equipmentControl.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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, 95, 10, 0],
  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: [62, 37, 20, 41, 32]
  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": "5年内",
  210. "value": 147,
  211. "labelText":"5年内 147台 26%",
  212. }, {
  213. "name": "10年内",
  214. "value": 136,
  215. "labelText":"10年内 136台 24%",
  216. }, {
  217. "name": "12年内",
  218. "value": 124,
  219. "labelText":"12年内 124台 22%",
  220. }, {
  221. "name": "20年内",
  222. "value": 96,
  223. "labelText":"20年内 96台 17%",
  224. }, {
  225. "name": "超期服役",
  226. "value": 67,
  227. "labelText":"超期服役 67台 11%",
  228. }]
  229. }]
  230. };
  231. this.chartDataTow = JSON.parse(JSON.stringify(res));
  232. }, 500);
  233. },
  234. getServerDataThree() {
  235. //模拟从服务器获取数据时的延时
  236. setTimeout(() => {
  237. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  238. let res = {
  239. series: [{
  240. data: [{
  241. "name": "13.2压力容器30%",
  242. "value": 50
  243. }, {
  244. "name": "13.1起重类设备10%",
  245. "value": 30
  246. }, {
  247. "name": "13.4加热及制冷装置管理40%",
  248. "value": 20
  249. }, {
  250. "name": "13.3场(厂)内专用机动车辆20%",
  251. "value": 18
  252. }]
  253. }]
  254. };
  255. this.chartDataThree = JSON.parse(JSON.stringify(res));
  256. }, 500);
  257. },
  258. dateClick(index) {
  259. this.dateIndex = index;
  260. },
  261. goPage(type) {
  262. if (type == 'overdue') {
  263. uni.navigateTo({
  264. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=1'
  265. });
  266. } else if (type == 'life') {
  267. uni.navigateTo({
  268. url: '/pages/views/dataBoard/equipmentControlOverdue?pageType=2'
  269. });
  270. }
  271. },
  272. },
  273. }
  274. </script>
  275. <style lang="stylus" scoped>
  276. .equipmentControl {
  277. height: 100%;
  278. width: 100%;
  279. background: #363744;
  280. padding: 2rpx 0rpx 0;
  281. box-sizing: border-box;
  282. .statistics {
  283. width: 750rpx;
  284. height: 120rpx;
  285. background: #3E414F;
  286. .statistics-b {
  287. display: flex;
  288. justify-content: space-between;
  289. align-items: center;
  290. .statistics-b-li {
  291. flex: 1;
  292. text-align: center;
  293. .statistics-b-li-t {
  294. font-weight: 400;
  295. font-size: 36rpx;
  296. line-height: 50rpx;
  297. margin-top: 10rpx;
  298. }
  299. .statistics-b-li-b {
  300. font-weight: 400;
  301. font-size: 24rpx;
  302. color: #FFFFFF;
  303. line-height: 34rpx;
  304. margin-top: 9rpx;
  305. }
  306. }
  307. .line {
  308. width: 2rpx;
  309. height: 30rpx;
  310. background: #D8D8D8;
  311. }
  312. .color-A {
  313. color: #0183FA;
  314. }
  315. .color-B {
  316. color: #FF0000;
  317. }
  318. .color-C {
  319. color: #FFAA00;
  320. }
  321. }
  322. }
  323. .small-title {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. margin: 0 30rpx;
  328. .small-title-l {
  329. font-weight: 400;
  330. font-size: 32rpx;
  331. color: #FFFFFF;
  332. line-height: 45rpx;
  333. text-align: left;
  334. margin: 28rpx 0;
  335. }
  336. .small-title-r {
  337. width: 15rpx;
  338. height: 18rpx;
  339. }
  340. }
  341. .chart {
  342. width: 690rpx;
  343. height: 476rpx;
  344. background: #3E414F;
  345. border-radius: 20rpx 20rpx 20rpx 20rpx;
  346. margin: 0 30rpx;
  347. .chart-b {
  348. width: 690rpx;
  349. height: 476rpx;
  350. }
  351. }
  352. .chart-tow {
  353. width: 690rpx;
  354. height: 436rpx;
  355. background: #3E414F;
  356. border-radius: 20rpx 20rpx 20rpx 20rpx;
  357. margin: 0 30rpx;
  358. .chart-tow-b {
  359. width: 690rpx;
  360. height: 436rpx;
  361. }
  362. }
  363. .small-title-tow {
  364. width: 750rpx;
  365. height: 80rpx;
  366. background: #3E414F;
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. padding: 0 20rpx 0 30rpx;
  371. box-sizing: border-box;
  372. margin-top: 2rpx;
  373. .small-title-tow-l {
  374. flex: 1;
  375. font-weight: 400;
  376. font-size: 30rpx;
  377. color: #FFFFFF;
  378. line-height: 42rpx;
  379. overflow: hidden;
  380. text-overflow: ellipsis;
  381. white-space: nowrap;
  382. }
  383. .small-title-tow-r {
  384. width: 14rpx;
  385. height: 8rpx;
  386. }
  387. }
  388. .chart-three {
  389. width: 690rpx;
  390. height: 394rpx;
  391. background: #3E414F;
  392. border-radius: 20rpx 20rpx 0rpx 0rpx;
  393. margin: 34rpx 30rpx 0;
  394. .chart-three-b {
  395. width: 690rpx;
  396. height: 394rpx;
  397. }
  398. }
  399. .chart-title {
  400. width: 689rpx;
  401. height: 80rpx;
  402. background: rgba(162, 162, 162, 0.2);
  403. border-radius: 0rpx 0rpx 0rpx 0rpx;
  404. padding: 0 70rpx 0 38rpx;
  405. box-sizing: border-box;
  406. margin: 0 30rpx;
  407. display: flex;
  408. justify-content: space-between;
  409. .chart-title-l {
  410. font-weight: 400;
  411. font-size: 30rpx;
  412. color: #FFFFFF;
  413. line-height: 80rpx;
  414. }
  415. .chart-title-r {
  416. font-weight: 400;
  417. font-size: 30rpx;
  418. color: #FFFFFF;
  419. line-height: 80rpx;
  420. }
  421. }
  422. .list {
  423. margin: 0 30rpx;
  424. padding: 0 30rpx;
  425. box-sizing: border-box;
  426. .list-title {
  427. height: 80rpx;
  428. display: flex;
  429. justify-content: space-between;
  430. border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
  431. padding: 0 38rpx 0 10rpx;
  432. box-sizing: border-box;
  433. .list-title-l {
  434. font-weight: 400;
  435. font-size: 28rpx;
  436. color: #FFFFFF;
  437. line-height: 80rpx;
  438. }
  439. .list-title-r {
  440. font-weight: 400;
  441. font-size: 28rpx;
  442. color: #0183FA;
  443. line-height: 80rpx;
  444. }
  445. }
  446. .list-li {
  447. height: 80rpx;
  448. display: flex;
  449. justify-content: space-between;
  450. padding: 0 38rpx 0 10rpx;
  451. box-sizing: border-box;
  452. font-weight: 400;
  453. font-size: 28rpx;
  454. color: #999999;
  455. line-height: 80rpx;
  456. text-align: left;
  457. }
  458. }
  459. }
  460. </style>