lifeParking.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <script>
  2. import Query from "@/components/common/query.vue";
  3. import Card from "@/components/common/card.vue";
  4. import CoreData from "@/components/common/coreData.vue";
  5. import LifeParkTrendChart from "@/components/life/parking/components/lifeParkTrendChart.vue";
  6. import lifeParkUnNormalChart from "@/components/life/parking/components/lifeParkUnNormalChart.vue";
  7. import LifeParkConsumeChart from "@/components/life/parking/components/lifeParkConsumeChart.vue";
  8. import LifeParkingTopChart from "@/components/life/parking/components/lifeParkTopTable.vue";
  9. import LifeParkDetailTable from "@/components/life/parking/components/lifeParkDetailTable.vue";
  10. import apiLifePark from "@/api/life/apiLifePark";
  11. export default {
  12. data() {
  13. let range = this.$util.dateUtil.getNearlyMonthRange();
  14. return {
  15. chartsHeight: 290,
  16. topSelect: '5',
  17. queryData: {
  18. companyId: '0',
  19. deptId: '0',
  20. timeRange: range
  21. },
  22. coreData: [
  23. {
  24. title: '车位数量(个)',
  25. num: 0,
  26. historyDesc: '同比',
  27. historyNum: 0
  28. },
  29. {
  30. title: '平均停车数量(辆/天)',
  31. num: 0,
  32. historyDesc: '同比',
  33. historyNum: 0
  34. },
  35. {
  36. title: '违停数量(辆)',
  37. num: 0,
  38. historyDesc: '同比',
  39. historyNum: 0
  40. },
  41. {
  42. title: '车位使用率',
  43. num: 0,
  44. unit: "%",
  45. historyDesc: '同比',
  46. historyNum: 0
  47. },
  48. {
  49. type: 1,
  50. isHighLight: false,
  51. title: '值得关注',
  52. showStar: true,
  53. content: ''
  54. },
  55. ],
  56. oriEmptyParks: [],
  57. emptyParks: [],
  58. parkDetails: [],
  59. }
  60. },
  61. components: {
  62. Query,
  63. Card,
  64. CoreData,
  65. LifeParkTrendChart,
  66. lifeParkUnNormalChart,
  67. LifeParkConsumeChart,
  68. LifeParkingTopChart,
  69. LifeParkDetailTable,
  70. },
  71. created() {
  72. },
  73. mounted() {
  74. this.init();
  75. },
  76. methods: {
  77. init() {
  78. this.$util.asyncPromise(
  79. this.getCoreData(),
  80. this.getEmptyPark(),
  81. this.getParkDetail()
  82. )
  83. },
  84. reset() {
  85. },
  86. search(data) {
  87. this.$util.asyncPromise(
  88. this.getCoreData(),
  89. this.getEmptyPark(),
  90. this.getParkDetail(),
  91. this.$refs.LifeParkConsumeChart.getData(),
  92. this.$refs.LifeParkTrendChart.getData(),
  93. this.$refs.LifeParkUnNormalChart.getData(),
  94. )
  95. },
  96. getCoreData() {
  97. return apiLifePark.getCoreData(this.queryData).then(res => {
  98. this.coreData[0].num = res.list[0].value
  99. this.coreData[0].historyNum = res.list[0].compare
  100. this.coreData[1].num = res.list[1].value
  101. this.coreData[1].historyNum = res.list[1].compare
  102. this.coreData[2].num = res.list[2].value
  103. this.coreData[2].historyNum = res.list[2].compare
  104. this.coreData[3].num = res.list[3].value
  105. this.coreData[3].historyNum = res.list[3].compare
  106. this.coreData[4].content = res.worthAttention
  107. })
  108. },
  109. getEmptyPark() {
  110. return apiLifePark.getVacantParkingSpace(this.queryData).then(res=>{
  111. this.oriEmptyParks = res
  112. this.handleTopChange();
  113. })
  114. },
  115. handleTopChange() {
  116. this.emptyParks = this.oriEmptyParks.slice(0, this.topSelect)
  117. },
  118. getParkDetail() {
  119. return apiLifePark.getParkingSpaceDetails(this.queryData).then(res=>{
  120. this.parkDetails = res
  121. })
  122. },
  123. }
  124. }
  125. </script>
  126. <template>
  127. <div class="lifeParking">
  128. <div class="page-query-core">
  129. <a-row>
  130. <a-col>
  131. <div class="lifeParking-query">
  132. <Query :query-data.sync="queryData" :show="['company','dept','time']" :reset="reset"
  133. :search="search"></Query>
  134. </div>
  135. </a-col>
  136. <a-col>
  137. <div class="lifeParking-core">
  138. <Card title="核心指标">
  139. <CoreData :data-list="coreData"></CoreData>
  140. </Card>
  141. </div>
  142. </a-col>
  143. </a-row>
  144. </div>
  145. <div style="margin-top: 12px">
  146. <a-row :gutter="[12,12]" >
  147. <a-col :span="18">
  148. <div class="lifeParking-trend ioc-card-content">
  149. <Card title="车流态势">
  150. <LifeParkTrendChart ref="LifeParkTrendChart" :queryData="queryData" :height="320"></LifeParkTrendChart>
  151. </Card>
  152. </div>
  153. </a-col>
  154. <a-col :span="6">
  155. <div class="lifeParking-top ioc-card-content">
  156. <Card title="空置车位">
  157. <div style="height: 340px;overflow-y: auto">
  158. <LifeParkingTopChart :tableData="emptyParks"></LifeParkingTopChart>
  159. </div>
  160. <template #title-extra>
  161. <a-select v-model="topSelect" default-value="5" style="width: 100px;" size="small" @change="handleTopChange">
  162. <a-select-option value="5">TOP5</a-select-option>
  163. <a-select-option value="10">TOP10</a-select-option>
  164. <a-select-option value="15">TOP15</a-select-option>
  165. </a-select>
  166. </template>
  167. </Card>
  168. </div>
  169. </a-col>
  170. <a-col :span="9">
  171. <div class="lifeParking-unNormal ioc-card-content">
  172. <Card title="违停情况">
  173. <LifeParkUnNormalChart ref="LifeParkUnNormalChart" :queryData="queryData" :height="390"></LifeParkUnNormalChart>
  174. </Card>
  175. </div>
  176. </a-col>
  177. <a-col :span="9">
  178. <div class="lifeParking-consume ioc-card-content">
  179. <Card title="占用车位数量">
  180. <LifeParkConsumeChart ref="LifeParkConsumeChart" :queryData="queryData" :height="390"></LifeParkConsumeChart>
  181. </Card>
  182. </div>
  183. </a-col>
  184. <a-col :span="6">
  185. <div class="lifeParking-detail ioc-card-content">
  186. <Card title="车位详情">
  187. <div style="height: 340px;overflow-y: auto">
  188. <LifeParkDetailTable :data="parkDetails"></LifeParkDetailTable>
  189. </div>
  190. </Card>
  191. </div>
  192. </a-col>
  193. </a-row>
  194. </div>
  195. </div>
  196. </template>
  197. <style lang="less" scoped>
  198. .lifeParking {
  199. width: 100%;
  200. height: auto;
  201. padding-bottom: 12px;
  202. display: inline-block;
  203. vertical-align: top;
  204. .lifeParking-query {
  205. width: 100%;
  206. }
  207. .lifeParking-core {
  208. width: 100%;
  209. }
  210. .lifeParking-trend {
  211. background-color: #ffffff;
  212. height: 390px;
  213. overflow: hidden;
  214. }
  215. .lifeParking-unNormal {
  216. height: 390px;
  217. overflow: hidden;
  218. }
  219. .lifeParking-consume {
  220. height: 390px;
  221. overflow: hidden;
  222. }
  223. .lifeParking-top {
  224. height: 390px;
  225. overflow-y: hidden;
  226. }
  227. .lifeParking-detail {
  228. height: 390px;
  229. overflow-y: hidden;
  230. }
  231. }
  232. /deep/ .lifeParking-top .ant-select-selection {
  233. background-color: #f8fafb;
  234. border: none;
  235. border-radius: 6px;
  236. padding: 0px 12px;
  237. color: #B2B2B2;
  238. }
  239. </style>