resolver-egretimp-plus 0.1.57 → 0.1.58

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.57",
3
+ "version": "0.1.58",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -230,7 +230,7 @@ export default {
230
230
 
231
231
  // 如果已经有dynamicHireRelat值的时候,就不需要再进行以下赋值了
232
232
  if (config?.dynamicHireRelat_bak) {
233
- definePrivatelyProp(config, 'dynamicHireRelat', `__@__${props.mode}__${config.dynamicHireRelat_bak}`)
233
+ definePrivatelyProp(config, 'dynamicHireRelat', `${config.dynamicHireRelat_bak}__@__${props.mode}__`)
234
234
  } else {
235
235
  const dynamicHireRelat = parent?.dynamicHireRelat ? `${parent?.dynamicHireRelat}${hasOwn(config, 'rowIndex') ? `[${config.rowIndex}]` : ''}->${(config.metaCode || '')}` : config.metaCode
236
236
  definePrivatelyProp(config, 'dynamicHireRelat', dynamicHireRelat)
@@ -70,7 +70,7 @@ function getRelateConfigs(codesStr, config, type) {
70
70
  let normalDynamicHireRelat = dynamicHireRelat
71
71
  let preFlagStr = ''
72
72
  // 这个规则是因为在日志直接拷贝配置的时候,在analysisComponent组件中会在前面额外加上 这个 标识 所以需要转换一下
73
- const preFlagStrReg = /^(__@__[^(->)]*__)/
73
+ const preFlagStrReg = /(__@__[^(->)]*__)$/
74
74
  const preFlagStrMatchs = dynamicHireRelat?.match(preFlagStrReg)
75
75
  if (preFlagStrMatchs) {
76
76
  preFlagStr = preFlagStrMatchs[1]
@@ -122,10 +122,10 @@ function getRelateConfigs(codesStr, config, type) {
122
122
  const { dynamicMapComp, _mapComp } = this
123
123
  let retConfigs = []
124
124
  if (sameStr) {
125
- retConfigs = [dynamicMapComp[`${preFlagStr}${sameStr}`]]
125
+ retConfigs = [dynamicMapComp[`${sameStr}${preFlagStr}`]]
126
126
  } else {
127
127
  const code = diffCodes.shift()
128
- retConfigs = [dynamicMapComp[`${preFlagStr}${code}`]]
128
+ retConfigs = [dynamicMapComp[`${code}${preFlagStr}`]]
129
129
  }
130
130
  while (diffCodes.length) {
131
131
  const code = diffCodes.shift()
@@ -1,8 +1,20 @@
1
1
  import { hasOwn, isPlainObject } from "../utils"
2
2
 
3
3
  export function getRelateConfigKeys(keys = [], path = '', relatePath = '') {
4
+ // 这边逻辑目前主要是为了兼容日志的时候,也可以正常使用规则========start=====
5
+ let normalRelatePath = relatePath
6
+ let preFlagStr = ''
7
+ // 这个规则是因为在日志直接拷贝配置的时候,在analysisComponent组件中会在前面额外加上 这个 标识 所以需要转换一下
8
+ const preFlagStrReg = /(__@__[^(->)]*__)$/
9
+ const preFlagStrMatchs = relatePath?.match(preFlagStrReg)
10
+ if (preFlagStrMatchs) {
11
+ preFlagStr = preFlagStrMatchs[1]
12
+ normalRelatePath = normalRelatePath?.replace(preFlagStrReg, '')
13
+ }
14
+ // 这边逻辑目前主要是为了兼容日志的时候,也可以正常使用规则========end=====
15
+
16
+ const relatePathArr = normalRelatePath ? normalRelatePath.split('->') : []
4
17
  const pathArr = path ? path.split('->') : []
5
- const relatePathArr = relatePath ? relatePath.split('->') : []
6
18
  let diffIdx = -1 // 此标识表示,是从那个所以开始,code不一样了
7
19
  let currentIdx = 0
8
20
  while(diffIdx === -1 && currentIdx < pathArr.length && currentIdx < relatePathArr.length) {
@@ -20,7 +32,7 @@ export function getRelateConfigKeys(keys = [], path = '', relatePath = '') {
20
32
  const noramlPathCode = pathCode.replace(/([\[\]]{1})/g, (_,b) => {return `\\${b}`})
21
33
  return ret + (ret ? `->${noramlPathCode}(\\[\\d+\\])?` : `${noramlPathCode}(\\[\\d+\\])?`)
22
34
  }, '')
23
- const normalPathReg = new RegExp(`^${normalPath}$`)
35
+ const normalPathReg = new RegExp(`^${normalPath}${preFlagStr}$`)
24
36
  return keys.filter(code => {
25
37
  return normalPathReg.test(code)
26
38
  })