equipmentControl.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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. reportAppletReportApiDeviceStatGetDeviceStat
  71. } from '@/pages/api/index.js'
  72. export default {
  73. name: "equipmentControl",
  74. components: {
  75. },
  76. data() {
  77. return {
  78. opts: {
  79. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  80. "#ea7ccc"
  81. ],
  82. padding: [15, 30, 0, 5],
  83. enableScroll: false,
  84. legend: {
  85. show: false,
  86. },
  87. xAxis: {
  88. disabled: true,
  89. disableGrid: true,
  90. axisLine: false,
  91. fontColor: '#fff',
  92. },
  93. yAxis: {
  94. disabled: false,
  95. disableGrid: true,
  96. data: [{
  97. type: 'categories',
  98. fontColor: '#fff',
  99. }],
  100. },
  101. extra: {
  102. bar: {
  103. type: "group",
  104. width: 12,
  105. meterBorde: 1,
  106. meterFillColor: "#FFFFFF",
  107. activeBgColor: "#000000",
  108. activeBgOpacity: 0.08,
  109. linearType: "custom",
  110. barBorderCircle: true,
  111. seriesGap: 2,
  112. categoryGap: 2
  113. }
  114. }
  115. },
  116. chartData: {},
  117. optsTow: {
  118. color: ["#0183FA", "#38F0F0", "#2CCA73", "#FC6E21", "#FF4646", ],
  119. legend: {
  120. show: false,
  121. },
  122. padding: [15, 95, 10, 0],
  123. enableScroll: false,
  124. extra: {
  125. funnel: {
  126. type: 'triangle',
  127. border: false,
  128. labelAlign: "right",
  129. }
  130. }
  131. },
  132. chartDataTow: {},
  133. optsThree: {
  134. color: ["#10C139", "#FF8400", "#00FFE6", "#0183FA", "#73C0DE", "#3CA272", ],
  135. legend: {
  136. show: false,
  137. },
  138. padding: [5, 5, 5, 5],
  139. enableScroll: false,
  140. extra: {
  141. pie: {
  142. offsetAngle: 0,
  143. labelWidth: 15,
  144. border: true,
  145. borderWidth: 3,
  146. borderColor: "#3E414F",
  147. }
  148. }
  149. },
  150. chartDataThree: {},
  151. // 查询参数
  152. queryParams: {
  153. page: 1,
  154. pageSize: 10,
  155. },
  156. dataList: [{
  157. data1: '13.4加热及制冷装置管理',
  158. data2: '40%',
  159. child: [{
  160. name: '13.4.1 冰箱、烘箱、马弗炉等周围堆放杂物',
  161. },
  162. {
  163. name: '13.4.3 烘箱叠放',
  164. },
  165. ]
  166. },
  167. {
  168. data1: '13.4加热及制冷装置管理',
  169. data2: '40%',
  170. child: [{
  171. name: '13.4.1 冰箱、烘箱、马弗炉等周围堆放杂物',
  172. },
  173. {
  174. name: '13.4.3 烘箱叠放',
  175. },
  176. ]
  177. },
  178. ],
  179. total: 0,
  180. }
  181. },
  182. created() {
  183. },
  184. beforeMount() {
  185. },
  186. mounted() {
  187. this.reportAppletReportApiDeviceStatGetDeviceStat();
  188. this.getServerData();
  189. this.getServerDataTow();
  190. this.getServerDataThree();
  191. },
  192. methods: {
  193. async reportAppletReportApiDeviceStatGetDeviceStat() {
  194. let self = this;
  195. const {
  196. data
  197. } = await reportAppletReportApiDeviceStatGetDeviceStat();
  198. if (data.code == 200) {
  199. /* this.dataList = data.data.warningList;
  200. this.$set(self, 'todayTotal', data.data.warning.todayTotal);
  201. this.$set(self, 'yesterdayTotal', data.data.warning.yesterdayTotal);
  202. this.$set(self, 'rate', data.data.warning.rate);
  203. */
  204. }
  205. },
  206. getServerData() {
  207. //模拟从服务器获取数据时的延时
  208. setTimeout(() => {
  209. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  210. let res = {
  211. categories: ["植物保护", "园林艺术", "生命科学", "理学院", "农学院"],
  212. series: [{
  213. name: "目标值",
  214. textColor: '#fff',
  215. data: [62, 37, 20, 41, 32]
  216. }, ]
  217. };
  218. this.chartData = JSON.parse(JSON.stringify(res));
  219. }, 500);
  220. },
  221. getServerDataTow() {
  222. //模拟从服务器获取数据时的延时
  223. setTimeout(() => {
  224. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  225. let res = {
  226. series: [{
  227. data: [{
  228. "name": "5年内",
  229. "value": 147,
  230. "labelText": "5年内 147台 26%",
  231. "textColor": "#fff",
  232. }, {
  233. "name": "10年内",
  234. "value": 136,
  235. "labelText": "10年内 136台 24%",
  236. "textColor": "#fff",
  237. }, {
  238. "name": "12年内",
  239. "value": 124,
  240. "labelText": "12年内 124台 22%",
  241. "textColor": "#fff",
  242. }, {
  243. "name": "20年内",
  244. "value": 96,
  245. "labelText": "20年内 96台 17%",
  246. "textColor": "#fff",
  247. }, {
  248. "name": "超期服役",
  249. "value": 67,
  250. "labelText": "超期服役 67台 11%",
  251. "textColor": "#fff",
  252. }]
  253. }]
  254. };
  255. this.chartDataTow = JSON.parse(JSON.stringify(res));
  256. }, 500);
  257. },
  258. getServerDataThree() {
  259. //模拟从服务器获取数据时的延时
  260. setTimeout(() => {
  261. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  262. let res = {
  263. series: [{
  264. data: [{
  265. "name": "13.2压力容器30%",
  266. "value": 50,
  267. "textColor": "#fff",
  268. }, {
  269. "name": "13.1起重类设备10%",
  270. "value": 30,
  271. "textColor": "#fff",
  272. }, {
  273. "name": "13.4加热及制冷装置管理40%",
  274. "value": 20,
  275. "textColor": "#fff",
  276. }, {
  277. "name": "13.3场(厂)内专用机动车辆20%",
  278. "value": 18,
  279. "textColor": "#fff",
  280. }]
  281. }]
  282. };
  283. this.chartDataThree = JSON.parse(JSON.stringify(res));
  284. }, 500);
  285. },
  286. dateClick(index) {
  287. this.dateIndex = index;
  288. },
  289. goPage(type) {
  290. if (type == 'overdue') {
  291. uni.navigateTo({
  292. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=1'
  293. });
  294. } else if (type == 'life') {
  295. uni.navigateTo({
  296. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=2'
  297. });
  298. }
  299. },
  300. },
  301. }
  302. </script>
  303. <style lang="stylus" scoped>
  304. .equipmentControl {
  305. height: 100%;
  306. width: 100%;
  307. background: #363744;
  308. padding: 2rpx 0rpx 0;
  309. box-sizing: border-box;
  310. .statistics {
  311. width: 750rpx;
  312. height: 120rpx;
  313. background: #3E414F;
  314. .statistics-b {
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. .statistics-b-li {
  319. flex: 1;
  320. text-align: center;
  321. .statistics-b-li-t {
  322. font-weight: 400;
  323. font-size: 36rpx;
  324. line-height: 50rpx;
  325. margin-top: 10rpx;
  326. }
  327. .statistics-b-li-b {
  328. font-weight: 400;
  329. font-size: 24rpx;
  330. color: #FFFFFF;
  331. line-height: 34rpx;
  332. margin-top: 9rpx;
  333. }
  334. }
  335. .line {
  336. width: 2rpx;
  337. height: 30rpx;
  338. background: #D8D8D8;
  339. }
  340. .color-A {
  341. color: #0183FA;
  342. }
  343. .color-B {
  344. color: #FF0000;
  345. }
  346. .color-C {
  347. color: #FFAA00;
  348. }
  349. }
  350. }
  351. .small-title {
  352. display: flex;
  353. justify-content: space-between;
  354. align-items: center;
  355. margin: 0 30rpx;
  356. .small-title-l {
  357. font-weight: 400;
  358. font-size: 32rpx;
  359. color: #FFFFFF;
  360. line-height: 45rpx;
  361. text-align: left;
  362. margin: 28rpx 0;
  363. }
  364. .small-title-r {
  365. width: 15rpx;
  366. height: 18rpx;
  367. }
  368. }
  369. .chart {
  370. width: 690rpx;
  371. height: 476rpx;
  372. background: #3E414F;
  373. border-radius: 20rpx 20rpx 20rpx 20rpx;
  374. margin: 0 30rpx;
  375. .chart-b {
  376. width: 690rpx;
  377. height: 476rpx;
  378. }
  379. }
  380. .chart-tow {
  381. width: 690rpx;
  382. height: 436rpx;
  383. background: #3E414F;
  384. border-radius: 20rpx 20rpx 20rpx 20rpx;
  385. margin: 0 30rpx;
  386. .chart-tow-b {
  387. width: 690rpx;
  388. height: 436rpx;
  389. }
  390. }
  391. .small-title-tow {
  392. width: 750rpx;
  393. height: 80rpx;
  394. background: #3E414F;
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. padding: 0 20rpx 0 30rpx;
  399. box-sizing: border-box;
  400. margin-top: 2rpx;
  401. .small-title-tow-l {
  402. flex: 1;
  403. font-weight: 400;
  404. font-size: 30rpx;
  405. color: #FFFFFF;
  406. line-height: 42rpx;
  407. overflow: hidden;
  408. text-overflow: ellipsis;
  409. white-space: nowrap;
  410. }
  411. .small-title-tow-r {
  412. width: 14rpx;
  413. height: 8rpx;
  414. }
  415. }
  416. .chart-three {
  417. width: 690rpx;
  418. height: 394rpx;
  419. background: #3E414F;
  420. border-radius: 20rpx 20rpx 0rpx 0rpx;
  421. margin: 34rpx 30rpx 0;
  422. .chart-three-b {
  423. width: 690rpx;
  424. height: 394rpx;
  425. }
  426. }
  427. .chart-title {
  428. width: 689rpx;
  429. height: 80rpx;
  430. background: rgba(162, 162, 162, 0.2);
  431. border-radius: 0rpx 0rpx 0rpx 0rpx;
  432. padding: 0 70rpx 0 38rpx;
  433. box-sizing: border-box;
  434. margin: 0 30rpx;
  435. display: flex;
  436. justify-content: space-between;
  437. .chart-title-l {
  438. font-weight: 400;
  439. font-size: 30rpx;
  440. color: #FFFFFF;
  441. line-height: 80rpx;
  442. }
  443. .chart-title-r {
  444. font-weight: 400;
  445. font-size: 30rpx;
  446. color: #FFFFFF;
  447. line-height: 80rpx;
  448. }
  449. }
  450. .list {
  451. margin: 0 30rpx;
  452. padding: 0 30rpx;
  453. box-sizing: border-box;
  454. .list-title {
  455. height: 80rpx;
  456. display: flex;
  457. justify-content: space-between;
  458. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  459. padding: 0 38rpx 0 10rpx;
  460. box-sizing: border-box;
  461. .list-title-l {
  462. font-weight: 400;
  463. font-size: 28rpx;
  464. color: #FFFFFF;
  465. line-height: 80rpx;
  466. }
  467. .list-title-r {
  468. font-weight: 400;
  469. font-size: 28rpx;
  470. color: #0183FA;
  471. line-height: 80rpx;
  472. }
  473. }
  474. .list-li {
  475. height: 80rpx;
  476. display: flex;
  477. justify-content: space-between;
  478. padding: 0 38rpx 0 10rpx;
  479. box-sizing: border-box;
  480. font-weight: 400;
  481. font-size: 28rpx;
  482. color: #999999;
  483. line-height: 80rpx;
  484. text-align: left;
  485. }
  486. }
  487. }
  488. </style>