Browse Source

夜间停车统计,车辆类型

duwendi 1 year ago
parent
commit
24e6217097

+ 223 - 0
src/pages/index/components/night_parking_statistics.vue

@@ -0,0 +1,223 @@
1
+<template>
2
+  <div class="body-wrapper">
3
+    <div class="page-container">
4
+      <h2 style="color: #3498db;">日夜间停车总小时数</h2>
5
+      <div style="width: 99%; height: 480px">
6
+        <linechart
7
+          :autoStop="false"
8
+          :top="30"
9
+          :bottom="180"
10
+          :left="40"
11
+          :legendTop="0"
12
+          yAxisName="(停车数)"
13
+          :dataset="linedata"
14
+          :xlabelFormat="taskFinishXFormat"
15
+          :tooltipFormat="lineTooltipFormat"
16
+          :encode="[
17
+              { x: 'month', y: 'lastAmount', seriesName: '泊位盈余情况',bool:'true' },
18
+            ]"
19
+          id="sxcyfzqk"
20
+        />
21
+      </div>
22
+      <el-form class="form-wrapper" :inline="true" :model="formInline">
23
+        <el-form-item label="停车场名称">
24
+          <el-input v-model="formInline.carParkName" placeholder="请输入"></el-input>
25
+        </el-form-item>
26
+        <el-form-item>
27
+          <el-button type="primary" @click="onSubmit">查询</el-button>
28
+        </el-form-item>
29
+      </el-form>
30
+      <el-table :data="tableData">
31
+        <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
32
+        </el-table-column>
33
+      </el-table>
34
+      <div class="table-pagination">
35
+        <el-pagination layout="prev, pager, next" :total="total" @current-change="handlePageChange"
36
+                       :current-page.sync="pageNum" :page-size.sync="pageSize">
37
+        </el-pagination>
38
+      </div>
39
+    </div>
40
+  </div>
41
+</template>
42
+<script>
43
+import linechart from "@/components/lineChart";
44
+import api from "@/api/article_z";
45
+
46
+
47
+export default {
48
+  components: {
49
+    linechart
50
+  },
51
+  data() {
52
+    return {
53
+      linedata: [],
54
+      pageNum: 1,
55
+      pageSize: 10,
56
+      total: 0,
57
+      formInline: {
58
+        carParkName: ''
59
+      },
60
+      tableData: [],
61
+      columns: [
62
+        {
63
+          label: '停车场',
64
+          key: 'carParkName'
65
+        },
66
+        {
67
+          label: '日间停车总时长',
68
+          key: 'dayTime'
69
+        },
70
+        {
71
+          label: '夜间停车总时长',
72
+          key: 'nightTime'
73
+        }
74
+      ],
75
+    }
76
+  },
77
+  mounted() {
78
+    this.getLinedata()
79
+    this.getTabledata()
80
+  },
81
+  watch: {
82
+
83
+  },
84
+  methods: {
85
+    taskFinishXFormat(name) {
86
+      var str = name.split("");
87
+      return str.join("\n");
88
+    },
89
+    getLinedata(){
90
+      api.queryBerthPerationNalysis_Bwyyqk().then(res=>{
91
+        this.linedata=res.data;
92
+      })
93
+    },
94
+    lineTooltipFormat(params) {
95
+      const data = params[0].data;
96
+      return `<div class="line-tooltip">
97
+        <div style="color: ${params[0].color}">${params[0].seriesName}: ${
98
+        params[0].data.lastAmount || "--"
99
+      }</div>`;
100
+    },
101
+    getTabledata() {
102
+      const {pageNum, pageSize} = this;
103
+      // todo
104
+      api.queryList({current: pageNum, size: pageSize, ...this.formInline}).then(res => {
105
+        this.tableData = res.data.records || []
106
+        this.total = res.data.total || 0
107
+      })
108
+    },
109
+    onSubmit() {
110
+      this.pageNum = 1;
111
+      this.getTabledata()
112
+    },
113
+    handlePageChange() {
114
+      this.getTabledata()
115
+    }
116
+  }
117
+}
118
+</script>
119
+<style  lang="scss" scoped>
120
+
121
+.form-wrapper {
122
+  margin-bottom: 20px;
123
+}
124
+/deep/ .el-input__inner {
125
+  background: #2d3744;
126
+  border: none;
127
+  border-radius: 0;
128
+}
129
+/deep/ .el-select {
130
+  height: 40px;
131
+  .el-input__inner {
132
+    height: 40px;
133
+  }
134
+  .el-input__prefix, .el-input__suffix {
135
+    height: 40px;
136
+  }
137
+
138
+  /* 下面设置右侧按钮居中 */
139
+  .el-input__suffix {
140
+    top: 0px;
141
+    display: flex;
142
+    justify-content: center;
143
+    align-items: center;
144
+    flex-wrap: nowrap;
145
+    flex-direction: row;
146
+    align-content: flex-start;
147
+  }
148
+  /* 输入框加上上下边是 32px + 2px =34px */
149
+  .el-input__icon {
150
+    line-height: 0px;
151
+  }
152
+}
153
+/deep/ .form-wrapper .el-button {
154
+  background: linear-gradient(90deg,#0158d9,#3c97e4);
155
+  width: 100px;
156
+  height: 40px;
157
+}
158
+.body-wrapper {
159
+  padding: 20px;
160
+  background: #0c0c0c;
161
+  .button-block{
162
+    text-align: right;
163
+    margin-bottom: 20px;
164
+  }
165
+  .table-pagination{
166
+    text-align: right;
167
+  }
168
+  .search-card{
169
+    margin-bottom: 20px;
170
+    text-align: center;
171
+    .input-wrapper{
172
+      width: 36%;
173
+    }
174
+  }
175
+}
176
+.body-wrapper {
177
+  padding: 20px;
178
+  .button-block{
179
+    text-align: right;
180
+    margin-bottom: 20px;
181
+  }
182
+  .table-pagination{
183
+    text-align: right;
184
+  }
185
+  .search-card{
186
+    margin-bottom: 20px;
187
+    text-align: center;
188
+    .input-wrapper{
189
+      width: 36%;
190
+    }
191
+  }
192
+}
193
+.audit-dialog{
194
+  .mg-bt{
195
+    margin-bottom: 24px;
196
+  }
197
+  .label{
198
+    text-align: right;
199
+  }
200
+}
201
+.middle-map {
202
+  width: 100%;
203
+  height: 800px;
204
+  .bottom {
205
+    height: 90%;
206
+    width: 100%;
207
+  }
208
+  /deep/.map-tooltip {
209
+    font-size: 18px;
210
+    padding: 10px 20px;
211
+    background: url("../../../../static/img/u231.png");
212
+    background-size: 100% 100%;
213
+    .map-tooltip-name {
214
+      color: #00e4ff;
215
+    }
216
+    .map-tooltip-value {
217
+      color: white;
218
+      margin-left: 20px;
219
+    }
220
+  }
221
+}
222
+
223
+</style>

+ 209 - 0
src/pages/index/components/vehicle_type.vue

@@ -0,0 +1,209 @@
1
+<template>
2
+  <div class="body-wrapper">
3
+    <div class="search-card">
4
+      <h5>车辆类型分析</h5>
5
+    </div>
6
+    <br>
7
+    <div class="charts">
8
+      <div style="width: 50%;height: 500px;">
9
+        <h4 style="color: white">新能源车占比</h4>
10
+        <piechart
11
+          class="model-pie-body"
12
+          id="chart1"
13
+          :radiusArr="['30%', '70%']"
14
+          :roseType = "false"
15
+          :colorArr="modelPieColor"
16
+          :labelFormat="['{name|{b}}', '{sub|{@value}辆 {d}%}', '{hr|}']"
17
+          :dataset="modelData"
18
+          :encode="{ itemName: 'name', value: 'value' }"
19
+        />
20
+      </div>
21
+      <div style="width: 50%;height: 500px;">
22
+        <h4 style="color: white">车型分类</h4>
23
+        <piechart
24
+          class="model-pie-body"
25
+          id="chart3"
26
+          :radiusArr="['30%', '70%']"
27
+          :roseType = "false"
28
+          :colorArr="modelPieColor4"
29
+          :labelFormat="['{name|{b}}', '{sub|{@value}辆 {d}%}', '{hr|}']"
30
+          :dataset="modelData4"
31
+          :encode="{ itemName: 'name', value: 'value' }"
32
+        />
33
+      </div>
34
+      <br>
35
+    </div>
36
+    <br>
37
+    <br>
38
+    <div class="charts">
39
+      <div style="width: 50%;height: 500px;">
40
+        <h4 style="color: white">新能源趋势</h4>
41
+        <linechart
42
+          :autoStop="false"
43
+          :top="30"
44
+          :bottom="30"
45
+          :left="40"
46
+          :legendTop="0"
47
+          yAxisName="%"
48
+          :dataset="linedata"
49
+          :tooltipFormat="lineTooltipFormat"
50
+          :encode="[
51
+              { x: 'month', y: 'lastYearAmount', seriesName: '入场',bool:'true' },
52
+            ]"
53
+          id="sxcyfzqk"
54
+        />
55
+      </div>
56
+      <div style="width: 50%;height: 500px;">
57
+        <h4 style="color: white">新能源车排名</h4>
58
+        <div class="progress-wrapper">
59
+          <div style="display: flex;line-height: 50px;" v-for="item in progresslist">
60
+            <span style="color: #fff; padding: 0 10px;">{{item.label}}</span>
61
+            <el-progress :text-inside="false" :stroke-width="26" :percentage="item.value" define-back-color="#191e3a" text-color="#888ea8"></el-progress>
62
+          </div>
63
+        </div>
64
+      </div>
65
+      <br>
66
+    </div>
67
+  </div>
68
+</template>
69
+<script>
70
+import piechart from "@/components/pieChart";
71
+import linechart from "@/components/lineChart";
72
+import api from "@/api/article_liao";
73
+export default {
74
+  components: {
75
+    piechart,
76
+    linechart
77
+  },
78
+  data() {
79
+    return {
80
+      linedata: [],
81
+      modelPieColor: ["#4382f6","#9078f8","#DAA520","#2E8B57"],
82
+      modelData: [],
83
+      modelPieColor4: ["#4382f6","#9078f8"],
84
+      modelData4: [],
85
+      modelPieColor5: ["#4382f6","#9078f8"],
86
+      modelData5: [],
87
+      progresslist: [{
88
+        label: '比亚迪',
89
+        value: 30
90
+      },{
91
+        label: '特斯拉',
92
+        value: 50
93
+      },{
94
+        label: '特斯拉',
95
+        value: 70
96
+      }]
97
+    }
98
+  },
99
+  mounted() {
100
+    this.parkBehaviorDuration()
101
+    this.parkBehaviorRange()
102
+    this.parkBehaviorTemporary()
103
+    this.parkBehaviorNight()
104
+  },
105
+  watch: {
106
+  },
107
+  methods: {
108
+    lineTooltipFormat(params) {
109
+      return `<div class="line-tooltip">
110
+        <div style="color: ${params[0].color}">${params[0].seriesName}: ${
111
+        params[0].data.lastYearAmount || "--"
112
+      }</div>
113
+      </div>`;
114
+    },
115
+    parkBehaviorDuration() {
116
+      api.parkBehaviorDuration().then(res =>{
117
+        this.modelData = res.data
118
+      })
119
+    },
120
+    parkBehaviorRange(){
121
+      api.parkBehaviorRange().then(res =>{
122
+        this.linedata = res.data
123
+      })
124
+    },
125
+    parkBehaviorTemporary(){
126
+      api.parkBehaviorTemporary().then(res =>{
127
+        this.modelData4 = res.data
128
+      })
129
+    },
130
+    parkBehaviorNight(){
131
+      api.parkBehaviorNight().then(res =>{
132
+        this.modelData5 = res.data
133
+      })
134
+    },
135
+  }
136
+}
137
+</script>
138
+<style  lang="scss" scoped>
139
+.body-wrapper {
140
+  padding: 20px;
141
+  background: #0c0c0c;
142
+  width: 100%;
143
+  .button-block{
144
+    text-align: right;
145
+    margin-bottom: 20px;
146
+  }
147
+  .table-pagination{
148
+    text-align: right;
149
+  }
150
+  .search-card{
151
+    font-size: 24px;
152
+    font-weight: bold;
153
+    color: #3498db;
154
+    margin-bottom: 20px;
155
+    .input-wrapper{
156
+      width: 36%;
157
+    }
158
+  }
159
+}
160
+
161
+.charts{
162
+  width: 100%;
163
+  display: flex;
164
+  justify-content: space-between;
165
+}
166
+.btn_save{
167
+  background-color: #3498db;
168
+  color: #ffffff;
169
+  padding: 10px 20px;
170
+  cursor: pointer;
171
+  border: none;
172
+  border-radius: 4px;
173
+  font-size: 16px;
174
+  height: 40px;
175
+}
176
+
177
+.sel{
178
+  height: 200px;
179
+  margin-right: 10px;
180
+}
181
+
182
+.input-search{
183
+  width: 100%;
184
+  padding: 10px;
185
+  margin-bottom: 20px;
186
+  box-sizing: border-box;
187
+  background-color: #2a2a2a;
188
+  border: 1px solid #333;
189
+  color: #ffffff;
190
+}
191
+.audit-dialog{
192
+  .mg-bt{
193
+    margin-bottom: 24px;
194
+  }
195
+  .label{
196
+    text-align: right;
197
+  }
198
+}
199
+.progress-wrapper {
200
+  width: 100%;
201
+  height: 480px;
202
+  .el-progress {
203
+    line-height: 50px;
204
+  }
205
+}
206
+/deep/.el-progress-bar__outer {
207
+  background-color: #191e3a !important;
208
+}
209
+</style>

+ 2 - 0
src/pages/index/layouts/indexLayout.vue

@@ -99,6 +99,8 @@ export default {
99 99
         {name: '临时停车统计', url: '/temp_parking-statistics'},
100 100
         {name: '泊位周转分析 ', url: '/berth_turnover'},
101 101
         {name: '停车场泊位分析 ', url: '/parking_lot'},
102
+        {name: '夜间停车统计 ', url: '/night_parking_statistics'},
103
+        {name: '车辆类型 ', url: '/vehicle_type'},
102 104
       ]
103 105
     }
104 106
   },

+ 10 - 0
src/router/index.js

@@ -333,6 +333,16 @@ export default new Router({
333 333
           path: "/berth_use",
334 334
           component: () => import("../pages/index/components/berth_use.vue")
335 335
         },
336
+        {
337
+          name: "night_parking_statistics",
338
+          path: "/night_parking_statistics",
339
+          component: () => import("../pages/index/components/night_parking_statistics.vue")
340
+        },
341
+        {
342
+          name: "vehicle_type",
343
+          path: "/vehicle_type",
344
+          component: () => import("../pages/index/components/vehicle_type.vue")
345
+        },
336 346
       ]
337 347
     }
338 348
   ]