resolver-egretimp-plus 0.1.20 → 0.1.21
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/rules/ruleUtils.js +1 -1
- package/src/utils/defaultVal.js +5 -4
package/package.json
CHANGED
package/src/rules/ruleUtils.js
CHANGED
|
@@ -47,7 +47,7 @@ export function setFormVal(pathStr, val) {
|
|
|
47
47
|
configs.forEach(cg => {
|
|
48
48
|
if (hasOwn(cg, 'refValue')) {
|
|
49
49
|
if (cg.metaType === 'ElSelect') {
|
|
50
|
-
val = formatSelectVal({config, val: val})
|
|
50
|
+
val = formatSelectVal({config: cg, val: val, isActive: true})
|
|
51
51
|
}
|
|
52
52
|
cg.refValue = val
|
|
53
53
|
} else {
|
package/src/utils/defaultVal.js
CHANGED
|
@@ -43,10 +43,11 @@ export default function defaultVal(config) {
|
|
|
43
43
|
|
|
44
44
|
export function formatSelectVal({
|
|
45
45
|
config,
|
|
46
|
-
val
|
|
46
|
+
val,
|
|
47
|
+
isActive = false
|
|
47
48
|
}) {
|
|
48
49
|
let retValue = val
|
|
49
|
-
if (!isHidden({config})) {
|
|
50
|
+
if (!isHidden({config}) || isActive) {
|
|
50
51
|
const valueType = config?.valueType
|
|
51
52
|
const separator = config?.separator
|
|
52
53
|
if (valueType == VALUE_TYPES.STRING) {
|
|
@@ -61,10 +62,10 @@ export function formatSelectVal({
|
|
|
61
62
|
if ((val && isString(val)) || isNumber(val)) {
|
|
62
63
|
retValue = `${val}`?.split(separator)
|
|
63
64
|
if (valueType == VALUE_TYPES.OBJECT) {
|
|
64
|
-
retValue =
|
|
65
|
+
retValue = retValue?.reduce((ret, item, idx) => {ret[idx] = item; return ret;}, {})
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
return
|
|
70
|
+
return retValue
|
|
70
71
|
}
|