resolver-egretimp-plus 0.0.60 → 0.0.61
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 +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/components/childDialog/src/index.vue +12 -0
- package/src/components/helper/eventOrchestration.js +8 -0
- package/src/components/helper/resolver.js +7 -1
- package/src/components/packages-H5/CmiButton.vue +4 -1
- package/src/components/packages-web/CustomComponentTable.jsx +18 -0
- package/src/components/packages-web/ElButton.vue +3 -1
- package/src/hooks/pageConfig.js +2 -0
- package/src/index.jsx +17 -0
- package/src/utils/render.jsx +10 -6
package/package.json
CHANGED
|
@@ -37,6 +37,16 @@ const props = defineProps({
|
|
|
37
37
|
type: Object,
|
|
38
38
|
default: () => ({})
|
|
39
39
|
},
|
|
40
|
+
parentRootValue: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({})
|
|
43
|
+
},
|
|
44
|
+
selectionsObj: {
|
|
45
|
+
type: Object,
|
|
46
|
+
// selections
|
|
47
|
+
// primaryKeys
|
|
48
|
+
default: () => ({})
|
|
49
|
+
},
|
|
40
50
|
rootStoreChange: Function
|
|
41
51
|
})
|
|
42
52
|
const formData = ref({})
|
|
@@ -82,6 +92,8 @@ defineExpose({
|
|
|
82
92
|
@loadedConfigCompeted="loadedConfigCompeted"
|
|
83
93
|
@rootStoreChange="rootStoreChange"
|
|
84
94
|
v-model="formData"
|
|
95
|
+
:parentRootValue="props.parentRootValue"
|
|
96
|
+
:selectionsObj="props.selectionsObj"
|
|
85
97
|
:busiIdentityId="busiIdentityId"
|
|
86
98
|
:lang="props.lang"
|
|
87
99
|
:buttonActions="props.buttonActions"
|
|
@@ -127,6 +127,7 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
export function openDailg({
|
|
130
|
+
rootValue,
|
|
130
131
|
pagePopupMap,
|
|
131
132
|
axiosInstance,
|
|
132
133
|
dynamicMapComp,
|
|
@@ -148,6 +149,7 @@ export function openDailg({
|
|
|
148
149
|
}
|
|
149
150
|
}) || []
|
|
150
151
|
let mapList = {}
|
|
152
|
+
let selectionsObj = {}
|
|
151
153
|
// 是表格还是list
|
|
152
154
|
const isList = pagePopupMap?.objOrList == '1'
|
|
153
155
|
if (isList ) {
|
|
@@ -171,6 +173,9 @@ export function openDailg({
|
|
|
171
173
|
isList: true
|
|
172
174
|
}
|
|
173
175
|
]
|
|
176
|
+
const orginTableConfig = getTableConfig(outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
177
|
+
selectionsObj.selections = (orginTableConfig.refValue || [])
|
|
178
|
+
selectionsObj.primaryKeys = primaryKeys
|
|
174
179
|
}
|
|
175
180
|
|
|
176
181
|
|
|
@@ -209,6 +214,8 @@ export function openDailg({
|
|
|
209
214
|
}
|
|
210
215
|
dialogClose = openChildDialog({
|
|
211
216
|
buttonActions,
|
|
217
|
+
parentRootValue: rootValue,
|
|
218
|
+
selectionsObj,
|
|
212
219
|
busiIdentityId,
|
|
213
220
|
axiosInstance: axiosInstance,
|
|
214
221
|
lang,
|
|
@@ -328,6 +335,7 @@ export async function executeEventOrchestration({props, axiosInstance, buttonAct
|
|
|
328
335
|
if (lcpPagePopupMapVO) {
|
|
329
336
|
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
330
337
|
openDailg({
|
|
338
|
+
rootValue,
|
|
331
339
|
pagePopupMap: lcpPagePopupMapVO,
|
|
332
340
|
axiosInstance,
|
|
333
341
|
dynamicMapComp,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { resultToast } from "../../utils/respone"
|
|
2
2
|
|
|
3
3
|
export async function executeLoadServices(services = [], { axiosInstance, messageInstance, reqData, respCb }) {
|
|
4
|
+
if (reqData?.notLoad) {
|
|
5
|
+
return
|
|
6
|
+
}
|
|
7
|
+
const noramlReqData = {
|
|
8
|
+
...(reqData || {})
|
|
9
|
+
}
|
|
10
|
+
delete noramlReqData.notLoad
|
|
4
11
|
const loadServices = services.filter(ser => ser.eventType == '1')
|
|
5
12
|
const mixinServiceConfig = services.find(service => service.serviceType === '1')
|
|
6
|
-
|
|
7
13
|
for (let i = 0; i < loadServices.length; i++) {
|
|
8
14
|
const service = loadServices[i]
|
|
9
15
|
const url = service.serviceCode
|
|
@@ -58,6 +58,8 @@ const rootValue = inject('rootValue')
|
|
|
58
58
|
const dataLoad = inject('dataLoad')
|
|
59
59
|
const rootForm = inject('rootForm')
|
|
60
60
|
const validate = inject('_validate', () => {})
|
|
61
|
+
const parentRootValue = inject('_parentRootValue', {})
|
|
62
|
+
|
|
61
63
|
const routeQuery= route?.query
|
|
62
64
|
|
|
63
65
|
const buttonAction = (...arg) => {
|
|
@@ -79,7 +81,8 @@ const buttonAction = (...arg) => {
|
|
|
79
81
|
rootForm,
|
|
80
82
|
routeQuery,
|
|
81
83
|
validate,
|
|
82
|
-
lastClick
|
|
84
|
+
lastClick,
|
|
85
|
+
parentRootValue
|
|
83
86
|
}, appContext)
|
|
84
87
|
}
|
|
85
88
|
if (actionFnRet !== null && actionFnRet !== undefined) {
|
|
@@ -57,6 +57,7 @@ export default {
|
|
|
57
57
|
const pagenationEvents = computed(() => {
|
|
58
58
|
return getCompEvents(ElPagination)
|
|
59
59
|
})
|
|
60
|
+
const selectionsObj = inject('_selectionsObj', {})
|
|
60
61
|
const rootStore = inject('_rootStore', {})
|
|
61
62
|
const lang = inject('lang')
|
|
62
63
|
const rootValue = inject('rootValue')
|
|
@@ -126,6 +127,23 @@ export default {
|
|
|
126
127
|
if (isPlainColumn({...config, isColumn: true}, calcDisable(config, props.mode))) {
|
|
127
128
|
props['show-overflow-tooltip'] = true
|
|
128
129
|
}
|
|
130
|
+
if (config.type === 'selection') {
|
|
131
|
+
const orginSelectable = props.selectable
|
|
132
|
+
props.selectable = (row, index) => {
|
|
133
|
+
let orginRet = true
|
|
134
|
+
if (orginSelectable && typeof orginSelectable === 'function') {
|
|
135
|
+
orginRet = orginSelectable(row, index)
|
|
136
|
+
}
|
|
137
|
+
let parentSelectionsRet = true
|
|
138
|
+
if (selectionsObj.selections && selectionsObj.selections.length && selectionsObj.primaryKeys && selectionsObj.primaryKeys.length) {
|
|
139
|
+
const hasRow = selectionsObj.selections?.some(selectRow => {
|
|
140
|
+
return selectionsObj.primaryKeys.map(key => key && selectRow[key] == row[key]).every(item => item)
|
|
141
|
+
})
|
|
142
|
+
parentSelectionsRet = !hasRow
|
|
143
|
+
}
|
|
144
|
+
return orginRet && parentSelectionsRet
|
|
145
|
+
}
|
|
146
|
+
}
|
|
129
147
|
return props
|
|
130
148
|
}
|
|
131
149
|
|
|
@@ -70,6 +70,7 @@ const rootValue = inject('rootValue')
|
|
|
70
70
|
const dataLoad = inject('dataLoad')
|
|
71
71
|
const rootForm = inject('rootForm')
|
|
72
72
|
const validate = inject('_validate', () => {})
|
|
73
|
+
const parentRootValue = inject('_parentRootValue', {})
|
|
73
74
|
|
|
74
75
|
const routeQuery= route?.query
|
|
75
76
|
|
|
@@ -92,7 +93,8 @@ const buttonAction = async (...arg) => {
|
|
|
92
93
|
rootForm,
|
|
93
94
|
routeQuery,
|
|
94
95
|
validate,
|
|
95
|
-
lastClick
|
|
96
|
+
lastClick,
|
|
97
|
+
parentRootValue
|
|
96
98
|
}, appContext)
|
|
97
99
|
}
|
|
98
100
|
if (actionFnRet !== null && actionFnRet !== undefined) {
|
package/src/hooks/pageConfig.js
CHANGED
|
@@ -17,6 +17,7 @@ export function usePageConfig() {
|
|
|
17
17
|
instance,
|
|
18
18
|
isH5,
|
|
19
19
|
rootValue,
|
|
20
|
+
parentRootValue,
|
|
20
21
|
axiosInstance,
|
|
21
22
|
messageInstance,
|
|
22
23
|
messageCb
|
|
@@ -24,6 +25,7 @@ export function usePageConfig() {
|
|
|
24
25
|
const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig({
|
|
25
26
|
config, lang, polyfillConfigs, instance, isH5,
|
|
26
27
|
rootValue,
|
|
28
|
+
parentRootValue,
|
|
27
29
|
axiosInstance,
|
|
28
30
|
messageInstance,
|
|
29
31
|
messageCb
|
package/src/index.jsx
CHANGED
|
@@ -98,6 +98,18 @@ export default {
|
|
|
98
98
|
type: Object,
|
|
99
99
|
default: () => ({})
|
|
100
100
|
},
|
|
101
|
+
// 如果当前页面是弹框,这个是父页面传入的根数据
|
|
102
|
+
parentRootValue: {
|
|
103
|
+
type: Object,
|
|
104
|
+
default: () => ({})
|
|
105
|
+
},
|
|
106
|
+
// 如果当前页面是弹框,这个是父页面已经选中的数据,控制表格选中的禁用
|
|
107
|
+
selectionsObj: {
|
|
108
|
+
type: Object,
|
|
109
|
+
// selections
|
|
110
|
+
// primaryKeys
|
|
111
|
+
default: () => ({})
|
|
112
|
+
},
|
|
101
113
|
// 提示语的回调
|
|
102
114
|
messageCb: Function,
|
|
103
115
|
},
|
|
@@ -133,6 +145,7 @@ export default {
|
|
|
133
145
|
instance,
|
|
134
146
|
isH5: props.isH5,
|
|
135
147
|
rootValue: props.modelValue,
|
|
148
|
+
parentRootValue: props.parentRootValue,
|
|
136
149
|
axiosInstance: axiosInstance.value,
|
|
137
150
|
messageInstance: props.messageInstance,
|
|
138
151
|
messageCb: props.messageCb
|
|
@@ -160,6 +173,7 @@ export default {
|
|
|
160
173
|
instance,
|
|
161
174
|
isH5: props.isH5,
|
|
162
175
|
rootValue: props.modelValue,
|
|
176
|
+
parentRootValue: props.parentRootValue,
|
|
163
177
|
axiosInstance: axiosInstance.value,
|
|
164
178
|
messageInstance: props.messageInstance,
|
|
165
179
|
messageCb: props.messageCb
|
|
@@ -201,6 +215,9 @@ export default {
|
|
|
201
215
|
provide('dialogComponents', props.dialogComponents) // 是否可以开始执行规则初始化
|
|
202
216
|
provide('_isH5', toRef(props, 'isH5')) // 是否是H5配置
|
|
203
217
|
|
|
218
|
+
provide('_parentRootValue', props.parentRootValue)
|
|
219
|
+
provide('_selectionsObj', props.selectionsObj)
|
|
220
|
+
|
|
204
221
|
const rootForm = ref(null)
|
|
205
222
|
provide('rootForm', rootForm)
|
|
206
223
|
|
package/src/utils/render.jsx
CHANGED
|
@@ -106,6 +106,7 @@ function generateFormConfig(lang = 'zh', isH5) {
|
|
|
106
106
|
export function parsePageConfig({
|
|
107
107
|
config, lang, polyfillConfigs, instance, isH5,
|
|
108
108
|
rootValue,
|
|
109
|
+
parentRootValue,
|
|
109
110
|
axiosInstance,
|
|
110
111
|
messageInstance,
|
|
111
112
|
messageCb
|
|
@@ -122,7 +123,8 @@ export function parsePageConfig({
|
|
|
122
123
|
rootValue,
|
|
123
124
|
axiosInstance,
|
|
124
125
|
messageInstance,
|
|
125
|
-
messageCb
|
|
126
|
+
messageCb,
|
|
127
|
+
parentRootValue
|
|
126
128
|
}, formConfig)
|
|
127
129
|
cbs.forEach((cb) => {
|
|
128
130
|
cb()
|
|
@@ -147,7 +149,8 @@ export function normalConfig({
|
|
|
147
149
|
rootValue,
|
|
148
150
|
axiosInstance,
|
|
149
151
|
messageInstance,
|
|
150
|
-
messageCb
|
|
152
|
+
messageCb,
|
|
153
|
+
parentRootValue
|
|
151
154
|
}, config, hireRelat = '', mapComp = {}, needformItem = false) {
|
|
152
155
|
const metaCode = config.metaCode || ''
|
|
153
156
|
hireRelat += hireRelat ? `->${metaCode}` : metaCode
|
|
@@ -189,7 +192,8 @@ export function normalConfig({
|
|
|
189
192
|
rootValue,
|
|
190
193
|
axiosInstance,
|
|
191
194
|
messageInstance ,
|
|
192
|
-
messageCb
|
|
195
|
+
messageCb,
|
|
196
|
+
parentRootValue
|
|
193
197
|
}, metaItem, hireRelat, mapComp, needformItem || [FORM_META_TYPE, FORM_META_TYPE_H5].includes(metaType))
|
|
194
198
|
return pageConfig
|
|
195
199
|
})?.sort((a, b) => a.seqNo - b.seqNo)
|
|
@@ -213,7 +217,7 @@ export function normalConfig({
|
|
|
213
217
|
pageConfig.needWrap = '1'
|
|
214
218
|
}
|
|
215
219
|
mapComp[hireRelat] = pageConfig
|
|
216
|
-
parsePolyfillConfigs({ polyfillConfigs, instance }, pageConfig)
|
|
220
|
+
parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue }, pageConfig)
|
|
217
221
|
if(pageConfig.lcpPageServiceMapVOList?.length) {
|
|
218
222
|
cbs.push(() => {
|
|
219
223
|
const tabsServices = getTableServices(pageConfig.lcpPageServiceMapVOList, {dynamicMapComp: mapComp, dynamicMapCompKeys: Object.keys(mapComp), hireRelat})
|
|
@@ -260,14 +264,14 @@ function getTableServices(lcpPageServiceMapVOList = [], { dynamicMapComp, dynami
|
|
|
260
264
|
return []
|
|
261
265
|
}
|
|
262
266
|
|
|
263
|
-
function parsePolyfillConfigs({ polyfillConfigs, instance }, config) {
|
|
267
|
+
function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue }, config) {
|
|
264
268
|
const hireRelat = config.hireRelat
|
|
265
269
|
const findKeys = Object.keys(polyfillConfigs).filter(key => hireRelat.endsWith(key))
|
|
266
270
|
if (!findKeys.length) {
|
|
267
271
|
return
|
|
268
272
|
}
|
|
269
273
|
const findKey = findKeys.reduce((ret, key) => (hireRelat.lastIndexOf(ret) < hireRelat.lastIndexOf(key) ? ret : key))
|
|
270
|
-
const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance)
|
|
274
|
+
const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance, {parentRootValue})
|
|
271
275
|
polyObj && Object.keys(polyObj).forEach(key => {
|
|
272
276
|
config[key] = polyObj[key]
|
|
273
277
|
})
|