dataBoard.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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">786</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" class="pageFlex"></lab-page>
  43. <hazard-sources v-if="pageType==2" class="pageFlex"></hazard-sources>
  44. <hazardous-chemicals v-if="pageType==3" class="pageFlex"></hazardous-chemicals>
  45. <security-hidden v-if="pageType==4" class="pageFlex"></security-hidden>
  46. <warning-dispose v-if="pageType==5" class="pageFlex"></warning-dispose>
  47. <equipment-control v-if="pageType==6" class="pageFlex"></equipment-control>
  48. <da-yi-reservation v-if="pageType==7" class="pageFlex"></da-yi-reservation>
  49. <cage-position v-if="pageType==8" class="pageFlex"></cage-position>
  50. <resource-reservation v-if="pageType==9" class="pageFlex"></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: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. }
  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. .pageFlex{
  171. display: flex;
  172. }
  173. .header {
  174. width: 750rpx;
  175. height: 476rpx;
  176. position: relative;
  177. .header-bg {
  178. width: 750rpx;
  179. height: 476rpx;
  180. position: absolute;
  181. left: 0;
  182. top: 0;
  183. z-index: 100;
  184. }
  185. .header-t {
  186. width: 100%;
  187. position: absolute;
  188. left: 0;
  189. top: 164rpx;
  190. z-index: 200;
  191. .header-t-l {
  192. width: 400rpx;
  193. height: 88rpx;
  194. position: absolute;
  195. left: 0rpx;
  196. top: 0;
  197. }
  198. .header-t-r {
  199. position: absolute;
  200. right: 0;
  201. top: 20rpx;
  202. font-weight: 400;
  203. font-size: 28rpx;
  204. color: #FFFFFF;
  205. line-height: 50rpx;
  206. text-align: left;
  207. width: 160rpx;
  208. height: 50rpx;
  209. background: rgba(54, 55, 68, 0.6);
  210. padding-left: 24rpx;
  211. border-radius: 24rpx 0 0 24rpx;
  212. }
  213. }
  214. .header-b {
  215. position: absolute;
  216. left: 30rpx;
  217. top: 302rpx;
  218. z-index: 200;
  219. width: 689rpx;
  220. height: 150rpx;
  221. background: rgba(62, 65, 79, 0.4);
  222. border-radius: 20rpx 20rpx 20rpx 20rpx;
  223. display: flex;
  224. justify-content: space-between;
  225. align-items: center;
  226. .header-b-li {
  227. flex: 1;
  228. text-align: center;
  229. .header-b-li-t {
  230. font-weight: 400;
  231. font-size: 36rpx;
  232. line-height: 50rpx;
  233. margin-top: 32rpx;
  234. margin-bottom: 9rpx;
  235. }
  236. .header-b-li-b {
  237. font-weight: 400;
  238. font-size: 24rpx;
  239. color: #FFFFFF;
  240. line-height: 34rpx;
  241. }
  242. }
  243. .line {
  244. width: 2rpx;
  245. height: 30rpx;
  246. background: #D8D8D8;
  247. }
  248. .color-A {
  249. color: #0183FA;
  250. }
  251. .color-B {
  252. color: #2EA805;
  253. }
  254. .color-C {
  255. color: #00FFE5;
  256. }
  257. .color-D {
  258. color: #FF8C00;
  259. }
  260. }
  261. }
  262. .tabTitle_tow {
  263. height: 80rpx;
  264. white-space: nowrap;
  265. display: inline-flex;
  266. background: #3E414F;
  267. .tabTitle_tow_li {
  268. position: relative;
  269. width: 152rpx;
  270. height: 80rpx;
  271. text-align center;
  272. padding-top: 18rpx;
  273. box-sizing: border-box;
  274. .tabTitle_tow_text {
  275. display: inline-block;
  276. font-size: 32rpx;
  277. font-family: PingFang SC;
  278. font-weight: 500;
  279. color: #FFFFFF;
  280. line-height: 46rpx;
  281. position: relative;
  282. &.on {
  283. color: #0183FA;
  284. }
  285. }
  286. .tabTitle_tow_across {
  287. width: 50rpx;
  288. height: 4rpx;
  289. background: #0183FA;
  290. border-radius: 2rpx;
  291. margin-left: 33%;
  292. margin-top: 16rpx;
  293. display none;
  294. &.on {
  295. display block;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. </style>