resolver-egretimp-plus 0.0.57 → 0.0.59
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/dist/h5/index.js +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/analysisComponent.jsx +2 -1
- package/src/components/childDialog/src/index.vue +9 -3
- package/src/components/helper/eventOrchestration.js +72 -16
- package/src/components/packages-H5/CmiButton.vue +12 -2
- package/src/components/packages-H5/CmiInput.vue +2 -2
- package/src/enums/index.js +4 -2
- package/src/utils/common.js +2 -1
package/package.json
CHANGED
|
@@ -48,6 +48,7 @@ export default {
|
|
|
48
48
|
delete ret.onClick
|
|
49
49
|
return ret
|
|
50
50
|
})
|
|
51
|
+
const buttonActions = inject('buttonActions', {})
|
|
51
52
|
const route = useRoute()
|
|
52
53
|
const routeQuery= route?.query
|
|
53
54
|
const hireRelatMapRules = inject('hireRelatMapRules')
|
|
@@ -179,7 +180,6 @@ export default {
|
|
|
179
180
|
appContext
|
|
180
181
|
}
|
|
181
182
|
attrs?.onClick?.call(context, e) // 如果配置中有点击事件
|
|
182
|
-
|
|
183
183
|
executeEventOrchestration({
|
|
184
184
|
props,
|
|
185
185
|
axiosInstance: _axiosInstance?.value,
|
|
@@ -189,6 +189,7 @@ export default {
|
|
|
189
189
|
openChildDialog: openChildDialogInstance?.value,
|
|
190
190
|
messageInstance: messageInstance?.value,
|
|
191
191
|
messageCb,
|
|
192
|
+
buttonActions,
|
|
192
193
|
lang: lang?.value,
|
|
193
194
|
appContext
|
|
194
195
|
})
|
|
@@ -12,9 +12,14 @@ const props = defineProps({
|
|
|
12
12
|
},
|
|
13
13
|
// 请求方法的实列
|
|
14
14
|
axiosInstance: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
type: [Object, Function],
|
|
16
|
+
default: () => null
|
|
17
|
+
},
|
|
18
|
+
// 按钮的工作集合
|
|
19
|
+
buttonActions: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({})
|
|
22
|
+
},
|
|
18
23
|
// config的额外属性配置
|
|
19
24
|
polyfillConfigs: {
|
|
20
25
|
type: Object,
|
|
@@ -76,6 +81,7 @@ defineExpose({
|
|
|
76
81
|
v-model="formData"
|
|
77
82
|
:busiIdentityId="busiIdentityId"
|
|
78
83
|
:lang="props.lang"
|
|
84
|
+
:buttonActions="props.buttonActions"
|
|
79
85
|
:loadEvnetsReq="props.loadEvnetsReq"
|
|
80
86
|
:polyfillConfigs="props.polyfillConfigs"
|
|
81
87
|
:axiosInstance="props.axiosInstance"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { isArray } from "../../utils/is"
|
|
1
2
|
import { DATA_VALID_RULE_EXECUTE } from "../../api/builtIn"
|
|
2
3
|
import { getRelateConfigKeys } from "../../rules/ruleUtils"
|
|
3
4
|
import { RESULT_CODE, resultToast } from "../../utils/respone"
|
|
5
|
+
import { unionWith } from "../../utils/index"
|
|
4
6
|
|
|
5
7
|
export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
|
|
6
8
|
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
@@ -77,7 +79,7 @@ function getReqData(inParamMappingList = [], {dynamicMapComp, dynamicMapCompKeys
|
|
|
77
79
|
|
|
78
80
|
function initOutParamData(outParamMappingList = [], { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult = {} }) {
|
|
79
81
|
outParamMappingList.forEach(params => {
|
|
80
|
-
const { orignParam = '', destParam = '' } = params
|
|
82
|
+
const { orignParam = '', destParam = '', isList = false, primaryKeys = [] } = params
|
|
81
83
|
const configCodes = getRelateConfigKeys(dynamicMapCompKeys, destParam, dynamicHireRelat)
|
|
82
84
|
if (configCodes.length > 1) {
|
|
83
85
|
console.error('search arg muti', params, configCodes)
|
|
@@ -87,10 +89,19 @@ function initOutParamData(outParamMappingList = [], { dynamicMapComp, dynamicMap
|
|
|
87
89
|
|
|
88
90
|
if (compConfig) {
|
|
89
91
|
const orignParamArr = orignParam ? orignParam?.split('.') : []
|
|
90
|
-
|
|
92
|
+
let val = orignParamArr.reduce((ret, item) => {
|
|
91
93
|
if (!ret) return
|
|
92
94
|
return ret[item]
|
|
93
95
|
}, outResult)
|
|
96
|
+
if (isList) {
|
|
97
|
+
if (!isArray(val)) {
|
|
98
|
+
val = isArray(compConfig.refValue) ? compConfig.refValue : []
|
|
99
|
+
} else if (isArray(compConfig.refValue) && isArray(val)) {
|
|
100
|
+
val = unionWith(compConfig.refValue, val, (arrVal, othVal) => {
|
|
101
|
+
return (primaryKeys && primaryKeys.length) ? primaryKeys.map(key => arrVal[key] == othVal[key])?.every(item => item) : false
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
94
105
|
compConfig.refValue = val
|
|
95
106
|
}
|
|
96
107
|
})
|
|
@@ -120,20 +131,47 @@ export function openDailg({
|
|
|
120
131
|
dynamicMapComp,
|
|
121
132
|
dynamicHireRelat,
|
|
122
133
|
lang,
|
|
134
|
+
buttonActions,
|
|
123
135
|
openChildDialog,
|
|
124
136
|
appContext,
|
|
125
137
|
}) {
|
|
126
138
|
const busiIdentityId = pagePopupMap.popupBusiIdentityId
|
|
127
139
|
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
128
140
|
const reqData = getReqData(pagePopupMap.inParamMappingList || [], {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
141
|
+
|
|
142
|
+
let mapList = {}
|
|
143
|
+
let outParamMappingList = []
|
|
144
|
+
// 是表格还是list
|
|
145
|
+
const isList = pagePopupMap?.objOrList == '1'
|
|
146
|
+
if (isList ) {
|
|
147
|
+
const primaryKeys = []
|
|
148
|
+
mapList = pagePopupMap?.outParamMappingList?.reduce((ret, item) => {
|
|
149
|
+
const { orignParam, destParam, primaryKeyFlag = '' } = item
|
|
150
|
+
ret[destParam] = orignParam
|
|
151
|
+
if (primaryKeyFlag == '1') {
|
|
152
|
+
primaryKeys.push(destParam)
|
|
153
|
+
}
|
|
154
|
+
return ret
|
|
155
|
+
}, {})
|
|
156
|
+
|
|
157
|
+
outParamMappingList = [
|
|
158
|
+
{
|
|
159
|
+
orignParam: '',
|
|
160
|
+
destParam: pagePopupMap.parentTable || '',
|
|
161
|
+
primaryKeys,
|
|
162
|
+
isList: true
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
} else {
|
|
166
|
+
outParamMappingList = pagePopupMap?.outParamMappingList?.map(item => {
|
|
167
|
+
const orignParamArr = item.orignParam ? item.orignParam.split('->') : []
|
|
168
|
+
return {
|
|
169
|
+
...item,
|
|
170
|
+
orignParam: item.orignParam ? orignParamArr[orignParamArr.length - 1] : ''
|
|
171
|
+
}
|
|
172
|
+
}) || []
|
|
173
|
+
}
|
|
129
174
|
|
|
130
|
-
const outParamMappingList = pagePopupMap?.outParamMappingList?.map(item => {
|
|
131
|
-
const orignParamArr = item.orignParam ? item.orignParam.split('->') : []
|
|
132
|
-
return {
|
|
133
|
-
...item,
|
|
134
|
-
orignParam: item.orignParam ? orignParamArr[orignParamArr.length - 1] : ''
|
|
135
|
-
}
|
|
136
|
-
}) || []
|
|
137
175
|
|
|
138
176
|
let rootStore = {}
|
|
139
177
|
let dialogClose = null
|
|
@@ -142,7 +180,16 @@ export function openDailg({
|
|
|
142
180
|
polyfillConfigs[pagePopupMap.outDisplayTrigger] = (config) => {
|
|
143
181
|
return {
|
|
144
182
|
onClick() {
|
|
145
|
-
|
|
183
|
+
const outResult = rootStore.tableSelectedInfo?.map(item => {
|
|
184
|
+
const retItem = {
|
|
185
|
+
...item
|
|
186
|
+
}
|
|
187
|
+
Object.keys(mapList).forEach(key => {
|
|
188
|
+
retItem[key] = item[mapList[key]]
|
|
189
|
+
})
|
|
190
|
+
return retItem
|
|
191
|
+
})
|
|
192
|
+
initOutParamData(outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult})
|
|
146
193
|
dialogClose?.()
|
|
147
194
|
}
|
|
148
195
|
}
|
|
@@ -158,6 +205,7 @@ export function openDailg({
|
|
|
158
205
|
}
|
|
159
206
|
}
|
|
160
207
|
dialogClose = openChildDialog({
|
|
208
|
+
buttonActions,
|
|
161
209
|
busiIdentityId,
|
|
162
210
|
axiosInstance: axiosInstance,
|
|
163
211
|
lang,
|
|
@@ -232,17 +280,20 @@ export async function executeDataValid(validConfig, { dynamicMapComp, mixinServi
|
|
|
232
280
|
})
|
|
233
281
|
}
|
|
234
282
|
|
|
235
|
-
function closePage() {
|
|
236
|
-
|
|
237
|
-
|
|
283
|
+
function closePage(lcpPageClosedMapVO) {
|
|
284
|
+
if (lcpPageClosedMapVO?.closedType == '1') {
|
|
285
|
+
const top = window.top
|
|
286
|
+
top?.close()
|
|
287
|
+
} else {
|
|
288
|
+
window?.history?.back()
|
|
289
|
+
}
|
|
238
290
|
}
|
|
239
291
|
|
|
240
|
-
export async function executeEventOrchestration({props, axiosInstance, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
|
|
292
|
+
export async function executeEventOrchestration({props, axiosInstance, buttonActions, rootValue, confirmInstance, dynamicMapComp, messageInstance, openChildDialog, messageCb, lang, appContext } = {}) {
|
|
241
293
|
const lcpPageRuleVOLis = props.config?.lcpPageRuleVOList || []
|
|
242
294
|
const PageServiceMapVOList = props.config.lcpPageServiceMapVOList || []
|
|
243
295
|
const mixinServiceConfig = PageServiceMapVOList.find(service => service.serviceType === '1')
|
|
244
296
|
if (lcpPageRuleVOLis?.length && mixinServiceConfig) {
|
|
245
|
-
// for(let i = 0; i < lcpPageRuleVOLis.length; i++) {
|
|
246
297
|
// 数据校验服务
|
|
247
298
|
const validConfig = lcpPageRuleVOLis[0]
|
|
248
299
|
const valid = await executeDataValid(validConfig, {
|
|
@@ -255,8 +306,8 @@ export async function executeEventOrchestration({props, axiosInstance, rootValue
|
|
|
255
306
|
if (!valid) {
|
|
256
307
|
return
|
|
257
308
|
}
|
|
258
|
-
// }
|
|
259
309
|
}
|
|
310
|
+
|
|
260
311
|
if (PageServiceMapVOList?.length) {
|
|
261
312
|
const dynamicHireRelat = props.config?.dynamicHireRelat
|
|
262
313
|
dispatchClickEvents({
|
|
@@ -281,7 +332,12 @@ export async function executeEventOrchestration({props, axiosInstance, rootValue
|
|
|
281
332
|
appContext,
|
|
282
333
|
lang,
|
|
283
334
|
messageCb,
|
|
335
|
+
buttonActions,
|
|
284
336
|
openChildDialog
|
|
285
337
|
})
|
|
286
338
|
}
|
|
339
|
+
const lcpPageClosedMapVO = props.config.lcpPageClosedMapVO
|
|
340
|
+
if (lcpPageClosedMapVO) {
|
|
341
|
+
closePage(lcpPageClosedMapVO)
|
|
342
|
+
}
|
|
287
343
|
}
|
|
@@ -5,6 +5,10 @@ import { useRoute } from 'vue-router'
|
|
|
5
5
|
|
|
6
6
|
const appContext = getCurrentInstance()?.appContext
|
|
7
7
|
|
|
8
|
+
defineOptions({
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
})
|
|
11
|
+
|
|
8
12
|
const props = defineProps({
|
|
9
13
|
...commonPropsType,
|
|
10
14
|
displayType: String,
|
|
@@ -31,7 +35,13 @@ const calcPorps = computed(() => {
|
|
|
31
35
|
})
|
|
32
36
|
|
|
33
37
|
const attrs = useAttrs()
|
|
34
|
-
|
|
38
|
+
const calcAttrs = computed(() => {
|
|
39
|
+
const props = {
|
|
40
|
+
...attrs,
|
|
41
|
+
}
|
|
42
|
+
delete props.onClick
|
|
43
|
+
return props
|
|
44
|
+
})
|
|
35
45
|
const lang = inject('lang')
|
|
36
46
|
|
|
37
47
|
const label = computed(() => {
|
|
@@ -91,7 +101,7 @@ const buttonAction = (...arg) => {
|
|
|
91
101
|
</script>
|
|
92
102
|
|
|
93
103
|
<template>
|
|
94
|
-
<cmi-button @click="buttonAction" v-bind="{ ...
|
|
104
|
+
<cmi-button @click="buttonAction" v-bind="{ ...calcAttrs, ...calcPorps,}">
|
|
95
105
|
{{label}}
|
|
96
106
|
</cmi-button>
|
|
97
107
|
</template>
|
|
@@ -15,13 +15,13 @@ const inputProps = computed(() => {
|
|
|
15
15
|
min: props.config?.min,
|
|
16
16
|
minlength: props.config?.minlength,
|
|
17
17
|
max: props.config?.max,
|
|
18
|
-
maxlength: props.config?.
|
|
18
|
+
maxlength: props.config?.maxLength,
|
|
19
19
|
disabled: props.disabled,
|
|
20
20
|
readonly: props.config?.readonly ==='1',
|
|
21
21
|
required: props.required,
|
|
22
22
|
errormsg: props.config?.errormsg,
|
|
23
23
|
clearable: props.clearable,
|
|
24
|
-
showWordLimit: props.config?.showWordLimit === '1',
|
|
24
|
+
showWordLimit: props.config?.showWordLimit === '1' && props.config?.maxLength,
|
|
25
25
|
showPassword: props.config?.showPassword === '1',
|
|
26
26
|
prefixIcon: props.config?.prefixIcon,
|
|
27
27
|
suffixIcon: props.config?.suffixIcon,
|
package/src/enums/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LCP_LOGIN } from "../api/builtIn"
|
|
1
|
+
import { GET_SYS_PARAM_CACHE, LCP_LOGIN, QUERY_PAGE_CONFIG_DATA } from "../api/builtIn"
|
|
2
2
|
|
|
3
3
|
export const USER_NAME = 'lcpsupport'
|
|
4
4
|
export const PASSWORD = '8ik,*IK<'
|
|
@@ -6,5 +6,7 @@ export const USER_TYPE = '1'
|
|
|
6
6
|
export const AUTH_CODE = '9887'
|
|
7
7
|
|
|
8
8
|
export const NOT_AUTH_APIS = [
|
|
9
|
-
LCP_LOGIN
|
|
9
|
+
LCP_LOGIN,
|
|
10
|
+
GET_SYS_PARAM_CACHE,
|
|
11
|
+
QUERY_PAGE_CONFIG_DATA
|
|
10
12
|
]
|