resolver-egretimp-plus 0.1.109 → 0.1.110
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
CHANGED
|
@@ -87,16 +87,37 @@ export async function executeLoadServices(services = [], {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export function normalPageConfigs(pageConfig) {
|
|
90
|
+
export function normalPageConfigs(pageConfig, target) {
|
|
91
91
|
const rootOptionComp = pageConfig?.pmPageMetaList?.find(item => item.metaType === 'PC-root-panel' || item.metaType === 'H5-root-panel')
|
|
92
92
|
if (rootOptionComp) {
|
|
93
93
|
pageConfig.pmPageMetaList = rootOptionComp.pmPageMetaList
|
|
94
94
|
delete rootOptionComp.pmPageMetaList
|
|
95
95
|
pageConfig.rootOptionComp = rootOptionComp
|
|
96
96
|
}
|
|
97
|
+
if (target) {
|
|
98
|
+
const targetComp = getTargetComp(pageConfig, target)
|
|
99
|
+
if (targetComp) {
|
|
100
|
+
pageConfig.pmPageMetaList = [targetComp]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
return pageConfig
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
// 获取配置的时候,设置了只需要展示指定的部分
|
|
107
|
+
function getTargetComp(config, target = '') {
|
|
108
|
+
let ret = config
|
|
109
|
+
if (target) {
|
|
110
|
+
metaCodes = target.split('->')
|
|
111
|
+
ret = metaCodes.reduce((ret, metaCode) => {
|
|
112
|
+
if (ret && ret.pmPageMetaList && Array.isArray(ret.pmPageMetaList)) {
|
|
113
|
+
return ret.pmPageMetaList.find(item => item.metaCode === metaCode)
|
|
114
|
+
}
|
|
115
|
+
return ret
|
|
116
|
+
}, config)
|
|
117
|
+
}
|
|
118
|
+
return ret
|
|
119
|
+
}
|
|
120
|
+
|
|
100
121
|
export function resetConfigEventInit(dynamicMapComp) {
|
|
101
122
|
Object.keys(dynamicMapComp).forEach(key => {
|
|
102
123
|
if (hasOwn(dynamicMapComp[key], 'eventInit')) {
|
|
@@ -50,11 +50,11 @@ export async function tableValidate({
|
|
|
50
50
|
}
|
|
51
51
|
const rules = getFormItemRule(columnConfig, lang, params, compProps)
|
|
52
52
|
const validator = new AsyncValidator({
|
|
53
|
-
|
|
54
|
-
validator: (rule, value, callback) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
53
|
+
[props.config.metaCode]: rules
|
|
54
|
+
// validator: (rule, value, callback) => {
|
|
55
|
+
// callback(new Error('test error'))
|
|
56
|
+
// return
|
|
57
|
+
// }
|
|
58
58
|
})
|
|
59
59
|
const a = await validator.validate({[columnConfig.metaCode]: row[columnConfig.metaCode]})
|
|
60
60
|
debugger
|
package/src/resolver-common.vue
CHANGED
|
@@ -8,7 +8,7 @@ const props = defineProps({
|
|
|
8
8
|
busiIdentityId: String,
|
|
9
9
|
selects: {
|
|
10
10
|
type: Object,
|
|
11
|
-
default: () => ({})
|
|
11
|
+
default: () => ({_default: true})
|
|
12
12
|
},
|
|
13
13
|
getNativeComps: {
|
|
14
14
|
type: Function,
|
|
@@ -38,43 +38,51 @@ const props = defineProps({
|
|
|
38
38
|
type: Object,
|
|
39
39
|
default: () => ({})
|
|
40
40
|
},
|
|
41
|
+
// 外部传入的config
|
|
42
|
+
nativeConfig: [Object, Array]
|
|
41
43
|
})
|
|
44
|
+
const selectsLoad = ref(true)
|
|
42
45
|
defineOptions({
|
|
43
46
|
inheritAttrs: false
|
|
44
47
|
})
|
|
45
|
-
const loadSelects = ref({})
|
|
46
48
|
const attrs = useAttrs()
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
...loadSelects.value,
|
|
50
|
-
...(props.selects || {})
|
|
51
|
-
}
|
|
52
|
-
})
|
|
49
|
+
|
|
53
50
|
initInterceptors(props.messageInstance)
|
|
54
51
|
const { getPageConfig, pageConfig, selects } = useBuildInData({messageInstance: props.messageInstance, loadingInstance: props.loadingInstance, requestTraceId: props.requestTraceId})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
...(props.builtPolyfillReq || {}),
|
|
60
|
-
...(props.loadConfigReq || {})
|
|
61
|
-
}, {
|
|
62
|
-
configCb: (pageConfig) => {
|
|
63
|
-
// 配置数据加载完成事件 'loadedConfigCompeted'
|
|
64
|
-
attrs?.onLoadedConfigCompeted?.(pageConfig)
|
|
65
|
-
},
|
|
66
|
-
selectsCb: (selects) => {
|
|
67
|
-
// 配置数据加载完成事件 'loadedConfigCompeted'
|
|
68
|
-
// Object.keys(selects || {}).forEach(key => {
|
|
69
|
-
// props.selects[key] = selects[key]
|
|
70
|
-
// })
|
|
71
|
-
loadSelects.value = selects
|
|
72
|
-
attrs?.onLoadedSelectsCompeted?.(allSelects.value)
|
|
73
|
-
},
|
|
74
|
-
selectPolyReq: {
|
|
75
|
-
...(props.builtPolyfillReq || {}),
|
|
52
|
+
if (!props.nativeConfig) {
|
|
53
|
+
if (props.selects?._default) {
|
|
54
|
+
// 没有传selects对象的时候,在selectsCb中设置props.selects属性,是不会响应式的,所以这边需要进行逻辑控制
|
|
55
|
+
selectsLoad.value = false
|
|
76
56
|
}
|
|
77
|
-
|
|
57
|
+
getPageConfig({
|
|
58
|
+
busiIdentityId: props.busiIdentityId,
|
|
59
|
+
queryPageMeta: '1',
|
|
60
|
+
queryPageService: '1',
|
|
61
|
+
...(props.builtPolyfillReq || {}),
|
|
62
|
+
...(props.loadConfigReq || {})
|
|
63
|
+
}, {
|
|
64
|
+
configCb: (pageConfig) => {
|
|
65
|
+
// 配置数据加载完成事件 'loadedConfigCompeted'
|
|
66
|
+
attrs?.onLoadedConfigCompeted?.(pageConfig)
|
|
67
|
+
},
|
|
68
|
+
selectsCb: (selects) => {
|
|
69
|
+
// 配置数据加载完成事件 'loadedConfigCompeted'
|
|
70
|
+
Object.keys(selects || {}).forEach(key => {
|
|
71
|
+
props.selects[key] = selects[key]
|
|
72
|
+
})
|
|
73
|
+
attrs?.onLoadedSelectsCompeted?.(props.selects)
|
|
74
|
+
if (props.selects?._default) {
|
|
75
|
+
// 没有传selects对象的时候,在selectsCb中设置props.selects属性,是不会响应式的,所以这边需要进行逻辑控制
|
|
76
|
+
selectsLoad.value = true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
selectPolyReq: {
|
|
80
|
+
...(props.builtPolyfillReq || {}),
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
} else {
|
|
84
|
+
pageConfig.value = props.nativeConfig
|
|
85
|
+
}
|
|
78
86
|
|
|
79
87
|
const resolverRef = ref(null)
|
|
80
88
|
defineExpose({
|
|
@@ -106,7 +114,7 @@ defineExpose({
|
|
|
106
114
|
</script>
|
|
107
115
|
<template>
|
|
108
116
|
<Resolver
|
|
109
|
-
v-if="pageConfig"
|
|
117
|
+
v-if="pageConfig && selectsLoad"
|
|
110
118
|
ref="resolverRef"
|
|
111
119
|
v-bind="attrs"
|
|
112
120
|
:loadingInstance="props.loadingInstance"
|
|
@@ -114,7 +122,7 @@ defineExpose({
|
|
|
114
122
|
:getNativeComps="props.getNativeComps"
|
|
115
123
|
:copyModal="props.copyModal"
|
|
116
124
|
:config="pageConfig || null"
|
|
117
|
-
:selects="
|
|
125
|
+
:selects="props.selects"
|
|
118
126
|
:builtPolyfillReq="props.builtPolyfillReq"
|
|
119
127
|
:requestTraceId="props.requestTraceId"
|
|
120
128
|
></Resolver>
|
package/src/utils/render.jsx
CHANGED
|
@@ -199,7 +199,6 @@ export function normalConfig({
|
|
|
199
199
|
parent: null, // 这个是执行过程中,动态获取的
|
|
200
200
|
dynamicHireRelat: '', // 这个也是执行过程中,动态获取的层级
|
|
201
201
|
}
|
|
202
|
-
|
|
203
202
|
let extendAttrObj = parseExtendAttr(config)
|
|
204
203
|
let extendObj = {
|
|
205
204
|
removeCol: findComponent(NOT_NEED_COL_ITEM_META_TYPE, extendAttrObj.renderby) !== -1 || findComponent(NOT_NEED_COL_ITEM_META_TYPE, metaType) !== -1,
|
|
@@ -449,6 +448,7 @@ export function getComponentForConfig({messageInstance, config, disabled, getNat
|
|
|
449
448
|
renderbyComp = <div>not component</div>
|
|
450
449
|
}
|
|
451
450
|
}
|
|
451
|
+
|
|
452
452
|
component = renderbyComp || component
|
|
453
453
|
}
|
|
454
454
|
return component
|