cagePosition.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <!-- 数据看板-笼位预约 -->
  2. <template>
  3. <view class="cagePosition">
  4. <view class="chart">
  5. <view class="chart-t">
  6. <img src="@/pages/images/loudong@2x.png">
  7. {{subName}}
  8. </view>
  9. <view class="chart-b">
  10. <view class="chart-b-li">
  11. <view class="chart-b-li-l">
  12. <qiun-data-charts type="arcbar" :opts="opts" :canvas2d="true" :chartData="chartData0" />
  13. </view>
  14. <view class="chart-b-li-r">
  15. <text>{{dataList[0].appointNum}}</text>
  16. <text>{{dataList[0].appointNum}}%</text>
  17. </view>
  18. </view>
  19. <view class="chart-b-li">
  20. <view class="chart-b-li-l">
  21. <qiun-data-charts type="arcbar" :opts="opts2" :canvas2d="true" :chartData="chartData1" />
  22. </view>
  23. <view class="chart-b-li-r">
  24. <text>{{dataList[0].freeNum}}</text>
  25. <text>{{dataList[0].freeRate}}%</text>
  26. </view>
  27. </view>
  28. <view class="chart-b-li">
  29. <view class="chart-b-li-l">
  30. <qiun-data-charts type="arcbar" :opts="opts3" :canvas2d="true" :chartData="chartData2" />
  31. </view>
  32. <view class="chart-b-li-r">
  33. <text>{{dataList[0].appointNum}}</text>
  34. <text>{{dataList[0].appointRate}}%</text>
  35. </view>
  36. </view>
  37. <view class="chart-b-li">
  38. <view class="chart-b-li-l">
  39. <qiun-data-charts type="arcbar" :opts="opts4" :canvas2d="true" :chartData="chartData3" />
  40. </view>
  41. <view class="chart-b-li-r">
  42. <text>{{dataList[0].lockedNum}}</text>
  43. <text>{{dataList[0].lockedNum}}%</text>
  44. </view>
  45. </view>
  46. <view class="chart-b-li">
  47. <view class="chart-b-li-l">
  48. <qiun-data-charts type="arcbar" :opts="opts5" :canvas2d="true" :chartData="chartData4" />
  49. </view>
  50. <view class="chart-b-li-r">
  51. <text>{{dataList[0].killNum}}</text>
  52. <text>{{dataList[0].killRate}}%</text>
  53. </view>
  54. </view>
  55. <view class="chart-b-li">
  56. <view class="chart-b-li-l">
  57. <qiun-data-charts type="arcbar" :opts="opts6" :canvas2d="true" :chartData="chartData5" />
  58. </view>
  59. <view class="chart-b-li-r">
  60. <text>{{dataList[0].repairNum}}</text>
  61. <text>{{dataList[0].repairRate}}%</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="chart">
  67. <view class="chart-t">
  68. <img src="@/pages/images/loudong@2x.png">
  69. {{subNameTow}}
  70. </view>
  71. <view class="chart-b">
  72. <view class="chart-b-li">
  73. <view class="chart-b-li-l">
  74. <qiun-data-charts type="arcbar" :opts="opts" :canvas2d="true" :chartData="chartDataTow0" />
  75. </view>
  76. <view class="chart-b-li-r">
  77. <text>{{dataList[0].appointNum}}</text>
  78. <text>{{dataList[0].appointNum}}%</text>
  79. </view>
  80. </view>
  81. <view class="chart-b-li">
  82. <view class="chart-b-li-l">
  83. <qiun-data-charts type="arcbar" :opts="opts2" :canvas2d="true" :chartData="chartDataTow1" />
  84. </view>
  85. <view class="chart-b-li-r">
  86. <text>{{dataList[0].freeNum}}</text>
  87. <text>{{dataList[0].freeRate}}%</text>
  88. </view>
  89. </view>
  90. <view class="chart-b-li">
  91. <view class="chart-b-li-l">
  92. <qiun-data-charts type="arcbar" :opts="opts3" :canvas2d="true" :chartData="chartDataTow2" />
  93. </view>
  94. <view class="chart-b-li-r">
  95. <text>{{dataList[0].appointNum}}</text>
  96. <text>{{dataList[0].appointRate}}%</text>
  97. </view>
  98. </view>
  99. <view class="chart-b-li">
  100. <view class="chart-b-li-l">
  101. <qiun-data-charts type="arcbar" :opts="opts4" :canvas2d="true" :chartData="chartDataTow3" />
  102. </view>
  103. <view class="chart-b-li-r">
  104. <text>{{dataList[0].lockedNum}}</text>
  105. <text>{{dataList[0].lockedNum}}%</text>
  106. </view>
  107. </view>
  108. <view class="chart-b-li">
  109. <view class="chart-b-li-l">
  110. <qiun-data-charts type="arcbar" :opts="opts5" :canvas2d="true" :chartData="chartDataTow4" />
  111. </view>
  112. <view class="chart-b-li-r">
  113. <text>{{dataList[0].killNum}}</text>
  114. <text>{{dataList[0].killRate}}%</text>
  115. </view>
  116. </view>
  117. <view class="chart-b-li">
  118. <view class="chart-b-li-l">
  119. <qiun-data-charts type="arcbar" :opts="opts6" :canvas2d="true" :chartData="chartDataTow5" />
  120. </view>
  121. <view class="chart-b-li-r">
  122. <text>{{dataList[0].repairNum}}</text>
  123. <text>{{dataList[0].repairRate}}%</text>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="small-title">
  129. <view class="small-title-l">隐患实验室统计</view>
  130. <viwe class="chart-tab-tow">
  131. <view class="chart-tab-li" :class="chartTabIndexThree==index?'tab-A':'tab-B'"
  132. v-for="(item,index) in chartTabListThree" :key="index" @click="chartTabClickThree(index)">{{item}}
  133. </view>
  134. </viwe>
  135. </view>
  136. <view class="chart-tow">
  137. <view class="chart-tow-b">
  138. <qiun-data-charts type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataThree" />
  139. </view>
  140. </view>
  141. </view>
  142. </template>
  143. <script>
  144. import {
  145. config
  146. } from '@/api/request/config.js'
  147. import {
  148. reportAppletReportBsEquipDangerList,
  149. reportAppletReportApiCageRateCageRateList
  150. } from '@/pages/api/index.js'
  151. export default {
  152. name: "cagePosition",
  153. components: {
  154. },
  155. data() {
  156. return {
  157. opts: {
  158. title: {
  159. name: "总数",
  160. fontSize: 10,
  161. color: "#0183FA"
  162. },
  163. subtitle: {
  164. name: "",
  165. },
  166. extra: {
  167. arcbar: {
  168. width: 6,
  169. backgroundColor: "#BEE0FF",
  170. startAngle: 0,
  171. endAngle: 1.5,
  172. gap: 2,
  173. }
  174. }
  175. },
  176. opts2: {
  177. title: {
  178. name: "空闲",
  179. fontSize: 10,
  180. color: "#16BF32"
  181. },
  182. subtitle: {
  183. name: "",
  184. },
  185. extra: {
  186. arcbar: {
  187. width: 6,
  188. backgroundColor: "#B1FCBE",
  189. startAngle: 0,
  190. endAngle: 1.5,
  191. gap: 2,
  192. }
  193. }
  194. },
  195. opts3: {
  196. title: {
  197. name: "预约",
  198. fontSize: 10,
  199. color: "#03D8D0"
  200. },
  201. subtitle: {
  202. name: "",
  203. },
  204. extra: {
  205. arcbar: {
  206. width: 6,
  207. backgroundColor: "#C0F5F3",
  208. startAngle: 0,
  209. endAngle: 1.5,
  210. gap: 2,
  211. }
  212. }
  213. },
  214. opts4: {
  215. title: {
  216. name: "锁定",
  217. fontSize: 10,
  218. color: "#FF4800"
  219. },
  220. subtitle: {
  221. name: "",
  222. },
  223. extra: {
  224. arcbar: {
  225. width: 6,
  226. backgroundColor: "#FFC0A7",
  227. startAngle: 0,
  228. endAngle: 1.5,
  229. gap: 2,
  230. }
  231. }
  232. },
  233. opts5: {
  234. title: {
  235. name: "消杀",
  236. fontSize: 10,
  237. color: "#FF5F5F"
  238. },
  239. subtitle: {
  240. name: "",
  241. },
  242. extra: {
  243. arcbar: {
  244. width: 6,
  245. backgroundColor: "#FF9898",
  246. startAngle: 0,
  247. endAngle: 1.5,
  248. gap: 2,
  249. }
  250. }
  251. },
  252. opts6: {
  253. title: {
  254. name: "维修",
  255. fontSize: 10,
  256. color: "#FF8C00"
  257. },
  258. subtitle: {
  259. name: "",
  260. },
  261. extra: {
  262. arcbar: {
  263. width: 6,
  264. backgroundColor: "#FFDDB5",
  265. startAngle: 0,
  266. endAngle: 1.5,
  267. gap: 2,
  268. }
  269. }
  270. },
  271. chartData0: {},
  272. chartData1: {},
  273. chartData2: {},
  274. chartData3: {},
  275. chartData4: {},
  276. chartData5: {},
  277. subName:'',
  278. chartDataTow0: {},
  279. chartDataTow1: {},
  280. chartDataTow2: {},
  281. chartDataTow3: {},
  282. chartDataTow4: {},
  283. chartDataTow5: {},
  284. subNameTow:'',
  285. optsTow: {
  286. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  287. "#ea7ccc"
  288. ],
  289. padding: [5, 5, 5, 5],
  290. dataLabel: false,
  291. enableScroll: false,
  292. legend: {
  293. show: false,
  294. position: "right",
  295. lineHeight: 25
  296. },
  297. extra: {
  298. radar: {
  299. gridType: "radar",
  300. gridColor: "#CCCCCC",
  301. gridCount: 3,
  302. opacity: 0.2,
  303. max: 200,
  304. labelShow: true,
  305. border: true,
  306. labelColor: '#fff',
  307. }
  308. }
  309. },
  310. chartDataThree: {},
  311. chartTabList: ['日', '月', '年'],
  312. chartTabIndex: 0,
  313. chartTabListTow: ['按资费', '按机时', '按样品'],
  314. chartTabIndexTow: 0,
  315. chartTabListThree: ['年度', '季度', '月度'],
  316. chartTabIndexThree: 0,
  317. type: 1, //1年2季度3月度
  318. totalAppointNum: 0,
  319. dataList:[],
  320. }
  321. },
  322. created() {
  323. },
  324. beforeMount() {
  325. },
  326. mounted() {
  327. this.reportAppletReportApiCageRateCageRateList()
  328. this.reportAppletReportBsEquipDangerList()
  329. },
  330. methods: {
  331. //笼位A-B楼
  332. async reportAppletReportApiCageRateCageRateList() {
  333. let self = this;
  334. const {
  335. data
  336. } = await reportAppletReportApiCageRateCageRateList();
  337. if (data.code == 200) {
  338. self.dataList=data.data.reportBsCageRateList;
  339. let nameList=['总数','空闲','预约','锁定','消杀','维修']
  340. let colorList=['#0183FA','#16BF32','#03D8D0','#FF4800','#FF5F5F','#FF8C00']
  341. let numList=[
  342. data.data.reportBsCageRateList[0].appointNum/100,
  343. data.data.reportBsCageRateList[0].freeNum/100,
  344. data.data.reportBsCageRateList[0].appointNum/100,
  345. data.data.reportBsCageRateList[0].lockedNum/100,
  346. data.data.reportBsCageRateList[0].killNum/100,
  347. data.data.reportBsCageRateList[0].repairNum/100,
  348. ]
  349. this.subName=data.data.reportBsCageRateList[0].buildName;
  350. let numListTow=[
  351. data.data.reportBsCageRateList[1].appointNum/100,
  352. data.data.reportBsCageRateList[1].freeNum/100,
  353. data.data.reportBsCageRateList[1].appointNum/100,
  354. data.data.reportBsCageRateList[1].lockedNum/100,
  355. data.data.reportBsCageRateList[1].killNum/100,
  356. data.data.reportBsCageRateList[1].repairNum/100,
  357. ]
  358. this.subNameTow=data.data.reportBsCageRateList[1].buildName;
  359. for(let i=0;i<6;i++){
  360. let res = {
  361. series: [{
  362. name: nameList[i],
  363. color: colorList[i],
  364. data: numList[i],
  365. }]
  366. };
  367. const propertyName = `chartData${i}`;
  368. this[propertyName] = JSON.parse(JSON.stringify(res));
  369. let res2 = {
  370. series: [{
  371. name: nameList[i],
  372. color: colorList[i],
  373. data: numListTow[i],
  374. }]
  375. };
  376. const propertyNameTow = `chartDataTow${i}`;
  377. this[propertyNameTow] = JSON.parse(JSON.stringify(res2));
  378. }
  379. }
  380. },
  381. async reportAppletReportBsEquipDangerList() {
  382. let self = this;
  383. const {
  384. data
  385. } = await reportAppletReportBsEquipDangerList({
  386. dangerType: '2',
  387. statisticsType: this.statisticsType
  388. });
  389. if (data.code == 200) {
  390. let list = [];
  391. let list2 = [];
  392. data.data.subjectList.forEach(function(item, index) {
  393. if (index < 5) {
  394. list.push(item.subjectName)
  395. list2.push(item.dangerNum)
  396. }
  397. })
  398. let res = {
  399. categories: list,
  400. series: [{
  401. name: "",
  402. data: list2
  403. }, ]
  404. };
  405. this.chartDataThree = JSON.parse(JSON.stringify(res));
  406. }
  407. },
  408. chartTabClick(index) {
  409. this.chartTabIndex = index;
  410. },
  411. chartTabClickTow(index) {
  412. this.chartTabIndexTow = index;
  413. },
  414. chartTabClickThree(index) {
  415. this.chartTabIndexThree = index;
  416. this.statisticsType = index + 1;
  417. this.reportAppletReportBsEquipDangerList();
  418. },
  419. },
  420. }
  421. </script>
  422. <style lang="stylus" scoped>
  423. .cagePosition {
  424. height: 100%;
  425. width: 100%;
  426. background: #363744;
  427. padding: 20rpx 0rpx 0;
  428. box-sizing: border-box;
  429. .chart {
  430. width: 690rpx;
  431. height: 360rpx;
  432. background: #3E414F;
  433. border-radius: 20rpx 20rpx 20rpx 20rpx;
  434. overflow: hidden;
  435. margin: 20rpx 30rpx 0;
  436. padding: 38rpx 40rpx 0;
  437. box-sizing: border-box;
  438. .chart-t {
  439. width: 100%;
  440. display: flex;
  441. justify-content: flex-start;
  442. align-items: center;
  443. font-size: 30rpx;
  444. color: #FFFFFF;
  445. line-height: 42rpx;
  446. text-align: left;
  447. >img {
  448. width: 40rpx;
  449. height: 34rpx;
  450. margin-right: 14rpx;
  451. }
  452. }
  453. .chart-b {
  454. display: flex;
  455. justify-content: space-between;
  456. flex-wrap: wrap;
  457. align-items: center;
  458. .chart-b-li {
  459. width: 180rpx;
  460. display: flex;
  461. justify-content: flex-start;
  462. align-items: center;
  463. margin-bottom: 34rpx;
  464. .chart-b-li-l {
  465. width: 100rpx;
  466. height: 100rpx;
  467. margin-right: 17rpx;
  468. }
  469. .chart-b-li-r {
  470. >text {
  471. display: block;
  472. font-size: 28rpx;
  473. color: #FFFFFF;
  474. line-height: 40rpx;
  475. text-align: left;
  476. }
  477. }
  478. }
  479. }
  480. }
  481. .small-title {
  482. width: 690rpx;
  483. height: 50rpx;
  484. display: flex;
  485. justify-content: space-between;
  486. align-items: center;
  487. margin: 24rpx 30rpx;
  488. .small-title-l {
  489. font-weight: 400;
  490. font-size: 32rpx;
  491. color: #FFFFFF;
  492. line-height: 45rpx;
  493. }
  494. .chart-tab-tow {
  495. width: 300rpx;
  496. height: 50rpx;
  497. border-radius: 25rpx;
  498. overflow: hidden;
  499. border: 1rpx solid #52545F;
  500. display: flex;
  501. justify-content: flex-start;
  502. .chart-tab-li {
  503. width: 100rpx;
  504. font-weight: 400;
  505. font-size: 28rpx;
  506. color: #999999;
  507. line-height: 50rpx;
  508. text-align: center;
  509. }
  510. .chart-tab-li:nth-of-type(1) {
  511. border-right: 1rpx solid #52545F;
  512. }
  513. .chart-tab-li:nth-of-type(2) {
  514. border-right: 1rpx solid #52545F;
  515. }
  516. .tab-A {
  517. color: #FFFFFF;
  518. background: #0183FA;
  519. }
  520. .tab-B {
  521. color: #999999;
  522. background: none;
  523. }
  524. }
  525. }
  526. .small-title-tow {
  527. width: 750rpx;
  528. height: 80rpx;
  529. background: #3E414F;
  530. display: flex;
  531. justify-content: space-between;
  532. align-items: center;
  533. padding: 0 20rpx 0 30rpx;
  534. box-sizing: border-box;
  535. margin-top: 2rpx;
  536. .small-title-tow-l {
  537. flex: 1;
  538. font-weight: 400;
  539. font-size: 30rpx;
  540. color: #FFFFFF;
  541. line-height: 42rpx;
  542. overflow: hidden;
  543. text-overflow: ellipsis;
  544. white-space: nowrap;
  545. }
  546. .small-title-tow-r {
  547. width: 14rpx;
  548. height: 8rpx;
  549. }
  550. }
  551. .chart-tow {
  552. width: 690rpx;
  553. height: 480rpx;
  554. background: #3E414F;
  555. border-radius: 20rpx 20rpx 20rpx 30rpx;
  556. margin: 26rpx 30rpx 0;
  557. .chart-tow-b {
  558. width: 690rpx;
  559. height: 480rpx;
  560. }
  561. }
  562. }
  563. </style>