vue2-client 1.2.41 → 1.2.42

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +109 -103
  2. package/docs/notice.md +22 -22
  3. package/package.json +1 -1
  4. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +555 -0
  5. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  6. package/src/base-client/components/common/XAddForm/XAddForm.vue +339 -338
  7. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +2 -1
  8. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  9. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +225 -225
  10. package/src/base-client/components/iot/DataAnalysisView/DataAnalysisView.vue +244 -244
  11. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +452 -452
  12. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  13. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  14. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +121 -121
  15. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  16. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +276 -276
  17. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +469 -469
  18. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +379 -379
  19. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +359 -359
  20. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  21. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +184 -184
  22. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +291 -291
  23. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +236 -236
  24. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +256 -256
  25. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +189 -189
  26. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +722 -722
  27. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  28. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +247 -247
  29. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +370 -370
  30. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  31. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  32. package/src/base-client/plugins/AppData.js +67 -67
  33. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  34. package/src/components/exception/ExceptionPage.vue +70 -70
  35. package/src/components/setting/Setting.vue +235 -235
  36. package/src/config/default/setting.config.js +35 -35
  37. package/src/config/index.js +3 -3
  38. package/src/layouts/header/HeaderNotice.vue +97 -97
  39. package/src/layouts/tabs/TabsView.vue +41 -40
  40. package/src/pages/login/Login.vue +201 -201
  41. package/src/pages/report/ReportTableHome.vue +28 -28
  42. package/src/pages/resourceManage/depListManage.vue +23 -23
  43. package/src/pages/resourceManage/funListManage.vue +23 -23
  44. package/src/pages/resourceManage/index.js +15 -15
  45. package/src/pages/resourceManage/orgListManage.vue +98 -98
  46. package/src/pages/resourceManage/roleListManage.vue +23 -23
  47. package/src/pages/resourceManage/staffListManage.vue +23 -23
  48. package/src/pages/system/ticket/submitTicketSuccess.vue +248 -248
  49. package/src/router/async/config.async.js +26 -26
  50. package/src/router/index.js +27 -27
  51. package/src/services/api/common.js +47 -47
  52. package/src/services/api/index.js +39 -39
  53. package/src/services/user.js +34 -34
  54. package/src/theme/default/style.less +47 -33
  55. package/src/utils/indexedDB.js +146 -146
  56. package/src/utils/routerUtil.js +359 -359
