labPage.vue 7.4 KB

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