resolver-egretimp-plus 0.1.120 → 0.1.121
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/dist/h5/index.js +13 -13
- package/dist/web/index.js +11 -11
- package/package.json +1 -1
- package/src/components/options/OptionsDefault.vue +0 -1
- package/src/components/packages-web/CustomComponentCycle.vue +38 -33
- package/src/components/packages-web/CustomComponentCycleTabPane.vue +40 -33
- package/src/components/packages-web/CustomComponentPlain.vue +6 -5
- package/src/components/packages-web/CustomComponentTable.jsx +42 -40
- package/src/components/packages-web/ElInput copy.jsx +0 -1
- package/src/components/packages-web/ElInput.jsx +0 -1
- package/src/config.js +1 -1
- package/src/hooks/pageConfig.js +2 -0
- package/src/index.jsx +2 -0
- package/src/renderer.jsx +4 -1
- package/src/utils/render.jsx +79 -26
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="custom-component-cycle">
|
|
3
|
-
<template v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" :key="pageMetaListKeys[pageMetaList.id]">
|
|
3
|
+
<!-- <template v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" :key="pageMetaListKeys[pageMetaList.id]"> -->
|
|
4
|
+
<template v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" :key="OPEN_DATA_RULES ? pageMetaList.map(item => item.id).join(',') : pageMetaListKeys[pageMetaList.id]">
|
|
4
5
|
<component :is="component" v-bind="componentProps">
|
|
5
6
|
<ElRow>
|
|
6
7
|
<Renderer :modelValue="modelValue?.[$index]" :rowScope="{row: modelValue?.[$index], $index}" @update:modelValues="onUpdateModelValue($event, $index)" :config="pageMetaList"></Renderer>
|
|
@@ -14,6 +15,7 @@ import { computed, defineModel, watch, reactive } from 'vue'
|
|
|
14
15
|
import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/index.js'
|
|
15
16
|
import { ElRow, ElCard } from 'element-plus'
|
|
16
17
|
import Renderer from '../../renderer.jsx'
|
|
18
|
+
import { OPEN_DATA_RULES } from '../../config.js'
|
|
17
19
|
|
|
18
20
|
// const lang = inject('lang')
|
|
19
21
|
const modelValue = defineModel()
|
|
@@ -42,39 +44,42 @@ const multiPmPageMetaList = computed(() => {
|
|
|
42
44
|
const pmPageMetaList = computed(() => {
|
|
43
45
|
return (props.config.pmPageMetaList || [])
|
|
44
46
|
})
|
|
45
|
-
const rowConfgsMap = new Map()
|
|
46
|
-
const pageMetaListKeys = reactive({})
|
|
47
|
-
watch(() => {
|
|
48
|
-
return modelValue.value?.length
|
|
49
|
-
}, (length) => {
|
|
50
|
-
let list = []
|
|
51
|
-
if (length) {
|
|
52
|
-
const newVal = modelValue.value
|
|
53
|
-
list = newVal.map((row, idx) => {
|
|
54
|
-
const rowCgs = rowConfgsMap.get(row)
|
|
55
|
-
if (rowCgs) {
|
|
56
|
-
rowCgs.forEach(config => {
|
|
57
|
-
config.rowIndex = idx
|
|
58
|
-
})
|
|
59
|
-
return rowCgs
|
|
60
|
-
} else {
|
|
61
|
-
const retConfigs = pmPageMetaList.value.map(config => {
|
|
62
|
-
const ret = cloneDeep(config)
|
|
63
|
-
ret.rowIndex = idx
|
|
64
|
-
return ret
|
|
65
|
-
})
|
|
66
|
-
retConfigs.id = new Date().getTime()
|
|
67
|
-
pageMetaListKeys[retConfigs.id] = new Date().getTime()
|
|
68
47
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
48
|
+
const pageMetaListKeys = reactive({})
|
|
49
|
+
if (!OPEN_DATA_RULES) {
|
|
50
|
+
const rowConfgsMap = new Map()
|
|
51
|
+
watch(() => {
|
|
52
|
+
return modelValue.value?.length
|
|
53
|
+
}, (length) => {
|
|
54
|
+
let list = []
|
|
55
|
+
if (length) {
|
|
56
|
+
const newVal = modelValue.value
|
|
57
|
+
list = newVal.map((row, idx) => {
|
|
58
|
+
const rowCgs = rowConfgsMap.get(row)
|
|
59
|
+
if (rowCgs) {
|
|
60
|
+
rowCgs.forEach(config => {
|
|
61
|
+
config.rowIndex = idx
|
|
62
|
+
})
|
|
63
|
+
return rowCgs
|
|
64
|
+
} else {
|
|
65
|
+
const retConfigs = pmPageMetaList.value.map(config => {
|
|
66
|
+
const ret = cloneDeep(config)
|
|
67
|
+
ret.rowIndex = idx
|
|
68
|
+
return ret
|
|
69
|
+
})
|
|
70
|
+
retConfigs.id = new Date().getTime()
|
|
71
|
+
pageMetaListKeys[retConfigs.id] = new Date().getTime()
|
|
72
|
+
|
|
73
|
+
rowConfgsMap.set(row, retConfigs)
|
|
74
|
+
return retConfigs
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
definePrivatelyProp(props.config, 'multiPmPageMetaList', list)
|
|
79
|
+
}, {
|
|
80
|
+
immediate: true
|
|
81
|
+
})
|
|
82
|
+
}
|
|
78
83
|
|
|
79
84
|
const component = computed(() => {
|
|
80
85
|
return props.config.needWrap === false ? 'div' : ElCard
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<TabPane v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" v-bind="{...tabPaneProps}"
|
|
2
|
+
<TabPane v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" v-bind="{...tabPaneProps}"
|
|
3
|
+
:key="OPEN_DATA_RULES ? pageMetaList.map(item => item.id).join(',') : pageMetaListKeys[pageMetaList.id]"
|
|
4
|
+
:label="`${lang.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn}-${$index}`"
|
|
5
|
+
:name="`${props.config?.metaCode}-${$index}`"
|
|
6
|
+
>
|
|
3
7
|
<template #label v-if="labelRenderContentFn || pageMetaList.filter(config => config.collapseSlot).length">
|
|
4
8
|
<component
|
|
5
9
|
v-if="labelRenderContentFn"
|
|
@@ -35,6 +39,7 @@ import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/ind
|
|
|
35
39
|
import { TabPane } from '../tabs'
|
|
36
40
|
import { h } from 'vue'
|
|
37
41
|
import { useAttrs } from 'vue'
|
|
42
|
+
import { OPEN_DATA_RULES } from '../../config.js'
|
|
38
43
|
|
|
39
44
|
defineOptions({
|
|
40
45
|
inheritAttrs: false
|
|
@@ -87,39 +92,41 @@ const multiPmPageMetaList = computed(() => {
|
|
|
87
92
|
const pmPageMetaList = computed(() => {
|
|
88
93
|
return (props.config.pmPageMetaList || [])
|
|
89
94
|
})
|
|
90
|
-
const rowConfgsMap = new Map()
|
|
91
95
|
const pageMetaListKeys = reactive({})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
rowCgs.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|
|
96
|
+
if (!OPEN_DATA_RULES) {
|
|
97
|
+
const rowConfgsMap = new Map()
|
|
98
|
+
watch(() => {
|
|
99
|
+
return modelValue.value?.length
|
|
100
|
+
}, (length) => {
|
|
101
|
+
let list = []
|
|
102
|
+
if (length) {
|
|
103
|
+
const newVal = modelValue.value
|
|
104
|
+
list = newVal.map((row, idx) => {
|
|
105
|
+
const rowCgs = rowConfgsMap.get(row)
|
|
106
|
+
if (rowCgs) {
|
|
107
|
+
rowCgs.forEach(config => {
|
|
108
|
+
config.rowIndex = idx
|
|
109
|
+
})
|
|
110
|
+
return rowCgs
|
|
111
|
+
} else {
|
|
112
|
+
const retConfigs = pmPageMetaList.value.map(config => {
|
|
113
|
+
const ret = cloneDeep(config)
|
|
114
|
+
ret.rowIndex = idx
|
|
115
|
+
return ret
|
|
116
|
+
})
|
|
117
|
+
retConfigs.id = new Date().getTime()
|
|
118
|
+
pageMetaListKeys[retConfigs.id] = new Date().getTime()
|
|
119
|
+
|
|
120
|
+
rowConfgsMap.set(row, retConfigs)
|
|
121
|
+
return retConfigs
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
definePrivatelyProp(props.config, 'multiPmPageMetaList', list)
|
|
126
|
+
}, {
|
|
127
|
+
immediate: true
|
|
128
|
+
})
|
|
129
|
+
}
|
|
123
130
|
|
|
124
131
|
// 自定义渲染label方法
|
|
125
132
|
const labelRenderContentFn = computed(() => {
|
|
@@ -77,7 +77,6 @@ const props = defineProps({
|
|
|
77
77
|
},
|
|
78
78
|
// 是否显示货币符号
|
|
79
79
|
showSymbol: {
|
|
80
|
-
type: String,
|
|
81
80
|
default: ''
|
|
82
81
|
},
|
|
83
82
|
// 货币符号
|
|
@@ -138,10 +137,12 @@ function inputNumebrFormat(val, props) {
|
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
const classObj = computed(() => (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
const classObj = computed(() => ([
|
|
141
|
+
props.type ? `custom-component-plain--${props.type}` : '',
|
|
142
|
+
{
|
|
143
|
+
cursor: props.isPointer == '1'
|
|
144
|
+
}
|
|
145
|
+
]))
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
const appContext = getCurrentInstance()?.appContext
|
|
@@ -5,7 +5,7 @@ import Renderer from '../../renderer.jsx'
|
|
|
5
5
|
import { computed, inject, watch, h, ref, reactive, onMounted, unref } from 'vue'
|
|
6
6
|
import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compareComponet, isPlainObject, hasOwn, cloneDeep, isPromise, isPlainColumn, generateUniqueId, calcDisable, camelize, capitalize, DISPLAY_HIDDEN, definePrivatelyProp, isArray, eleIsOverflow } from '../../utils/index.js'
|
|
7
7
|
import { getCustomerTableProps, tableValidate } from '../helper/table'
|
|
8
|
-
import { OPEN_TABLE_DEFAULT_PAGINATION } from '../../config'
|
|
8
|
+
import { OPEN_TABLE_DEFAULT_PAGINATION, OPEN_DATA_RULES } from '../../config'
|
|
9
9
|
// import '../styles/CustomComponenTable.scss'
|
|
10
10
|
|
|
11
11
|
export default {
|
|
@@ -288,7 +288,7 @@ export default {
|
|
|
288
288
|
retObj.className = `${retObj.className || ''} clear-index`
|
|
289
289
|
}
|
|
290
290
|
if (!isVirtualized.value) {
|
|
291
|
-
retObj.className = `${retObj.className} cell-col-ellipsis`
|
|
291
|
+
retObj.className = `${retObj.className || ''} cell-col-ellipsis`
|
|
292
292
|
if (!retObj.prop) {
|
|
293
293
|
retObj.prop = config.metaCode
|
|
294
294
|
}
|
|
@@ -394,44 +394,46 @@ export default {
|
|
|
394
394
|
* multiPmPageMetaList值主要作用是区分列的每一行都需要有单独的config,接口配置返回的只是列的配置,
|
|
395
395
|
* 所以这边需要单独再坐下处理
|
|
396
396
|
*/
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
columnsCgs
|
|
408
|
-
config
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
ret.
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
397
|
+
if (!OPEN_DATA_RULES) {
|
|
398
|
+
const rowColumnConfgsMap = new Map()
|
|
399
|
+
watch(() => {
|
|
400
|
+
return tableData?.value?.length
|
|
401
|
+
}, (length) => {
|
|
402
|
+
let list = []
|
|
403
|
+
if (length) {
|
|
404
|
+
const newVal = tableData.value
|
|
405
|
+
list = newVal?.map?.((row, idx) => {
|
|
406
|
+
const columnsCgs = rowColumnConfgsMap.get(row)
|
|
407
|
+
if (columnsCgs) {
|
|
408
|
+
columnsCgs.forEach(config => {
|
|
409
|
+
config.rowIndex = idx
|
|
410
|
+
})
|
|
411
|
+
return columnsCgs
|
|
412
|
+
} else {
|
|
413
|
+
const retColumnConfigs = tableColumnConfigs.value.map((config, relIdx) => {
|
|
414
|
+
const ret = cloneDeep(config)
|
|
415
|
+
if (ret.width && !ret.columnWidth) {
|
|
416
|
+
ret.columnWidth = ret.width
|
|
417
|
+
delete ret.width
|
|
418
|
+
}
|
|
419
|
+
ret.columnId = generateUniqueId()
|
|
420
|
+
ret.rowIndex = idx
|
|
421
|
+
ret.isColumn = true
|
|
422
|
+
ret.refConfig = props?.config?.pmPageMetaList?.[relIdx]
|
|
423
|
+
ret.parent = props?.config // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
|
|
424
|
+
return ret
|
|
425
|
+
})
|
|
426
|
+
rowColumnConfgsMap.set(row, retColumnConfigs)
|
|
427
|
+
return retColumnConfigs
|
|
428
|
+
}
|
|
429
|
+
})
|
|
430
|
+
}
|
|
431
|
+
definePrivatelyProp(props.config, 'multiPmPageMetaList', list)
|
|
432
|
+
}, {
|
|
433
|
+
immediate: true,
|
|
434
|
+
deep: true,
|
|
435
|
+
})
|
|
436
|
+
}
|
|
435
437
|
// 统计行定义 ====start======
|
|
436
438
|
const totalMetaCodes = computed(() => {
|
|
437
439
|
return props.config?.totalMetaCodes || []
|
package/src/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const OPEN_DATA_RULES = false
|
|
2
|
-
export const OPEN_TABLE_DEFAULT_PAGINATION =
|
|
2
|
+
export const OPEN_TABLE_DEFAULT_PAGINATION = true
|
package/src/hooks/pageConfig.js
CHANGED
|
@@ -20,6 +20,7 @@ export function usePageConfig() {
|
|
|
20
20
|
lang,
|
|
21
21
|
polyfillConfigs,
|
|
22
22
|
instance,
|
|
23
|
+
dynamicMapComp,
|
|
23
24
|
isH5,
|
|
24
25
|
rootValue,
|
|
25
26
|
parentRootValue,
|
|
@@ -35,6 +36,7 @@ export function usePageConfig() {
|
|
|
35
36
|
route,
|
|
36
37
|
router,
|
|
37
38
|
config, lang, polyfillConfigs, instance, isH5,
|
|
39
|
+
dynamicMapComp,
|
|
38
40
|
rootValue,
|
|
39
41
|
parentRootValue,
|
|
40
42
|
parentDynamicMapComp,
|
package/src/index.jsx
CHANGED
|
@@ -307,6 +307,7 @@ export default {
|
|
|
307
307
|
lang: props.lang,
|
|
308
308
|
polyfillConfigs: props.polyfillConfigs,
|
|
309
309
|
instance,
|
|
310
|
+
dynamicMapComp,
|
|
310
311
|
isH5: props.isH5,
|
|
311
312
|
rootValue: props.modelValue,
|
|
312
313
|
parentRootValue: props.parentRootValue,
|
|
@@ -328,6 +329,7 @@ export default {
|
|
|
328
329
|
lang: props.lang,
|
|
329
330
|
polyfillConfigs: props.polyfillConfigs,
|
|
330
331
|
instance,
|
|
332
|
+
dynamicMapComp,
|
|
331
333
|
isH5: props.isH5,
|
|
332
334
|
rootValue: props.modelValue,
|
|
333
335
|
parentRootValue: props.parentRootValue,
|
package/src/renderer.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, ref, computed, provide, isReactive } from 'vue'
|
|
2
|
-
import { DISPLAY_SHOW, getComponentForConfig, generateLayoutPolyfill, isPlainObject, hasOwn, calcDisable, DISPLAY_HIDDEN } from './utils/index.js'
|
|
2
|
+
import { DISPLAY_SHOW, getComponentForConfig, canHiddenConfig, generateLayoutPolyfill, isPlainObject, hasOwn, calcDisable, DISPLAY_HIDDEN } from './utils/index.js'
|
|
3
3
|
import AnalysisComponent from './analysisComponent.jsx'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -63,6 +63,9 @@ export default {
|
|
|
63
63
|
if (config?.displayType == DISPLAY_HIDDEN) {
|
|
64
64
|
return null
|
|
65
65
|
}
|
|
66
|
+
if (canHiddenConfig(config)) {
|
|
67
|
+
return null
|
|
68
|
+
}
|
|
66
69
|
const disabled = calcDisable(config, modelRef.value)
|
|
67
70
|
const component = getComponentForConfig({messageInstance: messageInstance?.value, config, disabled, getNativeComps, isH5: _isH5?.value, loadModuleCache})
|
|
68
71
|
if (component) {
|
package/src/utils/render.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCodeMapRules } from '../rules/rulesDriver.js'
|
|
2
2
|
import SimpleFormItemPc from '../components/simpleFormItemPc'
|
|
3
3
|
import { resolveAssetComponents, findComponent, compareComponet, normalPixel, isPlainObject, hasOwn, isFnStr, normalCapitalizeComponent, capitalize, camelize, formatDate, definePrivatelyProp, extend, getPathVal, cloneDeep, generateUniqueId} from './common.js'
|
|
4
|
-
import { resolveComponent, inject, watch, unref } from 'vue'
|
|
4
|
+
import { resolveComponent, inject, watch, unref, markRaw } from 'vue'
|
|
5
5
|
import CustomComponentColH5 from '../components/packages-H5/CustomComponentColH5.vue'
|
|
6
6
|
import {
|
|
7
7
|
commonPropsType,
|
|
@@ -125,6 +125,7 @@ export function parsePageConfig({
|
|
|
125
125
|
route,
|
|
126
126
|
router,
|
|
127
127
|
config, lang, polyfillConfigs, instance, isH5,
|
|
128
|
+
dynamicMapComp,
|
|
128
129
|
rootValue,
|
|
129
130
|
parentRootValue,
|
|
130
131
|
parentDynamicMapComp,
|
|
@@ -146,6 +147,7 @@ export function parsePageConfig({
|
|
|
146
147
|
router,
|
|
147
148
|
polyfillConfigs,
|
|
148
149
|
instance,
|
|
150
|
+
dynamicMapComp,
|
|
149
151
|
cbs,
|
|
150
152
|
rootValue,
|
|
151
153
|
axiosInstance,
|
|
@@ -177,6 +179,7 @@ export function normalConfig({
|
|
|
177
179
|
mode,
|
|
178
180
|
polyfillConfigs,
|
|
179
181
|
instance,
|
|
182
|
+
dynamicMapComp,
|
|
180
183
|
cbs = [],
|
|
181
184
|
rootValue,
|
|
182
185
|
axiosInstance,
|
|
@@ -184,6 +187,7 @@ export function normalConfig({
|
|
|
184
187
|
messageCb,
|
|
185
188
|
parentRootValue,
|
|
186
189
|
parentDynamicMapComp,
|
|
190
|
+
noParsePageMetaList,
|
|
187
191
|
}, config, hireRelat = '', mapComp = {}, needformItem = false, dynamicHireRelat = '', unWatchsList = []) {
|
|
188
192
|
const metaCode = config.metaCode || ''
|
|
189
193
|
hireRelat += hireRelat ? `->${metaCode}` : metaCode
|
|
@@ -207,7 +211,9 @@ export function normalConfig({
|
|
|
207
211
|
|
|
208
212
|
if (OPEN_DATA_RULES) {
|
|
209
213
|
extendNativeObj.dynamicHireRelat = dynamicHireRelat
|
|
210
|
-
|
|
214
|
+
dynamicMapComp[dynamicHireRelat] = config
|
|
215
|
+
// extendNativeObj._rootValue = rootValue
|
|
216
|
+
definePrivatelyProp(config, '_rootValue', rootValue)
|
|
211
217
|
}
|
|
212
218
|
|
|
213
219
|
let extendAttrObj = parseExtendAttr(config)
|
|
@@ -286,6 +292,7 @@ export function normalConfig({
|
|
|
286
292
|
cbs,
|
|
287
293
|
polyfillConfigs,
|
|
288
294
|
instance,
|
|
295
|
+
dynamicMapComp,
|
|
289
296
|
rootValue,
|
|
290
297
|
axiosInstance,
|
|
291
298
|
messageInstance ,
|
|
@@ -298,18 +305,28 @@ export function normalConfig({
|
|
|
298
305
|
}
|
|
299
306
|
} else {
|
|
300
307
|
// 如果有子项,需要进行递归遍历
|
|
301
|
-
if (pageConfig.pmPageMetaList && pageConfig.pmPageMetaList.length) {
|
|
308
|
+
if (pageConfig.pmPageMetaList && pageConfig.pmPageMetaList.length && !noParsePageMetaList) {
|
|
302
309
|
normalPmPageMetaList(pageConfig)
|
|
303
310
|
}
|
|
304
311
|
|
|
305
312
|
function normalPmPageMetaList(config) {
|
|
306
313
|
const isCycleFlag = isCycleConfig(config)
|
|
314
|
+
config.pmPageMetaList = simpleNormalPmPageMetaList(config.pmPageMetaList, dynamicHireRelat, unWatchsList, isCycleFlag)
|
|
315
|
+
|
|
316
|
+
definePrivatelyProp(config, '_rowColumnConfgsMap', markRaw(new Map()))
|
|
317
|
+
config._unPageMetaListWatch?.() // 删除当前的监听
|
|
307
318
|
if (isCycleFlag) {
|
|
308
|
-
|
|
309
|
-
config
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
319
|
+
const currentUnWatchsList = [...unWatchsList]
|
|
320
|
+
definePrivatelyProp(config, 'multiPmPageMetaList', [])
|
|
321
|
+
|
|
322
|
+
// 这边先执行,因为当前的_unWatchs里面只放子级的watch
|
|
323
|
+
const oldUnWatchsList = [...currentUnWatchsList]
|
|
324
|
+
|
|
325
|
+
definePrivatelyProp(config, '_unWatchs', markRaw([]))
|
|
326
|
+
currentUnWatchsList?.push(config._unWatchs)
|
|
327
|
+
|
|
328
|
+
config._unPageMetaListWatch = watch(() => getPathVal(unref(config._rootValue), config.dynamicHireRelat, '->'), (val) => {
|
|
329
|
+
// config._unPageMetaListWatch = watch(() => config._rootValue?.cycle, (val) => {
|
|
313
330
|
const list = getPathVal(unref(config._rootValue), config.dynamicHireRelat, '->')
|
|
314
331
|
if (list && list.length) {
|
|
315
332
|
config.multiPmPageMetaList = list.map((row, idx) => {
|
|
@@ -317,45 +334,55 @@ export function normalConfig({
|
|
|
317
334
|
if (columnsCgs) {
|
|
318
335
|
columnsCgs.forEach(config => {
|
|
319
336
|
config.rowIndex = idx
|
|
337
|
+
config.rowScope.$index =idx
|
|
320
338
|
})
|
|
321
339
|
return columnsCgs
|
|
322
340
|
} else {
|
|
323
341
|
let retColumnConfigs = config.pmPageMetaList.map((itemConfig, relIdx) => {
|
|
324
342
|
const ret = cloneDeep(itemConfig)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
ret.
|
|
328
|
-
|
|
343
|
+
if (findComponent(['CustomComponentTable'], config.renderby) !== -1 || findComponent(['CustomComponentTable'], config.metaType) !== -1) {
|
|
344
|
+
ret.labelHidden = '1'
|
|
345
|
+
if (ret.width && !ret.columnWidth) {
|
|
346
|
+
ret.columnWidth = ret.width
|
|
347
|
+
delete ret.width
|
|
348
|
+
}
|
|
349
|
+
ret.isColumn = true
|
|
329
350
|
}
|
|
351
|
+
ret.rowScope = {$index: idx, row}
|
|
330
352
|
ret.columnId = generateUniqueId()
|
|
331
353
|
ret.rowIndex = idx
|
|
332
|
-
ret
|
|
333
|
-
ret
|
|
334
|
-
ret.parent = config // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
|
|
354
|
+
definePrivatelyProp(ret, 'refConfig', config.pmPageMetaList?.[relIdx])
|
|
355
|
+
definePrivatelyProp(ret, 'parent', config) // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
|
|
335
356
|
return ret
|
|
336
357
|
})
|
|
337
|
-
simpleNormalPmPageMetaList(retColumnConfigs, `${dynamicHireRelat}[${idx}]`,
|
|
358
|
+
simpleNormalPmPageMetaList(retColumnConfigs, `${dynamicHireRelat}[${idx}]`, currentUnWatchsList)
|
|
338
359
|
config._rowColumnConfgsMap.set(row, retColumnConfigs)
|
|
339
360
|
return retColumnConfigs
|
|
340
361
|
}
|
|
341
362
|
})
|
|
363
|
+
|
|
364
|
+
const mapKeys = config._rowColumnConfgsMap.keys()
|
|
365
|
+
Array.from(mapKeys).forEach(row => {
|
|
366
|
+
// 如果已经没有对应的数据循环config了,删除子级的PmPageMetaList监听
|
|
367
|
+
if (!list.some(row2 => row2 === row)) {
|
|
368
|
+
config._rowColumnConfgsMap.get(row)?.forEach(unWatchConfig => {
|
|
369
|
+
unWatchConfig?._unWatchs?.forEach(un => un?.())
|
|
370
|
+
})
|
|
371
|
+
config._rowColumnConfgsMap.delete(row)
|
|
372
|
+
}
|
|
373
|
+
})
|
|
342
374
|
}
|
|
343
375
|
}, {
|
|
344
376
|
immediate: true,
|
|
377
|
+
deep: true,
|
|
345
378
|
})
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
list?.push(
|
|
379
|
+
|
|
380
|
+
oldUnWatchsList?.forEach(list => {
|
|
381
|
+
list?.push(config._unPageMetaListWatch)
|
|
349
382
|
})
|
|
350
|
-
config._unPageMetaListWatch = unWatch
|
|
351
|
-
config._unWatchs = []
|
|
352
|
-
unWatchsList?.push(config._unWatchs)
|
|
353
|
-
|
|
354
|
-
} else {
|
|
355
|
-
config.pmPageMetaList = simpleNormalPmPageMetaList(config.pmPageMetaList, dynamicHireRelat)
|
|
356
383
|
}
|
|
357
384
|
|
|
358
|
-
function simpleNormalPmPageMetaList(pmPageMetaList, dynamicHireRelat, unWatchsList) {
|
|
385
|
+
function simpleNormalPmPageMetaList(pmPageMetaList, dynamicHireRelat, unWatchsList, noParsePageMetaList) {
|
|
359
386
|
return pmPageMetaList.map(metaItem => {
|
|
360
387
|
const { pageConfig } = normalConfig({
|
|
361
388
|
requestTraceId,
|
|
@@ -365,12 +392,14 @@ export function normalConfig({
|
|
|
365
392
|
cbs,
|
|
366
393
|
polyfillConfigs,
|
|
367
394
|
instance,
|
|
395
|
+
dynamicMapComp,
|
|
368
396
|
rootValue,
|
|
369
397
|
axiosInstance,
|
|
370
398
|
messageInstance ,
|
|
371
399
|
messageCb,
|
|
372
400
|
parentRootValue,
|
|
373
401
|
parentDynamicMapComp,
|
|
402
|
+
noParsePageMetaList,
|
|
374
403
|
}, metaItem, hireRelat, mapComp, needformItem || [FORM_META_TYPE, FORM_META_TYPE_H5].includes(metaType), dynamicHireRelat, unWatchsList)
|
|
375
404
|
return pageConfig
|
|
376
405
|
})?.sort((a, b) => a.seqNo - b.seqNo)
|
|
@@ -467,6 +496,30 @@ export function isPlainColumn(config, disabled) {
|
|
|
467
496
|
return false
|
|
468
497
|
}
|
|
469
498
|
|
|
499
|
+
// 判断是否可以显示组件(需要开启数据驱动规则事件的时候)
|
|
500
|
+
export function canHiddenConfig(config) {
|
|
501
|
+
let retFlag = OPEN_DATA_RULES && config.hidden == '1'
|
|
502
|
+
if (!retFlag) return false
|
|
503
|
+
|
|
504
|
+
let travseConfigs = [config]
|
|
505
|
+
let currentConfig = null
|
|
506
|
+
while(travseConfigs.length) {
|
|
507
|
+
currentConfig = travseConfigs.shift()
|
|
508
|
+
// 如果子级别中有onVnodeMounted、onMounted中一个有值,就表示需要进行渲染
|
|
509
|
+
if (config.onVnodeMounted || config.onMounted) {
|
|
510
|
+
return false
|
|
511
|
+
}
|
|
512
|
+
if (isCycleConfig(currentConfig)) {
|
|
513
|
+
(currentConfig.multiPmPageMetaList || []).forEach(pmPageMetaList => {
|
|
514
|
+
[].push.apply(travseConfigs, pmPageMetaList)
|
|
515
|
+
})
|
|
516
|
+
} else if (currentConfig?.pmPageMetaList?.length) {
|
|
517
|
+
[].push.apply(travseConfigs, currentConfig.pmPageMetaList)
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return true
|
|
521
|
+
}
|
|
522
|
+
|
|
470
523
|
export function getComponentForConfig({messageInstance, config, disabled, getNativeComps, loadModuleCache}) {
|
|
471
524
|
if (config.isCustom) {
|
|
472
525
|
return () => loadModule(generateVuePath(config.fileId), loadModuleCache, messageInstance)
|