dataBoard.vue 7.8 KB

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