cagePosition.vue 14 KB

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