labPage.vue 8.5 KB

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