labPage.vue 7.1 KB

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