Browse Source

概览俩个

zbb 1 year ago
parent
commit
89e1d37735

+ 1 - 1
src/components/lineChart.vue

@@ -4,7 +4,7 @@ smooth:encode.bool,<template>
4 4
 
5 5
 <script>
6 6
 import * as echarts from 'echarts'
7
-const colors = ["#00F5FC", "#D5920F", "#FA6894","#4cff37"];
7
+const colors = ["#00F5FC", "#D5920F", "#FA6894","#4cff37","#8439f8", "#e7d65f"];
8 8
 export default {
9 9
   props: {
10 10
     id: { type: String, required: true },

+ 170 - 0
src/pages/index/components/event_monitoring.vue

@@ -0,0 +1,170 @@
1
+<template>
2
+  <div class="body-wrapper">
3
+    <el-table :data="tableData1" style="background: #2a2a2a;border-color: #333;">
4
+      <el-table-column v-for="(item, index) in columns1" :key="index" :label="item.label" :prop="item.key">
5
+      </el-table-column>
6
+    </el-table>
7
+    <div style="height: 300px">
8
+        <linechart
9
+          :autoStop="false"
10
+          :top="30"
11
+          :bottom="30"
12
+          :left="40"
13
+          :legendTop="0"
14
+          yAxisName="(件)"
15
+          :dataset="linedata"
16
+          :tooltipFormat="lineTooltipFormat"
17
+          :encode="[
18
+              { x: 'month', y: 'blacklistEvent', seriesName: '黑名单入场事件',bool:'true' },
19
+              { x: 'month', y: 'deckEvent', seriesName: '套牌车事件',bool:'true' },
20
+              { x: 'month', y: 'customerEvent', seriesName: '客诉事件',bool:'true' },
21
+              { x: 'month', y: 'deviceEvent', seriesName: '设备事件',bool:'true' },
22
+              { x: 'month', y: 'longEvent', seriesName: '超长停车事件',bool:'true' },
23
+              { x: 'month', y: 'largeEvent', seriesName: '大额欠费事件',bool:'true' },
24
+            ]"
25
+          id="sxcyfzqk"
26
+        />
27
+    </div>
28
+    <el-table :data="tableData" style="background: #2a2a2a;border-color: #333;">
29
+      <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
30
+      </el-table-column>
31
+    </el-table>
32
+    <div class="table-pagination">
33
+      <el-pagination :background="false" layout="total, prev, pager, next" :total="total" @current-change="handlePageChange"
34
+                     :current-page.sync="pageNum" :page-size.sync="pageSize">
35
+      </el-pagination>
36
+    </div>
37
+  </div>
38
+</template>
39
+<script>
40
+import api from "@/api/audit.js";
41
+import linechart from "@/components/lineChart";
42
+
43
+export default {
44
+  components: {
45
+    linechart,
46
+  },
47
+  data() {
48
+    return {
49
+      columns1: [
50
+        {
51
+          label: '实时事件数',
52
+          key: 'liveEvents'
53
+        },
54
+        {
55
+          label: '近日事件数',
56
+          key: 'recentEvents'
57
+        },
58
+        {
59
+          label: '历史事件数',
60
+          key: 'historicalEvents'
61
+        }
62
+      ],
63
+      tableData1: [],
64
+      linedata: [{month: '12-26', blacklistEvent:11,deckEvent:12,customerEvent:13,deviceEvent:11,longEvent:12,largeEvent:21},
65
+        {month: '12-27', blacklistEvent:12,deckEvent:13,customerEvent:12,deviceEvent:11,longEvent:11,largeEvent:12},
66
+        {month: '12-28', blacklistEvent:20,deckEvent:12,customerEvent:11,deviceEvent:22,longEvent:22,largeEvent:15},
67
+        {month: '12-29', blacklistEvent:13,deckEvent:14,customerEvent:21,deviceEvent:13,longEvent:13,largeEvent:12},
68
+        {month: '12-30', blacklistEvent:12,deckEvent:12,customerEvent:13,deviceEvent:12,longEvent:14,largeEvent:15},
69
+        {month: '12-31', blacklistEvent:13,deckEvent:12,customerEvent:12,deviceEvent:14,longEvent:21,largeEvent:21},],
70
+      columns: [
71
+        {
72
+          label: '停车场',
73
+          key: 'resourceName'
74
+        },
75
+        {
76
+          label: '泊位',
77
+          key: 'resourceType'
78
+        },
79
+        {
80
+          label: '车牌号',
81
+          key: 'plateno'
82
+        },
83
+        {
84
+          label: '日期',
85
+          key: 'creatTime'
86
+        },
87
+        {
88
+          label: '事件类型',
89
+          key: 'eventType'
90
+        }
91
+      ],
92
+      tableData: [],
93
+      total: 0,
94
+      pageSize: 10,
95
+      pageNum: 1,
96
+      radio: '2',
97
+      dialogVisible: false,
98
+      selRow: {},
99
+      searchWords: undefined
100
+    }
101
+  },
102
+  mounted() {
103
+    this.getTableData()
104
+  },
105
+  watch: {
106
+  },
107
+  methods: {
108
+    lineTooltipFormat(params) {
109
+      const data = params[0].data;
110
+      return `<div class="line-tooltip">
111
+        <div style="color: ${params[0].color}">${params[0].seriesName}: ${
112
+        params[0].data.blacklistEvent || "--"
113
+      }(件)</div>
114
+        <div style="color: ${params[1].color}">${params[1].seriesName}: ${
115
+        params[0].data.deckEvent || "--"
116
+      }(件)</div>
117
+        <div style="color: ${params[2].color}">${params[2].seriesName}: ${
118
+        params[0].data.customerEvent || "--"
119
+      }(件)</div>
120
+        <div style="color: ${params[3].color}">${params[3].seriesName}: ${
121
+        params[0].data.deviceEvent || "--"
122
+      }(件)</div>
123
+        <div style="color: ${params[4].color}">${params[4].seriesName}: ${
124
+        params[0].data.longEvent || "--"
125
+      }(件)</div>
126
+        <div style="color: ${params[5].color}">${params[5].seriesName}: ${
127
+        params[0].data.largeEvent || "--"
128
+      }(件)</div>
129
+      </div>`;
130
+    },
131
+    handlePageChange() {
132
+      this.getTableData()
133
+    },
134
+    handleAudit(row) {
135
+      this.selRow = row
136
+      this.dialogVisible = true
137
+    },
138
+    handleConfirm() {
139
+      const {id} = this.selRow
140
+      console.log('radio', this.radio)
141
+      api.applyResource({id, applyType: this.radio}).then(res => {
142
+        if(res.success) {
143
+          this.dialogVisible = false
144
+          this.getTableData()
145
+        }
146
+      })
147
+    },
148
+    getTableData() {
149
+      const {pageNum, pageSize, searchWords} = this
150
+      api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
151
+        this.tableData = []
152
+        this.total = res.data.total
153
+      })
154
+    },
155
+  }
156
+}
157
+</script>
158
+
159
+<style  lang="scss" scoped>
160
+.body-wrapper {
161
+  padding: 20px;
162
+  width: 100%;
163
+  height: 100%;
164
+  box-sizing: border-box;
165
+  background: #0c0c0c;
166
+  .table-pagination{
167
+    text-align: right;
168
+  }
169
+}
170
+</style>

