vue2-client 1.2.0 → 1.2.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.
Files changed (120) hide show
  1. package/README.md +65 -65
  2. package/babel.config.js +1 -0
  3. package/docs/notice.md +24 -0
  4. package/index.js +28 -28
  5. package/package.json +1 -1
  6. package/src/App.vue +93 -93
  7. package/src/base-client/all.js +57 -57
  8. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
  9. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
  11. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  12. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  13. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
  14. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  15. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
  17. package/src/base-client/components/common/XAddForm/index.md +60 -60
  18. package/src/base-client/components/common/XBadge/index.md +39 -39
  19. package/src/base-client/components/common/XCard/index.md +43 -43
  20. package/src/base-client/components/common/XForm/XForm.vue +275 -275
  21. package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
  22. package/src/base-client/components/common/XForm/index.md +196 -196
  23. package/src/base-client/components/common/XFormCol/index.md +35 -35
  24. package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
  25. package/src/base-client/components/common/XFormTable/index.md +89 -89
  26. package/src/base-client/components/common/XTable/XTable.vue +262 -262
  27. package/src/base-client/components/common/XTable/index.md +255 -255
  28. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
  29. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
  30. package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
  31. package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
  32. package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
  33. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
  34. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
  35. package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
  36. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
  37. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  38. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
  39. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
  40. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
  41. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
  42. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
  43. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
  44. package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
  45. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
  46. package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
  47. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
  48. package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
  49. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
  50. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
  51. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
  52. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
  53. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
  54. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
  55. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
  56. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
  57. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  58. package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
  59. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
  60. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
  61. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
  62. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
  63. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
  64. package/src/base-client/plugins/AppData.js +69 -69
  65. package/src/base-client/plugins/GetLoginInfoService.js +221 -221
  66. package/src/base-client/plugins/index.js +21 -21
  67. package/src/bootstrap.js +27 -27
  68. package/src/components/Ellipsis/Ellipsis.vue +64 -64
  69. package/src/components/Ellipsis/index.md +38 -38
  70. package/src/components/NumberInfo/index.md +43 -43
  71. package/src/components/STable/README.md +341 -341
  72. package/src/components/Trend/index.md +45 -45
  73. package/src/components/cache/AKeepAlive.js +172 -172
  74. package/src/components/checkbox/index.js +7 -7
  75. package/src/components/index.js +36 -36
  76. package/src/components/menu/menu.js +273 -273
  77. package/src/components/setting/Setting.vue +237 -237
  78. package/src/components/table/advance/AdvanceTable.vue +275 -275
  79. package/src/components/transition/PageToggleTransition.vue +97 -97
  80. package/src/layouts/CommonLayout.vue +42 -42
  81. package/src/layouts/PageLayout.vue +151 -151
  82. package/src/layouts/SinglePageView.vue +74 -74
  83. package/src/layouts/header/AdminHeader.vue +109 -109
  84. package/src/layouts/header/HeaderAvatar.vue +60 -60
  85. package/src/layouts/header/HeaderNotice.vue +97 -97
  86. package/src/layouts/tabs/TabsHead.vue +190 -190
  87. package/src/layouts/tabs/TabsView.vue +355 -355
  88. package/src/main.js +20 -20
  89. package/src/mock/goods/index.js +108 -108
  90. package/src/mock/index.js +12 -12
  91. package/src/mock/project/index.js +17 -17
  92. package/src/mock/user/current.js +13 -13
  93. package/src/mock/user/login.js +39 -39
  94. package/src/mock/workplace/index.js +15 -15
  95. package/src/pages/exception/403.vue +25 -25
  96. package/src/pages/exception/404.vue +25 -25
  97. package/src/pages/exception/500.vue +25 -25
  98. package/src/pages/login/Login.vue +194 -194
  99. package/src/pages/report/ReportTableHome.vue +28 -28
  100. package/src/pages/resourceManage/resourceManageMain.vue +55 -55
  101. package/src/pages/system/applyInstallView/Core.vue +570 -570
  102. package/src/pages/system/applyInstallView/index.vue +34 -34
  103. package/src/pages/system/dictionary/index.vue +41 -41
  104. package/src/pages/system/queryParams/index.vue +41 -41
  105. package/src/router/async/config.async.js +25 -25
  106. package/src/router/async/router.map.js +59 -59
  107. package/src/router/guards.js +104 -104
  108. package/src/router/index.js +27 -27
  109. package/src/services/api/common.js +39 -39
  110. package/src/services/api/restTools.js +23 -23
  111. package/src/services/dataSource.js +12 -12
  112. package/src/services/user.js +34 -34
  113. package/src/store/modules/setting.js +114 -114
  114. package/src/utils/i18n.js +80 -80
  115. package/src/utils/indexedDB.js +146 -146
  116. package/src/utils/request.js +197 -197
  117. package/src/utils/routerUtil.js +15 -2
  118. package/tests/unit/ReportTable.spec.js +15 -15
  119. package/vue.config.js +153 -153
  120. package/webpack.config.js +12 -12
