labPage.vue 8.1 KB

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