equipmentControl.vue 11 KB

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