dataBoard.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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 navBar from '@/pages/component/navbar.vue'
  56. import labPage from '@/pages/views/dataBoard/labPage.vue'
  57. import hazardSources from '@/pages/views/dataBoard/hazardSources.vue'
  58. import hazardousChemicals from '@/pages/views/dataBoard/hazardousChemicals.vue'
  59. import securityHidden from '@/pages/views/dataBoard/securityHidden.vue'
  60. import warningDispose from '@/pages/views/dataBoard/warningDispose.vue'
  61. import equipmentControl from '@/pages/views/dataBoard/equipmentControl.vue'
  62. import daYiReservation from '@/pages/views/dataBoard/daYiReservation.vue'
  63. import cagePosition from '@/pages/views/dataBoard/cagePosition.vue'
  64. import resourceReservation from '@/pages/views/dataBoard/resourceReservation.vue'
  65. import {
  66. config
  67. } from '@/api/request/config.js'
  68. import {
  69. reportAppStatisticsCountStatistics
  70. } from '@/pages/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: 1,
  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. getDataType: false,
  102. visitorCount:0,
  103. labOccupancyCount:0,
  104. dutyCount:0,
  105. checkCount:0,
  106. dataList:null,
  107. }
  108. },
  109. created() {
  110. },
  111. beforeMount() {
  112. },
  113. mounted() {
  114. this.reportAppStatisticsCountStatistics();
  115. },
  116. methods: {
  117. //返回按钮
  118. outButton() {
  119. this.$parent.goHome();
  120. },
  121. //滚动加载事件
  122. scrollGet() {
  123. },
  124. //顶部tab点击
  125. tabClickTow(item, index) {
  126. this.curTabTow = index;
  127. this.pageType = index + 1
  128. },
  129. //人员统计
  130. async reportAppStatisticsCountStatistics() {
  131. let self = this;
  132. const {
  133. data
  134. } = await reportAppStatisticsCountStatistics();
  135. if (data.code == 200) {
  136. this.$set(self, 'visitorCount', data.data.visitorCount);
  137. this.$set(self, 'labOccupancyCount', data.data.labOccupancyCount);
  138. this.$set(self, 'dutyCount', data.data.dutyCount);
  139. this.$set(self, 'checkCount', data.data.checkCount);
  140. }
  141. },
  142. async getList() {
  143. let self = this;
  144. const {
  145. data
  146. } = await reportAppStatisticsPersonDeviceSafety();
  147. if (data.code == 200) {
  148. this.dataList = data.data;
  149. }
  150. },
  151. },
  152. }
  153. </script>
  154. <style lang="stylus" scoped>
  155. .dataBoard {
  156. display: flex;
  157. flex-direction: column;
  158. flex:1;
  159. // height: 100%;
  160. // width: 100%;
  161. background: #363744;
  162. .pageFlex {
  163. display: flex;
  164. }
  165. .header {
  166. width: 750rpx;
  167. height: 476rpx;
  168. position: relative;
  169. .header-bg {
  170. width: 750rpx;
  171. height: 476rpx;
  172. position: absolute;
  173. left: 0;
  174. top: 0;
  175. z-index: 100;
  176. }
  177. .header-t {
  178. width: 100%;
  179. position: absolute;
  180. left: 0;
  181. top: 164rpx;
  182. z-index: 200;
  183. .header-t-l {
  184. width: 400rpx;
  185. height: 88rpx;
  186. position: absolute;
  187. left: 0rpx;
  188. top: 0;
  189. }
  190. .header-t-r {
  191. width: 130rpx;
  192. height: 109rpx;
  193. position: fixed;
  194. right: 0;
  195. top: 180rpx;
  196. /* position: absolute;
  197. right: 0;
  198. top: 20rpx;
  199. font-weight: 400;
  200. font-size: 28rpx;
  201. color: #FFFFFF;
  202. line-height: 50rpx;
  203. text-align: left;
  204. width: 160rpx;
  205. height: 50rpx;
  206. background: rgba(54, 55, 68, 0.6);
  207. padding-left: 24rpx;
  208. border-radius: 24rpx 0 0 24rpx; */
  209. }
  210. }
  211. .header-b {
  212. position: absolute;
  213. left: 30rpx;
  214. top: 302rpx;
  215. z-index: 200;
  216. width: 689rpx;
  217. height: 150rpx;
  218. background: rgba(62, 65, 79, 0.4);
  219. border-radius: 20rpx 20rpx 20rpx 20rpx;
  220. display: flex;
  221. justify-content: space-between;
  222. align-items: center;
  223. .header-b-li {
  224. flex: 1;
  225. text-align: center;
  226. .header-b-li-t {
  227. font-weight: 400;
  228. font-size: 36rpx;
  229. line-height: 50rpx;
  230. margin-top: 32rpx;
  231. margin-bottom: 9rpx;
  232. }
  233. .header-b-li-b {
  234. font-weight: 400;
  235. font-size: 24rpx;
  236. color: #FFFFFF;
  237. line-height: 34rpx;
  238. }
  239. }
  240. .line {
  241. width: 2rpx;
  242. height: 30rpx;
  243. background: #D8D8D8;
  244. }
  245. .color-A {
  246. color: #0183FA;
  247. }
  248. .color-B {
  249. color: #2EA805;
  250. }
  251. .color-C {
  252. color: #00FFE5;
  253. }
  254. .color-D {
  255. color: #FF8C00;
  256. }
  257. }
  258. }
  259. .tabTitle_tow {
  260. height: 80rpx;
  261. white-space: nowrap;
  262. display: inline-flex;
  263. background: #3E414F;
  264. .tabTitle_tow_li {
  265. position: relative;
  266. width: 152rpx;
  267. height: 80rpx;
  268. text-align center;
  269. padding-top: 18rpx;
  270. box-sizing: border-box;
  271. .tabTitle_tow_text {
  272. display: inline-block;
  273. font-size: 32rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #FFFFFF;
  277. line-height: 46rpx;
  278. position: relative;
  279. &.on {
  280. color: #0183FA;
  281. }
  282. }
  283. .tabTitle_tow_across {
  284. width: 50rpx;
  285. height: 4rpx;
  286. background: #0183FA;
  287. border-radius: 2rpx;
  288. margin:6rpx auto 0;
  289. display none;
  290. &.on {
  291. display block;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. </style>