陈嘉新
authored
|
1
2
|
<template>
<div class="interfacel">
|
陈嘉新
authored
|
3
4
5
6
7
8
9
10
11
12
|
<el-form
:model="queryConfig"
:rules="rules"
ref="queryConfig"
label-width="100px"
class="demo-queryConfig"
>
<el-row :gutter="10">
<el-col :span="3">
<el-form-item label="设备名:" prop="name">
|
陈嘉新
authored
|
13
14
15
16
|
<el-input
v-model="queryConfig.equipmentCode"
placeholder="请选择设备名"
></el-input>
|
陈嘉新
authored
|
17
18
19
20
|
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="日志分类:" prop="name">
|
陈嘉新
authored
|
21
22
23
24
|
<el-input
v-model="queryConfig.logType"
placeholder="请选择日志分类"
></el-input>
|
陈嘉新
authored
|
25
26
27
28
|
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="消息:" prop="name">
|
陈嘉新
authored
|
29
30
31
32
|
<el-input
v-model="queryConfig.message"
placeholder="请选择消息"
></el-input>
|
陈嘉新
authored
|
33
34
35
36
|
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="日志级别:" prop="">
|
陈嘉新
authored
|
37
38
39
40
|
<el-select
v-model="queryConfig.bllResultCode"
placeholder="请选择日志级别"
>
|
陈嘉新
authored
|
41
|
<el-option
|
陈嘉新
authored
|
42
|
v-for="item in optionsBllResult"
|
陈嘉新
authored
|
43
44
45
46
47
|
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
|
陈嘉新
authored
|
48
49
50
51
|
</el-form-item>
</el-col>
<el-col :span="3.5">
<el-form-item label="开始时间:" prop="">
|
陈嘉新
authored
|
52
53
54
55
56
|
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
|
陈嘉新
authored
|
57
58
59
60
|
</el-form-item>
</el-col>
<el-col :span="3.5">
<el-form-item label="结束时间:" prop="">
|
陈嘉新
authored
|
61
62
63
64
65
|
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="选择日期时间"
/>
|
陈嘉新
authored
|
66
67
68
69
70
71
72
73
|
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="" prop="">
<el-button
icon="el-icon-search"
class="T1"
@click="btnAction()"
|
陈嘉新
authored
|
74
|
size="small"
|
陈嘉新
authored
|
75
76
77
|
type="primary"
>查询</el-button
>
|
陈嘉新
authored
|
78
79
80
|
<el-button class="T1" size="small" @click="details()"
>查询情况</el-button
>
|
陈嘉新
authored
|
81
82
83
84
85
86
87
|
<!-- <el-button class="T1" @click="goodsTypeModify()" disabled
>导出</el-button
> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
|
陈嘉新
authored
|
88
|
<div class="table">
|
陈嘉新
authored
|
89
90
|
<el-table
:data="tableData"
|
陈嘉新
authored
|
91
92
93
|
border
stripe
:height="TableHeight"
|
陈嘉新
authored
|
94
|
@selection-change="handleSelectionChange"
|
陈嘉新
authored
|
95
|
:header-cell-style="{ color: '#000000' }"
|
陈嘉新
authored
|
96
|
>
|
陈嘉新
authored
|
97
98
99
100
101
|
<el-table-column
type="selection"
align="center"
width="55"
></el-table-column>
|
陈嘉新
authored
|
102
|
<el-table-column prop="id" label="内置id" width="180">
|
陈嘉新
authored
|
103
|
</el-table-column>
|
陈嘉新
authored
|
104
|
<el-table-column prop="equipmentCode" label="设备名" width="180">
|
陈嘉新
authored
|
105
|
</el-table-column>
|
陈嘉新
authored
|
106
107
108
109
110
111
|
<el-table-column prop="logType" label="日志分类"> </el-table-column>
<el-table-column prop="message" label="消息"> </el-table-column>
<el-table-column prop="bllResultCode" label="日志级别">
</el-table-column>
<el-table-column prop="errorCode" label="报警代码"> </el-table-column>
<el-table-column prop="created" label="创建时间"> </el-table-column>
|
陈嘉新
authored
|
112
113
114
|
</el-table>
<div class="pagination-container">
<el-pagination
|
陈嘉新
authored
|
115
116
117
118
|
style="margin-top: 15px"
align="center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
|
陈嘉新
authored
|
119
|
:current-page="queryConfig.currentPage"
|
陈嘉新
authored
|
120
|
:page-sizes="[20, 50, 100]"
|
陈嘉新
authored
|
121
|
:page-size="queryConfig.pageSize"
|
陈嘉新
authored
|
122
|
layout="total, sizes, prev, pager, next, jumper"
|
陈嘉新
authored
|
123
|
:total="total"
|
陈嘉新
authored
|
124
|
/>
|
陈嘉新
authored
|
125
126
|
</div>
</div>
|
陈嘉新
authored
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
<el-dialog title="系统日志详情" :visible.sync="dialogFormVisible">
<div class="container" v-for="(item, index) in detailsData" :key="index">
<div class="box">
<div class="inner-left">内部id:</div>
<div class="inner-right">{{ item.id }}</div>
</div>
<div class="box">
<div class="inner-left">日志级别:</div>
<div class="inner-right">{{ item.bllResultCode }}</div>
</div>
<div class="box">
<div class="inner-left">设备编码:</div>
<div class="inner-right">{{ item.equipmentCode }}</div>
</div>
<div class="box">
<div class="inner-left">日志分类:</div>
<div class="inner-right">{{ item.logType }}</div>
</div>
<div class="box">
<div class="inner-left">开始时间:</div>
<div class="inner-right">{{ item.created }}</div>
</div>
<div class="box">
<div class="inner-left">结束时间:</div>
<div class="inner-right">{{ item.update }}</div>
</div>
<div class="box">
<div class="inner-left">报警代码:</div>
<div class="inner-right">{{ item.errorCode }}</div>
</div>
<div class="box1">
<div class="inner-left">消息:</div>
<div class="inner-right">
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="请输入消息"
v-model="item.message"
/>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
</div>
</el-dialog>
|
陈嘉新
authored
|
173
174
175
|
</div>
</template>
<script>
|
陈嘉新
authored
|
176
177
178
|
import {
GetDictWithDetailsLangs,
GetEquipmentExecutedLog,
|
陈嘉新
authored
|
179
|
GetEquipmentExecutedLogById,
|
陈嘉新
authored
|
180
|
} from "@/api/logManage/index";
|
陈嘉新
authored
|
181
182
183
|
export default {
data() {
return {
|
陈嘉新
authored
|
184
|
tableData: [],
|
陈嘉新
authored
|
185
186
187
|
queryConfig: {
currentPage: 1,
pageSize: 20,
|
陈嘉新
authored
|
188
189
190
191
|
equipmentCode: "",
logType: "",
message: "",
bllResultCode: "",
|
陈嘉新
authored
|
192
193
194
195
196
197
198
199
|
},
total: 0,
form: {
startTime: this.$moment()
.subtract(3, "days")
.format("YYYY-MM-DD 00:00:00"),
endTime: this.$moment().add(1, "days").format("YYYY-MM-DD 23:59:59"),
},
|
陈嘉新
authored
|
200
201
202
203
204
205
|
optionsBllResult: [
{
value: "",
label: "全部",
},
],
|
陈嘉新
authored
|
206
207
208
|
dialogFormVisible: false,
multipleSelection: [],
detailsData: [],
|
陈嘉新
authored
|
209
210
|
};
},
|
陈嘉新
authored
|
211
212
213
214
|
created() {
this.getFlag("LogLevelFlag");
this.getTableList();
},
|
陈嘉新
authored
|
215
216
|
computed: {
TableHeight() {
|
陈嘉新
authored
|
217
|
return `calc(100vh - 390px )`;
|
陈嘉新
authored
|
218
219
|
},
},
|
陈嘉新
authored
|
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
methods: {
btnAction() {
this.getTableList();
},
getFlag(data) {
let params = { Code: data };
GetDictWithDetailsLangs(params).then((response) => {
response.data.dictDetails.forEach((x) => {
this.optionsBllResult.push({ value: x.code, label: x.name });
});
});
},
getTableList() {
const params = {
pageNumber: this.queryConfig.currentPage,
perPageCount: this.queryConfig.pageSize,
queryConfig: {
equipmentCode: this.queryConfig.equipmentCode,
logType: this.queryConfig.logType,
message: this.queryConfig.message,
bllResultCode: this.queryConfig.bllResultCode,
begin: this.form.startTime,
end: this.form.endTime,
},
};
this.listLoading = true;
GetEquipmentExecutedLog(params).then((response) => {
this.total = response.data.totalCount;
this.tableData = response.data.data;
this.listLoading = false;
});
},
// 详情
details() {
if (this.multipleSelection.length == 0) {
this.$alert("请选择一条数据!", "标题名称", {
confirmButtonText: "确定",
});
} else {
|
陈嘉新
authored
|
259
260
261
262
263
264
265
|
this.detailsData = [];
let params = {
id: this.multipleSelection[0].id,
};
GetEquipmentExecutedLogById(params).then((response) => {
this.detailsData.push(response.data);
});
|
陈嘉新
authored
|
266
267
268
269
270
271
272
273
|
this.dialogFormVisible = true;
}
},
//获取表格行数据
handleSelectionChange(val) {
this.multipleSelection = val;
},
//分页
|
陈嘉新
authored
|
274
275
276
277
278
279
280
281
|
handleSizeChange(val) {
this.queryConfig.pageSize = val;
this.queryConfig.currentPage = 1;
this.getTableList();
},
handleCurrentChange(val) {
this.queryConfig.currentPage = val;
|
陈嘉新
authored
|
282
283
284
285
286
287
288
|
this.getTableList();
},
validateNumber() {
const regex = /^[0-9]*$/;
this.numberError = regex.test(this.number) ? "" : "只能输入数字";
},
},
|
陈嘉新
authored
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
};
</script>
<style scoped lang="scss">
.interfacel {
width: 100%;
}
.el-row {
margin-bottom: 5px;
}
.interfacel-content {
display: flex;
border-radius: 4px;
min-height: 46px;
margin-bottom: 10px;
align-items: center;
}
.table {
border: 1px solid #e5e9f2;
}
.T1 {
border: 1px solid #b3d8ff;
}
.pagination-container {
text-align: center; /* 使分页组件靠右 */
margin-top: 20px; /* 添加顶部间距 */
}
</style>
|