|
@@ -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>
|