+ 231 - 0
src/pages/index/components/resource_access.vue

@@ -0,0 +1,231 @@
1
+<template>
2
+  <div class="body-wrapper">
3
+    <el-table :data="tableData" style="background: #2a2a2a;border-color: #333;">
4
+      <el-table-column v-for="(item, index) in columns" :key="index" :label="item.label" :prop="item.key">
5
+      </el-table-column>
6
+    </el-table>
7
+    <div class="table-pagination">
8
+      <el-pagination :background="false" layout="total, prev, pager, next" :total="total"
9
+                     @current-change="handlePageChange"
10
+                     :current-page.sync="pageNum" :page-size.sync="pageSize">
11
+      </el-pagination>
12
+    </div>
13
+    <div style="display: flex; justify-content: space-between;">
14
+      <div style="width: 50%; height: 300px">
15
+        <h5 style="color: white">设备实时在线情况</h5>
16
+        <linechart
17
+          :autoStop="false"
18
+          :top="30"
19
+          :bottom="30"
20
+          :left="40"
21
+          :legendTop="0"
22
+          yAxisName="(个)"
23
+          :dataset="linedata"
24
+          :tooltipFormat="lineTooltipFormat"
25
+          :encode="[
26
+              { x: 'month', y: 'lastYearAmount', seriesName: '在线设备数' },
27
+              { x: 'month', y: 'thisYearAmount', seriesName: '总设备数' },
28
+            ]"
29
+          id="sxcyfzqk"
30
+        />
31
+      </div>
32
+      <div style="width: 50%; height: 300px">
33
+        <h5 style="color: white">接口实时调用趋势</h5>
34
+        <linechart
35
+          :autoStop="false"
36
+          :top="30"
37
+          :bottom="30"
38
+          :left="40"
39
+          :legendTop="0"
40
+          yAxisName="(次)"
41
+          :dataset="linedata1"
42
+          :tooltipFormat="lineTooltipFormat1"
43
+          :encode="[
44
+              { x: 'month', y: 'lastYearAmount', seriesName: '接口调用次数',bool:'true' },
45
+            ]"
46
+          id="sxcyfzqk1"
47
+        />
48
+      </div>
49
+    </div>
50
+    <div style="display: flex; justify-content: space-between;">
51
+      <div style="width: 50%; height: 300px">
52
+        <h5 style="color: white">接入累计图</h5>
53
+        <linechart
54
+          :autoStop="false"
55
+          :top="30"
56
+          :bottom="30"
57
+          :left="40"
58
+          :legendTop="0"
59
+          yAxisName="(次)"
60
+          :dataset="linedata2"
61
+          :tooltipFormat="lineTooltipFormat2"
62
+          :encode="[
63
+              { x: 'month', y: 'lastYearAmount', seriesName: '接入次数',bool:'true' },
64
+            ]"
65
+          id="sxcyfzqk2"
66
+        />
67
+      </div>
68
+      <div style="width: 50%; height: 300px">
69
+        <h5 style="color: white">设备掉线趋势</h5>
70
+        <linechart
71
+          :autoStop="false"
72
+          :top="30"
73
+          :bottom="30"
74
+          :left="40"
75
+          :legendTop="0"
76
+          yAxisName="(次)"
77
+          :dataset="linedata3"
78
+          :tooltipFormat="lineTooltipFormat3"
79
+          :encode="[
80
+              { x: 'month', y: 'lastYearAmount', seriesName: '设备掉线次数',bool:'true' },
81
+            ]"
82
+          id="sxcyfzqk3"
83
+        />
84
+      </div>
85
+    </div>
86
+    <div style="width: 50%; height: 400px" class="pie-div">
87
+      <h5 style="color: white">各区接入设备数</h5>
88
+      <piechart
89
+        class="model-pie-body"
90
+        id="chart1"
91
+        :roseType="false"
92
+        :radiusArr="['30%', '70%']"
93
+        :colorArr="modelPieColor"
94
+        :labelFormat="['{name|{b}}', '{sub|{@value}个 {d}%}', '{hr|}']"
95
+        :dataset="modelData.list"
96
+        :encode="{ itemName: 'name', value: 'value' }"
97
+      />
98
+    </div>
99
+  </div>
100
+</template>
101
+<script>
102
+import api from "@/api/audit.js";
103
+import piechart from "@/components/pieChart";
104
+import linechart from "@/components/lineChart";
105
+
106
+export default {
107
+  components: {
108
+    piechart,
109
+    linechart,
110
+  },
111
+  data() {
112
+    return {
113
+      modelPieColor: ["#4382f6","#9078f8","#ac4cb0"],
114
+      modelData: {
115
+        list: [{name: '源汇区', value: 30}, {name: '郾城区', value: 25}, {name: '召陵区', value: 15}]
116
+      },
117
+      linedata: [{month: '0:00-3:00', lastYearAmount: 65, thisYearAmount: 69}
118
+        , {month: '3:00-6:00', lastYearAmount: 65, thisYearAmount: 69}
119
+        , {month: '6:00-9:00', lastYearAmount: 64, thisYearAmount: 69}
120
+        , {month: '9:00-12:00', lastYearAmount: 64, thisYearAmount: 69}],
121
+      linedata1: [{month: '0:00-3:00', lastYearAmount: 12}
122
+        , {month: '3:00-6:00', lastYearAmount: 23}
123
+        , {month: '6:00-9:00', lastYearAmount: 34}
124
+        , {month: '9:00-12:00', lastYearAmount: 24}
125
+        , {month: '12:00-15:00', lastYearAmount: 26}],
126
+      linedata2: [{month: '智泊', lastYearAmount: 1020}
127
+        , {month: '现代智停', lastYearAmount: 1520}
128
+        , {month: '云慧智慧停车', lastYearAmount: 602}],
129
+      linedata3: [{month: '一月', lastYearAmount: 3}
130
+        , {month: '二月', lastYearAmount: 4}
131
+        , {month: '三月', lastYearAmount: 4}
132
+        , {month: '四月', lastYearAmount: 5}
133
+        , {month: '五月', lastYearAmount: 5}
134
+        , {month: '六月', lastYearAmount: 3}],
135
+      columns: [
136
+        {
137
+          label: '平台名称',
138
+          key: 'platformName'
139
+        },
140
+        {
141
+          label: '接入时间',
142
+          key: 'accessTime'
143
+        },
144
+        {
145
+          label: '接入状态',
146
+          key: 'accessType'
147
+        },
148
+        {
149
+          label: '接口版本',
150
+          key: 'accessVersion'
151
+        },
152
+        {
153
+          label: '累计调用次数',
154
+          key: 'cumulativeCalls'
155
+        },
156
+        {
157
+          label: '今日调用次数',
158
+          key: 'todayCumulativeCalls'
159
+        }
160
+      ],
161
+      tableData: [],
162
+      total: 0,
163
+      pageSize: 10,
164
+      pageNum: 1,
165
+      radio: '2',
166
+      dialogVisible: false,
167
+      selRow: {},
168
+      searchWords: undefined
169
+    }
170
+  },
171
+  mounted() {
172
+    this.getTableData()
173
+  },
174
+  watch: {},
175
+  methods: {
176
+    lineTooltipFormat(params) {
177
+      const data = params[0].data;
178
+      return `<div class="line-tooltip">
179
+        <div style="color: ${params[0].color}">${params[0].seriesName}: ${
180
+        params[0].data.lastYearAmount || "--"
181
+      }(件)</div>
182
+        <div style="color: ${params[1].color}">${params[1].seriesName}: ${
183
+        params[0].data.thisYearAmount || "--"
184
+      }(件)</div>
185
+      </div>`;
186
+    },
187
+    handlePageChange() {
188
+      this.getTableData()
189
+    },
190
+    handleAudit(row) {
191
+      this.selRow = row
192
+      this.dialogVisible = true
193
+    },
194
+    handleConfirm() {
195
+      const {id} = this.selRow
196
+      console.log('radio', this.radio)
197
+      api.applyResource({id, applyType: this.radio}).then(res => {
198
+        if (res.success) {
199
+          this.dialogVisible = false
200
+          this.getTableData()
201
+        }
202
+      })
203
+    },
204
+    getTableData() {
205
+      const {pageNum, pageSize, searchWords} = this
206
+      api.applyList({pageNum, pageSize, resourceName: searchWords}).then(res => {
207
+        this.tableData = []
208
+        this.total = res.data.total
209
+      })
210
+    },
211
+  }
212
+}
213
+</script>
214
+
215
+<style lang="scss" scoped>
216
+.body-wrapper {
217
+  padding: 20px;
218
+  width: 100%;
219
+  height: 100%;
220
+  box-sizing: border-box;
221
+  background: #0c0c0c;
222
+
223
+  .table-pagination {
224
+    text-align: right;
225
+  }
226
+  .pie-div{
227
+    margin: auto;
228
+    margin-top: 20px;
229
+  }
230
+}
231
+</style>

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

@@ -87,6 +87,8 @@ export default {
87 87
         {name: '泊位列表', url: '/berth_list'},
88 88
         {name: '业务概览', url: '/business_overview'},
89 89
         {name: '经营情况', url: '/business_conditions'},
90
+        {name: '事件监测', url: '/event_monitoring'},
91
+        {name: '资源接入', url: '/resource_access'},
90 92
       ]
91 93
     }
92 94
   },

+ 10 - 0
src/router/index.js

@@ -272,6 +272,16 @@ export default new Router({
272 272
           path: "/business_conditions",
273 273
           component: () => import("../pages/index/components/business_conditions.vue")
274 274
         },
275
+        {
276
+          name: "event_monitoring",
277
+          path: "/event_monitoring",
278
+          component: () => import("../pages/index/components/event_monitoring.vue")
279
+        },
280
+        {
281
+          name: "resource_access",
282
+          path: "/resource_access",
283
+          component: () => import("../pages/index/components/resource_access.vue")
284
+        },
275 285
       ]
276 286
     }
277 287
   ]