陈嘉新
authored
|
1
2
|
<template>
<div class="interfacel">
|
陈嘉新
authored
|
3
4
5
6
7
8
9
10
11
|
<el-form
:model="queryConfig"
:rules="rules"
ref="queryConfig"
label-width="100px"
class="demo-queryConfig"
>
<el-row :gutter="10">
<el-col :span="3">
|
|
12
|
<el-form-item :label="$t('logManage.title')" prop="name">
|
陈嘉新
authored
|
13
14
|
<el-input
v-model="queryConfig.title"
|
|
15
|
:placeholder="$t('logManage.PleaseEnter') + $t('logManage.title')"
|
陈嘉新
authored
|
16
|
></el-input>
|
陈嘉新
authored
|
17
18
19
|
</el-form-item>
</el-col>
<el-col :span="3">
|
|
20
21
22
23
24
25
26
|
<el-form-item :label="$t('logManage.module')" prop="">
<el-select
v-model="queryConfig.module"
:placeholder="
$t('logManage.PleaseSelect') + $t('logManage.module')
"
>
|
陈嘉新
authored
|
27
|
<el-option
|
陈嘉新
authored
|
28
|
v-for="item in optionsModule"
|
陈嘉新
authored
|
29
30
31
32
33
|
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
|
陈嘉新
authored
|
34
35
36
|
</el-form-item>
</el-col>
<el-col :span="3">
|
|
37
|
<el-form-item :label="$t('logManage.content')" prop="name">
|
陈嘉新
authored
|
38
39
|
<el-input
v-model="queryConfig.content"
|
|
40
41
42
|
:placeholder="
$t('logManage.PleaseEnter') + $t('logManage.content')
"
|
陈嘉新
authored
|
43
|
></el-input>
|
陈嘉新
authored
|
44
45
46
|
</el-form-item>
</el-col>
<el-col :span="3">
|
|
47
48
49
50
51
|
<el-form-item :label="$t('logManage.sign')" prop="">
<el-select
v-model="queryConfig.flag"
:placeholder="$t('logManage.PleaseSelect') + $t('logManage.sign')"
>
|
陈嘉新
authored
|
52
|
<el-option
|
陈嘉新
authored
|
53
|
v-for="item in optionsFlag"
|
陈嘉新
authored
|
54
55
56
57
58
|
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
|
陈嘉新
authored
|
59
60
61
|
</el-form-item>
</el-col>
<el-col :span="3.5">
|
|
62
|
<el-form-item :label="$t('logManage.startTime')" prop="">
|
陈嘉新
authored
|
63
64
65
|
<el-date-picker
v-model="form.startTime"
type="datetime"
|
|
66
67
68
|
:placeholder="
$t('logManage.PleaseSelect') + $t('logManage.startTime')
"
|
陈嘉新
authored
|
69
|
/>
|
陈嘉新
authored
|
70
71
72
|
</el-form-item>
</el-col>
<el-col :span="3.5">
|
|
73
|
<el-form-item :label="$t('logManage.endTime')" prop="">
|
陈嘉新
authored
|
74
75
76
|
<el-date-picker
v-model="form.endTime"
type="datetime"
|
|
77
78
79
|
:placeholder="
$t('logManage.PleaseSelect') + $t('logManage.endTime')
"
|
陈嘉新
authored
|
80
|
/>
|
陈嘉新
authored
|
81
82
83
84
85
86
87
88
|
</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
|
89
|
size="small"
|
陈嘉新
authored
|
90
|
type="primary"
|
|
91
|
>{{ $t("logManage.query") }}</el-button
|
陈嘉新
authored
|
92
|
>
|
|
93
94
95
|
<el-button class="T1" size="small" @click="details()">{{
$t("logManage.queryDetails")
}}</el-button>
|
|
96
97
98
99
100
|
<el-button
class="T1"
size="small"
icon="el-icon-download"
@click="ExportList()"
|
|
101
|
>{{ $t("logManage.export") }}</el-button
|
陈嘉新
authored
|
102
|
>
|
陈嘉新
authored
|
103
104
105
106
|
</el-form-item>
</el-col>
</el-row>
</el-form>
|
陈嘉新
authored
|
107
|
<div class="table">
|
陈嘉新
authored
|
108
109
|
<el-table
:data="tableData"
|
陈嘉新
authored
|
110
|
border
|
|
111
|
highlight-current-row
|
陈嘉新
authored
|
112
|
:height="TableHeight"
|
陈嘉新
authored
|
113
|
@selection-change="handleSelectionChange"
|
|
114
115
|
@row-click="handleRowClick"
ref="multipleTable"
|
陈嘉新
authored
|
116
|
:header-cell-style="{ color: '#000000' }"
|
|
117
|
class="custom-table"
|
陈嘉新
authored
|
118
|
>
|
陈嘉新
authored
|
119
120
121
122
123
|
<el-table-column
type="selection"
align="center"
width="55"
></el-table-column>
|
|
124
125
126
127
128
129
130
131
132
133
134
135
136
|
<el-table-column
prop="id"
:label="$t('logManage.internalID')"
width="180"
>
</el-table-column>
<el-table-column
prop="title"
:label="$t('logManage.title')"
width="180"
>
</el-table-column>
<el-table-column prop="module" :label="$t('logManage.module')">
|
陈嘉新
authored
|
137
|
</el-table-column>
|
|
138
139
140
141
142
143
144
|
<el-table-column prop="content" :label="$t('logManage.content')">
</el-table-column>
<el-table-column prop="level" :label="$t('logManage.sign')">
</el-table-column>
<el-table-column prop="created" :label="$t('logManage.createdTime')">
</el-table-column>
<el-table-column prop="userCode" :label="$t('logManage.founder')">
|
陈嘉新
authored
|
145
146
147
148
|
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
|
陈嘉新
authored
|
149
150
151
152
|
style="margin-top: 15px"
align="center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
|
陈嘉新
authored
|
153
|
:current-page="queryConfig.currentPage"
|
陈嘉新
authored
|
154
|
:page-sizes="[20, 50, 100]"
|
陈嘉新
authored
|
155
|
:page-size="queryConfig.pageSize"
|
陈嘉新
authored
|
156
|
layout="total, sizes, prev, pager, next, jumper"
|
陈嘉新
authored
|
157
|
:total="total"
|
陈嘉新
authored
|
158
|
/>
|
陈嘉新
authored
|
159
160
|
</div>
</div>
|
|
161
162
163
164
|
<el-dialog
:title="$t('logManage.systemLogDetails')"
:visible.sync="dialogFormVisible"
>
|
陈嘉新
authored
|
165
166
|
<div class="container" v-for="(item, index) in detailsData" :key="index">
<div class="box">
|
|
167
|
<div class="inner-left">{{ $t("logManage.internalID") }}:</div>
|
陈嘉新
authored
|
168
169
170
|
<div class="inner-right">{{ item.id }}</div>
</div>
<div class="box">
|
|
171
|
<div class="inner-left">{{ $t("logManage.title") }}:</div>
|
陈嘉新
authored
|
172
173
174
|
<div class="inner-right">{{ item.title }}</div>
</div>
<div class="box">
|
|
175
|
<div class="inner-left">{{ $t("logManage.module") }}:</div>
|
陈嘉新
authored
|
176
177
178
|
<div class="inner-right">{{ item.module }}</div>
</div>
<div class="box">
|
|
179
|
<div class="inner-left">{{ $t("logManage.sign") }}:</div>
|
陈嘉新
authored
|
180
181
182
|
<div class="inner-right">{{ item.level }}</div>
</div>
<div class="box">
|
|
183
|
<div class="inner-left">{{ $t("logManage.createdTime") }}:</div>
|
陈嘉新
authored
|
184
185
186
|
<div class="inner-right">{{ item.created }}</div>
</div>
<div class="box">
|
|
187
|
<div class="inner-left">{{ $t("logManage.founder") }}:</div>
|
陈嘉新
authored
|
188
189
|
<div class="inner-right">{{ item.userCode }}</div>
</div>
|
|
190
|
<div class="TextField">
|
|
191
|
<div class="inner-left">{{ $t("logManage.content") }}:</div>
|
陈嘉新
authored
|
192
193
194
|
<div class="inner-right">
<el-input
type="textarea"
|
|
195
|
:rows="6"
|
|
196
197
198
|
:placeholder="
$t('logManage.PleaseEnter') + $t('logManage.content')
"
|
陈嘉新
authored
|
199
200
201
202
203
204
|
v-model="item.content"
/>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
|
|
205
206
207
|
<el-button @click="dialogFormVisible = false">{{
$t("logManage.cancel")
}}</el-button>
|
陈嘉新
authored
|
208
209
|
</div>
</el-dialog>
|
陈嘉新
authored
|
210
211
212
|
</div>
</template>
<script>
|
陈嘉新
authored
|
213
214
215
216
217
|
import {
GetDictWithDetailsLangs,
GetSysLog,
GetSysLogById,
} from "@/api/logManage/index";
|
陈嘉新
authored
|
218
|
import downloadFile from "@/api/user";
|
陈嘉新
authored
|
219
220
221
|
export default {
data() {
return {
|
陈嘉新
authored
|
222
|
tableData: [],
|
陈嘉新
authored
|
223
224
225
|
queryConfig: {
currentPage: 1,
pageSize: 20,
|
陈嘉新
authored
|
226
227
228
229
|
title: "",
module: "",
content: "",
level: "",
|
陈嘉新
authored
|
230
231
232
233
234
235
236
237
|
},
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
|
238
239
240
241
242
243
244
245
246
|
optionsModule: [
{
value: "",
label: "全部",
},
],
optionsFlag: [
{
value: "",
|
|
247
|
label: "",
|
陈嘉新
authored
|
248
249
|
},
],
|
陈嘉新
authored
|
250
251
252
|
dialogFormVisible: false,
multipleSelection: [],
detailsData: [],
|
|
253
|
export: "api/Log/ExportSysLog",
|
陈嘉新
authored
|
254
255
|
};
},
|
陈嘉新
authored
|
256
|
created() {
|
|
257
|
this.optionsFlag[0].label = this.$t("taskManage.all");
|
陈嘉新
authored
|
258
259
260
261
|
this.getFlag("LogLevelFlag");
this.getFlag("LogModuleFlag");
this.getTableList();
},
|
陈嘉新
authored
|
262
263
|
computed: {
TableHeight() {
|
陈嘉新
authored
|
264
|
return `calc(100vh - 390px )`;
|
陈嘉新
authored
|
265
266
|
},
},
|
陈嘉新
authored
|
267
|
methods: {
|
|
268
269
270
|
handleRowClick(row) {
this.$refs.multipleTable.toggleRowSelection(row);
},
|
陈嘉新
authored
|
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
btnAction() {
this.getTableList();
},
getFlag(data) {
let params = { Code: data };
GetDictWithDetailsLangs(params).then((response) => {
response.data.dictDetails.forEach((x) => {
if (data == "LogLevelFlag") {
this.optionsFlag.push({ value: x.code, label: x.name });
} else if (data == "LogModuleFlag") {
this.optionsModule.push({ value: x.code, label: x.name });
}
});
});
},
getTableList() {
const params = {
pageNumber: this.queryConfig.currentPage,
perPageCount: this.queryConfig.pageSize,
queryConfig: {
title: this.queryConfig.title,
module: this.queryConfig.module,
content: this.queryConfig.content,
level: this.queryConfig.level,
begin: this.form.startTime,
end: this.form.endTime,
},
};
this.listLoading = true;
GetSysLog(params).then((response) => {
this.total = response.data.totalCount;
this.tableData = response.data.data;
this.listLoading = false;
});
},
|
陈嘉新
authored
|
306
307
308
309
|
//获取表格行数据
handleSelectionChange(val) {
this.multipleSelection = val;
},
|
陈嘉新
authored
|
310
311
312
|
// 详情
details() {
if (this.multipleSelection.length == 0) {
|
|
313
314
315
316
317
318
319
|
this.$alert(
this.$t("logManage.PleaseSelectApieceOfData"),
this.$t("logManage.systemLogDetails"),
{
confirmButtonText: this.$t("logManage.sure"),
}
);
|
陈嘉新
authored
|
320
|
} else {
|
陈嘉新
authored
|
321
322
323
324
325
326
327
|
this.detailsData = [];
let params = {
id: this.multipleSelection[0].id,
};
GetSysLogById(params).then((response) => {
this.detailsData.push(response.data);
});
|
陈嘉新
authored
|
328
329
330
|
this.dialogFormVisible = true;
}
},
|
陈嘉新
authored
|
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
//导出按钮
ExportList() {
const params = {
pageNumber: this.queryConfig.currentPage,
perPageCount: this.queryConfig.pageSize,
queryConfig: {
title: this.queryConfig.title,
module: this.queryConfig.module,
content: this.queryConfig.content,
level: this.queryConfig.level,
begin: this.form.startTime,
end: this.form.endTime,
},
};
|
|
345
|
let text = this.$t("logManage.systemLogData") + ".xlsx";
|
陈嘉新
authored
|
346
347
348
|
// 调用下载函数
downloadFile(this.export, params, text);
},
|
陈嘉新
authored
|
349
350
351
352
353
|
//获取表格行数据
handleSelectionChange(val) {
this.multipleSelection = val;
},
//分页
|
陈嘉新
authored
|
354
355
356
357
358
359
360
361
|
handleSizeChange(val) {
this.queryConfig.pageSize = val;
this.queryConfig.currentPage = 1;
this.getTableList();
},
handleCurrentChange(val) {
this.queryConfig.currentPage = val;
|
陈嘉新
authored
|
362
363
364
|
this.getTableList();
},
},
|
陈嘉新
authored
|
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
};
</script>
<style scoped lang="scss">
.interfacel {
width: 100%;
}
.table {
border: 1px solid #e5e9f2;
}
.T1 {
border: 1px solid #b3d8ff;
}
.pagination-container {
text-align: center; /* 使分页组件靠右 */
margin-top: 20px; /* 添加顶部间距 */
}
</style>
|