resolver-egretimp-plus 0.0.134 → 0.0.136
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
|
@@ -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'
|
|
@@ -127,7 +127,9 @@ export default {
|
|
|
127
127
|
ruleExecuter.penddingRules[hireRelat] = null
|
|
128
128
|
}
|
|
129
129
|
if (props.config?.immediateClickEvent) {
|
|
130
|
-
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
executeClickEvents()
|
|
132
|
+
}, 0);
|
|
131
133
|
}
|
|
132
134
|
// 使用json-rules-engine书写的规则,打开这边,需要对之前的规则进行注释,并且需要再index.js文件中进行开启 ====end====
|
|
133
135
|
}
|
|
@@ -200,7 +202,7 @@ export default {
|
|
|
200
202
|
const _isH5 = inject('_isH5')
|
|
201
203
|
const lang = inject('lang')
|
|
202
204
|
const rootValue = inject('rootValue')
|
|
203
|
-
const onClick = (e,
|
|
205
|
+
const onClick = (e, params) => {
|
|
204
206
|
const context = {
|
|
205
207
|
props,
|
|
206
208
|
dynamicMapComp,
|
|
@@ -215,13 +217,21 @@ export default {
|
|
|
215
217
|
}
|
|
216
218
|
attrs?.onClick?.call(context, e) // 如果配置中有点击事件
|
|
217
219
|
if (findComponent(EXECTE_CLICK_EVENT_COMPONENTS, props.config?.renderby || props.config?.metaType) !== -1 ) {
|
|
218
|
-
executeClickEvents(
|
|
220
|
+
executeClickEvents(params)
|
|
219
221
|
}
|
|
220
222
|
}
|
|
221
|
-
function executeClickEvents(
|
|
223
|
+
function executeClickEvents(params = {}) {
|
|
224
|
+
// beforeRequestService,
|
|
225
|
+
// afterRequestService,
|
|
226
|
+
// beforeOpenDialog,
|
|
227
|
+
// afterOpenDialog,
|
|
228
|
+
// middleOpenDialog,
|
|
229
|
+
// 目前parmas支持以上五种钩子
|
|
230
|
+
if (!isPlainObject(params)) {
|
|
231
|
+
params = {}
|
|
232
|
+
}
|
|
222
233
|
executeEventOrchestration({
|
|
223
|
-
|
|
224
|
-
afterRequestService,
|
|
234
|
+
...params,
|
|
225
235
|
components,
|
|
226
236
|
props,
|
|
227
237
|
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
package/src/renderer.jsx
CHANGED
|
@@ -199,6 +199,9 @@ export function parseCondition(rule) {
|
|
|
199
199
|
// } else {
|
|
200
200
|
conditionsRet = conditions.map(condition => {
|
|
201
201
|
const { refType, refValue, targetType, targetValue } = condition
|
|
202
|
+
if (refValue?.indexOf('onlyDisplayPricingParameters') > -1) {
|
|
203
|
+
debugger
|
|
204
|
+
}
|
|
202
205
|
// if (refValue === 'studentId') {
|
|
203
206
|
// debugger
|
|
204
207
|
// }
|