labPage.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <!-- 数据看板-首页 -->
  2. <template>
  3. <view class="labPage">
  4. <view class="chart">
  5. <view class="chart-t">
  6. <view class="chart-t-li" @click="dateClick(index)" :class="dateIndex==index?'color-A':'color-B'"
  7. v-for="(item,index) in dateList">
  8. <view class="chart-t-li-t">{{item.num}}</view>
  9. <view class="chart-t-li-b">{{item.letterNUm}}</view>
  10. </view>
  11. </view>
  12. <view class="chart-b">
  13. <qiun-data-charts type="line" :opts="opts" :echartsH5="true" :chartData="chartData" />
  14. </view>
  15. </view>
  16. <view class="statistics">
  17. <view class="statistics-t">
  18. <view class="statistics-t-l">实验室总数:</view>
  19. <view class="statistics-t-r">364 间</view>
  20. </view>
  21. <view class="statistics-b">
  22. <view class="statistics-b-li">
  23. <view class="statistics-b-li-t color-A">175 间</view>
  24. <view class="statistics-b-li-b">使用</view>
  25. </view>
  26. <view class="line"></view>
  27. <view class="statistics-b-li">
  28. <view class="statistics-b-li-t color-B">130 间</view>
  29. <view class="statistics-b-li-b">空闲</view>
  30. </view>
  31. <view class="line"></view>
  32. <view class="statistics-b-li">
  33. <view class="statistics-b-li-t color-C">19 间</view>
  34. <view class="statistics-b-li-b">异常</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="table">
  39. <uni-card>
  40. <view style="height: 200px">
  41. <zb-table :columns="column" :stripe="false" :border="false" :data="dataList"></zb-table>
  42. </view>
  43. </uni-card>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. config
  50. } from '@/api/request/config.js'
  51. import {
  52. } from '@/pages_basics/api/index.js'
  53. export default {
  54. name: "labPage",
  55. components: {
  56. },
  57. data() {
  58. return {
  59. dateList: [{
  60. num: '1',
  61. letterNUm: 'Mon',
  62. },
  63. {
  64. num: '2',
  65. letterNUm: 'Tue',
  66. },
  67. {
  68. num: '3',
  69. letterNUm: 'Wed',
  70. },
  71. {
  72. num: '4',
  73. letterNUm: 'Thur',
  74. },
  75. {
  76. num: '5',
  77. letterNUm: 'Fri',
  78. },
  79. {
  80. num: '6',
  81. letterNUm: 'Sat',
  82. },
  83. {
  84. num: '7',
  85. letterNUm: 'Sun',
  86. },
  87. ],
  88. dateIndex: 0,
  89. // 查询参数
  90. queryParams: {
  91. page: 1,
  92. pageSize: 10,
  93. },
  94. opts: {
  95. color: ["#0183FA", "#16BF32", "#FF8C00", "#FF0000", ],
  96. padding: [15, 0, 0, 0],
  97. enableScroll: false,
  98. dataLabel: false,
  99. dataPointShape: false,
  100. legend: {
  101. show: false,
  102. fontColor: '#fff',
  103. },
  104. extra: {
  105. tooltip: {
  106. legendShape: 'circle',
  107. },
  108. },
  109. xAxis: {
  110. disableGrid: true,
  111. fontColor: '#fff',
  112. },
  113. yAxis: {
  114. gridType: "dash",
  115. dashLength: 2,
  116. data: [{
  117. axisLine: false,
  118. fontColor: '#fff',
  119. }]
  120. },
  121. },
  122. chartData: {},
  123. column: [{
  124. name: 'data1',
  125. label: '学院单位',
  126. fixed: true,
  127. width: 80,
  128. align: 'center',
  129. },
  130. {
  131. name: 'data2',
  132. label: '实验人数',
  133. fixed: true,
  134. width: 80,
  135. align: 'center',
  136. },
  137. {
  138. name: 'data3',
  139. label: '值班人数',
  140. align: 'center',
  141. },
  142. {
  143. name: 'data4',
  144. label: '检查次数',
  145. align: 'center',
  146. },
  147. {
  148. name: 'data5',
  149. label: '超期设备',
  150. align: 'center',
  151. },
  152. ],
  153. dataList: [{
  154. data1: '植物保护',
  155. data2: '499',
  156. data3: '47',
  157. data4: '220',
  158. data5: '137',
  159. },
  160. {
  161. data1: '资源环境',
  162. data2: '199',
  163. data3: '7',
  164. data4: '120',
  165. data5: '37',
  166. },
  167. {
  168. data1: '生命科学',
  169. data2: '299',
  170. data3: '71',
  171. data4: '10',
  172. data5: '37',
  173. },
  174. {
  175. data1: '资源环境',
  176. data2: '199',
  177. data3: '7',
  178. data4: '120',
  179. data5: '37',
  180. },
  181. {
  182. data1: '生命科学',
  183. data2: '299',
  184. data3: '71',
  185. data4: '10',
  186. data5: '37',
  187. },
  188. ],
  189. total: 0,
  190. }
  191. },
  192. created() {
  193. this.dateIndex = new Date().getDay() - 1;
  194. console.log(this.dateIndex)
  195. },
  196. beforeMount() {
  197. },
  198. mounted() {
  199. this.getServerData();
  200. },
  201. methods: {
  202. dateClick(index) {
  203. //this.dateIndex = index;
  204. },
  205. getServerData() {
  206. //模拟从服务器获取数据时的延时
  207. setTimeout(() => {
  208. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  209. let res = {
  210. categories: ["0:00", "6:00", "12:00", "18:00", "24:00"],
  211. series: [{
  212. name: "实验人数",
  213. data: [35, 8, 25, 37, 4, 20]
  214. },
  215. {
  216. name: "值日人数",
  217. data: [70, 40, 65, 100, 44, 68]
  218. },
  219. {
  220. name: "检查次数",
  221. data: [100, 80, 95, 150, 112, 132]
  222. },
  223. {
  224. name: "超期设备数",
  225. data: [30, 10, 25, 10, 82, 122]
  226. }
  227. ]
  228. };
  229. this.chartData = JSON.parse(JSON.stringify(res));
  230. }, 500);
  231. },
  232. },
  233. }
  234. </script>
  235. <style lang="stylus" scoped>
  236. .labPage {
  237. height: 100%;
  238. width: 100%;
  239. background: #363744;
  240. padding: 20rpx 30rpx 36rpx;
  241. box-sizing: border-box;
  242. .chart {
  243. width: 690rpx;
  244. height: 640rpx;
  245. background: #3E414F;
  246. border-radius: 20rpx 20rpx 20rpx 20rpx;
  247. padding: 34rpx 30rpx 26rpx;
  248. box-sizing: border-box;
  249. .chart-t {
  250. display: flex;
  251. justify-content: space-between;
  252. .chart-t-li {
  253. width: 76rpx;
  254. height: 100rpx;
  255. .chart-t-li-t {
  256. font-weight: 400;
  257. font-size: 30rpx;
  258. line-height: 42rpx;
  259. text-align: center;
  260. margin-top: 8rpx;
  261. }
  262. .chart-t-li-b {
  263. font-weight: 400;
  264. font-size: 28rpx;
  265. line-height: 39rpx;
  266. text-align: center;
  267. margin-top: 4rpx;
  268. }
  269. }
  270. .color-A {
  271. background: #0183FA;
  272. border-radius: 10rpx 10rpx 10rpx 10rpx;
  273. .chart-t-li-t {
  274. color: #FFFFFF;
  275. }
  276. .chart-t-li-b {
  277. color: #FFFFFF;
  278. }
  279. }
  280. .color-B {
  281. background: none;
  282. .chart-t-li-t {
  283. color: #FFFFFF;
  284. }
  285. .chart-t-li-b {
  286. color: #FFFFFF;
  287. }
  288. }
  289. }
  290. .chart-b {
  291. width: 632rpx;
  292. height: 444rpx;
  293. margin-top: 34rpx;
  294. }
  295. }
  296. .statistics {
  297. width: 690rpx;
  298. height: 241rpx;
  299. background: #3E414F;
  300. border-radius: 20rpx 20rpx 20rpx 20rpx;
  301. margin-top: 20rpx;
  302. .statistics-t {
  303. height: 100rpx;
  304. display: flex;
  305. justify-content: space-between;
  306. align-items: center;
  307. border-bottom: 1rpx solid #52545F;
  308. padding: 0 42rpx 0 38rpx;
  309. box-sizing: border-box;
  310. .statistics-t-l {
  311. font-weight: 400;
  312. font-size: 32rpx;
  313. color: #FFFFFF;
  314. line-height: 45rpx;
  315. }
  316. .statistics-t-r {
  317. font-weight: 400;
  318. font-size: 36rpx;
  319. color: #FFFFFF;
  320. line-height: 50rpx;
  321. }
  322. }
  323. .statistics-b {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. .statistics-b-li {
  328. flex: 1;
  329. text-align: center;
  330. .statistics-b-li-t {
  331. font-weight: 400;
  332. font-size: 36rpx;
  333. line-height: 50rpx;
  334. margin-top: 28rpx;
  335. }
  336. .statistics-b-li-b {
  337. font-weight: 400;
  338. font-size: 28rpx;
  339. color: #FFFFFF;
  340. line-height: 39rpx;
  341. margin-top: 9rpx;
  342. }
  343. }
  344. .line {
  345. width: 2rpx;
  346. height: 30rpx;
  347. background: #D8D8D8;
  348. }
  349. .color-A {
  350. color: #FF8C00;
  351. }
  352. .color-B {
  353. color: #26C736;
  354. }
  355. .color-C {
  356. color: #FF0000;
  357. }
  358. }
  359. }
  360. .table {
  361. width: 690rpx;
  362. margin-top: 20rpx;
  363. border-radius: 20rpx 20rpx 0 0;
  364. overflow: hidden;
  365. }
  366. }
  367. </style>