cagePosition.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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>60</text>
  16. <text>60%</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>60</text>
  25. <text>60%</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>60</text>
  34. <text>60%</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>60</text>
  43. <text>60%</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>60</text>
  52. <text>60%</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>60</text>
  61. <text>60%</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>60</text>
  78. <text>60%</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>60</text>
  87. <text>60%</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>60</text>
  96. <text>60%</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>60</text>
  105. <text>60%</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>60</text>
  114. <text>60%</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>60</text>
  123. <text>60%</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. }
  320. },
  321. created() {
  322. },
  323. beforeMount() {
  324. },
  325. mounted() {
  326. this.getServerData()
  327. this.reportAppletReportApiCageRateCageRateList()
  328. this.reportAppletReportBsEquipDangerList()
  329. },
  330. methods: {
  331. getServerData() {
  332. //模拟从服务器获取数据时的延时
  333. setTimeout(() => {
  334. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  335. let res = {
  336. series: [{
  337. name: "总数",
  338. color: "#0183FA",
  339. data: 0.8
  340. }]
  341. };
  342. this.chartData = JSON.parse(JSON.stringify(res));
  343. }, 500);
  344. },
  345. //笼位A-B楼
  346. async reportAppletReportApiCageRateCageRateList() {
  347. let self = this;
  348. const {
  349. data
  350. } = await reportAppletReportApiCageRateCageRateList();
  351. if (data.code == 200) {
  352. let nameList=['总数','空闲','预约','锁定','消杀','维修']
  353. let colorList=['#0183FA','#16BF32','#03D8D0','#FF4800','#FF5F5F','#FF8C00']
  354. let numList=[
  355. data.data.reportBsCageRateList[0].appointNum,
  356. data.data.reportBsCageRateList[0].freeNum,
  357. data.data.reportBsCageRateList[0].appointRate,
  358. data.data.reportBsCageRateList[0].lockedNum,
  359. data.data.reportBsCageRateList[0].killNum,
  360. data.data.reportBsCageRateList[0].repairNum,
  361. ]
  362. this.subName=data.data.reportBsCageRateList[0].buildName;
  363. let numListTow=[
  364. data.data.reportBsCageRateList[1].appointNum,
  365. data.data.reportBsCageRateList[1].freeNum,
  366. data.data.reportBsCageRateList[1].appointRate,
  367. data.data.reportBsCageRateList[1].lockedNum,
  368. data.data.reportBsCageRateList[1].killNum,
  369. data.data.reportBsCageRateList[1].repairNum,
  370. ]
  371. this.subNameTow=data.data.reportBsCageRateList[1].buildName;
  372. for(let i=0;i<6;i++){
  373. let res = {
  374. series: [{
  375. name: nameList[i],
  376. color: colorList[i],
  377. data: numList[i],
  378. }]
  379. };
  380. const propertyName = `chartData${i}`;
  381. this[propertyName] = JSON.parse(JSON.stringify(res));
  382. let res2 = {
  383. series: [{
  384. name: nameList[i],
  385. color: colorList[i],
  386. data: numListTow[i],
  387. }]
  388. };
  389. const propertyNameTow = `chartDataTow${i}`;
  390. this[propertyNameTow] = JSON.parse(JSON.stringify(res2));
  391. }
  392. }
  393. },
  394. async reportAppletReportBsEquipDangerList() {
  395. let self = this;
  396. const {
  397. data
  398. } = await reportAppletReportBsEquipDangerList({
  399. dangerType: '2',
  400. statisticsType: this.statisticsType
  401. });
  402. if (data.code == 200) {
  403. let list = [];
  404. let list2 = [];
  405. data.data.subjectList.forEach(function(item, index) {
  406. if (index < 5) {
  407. list.push(item.subjectName)
  408. list2.push(item.dangerNum)
  409. }
  410. })
  411. let res = {
  412. categories: list,
  413. series: [{
  414. name: "",
  415. data: list2
  416. }, ]
  417. };
  418. this.chartDataThree = JSON.parse(JSON.stringify(res));
  419. }
  420. },
  421. chartTabClick(index) {
  422. this.chartTabIndex = index;
  423. },
  424. chartTabClickTow(index) {
  425. this.chartTabIndexTow = index;
  426. },
  427. chartTabClickThree(index) {
  428. this.chartTabIndexThree = index;
  429. this.statisticsType = index + 1;
  430. this.reportAppletReportBsEquipDangerList();
  431. },
  432. },
  433. }
  434. </script>
  435. <style lang="stylus" scoped>
  436. .cagePosition {
  437. height: 100%;
  438. width: 100%;
  439. background: #363744;
  440. padding: 20rpx 0rpx 0;
  441. box-sizing: border-box;
  442. .chart {
  443. width: 690rpx;
  444. height: 360rpx;
  445. background: #3E414F;
  446. border-radius: 20rpx 20rpx 20rpx 20rpx;
  447. overflow: hidden;
  448. margin: 20rpx 30rpx 0;
  449. padding: 38rpx 40rpx 0;
  450. box-sizing: border-box;
  451. .chart-t {
  452. width: 100%;
  453. display: flex;
  454. justify-content: flex-start;
  455. align-items: center;
  456. font-size: 30rpx;
  457. color: #FFFFFF;
  458. line-height: 42rpx;
  459. text-align: left;
  460. >img {
  461. width: 40rpx;
  462. height: 34rpx;
  463. margin-right: 14rpx;
  464. }
  465. }
  466. .chart-b {
  467. display: flex;
  468. justify-content: space-between;
  469. flex-wrap: wrap;
  470. align-items: center;
  471. .chart-b-li {
  472. width: 180rpx;
  473. display: flex;
  474. justify-content: flex-start;
  475. align-items: center;
  476. margin-bottom: 34rpx;
  477. .chart-b-li-l {
  478. width: 100rpx;
  479. height: 100rpx;
  480. margin-right: 17rpx;
  481. }
  482. .chart-b-li-r {
  483. >text {
  484. display: block;
  485. font-size: 28rpx;
  486. color: #FFFFFF;
  487. line-height: 40rpx;
  488. text-align: left;
  489. }
  490. }
  491. }
  492. }
  493. }
  494. .small-title {
  495. width: 690rpx;
  496. height: 50rpx;
  497. display: flex;
  498. justify-content: space-between;
  499. align-items: center;
  500. margin: 24rpx 30rpx;
  501. .small-title-l {
  502. font-weight: 400;
  503. font-size: 32rpx;
  504. color: #FFFFFF;
  505. line-height: 45rpx;
  506. }
  507. .chart-tab-tow {
  508. width: 300rpx;
  509. height: 50rpx;
  510. border-radius: 25rpx;
  511. overflow: hidden;
  512. border: 1rpx solid #52545F;
  513. display: flex;
  514. justify-content: flex-start;
  515. .chart-tab-li {
  516. width: 100rpx;
  517. font-weight: 400;
  518. font-size: 28rpx;
  519. color: #999999;
  520. line-height: 50rpx;
  521. text-align: center;
  522. }
  523. .chart-tab-li:nth-of-type(1) {
  524. border-right: 1rpx solid #52545F;
  525. }
  526. .chart-tab-li:nth-of-type(2) {
  527. border-right: 1rpx solid #52545F;
  528. }
  529. .tab-A {
  530. color: #FFFFFF;
  531. background: #0183FA;
  532. }
  533. .tab-B {
  534. color: #999999;
  535. background: none;
  536. }
  537. }
  538. }
  539. .small-title-tow {
  540. width: 750rpx;
  541. height: 80rpx;
  542. background: #3E414F;
  543. display: flex;
  544. justify-content: space-between;
  545. align-items: center;
  546. padding: 0 20rpx 0 30rpx;
  547. box-sizing: border-box;
  548. margin-top: 2rpx;
  549. .small-title-tow-l {
  550. flex: 1;
  551. font-weight: 400;
  552. font-size: 30rpx;
  553. color: #FFFFFF;
  554. line-height: 42rpx;
  555. overflow: hidden;
  556. text-overflow: ellipsis;
  557. white-space: nowrap;
  558. }
  559. .small-title-tow-r {
  560. width: 14rpx;
  561. height: 8rpx;
  562. }
  563. }
  564. .chart-tow {
  565. width: 690rpx;
  566. height: 480rpx;
  567. background: #3E414F;
  568. border-radius: 20rpx 20rpx 20rpx 30rpx;
  569. margin: 26rpx 30rpx 0;
  570. .chart-tow-b {
  571. width: 690rpx;
  572. height: 480rpx;
  573. }
  574. }
  575. }
  576. </style>