dataBoard.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <!-- 数据看板-首页 -->
  2. <template>
  3. <view class="dataBoard">
  4. <nav-bar :title="title" style="position: absolute; z-index: 1000;"></nav-bar>
  5. <view class="header">
  6. <img class="header-bg" src="@/pages/images/dataBoard/dataBoard-icon1.png">
  7. <view class="header-t">
  8. <img class="header-t-l" :src="rectangleLogo">
  9. <view class="header-t-r" @click="outButton">管理面板</view>
  10. </view>
  11. <view class="header-b">
  12. <view class="header-b-li">
  13. <view class="header-b-li-t color-A">999</view>
  14. <view class="header-b-li-b">今日访问人数</view>
  15. </view>
  16. <view class="line"></view>
  17. <view class="header-b-li">
  18. <view class="header-b-li-t color-B">165</view>
  19. <view class="header-b-li-b">今日实验人数</view>
  20. </view>
  21. <view class="line"></view>
  22. <view class="header-b-li">
  23. <view class="header-b-li-t color-C">39</view>
  24. <view class="header-b-li-b">今日值日人数</view>
  25. </view>
  26. <view class="line"></view>
  27. <view class="header-b-li">
  28. <view class="header-b-li-t color-D">562</view>
  29. <view class="header-b-li-b">今日检查次数</view>
  30. </view>
  31. </view>
  32. </view>
  33. <scroll-view scroll-x @scrolltolower="scrollGet">
  34. <view class="tabTitle_tow">
  35. <view class="tabTitle_tow_li" @tap="tabClickTow(item,index)" :key="index"
  36. v-for="(item,index) in tabTextTow">
  37. <view :class="{on:curTabTow==index}" class="tabTitle_tow_text">{{item}}</view>
  38. <view :class="{on:curTabTow==index}" class="tabTitle_tow_across"></view>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. <lab-page v-if="pageType==1"></lab-page>
  43. <hazard-sources v-if="pageType==2"></hazard-sources>
  44. <hazardous-chemicals v-if="pageType==3"></hazardous-chemicals>
  45. <security-hidden v-if="pageType==4"></security-hidden>
  46. <warning-dispose v-if="pageType==5"></warning-dispose>
  47. <equipment-control v-if="pageType==6"></equipment-control>
  48. <da-yi-reservation v-if="pageType==7"></da-yi-reservation>
  49. <cage-position v-if="pageType==8"></cage-position>
  50. <resource-reservation v-if="pageType==9"></resource-reservation>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. navBar
  56. } from '@/pages/component/navbar.vue'
  57. import {labPage} from '@/pages/views/dataBoard/labPage.vue'
  58. import {hazardSources} from '@/pages/views/dataBoard/hazardSources.vue'
  59. import {hazardousChemicals} from '@/pages/views/dataBoard/hazardousChemicals.vue'
  60. import {securityHidden} from '@/pages/views/dataBoard/securityHidden.vue'
  61. import {warningDispose} from '@/pages/views/dataBoard/warningDispose.vue'
  62. import {equipmentControl} from '@/pages/views/dataBoard/equipmentControl.vue'
  63. import {daYiReservation} from '@/pages/views/dataBoard/daYiReservation.vue'
  64. import {cagePosition} from '@/pages/views/dataBoard/cagePosition.vue'
  65. import {resourceReservation} from '@/pages/views/dataBoard/resourceReservation.vue'
  66. import {
  67. config
  68. } from '@/api/request/config.js'
  69. import {
  70. } from '@/pages_basics/api/index.js'
  71. export default {
  72. name: "dataBoard",
  73. components: {
  74. navBar,
  75. labPage,
  76. hazardSources,
  77. hazardousChemicals,
  78. securityHidden,
  79. warningDispose,
  80. equipmentControl,
  81. daYiReservation,
  82. cagePosition,
  83. resourceReservation,
  84. },
  85. data() {
  86. return {
  87. pageType:4,
  88. rectangleLogo: uni.getStorageSync('rectangleLogo'),
  89. navHeight: uni.getStorageSync('navHeight'),
  90. title: '实验室安全智能监测与控制系统',
  91. baseUrl: config.base_url,
  92. // 查询参数
  93. queryParams: {
  94. page: 1,
  95. pageSize: 10,
  96. },
  97. dataList: [],
  98. total: 0,
  99. tabTextTow: ['实验室','危险源','危化品','安全隐患','预警处置','设备管控','大仪预约','笼位预约','资源预约'],
  100. curTabTow: 0,
  101. }
  102. },
  103. created() {
  104. },
  105. beforeMount() {
  106. },
  107. mounted() {},
  108. methods: {
  109. //返回按钮
  110. outButton(){
  111. this.$parent.goHome();
  112. },
  113. //滚动加载事件
  114. scrollGet() {
  115. if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
  116. this.$set(this, 'getDataType', true);
  117. } else {
  118. this.queryParams.page += 1;
  119. this.$nextTick(() => {
  120. this.getList();
  121. })
  122. }
  123. },
  124. //顶部tab点击
  125. tabClickTow(item, index) {
  126. this.curTabTow = index;
  127. this.pageType=index+1
  128. },
  129. async getList() {
  130. let self = this;
  131. let obj = JSON.parse(JSON.stringify(this.queryParams));
  132. const {
  133. data
  134. } = await laboratoryAppletPassOutList(obj);
  135. if (data.code == 200) {
  136. let list = [];
  137. if (this.queryParams.page != 1) {
  138. list = JSON.parse(JSON.stringify(this.dataList));
  139. }
  140. data.data.records.forEach((item) => {
  141. let num = 0;
  142. list.forEach((minItem) => {
  143. if (item.showInTime == minItem.showInTime) {
  144. num++
  145. minItem.list.push(item)
  146. }
  147. })
  148. if (num == 0) {
  149. list.push({
  150. showInTime: item.showInTime,
  151. list: [item]
  152. })
  153. }
  154. })
  155. this.$set(this, 'dataList', list);
  156. this.$set(this, 'total', data.data.total);
  157. if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
  158. this.$set(this, 'getDataType', true);
  159. }
  160. }
  161. },
  162. },
  163. }
  164. </script>
  165. <style lang="stylus" scoped>
  166. .dataBoard {
  167. height: 100%;
  168. width: 100%;
  169. background: #363744;
  170. .header {
  171. width: 750rpx;
  172. height: 476rpx;
  173. position: relative;
  174. .header-bg {
  175. width: 750rpx;
  176. height: 476rpx;
  177. position: absolute;
  178. left: 0;
  179. top: 0;
  180. z-index: 100;
  181. }
  182. .header-t {
  183. width: 100%;
  184. height: 50rpx;
  185. position: absolute;
  186. left: 0;
  187. top: 154rpx;
  188. z-index: 200;
  189. .header-t-l {
  190. width: 300rpx;
  191. height: 50rpx;
  192. position: absolute;
  193. left: 30rpx;
  194. top: 0;
  195. }
  196. .header-t-r {
  197. position: absolute;
  198. right: 0;
  199. top: 0;
  200. font-weight: 400;
  201. font-size: 28rpx;
  202. color: #FFFFFF;
  203. line-height: 50rpx;
  204. text-align: left;
  205. width: 160rpx;
  206. height: 50rpx;
  207. background: rgba(54, 55, 68, 0.6);
  208. padding-left: 24rpx;
  209. border-radius: 24rpx 0 0 24rpx;
  210. }
  211. }
  212. .header-b {
  213. position: absolute;
  214. left: 30rpx;
  215. top: 302rpx;
  216. z-index: 200;
  217. width: 689rpx;
  218. height: 150rpx;
  219. background: rgba(62, 65, 79, 0.4);
  220. border-radius: 20rpx 20rpx 20rpx 20rpx;
  221. display: flex;
  222. justify-content: space-between;
  223. align-items: center;
  224. .header-b-li {
  225. flex: 1;
  226. text-align: center;
  227. .header-b-li-t {
  228. font-weight: 400;
  229. font-size: 36rpx;
  230. line-height: 50rpx;
  231. margin-top: 32rpx;
  232. margin-bottom: 9rpx;
  233. }
  234. .header-b-li-b {
  235. font-weight: 400;
  236. font-size: 24rpx;
  237. color: #FFFFFF;
  238. line-height: 34rpx;
  239. }
  240. }
  241. .line {
  242. width: 2rpx;
  243. height: 30rpx;
  244. background: #D8D8D8;
  245. }
  246. .color-A {
  247. color: #0183FA;
  248. }
  249. .color-B {
  250. color: #2EA805;
  251. }
  252. .color-C {
  253. color: #00FFE5;
  254. }
  255. .color-D {
  256. color: #FF8C00;
  257. }
  258. }
  259. }
  260. .tabTitle_tow {
  261. height: 80rpx;
  262. white-space: nowrap;
  263. display: inline-flex;
  264. background: #3E414F;
  265. .tabTitle_tow_li {
  266. position: relative;
  267. width: 152rpx;
  268. height: 80rpx;
  269. text-align center;
  270. padding-top: 18rpx;
  271. box-sizing: border-box;
  272. .tabTitle_tow_text {
  273. display: inline-block;
  274. font-size: 32rpx;
  275. font-family: PingFang SC;
  276. font-weight: 500;
  277. color: #FFFFFF;
  278. line-height: 46rpx;
  279. position: relative;
  280. &.on {
  281. color: #0183FA;
  282. }
  283. }
  284. .tabTitle_tow_across {
  285. width: 50rpx;
  286. height: 4rpx;
  287. background: #0183FA;
  288. border-radius: 2rpx;
  289. margin-left: 33%;
  290. margin-top: 16rpx;
  291. display none;
  292. &.on {
  293. display block;
  294. }
  295. }
  296. }
  297. }
  298. }
  299. </style>