equipmentControl.vue 11 KB

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