parking_operate.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template>
  2. <div class="body-wrapper">
  3. <el-form class="form-wrapper" :inline="true" :model="formInline1">
  4. <el-form-item label="行政区">
  5. <el-select clearable v-model="formInline1.regionCode" placeholder="请选择" popper-class="cur-select">
  6. <el-option v-for="item in districtOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
  7. </el-select>
  8. </el-form-item>
  9. <el-form-item label="街道">
  10. <el-input v-model="formInline1.streetName" placeholder="请输入"></el-input>
  11. </el-form-item>
  12. <el-form-item label="停车场">
  13. <el-select clearable filterable v-model="formInline1.parkId" placeholder="请选择" popper-class="cur-select">
  14. <el-option v-for="item in carOptions" :key="item.parkId" :label="item.carParkName" :value="item.parkId"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="查询日期">
  18. <el-date-picker
  19. clearable
  20. v-model="formInline1.time"
  21. type="daterange"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. value-format="yyyy-MM-dd"
  25. :picker-options="{disabledDate: (time) => time.getTime() > Date.now()}"
  26. end-placeholder="结束日期">
  27. </el-date-picker>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button type="primary" @click="queryAll">查询</el-button>
  31. </el-form-item>
  32. </el-form>
  33. <br>
  34. <div style="display: flex; justify-content: space-between;">
  35. <div style="width: 50%; height: 300px">
  36. <div align="center" style="color: white">停车饱和度</div>
  37. <barchart
  38. class="side-chart"
  39. :autoStop="false"
  40. :colorArr="['#ffd201', '#00eacb', '#01b4ff', '#5d78ff']"
  41. legendIcon="react"
  42. :bottom="30"
  43. :xlabelFormat="xLabelFormat"
  44. :top="60"
  45. yAxisName="(个)"
  46. :tooltip="tooltipFormat"
  47. :dataset="bardata"
  48. :encode="[
  49. {x: 'month', y: 'hs', seriesName: '占用'},
  50. {x: 'month', y: 'cs', seriesName: '空闲'}]"
  51. :labelSize="15"
  52. id="fxdqhszzt"
  53. />
  54. </div>
  55. <div style="width: 50%; height: 300px">
  56. <div align="center" style="color: white">停车场周转率分析</div>
  57. <linechart
  58. :autoStop="false"
  59. :top="30"
  60. :bottom="30"
  61. :left="40"
  62. :legendTop="0"
  63. yAxisName="(%)"
  64. :dataset="linedata1"
  65. :tooltipFormat="lineTooltipFormat1"
  66. :encode="[
  67. { x: 'month', y: 'lastAmount', seriesName: '停车场周转率',bool:'true' },
  68. ]"
  69. id="sxcyfzqk1"
  70. />
  71. </div>
  72. </div>
  73. <div style="display: flex; justify-content: space-between;margin-top: 5%">
  74. <div style="width: 50%; height: 300px;">
  75. <div align="center" style="color: white">停车场营收分析</div>
  76. <linechart
  77. :autoStop="false"
  78. :top="30"
  79. :bottom="30"
  80. :left="40"
  81. :legendTop="0"
  82. yAxisName="(元)"
  83. :dataset="linedata"
  84. :tooltipFormat="lineTooltipFormat"
  85. :encode="[
  86. { x: 'month', y: 'lastAmount', seriesName: '泊位收入',bool:'true' }
  87. ]"
  88. id="sxcyfzqk"
  89. />
  90. </div>
  91. <div style="width: 50%; height: 300px">
  92. <div align="center" style="color: white">车辆类型进场占比</div>
  93. <piechart
  94. class="model-pie-body"
  95. id="chart1"
  96. :roseType="false"
  97. :radiusArr="['30%', '70%']"
  98. :colorArr="modelPieColor"
  99. :labelFormat="['{name|{b}}', '{sub|{d}%}', '{hr|}']"
  100. :dataset="modelData.list"
  101. :encode="{ itemName: 'name', value: 'value' }"
  102. />
  103. </div>
  104. </div>
  105. <div style="display: flex; justify-content: space-between;margin-top: 5%">
  106. <div style="width: 50%; height: 300px;padding-left: 25px">
  107. <div align="center" style="color: white">车辆进出场趋势</div>
  108. <linechart
  109. :autoStop="false"
  110. :top="30"
  111. :bottom="30"
  112. :left="40"
  113. :legendTop="0"
  114. yAxisName="(%)"
  115. :dataset="linedata2"
  116. :tooltipFormat="lineTooltipFormat2"
  117. :encode="[
  118. { x: 'month', y: 'lastYearAmount', seriesName: '进流率',bool:'true' },
  119. { x: 'month', y: 'thisYearAmount', seriesName: '出流率',bool:'true' },
  120. ]"
  121. id="sxcyfzqk2"
  122. />
  123. </div>
  124. <div style="width: 50%; height: 300px;">
  125. <div align="center" style="color: white">停车场营收对比分析</div>
  126. <linechart
  127. :autoStop="false"
  128. :top="30"
  129. :bottom="30"
  130. :left="40"
  131. :legendTop="0"
  132. yAxisName="(元)"
  133. :dataset="linedata3"
  134. :tooltipFormat="lineTooltipFormat3"
  135. :encode="[
  136. { x: 'month', y: 'lastYearAmount', seriesName: '建材市场南侧停车场',bool:'true' },
  137. { x: 'month', y: 'thisYearAmount', seriesName: '市民之家东侧停车场',bool:'true' },
  138. ]"
  139. id="sxcyfzqk3"
  140. />
  141. </div>
  142. </div>
  143. </div>
  144. </template>
  145. <script>
  146. import piechart from "@/components/pieChart";
  147. import linechart from "@/components/lineChart";
  148. import barchart from "@/components/barChart";
  149. import vtable from "@/components/vtableNew";
  150. import api from "@/api/article_z";
  151. import options from '@/util/options'
  152. export default {
  153. components: {
  154. piechart,
  155. linechart,
  156. barchart,
  157. vtable
  158. },
  159. data() {
  160. return {
  161. districtOptions: options.districtOptions,
  162. carOptions: [],
  163. formInline1: {
  164. parkId: '',
  165. time: [],
  166. regionCode: '',
  167. streetName: ''
  168. },
  169. modelPieColor: ["#4382f6", "#9078f8", "#79a7db", "#FF9800"],
  170. modelData: {
  171. list: []
  172. },
  173. linedata: [],
  174. linedata1: [],
  175. linedata2: [],
  176. linedata3: [],
  177. bardata: [],
  178. }
  179. },
  180. mounted() {
  181. this.getParkDic()
  182. this.queryAll()
  183. },
  184. watch: {
  185. },
  186. methods: {
  187. getParkDic() {
  188. api.parkDic().then(res => {
  189. this.carOptions = res.data || [];
  190. })
  191. },
  192. queryAll() {
  193. let params = {...this.formInline1}
  194. if (
  195. this.formInline1.time && this.formInline1.time.length === 2 &&
  196. this.formInline1.time[1] !== ""
  197. ) {
  198. this.formInline1.time[0] = this.formInline1.time[0].substring(0, 10) + " 00:00:00";
  199. this.formInline1.time[1] = this.formInline1.time[1].substring(0, 10) + " 23:59:59";
  200. params.begin= this.formInline1.time[0]
  201. params.end = this.formInline1.time[1]
  202. }
  203. delete params.time
  204. this.getBardataData(params)
  205. this.getLinedata1Data(params)
  206. this.getLinedataData(params)
  207. this.getModelDataData(params)
  208. this.getLinedata2Data(params)
  209. this.getLinedata3Data(params)
  210. },
  211. //初始化
  212. getBardataData(params){
  213. api.queryParkingOperate_Tcbhd(params).then(res=>{
  214. this.bardata=res.data;
  215. })
  216. },
  217. getLinedata1Data(params){
  218. api.queryParkingOperate_Tczzlfx(params).then(res=>{
  219. this.linedata1=res.data;
  220. })
  221. },
  222. getLinedataData(params){
  223. api.queryParkingOperate_Tccysfx(params).then(res=>{
  224. this.linedata=res.data;
  225. })
  226. },
  227. getModelDataData(params){
  228. api.queryParkingOperate_Tscljczb(params).then(res=>{
  229. this.modelData.list=res.data;
  230. })
  231. },
  232. getLinedata2Data(params){
  233. api.queryParkingOperate_Cljccqs(params).then(res=>{
  234. this.linedata2=res.data;
  235. })
  236. },
  237. getLinedata3Data(params){
  238. api.queryParkingOperate_Tccysdbfx(params).then(res=>{
  239. this.linedata3=res.data;
  240. })
  241. },
  242. lineTooltipFormat1(params) {
  243. const data = params[0].data;
  244. return `<div class="line-tooltip">
  245. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  246. params[0].data.lastAmount || "--"
  247. }(%)</div>`;
  248. },
  249. lineTooltipFormat(params) {
  250. const data = params[0].data;
  251. return `<div class="line-tooltip">
  252. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  253. params[0].data.lastAmount || "--"
  254. }(元)</div>`;
  255. },
  256. lineTooltipFormat2(params) {
  257. const data = params[0].data;
  258. return `<div class="line-tooltip">
  259. <div style="color: ${params[1].color}">${params[1].seriesName}: ${
  260. params[0].data.thisYearAmount || "--"
  261. }(%)</div>
  262. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  263. params[0].data.lastYearAmount || "--"
  264. }(%)</div>
  265. </div>`;
  266. },
  267. lineTooltipFormat3(params) {
  268. const data = params[0].data;
  269. return `<div class="line-tooltip">
  270. <div style="color: ${params[0].color}">${params[0].seriesName}: ${
  271. params[0].data.lastYearAmount || "--"
  272. }(元)</div>
  273. <div style="color: ${params[1].color}">${params[1].seriesName}: ${
  274. params[0].data.thisYearAmount || "--"
  275. }(元)</div>
  276. </div>`;
  277. },
  278. xLabelFormat(name) {
  279. const nameArr = []
  280. for(let i=0; i<name.length; i+=7) {
  281. nameArr.push(name.substring(i, i+7))
  282. }
  283. return nameArr.join('\n');
  284. },
  285. tooltipFormat(params) {
  286. const type = params[0].seriesType;
  287. const data = params[0].data;
  288. // ${params[0].name || "--"}月:
  289. return `<div class="line-tooltip">
  290. <div>${params[0].seriesName}: ${
  291. params[0].data.hs || "--"}个</div>
  292. <div>${params[1].seriesName}: ${
  293. params[0].data.cs || "--"}个</div>
  294. </div>`;
  295. },
  296. }
  297. }
  298. </script>
  299. <style lang="scss" scoped>
  300. .form-wrapper {
  301. margin-bottom: 20px;
  302. }
  303. /deep/ .el-input__inner {
  304. background: #2d3744;
  305. border: none;
  306. border-radius: 0;
  307. }
  308. /deep/ .el-select {
  309. height: 40px;
  310. .el-input__inner {
  311. height: 40px;
  312. }
  313. .el-input__prefix, .el-input__suffix {
  314. height: 40px;
  315. }
  316. /* 下面设置右侧按钮居中 */
  317. .el-input__suffix {
  318. top: 0px;
  319. display: flex;
  320. justify-content: center;
  321. align-items: center;
  322. flex-wrap: nowrap;
  323. flex-direction: row;
  324. align-content: flex-start;
  325. }
  326. /* 输入框加上上下边是 32px + 2px =34px */
  327. .el-input__icon {
  328. line-height: 0px;
  329. }
  330. }
  331. /deep/ .form-wrapper .el-button {
  332. background: linear-gradient(90deg, #0158d9, #3c97e4);
  333. width: 100px;
  334. height: 40px;
  335. }
  336. .body-wrapper {
  337. padding: 20px;
  338. background: #0c0c0c;
  339. .button-block{
  340. text-align: right;
  341. margin-bottom: 20px;
  342. }
  343. .table-pagination{
  344. text-align: right;
  345. }
  346. .search-card{
  347. font-size: 24px;
  348. font-weight: bold;
  349. color: #3498db;
  350. margin-bottom: 20px;
  351. .input-wrapper{
  352. width: 36%;
  353. }
  354. }
  355. }
  356. .audit-dialog{
  357. .mg-bt{
  358. margin-bottom: 24px;
  359. }
  360. .label{
  361. text-align: right;
  362. }
  363. }
  364. .charts_all {
  365. display: flex;
  366. justify-content: space-around;
  367. width: 100%;
  368. height: 400px;
  369. }
  370. .charts {
  371. width: 30%;
  372. height: 300px;
  373. }
  374. .btn_save {
  375. background-color: #3498db;
  376. color: #ffffff;
  377. padding: 10px 20px;
  378. cursor: pointer;
  379. border: none;
  380. border-radius: 4px;
  381. font-size: 16px;
  382. height: 40px;
  383. }
  384. .sel {
  385. height: 200px;
  386. margin-right: 10px;
  387. }
  388. .input-search {
  389. width: 100%;
  390. padding: 10px;
  391. margin-bottom: 20px;
  392. box-sizing: border-box;
  393. background-color: #2a2a2a;
  394. border: 1px solid #333;
  395. color: #ffffff;
  396. }
  397. .audit-dialog {
  398. .mg-bt {
  399. margin-bottom: 24px;
  400. }
  401. .label {
  402. text-align: right;
  403. }
  404. .form-div {
  405. /deep/ .el-input__inner {
  406. height: 35px;
  407. width: 100%;
  408. border: 1px solid #a6a5a5;
  409. color: #fff;
  410. background: #2d3744;
  411. }
  412. /deep/ .el-input__icon {
  413. //line-height: 35px;
  414. }
  415. }
  416. }
  417. </style>