@@ -1,380 +1,380 @@
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 } from '@vue2-client/services/api/LogDetailsViewApi'
136
- import { post } from '@vue2-client/services/api/restTools'
137
- import { mapState } from 'vuex'
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
- data () {
180
- return {
181
- // 日志ID
182
- id: 0,
183
- // 日志详情加载,
184
- loadLogDetails: true,
185
- // 页面宽度
186
- screenWidth: document.documentElement.clientWidth,
187
- // 日志详情
188
- details: {
189
- id: 0,
190
- f_service: '',
191
- f_src: '',
192
- f_web_url: '',
193
- f_log_type: '',
194
- f_error_title: '',
195
- f_times: '',
196
- f_first_update_time: '',
197
- f_last_update_time: '',
198
- f_status: '待办的',
199
- f_error_msg: ''
200
- },
201
- // 处理情况数组
202
- eventList: [],
203
- // 处理情况描述
204
- remark: '',
205
- operationTabList: [
206
- {
207
- key: '1',
208
- tab: '基本信息'
209
- }
210
- ],
211
- operationActiveTabKey: '1'
212
- }
213
- },
214
- mounted () {
215
- this.initView()
216
- },
217
- filters: {
218
- statusIconFilter (type) {
219
- return statusIconMap[type].icon
220
- },
221
- statusIconStyleFilter (type) {
222
- return statusIconMap[type].style
223
- },
224
- eventIconFilter (type) {
225
- return eventIconMap[type].icon
226
- },
227
- eventIconStyleFilter (type) {
228
- return eventIconMap[type].style
229
- }
230
- },
231
- computed: {
232
- ...mapState('account', { currUser: 'user' }),
233
- ...mapState('setting', ['isMobile'])
234
- },
235
- props: {
236
- logid: {
237
- type: String,
238
- required: true
239
- },
240
- selectOrgName: {
241
- type: String,
242
- required: true
243
- },
244
- visible: {
245
- type: Boolean,
246
- default: false
247
- }
248
- },
249
- methods: {
250
- // 初始化组件
251
- initView () {
252
- this.getLog(this.logid, this.selectOrgName)
253
- },
254
- onClose () {
255
- this.$emit('update:visible', false)
256
- },
257
- // 获取日志详情信息
258
- getLog (logId, selectOrgName) {
259
- this.loadLogDetails = true
260
- return post(LogDetailsViewApi.getLogDetails, {
261
- id: logId,
262
- orgName: selectOrgName
263
- })
264
- .then(res => {
265
- this.details = res
266
- this.getRecord()
267
- this.loadLogDetails = false
268
- }, err => {
269
- this.loadLogDetails = false
270
- console.warn(err)
271
- })
272
- },
273
- getRecord () {
274
- return post(LogDetailsViewApi.getLogRecordList, {
275
- pageNo: 1,
276
- pageSize: 500,
277
- dataId: this.logid,
278
- type: '异常处理',
279
- orgName: this.selectOrgName
280
- })
281
- .then(res => {
282
- this.eventList = res.data.reverse()
283
- })
284
- },
285
- updateLogStatus (status) {
286
- if (this.loadLogDetails) {
287
- return
288
- }
289
- const _this = this
290
- return post(LogDetailsViewApi.updateLogStatusData, {
291
- id: _this.logid,
292
- status: status,
293
- orgName: _this.selectOrgName,
294
- username: _this.currUser.name
295
- }).then(res => {
296
- _this.getLog(_this.logid, _this.selectOrgName)
297
- if (res.nums === 1) {
298
- _this.$message.success('操作成功')
299
- } else {
300
- _this.$message.error('操作失败')
301
- }
302
- })
303
- },
304
- format (date, format) {
305
- return formatDate(date, format)
306
- },
307
- toText (text) {
308
- return text
309
- .replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
310
- .replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
311
- }
312
- },
313
- watch: {
314
- 'visible' (val) {
315
- if (val) {
316
- this.initView()
317
- }
318
- }
319
- }
320
- }
321
- </script>
322
-
323
- <style lang="less" scoped>
324
- .detail-layout {
325
- margin-left: 44px;
326
- }
327
- .text {
328
- color: rgba(0, 0, 0, .45);
329
- }
330
-
331
- .heading {
332
- color: rgba(0, 0, 0, .85);
333
- font-size: 20px;
334
- }
335
-
336
- .no-data {
337
- color: rgba(0, 0, 0, .25);
338
- text-align: center;
339
- line-height: 64px;
340
- font-size: 16px;
341
-
342
- i {
343
- font-size: 24px;
344
- margin-right: 16px;
345
- position: relative;
346
- top: 3px;
347
- }
348
- }
349
-
350
- .mobile {
351
- .detail-layout {
352
- margin-left: unset;
353
- }
354
- .text {
355
-
356
- }
357
- .status-list {
358
- text-align: left;
359
- }
360
- }
361
-
362
- .row {
363
- display: flex;
364
-
365
- .content {
366
- -webkit-box-flex: 1;
367
- flex: auto;
368
- -ms-flex: auto;
369
- }
370
-
371
- .extra {
372
- flex: 0 1 auto;
373
- -webkit-box-flex: 0;
374
- -ms-flex: 0 1 auto;
375
- min-width: 242px;
376
- margin-left: 88px;
377
- text-align: right;
378
- }
379
- }
380
- </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 } from '@vue2-client/services/api/LogDetailsViewApi'
136
+ import { post } from '@vue2-client/services/api/restTools'
137
+ import { mapState } from 'vuex'
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
+ data () {
180
+ return {
181
+ // 日志ID
182
+ id: 0,
183
+ // 日志详情加载,
184
+ loadLogDetails: true,
185
+ // 页面宽度
186
+ screenWidth: document.documentElement.clientWidth,
187
+ // 日志详情
188
+ details: {
189
+ id: 0,
190
+ f_service: '',
191
+ f_src: '',
192
+ f_web_url: '',
193
+ f_log_type: '',
194
+ f_error_title: '',
195
+ f_times: '',
196
+ f_first_update_time: '',
197
+ f_last_update_time: '',
198
+ f_status: '待办的',
199
+ f_error_msg: ''
200
+ },
201
+ // 处理情况数组
202
+ eventList: [],
203
+ // 处理情况描述
204
+ remark: '',
205
+ operationTabList: [
206
+ {
207
+ key: '1',
208
+ tab: '基本信息'
209
+ }
210
+ ],
211
+ operationActiveTabKey: '1'
212
+ }
213
+ },
214
+ mounted () {
215
+ this.initView()
216
+ },
217
+ filters: {
218
+ statusIconFilter (type) {
219
+ return statusIconMap[type].icon
220
+ },
221
+ statusIconStyleFilter (type) {
222
+ return statusIconMap[type].style
223
+ },
224
+ eventIconFilter (type) {
225
+ return eventIconMap[type].icon
226
+ },
227
+ eventIconStyleFilter (type) {
228
+ return eventIconMap[type].style
229
+ }
230
+ },
231
+ computed: {
232
+ ...mapState('account', { currUser: 'user' }),
233
+ ...mapState('setting', ['isMobile'])
234
+ },
235
+ props: {
236
+ logid: {
237
+ type: String,
238
+ required: true
239
+ },
240
+ selectOrgName: {
241
+ type: String,
242
+ required: true
243
+ },
244
+ visible: {
245
+ type: Boolean,
246
+ default: false
247
+ }
248
+ },
249
+ methods: {
250
+ // 初始化组件
251
+ initView () {
252
+ this.getLog(this.logid, this.selectOrgName)
253
+ },
254
+ onClose () {
255
+ this.$emit('update:visible', false)
256
+ },
257
+ // 获取日志详情信息
258
+ getLog (logId, selectOrgName) {
259
+ this.loadLogDetails = true
260
+ return post(LogDetailsViewApi.getLogDetails, {
261
+ id: logId,
262
+ orgName: selectOrgName
263
+ })
264
+ .then(res => {
265
+ this.details = res
266
+ this.getRecord()
267
+ this.loadLogDetails = false
268
+ }, err => {
269
+ this.loadLogDetails = false
270
+ console.warn(err)
271
+ })
272
+ },
273
+ getRecord () {
274
+ return post(LogDetailsViewApi.getLogRecordList, {
275
+ pageNo: 1,
276
+ pageSize: 500,
277
+ dataId: this.logid,
278
+ type: '异常处理',
279
+ orgName: this.selectOrgName
280
+ })
281
+ .then(res => {
282
+ this.eventList = res.data.reverse()
283
+ })
284
+ },
285
+ updateLogStatus (status) {
286
+ if (this.loadLogDetails) {
287
+ return
288
+ }
289
+ const _this = this
290
+ return post(LogDetailsViewApi.updateLogStatusData, {
291
+ id: _this.logid,
292
+ status: status,
293
+ orgName: _this.selectOrgName,
294
+ username: _this.currUser.name
295
+ }).then(res => {
296
+ _this.getLog(_this.logid, _this.selectOrgName)
297
+ if (res.nums === 1) {
298
+ _this.$message.success('操作成功')
299
+ } else {
300
+ _this.$message.error('操作失败')
301
+ }
302
+ })
303
+ },
304
+ format (date, format) {
305
+ return formatDate(date, format)
306
+ },
307
+ toText (text) {
308
+ return text
309
+ .replace(new RegExp('<-', 'g'), '<span style="color: red;font-weight: bold;"><-</span>')
310
+ .replace(new RegExp('Caused by:', 'g'), '<span style="color: red;font-weight: bold;">Caused by:</span>')
311
+ }
312
+ },
313
+ watch: {
314
+ 'visible' (val) {
315
+ if (val) {
316
+ this.initView()
317
+ }
318
+ }
319
+ }
320
+ }
321
+ </script>
322
+
323
+ <style lang="less" scoped>
324
+ .detail-layout {
325
+ margin-left: 44px;
326
+ }
327
+ .text {
328
+ color: rgba(0, 0, 0, .45);
329
+ }
330
+
331
+ .heading {
332
+ color: rgba(0, 0, 0, .85);
333
+ font-size: 20px;
334
+ }
335
+
336
+ .no-data {
337
+ color: rgba(0, 0, 0, .25);
338
+ text-align: center;
339
+ line-height: 64px;
340
+ font-size: 16px;
341
+
342
+ i {
343
+ font-size: 24px;
344
+ margin-right: 16px;
345
+ position: relative;
346
+ top: 3px;
347
+ }
348
+ }
349
+
350
+ .mobile {
351
+ .detail-layout {
352
+ margin-left: unset;
353
+ }
354
+ .text {
355
+
356
+ }
357
+ .status-list {
358
+ text-align: left;
359
+ }
360
+ }
361
+
362
+ .row {
363
+ display: flex;
364
+
365
+ .content {
366
+ -webkit-box-flex: 1;
367
+ flex: auto;
368
+ -ms-flex: auto;
369
+ }
370
+
371
+ .extra {
372
+ flex: 0 1 auto;
373
+ -webkit-box-flex: 0;
374
+ -ms-flex: 0 1 auto;
375
+ min-width: 242px;
376
+ margin-left: 88px;
377
+ text-align: right;
378
+ }
379
+ }
380
+ </style>