resolver-egretimp-plus 0.1.126 → 0.1.127
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 +18 -18
- package/dist/web/index.js +19 -19
- package/package.json +1 -1
- package/src/analysisComponent.jsx +17 -5
- package/src/components/lazyLoadComponent/index.js +2 -0
- package/src/components/lazyLoadComponent/src/LazyLoadComponent.jsx +71 -29
- package/src/components/lazyLoadComponent/src/LazyLoadSkeleton.vue +112 -0
- package/src/components/packages-web/CustomComponentCycle.vue +4 -2
- package/src/components/packages-web/CustomComponentCycleTabPane.vue +1 -1
- package/src/components/packages-web/CustomComponentNativeTabPane.vue +1 -1
- package/src/components/packages-web/CustomComponentSelectEmployees.vue +2 -2
- package/src/components/packages-web/CustomComponentTable.jsx +3 -1
- package/src/components/packages-web/CustomComponentTabs.vue +2 -2
- package/src/hooks/index.js +5 -4
- package/src/hooks/pageConfig.js +2 -0
- package/src/index.jsx +11 -2
- package/src/renderer.jsx +2 -1
- package/src/rules/eventsSupplement.js +13 -15
- package/src/rules/ruleUtils.js +1 -1
- package/src/rules/rulesDriver.js +16 -3
- package/src/rulesOfDate/eventsSupplement.js +107 -31
- package/src/rulesOfDate/ruleUtils.js +1 -1
- package/src/rulesOfDate/rulesDriver.js +8 -4
- package/src/utils/render.jsx +60 -10
- package/src/utils/validateByData.js +4 -2
package/src/rules/rulesDriver.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import { parseCondition } from './parseCondition'
|
|
3
3
|
import { runEvent } from './eventsSupplement'
|
|
4
|
-
import { OPEN_DATA_RULES } from '../config'
|
|
5
4
|
|
|
6
|
-
const recoverCb = {}
|
|
5
|
+
export const recoverCb = {}
|
|
7
6
|
const recoverCbTimer = {}
|
|
8
7
|
|
|
9
|
-
export default function(rules, isInit) {
|
|
8
|
+
export default function(rules, isInit, OPEN_DATA_RULES) {
|
|
10
9
|
if (OPEN_DATA_RULES) {
|
|
11
10
|
return
|
|
12
11
|
}
|
|
@@ -118,5 +117,19 @@ export function runClickRules(rules, isInit) {
|
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
|
|
120
|
+
export function normalRecoverCb(config, index) {
|
|
121
|
+
const currentHire = config.dynamicHireRelat?.replace(new RegExp(`\\[\\d*\\]->${config.metaCode}$`), `[${index}]->${config.metaCode}`)
|
|
122
|
+
if (currentHire == config.dynamicHireRelat) {
|
|
123
|
+
return
|
|
124
|
+
}
|
|
125
|
+
Object.keys(recoverCb).forEach(key => {
|
|
126
|
+
const currentKey = key.replace(config.dynamicHireRelat, currentHire)
|
|
127
|
+
if (currentKey !== key) {
|
|
128
|
+
recoverCb[currentKey] = recoverCb[key]
|
|
129
|
+
delete recoverCb[key]
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
121
134
|
export { generateConfigsHireRelat } from './ruleUtils'
|
|
122
135
|
export { getCodeMapRules } from './parseCondition.js'
|
|
@@ -83,6 +83,7 @@ function replaceDefValue(str, {currentPath, rootValue, lang, route}) {
|
|
|
83
83
|
return val
|
|
84
84
|
})
|
|
85
85
|
}
|
|
86
|
+
export const actionPeddingMaps = {}
|
|
86
87
|
const allInitEvents = {
|
|
87
88
|
setDefaultValue({event, rootValue, mapComp, route, lang, currentPath, isInit}) {
|
|
88
89
|
let { targetObj: target, targetObjVal } = event
|
|
@@ -145,7 +146,9 @@ const allInitEvents = {
|
|
|
145
146
|
const { targetObj: target } = event
|
|
146
147
|
if (!target) return
|
|
147
148
|
const targetObj = `${target}`
|
|
148
|
-
|
|
149
|
+
if (targetObj === 'PreInitiationTab1->tabPane3->tabPlane4->projectTab->purchaseSolution->purchaseContent->forBidPackage->bidPackage->purchaseMethodRow->supplierId') {
|
|
150
|
+
debugger
|
|
151
|
+
}
|
|
149
152
|
setFormVal(targetObj, '', mapComp, rootValue, currentPath)
|
|
150
153
|
|
|
151
154
|
},
|
|
@@ -153,10 +156,16 @@ const allInitEvents = {
|
|
|
153
156
|
const { targetObj: target } = event
|
|
154
157
|
if (!target) return
|
|
155
158
|
const targetObj = `${target}`
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
let configs = []
|
|
160
|
+
|
|
161
|
+
function toAction() {
|
|
162
|
+
configs = getCurrentComp({codesStr: targetObj, dynamicMapComp, currentPath})
|
|
163
|
+
configs.forEach(labelInfo => {
|
|
164
|
+
labelInfo && (labelInfo.editFlag = '0')
|
|
165
|
+
})
|
|
166
|
+
}
|
|
167
|
+
toAction()
|
|
168
|
+
|
|
160
169
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
161
170
|
return () => {
|
|
162
171
|
configs.forEach(labelInfo => {
|
|
@@ -204,6 +213,8 @@ const allInitEvents = {
|
|
|
204
213
|
if (multiPmPageMetaList?.every(columns => columns[idx]?.requiredFlag == '0')) {
|
|
205
214
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
206
215
|
}
|
|
216
|
+
} else {
|
|
217
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
207
218
|
}
|
|
208
219
|
})
|
|
209
220
|
}
|
|
@@ -225,39 +236,66 @@ const allInitEvents = {
|
|
|
225
236
|
return () => {
|
|
226
237
|
configs.forEach((labelInfo, idx) => {
|
|
227
238
|
labelInfo && (labelInfo.requiredFlag = labelInfo._originRequiredFlag)
|
|
228
|
-
if (labelInfo.isColumn
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
239
|
+
if (labelInfo.isColumn) {
|
|
240
|
+
if (labelInfo._originRequiredFlag == '0') {
|
|
241
|
+
// 表格列的必填设置,需要判断所有列是否都不是必填的
|
|
242
|
+
const pmPageMetaList = labelInfo?.parent?.pmPageMetaList || []
|
|
243
|
+
const multiPmPageMetaList = labelInfo?.parent?.multiPmPageMetaList || []
|
|
244
|
+
const idx = pmPageMetaList?.findIndex(cg => cg.metaCode === labelInfo.metaCode)
|
|
245
|
+
if (multiPmPageMetaList?.every(columns => columns[idx]?.requiredFlag == '0')) {
|
|
246
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = labelInfo._originRequiredFlag)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
if (labelInfo._originRequiredFlag == '0') {
|
|
234
251
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = labelInfo._originRequiredFlag)
|
|
235
252
|
}
|
|
236
253
|
}
|
|
237
254
|
})
|
|
238
255
|
}
|
|
239
256
|
},
|
|
240
|
-
setHidden({event, rootValue, mapComp, dynamicMapComp, currentPath, isInit}) {
|
|
257
|
+
setHidden({event, rootValue, mapComp, dynamicMapComp, currentPath, isInit, relIdKey}) {
|
|
241
258
|
const { targetObj: target } = event
|
|
242
259
|
if (!target) return
|
|
243
260
|
const targetObj = `${target}`
|
|
244
|
-
|
|
261
|
+
let configs = []
|
|
262
|
+
function toAction() {
|
|
263
|
+
configs = getCurrentComp({codesStr: targetObj, dynamicMapComp, currentPath})
|
|
264
|
+
configs.forEach(labelInfo => {
|
|
265
|
+
labelInfo && (labelInfo.hidden = '1')
|
|
266
|
+
// if (labelInfo.isColumn) {
|
|
267
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '1')
|
|
268
|
+
// }
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
toAction()
|
|
272
|
+
|
|
273
|
+
// 为了支持循环组件中还没加载出来的组件进行了动作的设置 ====start====
|
|
274
|
+
// !actionPeddingMaps[targetObj] && (actionPeddingMaps[targetObj] = [])
|
|
275
|
+
// const penddingId = `${relIdKey}_setHidden`
|
|
276
|
+
// const existIdx = actionPeddingMaps[targetObj].findIndex(item => item.id === penddingId)
|
|
277
|
+
// if (existIdx > -1) {
|
|
278
|
+
// actionPeddingMaps[targetObj].splice(existIdx, 1)
|
|
279
|
+
// }
|
|
280
|
+
// actionPeddingMaps[targetObj].push({
|
|
281
|
+
// id: penddingId,
|
|
282
|
+
// currentPath,
|
|
283
|
+
// action: toAction
|
|
284
|
+
// })
|
|
285
|
+
// 为了支持循环组件中还没加载出来的组件进行了动作的设置 ====end====
|
|
245
286
|
|
|
246
|
-
configs.forEach(labelInfo => {
|
|
247
|
-
labelInfo && (labelInfo.hidden = '1')
|
|
248
|
-
if (labelInfo.isColumn) {
|
|
249
|
-
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '1')
|
|
250
|
-
}
|
|
251
|
-
})
|
|
252
|
-
|
|
253
287
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
254
288
|
return () => {
|
|
255
289
|
configs.forEach((labelInfo, idx) => {
|
|
256
290
|
labelInfo && (labelInfo.hidden = '0')
|
|
257
|
-
if (labelInfo.isColumn) {
|
|
291
|
+
// if (labelInfo.isColumn) {
|
|
258
292
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '0')
|
|
259
|
-
}
|
|
293
|
+
// }
|
|
260
294
|
})
|
|
295
|
+
// const actionIdx = actionPeddingMaps[targetObj].findIndex(item => item.id === penddingId)
|
|
296
|
+
// if (actionIdx > -1) {
|
|
297
|
+
// actionPeddingMaps[targetObj].splice(actionIdx, 1)
|
|
298
|
+
// }
|
|
261
299
|
}
|
|
262
300
|
},
|
|
263
301
|
setShow({event, rootValue, mapComp, dynamicMapComp, currentPath, isInit}) {
|
|
@@ -267,17 +305,17 @@ const allInitEvents = {
|
|
|
267
305
|
const configs = getCurrentComp({codesStr: targetObj, dynamicMapComp, currentPath})
|
|
268
306
|
configs.forEach((labelInfo) => {
|
|
269
307
|
labelInfo && (labelInfo.hidden = '0')
|
|
270
|
-
if (labelInfo.isColumn) {
|
|
308
|
+
// if (labelInfo.isColumn) {
|
|
271
309
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '0')
|
|
272
|
-
}
|
|
310
|
+
// }
|
|
273
311
|
})
|
|
274
312
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
275
313
|
return () => {
|
|
276
314
|
configs.forEach((labelInfo, idx) => {
|
|
277
315
|
labelInfo && (labelInfo.hidden = '1')
|
|
278
|
-
if (labelInfo.isColumn) {
|
|
316
|
+
// if (labelInfo.isColumn) {
|
|
279
317
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.hidden = '1')
|
|
280
|
-
}
|
|
318
|
+
// }
|
|
281
319
|
})
|
|
282
320
|
}
|
|
283
321
|
},
|
|
@@ -299,6 +337,8 @@ const allInitEvents = {
|
|
|
299
337
|
if (multiPmPageMetaList?.every(columns => columns[idx]?.requiredFlag == '0')) {
|
|
300
338
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
301
339
|
}
|
|
340
|
+
} else {
|
|
341
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
302
342
|
}
|
|
303
343
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
304
344
|
callFns.push(() => {
|
|
@@ -333,6 +373,8 @@ const allInitEvents = {
|
|
|
333
373
|
if (multiPmPageMetaList?.every(columns => columns[idx]?.requiredFlag == '0')) {
|
|
334
374
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
335
375
|
}
|
|
376
|
+
} else {
|
|
377
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = '0')
|
|
336
378
|
}
|
|
337
379
|
|
|
338
380
|
// 有的事件在不满足条件的情况下,需要进行恢复
|
|
@@ -347,6 +389,8 @@ const allInitEvents = {
|
|
|
347
389
|
if (multiPmPageMetaList?.every(columns => columns[idx]?.requiredFlag == '0')) {
|
|
348
390
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = labelInfo._originRequiredFlag)
|
|
349
391
|
}
|
|
392
|
+
} else {
|
|
393
|
+
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = labelInfo._originRequiredFlag)
|
|
350
394
|
}
|
|
351
395
|
} else {
|
|
352
396
|
labelInfo && labelInfo.refConfig && (labelInfo.refConfig.requiredFlag = labelInfo._originRequiredFlag)
|
|
@@ -518,8 +562,9 @@ const allInitEvents = {
|
|
|
518
562
|
setProps({event, rootValue, mapComp, dynamicMapComp, currentPath, messageInstance, isInit}) {
|
|
519
563
|
const { targetObj: target, targetObjVal } = event
|
|
520
564
|
if (!target) return
|
|
521
|
-
|
|
522
565
|
const targetObj = `${target}`
|
|
566
|
+
const configs = getCurrentComp({codesStr: targetObj, dynamicMapComp, currentPath})
|
|
567
|
+
|
|
523
568
|
let val = ''
|
|
524
569
|
try {
|
|
525
570
|
val = parseExtendAttr(
|
|
@@ -534,8 +579,6 @@ const allInitEvents = {
|
|
|
534
579
|
}
|
|
535
580
|
delete val.metaCode
|
|
536
581
|
if (!isPlainObject(val)) return
|
|
537
|
-
|
|
538
|
-
const configs = getCurrentComp({codesStr: targetObj, dynamicMapComp, currentPath})
|
|
539
582
|
const porpsKeys = Object.keys(val)
|
|
540
583
|
configs.forEach((labelInfo) => {
|
|
541
584
|
let updateFlag = false
|
|
@@ -583,12 +626,45 @@ const allInitEvents = {
|
|
|
583
626
|
|
|
584
627
|
export default allInitEvents
|
|
585
628
|
|
|
586
|
-
export function runEvent({events, rootValue, mapComp, dynamicMapComp, route, lang, currentPath, isInit, rule, messageInstance}) {
|
|
629
|
+
export function runEvent({events, rootValue, mapComp, dynamicMapComp, route, lang, currentPath, isInit, rule, messageInstance, relIdKey}) {
|
|
587
630
|
events = events || []
|
|
588
631
|
return events.map(event => {
|
|
589
632
|
const { eventId } = event
|
|
590
633
|
const eventCode = eventsMap[eventId]
|
|
591
|
-
|
|
634
|
+
let actionRecoverCb = allInitEvents[eventCode] && allInitEvents[eventCode]({event, rootValue, mapComp, dynamicMapComp, route, lang, currentPath, isInit, rule, messageInstance, relIdKey})
|
|
635
|
+
const retObj = {
|
|
636
|
+
recoverCb: null
|
|
637
|
+
}
|
|
638
|
+
if (actionRecoverCb) {
|
|
639
|
+
const { targetObj } = event
|
|
640
|
+
// 为了支持循环组件中还没加载出来的组件进行了动作的设置 ====start====
|
|
641
|
+
!actionPeddingMaps[targetObj] && (actionPeddingMaps[targetObj] = [])
|
|
642
|
+
const penddingId = `${relIdKey}_${eventCode}`
|
|
643
|
+
const existIdx = actionPeddingMaps[targetObj].findIndex(item => item.id === penddingId)
|
|
644
|
+
if (existIdx > -1) {
|
|
645
|
+
actionPeddingMaps[targetObj].splice(existIdx, 1)
|
|
646
|
+
}
|
|
647
|
+
actionPeddingMaps[targetObj].push({
|
|
648
|
+
id: penddingId,
|
|
649
|
+
currentPath,
|
|
650
|
+
action: () => {
|
|
651
|
+
actionRecoverCb = allInitEvents[eventCode] && allInitEvents[eventCode]({event, rootValue, mapComp, dynamicMapComp, route, lang, currentPath, isInit, rule, messageInstance, relIdKey})
|
|
652
|
+
}
|
|
653
|
+
})
|
|
654
|
+
// 为了支持循环组件中还没加载出来的组件进行了动作的设置 ====end====
|
|
655
|
+
|
|
656
|
+
retObj.recoverCb = () => {
|
|
657
|
+
actionRecoverCb?.()
|
|
658
|
+
const actionIdx = actionPeddingMaps[targetObj].findIndex(item => item.id === penddingId)
|
|
659
|
+
if (actionIdx > -1) {
|
|
660
|
+
actionPeddingMaps[targetObj].splice(actionIdx, 1)
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
} else {
|
|
664
|
+
retObj.recoverCb = actionRecoverCb
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
return retObj
|
|
592
668
|
})
|
|
593
669
|
}
|
|
594
670
|
|
|
@@ -87,7 +87,7 @@ export function setFormVal(pathStr, val, mapComp, rootValue, currentPath) {
|
|
|
87
87
|
let assignPath = null
|
|
88
88
|
if (diffIdx !== -1) {
|
|
89
89
|
difComps = comps.slice(diffIdx)
|
|
90
|
-
const prefix =
|
|
90
|
+
const prefix = pathArr.slice(0, diffIdx).join('->')
|
|
91
91
|
assignPath = calcAssignPath(difComps, 0, prefix)
|
|
92
92
|
} else {
|
|
93
93
|
assignPath = pathArr.join('->')
|
|
@@ -21,22 +21,26 @@ export default function({
|
|
|
21
21
|
// this.rules = rules
|
|
22
22
|
|
|
23
23
|
if (rules && rules.length) {
|
|
24
|
+
const executeFns = []
|
|
24
25
|
rules.forEach(rule => {
|
|
25
26
|
if (!rule) return
|
|
26
27
|
const { pmRuleTargetEventVoList, pmRuleTargetEventVOList, relId } = rule
|
|
27
28
|
const relIdKey = `${relId}__${currentPath}`
|
|
28
29
|
if (parseCondition({rule, rootValue: unref(rootValue), currentPath})) {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
executeFns.push(() => {
|
|
31
|
+
const recovers = runEvent({events: pmRuleTargetEventVoList || pmRuleTargetEventVOList, rootValue, route, lang, currentPath, mapComp, dynamicMapComp, isInit, rule, messageInstance, relIdKey})
|
|
32
|
+
recoverCb[relIdKey] = recovers
|
|
33
|
+
})
|
|
31
34
|
} else {
|
|
32
35
|
recoverCb[relIdKey] && recoverCb[relIdKey].forEach(recover => {
|
|
33
|
-
if (recover) {
|
|
34
|
-
recover()
|
|
36
|
+
if (recover?.recoverCb) {
|
|
37
|
+
recover?.recoverCb()
|
|
35
38
|
}
|
|
36
39
|
})
|
|
37
40
|
delete recoverCb[relIdKey]
|
|
38
41
|
}
|
|
39
42
|
})
|
|
43
|
+
executeFns.forEach(cb => cb?.())
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
|
package/src/utils/render.jsx
CHANGED
|
@@ -38,8 +38,9 @@ import { dispatchClickEvent, dispatchClickEvents, executeEventOrchestration, get
|
|
|
38
38
|
import CmiFormItem from '../components/cmiFormItem'
|
|
39
39
|
import loadModule from './loadModule.js'
|
|
40
40
|
import dayjs from 'dayjs'
|
|
41
|
-
import { OPEN_DATA_RULES } from '../config.js'
|
|
42
41
|
import { useVmodels } from '../hooks/reactive.js'
|
|
42
|
+
import LazyLoadComponent, { LazyLoadSkeleton } from '../components/lazyLoadComponent/index.js'
|
|
43
|
+
import { actionPeddingMaps } from '../rulesOfDate/eventsSupplement.js'
|
|
43
44
|
|
|
44
45
|
export const COFNGI_KEY_EVENT_FLAG = /^on[A-Z]/
|
|
45
46
|
|
|
@@ -120,6 +121,7 @@ export function generateFormConfig(lang = 'zh', isH5) {
|
|
|
120
121
|
* @param {*} config 通过接口获取的配置对象
|
|
121
122
|
*/
|
|
122
123
|
export function parsePageConfig({
|
|
124
|
+
OPEN_DATA_RULES,
|
|
123
125
|
components,
|
|
124
126
|
confirmInstance,
|
|
125
127
|
openChildDialogInstance,
|
|
@@ -146,6 +148,7 @@ export function parsePageConfig({
|
|
|
146
148
|
const cbs = []
|
|
147
149
|
window?.performance?.mark('noraml_config_start')
|
|
148
150
|
let { pageConfig, mapComp } = normalConfig({
|
|
151
|
+
OPEN_DATA_RULES,
|
|
149
152
|
components,
|
|
150
153
|
confirmInstance,
|
|
151
154
|
openChildDialogInstance,
|
|
@@ -237,6 +240,7 @@ function canReuse(
|
|
|
237
240
|
* @param {*} config
|
|
238
241
|
*/
|
|
239
242
|
export function normalConfig({
|
|
243
|
+
OPEN_DATA_RULES,
|
|
240
244
|
components,
|
|
241
245
|
confirmInstance,
|
|
242
246
|
openChildDialogInstance,
|
|
@@ -295,6 +299,18 @@ export function normalConfig({
|
|
|
295
299
|
definePrivatelyProp(config, '_rootValue', rootValue)
|
|
296
300
|
definePrivatelyProp(config, 'refValue', useVmodels(config).modelValue)
|
|
297
301
|
definePrivatelyProp(config, 'parent', parentConfig) // 这边手动设置一下,防止组件复用的时候不会刷新,造成parent的丢失
|
|
302
|
+
if (!config.refConfig && parentConfig?.refConfig) {
|
|
303
|
+
definePrivatelyProp(config, 'refConfig', parentConfig.refConfig?.pmPageMetaList?.find(item => item.metaCode === config.metaCode))
|
|
304
|
+
}
|
|
305
|
+
if (actionPeddingMaps[hireRelat]) {
|
|
306
|
+
actionPeddingMaps[hireRelat].forEach(peddingAction => {
|
|
307
|
+
peddingAction?.action()
|
|
308
|
+
})
|
|
309
|
+
}
|
|
310
|
+
// 如何子组件中有自定义组件,不开启懒加载
|
|
311
|
+
if (config.renderby) {
|
|
312
|
+
travelParentConfigLazy(config)
|
|
313
|
+
}
|
|
298
314
|
}
|
|
299
315
|
|
|
300
316
|
if (!notParseConfig) {
|
|
@@ -512,6 +528,7 @@ export function normalConfig({
|
|
|
512
528
|
function simpleNormalPmPageMetaList({pmPageMetaList, dynamicHireRelat, unWatchsList, noParsePageMetaList, changeConfig, notParseConfig}) {
|
|
513
529
|
return pmPageMetaList.map(metaItem => {
|
|
514
530
|
const { pageConfig } = normalConfig({
|
|
531
|
+
OPEN_DATA_RULES,
|
|
515
532
|
components,
|
|
516
533
|
confirmInstance,
|
|
517
534
|
openChildDialogInstance,
|
|
@@ -548,6 +565,16 @@ export function normalConfig({
|
|
|
548
565
|
}
|
|
549
566
|
}
|
|
550
567
|
|
|
568
|
+
// _notOpenLazyopenLazy 属性
|
|
569
|
+
// 如果是自定义组件,父层级组件都不能进行懒加载
|
|
570
|
+
export function travelParentConfigLazy(config) {
|
|
571
|
+
definePrivatelyProp(config, '_notOpenLazy', true)
|
|
572
|
+
while (config.parent) {
|
|
573
|
+
config = config.parent
|
|
574
|
+
definePrivatelyProp(config, '_notOpenLazy', true)
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
551
578
|
// 目前做数据进行驱动规则、循环组件的config渲染,需要兼容一些现有业务逻辑
|
|
552
579
|
function compatibilityConfig({
|
|
553
580
|
config,
|
|
@@ -702,7 +729,7 @@ export function isPlainColumn(config, disabled) {
|
|
|
702
729
|
}
|
|
703
730
|
|
|
704
731
|
// 判断是否可以显示组件(需要开启数据驱动规则事件的时候)
|
|
705
|
-
export function canHiddenConfig(config) {
|
|
732
|
+
export function canHiddenConfig(config, OPEN_DATA_RULES) {
|
|
706
733
|
let retFlag = OPEN_DATA_RULES && config.hidden == '1'
|
|
707
734
|
if (!retFlag) return false
|
|
708
735
|
|
|
@@ -896,10 +923,6 @@ export function generateLayoutPolyfill(config, disabled, isH5) {
|
|
|
896
923
|
...elColSpecialProsp(config),
|
|
897
924
|
}
|
|
898
925
|
return node => {
|
|
899
|
-
// 表格中中的列,是否需要转换为普通形式
|
|
900
|
-
// if (isPlainColumn(config, disabled)) {
|
|
901
|
-
// return node
|
|
902
|
-
// }
|
|
903
926
|
|
|
904
927
|
if (config.removeCol) {
|
|
905
928
|
return node
|
|
@@ -972,6 +995,34 @@ function parseIntColProps(obj) {
|
|
|
972
995
|
return obj
|
|
973
996
|
}
|
|
974
997
|
|
|
998
|
+
// 生成懒加载vnode
|
|
999
|
+
function generateLazyNode(node, config) {
|
|
1000
|
+
if (config._notOpenLazy) {
|
|
1001
|
+
return node
|
|
1002
|
+
}
|
|
1003
|
+
let height = 32
|
|
1004
|
+
if (config.isColumn) {
|
|
1005
|
+
height = 23
|
|
1006
|
+
}
|
|
1007
|
+
if (findComponent([FORM_META_TYPE, FORM_META_TYPE_H5], config.renderby || config.metaType) !== -1) {
|
|
1008
|
+
height = '100vh'
|
|
1009
|
+
} else if (findComponent(['CustomComponentCollapse', 'CustomComponentCard'], config.renderby || config.metaType) !== -1) {
|
|
1010
|
+
height = 200
|
|
1011
|
+
} else if (findComponent(['CustomComponentTabs'], config.renderby || config.metaType) !== -1) {
|
|
1012
|
+
height = 400
|
|
1013
|
+
} else if (findComponent(['CustomComponentTable'], config.renderby || config.metaType) !== -1) {
|
|
1014
|
+
height = 300
|
|
1015
|
+
}
|
|
1016
|
+
return (
|
|
1017
|
+
<LazyLoadComponent config={config}>
|
|
1018
|
+
{{
|
|
1019
|
+
default: () => node,
|
|
1020
|
+
skeleton: () => <LazyLoadSkeleton key={Math.random()} height={height}></LazyLoadSkeleton>
|
|
1021
|
+
}}
|
|
1022
|
+
</LazyLoadComponent>
|
|
1023
|
+
)
|
|
1024
|
+
}
|
|
1025
|
+
|
|
975
1026
|
function generateFormItemPc (config, lang, compProps, params,) {
|
|
976
1027
|
let isFormItem = false
|
|
977
1028
|
let props = {}
|
|
@@ -1003,6 +1054,9 @@ function generateFormItemPc (config, lang, compProps, params,) {
|
|
|
1003
1054
|
}
|
|
1004
1055
|
}
|
|
1005
1056
|
return node => {
|
|
1057
|
+
if (params.OPEN_DATA_RULES) {
|
|
1058
|
+
node = generateLazyNode(node, config)
|
|
1059
|
+
}
|
|
1006
1060
|
if (config.polyfillNode && typeof config.polyfillNode === 'function') {
|
|
1007
1061
|
node = (
|
|
1008
1062
|
<div style="width: 100%; line-height: 16px;">
|
|
@@ -1011,10 +1065,6 @@ function generateFormItemPc (config, lang, compProps, params,) {
|
|
|
1011
1065
|
</div>
|
|
1012
1066
|
)
|
|
1013
1067
|
}
|
|
1014
|
-
// 表格中中的列,是否需要转换为普通形式
|
|
1015
|
-
// if (isPlainColumn(config, compProps.disabled)) {
|
|
1016
|
-
// return node
|
|
1017
|
-
// }
|
|
1018
1068
|
|
|
1019
1069
|
let showFormItem = null
|
|
1020
1070
|
if (hasOwn(config, 'showFormItem')) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { toRaw } from "vue"
|
|
1
|
+
import { nextTick, toRaw } from "vue"
|
|
2
2
|
import { calcDisable } from "./const"
|
|
3
|
-
import { getFormItemRule, isCycleConfig } from "./render"
|
|
3
|
+
import { getFormItemRule, isCycleConfig, travelParentConfigLazy } from "./render"
|
|
4
4
|
import AsyncValidator from 'async-validator'
|
|
5
5
|
|
|
6
6
|
export async function toValidate({
|
|
@@ -145,6 +145,8 @@ function validateConfig({
|
|
|
145
145
|
try {
|
|
146
146
|
await validator.validate({[config.dynamicHireRelat]: toRaw(config?.refValue)})
|
|
147
147
|
} catch (error) {
|
|
148
|
+
travelParentConfigLazy(config)
|
|
149
|
+
await nextTick()
|
|
148
150
|
validFailAction({[config.dynamicHireRelat]: true}, dynamicMapComp)
|
|
149
151
|
return Promise.reject()
|
|
150
152
|
}
|