dataBoard.vue 7.9 KB

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