vue2-client 1.3.25 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +339 -328
- package/package.json +78 -76
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +543 -551
- package/src/base-client/components/common/Upload/Upload.vue +168 -167
- package/src/base-client/components/common/XFormTable/XFormTable.vue +113 -76
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +131 -0
- package/src/base-client/components/common/XImportExcel/index.js +3 -0
- package/src/base-client/components/common/XImportExcel/index.md +38 -0
- package/src/base-client/components/common/XTable/XTable.vue +259 -278
- package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -376
- package/src/components/TableSetting/TableSetting.vue +143 -0
- package/src/components/TableSetting/index.js +3 -0
- package/src/pages/login/Login.vue +360 -361
- package/src/pages/system/ticket/index.vue +1 -1
- package/src/services/api/common.js +123 -58
- package/src/utils/common.js +10 -0
- package/src/utils/errorCode.js +6 -0
- package/src/base-client/components/common/CustomColumnsDrawer/CustomColumnsDrawer.vue +0 -109
- package/src/base-client/components/common/CustomColumnsDrawer/index.js +0 -3
- package/src/base-client/components/common/CustomColumnsDrawer/index.md +0 -46
|
@@ -1,376 +1,376 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
title="日志详情"
|
|
4
|
-
placement="right"
|
|
5
|
-
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
-
:visible="visible"
|
|
7
|
-
@close="onClose"
|
|
8
|
-
>
|
|
9
|
-
<a-spin :spinning="loadLogDetails">
|
|
10
|
-
<a-page-header
|
|
11
|
-
:title="details.f_log_type + ': '+details.f_error_title"
|
|
12
|
-
>
|
|
13
|
-
<div class="row">
|
|
14
|
-
<div class="content">
|
|
15
|
-
<a-descriptions size="small" :column="isMobile ? 1 : 2">
|
|
16
|
-
<a-descriptions-item label="日志编号">{{ details.id }}</a-descriptions-item>
|
|
17
|
-
<a-descriptions-item label="所属服务">{{ details.f_service }}</a-descriptions-item>
|
|
18
|
-
<a-descriptions-item label="网络路径">{{ details.f_web_url }}</a-descriptions-item>
|
|
19
|
-
<a-descriptions-item label="源路径">{{ details.f_src }}</a-descriptions-item>
|
|
20
|
-
<a-descriptions-item label="简述">
|
|
21
|
-
{{ details.f_error_title }}
|
|
22
|
-
</a-descriptions-item>
|
|
23
|
-
<a-descriptions-item label="发生次数">
|
|
24
|
-
{{ details.f_times }}
|
|
25
|
-
</a-descriptions-item>
|
|
26
|
-
<a-descriptions-item label="首次发生时间">
|
|
27
|
-
{{ format(details.f_first_update_time,'yyyy-MM-dd hh:mm:ss') }}
|
|
28
|
-
</a-descriptions-item>
|
|
29
|
-
<a-descriptions-item label="最后发生时间">
|
|
30
|
-
{{ format(details.f_last_update_time,'yyyy-MM-dd hh:mm:ss') }}
|
|
31
|
-
</a-descriptions-item>
|
|
32
|
-
</a-descriptions>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="extra">
|
|
35
|
-
<a-row class="status-list">
|
|
36
|
-
<a-col :xs="12" :sm="24">
|
|
37
|
-
<div class="text">类型</div>
|
|
38
|
-
<div class="heading">
|
|
39
|
-
<x-badge badge-key="logTypeMap" :value="details.f_log_type" :is-external-text="true"/>
|
|
40
|
-
</div>
|
|
41
|
-
</a-col>
|
|
42
|
-
</a-row>
|
|
43
|
-
<p></p>
|
|
44
|
-
<a-row class="status-list">
|
|
45
|
-
<a-col :xs="12" :sm="24">
|
|
46
|
-
<div class="text">状态</div>
|
|
47
|
-
<div class="heading">
|
|
48
|
-
<a-dropdown :trigger="['click']">
|
|
49
|
-
<a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
50
|
-
<a-icon style="margin-right: 4px;" :type="details.f_status | statusIconFilter" :style="details.f_status | statusIconStyleFilter"/>
|
|
51
|
-
<span style="color:rgba(0, 0, 0, 0.85);">{{ details.f_status }}</span>
|
|
52
|
-
<a-icon type="edit" style="font-size: 14px;color:#999;cursor: pointer;"/>
|
|
53
|
-
</a>
|
|
54
|
-
<a-menu slot="overlay" style="margin-top: 10px;width: 200px;">
|
|
55
|
-
<a-menu-item style="padding: 10px 15px;">
|
|
56
|
-
<a @click="updateLogStatus('待办的')">
|
|
57
|
-
<a-icon :type="'待办的' | statusIconFilter" :style="'待办的' | statusIconStyleFilter"/>
|
|
58
|
-
待办的
|
|
59
|
-
</a>
|
|
60
|
-
</a-menu-item>
|
|
61
|
-
<a-menu-item style="padding: 10px 15px;">
|
|
62
|
-
<a @click="updateLogStatus('进行中')">
|
|
63
|
-
<a-icon :type="'进行中' | statusIconFilter" :style="'进行中' | statusIconStyleFilter"/>
|
|
64
|
-
进行中
|
|
65
|
-
</a>
|
|
66
|
-
</a-menu-item>
|
|
67
|
-
<a-menu-item style="padding: 10px 15px;">
|
|
68
|
-
<a @click="updateLogStatus('已完成')">
|
|
69
|
-
<a-icon :type="'已完成' | statusIconFilter" :style="'已完成' | statusIconStyleFilter"/>
|
|
70
|
-
已完成
|
|
71
|
-
</a>
|
|
72
|
-
</a-menu-item>
|
|
73
|
-
<a-menu-item style="padding: 10px 15px;">
|
|
74
|
-
<a @click="updateLogStatus('已关闭')">
|
|
75
|
-
<a-icon :type="'已关闭' | statusIconFilter" :style="'已关闭' | statusIconStyleFilter"/>
|
|
76
|
-
已关闭
|
|
77
|
-
</a>
|
|
78
|
-
</a-menu-item>
|
|
79
|
-
</a-menu>
|
|
80
|
-
</a-dropdown>
|
|
81
|
-
</div>
|
|
82
|
-
</a-col>
|
|
83
|
-
</a-row>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
|
|
87
|
-
<!-- actions -->
|
|
88
|
-
<template v-slot:extra>
|
|
89
|
-
<a-button-group style="margin-right: 4px;">
|
|
90
|
-
<a-button type="dashed" @click="initView" :loading="loadLogDetails">刷新</a-button>
|
|
91
|
-
</a-button-group>
|
|
92
|
-
</template>
|
|
93
|
-
|
|
94
|
-
<!-- 操作 -->
|
|
95
|
-
<a-card :bordered="false" title="处理情况">
|
|
96
|
-
<a-timeline :reverse="true">
|
|
97
|
-
<a-timeline-item color="#666">
|
|
98
|
-
<a-icon slot="dot" type="plus-square" style="font-size: 16px;" />
|
|
99
|
-
异常检测模块 捕获到了异常事件
|
|
100
|
-
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(details.f_first_update_time,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
101
|
-
</a-timeline-item>
|
|
102
|
-
<a-timeline-item color="red">
|
|
103
|
-
<a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;" />
|
|
104
|
-
异常检测模块 已确认最后发生时间
|
|
105
|
-
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(details.f_last_update_time,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
106
|
-
</a-timeline-item>
|
|
107
|
-
<a-timeline-item :key="index" v-for="(item, index) in eventList">
|
|
108
|
-
<a-icon slot="dot" :type="item.f_info | eventIconFilter" :style="item.f_info | eventIconStyleFilter"/>
|
|
109
|
-
{{ item.f_china_name }} {{ item.f_info }}
|
|
110
|
-
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(item.f_input_date,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
111
|
-
</a-timeline-item>
|
|
112
|
-
</a-timeline>
|
|
113
|
-
</a-card>
|
|
114
|
-
<a-card
|
|
115
|
-
style="margin-top: 24px"
|
|
116
|
-
:bordered="false"
|
|
117
|
-
:tabList="operationTabList"
|
|
118
|
-
:activeTabKey="operationActiveTabKey"
|
|
119
|
-
@tabChange="(key) => {this.operationActiveTabKey = key}"
|
|
120
|
-
>
|
|
121
|
-
<div v-if="operationActiveTabKey === '1'">
|
|
122
|
-
<a-descriptions layout="vertical" bordered>
|
|
123
|
-
<a-descriptions-item label="日志内容"><p style="margin: 0;white-space: pre;" v-html="details.f_error_msg === '' ? '--' : toText(details.f_error_msg)"></p></a-descriptions-item>
|
|
124
|
-
</a-descriptions>
|
|
125
|
-
</div>
|
|
126
|
-
<div v-else-if="operationActiveTabKey === '2'" class="no-data"><a-icon type="frown-o"/>暂无数据</div>
|
|
127
|
-
</a-card>
|
|
128
|
-
</a-page-header>
|
|
129
|
-
</a-spin>
|
|
130
|
-
</a-drawer>
|
|
131
|
-
</template>
|
|
132
|
-
|
|
133
|
-
<script>
|
|
134
|
-
import { formatDate } from '@vue2-client/utils/util'
|
|
135
|
-
import { LogDetailsViewApi, post } from '@vue2-client/services/api'
|
|
136
|
-
import { mapState } from 'vuex'
|
|
137
|
-
import XBadge from '
|
|
138
|
-
|
|
139
|
-
const statusIconMap = {
|
|
140
|
-
'待办的': {
|
|
141
|
-
icon: 'info-circle',
|
|
142
|
-
style: 'color: #fe7300;'
|
|
143
|
-
},
|
|
144
|
-
'进行中': {
|
|
145
|
-
icon: 'clock-circle',
|
|
146
|
-
style: 'color: #2d81d7;'
|
|
147
|
-
},
|
|
148
|
-
'已完成': {
|
|
149
|
-
icon: 'check-circle',
|
|
150
|
-
style: 'color:#4baf50;'
|
|
151
|
-
},
|
|
152
|
-
'已关闭': {
|
|
153
|
-
icon: 'issues-close',
|
|
154
|
-
style: 'color:#ec0019;'
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const eventIconMap = {
|
|
159
|
-
'开始处理事件': {
|
|
160
|
-
icon: 'forward',
|
|
161
|
-
style: 'color: #fe7300;'
|
|
162
|
-
},
|
|
163
|
-
'将事件状态修改为 代办的': {
|
|
164
|
-
icon: 'edit',
|
|
165
|
-
style: 'color: #2d81d7;'
|
|
166
|
-
},
|
|
167
|
-
'将事件状态修改为 已关闭': {
|
|
168
|
-
icon: 'issues-close',
|
|
169
|
-
style: 'color:#ec0019;'
|
|
170
|
-
},
|
|
171
|
-
'已完成对事件的处理': {
|
|
172
|
-
icon: 'check-circle',
|
|
173
|
-
style: 'color:#4baf50;'
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export default {
|
|
178
|
-
name: 'LogDetailsView',
|
|
179
|
-
components: {
|
|
180
|
-
XBadge
|
|
181
|
-
},
|
|
182
|
-
data () {
|
|
183
|
-
return {
|
|
184
|
-
// 日志ID
|
|
185
|
-
id: 0,
|
|
186
|
-
// 日志详情加载,
|
|
187
|
-
loadLogDetails: true,
|
|
188
|
-
// 页面宽度
|
|
189
|
-
screenWidth: document.documentElement.clientWidth,
|
|
190
|
-
// 日志详情
|
|
191
|
-
details: {
|
|
192
|
-
id: 0,
|
|
193
|
-
f_service: '',
|
|
194
|
-
f_src: '',
|
|
195
|
-
f_web_url: '',
|
|
196
|
-
f_log_type: '',
|
|
197
|
-
f_error_title: '',
|
|
198
|
-
f_times: '',
|
|
199
|
-
f_first_update_time: '',
|
|
200
|
-
f_last_update_time: '',
|
|
201
|
-
f_status: '待办的',
|
|
202
|
-
f_error_msg: ''
|
|
203
|
-
},
|
|
204
|
-
// 处理情况数组
|
|
205
|
-
eventList: [],
|
|
206
|
-
// 处理情况描述
|
|
207
|
-
remark: '',
|
|
208
|
-
operationTabList: [
|
|
209
|
-
{
|
|
210
|
-
key: '1',
|
|
211
|
-
tab: '基本信息'
|
|
212
|
-
}
|
|
213
|
-
],
|
|
214
|
-
operationActiveTabKey: '1'
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
mounted () {
|
|
218
|
-
this.initView()
|
|
219
|
-
},
|
|
220
|
-
filters: {
|
|
221
|
-
statusIconFilter (type) {
|
|
222
|
-
return statusIconMap[type].icon
|
|
223
|
-
},
|
|
224
|
-
statusIconStyleFilter (type) {
|
|
225
|
-
return statusIconMap[type].style
|
|
226
|
-
},
|
|
227
|
-
eventIconFilter (type) {
|
|
228
|
-
return eventIconMap[type].icon
|
|
229
|
-
},
|
|
230
|
-
eventIconStyleFilter (type) {
|
|
231
|
-
return eventIconMap[type].style
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
computed: {
|
|
235
|
-
...mapState('account', { currUser: 'user' }),
|
|
236
|
-
...mapState('setting', ['isMobile'])
|
|
237
|
-
},
|
|
238
|
-
props: {
|
|
239
|
-
logid: {
|
|
240
|
-
type: String || Number,
|
|
241
|
-
required: true
|
|
242
|
-
},
|
|
243
|
-
visible: {
|
|
244
|
-
type: Boolean,
|
|
245
|
-
default: false
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
methods: {
|
|
249
|
-
// 初始化组件
|
|
250
|
-
initView () {
|
|
251
|
-
this.getLog(this.logid)
|
|
252
|
-
},
|
|
253
|
-
onClose () {
|
|
254
|
-
this.$emit('update:visible', false)
|
|
255
|
-
},
|
|
256
|
-
// 获取日志详情信息
|
|
257
|
-
getLog (logId) {
|
|
258
|
-
this.loadLogDetails = true
|
|
259
|
-
return post(LogDetailsViewApi.getLogDetails, {
|
|
260
|
-
id: logId
|
|
261
|
-
})
|
|
262
|
-
.then(res => {
|
|
263
|
-
this.details = res
|
|
264
|
-
this.getRecord()
|
|
265
|
-
this.loadLogDetails = false
|
|
266
|
-
}, err => {
|
|
267
|
-
this.loadLogDetails = false
|
|
268
|
-
console.warn(err)
|
|
269
|
-
})
|
|
270
|
-
},
|
|
271
|
-
getRecord () {
|
|
272
|
-
return post(LogDetailsViewApi.getLogRecordList, {
|
|
273
|
-
pageNo: 1,
|
|
274
|
-
pageSize: 500,
|
|
275
|
-
dataId: this.logid,
|
|
276
|
-
type: '异常处理'
|
|
277
|
-
})
|
|
278
|
-
.then(res => {
|
|
279
|
-
this.eventList = res.data.reverse()
|
|
280
|
-
})
|
|
281
|
-
},
|
|
282
|
-
updateLogStatus (status) {
|
|
283
|
-
if (this.loadLogDetails) {
|
|
284
|
-
return
|
|
285
|
-
}
|
|
286
|
-
const _this = this
|
|
287
|
-
return post(LogDetailsViewApi.updateLogStatusData, {
|
|
288
|
-
id: _this.logid,
|
|
289
|
-
status: status,
|
|
290
|
-
username: _this.currUser.name
|
|
291
|
-
}).then(res => {
|
|
292
|
-
_this.getLog(_this.logid)
|
|
293
|
-
if (res.nums === 1) {
|
|
294
|
-
_this.$message.success('操作成功')
|
|
295
|
-
} else {
|
|
296
|
-
_this.$message.error('操作失败')
|
|
297
|
-
}
|
|
298
|
-
})
|
|
299
|
-
},
|
|
300
|
-
format (date, format) {
|
|
301
|
-
return formatDate(date, format)
|
|
302
|
-
},
|
|
303
|
-
toText (text) {
|
|
304
|
-
return text
|
|
305
|
-
.replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
|
|
306
|
-
.replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
watch: {
|
|
310
|
-
'visible' (val) {
|
|
311
|
-
if (val) {
|
|
312
|
-
this.initView()
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
</script>
|
|
318
|
-
|
|
319
|
-
<style lang="less" scoped>
|
|
320
|
-
.detail-layout {
|
|
321
|
-
margin-left: 44px;
|
|
322
|
-
}
|
|
323
|
-
.text {
|
|
324
|
-
color: rgba(0, 0, 0, .45);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.heading {
|
|
328
|
-
color: rgba(0, 0, 0, .85);
|
|
329
|
-
font-size: 20px;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.no-data {
|
|
333
|
-
color: rgba(0, 0, 0, .25);
|
|
334
|
-
text-align: center;
|
|
335
|
-
line-height: 64px;
|
|
336
|
-
font-size: 16px;
|
|
337
|
-
|
|
338
|
-
i {
|
|
339
|
-
font-size: 24px;
|
|
340
|
-
margin-right: 16px;
|
|
341
|
-
position: relative;
|
|
342
|
-
top: 3px;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.mobile {
|
|
347
|
-
.detail-layout {
|
|
348
|
-
margin-left: unset;
|
|
349
|
-
}
|
|
350
|
-
.text {
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
.status-list {
|
|
354
|
-
text-align: left;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.row {
|
|
359
|
-
display: flex;
|
|
360
|
-
|
|
361
|
-
.content {
|
|
362
|
-
-webkit-box-flex: 1;
|
|
363
|
-
flex: auto;
|
|
364
|
-
-ms-flex: auto;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.extra {
|
|
368
|
-
flex: 0 1 auto;
|
|
369
|
-
-webkit-box-flex: 0;
|
|
370
|
-
-ms-flex: 0 1 auto;
|
|
371
|
-
min-width: 242px;
|
|
372
|
-
margin-left: 88px;
|
|
373
|
-
text-align: right;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
title="日志详情"
|
|
4
|
+
placement="right"
|
|
5
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
+
:visible="visible"
|
|
7
|
+
@close="onClose"
|
|
8
|
+
>
|
|
9
|
+
<a-spin :spinning="loadLogDetails">
|
|
10
|
+
<a-page-header
|
|
11
|
+
:title="details.f_log_type + ': '+details.f_error_title"
|
|
12
|
+
>
|
|
13
|
+
<div class="row">
|
|
14
|
+
<div class="content">
|
|
15
|
+
<a-descriptions size="small" :column="isMobile ? 1 : 2">
|
|
16
|
+
<a-descriptions-item label="日志编号">{{ details.id }}</a-descriptions-item>
|
|
17
|
+
<a-descriptions-item label="所属服务">{{ details.f_service }}</a-descriptions-item>
|
|
18
|
+
<a-descriptions-item label="网络路径">{{ details.f_web_url }}</a-descriptions-item>
|
|
19
|
+
<a-descriptions-item label="源路径">{{ details.f_src }}</a-descriptions-item>
|
|
20
|
+
<a-descriptions-item label="简述">
|
|
21
|
+
{{ details.f_error_title }}
|
|
22
|
+
</a-descriptions-item>
|
|
23
|
+
<a-descriptions-item label="发生次数">
|
|
24
|
+
{{ details.f_times }}
|
|
25
|
+
</a-descriptions-item>
|
|
26
|
+
<a-descriptions-item label="首次发生时间">
|
|
27
|
+
{{ format(details.f_first_update_time,'yyyy-MM-dd hh:mm:ss') }}
|
|
28
|
+
</a-descriptions-item>
|
|
29
|
+
<a-descriptions-item label="最后发生时间">
|
|
30
|
+
{{ format(details.f_last_update_time,'yyyy-MM-dd hh:mm:ss') }}
|
|
31
|
+
</a-descriptions-item>
|
|
32
|
+
</a-descriptions>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="extra">
|
|
35
|
+
<a-row class="status-list">
|
|
36
|
+
<a-col :xs="12" :sm="24">
|
|
37
|
+
<div class="text">类型</div>
|
|
38
|
+
<div class="heading">
|
|
39
|
+
<x-badge badge-key="logTypeMap" :value="details.f_log_type" :is-external-text="true"/>
|
|
40
|
+
</div>
|
|
41
|
+
</a-col>
|
|
42
|
+
</a-row>
|
|
43
|
+
<p></p>
|
|
44
|
+
<a-row class="status-list">
|
|
45
|
+
<a-col :xs="12" :sm="24">
|
|
46
|
+
<div class="text">状态</div>
|
|
47
|
+
<div class="heading">
|
|
48
|
+
<a-dropdown :trigger="['click']">
|
|
49
|
+
<a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
50
|
+
<a-icon style="margin-right: 4px;" :type="details.f_status | statusIconFilter" :style="details.f_status | statusIconStyleFilter"/>
|
|
51
|
+
<span style="color:rgba(0, 0, 0, 0.85);">{{ details.f_status }}</span>
|
|
52
|
+
<a-icon type="edit" style="font-size: 14px;color:#999;cursor: pointer;"/>
|
|
53
|
+
</a>
|
|
54
|
+
<a-menu slot="overlay" style="margin-top: 10px;width: 200px;">
|
|
55
|
+
<a-menu-item style="padding: 10px 15px;">
|
|
56
|
+
<a @click="updateLogStatus('待办的')">
|
|
57
|
+
<a-icon :type="'待办的' | statusIconFilter" :style="'待办的' | statusIconStyleFilter"/>
|
|
58
|
+
待办的
|
|
59
|
+
</a>
|
|
60
|
+
</a-menu-item>
|
|
61
|
+
<a-menu-item style="padding: 10px 15px;">
|
|
62
|
+
<a @click="updateLogStatus('进行中')">
|
|
63
|
+
<a-icon :type="'进行中' | statusIconFilter" :style="'进行中' | statusIconStyleFilter"/>
|
|
64
|
+
进行中
|
|
65
|
+
</a>
|
|
66
|
+
</a-menu-item>
|
|
67
|
+
<a-menu-item style="padding: 10px 15px;">
|
|
68
|
+
<a @click="updateLogStatus('已完成')">
|
|
69
|
+
<a-icon :type="'已完成' | statusIconFilter" :style="'已完成' | statusIconStyleFilter"/>
|
|
70
|
+
已完成
|
|
71
|
+
</a>
|
|
72
|
+
</a-menu-item>
|
|
73
|
+
<a-menu-item style="padding: 10px 15px;">
|
|
74
|
+
<a @click="updateLogStatus('已关闭')">
|
|
75
|
+
<a-icon :type="'已关闭' | statusIconFilter" :style="'已关闭' | statusIconStyleFilter"/>
|
|
76
|
+
已关闭
|
|
77
|
+
</a>
|
|
78
|
+
</a-menu-item>
|
|
79
|
+
</a-menu>
|
|
80
|
+
</a-dropdown>
|
|
81
|
+
</div>
|
|
82
|
+
</a-col>
|
|
83
|
+
</a-row>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<!-- actions -->
|
|
88
|
+
<template v-slot:extra>
|
|
89
|
+
<a-button-group style="margin-right: 4px;">
|
|
90
|
+
<a-button type="dashed" @click="initView" :loading="loadLogDetails">刷新</a-button>
|
|
91
|
+
</a-button-group>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<!-- 操作 -->
|
|
95
|
+
<a-card :bordered="false" title="处理情况">
|
|
96
|
+
<a-timeline :reverse="true">
|
|
97
|
+
<a-timeline-item color="#666">
|
|
98
|
+
<a-icon slot="dot" type="plus-square" style="font-size: 16px;" />
|
|
99
|
+
异常检测模块 捕获到了异常事件
|
|
100
|
+
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(details.f_first_update_time,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
101
|
+
</a-timeline-item>
|
|
102
|
+
<a-timeline-item color="red">
|
|
103
|
+
<a-icon slot="dot" type="clock-circle-o" style="font-size: 16px;" />
|
|
104
|
+
异常检测模块 已确认最后发生时间
|
|
105
|
+
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(details.f_last_update_time,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
106
|
+
</a-timeline-item>
|
|
107
|
+
<a-timeline-item :key="index" v-for="(item, index) in eventList">
|
|
108
|
+
<a-icon slot="dot" :type="item.f_info | eventIconFilter" :style="item.f_info | eventIconStyleFilter"/>
|
|
109
|
+
{{ item.f_china_name }} {{ item.f_info }}
|
|
110
|
+
<span style="padding-left: 5px;font-size: 12px;color:#8c92a4;">{{ format(item.f_input_date,'yyyy-MM-dd hh:mm:ss') }}</span>
|
|
111
|
+
</a-timeline-item>
|
|
112
|
+
</a-timeline>
|
|
113
|
+
</a-card>
|
|
114
|
+
<a-card
|
|
115
|
+
style="margin-top: 24px"
|
|
116
|
+
:bordered="false"
|
|
117
|
+
:tabList="operationTabList"
|
|
118
|
+
:activeTabKey="operationActiveTabKey"
|
|
119
|
+
@tabChange="(key) => {this.operationActiveTabKey = key}"
|
|
120
|
+
>
|
|
121
|
+
<div v-if="operationActiveTabKey === '1'">
|
|
122
|
+
<a-descriptions layout="vertical" bordered>
|
|
123
|
+
<a-descriptions-item label="日志内容"><p style="margin: 0;white-space: pre;" v-html="details.f_error_msg === '' ? '--' : toText(details.f_error_msg)"></p></a-descriptions-item>
|
|
124
|
+
</a-descriptions>
|
|
125
|
+
</div>
|
|
126
|
+
<div v-else-if="operationActiveTabKey === '2'" class="no-data"><a-icon type="frown-o"/>暂无数据</div>
|
|
127
|
+
</a-card>
|
|
128
|
+
</a-page-header>
|
|
129
|
+
</a-spin>
|
|
130
|
+
</a-drawer>
|
|
131
|
+
</template>
|
|
132
|
+
|
|
133
|
+
<script>
|
|
134
|
+
import { formatDate } from '@vue2-client/utils/util'
|
|
135
|
+
import { LogDetailsViewApi, post } from '@vue2-client/services/api'
|
|
136
|
+
import { mapState } from 'vuex'
|
|
137
|
+
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
138
|
+
|
|
139
|
+
const statusIconMap = {
|
|
140
|
+
'待办的': {
|
|
141
|
+
icon: 'info-circle',
|
|
142
|
+
style: 'color: #fe7300;'
|
|
143
|
+
},
|
|
144
|
+
'进行中': {
|
|
145
|
+
icon: 'clock-circle',
|
|
146
|
+
style: 'color: #2d81d7;'
|
|
147
|
+
},
|
|
148
|
+
'已完成': {
|
|
149
|
+
icon: 'check-circle',
|
|
150
|
+
style: 'color:#4baf50;'
|
|
151
|
+
},
|
|
152
|
+
'已关闭': {
|
|
153
|
+
icon: 'issues-close',
|
|
154
|
+
style: 'color:#ec0019;'
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const eventIconMap = {
|
|
159
|
+
'开始处理事件': {
|
|
160
|
+
icon: 'forward',
|
|
161
|
+
style: 'color: #fe7300;'
|
|
162
|
+
},
|
|
163
|
+
'将事件状态修改为 代办的': {
|
|
164
|
+
icon: 'edit',
|
|
165
|
+
style: 'color: #2d81d7;'
|
|
166
|
+
},
|
|
167
|
+
'将事件状态修改为 已关闭': {
|
|
168
|
+
icon: 'issues-close',
|
|
169
|
+
style: 'color:#ec0019;'
|
|
170
|
+
},
|
|
171
|
+
'已完成对事件的处理': {
|
|
172
|
+
icon: 'check-circle',
|
|
173
|
+
style: 'color:#4baf50;'
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export default {
|
|
178
|
+
name: 'LogDetailsView',
|
|
179
|
+
components: {
|
|
180
|
+
XBadge
|
|
181
|
+
},
|
|
182
|
+
data () {
|
|
183
|
+
return {
|
|
184
|
+
// 日志ID
|
|
185
|
+
id: 0,
|
|
186
|
+
// 日志详情加载,
|
|
187
|
+
loadLogDetails: true,
|
|
188
|
+
// 页面宽度
|
|
189
|
+
screenWidth: document.documentElement.clientWidth,
|
|
190
|
+
// 日志详情
|
|
191
|
+
details: {
|
|
192
|
+
id: 0,
|
|
193
|
+
f_service: '',
|
|
194
|
+
f_src: '',
|
|
195
|
+
f_web_url: '',
|
|
196
|
+
f_log_type: '',
|
|
197
|
+
f_error_title: '',
|
|
198
|
+
f_times: '',
|
|
199
|
+
f_first_update_time: '',
|
|
200
|
+
f_last_update_time: '',
|
|
201
|
+
f_status: '待办的',
|
|
202
|
+
f_error_msg: ''
|
|
203
|
+
},
|
|
204
|
+
// 处理情况数组
|
|
205
|
+
eventList: [],
|
|
206
|
+
// 处理情况描述
|
|
207
|
+
remark: '',
|
|
208
|
+
operationTabList: [
|
|
209
|
+
{
|
|
210
|
+
key: '1',
|
|
211
|
+
tab: '基本信息'
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
operationActiveTabKey: '1'
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
mounted () {
|
|
218
|
+
this.initView()
|
|
219
|
+
},
|
|
220
|
+
filters: {
|
|
221
|
+
statusIconFilter (type) {
|
|
222
|
+
return statusIconMap[type].icon
|
|
223
|
+
},
|
|
224
|
+
statusIconStyleFilter (type) {
|
|
225
|
+
return statusIconMap[type].style
|
|
226
|
+
},
|
|
227
|
+
eventIconFilter (type) {
|
|
228
|
+
return eventIconMap[type].icon
|
|
229
|
+
},
|
|
230
|
+
eventIconStyleFilter (type) {
|
|
231
|
+
return eventIconMap[type].style
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
computed: {
|
|
235
|
+
...mapState('account', { currUser: 'user' }),
|
|
236
|
+
...mapState('setting', ['isMobile'])
|
|
237
|
+
},
|
|
238
|
+
props: {
|
|
239
|
+
logid: {
|
|
240
|
+
type: String || Number,
|
|
241
|
+
required: true
|
|
242
|
+
},
|
|
243
|
+
visible: {
|
|
244
|
+
type: Boolean,
|
|
245
|
+
default: false
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
methods: {
|
|
249
|
+
// 初始化组件
|
|
250
|
+
initView () {
|
|
251
|
+
this.getLog(this.logid)
|
|
252
|
+
},
|
|
253
|
+
onClose () {
|
|
254
|
+
this.$emit('update:visible', false)
|
|
255
|
+
},
|
|
256
|
+
// 获取日志详情信息
|
|
257
|
+
getLog (logId) {
|
|
258
|
+
this.loadLogDetails = true
|
|
259
|
+
return post(LogDetailsViewApi.getLogDetails, {
|
|
260
|
+
id: logId
|
|
261
|
+
})
|
|
262
|
+
.then(res => {
|
|
263
|
+
this.details = res
|
|
264
|
+
this.getRecord()
|
|
265
|
+
this.loadLogDetails = false
|
|
266
|
+
}, err => {
|
|
267
|
+
this.loadLogDetails = false
|
|
268
|
+
console.warn(err)
|
|
269
|
+
})
|
|
270
|
+
},
|
|
271
|
+
getRecord () {
|
|
272
|
+
return post(LogDetailsViewApi.getLogRecordList, {
|
|
273
|
+
pageNo: 1,
|
|
274
|
+
pageSize: 500,
|
|
275
|
+
dataId: this.logid,
|
|
276
|
+
type: '异常处理'
|
|
277
|
+
})
|
|
278
|
+
.then(res => {
|
|
279
|
+
this.eventList = res.data.reverse()
|
|
280
|
+
})
|
|
281
|
+
},
|
|
282
|
+
updateLogStatus (status) {
|
|
283
|
+
if (this.loadLogDetails) {
|
|
284
|
+
return
|
|
285
|
+
}
|
|
286
|
+
const _this = this
|
|
287
|
+
return post(LogDetailsViewApi.updateLogStatusData, {
|
|
288
|
+
id: _this.logid,
|
|
289
|
+
status: status,
|
|
290
|
+
username: _this.currUser.name
|
|
291
|
+
}).then(res => {
|
|
292
|
+
_this.getLog(_this.logid)
|
|
293
|
+
if (res.nums === 1) {
|
|
294
|
+
_this.$message.success('操作成功')
|
|
295
|
+
} else {
|
|
296
|
+
_this.$message.error('操作失败')
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
},
|
|
300
|
+
format (date, format) {
|
|
301
|
+
return formatDate(date, format)
|
|
302
|
+
},
|
|
303
|
+
toText (text) {
|
|
304
|
+
return text
|
|
305
|
+
.replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
|
|
306
|
+
.replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
watch: {
|
|
310
|
+
'visible' (val) {
|
|
311
|
+
if (val) {
|
|
312
|
+
this.initView()
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
</script>
|
|
318
|
+
|
|
319
|
+
<style lang="less" scoped>
|
|
320
|
+
.detail-layout {
|
|
321
|
+
margin-left: 44px;
|
|
322
|
+
}
|
|
323
|
+
.text {
|
|
324
|
+
color: rgba(0, 0, 0, .45);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.heading {
|
|
328
|
+
color: rgba(0, 0, 0, .85);
|
|
329
|
+
font-size: 20px;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.no-data {
|
|
333
|
+
color: rgba(0, 0, 0, .25);
|
|
334
|
+
text-align: center;
|
|
335
|
+
line-height: 64px;
|
|
336
|
+
font-size: 16px;
|
|
337
|
+
|
|
338
|
+
i {
|
|
339
|
+
font-size: 24px;
|
|
340
|
+
margin-right: 16px;
|
|
341
|
+
position: relative;
|
|
342
|
+
top: 3px;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.mobile {
|
|
347
|
+
.detail-layout {
|
|
348
|
+
margin-left: unset;
|
|
349
|
+
}
|
|
350
|
+
.text {
|
|
351
|
+
|
|
352
|
+
}
|
|
353
|
+
.status-list {
|
|
354
|
+
text-align: left;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.row {
|
|
359
|
+
display: flex;
|
|
360
|
+
|
|
361
|
+
.content {
|
|
362
|
+
-webkit-box-flex: 1;
|
|
363
|
+
flex: auto;
|
|
364
|
+
-ms-flex: auto;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.extra {
|
|
368
|
+
flex: 0 1 auto;
|
|
369
|
+
-webkit-box-flex: 0;
|
|
370
|
+
-ms-flex: 0 1 auto;
|
|
371
|
+
min-width: 242px;
|
|
372
|
+
margin-left: 88px;
|
|
373
|
+
text-align: right;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
</style>
|