dataBoard.vue 6.1 KB

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