@@ -1,379 +1,379 @@
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
-
138
- const statusIconMap = {
139
- '待办的': {
140
- icon: 'info-circle',
141
- style: 'color: #fe7300;'
142
- },
143
- '进行中': {
144
- icon: 'clock-circle',
145
- style: 'color: #2d81d7;'
146
- },
147
- '已完成': {
148
- icon: 'check-circle',
149
- style: 'color:#4baf50;'
150
- },
151
- '已关闭': {
152
- icon: 'issues-close',
153
- style: 'color:#ec0019;'
154
- }
155
- }
156
-
157
- const eventIconMap = {
158
- '开始处理事件': {
159
- icon: 'forward',
160
- style: 'color: #fe7300;'
161
- },
162
- '将事件状态修改为 代办的': {
163
- icon: 'edit',
164
- style: 'color: #2d81d7;'
165
- },
166
- '将事件状态修改为 已关闭': {
167
- icon: 'issues-close',
168
- style: 'color:#ec0019;'
169
- },
170
- '已完成对事件的处理': {
171
- icon: 'check-circle',
172
- style: 'color:#4baf50;'
173
- }
174
- }
175
-
176
- export default {
177
- name: 'LogDetailsView',
178
- data () {
179
- return {
180
- // 日志ID
181
- id: 0,
182
- // 日志详情加载,
183
- loadLogDetails: true,
184
- // 页面宽度
185
- screenWidth: document.documentElement.clientWidth,
186
- // 日志详情
187
- details: {
188
- id: 0,
189
- f_service: '',
190
- f_src: '',
191
- f_web_url: '',
192
- f_log_type: '',
193
- f_error_title: '',
194
- f_times: '',
195
- f_first_update_time: '',
196
- f_last_update_time: '',
197
- f_status: '待办的',
198
- f_error_msg: ''
199
- },
200
- // 处理情况数组
201
- eventList: [],
202
- // 处理情况描述
203
- remark: '',
204
- operationTabList: [
205
- {
206
- key: '1',
207
- tab: '基本信息'
208
- }
209
- ],
210
- operationActiveTabKey: '1'
211
- }
212
- },
213
- mounted () {
214
- this.initView()
215
- },
216
- filters: {
217
- statusIconFilter (type) {
218
- return statusIconMap[type].icon
219
- },
220
- statusIconStyleFilter (type) {
221
- return statusIconMap[type].style
222
- },
223
- eventIconFilter (type) {
224
- return eventIconMap[type].icon
225
- },
226
- eventIconStyleFilter (type) {
227
- return eventIconMap[type].style
228
- }
229
- },
230
- computed: {
231
- ...mapState('account', { currUser: 'user' }),
232
- ...mapState('setting', ['isMobile'])
233
- },
234
- props: {
235
- logid: {
236
- type: String,
237
- required: true
238
- },
239
- selectOrgName: {
240
- type: String,
241
- required: true
242
- },
243
- visible: {
244
- type: Boolean,
245
- default: false
246
- }
247
- },
248
- methods: {
249
- // 初始化组件
250
- initView () {
251
- this.getLog(this.logid, this.selectOrgName)
252
- },
253
- onClose () {
254
- this.$emit('update:visible', false)
255
- },
256
- // 获取日志详情信息
257
- getLog (logId, selectOrgName) {
258
- this.loadLogDetails = true
259
- return post(LogDetailsViewApi.getLogDetails, {
260
- id: logId,
261
- orgName: selectOrgName
262
- })
263
- .then(res => {
264
- this.details = res
265
- this.getRecord()
266
- this.loadLogDetails = false
267
- }, err => {
268
- this.loadLogDetails = false
269
- console.warn(err)
270
- })
271
- },
272
- getRecord () {
273
- return post(LogDetailsViewApi.getLogRecordList, {
274
- pageNo: 1,
275
- pageSize: 500,
276
- dataId: this.logid,
277
- type: '异常处理',
278
- orgName: this.selectOrgName
279
- })
280
- .then(res => {
281
- this.eventList = res.data.reverse()
282
- })
283
- },
284
- updateLogStatus (status) {
285
- if (this.loadLogDetails) {
286
- return
287
- }
288
- const _this = this
289
- return post(LogDetailsViewApi.updateLogStatusData, {
290
- id: _this.logid,
291
- status: status,
292
- orgName: _this.selectOrgName,
293
- username: _this.currUser.name
294
- }).then(res => {
295
- _this.getLog(_this.logid, _this.selectOrgName)
296
- if (res.nums === 1) {
297
- _this.$message.success('操作成功')
298
- } else {
299
- _this.$message.error('操作失败')
300
- }
301
- })
302
- },
303
- format (date, format) {
304
- return formatDate(date, format)
305
- },
306
- toText (text) {
307
- return text
308
- .replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
309
- .replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
310
- }
311
- },
312
- watch: {
313
- 'visible' (val) {
314
- if (val) {
315
- this.initView()
316
- }
317
- }
318
- }
319
- }
320
- </script>
321
-
322
- <style lang="less" scoped>
323
- .detail-layout {
324
- margin-left: 44px;
325
- }
326
- .text {
327
- color: rgba(0, 0, 0, .45);
328
- }
329
-
330
- .heading {
331
- color: rgba(0, 0, 0, .85);
332
- font-size: 20px;
333
- }
334
-
335
- .no-data {
336
- color: rgba(0, 0, 0, .25);
337
- text-align: center;
338
- line-height: 64px;
339
- font-size: 16px;
340
-
341
- i {
342
- font-size: 24px;
343
- margin-right: 16px;
344
- position: relative;
345
- top: 3px;
346
- }
347
- }
348
-
349
- .mobile {
350
- .detail-layout {
351
- margin-left: unset;
352
- }
353
- .text {
354
-
355
- }
356
- .status-list {
357
- text-align: left;
358
- }
359
- }
360
-
361
- .row {
362
- display: flex;
363
-
364
- .content {
365
- -webkit-box-flex: 1;
366
- flex: auto;
367
- -ms-flex: auto;
368
- }
369
-
370
- .extra {
371
- flex: 0 1 auto;
372
- -webkit-box-flex: 0;
373
- -ms-flex: 0 1 auto;
374
- min-width: 242px;
375
- margin-left: 88px;
376
- text-align: right;
377
- }
378
- }
379
- </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
+
138
+ const statusIconMap = {
139
+ '待办的': {
140
+ icon: 'info-circle',
141
+ style: 'color: #fe7300;'
142
+ },
143
+ '进行中': {
144
+ icon: 'clock-circle',
145
+ style: 'color: #2d81d7;'
146
+ },
147
+ '已完成': {
148
+ icon: 'check-circle',
149
+ style: 'color:#4baf50;'
150
+ },
151
+ '已关闭': {
152
+ icon: 'issues-close',
153
+ style: 'color:#ec0019;'
154
+ }
155
+ }
156
+
157
+ const eventIconMap = {
158
+ '开始处理事件': {
159
+ icon: 'forward',
160
+ style: 'color: #fe7300;'
161
+ },
162
+ '将事件状态修改为 代办的': {
163
+ icon: 'edit',
164
+ style: 'color: #2d81d7;'
165
+ },
166
+ '将事件状态修改为 已关闭': {
167
+ icon: 'issues-close',
168
+ style: 'color:#ec0019;'
169
+ },
170
+ '已完成对事件的处理': {
171
+ icon: 'check-circle',
172
+ style: 'color:#4baf50;'
173
+ }
174
+ }
175
+
176
+ export default {
177
+ name: 'LogDetailsView',
178
+ data () {
179
+ return {
180
+ // 日志ID
181
+ id: 0,
182
+ // 日志详情加载,
183
+ loadLogDetails: true,
184
+ // 页面宽度
185
+ screenWidth: document.documentElement.clientWidth,
186
+ // 日志详情
187
+ details: {
188
+ id: 0,
189
+ f_service: '',
190
+ f_src: '',
191
+ f_web_url: '',
192
+ f_log_type: '',
193
+ f_error_title: '',
194
+ f_times: '',
195
+ f_first_update_time: '',
196
+ f_last_update_time: '',
197
+ f_status: '待办的',
198
+ f_error_msg: ''
199
+ },
200
+ // 处理情况数组
201
+ eventList: [],
202
+ // 处理情况描述
203
+ remark: '',
204
+ operationTabList: [
205
+ {
206
+ key: '1',
207
+ tab: '基本信息'
208
+ }
209
+ ],
210
+ operationActiveTabKey: '1'
211
+ }
212
+ },
213
+ mounted () {
214
+ this.initView()
215
+ },
216
+ filters: {
217
+ statusIconFilter (type) {
218
+ return statusIconMap[type].icon
219
+ },
220
+ statusIconStyleFilter (type) {
221
+ return statusIconMap[type].style
222
+ },
223
+ eventIconFilter (type) {
224
+ return eventIconMap[type].icon
225
+ },
226
+ eventIconStyleFilter (type) {
227
+ return eventIconMap[type].style
228
+ }
229
+ },
230
+ computed: {
231
+ ...mapState('account', { currUser: 'user' }),
232
+ ...mapState('setting', ['isMobile'])
233
+ },
234
+ props: {
235
+ logid: {
236
+ type: String,
237
+ required: true
238
+ },
239
+ selectOrgName: {
240
+ type: String,
241
+ required: true
242
+ },
243
+ visible: {
244
+ type: Boolean,
245
+ default: false
246
+ }
247
+ },
248
+ methods: {
249
+ // 初始化组件
250
+ initView () {
251
+ this.getLog(this.logid, this.selectOrgName)
252
+ },
253
+ onClose () {
254
+ this.$emit('update:visible', false)
255
+ },
256
+ // 获取日志详情信息
257
+ getLog (logId, selectOrgName) {
258
+ this.loadLogDetails = true
259
+ return post(LogDetailsViewApi.getLogDetails, {
260
+ id: logId,
261
+ orgName: selectOrgName
262
+ })
263
+ .then(res => {
264
+ this.details = res
265
+ this.getRecord()
266
+ this.loadLogDetails = false
267
+ }, err => {
268
+ this.loadLogDetails = false
269
+ console.warn(err)
270
+ })
271
+ },
272
+ getRecord () {
273
+ return post(LogDetailsViewApi.getLogRecordList, {
274
+ pageNo: 1,
275
+ pageSize: 500,
276
+ dataId: this.logid,
277
+ type: '异常处理',
278
+ orgName: this.selectOrgName
279
+ })
280
+ .then(res => {
281
+ this.eventList = res.data.reverse()
282
+ })
283
+ },
284
+ updateLogStatus (status) {
285
+ if (this.loadLogDetails) {
286
+ return
287
+ }
288
+ const _this = this
289
+ return post(LogDetailsViewApi.updateLogStatusData, {
290
+ id: _this.logid,
291
+ status: status,
292
+ orgName: _this.selectOrgName,
293
+ username: _this.currUser.name
294
+ }).then(res => {
295
+ _this.getLog(_this.logid, _this.selectOrgName)
296
+ if (res.nums === 1) {
297
+ _this.$message.success('操作成功')
298
+ } else {
299
+ _this.$message.error('操作失败')
300
+ }
301
+ })
302
+ },
303
+ format (date, format) {
304
+ return formatDate(date, format)
305
+ },
306
+ toText (text) {
307
+ return text
308
+ .replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
309
+ .replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
310
+ }
311
+ },
312
+ watch: {
313
+ 'visible' (val) {
314
+ if (val) {
315
+ this.initView()
316
+ }
317
+ }
318
+ }
319
+ }
320
+ </script>
321
+
322
+ <style lang="less" scoped>
323
+ .detail-layout {
324
+ margin-left: 44px;
325
+ }
326
+ .text {
327
+ color: rgba(0, 0, 0, .45);
328
+ }
329
+
330
+ .heading {
331
+ color: rgba(0, 0, 0, .85);
332
+ font-size: 20px;
333
+ }
334
+
335
+ .no-data {
336
+ color: rgba(0, 0, 0, .25);
337
+ text-align: center;
338
+ line-height: 64px;
339
+ font-size: 16px;
340
+
341
+ i {
342
+ font-size: 24px;
343
+ margin-right: 16px;
344
+ position: relative;
345
+ top: 3px;
346
+ }
347
+ }
348
+
349
+ .mobile {
350
+ .detail-layout {
351
+ margin-left: unset;
352
+ }
353
+ .text {
354
+
355
+ }
356
+ .status-list {
357
+ text-align: left;
358
+ }
359
+ }
360
+
361
+ .row {
362
+ display: flex;
363
+
364
+ .content {
365
+ -webkit-box-flex: 1;
366
+ flex: auto;
367
+ -ms-flex: auto;
368
+ }
369
+
370
+ .extra {
371
+ flex: 0 1 auto;
372
+ -webkit-box-flex: 0;
373
+ -ms-flex: 0 1 auto;
374
+ min-width: 242px;
375
+ margin-left: 88px;
376
+ text-align: right;
377
+ }
378
+ }
379
+ </style>