dataBoard.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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">管理面板</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. rectangleLogo: uni.getStorageSync('rectangleLogo'),
  88. pageType:1,
  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. scrollGet() {
  111. if (this.total / this.queryParams.pageSize <= this.queryParams.page) {
  112. this.$set(this, 'getDataType', true);
  113. } else {
  114. this.queryParams.page += 1;
  115. this.$nextTick(() => {
  116. this.getList();
  117. })
  118. }
  119. },
  120. //顶部tab点击
  121. tabClickTow(item, index) {
  122. this.curTabTow = index;
  123. this.pageType=index+1
  124. },
  125. async getList() {
  126. let self = this;
  127. let obj = JSON.parse(JSON.stringify(this.queryParams));
  128. const {
  129. data
  130. } = await laboratoryAppletPassOutList(obj);
  131. if (data.code == 200) {
  132. let list = [];
  133. if (this.queryParams.page != 1) {
  134. list = JSON.parse(JSON.stringify(this.dataList));
  135. }
  136. data.data.records.forEach((item) => {
  137. let num = 0;
  138. list.forEach((minItem) => {
  139. if (item.showInTime == minItem.showInTime) {
  140. num++
  141. minItem.list.push(item)
  142. }
  143. })
  144. if (num == 0) {
  145. list.push({
  146. showInTime: item.showInTime,
  147. list: [item]
  148. })
  149. }
  150. })
  151. this.$set(this, 'dataList', list);
  152. this.$set(this, 'total', data.data.total);
  153. if (data.data.total / this.queryParams.pageSize <= this.queryParams.page) {
  154. this.$set(this, 'getDataType', true);
  155. }
  156. }
  157. },
  158. },
  159. }
  160. </script>
  161. <style lang="stylus" scoped>
  162. .dataBoard {
  163. height: 100%;
  164. width: 100%;
  165. background: #363744;
  166. .header {
  167. width: 750rpx;
  168. height: 476rpx;
  169. position: relative;
  170. .header-bg {
  171. width: 750rpx;
  172. height: 476rpx;
  173. position: absolute;
  174. left: 0;
  175. top: 0;
  176. z-index: 100;
  177. }
  178. .header-t {
  179. width: 100%;
  180. height: 50rpx;
  181. position: absolute;
  182. left: 0;
  183. top: 154rpx;
  184. z-index: 200;
  185. .header-t-l {
  186. width: 300rpx;
  187. height: 50rpx;
  188. position: absolute;
  189. left: 30rpx;
  190. top: 0;
  191. }
  192. .header-t-r {
  193. position: absolute;
  194. right: 0;
  195. top: 0;
  196. font-weight: 400;
  197. font-size: 28rpx;
  198. color: #FFFFFF;
  199. line-height: 50rpx;
  200. text-align: left;
  201. width: 160rpx;
  202. height: 50rpx;
  203. background: rgba(54, 55, 68, 0.6);
  204. padding-left: 24rpx;
  205. border-radius: 24rpx 0 0 24rpx;
  206. }
  207. }
  208. .header-b {
  209. position: absolute;
  210. left: 30rpx;
  211. top: 302rpx;
  212. z-index: 200;
  213. width: 689rpx;
  214. height: 150rpx;
  215. background: rgba(62, 65, 79, 0.4);
  216. border-radius: 20rpx 20rpx 20rpx 20rpx;
  217. display: flex;
  218. justify-content: space-between;
  219. align-items: center;
  220. .header-b-li {
  221. flex: 1;
  222. text-align: center;
  223. .header-b-li-t {
  224. font-weight: 400;
  225. font-size: 36rpx;
  226. line-height: 50rpx;
  227. margin-top: 32rpx;
  228. margin-bottom: 9rpx;
  229. }
  230. .header-b-li-b {
  231. font-weight: 400;
  232. font-size: 24rpx;
  233. color: #FFFFFF;
  234. line-height: 34rpx;
  235. }
  236. }
  237. .line {
  238. width: 2rpx;
  239. height: 30rpx;
  240. background: #D8D8D8;
  241. }
  242. .color-A {
  243. color: #0183FA;
  244. }
  245. .color-B {
  246. color: #2EA805;
  247. }
  248. .color-C {
  249. color: #00FFE5;
  250. }
  251. .color-D {
  252. color: #FF8C00;
  253. }
  254. }
  255. }
  256. .tabTitle_tow {
  257. height: 80rpx;
  258. white-space: nowrap;
  259. display: inline-flex;
  260. background: #3E414F;
  261. .tabTitle_tow_li {
  262. position: relative;
  263. width: 152rpx;
  264. height: 80rpx;
  265. text-align center;
  266. padding-top: 18rpx;
  267. box-sizing: border-box;
  268. .tabTitle_tow_text {
  269. display: inline-block;
  270. font-size: 32rpx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #FFFFFF;
  274. line-height: 46rpx;
  275. position: relative;
  276. &.on {
  277. color: #0183FA;
  278. }
  279. }
  280. .tabTitle_tow_across {
  281. width: 50rpx;
  282. height: 4rpx;
  283. background: #0183FA;
  284. border-radius: 2rpx;
  285. margin-left: 33%;
  286. margin-top: 16rpx;
  287. display none;
  288. &.on {
  289. display block;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. </style>