resolver-egretimp-plus 0.0.230 → 0.0.231

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.0.230",
3
+ "version": "0.0.231",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -79,6 +79,7 @@ export default {
79
79
  definePrivatelyProp(props.config, 'route', route)
80
80
  definePrivatelyProp(props.config, '_validate', validate)
81
81
  definePrivatelyProp(props.config, '_rowScope', props.rowScope)
82
+ definePrivatelyProp(props.config, '_selects', selects)
82
83
  // 当前组件的实例
83
84
  const instance = getCurrentInstance()
84
85
  const appContext = instance?.appContext
@@ -133,7 +134,7 @@ export default {
133
134
  const rules = context.rules
134
135
  delete context.rules
135
136
  setTimeout(() => {
136
- rulesDriver.call(context, rules)
137
+ ruleExecuter?.run(context, rules)
137
138
  }, 0)
138
139
  })
139
140
  ruleExecuter.penddingRules[hireRelat] = null
@@ -78,9 +78,9 @@ export async function dispatchClickEvent(service, {
78
78
  // 定义的请求后钩子
79
79
  const configAfterRequestService = compConfig?.afterRequestService
80
80
  if (configAfterRequestService || afterRequestService) {
81
- normalAfterRequestService = (...arg) => {
82
- afterRequestService?.(...arg)
83
- configAfterRequestService?.(...arg)
81
+ normalAfterRequestService = async (...arg) => {
82
+ await afterRequestService?.(...arg)
83
+ await configAfterRequestService?.(...arg)
84
84
  }
85
85
  }
86
86
 
@@ -142,7 +142,19 @@ export async function dispatchClickEvent(service, {
142
142
  delete reqConfig.data
143
143
  }
144
144
  const ret = await (axiosInstance && axiosInstance(reqConfig))
145
- normalAfterRequestService && normalAfterRequestService(ret)
145
+ if (normalAfterRequestService) {
146
+ await normalAfterRequestService(ret, {
147
+ dynamicMapComp,
148
+ requestTraceId,
149
+ mixinServiceConfig,
150
+ rootValue,
151
+ dynamicHireRelat,
152
+ compConfig,
153
+ service,
154
+ reqData: reqResult
155
+ })
156
+ }
157
+
146
158
  const noSuccessIip = httpMethod.toLocaleLowerCase() === 'get' || service.transactionType == '1' || serviceCustomProps?.noSuccessIip
147
159
  if (!resultToast(ret?.data, messageInstance, {messageCb, service, compConfig, noSuccessIip})) {
148
160
  await Promise.reject()
@@ -1,3 +1,5 @@
1
+ import rulesDriver from "../../rules/rulesDriver"
2
+ import { penddingRules } from "../../rules/ruleUtils"
1
3
  import { hasOwn } from "../../utils"
2
4
  import { resultToast } from "../../utils/respone"
3
5
 
@@ -67,4 +69,40 @@ export function resetConfigEventInit(dynamicMapComp) {
67
69
  dynamicMapComp[key].eventInit = false
68
70
  }
69
71
  })
72
+ }
73
+
74
+ export function assginConfig({
75
+ dynamicMapComp,
76
+ preKey,
77
+ pmPageMetaList,
78
+ ruleExecuter
79
+ }) {
80
+ pmPageMetaList?.forEach(config => {
81
+ const configKey = config.metaCode
82
+ dynamicMapComp[`${preKey}->${configKey}`] = config
83
+
84
+ // 执行没有执行完的规则
85
+ const hireRelat = config?.hireRelat
86
+ if (penddingRules[hireRelat]?.length) {
87
+ penddingRules[hireRelat].forEach(context => {
88
+ const rules = context.rules
89
+ delete context.rules
90
+ setTimeout(() => {
91
+ rulesDriver.call(context, rules)
92
+ }, 0)
93
+ })
94
+ penddingRules[hireRelat] = null
95
+ }
96
+ // 使用json-rules-engine书写的规则,打开这边,需要对之前的规则进行注释,并且需要再index.js文件中进行开启 ====start====
97
+ if (ruleExecuter?.penddingRules?.[hireRelat]?.length) {
98
+ ruleExecuter?.penddingRules[hireRelat].forEach(context => {
99
+ const rules = context.rules
100
+ delete context.rules
101
+ setTimeout(() => {
102
+ rulesDriver.call(context, rules)
103
+ }, 0)
104
+ })
105
+ ruleExecuter.penddingRules[hireRelat] = null
106
+ }
107
+ })
70
108
  }
@@ -19,7 +19,7 @@ const props = defineProps({
19
19
  default: null
20
20
  },
21
21
  isPointer: {
22
- type: [String]
22
+ type: [String, Number]
23
23
  },
24
24
  showMoney: {
25
25
  type: [String, Number],
@@ -25,13 +25,17 @@ const attrs = useAttrs()
25
25
  const classRef = computed(() => {
26
26
  return {
27
27
  'clear-right-margin': !reserveRightMargin.value,
28
- 'clear-bottom-margin': !reserveBottomMargin.value,
28
+ 'clear-bottom-margin': !reserveBottomMargin.value || allHidden.value,
29
29
  }
30
30
  })
31
31
 
32
32
  const pmPageMetaList = computed(() => {
33
33
  return props.config?.pmPageMetaList || []
34
34
  })
35
+
36
+ const allHidden = computed(() => {
37
+ return !!pmPageMetaList.value?.find(config => !((typeof config.hidden === 'boolean' && config.hidden) || config.hidden === '1'))
38
+ })
35
39
  // 保留内部formItem的margin-right
36
40
  const reserveRightMargin = computed(() => {
37
41
  return props.config?.reserveRightMargin
@@ -56,6 +60,9 @@ const reserveBottomMargin = computed(() => {
56
60
  }
57
61
  }
58
62
  .clear-bottom-margin {
63
+ &.clear-bottom-margin.clear-bottom-margin.clear-bottom-margin {
64
+ margin-bottom: 0;
65
+ }
59
66
  .el-col {
60
67
  & > .el-form-item {
61
68
  margin-bottom: 0;
@@ -4,6 +4,7 @@ import Renderer from '../../renderer.jsx'
4
4
  import { computed, inject, watch, h, ref, reactive } from 'vue'
5
5
  import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compareComponet, isPlainObject, hasOwn, cloneDeep, isPromise, isPlainColumn, generateUniqueId, calcDisable, camelize, capitalize, DISPLAY_HIDDEN, definePrivatelyProp } from '../../utils/index.js'
6
6
  import '../styles/CustomComponenTable.scss'
7
+ import { assginConfig } from '../helper/resolver.js'
7
8
 
8
9
  export default {
9
10
  inheritAttrs: false,
@@ -58,6 +59,8 @@ export default {
58
59
  return getCompEvents(ElPagination)
59
60
  })
60
61
 
62
+ const ruleExecuter = inject('_ruleExecuter')
63
+ const dynamicMapComp = inject('dynamicMapComp')
61
64
  const parentRootValue = inject('_parentRootValue', {})
62
65
  const selectionsObj = inject('_selectionsObj', {})
63
66
  const rootStore = inject('_rootStore', {})
@@ -65,6 +68,7 @@ export default {
65
68
  const rootValue = inject('rootValue')
66
69
  const selects = inject('selects')
67
70
  const tableColumnFirstMetaCode = ref("")
71
+ // assginConfig({dynamicMapComp, pmPageMetaList: props.config.pmPageMetaList || [], preKey: props.config?.dynamicHireRelat || '', ruleExecuter })
68
72
  const tableColumnConfigs = computed(() => {
69
73
  let pmPageMetaList = props.config.pmPageMetaList || []
70
74
  return pmPageMetaList.map((config) => {
@@ -66,7 +66,7 @@ const allInitEvents = {
66
66
  }
67
67
  if (val === ARG_FLAGS.REF_VAL) {
68
68
  const { config } = this
69
- val = config?.bindValue
69
+ val = config?.bindValue ?? ''
70
70
  } else {
71
71
  let routeMatchs = null
72
72
  const _absoluteTarget = /^_absoluteTarget:(.+)$/
@@ -193,7 +193,7 @@ const allInitEvents = {
193
193
  const { targetObj: target } = event
194
194
  if (!target) return
195
195
  const targetObj = `${tabpanelCode ? tabpanelCode + '->' : ''}${target}`
196
- const configs = getCurrentComp.call(this, targetObj)
196
+ const configs = getCurrentComp.call(this, targetObj, 'setHidden')
197
197
  // const oldDisplayTypes = []
198
198
  // 隐藏的效果需要晚点触发,才能正常执行清空等一些列需要组件操作
199
199
  setTimeout(() => {
@@ -223,7 +223,7 @@ const allInitEvents = {
223
223
  const { targetObj: target } = event
224
224
  if (!target) return
225
225
  const targetObj = `${tabpanelCode ? tabpanelCode + '->' : ''}${target}`
226
- const configs = getCurrentComp.call(this, targetObj)
226
+ const configs = getCurrentComp.call(this, targetObj, 'setShow')
227
227
  // const oldDisplayTypes = []
228
228
  configs.forEach((labelInfo) => {
229
229
  // const oldDisplayType = labelInfo && labelInfo.displayType
@@ -2,6 +2,7 @@
2
2
  import { hasOwn, isPlainObject } from "../utils"
3
3
  import { MULTI_PAGE_META_LIST_TYPES, findComponent } from '../utils/index'
4
4
 
5
+ const pmPageMetaListTypeList = ['setShow', 'setHidden']
5
6
  // 这边是一些组件在执行规则的时候,如果还没有加载出来,规则会走不动,这边就是存储没走通的规则,等组件加载完之后,再去执行
6
7
  export const penddingRules = {}
7
8
 
@@ -59,7 +60,7 @@ export function setFormVal(pathStr, val) {
59
60
  })
60
61
  }
61
62
 
62
- function getRelateConfigs(codesStr, config) {
63
+ function getRelateConfigs(codesStr, config, type) {
63
64
  const { dynamicHireRelat = '' } = config
64
65
  // 组装成此数据结果,用于后续的获取对应字段=====start====
65
66
  const dynamicCodeInfos = dynamicHireRelat.split('->').map(code => {
@@ -122,11 +123,18 @@ function getRelateConfigs(codesStr, config) {
122
123
  list.push(fincCg)
123
124
  sameIdx = null
124
125
  } else {
125
- cg.multiPmPageMetaList.forEach(childCgList => {
126
- const fincCg = childCgList.find(childCg => childCg.metaCode === code)
126
+ if (pmPageMetaListTypeList.includes(type)) {
127
+ const fincCg = cg?.pmPageMetaList?.find(childCg => childCg.metaCode === code)
127
128
  if (!fincCg) return
128
129
  list.push(fincCg)
129
- })
130
+ } else {
131
+ cg.multiPmPageMetaList.forEach(childCgList => {
132
+ const fincCg = childCgList.find(childCg => childCg.metaCode === code)
133
+ if (!fincCg) return
134
+ list.push(fincCg)
135
+ })
136
+ }
137
+
130
138
  }
131
139
  } else {
132
140
  const fincCg = cg?.pmPageMetaList?.find(childCg => childCg.metaCode === code)
@@ -174,10 +182,10 @@ export function canTransNumber(val) {
174
182
  /**
175
183
  * 根据code path 获取到对应的组件或者label
176
184
  */
177
- export function getCurrentComp(codesStr) {
185
+ export function getCurrentComp(codesStr, type) {
178
186
  if (!codesStr) return null
179
187
  const { config } = this
180
- return getRelateConfigs.call(this, codesStr, config)
188
+ return getRelateConfigs.call(this, codesStr, config, type)
181
189
  }
182
190
 
183
191
  export function parseRules(config) {