parking-statistics.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="page animate__animated animate__faster animate__fadeInRight">
  3. <more title="泊车统计" nomore></more>
  4. <div class="full center" style="flex-direction: column;">
  5. <dv-active-ring-chart :config="config" style="width:260px;height:260px" />
  6. <div class="static">
  7. <div class="data" v-for="(item,index) in dataList" :key="index">
  8. <div>{{item.label}}</div>
  9. <div>{{item.value}}</div>
  10. </div>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import more from "@/components/more.vue"
  17. import {
  18. statistics
  19. } from "@/api/estate/parkingspace.js"
  20. export default {
  21. components: {
  22. more
  23. },
  24. data() {
  25. return {
  26. dataList: [{
  27. label: '总泊车位',
  28. value: 0
  29. },
  30. {
  31. label: '已泊车位',
  32. value: 0
  33. },
  34. {
  35. label: '剩余车位',
  36. value: 0
  37. }
  38. ],
  39. config: {}
  40. }
  41. },
  42. created() {
  43. this.getStat()
  44. },
  45. methods: {
  46. async getStat() {
  47. let data = (await statistics()).data.data
  48. if (this.$isNotEmpty(data)) {
  49. this.dataList[0].value = data.totalCount
  50. this.dataList[1].value = data.isUseCount
  51. this.dataList[2].value = data.notUseCount
  52. this.config = {
  53. data: [{
  54. name: '剩余车位',
  55. value: data.notUseCount
  56. }, {
  57. name: '已泊车位',
  58. value: data.isUseCount
  59. }],
  60. digitalFlopStyle: {
  61. fontSize: 16,
  62. fill: '#333'
  63. },
  64. lineWidth: 30,
  65. color: ['#4da9ff', '#ff7070']
  66. }
  67. console.log(this.config);
  68. }
  69. }
  70. }
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. .full {
  75. width: 100%;
  76. height: 100%;
  77. }
  78. .center {
  79. display: flex;
  80. justify-content: center;
  81. align-items: center;
  82. }
  83. .page {
  84. background-color: #FFFFFF;
  85. padding: 1.2rem;
  86. box-sizing: border-box;
  87. }
  88. .static {
  89. width: 65%;
  90. font-size: 1rem;
  91. font-weight: 400;
  92. margin-top: -1rem;
  93. .data {
  94. padding-bottom: 0.625rem;
  95. display: flex;
  96. justify-content: space-between;
  97. div:last-child {
  98. font-size: 1rem;
  99. font-weight: 500;
  100. }
  101. }
  102. }
  103. /deep/ .dv-active-ring-chart .active-ring-info .active-ring-name {
  104. width: 100px;
  105. height: 30px;
  106. color: #333;
  107. text-align: center;
  108. vertical-align: middle;
  109. text-overflow: ellipsis;
  110. overflow: hidden;
  111. white-space: nowrap;
  112. }
  113. </style>