resolver-egretimp-plus 0.1.140 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.1.140",
3
+ "version": "0.1.142",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -169,6 +169,13 @@ onMounted(() => {
169
169
  </script>
170
170
 
171
171
  <style lang="scss">
172
+ .el-form-item.is-error {
173
+ .select-employees {
174
+ xm-select {
175
+ box-shadow: 0 0 0 1px var(--el-color-danger) inset;
176
+ }
177
+ }
178
+ }
172
179
  .select-employees {
173
180
  position: relative;
174
181
  width: 100%;
@@ -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
- return value
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 == targetVal || (!targetVal && isArray(refVal) && !refVal.length)
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, isArray} from '../utils/index'
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
- return value
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 == targetVal || (!targetVal && isArray(refVal) && !refVal.length)
153
+ return normalCompareVal(refVal) == normalCompareVal(targetVal)
148
154
  case 6:
149
155
  return refVal != targetVal
150
156
  case 7:
@@ -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
+ }
@@ -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
  })