dataBoard.vue 6.9 KB

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