cagePosition.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <!-- 数据看板-笼位预约 -->
  2. <template>
  3. <view class="cagePosition">
  4. <view class="chart">
  5. <view class="chart-t">
  6. <viwe class="chart-t-l">
  7. <text>笼位总数:</text>
  8. <text>{{totalAppointNum}}</text>
  9. </viwe>
  10. <viwe class="chart-tab">
  11. <view class="chart-tab-li" :class="chartTabIndex==index?'tab-A':'tab-B'"
  12. v-for="(item,index) in chartTabList" :key="index" @click="chartTabClick(index)">{{item}}</view>
  13. </viwe>
  14. </view>
  15. <view class="chart-b">
  16. <qiun-data-charts type="ring" :opts="opts" :echartsH5="true" :chartData="chartData" />
  17. </view>
  18. </view>
  19. <view class="small-title">
  20. <view class="small-title-l">安全隐患统计</view>
  21. <viwe class="chart-tab-tow">
  22. <view class="chart-tab-li" :class="chartTabIndexThree==index?'tab-A':'tab-B'"
  23. v-for="(item,index) in chartTabListThree" :key="index" @click="chartTabClickThree(index)">{{item}}
  24. </view>
  25. </viwe>
  26. </view>
  27. <view class="chart-tow">
  28. <view class="chart-tow-b">
  29. <qiun-data-charts type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. config
  37. } from '@/api/request/config.js'
  38. import {
  39. reportAppletReportApiCageRateList,
  40. reportAppletReportBsEquipDangerList
  41. } from '@/pages/api/index.js'
  42. export default {
  43. name: "cagePosition",
  44. components: {
  45. },
  46. data() {
  47. return {
  48. opts: {
  49. rotate: false,
  50. rotateLock: false,
  51. color: ["#10C139", "#C42EFF", "#FF8400", "#19B6B6", "#0283FA", "#3CA272", ],
  52. padding: [5, 5, 5, 5],
  53. dataLabel: true,
  54. enableScroll: false,
  55. legend: {
  56. show: true,
  57. position: "right",
  58. fontColor:'#fff',
  59. },
  60. title: {
  61. name: "",
  62. },
  63. subtitle: {
  64. name: "",
  65. },
  66. extra: {
  67. ring: {
  68. ringWidth: 10,
  69. centerColor: '#3E414F',
  70. activeOpacity: 0.5,
  71. customRadius:46,
  72. activeRadius: 20,
  73. offsetAngle: 0,
  74. labelWidth: 15,
  75. border: true,
  76. borderWidth: 3,
  77. borderColor: "#3E414F"
  78. }
  79. }
  80. },
  81. chartData: {},
  82. optsTow: {
  83. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  84. "#ea7ccc"
  85. ],
  86. padding: [5, 5, 5, 5],
  87. dataLabel: false,
  88. enableScroll: false,
  89. legend: {
  90. show: false,
  91. position: "right",
  92. lineHeight: 25
  93. },
  94. extra: {
  95. radar: {
  96. gridType: "radar",
  97. gridColor: "#CCCCCC",
  98. gridCount: 3,
  99. opacity: 0.2,
  100. max: 200,
  101. labelShow: true,
  102. border: true,
  103. labelColor:'#fff',
  104. }
  105. }
  106. },
  107. chartDataTow: {},
  108. chartTabList: ['日', '月', '年'],
  109. chartTabIndex: 0,
  110. chartTabListTow: ['按资费', '按机时', '按样品'],
  111. chartTabIndexTow: 0,
  112. // 查询参数
  113. queryParams: {
  114. page: 1,
  115. pageSize: 10,
  116. },
  117. dataList: [{
  118. data1: '学院学院简称',
  119. data2: '666',
  120. },
  121. {
  122. data1: '学院学院简称',
  123. data2: '666',
  124. },
  125. {
  126. data1: '学院学院简称',
  127. data2: '666',
  128. },
  129. {
  130. data1: '学院学院简称',
  131. data2: '666',
  132. },
  133. ],
  134. total: 0,
  135. chartTabListThree: ['年度', '季度', '月度'],
  136. chartTabIndexThree: 0,
  137. type:1,//1年2季度3月度
  138. totalAppointNum:0,
  139. }
  140. },
  141. created() {
  142. },
  143. beforeMount() {
  144. },
  145. mounted() {
  146. this.reportAppletReportApiCageRateList()
  147. this.reportAppletReportBsEquipDangerList()
  148. },
  149. methods: {
  150. //隐患统计
  151. async reportAppletReportApiCageRateList() {
  152. let self = this;
  153. const {
  154. data
  155. } = await reportAppletReportApiCageRateList({
  156. type: this.type
  157. });
  158. if (data.code == 200) {
  159. let list = [];
  160. this.totalAppointNum=data.data.totalAppointNum;
  161. list.push({
  162. "name": "维修",
  163. "value": data.data.reportBsCageRateList[0].repairNum,
  164. "labelShow": false
  165. }, {
  166. "name": "预约",
  167. "value": data.data.reportBsCageRateList[0].appointNum,
  168. "labelShow": false
  169. }, {
  170. "name": "空闲",
  171. "value": data.data.reportBsCageRateList[0].freeNum,
  172. "labelShow": false
  173. }, {
  174. "name": "消杀",
  175. "value": data.data.reportBsCageRateList[0].killNum,
  176. "labelShow": false
  177. }, {
  178. "name": "锁定",
  179. "value": data.data.reportBsCageRateList[0].lockedNum,
  180. "labelShow": false
  181. })
  182. let res = {
  183. series: [{
  184. data: list
  185. }]
  186. };
  187. this.chartData = JSON.parse(JSON.stringify(res));
  188. }
  189. },
  190. async reportAppletReportBsEquipDangerList() {
  191. let self = this;
  192. const {
  193. data
  194. } = await reportAppletReportBsEquipDangerList({dangerType:'2',statisticsType:this.statisticsType});
  195. if (data.code == 200) {
  196. let list=[];
  197. let list2=[];
  198. data.data.subjectList.forEach(function(item,index){
  199. if(index<5){
  200. list.push(item.subjectName)
  201. list2.push(item.dangerNum)
  202. }
  203. })
  204. let res = {
  205. categories: list,
  206. series: [{
  207. name: "",
  208. data: list2
  209. },
  210. ]
  211. };
  212. this.chartDataTow = JSON.parse(JSON.stringify(res));
  213. }
  214. },
  215. chartTabClick(index) {
  216. this.chartTabIndex = index;
  217. },
  218. chartTabClickTow(index) {
  219. this.chartTabIndexTow = index;
  220. },
  221. chartTabClickThree(index) {
  222. this.chartTabIndexThree = index;
  223. this.statisticsType = index+1;
  224. this.reportAppletReportBsEquipDangerList();
  225. },
  226. },
  227. }
  228. </script>
  229. <style lang="stylus" scoped>
  230. .cagePosition {
  231. height: 100%;
  232. width: 100%;
  233. background: #363744;
  234. padding: 20rpx 0rpx 0;
  235. box-sizing: border-box;
  236. .chart {
  237. width: 690rpx;
  238. height: 380rpx;
  239. background: #3E414F;
  240. border-radius: 20rpx 20rpx 20rpx 20rpx;
  241. overflow: hidden;
  242. margin: 0 30rpx;
  243. .chart-t {
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. height: 50rpx;
  248. margin-top: 30rpx;
  249. padding: 0 24rpx 0 42rpx;
  250. box-sizing: border-box;
  251. .chart-t-l {
  252. >text {
  253. font-weight: 400;
  254. font-size: 30rpx;
  255. color: #FFFFFF;
  256. line-height: 42rpx;
  257. }
  258. >text:nth-of-type(1) {
  259. color: #FFFFFF;
  260. }
  261. >text:nth-of-type(2) {
  262. color: #0183FA;
  263. }
  264. }
  265. .chart-tab {
  266. width: 120rpx;
  267. height: 50rpx;
  268. border-radius: 10rpx;
  269. overflow: hidden;
  270. border: 1rpx solid #52545F;
  271. display: flex;
  272. justify-content: flex-start;
  273. .chart-tab-li {
  274. width: 60rpx;
  275. font-weight: 400;
  276. font-size: 28rpx;
  277. color: #999999;
  278. line-height: 50rpx;
  279. text-align: center;
  280. }
  281. .chart-tab-li:nth-of-type(1) {
  282. border-right: 1rpx solid #52545F;
  283. }
  284. .chart-tab-li:nth-of-type(2) {
  285. border-right: 1rpx solid #52545F;
  286. }
  287. .tab-A {
  288. color: #FFFFFF;
  289. background: #0183FA;
  290. }
  291. .tab-B {
  292. color: #999999;
  293. background: none;
  294. }
  295. }
  296. }
  297. .chart-b {
  298. width: 690rpx;
  299. height: 300rpx;
  300. }
  301. }
  302. .small-title {
  303. width: 690rpx;
  304. height: 50rpx;
  305. display: flex;
  306. justify-content: space-between;
  307. align-items: center;
  308. margin: 24rpx 30rpx;
  309. .small-title-l {
  310. font-weight: 400;
  311. font-size: 32rpx;
  312. color: #FFFFFF;
  313. line-height: 45rpx;
  314. }
  315. .chart-tab-tow {
  316. width: 300rpx;
  317. height: 50rpx;
  318. border-radius: 25rpx;
  319. overflow: hidden;
  320. border: 1rpx solid #52545F;
  321. display: flex;
  322. justify-content: flex-start;
  323. .chart-tab-li {
  324. width: 100rpx;
  325. font-weight: 400;
  326. font-size: 28rpx;
  327. color: #999999;
  328. line-height: 50rpx;
  329. text-align: center;
  330. }
  331. .chart-tab-li:nth-of-type(1) {
  332. border-right: 1rpx solid #52545F;
  333. }
  334. .chart-tab-li:nth-of-type(2) {
  335. border-right: 1rpx solid #52545F;
  336. }
  337. .tab-A {
  338. color: #FFFFFF;
  339. background: #0183FA;
  340. }
  341. .tab-B {
  342. color: #999999;
  343. background: none;
  344. }
  345. }
  346. }
  347. .small-title-tow {
  348. width: 750rpx;
  349. height: 80rpx;
  350. background: #3E414F;
  351. display: flex;
  352. justify-content: space-between;
  353. align-items: center;
  354. padding: 0 20rpx 0 30rpx;
  355. box-sizing: border-box;
  356. margin-top: 2rpx;
  357. .small-title-tow-l {
  358. flex: 1;
  359. font-weight: 400;
  360. font-size: 30rpx;
  361. color: #FFFFFF;
  362. line-height: 42rpx;
  363. overflow: hidden;
  364. text-overflow: ellipsis;
  365. white-space: nowrap;
  366. }
  367. .small-title-tow-r {
  368. width: 14rpx;
  369. height: 8rpx;
  370. }
  371. }
  372. .chart-tow {
  373. width: 690rpx;
  374. height: 480rpx;
  375. background: #3E414F;
  376. border-radius: 20rpx 20rpx 20rpx 30rpx;
  377. margin: 26rpx 30rpx 0;
  378. .chart-tow-b {
  379. width: 690rpx;
  380. height: 480rpx;
  381. }
  382. }
  383. }
  384. </style>