resolver-egretimp-plus 0.0.72 → 0.0.73
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/const/index.js +1 -1
- package/dist/h5/index.js +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/components/childDialog/src/index.vue +4 -0
- package/src/components/helper/eventOrchestration.js +23 -15
- package/src/components/helper/resolver.js +22 -14
- package/src/components/packages-H5/CustomComponentTableH5.vue +45 -7
- package/src/components/packages-web/CustomComponentTable.jsx +1 -1
- package/src/components/packages-web/ElSelect.vue +5 -0
- package/src/utils/common.js +26 -0
- package/src/utils/const.js +2 -24
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { isArray, isHasVal } from "../../utils/is"
|
|
|
2
2
|
import { DATA_VALID_RULE_EXECUTE } from "../../api/builtIn"
|
|
3
3
|
import { getRelateConfigKeys } from "../../rules/ruleUtils"
|
|
4
4
|
import { RESULT_CODE, resultToast } from "../../utils/respone"
|
|
5
|
-
import { unionWith } from "../../utils/index"
|
|
5
|
+
import { parseExtendAttr, unionWith } from "../../utils/index"
|
|
6
6
|
|
|
7
7
|
export async function dispatchClickEvents ({serviceList = [], requestTraceId, axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
|
|
8
8
|
const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
@@ -25,21 +25,27 @@ export async function dispatchClickEvent(service, { dynamicMapComp, requestTrace
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const url = service.serviceCode
|
|
28
|
-
const httpMethod = service.httpMethod
|
|
29
|
-
const
|
|
28
|
+
const httpMethod = service.httpMethod || "post"
|
|
29
|
+
const reqResult = {
|
|
30
|
+
requestTraceId,
|
|
31
|
+
pmHandleBusinessIdentity: {
|
|
32
|
+
busiIdentityId: service.busiIdentityId,
|
|
33
|
+
pageMetaId: service.pageMetaId,
|
|
34
|
+
tenantId: service.tenantId,
|
|
35
|
+
mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
|
|
36
|
+
},
|
|
37
|
+
...reqData
|
|
38
|
+
}
|
|
39
|
+
const reqConfig = {
|
|
30
40
|
url,
|
|
31
|
-
method: httpMethod
|
|
32
|
-
data:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
...reqData
|
|
41
|
-
}
|
|
42
|
-
}))
|
|
41
|
+
method: httpMethod,
|
|
42
|
+
data: reqResult
|
|
43
|
+
}
|
|
44
|
+
if (httpMethod.toLocaleLowerCase() === 'get') {
|
|
45
|
+
reqConfig.params = reqResult
|
|
46
|
+
delete reqConfig.data
|
|
47
|
+
}
|
|
48
|
+
const ret = await (axiosInstance && axiosInstance(reqConfig))
|
|
43
49
|
if (!resultToast(ret?.data, messageInstance, {messageCb, service, compConfig})) {
|
|
44
50
|
await Promise.reject()
|
|
45
51
|
return
|
|
@@ -215,8 +221,10 @@ export function openDailg({
|
|
|
215
221
|
}
|
|
216
222
|
}
|
|
217
223
|
}
|
|
224
|
+
const dialogProps = parseExtendAttr({extendAttr: pagePopupMap.extendAttr})
|
|
218
225
|
dialogClose = openChildDialog({
|
|
219
226
|
buttonActions,
|
|
227
|
+
dialogProps,
|
|
220
228
|
parentRootValue: rootValue,
|
|
221
229
|
selectionsObj,
|
|
222
230
|
busiIdentityId,
|
|
@@ -13,21 +13,29 @@ export async function executeLoadServices(services = [], { requestTraceId, busin
|
|
|
13
13
|
for (let i = 0; i < loadServices.length; i++) {
|
|
14
14
|
const service = loadServices[i]
|
|
15
15
|
const url = service.serviceCode
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
data: {
|
|
20
|
-
requestTraceId,
|
|
16
|
+
const httpMethod = service.httpMethod || "post"
|
|
17
|
+
const reqResult = {
|
|
18
|
+
requestTraceId,
|
|
21
19
|
pmHandleBusinessIdentity: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
busiIdentityId: service.busiIdentityId,
|
|
21
|
+
pageMetaId: service.pageMetaId,
|
|
22
|
+
tenantId: service.tenantId,
|
|
23
|
+
mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
|
|
24
|
+
...businessIdentityReqData,
|
|
25
|
+
},
|
|
26
|
+
...(reqData || {})
|
|
27
|
+
}
|
|
28
|
+
const reqConfig = {
|
|
29
|
+
url,
|
|
30
|
+
method: httpMethod,
|
|
31
|
+
data: reqResult
|
|
32
|
+
}
|
|
33
|
+
if (httpMethod.toLocaleLowerCase() === 'get') {
|
|
34
|
+
reqConfig.params = reqResult
|
|
35
|
+
delete reqConfig.data
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const ret = await (axiosInstance.value && axiosInstance.value(reqConfig))
|
|
31
39
|
if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
|
|
32
40
|
respCb && respCb(ret?.data?.result)
|
|
33
41
|
return
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { commonPropsType, hasOwn } from '../../utils/index.js'
|
|
2
|
+
import { commonPropsType, getConfigOptions, hasOwn } from '../../utils/index.js'
|
|
3
3
|
import { computed, inject, reactive, ref, useAttrs, watch } from 'vue'
|
|
4
4
|
|
|
5
5
|
const attrs = useAttrs()
|
|
6
6
|
const lang = inject('lang')
|
|
7
|
+
const selects = inject('selects')
|
|
7
8
|
const tableRef = ref(null)
|
|
8
9
|
const props = defineProps({
|
|
9
10
|
...commonPropsType,
|
|
@@ -12,7 +13,7 @@ const tableData = ref([])
|
|
|
12
13
|
const modelValue = defineModel()
|
|
13
14
|
|
|
14
15
|
const isFrontPage = computed(() => {
|
|
15
|
-
return props.config?.frontPageFlag
|
|
16
|
+
return props.config?.frontPageFlag == '1'
|
|
16
17
|
})
|
|
17
18
|
const tableProps = computed(() => {
|
|
18
19
|
return {
|
|
@@ -21,6 +22,8 @@ const tableProps = computed(() => {
|
|
|
21
22
|
display: props.config?.display,
|
|
22
23
|
open: props.config?.defaultOpenFlag === '1',
|
|
23
24
|
showlandscape: props.config?.showLandscape === '1',
|
|
25
|
+
rowkey: props.config?.rowkey,
|
|
26
|
+
height: props.config?.height,
|
|
24
27
|
}
|
|
25
28
|
})
|
|
26
29
|
const page = reactive({
|
|
@@ -30,9 +33,12 @@ const page = reactive({
|
|
|
30
33
|
})
|
|
31
34
|
|
|
32
35
|
const normalTableData = computed(() => {
|
|
33
|
-
|
|
36
|
+
const orgList = !isFrontPage.value ?
|
|
34
37
|
tableData.value :
|
|
35
38
|
tableData.value.slice((page.pageNum - 1) * page.pageSize, page.pageNum * page.pageSize)
|
|
39
|
+
return orgList.map(row => {
|
|
40
|
+
return normalTableRowValue(row)
|
|
41
|
+
})
|
|
36
42
|
})
|
|
37
43
|
|
|
38
44
|
const normalPageTotal = computed(() => {
|
|
@@ -74,7 +80,7 @@ const tableEvents = computed(() => {
|
|
|
74
80
|
})
|
|
75
81
|
// 是否配置分页功能 ====== start======
|
|
76
82
|
const pageable = computed(() => {
|
|
77
|
-
return props.config?.pageable
|
|
83
|
+
return props.config?.pageable == '1'
|
|
78
84
|
})
|
|
79
85
|
const pageAlign = computed(() => {
|
|
80
86
|
return props.config?.pageAlign
|
|
@@ -126,10 +132,10 @@ const getTableColumnProps = (config) => {
|
|
|
126
132
|
prop: config.metaCode,
|
|
127
133
|
width: config.columnWidth,
|
|
128
134
|
ellipsis: config.ellipsis === '1',
|
|
129
|
-
showexpand: config.showexpand === '1'
|
|
135
|
+
showexpand: config.showexpand === '1',
|
|
136
|
+
fixed: config.fixed,
|
|
130
137
|
}
|
|
131
138
|
}
|
|
132
|
-
|
|
133
139
|
watch(modelValue, (val) => {
|
|
134
140
|
setTimeout(() => {
|
|
135
141
|
tableData.value = val || (tableProps.value.card ? [] : [])
|
|
@@ -138,9 +144,41 @@ watch(modelValue, (val) => {
|
|
|
138
144
|
}, {
|
|
139
145
|
immediate: true
|
|
140
146
|
})
|
|
147
|
+
// 这个的监听是因为 table正常形态的时候,改变分页,行高会越来越高,所以就设置了key
|
|
148
|
+
// 设置key之后需要重新setTableData
|
|
149
|
+
watch(() => {
|
|
150
|
+
return `${tableProps.value.card}${tableProps.value.display}${!tableProps.value.card ? page.pageNum : 0}`
|
|
151
|
+
}, () => {
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
tableRef.value?.setTableData(normalTableData.value)
|
|
154
|
+
}, 100);
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
function getOptions(config) {
|
|
158
|
+
return getConfigOptions(config, selects)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function normalVal(val, options) {
|
|
162
|
+
const findItem = options?.find(item => item.columnValue == val)
|
|
163
|
+
if (findItem) {
|
|
164
|
+
return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
|
|
165
|
+
}
|
|
166
|
+
return val
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
function normalTableRowValue(row) {
|
|
171
|
+
const ret = {
|
|
172
|
+
...row
|
|
173
|
+
}
|
|
174
|
+
pmPageMetaList.value.forEach(config => {
|
|
175
|
+
ret[config.metaCode] = normalVal(ret[config.metaCode], getOptions(config))
|
|
176
|
+
})
|
|
177
|
+
return ret
|
|
178
|
+
}
|
|
141
179
|
</script>
|
|
142
180
|
<template>
|
|
143
|
-
<cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="normalTableData" @rowclick="tableEvents.onRowclick">
|
|
181
|
+
<cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}${!tableProps.card ? page.pageNum : 0}`" v-bind="tableProps" :data="normalTableData" @rowclick="tableEvents.onRowclick">
|
|
144
182
|
<cmi-table-column
|
|
145
183
|
v-for="column in pmPageMetaList" :key="column.metaCode"
|
|
146
184
|
v-bind="{
|
|
@@ -134,7 +134,7 @@ export default {
|
|
|
134
134
|
if (!props.columnWidth) {
|
|
135
135
|
props.minWidth = '160px'
|
|
136
136
|
}
|
|
137
|
-
if (props.width == 0 || props.width == '0px') {
|
|
137
|
+
if (props.width == 0 || props.width == '0px' || config.hidden == '1') {
|
|
138
138
|
props.className = 'hidden-column'
|
|
139
139
|
props.width = '1px'
|
|
140
140
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
|
|
2
3
|
<ElSelect class="custom-self-select" v-bind="{...attrs, ...selectProps }" v-model="value" @clear="clear">
|
|
3
4
|
<ElOption v-for="option in props.options"
|
|
4
5
|
:key="option.columnValue"
|
|
@@ -66,6 +67,10 @@ const selectProps = computed(() => {
|
|
|
66
67
|
if (typeof attrs.multiple === 'string') {
|
|
67
68
|
attrs.multiple = attrs.multiple == '1'
|
|
68
69
|
}
|
|
70
|
+
if (!attrs['suffix-icon'] && !attrs.suffixIcon) {
|
|
71
|
+
delete attrs.suffixIcon
|
|
72
|
+
delete attrs['suffix-icon']
|
|
73
|
+
}
|
|
69
74
|
attrs.multipleLimit = Number(parseInt(attrs.multipleLimit || 0))
|
|
70
75
|
return attrs
|
|
71
76
|
})
|
package/src/utils/common.js
CHANGED
|
@@ -257,3 +257,29 @@ export function getUuid () {
|
|
|
257
257
|
return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16);
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
+
|
|
261
|
+
export function getConfigOptions(config, selects) {
|
|
262
|
+
const referenceOptions = config.referenceOptions
|
|
263
|
+
const selectKey = config.selectKey
|
|
264
|
+
let optionItemsList = []
|
|
265
|
+
try {
|
|
266
|
+
optionItemsList = JSON.parse(config?.optionItems || '[]').map(item => {
|
|
267
|
+
return {
|
|
268
|
+
columnValue: item.value,
|
|
269
|
+
columnDesc_zh: item.label,
|
|
270
|
+
columnDesc: item.label_en || item.label,
|
|
271
|
+
columnStatus: item.columnStatus
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
} catch (error) {
|
|
275
|
+
optionItemsList = []
|
|
276
|
+
}
|
|
277
|
+
const options = (selects?.value && selects?.value?.[selectKey]) || (selects?.value && selects?.value?.[`${config.metaCode}ListValue`]) || (selects?.value && selects?.value?.[referenceOptions]) || optionItemsList || []
|
|
278
|
+
return options
|
|
279
|
+
// const disabled = calcDisable(config, props.mode)
|
|
280
|
+
// if (disabled) {
|
|
281
|
+
// return options
|
|
282
|
+
// } else {
|
|
283
|
+
// return options.filter(item => !(item.columnStatus == '0' || item.columnStatus == '2'))
|
|
284
|
+
// }
|
|
285
|
+
}
|
package/src/utils/const.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalPixel, getDate, findComponent, isPatchComponent } from './common.js'
|
|
1
|
+
import { normalPixel, getDate, findComponent, isPatchComponent, getConfigOptions } from './common.js'
|
|
2
2
|
|
|
3
3
|
export const MODE = {
|
|
4
4
|
OPERATE: 'operate',
|
|
@@ -144,29 +144,7 @@ export const commonPropsType = {
|
|
|
144
144
|
type: Array,
|
|
145
145
|
default: () => [],
|
|
146
146
|
getValue(config, props, modelValue, selects) {
|
|
147
|
-
|
|
148
|
-
const selectKey = config.selectKey
|
|
149
|
-
let optionItemsList = []
|
|
150
|
-
try {
|
|
151
|
-
optionItemsList = JSON.parse(config?.optionItems || '[]').map(item => {
|
|
152
|
-
return {
|
|
153
|
-
columnValue: item.value,
|
|
154
|
-
columnDesc_zh: item.label,
|
|
155
|
-
columnDesc: item.label_en || item.label,
|
|
156
|
-
columnStatus: item.columnStatus
|
|
157
|
-
}
|
|
158
|
-
})
|
|
159
|
-
} catch (error) {
|
|
160
|
-
optionItemsList = []
|
|
161
|
-
}
|
|
162
|
-
const options = (selects?.value && selects?.value?.[selectKey]) || (selects?.value && selects?.value?.[`${config.metaCode}ListValue`]) || (selects?.value && selects?.value?.[referenceOptions]) || optionItemsList || []
|
|
163
|
-
return options
|
|
164
|
-
// const disabled = calcDisable(config, props.mode)
|
|
165
|
-
// if (disabled) {
|
|
166
|
-
// return options
|
|
167
|
-
// } else {
|
|
168
|
-
// return options.filter(item => !(item.columnStatus == '0' || item.columnStatus == '2'))
|
|
169
|
-
// }
|
|
147
|
+
return getConfigOptions(config, selects)
|
|
170
148
|
}
|
|
171
149
|
},
|
|
172
150
|
placeholder: {
|