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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -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 {
@@ -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 = val?.reduce((ret, item, idx) => {ret[idx] = item; return ret;}, {})
65
+ retValue = retValue?.reduce((ret, item, idx) => {ret[idx] = item; return ret;}, {})
65
66
  }
66
67
  }
67
68
  }
68
69
  }
69
- return val
70
+ return retValue
70
71
  }