resolver-egretimp-plus 0.0.133 → 0.0.135
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/analysisComponent.jsx +14 -6
- package/src/components/helper/eventOrchestration.js +65 -15
- package/src/index.jsx +0 -1
- package/src/renderer.jsx +0 -1
- package/src/utils/common.js +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, defineAsyncComponent, getCurrentInstance, inject, onBeforeMount, provide, ref } from 'vue'
|
|
2
|
-
import { commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, hasOwn } from './utils/index.js'
|
|
2
|
+
import { commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, hasOwn, isPlainObject } from './utils/index.js'
|
|
3
3
|
import { useVmodels } from './hooks/index.js'
|
|
4
4
|
import { getRenderComponentProps, generateFormItemPolyfill } from './utils/index.js'
|
|
5
5
|
import rulesDriver from './rules/rulesDriver'
|
|
@@ -200,7 +200,7 @@ export default {
|
|
|
200
200
|
const _isH5 = inject('_isH5')
|
|
201
201
|
const lang = inject('lang')
|
|
202
202
|
const rootValue = inject('rootValue')
|
|
203
|
-
const onClick = (e,
|
|
203
|
+
const onClick = (e, params) => {
|
|
204
204
|
const context = {
|
|
205
205
|
props,
|
|
206
206
|
dynamicMapComp,
|
|
@@ -215,13 +215,21 @@ export default {
|
|
|
215
215
|
}
|
|
216
216
|
attrs?.onClick?.call(context, e) // 如果配置中有点击事件
|
|
217
217
|
if (findComponent(EXECTE_CLICK_EVENT_COMPONENTS, props.config?.renderby || props.config?.metaType) !== -1 ) {
|
|
218
|
-
executeClickEvents(
|
|
218
|
+
executeClickEvents(params)
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
function executeClickEvents(
|
|
221
|
+
function executeClickEvents(params = {}) {
|
|
222
|
+
// beforeRequestService,
|
|
223
|
+
// afterRequestService,
|
|
224
|
+
// beforeOpenDialog,
|
|
225
|
+
// afterOpenDialog,
|
|
226
|
+
// middleOpenDialog,
|
|
227
|
+
// 目前parmas支持以上五种钩子
|
|
228
|
+
if (!isPlainObject(params)) {
|
|
229
|
+
params = {}
|
|
230
|
+
}
|
|
222
231
|
executeEventOrchestration({
|
|
223
|
-
|
|
224
|
-
afterRequestService,
|
|
232
|
+
...params,
|
|
225
233
|
components,
|
|
226
234
|
props,
|
|
227
235
|
requestTraceId: requestTraceId?.value,
|
|
@@ -144,7 +144,6 @@ function getReqData(inParamMappingList = [], {dynamicMapComp, dynamicMapCompKeys
|
|
|
144
144
|
|
|
145
145
|
function initOutParamData(outParamMappingList = [], { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult = {} }) {
|
|
146
146
|
outParamMappingList.forEach(params => {
|
|
147
|
-
debugger
|
|
148
147
|
const { orignParam = '', destParam = '', isList = false, primaryKeys = [] } = params
|
|
149
148
|
const configCodes = getRelateConfigKeys(dynamicMapCompKeys, destParam, dynamicHireRelat)
|
|
150
149
|
if (configCodes.length > 1) {
|
|
@@ -193,6 +192,9 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
|
|
|
193
192
|
}
|
|
194
193
|
|
|
195
194
|
export function openDailg({
|
|
195
|
+
beforeOpenDialog,
|
|
196
|
+
afterOpenDialog,
|
|
197
|
+
middleOpenDialog,
|
|
196
198
|
components,
|
|
197
199
|
rootValue,
|
|
198
200
|
polyfillConfigs,
|
|
@@ -269,9 +271,25 @@ export function openDailg({
|
|
|
269
271
|
return retItem
|
|
270
272
|
})
|
|
271
273
|
}
|
|
272
|
-
//
|
|
273
|
-
const
|
|
274
|
-
|
|
274
|
+
// 定义打开弹框-中间钩子
|
|
275
|
+
const configMiddleOpenDialog = compConfig?.middleOpenDialog
|
|
276
|
+
const parmasMiddleOpenDialog = middleOpenDialog
|
|
277
|
+
if (configMiddleOpenDialog || parmasMiddleOpenDialog) {
|
|
278
|
+
middleOpenDialog = async (params) => {
|
|
279
|
+
let ret = null
|
|
280
|
+
if (parmasMiddleOpenDialog) {
|
|
281
|
+
ret = parmasMiddleOpenDialog?.(params)
|
|
282
|
+
}
|
|
283
|
+
if (ret) {
|
|
284
|
+
const outputParams = await ret
|
|
285
|
+
return configMiddleOpenDialog?.({
|
|
286
|
+
...params,
|
|
287
|
+
outputParams
|
|
288
|
+
})
|
|
289
|
+
}
|
|
290
|
+
return configMiddleOpenDialog?.(params)
|
|
291
|
+
}
|
|
292
|
+
}
|
|
275
293
|
let middleOpenDialogRet = outResult
|
|
276
294
|
if (middleOpenDialog) {
|
|
277
295
|
middleOpenDialogRet = middleOpenDialog({
|
|
@@ -282,7 +300,7 @@ export function openDailg({
|
|
|
282
300
|
pagePopupMap,
|
|
283
301
|
inputParams: reqData,
|
|
284
302
|
outputParams: outResult
|
|
285
|
-
})
|
|
303
|
+
}) || middleOpenDialogRet
|
|
286
304
|
}
|
|
287
305
|
if (isPromise(middleOpenDialogRet)) {
|
|
288
306
|
middleOpenDialogRet.then(res => {
|
|
@@ -314,11 +332,26 @@ export function openDailg({
|
|
|
314
332
|
}
|
|
315
333
|
const dialogProps = parseExtendAttr({extendAttr: pagePopupMap.extendAttr})
|
|
316
334
|
|
|
317
|
-
//
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
335
|
+
// 定义的弹框打开前钩子
|
|
336
|
+
const configBeforeOpenDialog = compConfig?.beforeOpenDialog
|
|
337
|
+
const paramsBeforeOpenDialog = beforeOpenDialog
|
|
338
|
+
if (configBeforeOpenDialog || paramsBeforeOpenDialog) {
|
|
339
|
+
beforeOpenDialog = async (...arg) => {
|
|
340
|
+
let beforeOpenDialogRet = true
|
|
341
|
+
if (paramsBeforeOpenDialog) {
|
|
342
|
+
beforeOpenDialogRet = paramsBeforeOpenDialog?.(...arg)
|
|
343
|
+
}
|
|
344
|
+
const beforeOpenDialogRetValid = await beforeOpenDialogRet
|
|
345
|
+
if (!beforeOpenDialogRetValid) {
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
if (configBeforeOpenDialog) {
|
|
349
|
+
return configBeforeOpenDialog?.(...arg)
|
|
350
|
+
} else {
|
|
351
|
+
return true
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
322
355
|
let beforeOpenDialogRet = true
|
|
323
356
|
if (beforeOpenDialog) {
|
|
324
357
|
beforeOpenDialogRet = beforeOpenDialog({
|
|
@@ -348,8 +381,15 @@ export function openDailg({
|
|
|
348
381
|
}
|
|
349
382
|
|
|
350
383
|
function toAfterOpenDialog(outputParams) {
|
|
351
|
-
//
|
|
352
|
-
const
|
|
384
|
+
// 打开弹框-确认后的钩子
|
|
385
|
+
const configAfterOpenDialog = compConfig?.afterOpenDialog
|
|
386
|
+
const paramsAfterOpenDialog = afterOpenDialog
|
|
387
|
+
if (configAfterOpenDialog || paramsAfterOpenDialog) {
|
|
388
|
+
afterOpenDialog = async (...arg) => {
|
|
389
|
+
paramsBeforeOpenDialog?.(...arg)
|
|
390
|
+
configAfterOpenDialog?.(...arg)
|
|
391
|
+
}
|
|
392
|
+
}
|
|
353
393
|
afterOpenDialog && afterOpenDialog({
|
|
354
394
|
dynamicMapComp,
|
|
355
395
|
rootValue,
|
|
@@ -498,6 +538,9 @@ function closePage(lcpPageClosedMapVO) {
|
|
|
498
538
|
export async function executeEventOrchestration({
|
|
499
539
|
beforeRequestService,
|
|
500
540
|
afterRequestService,
|
|
541
|
+
beforeOpenDialog,
|
|
542
|
+
afterOpenDialog,
|
|
543
|
+
middleOpenDialog,
|
|
501
544
|
components,
|
|
502
545
|
props,
|
|
503
546
|
requestTraceId,
|
|
@@ -525,16 +568,20 @@ export async function executeEventOrchestration({
|
|
|
525
568
|
const configBeforeRequestService = props.config?.beforeRequestService
|
|
526
569
|
if (configBeforeRequestService || beforeRequestService) {
|
|
527
570
|
normalBeforeRequestService = async (...arg) => {
|
|
528
|
-
let
|
|
571
|
+
let beforeRequestServiceRet = true
|
|
529
572
|
if (beforeRequestService) {
|
|
530
|
-
|
|
573
|
+
beforeRequestServiceRet = beforeRequestService?.(...arg)
|
|
531
574
|
}
|
|
532
575
|
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
533
576
|
if (!beforeRequestServiceRetValid) {
|
|
534
577
|
return
|
|
535
578
|
}
|
|
579
|
+
if (configBeforeRequestService) {
|
|
580
|
+
return configBeforeRequestService?.(...arg)
|
|
581
|
+
} else {
|
|
582
|
+
return true
|
|
583
|
+
}
|
|
536
584
|
}
|
|
537
|
-
return configBeforeRequestService?.(...arg)
|
|
538
585
|
}
|
|
539
586
|
// 定义的请求后钩子
|
|
540
587
|
const configAfterRequestService = props.config?.afterRequestService
|
|
@@ -588,6 +635,9 @@ export async function executeEventOrchestration({
|
|
|
588
635
|
|
|
589
636
|
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
590
637
|
openDailg({
|
|
638
|
+
beforeOpenDialog,
|
|
639
|
+
afterOpenDialog,
|
|
640
|
+
middleOpenDialog,
|
|
591
641
|
components,
|
|
592
642
|
rootValue,
|
|
593
643
|
polyfillConfigs,
|
package/src/index.jsx
CHANGED
package/src/renderer.jsx
CHANGED
package/src/utils/common.js
CHANGED
|
@@ -337,7 +337,7 @@ export function setValueDeep(obj, key = '', val) {
|
|
|
337
337
|
const cod = matchs[1]
|
|
338
338
|
const idx = matchs[2]
|
|
339
339
|
!ret[cod] && (ret[cod] = [])
|
|
340
|
-
ret[cod][idx] = {}
|
|
340
|
+
!ret[cod][idx] && (ret[cod][idx] = {})
|
|
341
341
|
return ret[cod][idx]
|
|
342
342
|
} else {
|
|
343
343
|
!ret[code] && (ret[code] = {})
|