Browse Source

更新

更新
烬玊 1 year ago
parent
commit
c278a45a39
2 changed files with 242 additions and 0 deletions
  1. 237 0
      src/pages/index/components/berth_list.vue
  2. 5 0
      src/router/index.js

+ 237 - 0
src/pages/index/components/berth_list.vue

@@ -0,0 +1,237 @@
1
+<template>
2
+  <div class="body-wrapper">
3
+    <div style="display: flex; justify-content: space-between;">
4
+      <div style="width: 100%">
5
+        <h4>泊位列表</h4>
6
+        <br>
7
+        <el-form class="form-wrapper" :inline="true" :model="formInline">
8
+        <el-form-item>
9
+          <el-button type="success" @click="handleAdd">添加白名单</el-button>
10
+        </el-form-item>
11
+        </el-form>
12
+        <br>
13
+        <el-table :data="tableData" style="background: #F0FFFF;border-color: #333;">
14
+          <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
15
+          </el-table-column>
16
+        </el-table>
17
+
18
+        <div class="table-pagination">
19
+          <el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
20
+                         :current-page.sync="pageNum" :page-size.sync="pageSize">
21
+          </el-pagination>
22
+      </div>
23
+        <el-dialog
24
+          :title="title"
25
+          :visible.sync="dialogVisible"
26
+          width="60%"
27
+          custom-class="audit-dialog">
28
+          <el-form label-position="left" label-width="80px" :model="formLabelAlign">
29
+            <el-form-item label="泊位号">
30
+              <el-input v-model="tableData.ipAddr"></el-input>
31
+            </el-form-item>
32
+            <el-form-item label="泊车状态">
33
+              <el-input v-model="tableData.ipAddr"></el-input>
34
+            </el-form-item>
35
+          </el-form>
36
+          <span slot="footer" class="dialog-footer">
37
+            <el-button @click="dialogVisible = false">取 消</el-button>
38
+            <el-button type="primary" @click="handleConfirm">确 定</el-button>
39
+        </span>
40
+        </el-dialog>
41
+    </div>
42
+  </div>
43
+  </div>
44
+</template>
45
+<script>
46
+
47
+
48
+export default {
49
+  components: {
50
+
51
+  },
52
+  data() {
53
+    return {
54
+      columns: [
55
+        {
56
+          label: '停车场',
57
+          key: 'deviceName'
58
+        },
59
+        {
60
+          label: '泊位号',
61
+          key: 'deviceName'
62
+        },
63
+        {
64
+          label: '泊车状态',
65
+          key: 'deviceName'
66
+        },
67
+        {
68
+          label: '是否潮汐车位',
69
+          key: 'deviceName'
70
+        },
71
+        {
72
+          label: '是否充电泊位',
73
+          key: 'deviceName'
74
+        },
75
+        {
76
+          label: '是否共享泊位',
77
+          key: 'deviceName'
78
+        },
79
+        {
80
+          label: '是否异常',
81
+          key: 'deviceName'
82
+        },
83
+      ],
84
+      handlePageChange() {
85
+        this.getTableData()
86
+      },
87
+      formInline: {
88
+        interfaceName: '',
89
+        region: ''
90
+      },
91
+      tableData:[],
92
+      value: '',
93
+      modelPieColor: ["#4382f6", "#9078f8", "#79a7db", "#FF9800", "#9C27B0"],
94
+      modelPieColor1: ["#4382f6", "#9078f8", "#6aa1e1", "#FF9800", "#9C27B0"],
95
+      modelData: {
96
+        list: []
97
+      },
98
+      dialogVisible: false,
99
+      title: '',
100
+      total: 0,
101
+      pageSize: 5,
102
+      pageNum: 1,
103
+      bardata: [],
104
+    }
105
+  },
106
+  mounted() {
107
+    this.dashAccessDataAnalysisStat1()
108
+    this.dashAccessDataAnalysisStat2()
109
+  },
110
+  watch: {},
111
+  methods: {
112
+    tooltipFormat(params) {
113
+      const type = params[0].seriesType;
114
+      const data = params[0].data;
115
+      // ${params[0].name || "--"}月:
116
+      return `<div class="line-tooltip">
117
+<div>${params[0].seriesName}: ${
118
+        params[0].data.hs || "--"}个</div>
119
+<div>${params[1].seriesName}: ${
120
+        params[0].data.cs || "--"}个</div>
121
+</div>`;
122
+    },
123
+    xLabelFormat(name) {
124
+      const nameArr = []
125
+      for (let i = 0; i < name.length; i += 7) {
126
+        nameArr.push(name.substring(i, i + 7))
127
+      }
128
+      return nameArr.join('\n');
129
+    },
130
+    handleAdd () {
131
+      this.title = '添加泊位列表'
132
+      this.tableData.ipAddr = ''
133
+      this.dialogVisible = true
134
+    },
135
+    dashAccessDataAnalysisStat1(){
136
+      api.dashAccessDataAnalysisStat1().then(res =>{
137
+        this.bardata = res.data
138
+      })
139
+    },
140
+    dashAccessDataAnalysisStat2(){
141
+      api.dashAccessDataAnalysisStat2().then(res =>{
142
+        this.modelData.list = res.data
143
+      })
144
+    },
145
+  }
146
+}
147
+</script>
148
+<style lang="scss" scoped>
149
+.form-wrapper {
150
+  margin-bottom: 20px;
151
+}
152
+/deep/ .el-input__inner {
153
+  background: #2d3744;
154
+  border: none;
155
+  border-radius: 0;
156
+}
157
+/deep/ .el-select {
158
+  height: 40px;
159
+  .el-input__inner {
160
+    height: 40px;
161
+  }
162
+  .el-input__prefix, .el-input__suffix {
163
+    height: 40px;
164
+  }
165
+
166
+  /* 下面设置右侧按钮居中 */
167
+  .el-input__suffix {
168
+    top: 0px;
169
+    display: flex;
170
+    justify-content: center;
171
+    align-items: center;
172
+    flex-wrap: nowrap;
173
+    flex-direction: row;
174
+    align-content: flex-start;
175
+  }
176
+  /* 输入框加上上下边是 32px + 2px =34px */
177
+  .el-input__icon {
178
+    line-height: 0px;
179
+  }
180
+}
181
+/deep/ .form-wrapper .el-button {
182
+  background: linear-gradient(90deg,#0158d9,#3c97e4);
183
+  width: 100px;
184
+  height: 40px;
185
+}
186
+.body-wrapper {
187
+  width: 100%;
188
+  height: 100%;
189
+  box-sizing: border-box;
190
+
191
+}
192
+
193
+.model-pie-body {
194
+  width: 100%;
195
+  height: 99%;
196
+}
197
+
198
+.form-wrapper {
199
+  margin-bottom: 20px;
200
+}
201
+/deep/ .el-input__inner {
202
+  background: #2d3744;
203
+  border: none;
204
+  border-radius: 0;
205
+}
206
+/deep/ .el-select {
207
+  height: 40px;
208
+  .el-input__inner {
209
+    height: 40px;
210
+  }
211
+  .el-input__prefix, .el-input__suffix {
212
+    height: 40px;
213
+  }
214
+
215
+  /* 下面设置右侧按钮居中 */
216
+  .el-input__suffix {
217
+    top: 0px;
218
+    display: flex;
219
+    justify-content: center;
220
+    align-items: center;
221
+    flex-wrap: nowrap;
222
+    flex-direction: row;
223
+    align-content: flex-start;
224
+  }
225
+  /* 输入框加上上下边是 32px + 2px =34px */
226
+  .el-input__icon {
227
+    line-height: 0px;
228
+  }
229
+}
230
+/deep/ .form-wrapper .el-button {
231
+  background: linear-gradient(90deg,#0158d9,#3c97e4);
232
+  width: 100px;
233
+  height: 40px;
234
+}
235
+
236
+
237
+</style>

+ 5 - 0
src/router/index.js

@@ -27,6 +27,11 @@ export default new Router({
27
           path: "/demo2",
27
           path: "/demo2",
28
           component: () => import("../pages/index/components/demo2.vue")
28
           component: () => import("../pages/index/components/demo2.vue")
29
         },
29
         },
30
+        {
31
+          name: "berth_list",
32
+          path: "/berth_list",
33
+          component: () => import("../pages/index/components/berth_list.vue")
34
+        },
30
       ]
35
       ]
31
     }
36
     }
32
   ]
37
   ]