equipmentControl.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <!-- 数据看板-设备管控 -->
  2. <template>
  3. <view class="equipmentControl">
  4. <view class="statistics">
  5. <view class="statistics-b">
  6. <view class="statistics-b-li">
  7. <view class="statistics-b-li-t color-A">99</view>
  8. <view class="statistics-b-li-b">设备总数</view>
  9. </view>
  10. <view class="line"></view>
  11. <view class="statistics-b-li">
  12. <view class="statistics-b-li-t color-B">16</view>
  13. <view class="statistics-b-li-b">今日新增设备</view>
  14. </view>
  15. <view class="line"></view>
  16. <view class="statistics-b-li">
  17. <view class="statistics-b-li-t color-C">33</view>
  18. <view class="statistics-b-li-b">超期服役设备</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="small-title">
  23. <view class="small-title-l">超期服役排行TOP5</view>
  24. <img class="small-title-r" @click="goPage('overdue')" src="@/pages/images/icon_wdwg_gd.png">
  25. </view>
  26. <view class="chart">
  27. <view class="chart-b">
  28. <qiun-data-charts type="bar" :opts="opts" :echartsH5="true" :chartData="chartData" />
  29. </view>
  30. </view>
  31. <view class="small-title">
  32. <view class="small-title-l">设备使用寿命</view>
  33. <img class="small-title-r" @click="goPage('life')" src="@/pages/images/icon_wdwg_gd.png">
  34. </view>
  35. <view class="chart-tow">
  36. <view class="chart-tow-b">
  37. <qiun-data-charts type="funnel" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
  38. </view>
  39. </view>
  40. <view class="small-title">
  41. <view class="small-title-l">特种设备与常规冷热设备安全隐患统计</view>
  42. </view>
  43. <view class="small-title-tow">
  44. <view class="small-title-tow-l">安全检查校级巡查计划标题标题标题标题标题</view>
  45. <img class="small-title-tow-r" src="@/pages/images/dataBoard/icon_06.png">
  46. </view>
  47. <view class="chart-three">
  48. <view class="chart-three-b">
  49. <qiun-data-charts type="pie" :opts="optsThree" :echartsH5="true" :chartData="chartDataThree" />
  50. </view>
  51. </view>
  52. <view class="chart-title">
  53. <view class="chart-title-l">安全指标</view>
  54. <view class="chart-title-r">占比</view>
  55. </view>
  56. <view class="list" v-for="(item,index) in dataList" :key="index">
  57. <view class="list-title">
  58. <view class="list-title-l">{{item.data1}}</view>
  59. <view class="list-title-r">{{item.data2}}</view>
  60. </view>
  61. <view class="list-li" v-for="(item2,index2) in item.child" :key="index2">{{item2.name}}</view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import {
  67. config
  68. } from '@/api/request/config.js'
  69. import {
  70. } from '@/pages_basics/api/index.js'
  71. export default {
  72. name: "equipmentControl",
  73. components: {
  74. },
  75. data() {
  76. return {
  77. opts: {
  78. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  79. "#ea7ccc"
  80. ],
  81. padding: [15, 30, 0, 5],
  82. enableScroll: false,
  83. legend: {
  84. show: false,
  85. },
  86. xAxis: {
  87. disabled: true,
  88. disableGrid: true,
  89. axisLine: false,
  90. },
  91. yAxis: {
  92. disabled: false,
  93. disableGrid: true,
  94. data: [],
  95. },
  96. extra: {
  97. bar: {
  98. type: "group",
  99. width: 20,
  100. meterBorde: 1,
  101. meterFillColor: "#FFFFFF",
  102. activeBgColor: "#000000",
  103. activeBgOpacity: 0.08,
  104. linearType: "custom",
  105. barBorderCircle: true,
  106. seriesGap: 2,
  107. categoryGap: 2
  108. }
  109. }
  110. },
  111. chartData: {},
  112. optsTow: {
  113. color: ["#0183FA", "#38F0F0", "#2CCA73", "#FC6E21", "#FF4646", ],
  114. legend: {
  115. show: false,
  116. },
  117. padding: [15, 15, 10, 15],
  118. enableScroll: false,
  119. extra: {
  120. funnel: {
  121. type: 'triangle',
  122. border: false,
  123. labelAlign: "right",
  124. }
  125. }
  126. },
  127. chartDataTow: {},
  128. optsThree: {
  129. color: ["#10C139", "#FF8400", "#00FFE6", "#0183FA", "#73C0DE", "#3CA272",],
  130. legend: {
  131. show: false,
  132. },
  133. padding: [5, 5, 5, 5],
  134. enableScroll: false,
  135. extra: {
  136. pie: {
  137. offsetAngle: 0,
  138. labelWidth: 15,
  139. border: true,
  140. borderWidth: 3,
  141. borderColor: "#3E414F",
  142. }
  143. }
  144. },
  145. chartDataThree: {},
  146. // 查询参数
  147. queryParams: {
  148. page: 1,
  149. pageSize: 10,
  150. },
  151. dataList: [{
  152. data1: '13.4加热及制冷装置管理',
  153. data2: '40%',
  154. child: [{
  155. name: '13.4.1 冰箱、烘箱、马弗炉等周围堆放杂物',
  156. },
  157. {
  158. name: '13.4.3 烘箱叠放',
  159. },
  160. ]
  161. },
  162. {
  163. data1: '13.4加热及制冷装置管理',
  164. data2: '40%',
  165. child: [{
  166. name: '13.4.1 冰箱、烘箱、马弗炉等周围堆放杂物',
  167. },
  168. {
  169. name: '13.4.3 烘箱叠放',
  170. },
  171. ]
  172. },
  173. ],
  174. total: 0,
  175. }
  176. },
  177. created() {
  178. },
  179. beforeMount() {
  180. },
  181. mounted() {
  182. this.getServerData();
  183. this.getServerDataTow();
  184. this.getServerDataThree();
  185. },
  186. methods: {
  187. getServerData() {
  188. //模拟从服务器获取数据时的延时
  189. setTimeout(() => {
  190. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  191. let res = {
  192. categories: ["化学与药学院", "化学与药学院", "化学与药学院", "化学与药学院", "化学与药学院"],
  193. series: [{
  194. name: "目标值",
  195. textColor: '#fff',
  196. data: [35, 36, 31, 33, 13]
  197. }, ]
  198. };
  199. this.chartData = JSON.parse(JSON.stringify(res));
  200. }, 500);
  201. },
  202. getServerDataTow() {
  203. //模拟从服务器获取数据时的延时
  204. setTimeout(() => {
  205. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  206. let res = {
  207. series: [{
  208. data: [{
  209. "name": "一班",
  210. "value": 50
  211. }, {
  212. "name": "二班",
  213. "value": 40,
  214. }, {
  215. "name": "三班",
  216. "value": 30,
  217. }, {
  218. "name": "四班",
  219. "value": 20,
  220. }, {
  221. "name": "五班",
  222. "value": 10,
  223. }]
  224. }]
  225. };
  226. this.chartDataTow = JSON.parse(JSON.stringify(res));
  227. }, 500);
  228. },
  229. getServerDataThree() {
  230. //模拟从服务器获取数据时的延时
  231. setTimeout(() => {
  232. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  233. let res = {
  234. series: [{
  235. data: [{
  236. "name": "一班",
  237. "value": 50
  238. }, {
  239. "name": "二班",
  240. "value": 30
  241. }, {
  242. "name": "三班",
  243. "value": 20
  244. }, {
  245. "name": "四班",
  246. "value": 18
  247. }, {
  248. "name": "五班",
  249. "value": 8
  250. }]
  251. }]
  252. };
  253. this.chartDataThree = JSON.parse(JSON.stringify(res));
  254. }, 500);
  255. },
  256. dateClick(index) {
  257. this.dateIndex = index;
  258. },
  259. goPage(type) {
  260. if (type == 'overdue') {
  261. uni.navigateTo({
  262. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=1'
  263. });
  264. } else if (type == 'life') {
  265. uni.navigateTo({
  266. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=2'
  267. });
  268. }
  269. },
  270. },
  271. }
  272. </script>
  273. <style lang="stylus" scoped>
  274. .equipmentControl {
  275. height: 100%;
  276. width: 100%;
  277. background: #363744;
  278. padding: 2rpx 0rpx 0;
  279. box-sizing: border-box;
  280. .statistics {
  281. width: 750rpx;
  282. height: 120rpx;
  283. background: #3E414F;
  284. .statistics-b {
  285. display: flex;
  286. justify-content: space-between;
  287. align-items: center;
  288. .statistics-b-li {
  289. flex: 1;
  290. text-align: center;
  291. .statistics-b-li-t {
  292. font-weight: 400;
  293. font-size: 36rpx;
  294. line-height: 50rpx;
  295. margin-top: 10rpx;
  296. }
  297. .statistics-b-li-b {
  298. font-weight: 400;
  299. font-size: 24rpx;
  300. color: #FFFFFF;
  301. line-height: 34rpx;
  302. margin-top: 9rpx;
  303. }
  304. }
  305. .line {
  306. width: 2rpx;
  307. height: 30rpx;
  308. background: #D8D8D8;
  309. }
  310. .color-A {
  311. color: #0183FA;
  312. }
  313. .color-B {
  314. color: #FF0000;
  315. }
  316. .color-C {
  317. color: #FFAA00;
  318. }
  319. }
  320. }
  321. .small-title {
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: center;
  325. margin: 0 30rpx;
  326. .small-title-l {
  327. font-weight: 400;
  328. font-size: 32rpx;
  329. color: #FFFFFF;
  330. line-height: 45rpx;
  331. text-align: left;
  332. margin: 28rpx 0;
  333. }
  334. .small-title-r {
  335. width: 15rpx;
  336. height: 18rpx;
  337. }
  338. }
  339. .chart {
  340. width: 690rpx;
  341. height: 476rpx;
  342. background: #3E414F;
  343. border-radius: 20rpx 20rpx 20rpx 20rpx;
  344. margin: 0 30rpx;
  345. .chart-b {
  346. width: 690rpx;
  347. height: 476rpx;
  348. }
  349. }
  350. .chart-tow {
  351. width: 690rpx;
  352. height: 436rpx;
  353. background: #3E414F;
  354. border-radius: 20rpx 20rpx 20rpx 20rpx;
  355. margin: 0 30rpx;
  356. .chart-tow-b {
  357. width: 690rpx;
  358. height: 436rpx;
  359. }
  360. }
  361. .small-title-tow {
  362. width: 750rpx;
  363. height: 80rpx;
  364. background: #3E414F;
  365. display: flex;
  366. justify-content: space-between;
  367. align-items: center;
  368. padding: 0 20rpx 0 30rpx;
  369. box-sizing: border-box;
  370. margin-top: 2rpx;
  371. .small-title-tow-l {
  372. flex: 1;
  373. font-weight: 400;
  374. font-size: 30rpx;
  375. color: #FFFFFF;
  376. line-height: 42rpx;
  377. overflow: hidden;
  378. text-overflow: ellipsis;
  379. white-space: nowrap;
  380. }
  381. .small-title-tow-r {
  382. width: 14rpx;
  383. height: 8rpx;
  384. }
  385. }
  386. .chart-three {
  387. width: 690rpx;
  388. height: 394rpx;
  389. background: #3E414F;
  390. border-radius: 20rpx 20rpx 0rpx 0rpx;
  391. margin: 34rpx 30rpx 0;
  392. .chart-three-b {
  393. width: 690rpx;
  394. height: 394rpx;
  395. }
  396. }
  397. .chart-title {
  398. width: 689rpx;
  399. height: 80rpx;
  400. background: rgba(162, 162, 162, 0.2);
  401. border-radius: 0rpx 0rpx 0rpx 0rpx;
  402. padding: 0 70rpx 0 38rpx;
  403. box-sizing: border-box;
  404. margin: 0 30rpx;
  405. display: flex;
  406. justify-content: space-between;
  407. .chart-title-l {
  408. font-weight: 400;
  409. font-size: 30rpx;
  410. color: #FFFFFF;
  411. line-height: 80rpx;
  412. }
  413. .chart-title-r {
  414. font-weight: 400;
  415. font-size: 30rpx;
  416. color: #FFFFFF;
  417. line-height: 80rpx;
  418. }
  419. }
  420. .list {
  421. margin: 0 30rpx;
  422. padding: 0 30rpx;
  423. box-sizing: border-box;
  424. .list-title {
  425. height: 80rpx;
  426. display: flex;
  427. justify-content: space-between;
  428. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  429. padding: 0 38rpx 0 10rpx;
  430. box-sizing: border-box;
  431. .list-title-l {
  432. font-weight: 400;
  433. font-size: 28rpx;
  434. color: #FFFFFF;
  435. line-height: 80rpx;
  436. }
  437. .list-title-r {
  438. font-weight: 400;
  439. font-size: 28rpx;
  440. color: #0183FA;
  441. line-height: 80rpx;
  442. }
  443. }
  444. .list-li {
  445. height: 80rpx;
  446. display: flex;
  447. justify-content: space-between;
  448. padding: 0 38rpx 0 10rpx;
  449. box-sizing: border-box;
  450. font-weight: 400;
  451. font-size: 28rpx;
  452. color: #999999;
  453. line-height: 80rpx;
  454. text-align: left;
  455. }
  456. }
  457. }
  458. </style>