cagePosition.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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" :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" :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" :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" :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" :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" :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" :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" :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" :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" :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" :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" :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 :tapLegend="false" :tooltipShow="false"
  139. type="bar" :opts="optsTow" :echartsH5="true" :chartData="chartDataThree" />
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import {
  146. config
  147. } from '@/api/request/config.js'
  148. import {
  149. reportAppletReportBsEquipDangerList,
  150. reportAppletReportApiCageRateCageRateList
  151. } from '@/pages/api/index.js'
  152. export default {
  153. name: "cagePosition",
  154. components: {
  155. },
  156. data() {
  157. return {
  158. opts: {
  159. title: {
  160. name: "总数",
  161. fontSize: 10,
  162. color: "#0183FA"
  163. },
  164. subtitle: {
  165. name: "",
  166. },
  167. extra: {
  168. arcbar: {
  169. width: 6,
  170. direction:"ccw",
  171. startAngle: 1.5,
  172. endAngle: 1.51,
  173. gap: 2,
  174. backgroundColor: "#373745",
  175. linearType:"custom",
  176. customColor:["#0183FA"],
  177. }
  178. }
  179. },
  180. opts2: {
  181. title: {
  182. name: "空闲",
  183. fontSize: 10,
  184. color: "#16BF32"
  185. },
  186. subtitle: {
  187. name: "",
  188. },
  189. extra: {
  190. arcbar: {
  191. width: 6,
  192. direction:"ccw",
  193. startAngle: 1.5,
  194. endAngle: 1.51,
  195. gap: 2,
  196. backgroundColor: "#373745",
  197. linearType:"custom",
  198. customColor:["#16BF32"],
  199. }
  200. }
  201. },
  202. opts3: {
  203. title: {
  204. name: "预约",
  205. fontSize: 10,
  206. color: "#03D8D0"
  207. },
  208. subtitle: {
  209. name: "",
  210. },
  211. extra: {
  212. arcbar: {
  213. width: 6,
  214. direction:"ccw",
  215. startAngle: 1.5,
  216. endAngle: 1.51,
  217. gap: 2,
  218. backgroundColor: "#373745",
  219. linearType:"custom",
  220. customColor:["#03D8D0"],
  221. }
  222. }
  223. },
  224. opts4: {
  225. title: {
  226. name: "锁定",
  227. fontSize: 10,
  228. color: "#FF4800"
  229. },
  230. subtitle: {
  231. name: "",
  232. },
  233. extra: {
  234. arcbar: {
  235. width: 6,
  236. direction:"ccw",
  237. startAngle: 1.5,
  238. endAngle: 1.51,
  239. gap: 2,
  240. backgroundColor: "#373745",
  241. linearType:"custom",
  242. customColor:["#FF4800"],
  243. }
  244. }
  245. },
  246. opts5: {
  247. title: {
  248. name: "消杀",
  249. fontSize: 10,
  250. color: "#FF5F5F"
  251. },
  252. subtitle: {
  253. name: "",
  254. },
  255. extra: {
  256. arcbar: {
  257. width: 6,
  258. direction:"ccw",
  259. startAngle: 1.5,
  260. endAngle: 1.51,
  261. gap: 2,
  262. backgroundColor: "#373745",
  263. linearType:"custom",
  264. customColor:["#FF5F5F"],
  265. }
  266. }
  267. },
  268. opts6: {
  269. title: {
  270. name: "维修",
  271. fontSize: 10,
  272. color: "#FF8C00"
  273. },
  274. subtitle: {
  275. name: "",
  276. },
  277. extra: {
  278. arcbar: {
  279. width: 6,
  280. direction:"ccw",
  281. startAngle: 1.5,
  282. endAngle: 1.51,
  283. gap: 2,
  284. backgroundColor: "#373745",
  285. linearType:"custom",
  286. customColor:["#FF8C00"],
  287. }
  288. }
  289. },
  290. chartData0: {},
  291. chartData1: {},
  292. chartData2: {},
  293. chartData3: {},
  294. chartData4: {},
  295. chartData5: {},
  296. subName:'',
  297. chartDataTow0: {},
  298. chartDataTow1: {},
  299. chartDataTow2: {},
  300. chartDataTow3: {},
  301. chartDataTow4: {},
  302. chartDataTow5: {},
  303. subNameTow:'',
  304. optsTow: {
  305. rotate: false,
  306. rotateLock: false,
  307. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
  308. padding: [15, 20, 15, 15],
  309. dataLabel: true,
  310. enableScroll: false,
  311. fontColor:'#ffffff',
  312. legend: {
  313. show:false,
  314. },
  315. xAxis: {
  316. boundaryGap: "justify",
  317. disableGrid: false,
  318. min: 0,
  319. axisLine: false,
  320. max: 40
  321. },
  322. yAxis: {},
  323. extra: {
  324. bar: {
  325. type: "group",
  326. width: 15,
  327. meterBorde: 1,
  328. meterFillColor: "#FFFFFF",
  329. activeBgColor: "#000000",
  330. activeBgOpacity: 0.08,
  331. linearType: "custom",
  332. barBorderCircle: true,
  333. seriesGap: 2,
  334. categoryGap: 2
  335. }
  336. }
  337. },
  338. chartDataThree: {},
  339. chartTabList: ['日', '月', '年'],
  340. chartTabIndex: 0,
  341. chartTabListTow: ['按资费', '按机时', '按样品'],
  342. chartTabIndexTow: 0,
  343. chartTabListThree: ['年度', '季度', '月度'],
  344. chartTabIndexThree: 0,
  345. type: 1, //1年2季度3月度
  346. totalAppointNum: 0,
  347. dataList:[],
  348. }
  349. },
  350. created() {
  351. },
  352. beforeMount() {
  353. },
  354. mounted() {
  355. this.reportAppletReportApiCageRateCageRateList()
  356. this.reportAppletReportBsEquipDangerList()
  357. },
  358. methods: {
  359. //笼位A-B楼
  360. async reportAppletReportApiCageRateCageRateList() {
  361. let self = this;
  362. const {
  363. data
  364. } = await reportAppletReportApiCageRateCageRateList();
  365. if (data.code == 200) {
  366. self.dataList=data.data.reportBsCageRateList;
  367. let nameList=['总数','空闲','预约','锁定','消杀','维修']
  368. let colorList=['#B5DEFC','#9FF7B2','#B5F2F0','#FFBCA2','#FC9893','#FFDCB5']
  369. let numList=[
  370. data.data.reportBsCageRateList[0].appointNum/100,
  371. data.data.reportBsCageRateList[0].freeNum/100,
  372. data.data.reportBsCageRateList[0].appointNum/100,
  373. data.data.reportBsCageRateList[0].lockedNum/100,
  374. data.data.reportBsCageRateList[0].killNum/100,
  375. data.data.reportBsCageRateList[0].repairNum/100,
  376. ]
  377. this.subName=data.data.reportBsCageRateList[0].buildName;
  378. let numListTow=[
  379. data.data.reportBsCageRateList[1].appointNum/100,
  380. data.data.reportBsCageRateList[1].freeNum/100,
  381. data.data.reportBsCageRateList[1].appointNum/100,
  382. data.data.reportBsCageRateList[1].lockedNum/100,
  383. data.data.reportBsCageRateList[1].killNum/100,
  384. data.data.reportBsCageRateList[1].repairNum/100,
  385. ]
  386. this.subNameTow=data.data.reportBsCageRateList[1].buildName;
  387. for(let i=0;i<6;i++){
  388. let res = {
  389. series: [{
  390. name: nameList[i],
  391. color: colorList[i],
  392. data: numList[i],
  393. }]
  394. };
  395. const propertyName = `chartData${i}`;
  396. this[propertyName] = JSON.parse(JSON.stringify(res));
  397. let res2 = {
  398. series: [{
  399. name: nameList[i],
  400. color: colorList[i],
  401. data: numListTow[i],
  402. }]
  403. };
  404. const propertyNameTow = `chartDataTow${i}`;
  405. this[propertyNameTow] = JSON.parse(JSON.stringify(res2));
  406. }
  407. }
  408. },
  409. async reportAppletReportBsEquipDangerList() {
  410. let self = this;
  411. const {
  412. data
  413. } = await reportAppletReportBsEquipDangerList({
  414. dangerType: '2',
  415. statisticsType: this.statisticsType
  416. });
  417. if (data.code == 200) {
  418. let categories = [];
  419. let list = [];
  420. data.data.subjectList.forEach((item, index)=>{
  421. if (index < 5) {
  422. if (item.subjectName.length > 6) {
  423. item.subjectName = item.subjectName.slice(0, 6) + '...';
  424. }
  425. categories.push(item.subjectName)
  426. list.push(item.dangerNum)
  427. }
  428. })
  429. let res = {};
  430. if(categories[0]){
  431. res = {
  432. categories: categories,
  433. series: [{
  434. name: "",
  435. data: list
  436. }]
  437. };
  438. }else{
  439. res = {
  440. categories: ['无数据'],
  441. series: [{
  442. name: "",
  443. data: [0]
  444. }]
  445. };
  446. }
  447. self.$set(this,'chartDataThree',res);
  448. }
  449. },
  450. chartTabClick(index) {
  451. this.chartTabIndex = index;
  452. },
  453. chartTabClickTow(index) {
  454. this.chartTabIndexTow = index;
  455. },
  456. chartTabClickThree(index) {
  457. this.chartTabIndexThree = index;
  458. this.statisticsType = index + 1;
  459. this.reportAppletReportBsEquipDangerList();
  460. },
  461. },
  462. }
  463. </script>
  464. <style lang="stylus" scoped>
  465. .cagePosition {
  466. height: 100%;
  467. width: 100%;
  468. background: #363744;
  469. padding: 20rpx 0rpx 0;
  470. box-sizing: border-box;
  471. .chart {
  472. width: 690rpx;
  473. height: 360rpx;
  474. background: #3E414F;
  475. border-radius: 20rpx 20rpx 20rpx 20rpx;
  476. overflow: hidden;
  477. margin: 20rpx 30rpx 0;
  478. padding: 38rpx 40rpx 0;
  479. box-sizing: border-box;
  480. .chart-t {
  481. width: 100%;
  482. display: flex;
  483. justify-content: flex-start;
  484. align-items: center;
  485. font-size: 30rpx;
  486. color: #FFFFFF;
  487. line-height: 42rpx;
  488. text-align: left;
  489. >img {
  490. width: 40rpx;
  491. height: 34rpx;
  492. margin-right: 14rpx;
  493. }
  494. }
  495. .chart-b {
  496. display: flex;
  497. justify-content: space-between;
  498. flex-wrap: wrap;
  499. align-items: center;
  500. .chart-b-li {
  501. width: 180rpx;
  502. display: flex;
  503. justify-content: flex-start;
  504. align-items: center;
  505. margin-bottom: 34rpx;
  506. .chart-b-li-l {
  507. width: 100rpx;
  508. height: 100rpx;
  509. margin-right: 17rpx;
  510. }
  511. .chart-b-li-r {
  512. >text {
  513. display: block;
  514. font-size: 28rpx;
  515. color: #FFFFFF;
  516. line-height: 40rpx;
  517. text-align: left;
  518. }
  519. }
  520. }
  521. }
  522. }
  523. .small-title {
  524. width: 690rpx;
  525. height: 50rpx;
  526. display: flex;
  527. justify-content: space-between;
  528. align-items: center;
  529. margin: 24rpx 30rpx;
  530. .small-title-l {
  531. font-weight: 400;
  532. font-size: 32rpx;
  533. color: #FFFFFF;
  534. line-height: 45rpx;
  535. }
  536. .chart-tab-tow {
  537. width: 300rpx;
  538. height: 50rpx;
  539. border-radius: 25rpx;
  540. overflow: hidden;
  541. border: 1rpx solid #52545F;
  542. display: flex;
  543. justify-content: flex-start;
  544. .chart-tab-li {
  545. width: 100rpx;
  546. font-weight: 400;
  547. font-size: 28rpx;
  548. color: #999999;
  549. line-height: 50rpx;
  550. text-align: center;
  551. }
  552. .chart-tab-li:nth-of-type(1) {
  553. border-right: 1rpx solid #52545F;
  554. }
  555. .chart-tab-li:nth-of-type(2) {
  556. border-right: 1rpx solid #52545F;
  557. }
  558. .tab-A {
  559. color: #FFFFFF;
  560. background: #0183FA;
  561. }
  562. .tab-B {
  563. color: #999999;
  564. background: none;
  565. }
  566. }
  567. }
  568. .small-title-tow {
  569. width: 750rpx;
  570. height: 80rpx;
  571. background: #3E414F;
  572. display: flex;
  573. justify-content: space-between;
  574. align-items: center;
  575. padding: 0 20rpx 0 30rpx;
  576. box-sizing: border-box;
  577. margin-top: 2rpx;
  578. .small-title-tow-l {
  579. flex: 1;
  580. font-weight: 400;
  581. font-size: 30rpx;
  582. color: #FFFFFF;
  583. line-height: 42rpx;
  584. overflow: hidden;
  585. text-overflow: ellipsis;
  586. white-space: nowrap;
  587. }
  588. .small-title-tow-r {
  589. width: 14rpx;
  590. height: 8rpx;
  591. }
  592. }
  593. .chart-tow {
  594. width: 690rpx;
  595. height: 480rpx;
  596. background: #3E414F;
  597. border-radius: 20rpx 20rpx 20rpx 30rpx;
  598. margin: 26rpx 30rpx 0;
  599. .chart-tow-b {
  600. width: 690rpx;
  601. height: 480rpx;
  602. }
  603. }
  604. }
  605. </style>