labPage.vue 8.5 KB

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