resolver-egretimp-plus 0.1.141 → 0.1.142
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 +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/rules/parseCondition.js +9 -4
- package/src/rulesOfDate/parseCondition.js +9 -3
- package/src/utils/common.js +10 -1
- package/src/utils/render.jsx +3 -3
- package//346/270/262/346/237/223/345/231/250/344/275/277/347/224/250/346/211/213/345/206/214.md +2242 -0
- package//344/275/277/347/224/250/346/211/213/345/206/214.md +0 -1216
- package//347/273/204/344/273/266/351/205/215/347/275/256/345/261/236/346/200/247/345/256/214/346/225/264/345/217/202/350/200/203.md +0 -1094
package/package.json
CHANGED
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
*/
|
|
71
71
|
import { getConfigValue, getCurrentComp, parseRules } from './ruleUtils'
|
|
72
|
-
import {formatDate, isArray} from '../utils/index'
|
|
72
|
+
import {formatDate, isArray, normalCompareVal} from '../utils/index'
|
|
73
73
|
|
|
74
74
|
export const rulesTypes = {
|
|
75
75
|
constrast: '1',
|
|
@@ -99,7 +99,13 @@ const calcConditionValue = {
|
|
|
99
99
|
return getSystemArgVal(value)
|
|
100
100
|
},
|
|
101
101
|
[conditionType.SELF]: ({value}) => {
|
|
102
|
-
|
|
102
|
+
let retVal = ''
|
|
103
|
+
try {
|
|
104
|
+
retVal = JSON.parse(value)
|
|
105
|
+
} catch (e) {
|
|
106
|
+
// console.log('e==:', e)
|
|
107
|
+
}
|
|
108
|
+
return retVal
|
|
103
109
|
},
|
|
104
110
|
[conditionType.COMPONENT_ENMU]: ({value}) => {
|
|
105
111
|
return value
|
|
@@ -210,7 +216,6 @@ export function parseCondition(rule) {
|
|
|
210
216
|
// }
|
|
211
217
|
if (!calcConditionValue[refType]) return false
|
|
212
218
|
let refVal = calcConditionValue[refType].call(this, {tabpanelCode, value: refValue})
|
|
213
|
-
|
|
214
219
|
if (conditionType.COMPONENT == targetType) {
|
|
215
220
|
const labelInfos = getCurrentComp.call(this, `${tabpanelCode ? tabpanelCode + '->' : ''}${targetValue}`)
|
|
216
221
|
if (!labelInfos || labelInfos.length !== 1) {
|
|
@@ -239,7 +244,7 @@ export function parseCondition(rule) {
|
|
|
239
244
|
case 4:
|
|
240
245
|
return formatRefVal <= formatTargetVal
|
|
241
246
|
case 5:
|
|
242
|
-
return refVal ==
|
|
247
|
+
return normalCompareVal(refVal) == normalCompareVal(targetVal)
|
|
243
248
|
case 6:
|
|
244
249
|
return refVal != targetVal
|
|
245
250
|
case 7:
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
*/
|
|
71
71
|
import { getConfigValue, getCurrentComp, parseRules } from './ruleUtils'
|
|
72
|
-
import {formatDate,
|
|
72
|
+
import {formatDate, normalCompareVal} from '../utils/index'
|
|
73
73
|
|
|
74
74
|
export const rulesTypes = {
|
|
75
75
|
constrast: '1',
|
|
@@ -95,7 +95,13 @@ const calcConditionValue = {
|
|
|
95
95
|
return getSystemArgVal(value)
|
|
96
96
|
},
|
|
97
97
|
[conditionType.SELF]: ({value}) => {
|
|
98
|
-
|
|
98
|
+
let retVal = ''
|
|
99
|
+
try {
|
|
100
|
+
retVal = JSON.parse(value)
|
|
101
|
+
} catch (e) {
|
|
102
|
+
// console.log('e==:', e)
|
|
103
|
+
}
|
|
104
|
+
return retVal
|
|
99
105
|
},
|
|
100
106
|
[conditionType.COMPONENT_ENMU]: ({value}) => {
|
|
101
107
|
return value
|
|
@@ -144,7 +150,7 @@ export function parseCondition({
|
|
|
144
150
|
case 4:
|
|
145
151
|
return formatRefVal <= formatTargetVal
|
|
146
152
|
case 5:
|
|
147
|
-
return refVal ==
|
|
153
|
+
return normalCompareVal(refVal) == normalCompareVal(targetVal)
|
|
148
154
|
case 6:
|
|
149
155
|
return refVal != targetVal
|
|
150
156
|
case 7:
|
package/src/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { intersectionWith, isEqual, mergeWith, unionWith, isArray, cloneDeep, debounce } from 'lodash-es'
|
|
2
|
+
import { intersectionWith, isEqual, mergeWith, unionWith, isArray, cloneDeep, debounce, isEmpty } from 'lodash-es'
|
|
3
3
|
import { isDate } from './is'
|
|
4
4
|
import { isRef } from 'vue'
|
|
5
5
|
export {
|
|
@@ -735,3 +735,12 @@ function getPadding(el) {
|
|
|
735
735
|
function isGreaterThan(a, b, epsilon = 0.01) {
|
|
736
736
|
return a - b > epsilon
|
|
737
737
|
}
|
|
738
|
+
|
|
739
|
+
// 规则比较值的时候,兼容数组比较
|
|
740
|
+
export function normalCompareVal(val) {
|
|
741
|
+
if (isArray(val)) {
|
|
742
|
+
return isEmpty(val) ? '' : val.join(',')
|
|
743
|
+
} else {
|
|
744
|
+
return val
|
|
745
|
+
}
|
|
746
|
+
}
|
package/src/utils/render.jsx
CHANGED
|
@@ -372,7 +372,7 @@ export function normalConfig({
|
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
mapComp[hireRelat] = pageConfig
|
|
375
|
-
parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp }, toRaw(pageConfig))
|
|
375
|
+
parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp, rootValue, dynamicMapComp }, toRaw(pageConfig))
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
if (!OPEN_DATA_RULES) {
|
|
@@ -671,7 +671,7 @@ export function isCycleConfig(config) {
|
|
|
671
671
|
return findComponent(CYCLE_COMPONETS, config.renderby) !== -1 || findComponent(CYCLE_COMPONETS, config.metaType) !== -1
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
-
function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp}, config) {
|
|
674
|
+
function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp, rootValue, dynamicMapComp}, config) {
|
|
675
675
|
const hireRelat = config.hireRelat
|
|
676
676
|
const findKeys = Object.keys(polyfillConfigs || {}).filter(key => hireRelat.endsWith(key))
|
|
677
677
|
if (!findKeys.length) {
|
|
@@ -679,7 +679,7 @@ function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, pare
|
|
|
679
679
|
}
|
|
680
680
|
// 层级写的越明确,就使用更明确的层级配置
|
|
681
681
|
const findKey = findKeys.reduce((ret, key) => (hireRelat.lastIndexOf(ret) < hireRelat.lastIndexOf(key) ? ret : key))
|
|
682
|
-
const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance, {parentRootValue, parentDynamicMapComp,})
|
|
682
|
+
const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance, {parentRootValue, parentDynamicMapComp, rootValue, dynamicMapComp})
|
|
683
683
|
polyObj && Object.keys(polyObj).forEach(key => {
|
|
684
684
|
config[key] = polyObj[key]
|
|
685
685
|
})
|