resolver-egretimp-plus 0.0.60 → 0.0.62

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.60",
3
+ "version": "0.0.62",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -48,6 +48,7 @@ export default {
48
48
  delete ret.onClick
49
49
  return ret
50
50
  })
51
+ const polyfillConfigs = inject('_polyfillConfigs', {})
51
52
  const buttonActions = inject('buttonActions', {})
52
53
  const route = useRoute()
53
54
  const routeQuery= route?.query
@@ -183,6 +184,7 @@ export default {
183
184
  executeEventOrchestration({
184
185
  props,
185
186
  axiosInstance: _axiosInstance?.value,
187
+ polyfillConfigs,
186
188
  rootValue: rootValue?.value,
187
189
  confirmInstance: confirmInstance?.value,
188
190
  dynamicMapComp,
@@ -37,6 +37,16 @@ const props = defineProps({
37
37
  type: Object,
38
38
  default: () => ({})
39
39
  },
40
+ parentRootValue: {
41
+ type: Object,
42
+ default: () => ({})
43
+ },
44
+ selectionsObj: {
45
+ type: Object,
46
+ // selections
47
+ // primaryKeys
48
+ default: () => ({})
49
+ },
40
50
  rootStoreChange: Function
41
51
  })
42
52
  const formData = ref({})
@@ -82,6 +92,8 @@ defineExpose({
82
92
  @loadedConfigCompeted="loadedConfigCompeted"
83
93
  @rootStoreChange="rootStoreChange"
84
94
  v-model="formData"
95
+ :parentRootValue="props.parentRootValue"
96
+ :selectionsObj="props.selectionsObj"
85
97
  :busiIdentityId="busiIdentityId"
86
98
  :lang="props.lang"
87
99
  :buttonActions="props.buttonActions"
@@ -127,6 +127,8 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
127
127
  }
128
128
 
129
129
  export function openDailg({
130
+ rootValue,
131
+ polyfillConfigs,
130
132
  pagePopupMap,
131
133
  axiosInstance,
132
134
  dynamicMapComp,
@@ -148,6 +150,7 @@ export function openDailg({
148
150
  }
149
151
  }) || []
150
152
  let mapList = {}
153
+ let selectionsObj = {}
151
154
  // 是表格还是list
152
155
  const isList = pagePopupMap?.objOrList == '1'
153
156
  if (isList ) {
@@ -171,14 +174,17 @@ export function openDailg({
171
174
  isList: true
172
175
  }
173
176
  ]
177
+ const orginTableConfig = getTableConfig(outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
178
+ selectionsObj.selections = (orginTableConfig.refValue || [])
179
+ selectionsObj.primaryKeys = primaryKeys
174
180
  }
175
181
 
176
182
 
177
183
  let rootStore = {}
178
184
  let dialogClose = null
179
- const polyfillConfigs = {}
185
+ const initPolyfillConfigs = {}
180
186
  if (pagePopupMap.outDisplayTrigger) {
181
- polyfillConfigs[pagePopupMap.outDisplayTrigger] = (config) => {
187
+ initPolyfillConfigs[pagePopupMap.outDisplayTrigger] = (config) => {
182
188
  return {
183
189
  onClick() {
184
190
  const outResult = rootStore.tableSelectedInfo?.map(item => {
@@ -199,7 +205,7 @@ export function openDailg({
199
205
  }
200
206
  }
201
207
  if (pagePopupMap.closedTrigger) {
202
- polyfillConfigs[pagePopupMap.closedTrigger] = (config) => {
208
+ initPolyfillConfigs[pagePopupMap.closedTrigger] = (config) => {
203
209
  return {
204
210
  onClick() {
205
211
  dialogClose?.()
@@ -209,11 +215,16 @@ export function openDailg({
209
215
  }
210
216
  dialogClose = openChildDialog({
211
217
  buttonActions,
218
+ parentRootValue: rootValue,
219
+ selectionsObj,
212
220
  busiIdentityId,
213
221
  axiosInstance: axiosInstance,
214
222
  lang,
215
223
  loadEvnetsReq: reqData,
216
- polyfillConfigs,
224
+ polyfillConfigs: {
225
+ ...initPolyfillConfigs,
226
+ ...(polyfillConfigs || {})
227
+ },
217
228
  rootStoreChange: (val) => {
218
229
  rootStore = val
219
230
  }
@@ -292,7 +303,7 @@ function closePage(lcpPageClosedMapVO) {
292
303
  }
293
304
  }
294
305
 
295
- export async function executeEventOrchestration({props, axiosInstance, buttonActions, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
306
+ export async function executeEventOrchestration({props, axiosInstance, polyfillConfigs, buttonActions, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
296
307
  const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
297
308
  const PageServiceMapVOList = props.config.lcpPageServiceMapVOList || []
298
309
  const mixinServiceConfig = PageServiceMapVOList.find(service => service.serviceType === '1')
@@ -328,6 +339,8 @@ export async function executeEventOrchestration({props, axiosInstance, buttonAct
328
339
  if (lcpPagePopupMapVO) {
329
340
  const dynamicHireRelat = props.config?.dynamicHireRelat
330
341
  openDailg({
342
+ rootValue,
343
+ polyfillConfigs,
331
344
  pagePopupMap: lcpPagePopupMapVO,
332
345
  axiosInstance,
333
346
  dynamicMapComp,
@@ -1,9 +1,15 @@
1
1
  import { resultToast } from "../../utils/respone"
2
2
 
3
3
  export async function executeLoadServices(services = [], { axiosInstance, messageInstance, reqData, respCb }) {
4
+ if (reqData?.notLoad) {
5
+ return
6
+ }
7
+ const noramlReqData = {
8
+ ...(reqData || {})
9
+ }
10
+ delete noramlReqData.notLoad
4
11
  const loadServices = services.filter(ser => ser.eventType == '1')
5
12
  const mixinServiceConfig = services.find(service => service.serviceType === '1')
6
-
7
13
  for (let i = 0; i < loadServices.length; i++) {
8
14
  const service = loadServices[i]
9
15
  const url = service.serviceCode
@@ -58,6 +58,8 @@ const rootValue = inject('rootValue')
58
58
  const dataLoad = inject('dataLoad')
59
59
  const rootForm = inject('rootForm')
60
60
  const validate = inject('_validate', () => {})
61
+ const parentRootValue = inject('_parentRootValue', {})
62
+
61
63
  const routeQuery= route?.query
62
64
 
63
65
  const buttonAction = (...arg) => {
@@ -79,7 +81,8 @@ const buttonAction = (...arg) => {
79
81
  rootForm,
80
82
  routeQuery,
81
83
  validate,
82
- lastClick
84
+ lastClick,
85
+ parentRootValue
83
86
  }, appContext)
84
87
  }
85
88
  if (actionFnRet !== null && actionFnRet !== undefined) {
@@ -57,6 +57,7 @@ export default {
57
57
  const pagenationEvents = computed(() => {
58
58
  return getCompEvents(ElPagination)
59
59
  })
60
+ const selectionsObj = inject('_selectionsObj', {})
60
61
  const rootStore = inject('_rootStore', {})
61
62
  const lang = inject('lang')
62
63
  const rootValue = inject('rootValue')
@@ -126,6 +127,23 @@ export default {
126
127
  if (isPlainColumn({...config, isColumn: true}, calcDisable(config, props.mode))) {
127
128
  props['show-overflow-tooltip'] = true
128
129
  }
130
+ if (config.type === 'selection') {
131
+ const orginSelectable = props.selectable
132
+ props.selectable = (row, index) => {
133
+ let orginRet = true
134
+ if (orginSelectable && typeof orginSelectable === 'function') {
135
+ orginRet = orginSelectable(row, index)
136
+ }
137
+ let parentSelectionsRet = true
138
+ if (selectionsObj.selections && selectionsObj.selections.length && selectionsObj.primaryKeys && selectionsObj.primaryKeys.length) {
139
+ const hasRow = selectionsObj.selections?.some(selectRow => {
140
+ return selectionsObj.primaryKeys.map(key => key && selectRow[key] == row[key]).every(item => item)
141
+ })
142
+ parentSelectionsRet = !hasRow
143
+ }
144
+ return orginRet && parentSelectionsRet
145
+ }
146
+ }
129
147
  return props
130
148
  }
131
149
 
@@ -70,6 +70,7 @@ const rootValue = inject('rootValue')
70
70
  const dataLoad = inject('dataLoad')
71
71
  const rootForm = inject('rootForm')
72
72
  const validate = inject('_validate', () => {})
73
+ const parentRootValue = inject('_parentRootValue', {})
73
74
 
74
75
  const routeQuery= route?.query
75
76
 
@@ -92,7 +93,8 @@ const buttonAction = async (...arg) => {
92
93
  rootForm,
93
94
  routeQuery,
94
95
  validate,
95
- lastClick
96
+ lastClick,
97
+ parentRootValue
96
98
  }, appContext)
97
99
  }
98
100
  if (actionFnRet !== null && actionFnRet !== undefined) {
@@ -17,6 +17,7 @@ export function usePageConfig() {
17
17
  instance,
18
18
  isH5,
19
19
  rootValue,
20
+ parentRootValue,
20
21
  axiosInstance,
21
22
  messageInstance,
22
23
  messageCb
@@ -24,6 +25,7 @@ export function usePageConfig() {
24
25
  const { pageConfig, mapComp, hireRelatMapRules } = parsePageConfig({
25
26
  config, lang, polyfillConfigs, instance, isH5,
26
27
  rootValue,
28
+ parentRootValue,
27
29
  axiosInstance,
28
30
  messageInstance,
29
31
  messageCb
package/src/index.jsx CHANGED
@@ -98,6 +98,18 @@ export default {
98
98
  type: Object,
99
99
  default: () => ({})
100
100
  },
101
+ // 如果当前页面是弹框,这个是父页面传入的根数据
102
+ parentRootValue: {
103
+ type: Object,
104
+ default: () => ({})
105
+ },
106
+ // 如果当前页面是弹框,这个是父页面已经选中的数据,控制表格选中的禁用
107
+ selectionsObj: {
108
+ type: Object,
109
+ // selections
110
+ // primaryKeys
111
+ default: () => ({})
112
+ },
101
113
  // 提示语的回调
102
114
  messageCb: Function,
103
115
  },
@@ -133,6 +145,7 @@ export default {
133
145
  instance,
134
146
  isH5: props.isH5,
135
147
  rootValue: props.modelValue,
148
+ parentRootValue: props.parentRootValue,
136
149
  axiosInstance: axiosInstance.value,
137
150
  messageInstance: props.messageInstance,
138
151
  messageCb: props.messageCb
@@ -160,6 +173,7 @@ export default {
160
173
  instance,
161
174
  isH5: props.isH5,
162
175
  rootValue: props.modelValue,
176
+ parentRootValue: props.parentRootValue,
163
177
  axiosInstance: axiosInstance.value,
164
178
  messageInstance: props.messageInstance,
165
179
  messageCb: props.messageCb
@@ -201,6 +215,10 @@ export default {
201
215
  provide('dialogComponents', props.dialogComponents) // 是否可以开始执行规则初始化
202
216
  provide('_isH5', toRef(props, 'isH5')) // 是否是H5配置
203
217
 
218
+ provide('_parentRootValue', props.parentRootValue)
219
+ provide('_selectionsObj', props.selectionsObj)
220
+ provide('_polyfillConfigs', props.polyfillConfigs)
221
+
204
222
  const rootForm = ref(null)
205
223
  provide('rootForm', rootForm)
206
224
 
@@ -106,6 +106,7 @@ function generateFormConfig(lang = 'zh', isH5) {
106
106
  export function parsePageConfig({
107
107
  config, lang, polyfillConfigs, instance, isH5,
108
108
  rootValue,
109
+ parentRootValue,
109
110
  axiosInstance,
110
111
  messageInstance,
111
112
  messageCb
@@ -122,7 +123,8 @@ export function parsePageConfig({
122
123
  rootValue,
123
124
  axiosInstance,
124
125
  messageInstance,
125
- messageCb
126
+ messageCb,
127
+ parentRootValue
126
128
  }, formConfig)
127
129
  cbs.forEach((cb) => {
128
130
  cb()
@@ -147,7 +149,8 @@ export function normalConfig({
147
149
  rootValue,
148
150
  axiosInstance,
149
151
  messageInstance,
150
- messageCb
152
+ messageCb,
153
+ parentRootValue
151
154
  }, config, hireRelat = '', mapComp = {}, needformItem = false) {
152
155
  const metaCode = config.metaCode || ''
153
156
  hireRelat += hireRelat ? `->${metaCode}` : metaCode
@@ -189,7 +192,8 @@ export function normalConfig({
189
192
  rootValue,
190
193
  axiosInstance,
191
194
  messageInstance ,
192
- messageCb
195
+ messageCb,
196
+ parentRootValue
193
197
  }, metaItem, hireRelat, mapComp, needformItem || [FORM_META_TYPE, FORM_META_TYPE_H5].includes(metaType))
194
198
  return pageConfig
195
199
  })?.sort((a, b) => a.seqNo - b.seqNo)
@@ -213,7 +217,7 @@ export function normalConfig({
213
217
  pageConfig.needWrap = '1'
214
218
  }
215
219
  mapComp[hireRelat] = pageConfig
216
- parsePolyfillConfigs({ polyfillConfigs, instance }, pageConfig)
220
+ parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue }, pageConfig)
217
221
  if(pageConfig.lcpPageServiceMapVOList?.length) {
218
222
  cbs.push(() => {
219
223
  const tabsServices = getTableServices(pageConfig.lcpPageServiceMapVOList, {dynamicMapComp: mapComp, dynamicMapCompKeys: Object.keys(mapComp), hireRelat})
@@ -260,14 +264,15 @@ function getTableServices(lcpPageServiceMapVOList = [], { dynamicMapComp, dynami
260
264
  return []
261
265
  }
262
266
 
263
- function parsePolyfillConfigs({ polyfillConfigs, instance }, config) {
267
+ function parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue }, config) {
264
268
  const hireRelat = config.hireRelat
265
269
  const findKeys = Object.keys(polyfillConfigs).filter(key => hireRelat.endsWith(key))
266
270
  if (!findKeys.length) {
267
271
  return
268
272
  }
273
+ // 层级写的越明确,就使用更明确的层级配置
269
274
  const findKey = findKeys.reduce((ret, key) => (hireRelat.lastIndexOf(ret) < hireRelat.lastIndexOf(key) ? ret : key))
270
- const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance)
275
+ const polyObj = polyfillConfigs[findKey] && polyfillConfigs[findKey](config, instance, {parentRootValue})
271
276
  polyObj && Object.keys(polyObj).forEach(key => {
272
277
  config[key] = polyObj[key]
273
278
  })
@@ -461,10 +466,13 @@ export function generateLayoutPolyfill(config, disabled, isH5) {
461
466
  props = {
462
467
  ...props,
463
468
  ...getDefaultColProps(config),
464
- ...elColSpecialProsp(config),
465
469
  }
466
470
 
467
471
  }
472
+ props = {
473
+ ...props,
474
+ ...elColSpecialProsp(config),
475
+ }
468
476
  return node => {
469
477
  // 表格中中的列,是否需要转换为普通形式
470
478
  if (isPlainColumn(config, disabled)) {