vue2-client 1.17.15 → 1.17.18
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/package.json +1 -1
- package/src/base-client/components/common/XForm/XTreeSelect.vue +276 -276
- package/src/base-client/components/common/XFormTable/demo.vue +89 -89
- package/src/base-client/components/common/XReport/print.js +186 -186
- package/src/base-client/components/common/XTab/XTab.vue +243 -44
- package/src/components/FileImageItem/ImageItem.vue +13 -2
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +1 -1
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +8 -0
- package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowPreview.vue +8 -1
- package/src/router/async/router.map.js +2 -2
- package/src/services/api/workFlow.js +2 -0
- package/src/utils/map-utils.js +47 -47
- package/vue.config.js +20 -10
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
<slot name="extraBeforeTabs"></slot>
|
|
14
14
|
<a-tab-pane
|
|
15
|
-
:forceRender="true"
|
|
16
15
|
v-for="(tab, index) in config.data"
|
|
17
16
|
:key="index"
|
|
18
17
|
:tab="tab.title"
|
|
18
|
+
:forceRender="isTabLoaded(index)"
|
|
19
19
|
>
|
|
20
20
|
<component
|
|
21
|
+
v-if="isTabLoaded(index)"
|
|
21
22
|
:is="tab.slotType"
|
|
22
23
|
:key="'xTabPaneComp' + index"
|
|
23
24
|
:ref="`tab_com_${tab.slotType}_${index}`"
|
|
@@ -51,18 +52,22 @@ export default {
|
|
|
51
52
|
XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue')
|
|
52
53
|
},
|
|
53
54
|
inject: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
isInAModal: { default: false },
|
|
56
|
+
getSelectedId: { default: false },
|
|
57
|
+
getSelectedData: { default: false },
|
|
58
|
+
getOutEnv: { default: false },
|
|
59
|
+
setGlobalData: { default: false },
|
|
60
|
+
getGlobalData: { default: false },
|
|
61
|
+
generalFunction: { default: false },
|
|
62
|
+
},
|
|
62
63
|
provide () {
|
|
63
64
|
return {
|
|
64
65
|
currUser: this.currUser,
|
|
65
|
-
getSelectedId: this.getSelectedId
|
|
66
|
+
getSelectedId: this.getSelectedId,
|
|
67
|
+
// 暴露页签加载相关方法,供子组件调用
|
|
68
|
+
ensureTabLoaded: this.ensureTabLoaded,
|
|
69
|
+
getTabComponent: this.getTabComponent,
|
|
70
|
+
isTabLoaded: this.isTabLoaded
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
data () {
|
|
@@ -72,7 +77,8 @@ export default {
|
|
|
72
77
|
config: undefined,
|
|
73
78
|
tabBarExtraContent: undefined,
|
|
74
79
|
attr: {},
|
|
75
|
-
showTabBar: true // 默认显示页签
|
|
80
|
+
showTabBar: true, // 默认显示页签
|
|
81
|
+
loadedTabs: [] // 记录已加载的页签索引
|
|
76
82
|
}
|
|
77
83
|
},
|
|
78
84
|
computed: {
|
|
@@ -80,6 +86,8 @@ export default {
|
|
|
80
86
|
},
|
|
81
87
|
mounted () {
|
|
82
88
|
this.activeKey = this.defaultActiveKey
|
|
89
|
+
// 标记默认激活的页签为已加载
|
|
90
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
83
91
|
this.tabPaneChange('initTabLoading', true)
|
|
84
92
|
},
|
|
85
93
|
methods: {
|
|
@@ -92,17 +100,25 @@ export default {
|
|
|
92
100
|
getRealKeyData,
|
|
93
101
|
getConfigByName,
|
|
94
102
|
getConfigByNameAsync,
|
|
95
|
-
tabPaneChange (newKey, initStatus = false) {
|
|
103
|
+
async tabPaneChange (newKey, initStatus = false) {
|
|
96
104
|
let result = {}
|
|
97
105
|
if (this.activeKey === newKey) {
|
|
98
106
|
return
|
|
99
107
|
}
|
|
108
|
+
|
|
100
109
|
const oldKey = this.activeKey
|
|
110
|
+
|
|
111
|
+
// 标记新页签为已加载
|
|
112
|
+
if (this.config && this.config.data && this.config.data[newKey] !== undefined) {
|
|
113
|
+
this.markTabAsLoaded(newKey)
|
|
114
|
+
}
|
|
115
|
+
|
|
101
116
|
if (this.config && this.config.changeFunc) {
|
|
102
117
|
let oldRef
|
|
103
118
|
let oldTabName
|
|
104
119
|
let newRef
|
|
105
120
|
let newTabName
|
|
121
|
+
|
|
106
122
|
if (!this.config.data[oldKey]) {
|
|
107
123
|
oldTabName = `tab_com_${oldKey}`
|
|
108
124
|
oldRef = this.$refs[oldTabName]
|
|
@@ -111,6 +127,7 @@ export default {
|
|
|
111
127
|
oldTabName = `tab_com_${oldTabSlotType}_${oldKey}`
|
|
112
128
|
oldRef = this.$refs[oldTabName]
|
|
113
129
|
}
|
|
130
|
+
|
|
114
131
|
if (!this.config.data[newKey]) {
|
|
115
132
|
newTabName = `tab_com_${newKey}`
|
|
116
133
|
newRef = this.$refs[newTabName]
|
|
@@ -119,6 +136,7 @@ export default {
|
|
|
119
136
|
newTabName = `tab_com_${newTabSlotType}_${newKey}`
|
|
120
137
|
newRef = this.$refs[newTabName]
|
|
121
138
|
}
|
|
139
|
+
|
|
122
140
|
const args = [
|
|
123
141
|
oldKey,
|
|
124
142
|
newKey,
|
|
@@ -127,56 +145,75 @@ export default {
|
|
|
127
145
|
oldRef ? oldRef[0] : undefined,
|
|
128
146
|
]
|
|
129
147
|
args.push(newTabName)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
|
|
149
|
+
// 关键修改:确保新组件实例存在
|
|
150
|
+
if (!newRef || !newRef[0]) {
|
|
151
|
+
console.log('等待新页签组件初始化...')
|
|
152
|
+
// 等待组件挂载完成
|
|
153
|
+
await this.waitForComponentReady(newKey)
|
|
154
|
+
newRef = this.$refs[newTabName]
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (newRef && newRef[0]) {
|
|
134
158
|
args.push(newRef[0])
|
|
159
|
+
} else {
|
|
160
|
+
args.push(null)
|
|
161
|
+
console.warn('新页签组件实例获取失败')
|
|
135
162
|
}
|
|
163
|
+
|
|
136
164
|
args.push(this.extraData)
|
|
165
|
+
|
|
166
|
+
// 使用 $nextTick 确保 DOM 更新完成
|
|
167
|
+
await this.$nextTick()
|
|
168
|
+
|
|
137
169
|
result = executeStrFunctionByContext(this, this.config.changeFunc, args)
|
|
170
|
+
|
|
138
171
|
if (result && result.noChange) {
|
|
139
172
|
console.info('不切换页签作为按钮使用')
|
|
140
173
|
} else {
|
|
141
174
|
this.activeKey = newKey
|
|
175
|
+
// 确保回调在组件完全就绪后执行
|
|
142
176
|
if (result && result.callback && typeof result.callback === 'function') {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const newComponent = newRef
|
|
146
|
-
if (!newComponent || !newComponent[0]) {
|
|
147
|
-
console.warn('组件实例尚未创建,等待组件mounted事件')
|
|
148
|
-
// 使用 MutationObserver 监听DOM变化
|
|
149
|
-
const observer = new MutationObserver((mutations, obs) => {
|
|
150
|
-
const newComp = newRef
|
|
151
|
-
if (newComp && newComp[0]) {
|
|
152
|
-
obs.disconnect()
|
|
153
|
-
console.log('组件已创建,执行回调')
|
|
154
|
-
result.callback()
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
observer.observe(this.$el, {
|
|
158
|
-
childList: true,
|
|
159
|
-
subtree: true
|
|
160
|
-
})
|
|
161
|
-
// 设置超时,避免无限等待
|
|
162
|
-
setTimeout(() => {
|
|
163
|
-
observer.disconnect()
|
|
164
|
-
console.warn('等待组件创建超时')
|
|
165
|
-
}, 500)
|
|
166
|
-
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
result.callback()
|
|
170
|
-
})
|
|
177
|
+
await this.$nextTick()
|
|
178
|
+
result.callback()
|
|
171
179
|
}
|
|
172
180
|
}
|
|
173
181
|
} else {
|
|
174
182
|
this.activeKey = newKey
|
|
175
183
|
}
|
|
184
|
+
|
|
176
185
|
if (initStatus) {
|
|
177
186
|
this.activeKey = this.defaultActiveKey
|
|
178
187
|
}
|
|
179
188
|
},
|
|
189
|
+
|
|
190
|
+
// 新增:等待组件就绪的方法
|
|
191
|
+
waitForComponentReady (index) {
|
|
192
|
+
return new Promise((resolve) => {
|
|
193
|
+
const checkComponent = () => {
|
|
194
|
+
const tab = this.config.data[index]
|
|
195
|
+
const refName = `tab_com_${tab.slotType}_${index}`
|
|
196
|
+
const ref = this.$refs[refName]
|
|
197
|
+
|
|
198
|
+
if (ref && ref[0]) {
|
|
199
|
+
// 额外检查组件内部是否已初始化(如果有相关状态的话)
|
|
200
|
+
if (ref[0].isReady !== undefined) {
|
|
201
|
+
if (ref[0].isReady) {
|
|
202
|
+
resolve(ref[0])
|
|
203
|
+
} else {
|
|
204
|
+
setTimeout(checkComponent, 50)
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
resolve(ref[0])
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
setTimeout(checkComponent, 50)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
checkComponent()
|
|
215
|
+
})
|
|
216
|
+
},
|
|
180
217
|
initConfig () {
|
|
181
218
|
if (this.configName) {
|
|
182
219
|
this.getConfig()
|
|
@@ -185,12 +222,22 @@ export default {
|
|
|
185
222
|
// 设置是否显示页签
|
|
186
223
|
this.showTabBar = this.localConfig.showTabBar !== false
|
|
187
224
|
}
|
|
225
|
+
// 重置已加载页签集合,确保配置变更后重新加载
|
|
226
|
+
this.loadedTabs = []
|
|
227
|
+
// 标记默认激活的页签为已加载
|
|
228
|
+
if (this.config && this.config.data) {
|
|
229
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
230
|
+
}
|
|
188
231
|
},
|
|
189
232
|
getConfig () {
|
|
190
233
|
getConfigByName(this.configName, this.serverName, res => {
|
|
191
234
|
this.config = res
|
|
192
235
|
// 设置是否显示页签
|
|
193
236
|
this.showTabBar = res.showTabBar !== false
|
|
237
|
+
// 标记默认激活的页签为已加载
|
|
238
|
+
if (this.config && this.config.data) {
|
|
239
|
+
this.markTabAsLoaded(this.defaultActiveKey)
|
|
240
|
+
}
|
|
194
241
|
}, this.env === 'dev')
|
|
195
242
|
},
|
|
196
243
|
getEventHandlers (tab, index) {
|
|
@@ -237,6 +284,158 @@ export default {
|
|
|
237
284
|
}, this.env === 'dev')
|
|
238
285
|
}
|
|
239
286
|
},
|
|
287
|
+
// 判断页签是否已加载
|
|
288
|
+
isTabLoaded (index) {
|
|
289
|
+
const numIndex = Number(index)
|
|
290
|
+
return this.loadedTabs.includes(numIndex) || Number(this.activeKey) === numIndex
|
|
291
|
+
},
|
|
292
|
+
// 标记页签为已加载
|
|
293
|
+
markTabAsLoaded (index) {
|
|
294
|
+
const numIndex = Number(index)
|
|
295
|
+
// 确保是有效的数字索引,且未添加过
|
|
296
|
+
if (!isNaN(numIndex) && numIndex >= 0 && !this.loadedTabs.includes(numIndex)) {
|
|
297
|
+
this.loadedTabs.push(numIndex)
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
// 确保页签已加载,如果未加载则先加载,返回 Promise 等待组件渲染完成
|
|
301
|
+
ensureTabLoaded (index, options = {}) {
|
|
302
|
+
return new Promise((resolve, reject) => {
|
|
303
|
+
const numIndex = Number(index)
|
|
304
|
+
const innerRefs = Array.isArray(options.innerRefs) ? options.innerRefs : []
|
|
305
|
+
const allowSwitch = options.allowSwitch !== false
|
|
306
|
+
// 验证索引有效性
|
|
307
|
+
if (isNaN(numIndex) || numIndex < 0) {
|
|
308
|
+
reject(new Error(`无效的页签索引: ${index}`))
|
|
309
|
+
return
|
|
310
|
+
}
|
|
311
|
+
if (!this.config || !this.config.data || !this.config.data[numIndex]) {
|
|
312
|
+
reject(new Error(`页签索引 ${index} 不存在`))
|
|
313
|
+
return
|
|
314
|
+
}
|
|
315
|
+
// 如果已经加载,直接返回组件实例
|
|
316
|
+
if (this.isTabLoaded(numIndex)) {
|
|
317
|
+
const component = this.getTabComponent(numIndex)
|
|
318
|
+
if (component) {
|
|
319
|
+
if (innerRefs.length === 0) {
|
|
320
|
+
resolve(component)
|
|
321
|
+
} else {
|
|
322
|
+
this.waitForInnerRefs(component, innerRefs, resolve, reject)
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
// 已标记但组件可能还在渲染中,等待一下
|
|
326
|
+
this.$nextTick(() => {
|
|
327
|
+
const comp = this.getTabComponent(numIndex)
|
|
328
|
+
if (comp) {
|
|
329
|
+
if (innerRefs.length === 0) {
|
|
330
|
+
resolve(comp)
|
|
331
|
+
} else {
|
|
332
|
+
this.waitForInnerRefs(comp, innerRefs, resolve, reject)
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
// 等待组件mounted
|
|
336
|
+
this.waitForComponent(numIndex, (c) => {
|
|
337
|
+
if (innerRefs.length === 0) {
|
|
338
|
+
resolve(c)
|
|
339
|
+
} else {
|
|
340
|
+
this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
341
|
+
}
|
|
342
|
+
}, reject)
|
|
343
|
+
}
|
|
344
|
+
})
|
|
345
|
+
}
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
// 标记为已加载,触发渲染
|
|
349
|
+
this.markTabAsLoaded(numIndex)
|
|
350
|
+
// 优先尝试在不切换页签的情况下获取组件
|
|
351
|
+
this.$nextTick(() => {
|
|
352
|
+
const comp = this.getTabComponent(numIndex)
|
|
353
|
+
if (comp) {
|
|
354
|
+
if (innerRefs.length === 0) resolve(comp)
|
|
355
|
+
else this.waitForInnerRefs(comp, innerRefs, resolve, reject)
|
|
356
|
+
return
|
|
357
|
+
}
|
|
358
|
+
// 若仍未渲染,且允许临时切换,则进行一次激活-恢复回退
|
|
359
|
+
if (!allowSwitch) {
|
|
360
|
+
// 不允许切换则进入常规等待(可能更慢)
|
|
361
|
+
this.waitForComponent(numIndex, (c) => {
|
|
362
|
+
if (innerRefs.length === 0) resolve(c)
|
|
363
|
+
else this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
364
|
+
}, reject)
|
|
365
|
+
return
|
|
366
|
+
}
|
|
367
|
+
const prevActive = this.activeKey
|
|
368
|
+
this.activeKey = numIndex
|
|
369
|
+
this.$nextTick(() => {
|
|
370
|
+
this.waitForComponent(numIndex, (c) => {
|
|
371
|
+
// 组件到位后再恢复原激活页签
|
|
372
|
+
if (prevActive !== numIndex) {
|
|
373
|
+
this.$nextTick(() => { this.activeKey = prevActive })
|
|
374
|
+
}
|
|
375
|
+
if (innerRefs.length === 0) resolve(c)
|
|
376
|
+
else this.waitForInnerRefs(c, innerRefs, resolve, reject)
|
|
377
|
+
}, reject)
|
|
378
|
+
})
|
|
379
|
+
})
|
|
380
|
+
})
|
|
381
|
+
},
|
|
382
|
+
// 等待组件渲染完成
|
|
383
|
+
waitForComponent (index, resolve, reject) {
|
|
384
|
+
const maxAttempts = 50 // 最多尝试50次
|
|
385
|
+
let attempts = 0
|
|
386
|
+
const checkInterval = 50 // 每50ms检查一次
|
|
387
|
+
const tab = this.config.data[index]
|
|
388
|
+
const refName = `tab_com_${tab.slotType}_${index}`
|
|
389
|
+
const checkComponent = () => {
|
|
390
|
+
attempts++
|
|
391
|
+
const component = this.$refs[refName]
|
|
392
|
+
if (component && component[0]) {
|
|
393
|
+
resolve(component[0])
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
if (attempts >= maxAttempts) {
|
|
397
|
+
reject(new Error(`等待页签 ${index} 组件加载超时`))
|
|
398
|
+
return
|
|
399
|
+
}
|
|
400
|
+
setTimeout(checkComponent, checkInterval)
|
|
401
|
+
}
|
|
402
|
+
// 首次检查
|
|
403
|
+
this.$nextTick(() => {
|
|
404
|
+
checkComponent()
|
|
405
|
+
})
|
|
406
|
+
},
|
|
407
|
+
// 等待内部 $refs 就绪
|
|
408
|
+
waitForInnerRefs (component, innerRefs, resolve, reject) {
|
|
409
|
+
const maxAttempts = 50
|
|
410
|
+
let attempts = 0
|
|
411
|
+
const checkInterval = 50
|
|
412
|
+
const allReady = () => innerRefs.every(name => component.$refs && component.$refs[name])
|
|
413
|
+
const check = () => {
|
|
414
|
+
attempts++
|
|
415
|
+
if (allReady()) {
|
|
416
|
+
resolve(component)
|
|
417
|
+
return
|
|
418
|
+
}
|
|
419
|
+
if (attempts >= maxAttempts) {
|
|
420
|
+
reject(new Error(`等待内部 refs [${innerRefs.join(', ')}] 就绪超时`))
|
|
421
|
+
return
|
|
422
|
+
}
|
|
423
|
+
setTimeout(check, checkInterval)
|
|
424
|
+
}
|
|
425
|
+
this.$nextTick(() => check())
|
|
426
|
+
},
|
|
427
|
+
// 获取页签的组件实例
|
|
428
|
+
getTabComponent (index) {
|
|
429
|
+
const numIndex = Number(index)
|
|
430
|
+
if (isNaN(numIndex) || numIndex < 0 || !this.config || !this.config.data || !this.config.data[numIndex]) {
|
|
431
|
+
return null
|
|
432
|
+
}
|
|
433
|
+
const tab = this.config.data[numIndex]
|
|
434
|
+
const refName = `tab_com_${tab.slotType}_${numIndex}`
|
|
435
|
+
const ref = this.$refs[refName]
|
|
436
|
+
return ref && ref[0] ? ref[0] : null
|
|
437
|
+
},
|
|
438
|
+
|
|
240
439
|
},
|
|
241
440
|
props: {
|
|
242
441
|
// 配置名
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<!-- 图片 -->
|
|
4
|
-
<span v-for="img in images" :key="img.id" class="picture-card" :style="{ width: cardSize, height: cardSize }">
|
|
4
|
+
<span v-for="img in images" :key="img.id" class="picture-card" :style="{ width: cardSize, height: cardSize, padding: paddingSize }">
|
|
5
5
|
<img :src="img.url" :alt="img.name" />
|
|
6
6
|
<span class="picture-action" :style="{ width: actionSize, height: actionSize }">
|
|
7
7
|
<a-icon type="eye" class="picture-preview-icon" @click="handlePreview(img.url)" />
|
|
@@ -38,6 +38,10 @@ export default {
|
|
|
38
38
|
width: {
|
|
39
39
|
type: Number,
|
|
40
40
|
default: 150
|
|
41
|
+
},
|
|
42
|
+
padding: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 10
|
|
41
45
|
}
|
|
42
46
|
},
|
|
43
47
|
data () {
|
|
@@ -52,6 +56,13 @@ export default {
|
|
|
52
56
|
},
|
|
53
57
|
actionSize: function () {
|
|
54
58
|
return this.width - 22 + 'px'
|
|
59
|
+
},
|
|
60
|
+
paddingSize: function () {
|
|
61
|
+
if (Number(this.padding) === 0) {
|
|
62
|
+
return 0
|
|
63
|
+
} else {
|
|
64
|
+
return this.padding + 'px'
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
},
|
|
57
68
|
methods: {
|
|
@@ -73,7 +84,7 @@ export default {
|
|
|
73
84
|
display: inline-block;
|
|
74
85
|
border: 1px solid #d9d9d9;
|
|
75
86
|
border-radius: 6px;
|
|
76
|
-
padding: 10px;
|
|
87
|
+
//padding: 10px;
|
|
77
88
|
margin: 0 10px 10px 0;
|
|
78
89
|
overflow: hidden;
|
|
79
90
|
img {
|
|
@@ -1083,6 +1083,14 @@ export default {
|
|
|
1083
1083
|
continue
|
|
1084
1084
|
}
|
|
1085
1085
|
let value = dataObj[key]
|
|
1086
|
+
// 如果字段类型是图片,获取图片的url
|
|
1087
|
+
if (stepDefine.type === 'image' && Array.isArray(value) && value.length > 0) {
|
|
1088
|
+
const urls = await postByServiceName(workFlowViewApi.getFilesUrlByIds, {
|
|
1089
|
+
ids: `(${value.map(id => Number(id)).join(',')})`
|
|
1090
|
+
})
|
|
1091
|
+
formDataArr.push({ label: stepDefine.name, value: urls.urls, type: 'image' })
|
|
1092
|
+
continue
|
|
1093
|
+
}
|
|
1086
1094
|
// 字典值处理
|
|
1087
1095
|
if (stepDefine.formType === 'select' && stepDefine.selectType === 'key') {
|
|
1088
1096
|
const dictList = this.$appdata.getDictionaryList(stepDefine.selectKey)
|
|
@@ -27,7 +27,14 @@
|
|
|
27
27
|
v-show="item.label !== '附件上传' && item.label !== '__expressionRs'"
|
|
28
28
|
>
|
|
29
29
|
<span slot="label" style="color: #000">{{ item.label }}</span>
|
|
30
|
-
<
|
|
30
|
+
<span v-if="(item.type ?? 'default') === 'image'">
|
|
31
|
+
<div style="white-space: pre-wrap">
|
|
32
|
+
<image-item :images="item.value" :width="70" :padding="0"/>
|
|
33
|
+
</div>
|
|
34
|
+
</span>
|
|
35
|
+
<span v-else>
|
|
36
|
+
<div style="white-space: pre-wrap">{{ item.value }}</div>
|
|
37
|
+
</span>
|
|
31
38
|
</a-descriptions-item>
|
|
32
39
|
</template>
|
|
33
40
|
</a-descriptions>
|
|
@@ -53,9 +53,9 @@ routerResource.newDynamicStatistics = () => import('@vue2-client/pages/NewDynami
|
|
|
53
53
|
routerResource.example = {
|
|
54
54
|
path: 'example',
|
|
55
55
|
name: '示例主页面',
|
|
56
|
-
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo2.vue'),
|
|
57
|
-
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
58
56
|
component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
57
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
58
|
+
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
59
59
|
// component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),
|
|
60
60
|
// component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
|
|
61
61
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
package/src/utils/map-utils.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
-
let Amap
|
|
3
|
-
async function GetGDMap (secretKey, key) {
|
|
4
|
-
if (!Amap) {
|
|
5
|
-
window._AMapSecurityConfig = {
|
|
6
|
-
securityJsCode: secretKey
|
|
7
|
-
}
|
|
8
|
-
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
-
AMapLoader.reset()
|
|
10
|
-
Amap = await AMapLoader.load({
|
|
11
|
-
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
-
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
-
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
-
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
-
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
-
AMapUI: {
|
|
17
|
-
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
-
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
return Amap
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function getGDMap (address) {
|
|
26
|
-
new (await GetGDMap()).Geocoder({
|
|
27
|
-
radius: 500 // 范围,默认:500
|
|
28
|
-
}).getLocation(address, function (status, result) {
|
|
29
|
-
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
-
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
-
} else {
|
|
32
|
-
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
-
throw new Error('根据经纬度查询地址失败')
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function GetLocation (address) {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
try {
|
|
41
|
-
resolve(getGDMap(address))
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
export { GetGDMap, GetLocation }
|
|
1
|
+
import AMapLoader from '@amap/amap-jsapi-loader'
|
|
2
|
+
let Amap
|
|
3
|
+
async function GetGDMap (secretKey, key) {
|
|
4
|
+
if (!Amap) {
|
|
5
|
+
window._AMapSecurityConfig = {
|
|
6
|
+
securityJsCode: secretKey
|
|
7
|
+
}
|
|
8
|
+
// 解决高德地图加载报错 ---> 禁止多种API加载方式混用
|
|
9
|
+
AMapLoader.reset()
|
|
10
|
+
Amap = await AMapLoader.load({
|
|
11
|
+
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
12
|
+
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
13
|
+
plugins: ['AMap.IndexCluster', 'AMP.MarkerCluster', 'AMap.InfoWindow', 'AMap.HeatMap', 'AMap.HawkEye', 'AMap.DistrictSearch',
|
|
14
|
+
'AMap.ToolBar', 'AMap.Geolocation', 'AMap.MouseTool',
|
|
15
|
+
'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.AutoComplete', 'AMap.Scale'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
16
|
+
AMapUI: {
|
|
17
|
+
version: '1.1', // AMapUI 缺省 1.1
|
|
18
|
+
plugins: ['misc/PositionPicker'] // 需要加载的 AMapUI ui插件
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
return Amap
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function getGDMap (address) {
|
|
26
|
+
new (await GetGDMap()).Geocoder({
|
|
27
|
+
radius: 500 // 范围,默认:500
|
|
28
|
+
}).getLocation(address, function (status, result) {
|
|
29
|
+
if (status === 'complete' && result.geocodes.length) {
|
|
30
|
+
return ({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
|
|
31
|
+
} else {
|
|
32
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
33
|
+
throw new Error('根据经纬度查询地址失败')
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function GetLocation (address) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
try {
|
|
41
|
+
resolve(getGDMap(address))
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
export { GetGDMap, GetLocation }
|
package/vue.config.js
CHANGED
|
@@ -47,6 +47,21 @@ module.exports = {
|
|
|
47
47
|
target: v3Server,
|
|
48
48
|
changeOrigin: true
|
|
49
49
|
},
|
|
50
|
+
'/resource': {
|
|
51
|
+
// pathRewrite: { '^/resource': '/' },
|
|
52
|
+
target: revenue,
|
|
53
|
+
changeOrigin: true
|
|
54
|
+
},
|
|
55
|
+
'/api/af-linepatrol/': {
|
|
56
|
+
pathRewrite: { '^/api/af-linepatrol/': '/' },
|
|
57
|
+
target: 'http://127.0.0.1:9012',
|
|
58
|
+
changeOrigin: true
|
|
59
|
+
},
|
|
60
|
+
'/api/linepatrol/': {
|
|
61
|
+
pathRewrite: { '^/api/linepatrol/': '/' },
|
|
62
|
+
target: 'http://127.0.0.1:9012',
|
|
63
|
+
changeOrigin: true
|
|
64
|
+
},
|
|
50
65
|
// '/api/af-system/resource': {
|
|
51
66
|
// pathRewrite: { '^/api/af-system': '/' },
|
|
52
67
|
// target: testUpload,
|
|
@@ -57,11 +72,11 @@ module.exports = {
|
|
|
57
72
|
target: revenue,
|
|
58
73
|
changeOrigin: true
|
|
59
74
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
'/api/af-apply': {
|
|
76
|
+
// pathRewrite: { '^/api/af-apply': '/' },
|
|
77
|
+
target: revenue,
|
|
78
|
+
changeOrigin: true
|
|
79
|
+
},
|
|
65
80
|
'/api/af-scada': {
|
|
66
81
|
target: revenue,
|
|
67
82
|
changeOrigin: true
|
|
@@ -103,11 +118,6 @@ module.exports = {
|
|
|
103
118
|
target: revenue,
|
|
104
119
|
changeOrigin: true
|
|
105
120
|
},
|
|
106
|
-
'/resource': {
|
|
107
|
-
// pathRewrite: { '^/resource': '/' },
|
|
108
|
-
target: revenue,
|
|
109
|
-
changeOrigin: true
|
|
110
|
-
},
|
|
111
121
|
'/ai': {
|
|
112
122
|
target: 'http://192.168.50.67:31761',
|
|
113
123
|
pathRewrite: { '^/ai': '/' },
|