resolver-egretimp-plus 0.0.134 → 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 -14
- package/src/index.jsx +0 -1
- package/src/renderer.jsx +0 -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,
|
|
@@ -192,6 +192,9 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
export function openDailg({
|
|
195
|
+
beforeOpenDialog,
|
|
196
|
+
afterOpenDialog,
|
|
197
|
+
middleOpenDialog,
|
|
195
198
|
components,
|
|
196
199
|
rootValue,
|
|
197
200
|
polyfillConfigs,
|
|
@@ -268,9 +271,25 @@ export function openDailg({
|
|
|
268
271
|
return retItem
|
|
269
272
|
})
|
|
270
273
|
}
|
|
271
|
-
//
|
|
272
|
-
const
|
|
273
|
-
|
|
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
|
+
}
|
|
274
293
|
let middleOpenDialogRet = outResult
|
|
275
294
|
if (middleOpenDialog) {
|
|
276
295
|
middleOpenDialogRet = middleOpenDialog({
|
|
@@ -281,7 +300,7 @@ export function openDailg({
|
|
|
281
300
|
pagePopupMap,
|
|
282
301
|
inputParams: reqData,
|
|
283
302
|
outputParams: outResult
|
|
284
|
-
})
|
|
303
|
+
}) || middleOpenDialogRet
|
|
285
304
|
}
|
|
286
305
|
if (isPromise(middleOpenDialogRet)) {
|
|
287
306
|
middleOpenDialogRet.then(res => {
|
|
@@ -313,11 +332,26 @@ export function openDailg({
|
|
|
313
332
|
}
|
|
314
333
|
const dialogProps = parseExtendAttr({extendAttr: pagePopupMap.extendAttr})
|
|
315
334
|
|
|
316
|
-
//
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
+
}
|
|
321
355
|
let beforeOpenDialogRet = true
|
|
322
356
|
if (beforeOpenDialog) {
|
|
323
357
|
beforeOpenDialogRet = beforeOpenDialog({
|
|
@@ -347,8 +381,15 @@ export function openDailg({
|
|
|
347
381
|
}
|
|
348
382
|
|
|
349
383
|
function toAfterOpenDialog(outputParams) {
|
|
350
|
-
//
|
|
351
|
-
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
|
+
}
|
|
352
393
|
afterOpenDialog && afterOpenDialog({
|
|
353
394
|
dynamicMapComp,
|
|
354
395
|
rootValue,
|
|
@@ -497,6 +538,9 @@ function closePage(lcpPageClosedMapVO) {
|
|
|
497
538
|
export async function executeEventOrchestration({
|
|
498
539
|
beforeRequestService,
|
|
499
540
|
afterRequestService,
|
|
541
|
+
beforeOpenDialog,
|
|
542
|
+
afterOpenDialog,
|
|
543
|
+
middleOpenDialog,
|
|
500
544
|
components,
|
|
501
545
|
props,
|
|
502
546
|
requestTraceId,
|
|
@@ -524,16 +568,20 @@ export async function executeEventOrchestration({
|
|
|
524
568
|
const configBeforeRequestService = props.config?.beforeRequestService
|
|
525
569
|
if (configBeforeRequestService || beforeRequestService) {
|
|
526
570
|
normalBeforeRequestService = async (...arg) => {
|
|
527
|
-
let
|
|
571
|
+
let beforeRequestServiceRet = true
|
|
528
572
|
if (beforeRequestService) {
|
|
529
|
-
|
|
573
|
+
beforeRequestServiceRet = beforeRequestService?.(...arg)
|
|
530
574
|
}
|
|
531
575
|
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
532
576
|
if (!beforeRequestServiceRetValid) {
|
|
533
577
|
return
|
|
534
578
|
}
|
|
579
|
+
if (configBeforeRequestService) {
|
|
580
|
+
return configBeforeRequestService?.(...arg)
|
|
581
|
+
} else {
|
|
582
|
+
return true
|
|
583
|
+
}
|
|
535
584
|
}
|
|
536
|
-
return configBeforeRequestService?.(...arg)
|
|
537
585
|
}
|
|
538
586
|
// 定义的请求后钩子
|
|
539
587
|
const configAfterRequestService = props.config?.afterRequestService
|
|
@@ -587,6 +635,9 @@ export async function executeEventOrchestration({
|
|
|
587
635
|
|
|
588
636
|
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
589
637
|
openDailg({
|
|
638
|
+
beforeOpenDialog,
|
|
639
|
+
afterOpenDialog,
|
|
640
|
+
middleOpenDialog,
|
|
590
641
|
components,
|
|
591
642
|
rootValue,
|
|
592
643
|
polyfillConfigs,
|
package/src/index.jsx
CHANGED