equipmentControl.vue 12 KB

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