resolver-egretimp-plus 0.1.58 → 0.1.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/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { isArray, isHasVal, isNull, isUndefined } 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 { assignmentPathVal, getPathVal, isPromise, modelValueDeepMerge, parseExtendAttr, unionWith } from "../../utils/index"
|
|
5
|
+
import { assignmentPathVal, definePrivatelyProp, getPathVal, isPromise, modelValueDeepMerge, parseExtendAttr, unionWith } from "../../utils/index"
|
|
6
6
|
import { buildInRequest } from "../../utils/request"
|
|
7
7
|
import { bpmInstance } from "../../bpm/bpmInstance"
|
|
8
8
|
|
|
@@ -21,148 +21,174 @@ export async function dispatchClickEvent(service, {
|
|
|
21
21
|
dynamicHireRelat, axiosInstance, messageCb, compConfig,
|
|
22
22
|
messageInstance, lang, beforeRequestService, afterRequestService
|
|
23
23
|
}) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
if (service.transactionType == '1') {
|
|
25
|
+
const tableConfig = getTableConfig(service.outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
26
|
+
if (tableConfig) {
|
|
27
|
+
definePrivatelyProp(tableConfig, 'serviceSizeChange', (val, props, page) => {
|
|
28
|
+
toExecute()
|
|
29
|
+
})
|
|
30
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChange', (val, props, page) => {
|
|
31
|
+
toExecute(false)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// 把执行逻辑封装成一个方法
|
|
36
|
+
async function toExecute(resetPageNum = true) {
|
|
37
|
+
let reqData = rootValue || {}
|
|
38
|
+
let tableConfig = null
|
|
39
|
+
const serviceCustomProps = parseExtendAttr({extendAttr: service.extendAttr})
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
let normalBeforeRequestService = null
|
|
42
|
+
let normalAfterRequestService = null
|
|
43
|
+
// 定义的请求前钩子
|
|
44
|
+
const configBeforeRequestService = compConfig?.beforeRequestService
|
|
45
|
+
if (configBeforeRequestService || beforeRequestService) {
|
|
46
|
+
normalBeforeRequestService = async (...arg) => {
|
|
47
|
+
let beforeRequestServiceRet = true
|
|
48
|
+
if (beforeRequestService) {
|
|
49
|
+
beforeRequestServiceRet = beforeRequestService?.(...arg)
|
|
50
|
+
}
|
|
51
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
52
|
+
if (beforeRequestServiceRetValid === false) {
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
if (configBeforeRequestService) {
|
|
56
|
+
return configBeforeRequestService?.(...arg)
|
|
57
|
+
} else {
|
|
58
|
+
return true
|
|
59
|
+
}
|
|
41
60
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
}
|
|
62
|
+
// 定义的请求后钩子
|
|
63
|
+
const configAfterRequestService = compConfig?.afterRequestService
|
|
64
|
+
if (configAfterRequestService || afterRequestService) {
|
|
65
|
+
normalAfterRequestService = async (...arg) => {
|
|
66
|
+
await afterRequestService?.(...arg)
|
|
67
|
+
await configAfterRequestService?.(...arg)
|
|
46
68
|
}
|
|
47
69
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
if (service.transactionType == '1') {
|
|
71
|
+
reqData = getReqData(service.inParamMappingList || [], {emptyUpdate: true, dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
72
|
+
tableConfig = getTableConfig(service.outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
73
|
+
if (tableConfig?.vm) {
|
|
74
|
+
if (resetPageNum) {
|
|
75
|
+
// 控制表格组件中分页变化不会出发监听
|
|
76
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChangeLoad', true)
|
|
77
|
+
tableConfig.vm.page.pageNum = 1
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
definePrivatelyProp(tableConfig, 'serviceCurrentChangeLoad', false)
|
|
80
|
+
}, 200);
|
|
81
|
+
}
|
|
82
|
+
if (!isUndefined(tableConfig.vm.page?.pageNum) && !isNull(tableConfig.vm.page?.pageNum) ) {
|
|
83
|
+
assignmentPathVal(reqData, service.pageNum || 'pageNum', tableConfig.vm.page?.pageNum)
|
|
84
|
+
}
|
|
85
|
+
if (!isUndefined(tableConfig.vm.page?.pageSize) && !isNull(tableConfig.vm.page?.pageSize) ) {
|
|
86
|
+
assignmentPathVal(reqData, service.pageSize || 'pageSize', tableConfig.vm.page?.pageSize)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
reqData = {
|
|
90
|
+
...reqData,
|
|
91
|
+
// ...dialogReq
|
|
92
|
+
}
|
|
55
93
|
}
|
|
56
|
-
}
|
|
57
94
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
95
|
+
const url = service.serviceCode
|
|
96
|
+
const httpMethod = service.httpMethod || "post"
|
|
97
|
+
|
|
98
|
+
let reqResult = {
|
|
99
|
+
aid_language: lang,
|
|
100
|
+
requestTraceId,
|
|
101
|
+
pmHandleBusinessIdentity: {
|
|
102
|
+
busiIdentityId: service.busiIdentityId,
|
|
103
|
+
pageMetaId: service.pageMetaId,
|
|
104
|
+
tenantId: service.tenantId,
|
|
105
|
+
mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
// 控制是否需要传入默认参数 ===== start=====
|
|
110
|
+
const notDefaultParmas = serviceCustomProps?.notDefaultParmas
|
|
111
|
+
if (notDefaultParmas) {
|
|
112
|
+
reqResult = {
|
|
67
113
|
}
|
|
68
114
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
115
|
+
const mergeObj = modelValueDeepMerge(reqResult, reqData)
|
|
116
|
+
reqResult = mergeObj
|
|
117
|
+
// 控制是否需要传入默认参数 ===== end=====
|
|
118
|
+
|
|
119
|
+
let beforeRequestServiceRet = true
|
|
120
|
+
if (normalBeforeRequestService) {
|
|
121
|
+
beforeRequestServiceRet = normalBeforeRequestService({
|
|
122
|
+
dynamicMapComp,
|
|
123
|
+
requestTraceId,
|
|
124
|
+
mixinServiceConfig,
|
|
125
|
+
rootValue,
|
|
126
|
+
dynamicHireRelat,
|
|
127
|
+
compConfig,
|
|
128
|
+
service,
|
|
129
|
+
reqData: reqResult
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
133
|
+
if (beforeRequestServiceRetValid === false) {
|
|
134
|
+
return
|
|
72
135
|
}
|
|
73
|
-
}
|
|
74
|
-
const url = service.serviceCode
|
|
75
|
-
const httpMethod = service.httpMethod || "post"
|
|
76
136
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
137
|
+
const reqConfig = {
|
|
138
|
+
url,
|
|
139
|
+
method: httpMethod,
|
|
140
|
+
data: reqResult
|
|
141
|
+
}
|
|
142
|
+
if (httpMethod.toLocaleLowerCase() === 'get') {
|
|
143
|
+
reqConfig.params = reqResult
|
|
144
|
+
delete reqConfig.data
|
|
145
|
+
}
|
|
146
|
+
const ret = await (axiosInstance && axiosInstance(reqConfig))
|
|
147
|
+
if (normalAfterRequestService) {
|
|
148
|
+
await normalAfterRequestService(ret, {
|
|
149
|
+
dynamicMapComp,
|
|
150
|
+
requestTraceId,
|
|
151
|
+
mixinServiceConfig,
|
|
152
|
+
rootValue,
|
|
153
|
+
dynamicHireRelat,
|
|
154
|
+
compConfig,
|
|
155
|
+
service,
|
|
156
|
+
reqData: reqResult
|
|
157
|
+
})
|
|
91
158
|
}
|
|
92
|
-
}
|
|
93
|
-
const mergeObj = modelValueDeepMerge(reqResult, reqData)
|
|
94
|
-
reqResult = mergeObj
|
|
95
159
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
dynamicMapComp,
|
|
100
|
-
requestTraceId,
|
|
101
|
-
mixinServiceConfig,
|
|
102
|
-
rootValue,
|
|
103
|
-
dynamicHireRelat,
|
|
104
|
-
compConfig,
|
|
160
|
+
const noSuccessIip = httpMethod.toLocaleLowerCase() === 'get' || service.transactionType == '1' || serviceCustomProps?.noSuccessIip
|
|
161
|
+
const toastParmas = {
|
|
162
|
+
messageCb,
|
|
105
163
|
service,
|
|
106
|
-
reqData: reqResult
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
const beforeRequestServiceRetValid = await beforeRequestServiceRet
|
|
110
|
-
if (beforeRequestServiceRetValid === false) {
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const reqConfig = {
|
|
115
|
-
url,
|
|
116
|
-
method: httpMethod,
|
|
117
|
-
data: reqResult
|
|
118
|
-
}
|
|
119
|
-
if (httpMethod.toLocaleLowerCase() === 'get') {
|
|
120
|
-
reqConfig.params = reqResult
|
|
121
|
-
delete reqConfig.data
|
|
122
|
-
}
|
|
123
|
-
const ret = await (axiosInstance && axiosInstance(reqConfig))
|
|
124
|
-
if (normalAfterRequestService) {
|
|
125
|
-
await normalAfterRequestService(ret, {
|
|
126
|
-
dynamicMapComp,
|
|
127
|
-
requestTraceId,
|
|
128
|
-
mixinServiceConfig,
|
|
129
|
-
rootValue,
|
|
130
|
-
dynamicHireRelat,
|
|
131
164
|
compConfig,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
let pageTotalCountKey = service.pageTotalCount
|
|
156
|
-
const deepMatch = /^_deep:(.+)$/
|
|
157
|
-
const matchs = service.pageTotalCount?.match(deepMatch)
|
|
158
|
-
if (matchs) {
|
|
159
|
-
totalObj = ret.data
|
|
160
|
-
pageTotalCountKey = matchs[1]
|
|
165
|
+
noSuccessIip
|
|
166
|
+
}
|
|
167
|
+
if (serviceCustomProps.resultCodeKey) {
|
|
168
|
+
toastParmas.resultCodeKey = serviceCustomProps.resultCodeKey
|
|
169
|
+
}
|
|
170
|
+
if (!resultToast(ret?.data, messageInstance, toastParmas)) {
|
|
171
|
+
await Promise.reject()
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
// ret.data = {result: {pageTotalCount: 100, result: [{},{},{},{},{}]}}
|
|
175
|
+
initOutParamData(service.outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: ret.data})
|
|
176
|
+
if (tableConfig?.vm) {
|
|
177
|
+
let totalObj = ret.data?.result
|
|
178
|
+
let pageTotalCountKey = service.pageTotalCount
|
|
179
|
+
const deepMatch = /^_deep:(.+)$/
|
|
180
|
+
const matchs = service.pageTotalCount?.match(deepMatch)
|
|
181
|
+
if (matchs) {
|
|
182
|
+
totalObj = ret.data
|
|
183
|
+
pageTotalCountKey = matchs[1]
|
|
184
|
+
}
|
|
185
|
+
const total = parseInt(getPathVal(totalObj || {}, pageTotalCountKey || 'pageCount'))
|
|
186
|
+
tableConfig.vm.page.total = total
|
|
187
|
+
// tableConfig.vm?.changePage(total, 'total')
|
|
161
188
|
}
|
|
162
|
-
const total = parseInt(getPathVal(totalObj || {}, pageTotalCountKey || 'pageCount'))
|
|
163
|
-
tableConfig.vm.page.total = total
|
|
164
|
-
// tableConfig.vm?.changePage(total, 'total')
|
|
165
189
|
}
|
|
190
|
+
|
|
191
|
+
toExecute()
|
|
166
192
|
}
|
|
167
193
|
|
|
168
194
|
function getReqData(inParamMappingList = [], {emptyUpdate, dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat}) {
|
|
@@ -3,7 +3,7 @@ import { ElPagination } from 'element-plus'
|
|
|
3
3
|
import ElTable, { ElTableColumn } from '../table'
|
|
4
4
|
import Renderer from '../../renderer.jsx'
|
|
5
5
|
import { computed, inject, watch, h, ref, reactive } from 'vue'
|
|
6
|
-
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
|
+
import { commonPropsType, TABLE_COLUMN_NOT_RENDER_META_TYPE, DISPLAY_SHOW, compareComponet, isPlainObject, hasOwn, cloneDeep, isPromise, isPlainColumn, generateUniqueId, calcDisable, camelize, capitalize, DISPLAY_HIDDEN, definePrivatelyProp, isArray } from '../../utils/index.js'
|
|
7
7
|
// import '../styles/CustomComponenTable.scss'
|
|
8
8
|
|
|
9
9
|
export default {
|
|
@@ -432,32 +432,33 @@ export default {
|
|
|
432
432
|
})
|
|
433
433
|
|
|
434
434
|
// 页码变动
|
|
435
|
-
watch(() => page.pageNum, (val) => {
|
|
435
|
+
watch(() => page.pageNum, async (val) => {
|
|
436
|
+
if (props.config?.serviceCurrentChangeLoad) {
|
|
437
|
+
return
|
|
438
|
+
}
|
|
436
439
|
const fn = props.config?.currentChange
|
|
437
|
-
const ret =
|
|
438
|
-
if (ret) {
|
|
439
|
-
|
|
440
|
-
ret.then((res) => {
|
|
441
|
-
res && (modelValue.value = res)
|
|
442
|
-
})
|
|
443
|
-
} else {
|
|
444
|
-
modelValue.value = ret
|
|
445
|
-
}
|
|
440
|
+
const ret = await fn?.(val, props, page)
|
|
441
|
+
if (ret && isArray(ret)) {
|
|
442
|
+
modelValue.value = ret
|
|
446
443
|
}
|
|
444
|
+
|
|
445
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== start ======
|
|
446
|
+
const serviceFn = props.config?.serviceCurrentChange
|
|
447
|
+
serviceFn?.(val, props, page)
|
|
448
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== end ======
|
|
447
449
|
})
|
|
448
450
|
// 页面大小变动
|
|
449
|
-
watch(() => page.pageSize, (val) => {
|
|
451
|
+
watch(() => page.pageSize, async (val) => {
|
|
450
452
|
const fn = props.config?.sizeChange
|
|
451
|
-
const ret =
|
|
452
|
-
if (ret) {
|
|
453
|
-
|
|
454
|
-
ret.then((res) => {
|
|
455
|
-
res && (modelValue.value = res)
|
|
456
|
-
})
|
|
457
|
-
} else {
|
|
458
|
-
modelValue.value = ret
|
|
459
|
-
}
|
|
453
|
+
const ret = await fn?.(val, props, page)
|
|
454
|
+
if (ret && isArray(ret)) {
|
|
455
|
+
modelValue.value = ret
|
|
460
456
|
}
|
|
457
|
+
|
|
458
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== start ======
|
|
459
|
+
const serviceFn = props.config?.serviceSizeChange
|
|
460
|
+
serviceFn?.(val, props, page)
|
|
461
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== end ======
|
|
461
462
|
})
|
|
462
463
|
|
|
463
464
|
const tableExposeKeys = [
|
package/src/utils/render.jsx
CHANGED
|
@@ -277,55 +277,55 @@ export function normalConfig({
|
|
|
277
277
|
|
|
278
278
|
mapComp[hireRelat] = pageConfig
|
|
279
279
|
parsePolyfillConfigs({ polyfillConfigs, instance, parentRootValue, parentDynamicMapComp }, pageConfig)
|
|
280
|
-
if(pageConfig.lcpPageServiceMapVOList?.length) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
280
|
+
// if(pageConfig.lcpPageServiceMapVOList?.length) {
|
|
281
|
+
// cbs.push(() => {
|
|
282
|
+
// const tabsServices = getTableServices(pageConfig.lcpPageServiceMapVOList, {dynamicMapComp: mapComp, dynamicMapCompKeys: Object.keys(mapComp), hireRelat})
|
|
283
|
+
// tabsServices.forEach((({mixinServiceConfig, tableConfig, service}) => {
|
|
284
|
+
// const orginCurrentChange = tableConfig.currentChange
|
|
285
|
+
// tableConfig.currentChange = (val, props, page) => {
|
|
286
|
+
// orginCurrentChange && orginCurrentChange(val, props, page)
|
|
287
|
+
// const dynamicMapComp = props.config.dynamicMapComp
|
|
288
|
+
// const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
289
|
+
// const dynamicHireRelat = props.config.dynamicHireRelat
|
|
290
|
+
// dispatchClickEvent(service, {
|
|
291
|
+
// requestTraceId,
|
|
292
|
+
// dialogReq,
|
|
293
|
+
// mixinServiceConfig,
|
|
294
|
+
// lang,
|
|
295
|
+
// dynamicMapComp,
|
|
296
|
+
// dynamicMapCompKeys,
|
|
297
|
+
// dynamicHireRelat,
|
|
298
|
+
// rootValue,
|
|
299
|
+
// messageCb,
|
|
300
|
+
// compConfig: pageConfig,
|
|
301
|
+
// axiosInstance,
|
|
302
|
+
// messageInstance
|
|
303
|
+
// })
|
|
304
|
+
// }
|
|
305
|
+
// const orginSizeChange = tableConfig.sizeChange
|
|
306
|
+
// tableConfig.sizeChange = (val, props, page) => {
|
|
307
|
+
// orginSizeChange && orginSizeChange(val, props, page)
|
|
308
|
+
// const dynamicMapComp = props.config.dynamicMapComp
|
|
309
|
+
// const dynamicMapCompKeys = Object.keys(dynamicMapComp)
|
|
310
|
+
// const dynamicHireRelat = props.config.dynamicHireRelat
|
|
311
|
+
// dispatchClickEvent(service, {
|
|
312
|
+
// requestTraceId,
|
|
313
|
+
// dialogReq,
|
|
314
|
+
// mixinServiceConfig,
|
|
315
|
+
// lang,
|
|
316
|
+
// dynamicMapComp,
|
|
317
|
+
// dynamicMapCompKeys,
|
|
318
|
+
// dynamicHireRelat,
|
|
319
|
+
// rootValue,
|
|
320
|
+
// messageCb,
|
|
321
|
+
// compConfig: pageConfig,
|
|
322
|
+
// axiosInstance,
|
|
323
|
+
// messageInstance
|
|
324
|
+
// })
|
|
325
|
+
// }
|
|
326
|
+
// }))
|
|
327
|
+
// })
|
|
328
|
+
// }
|
|
329
329
|
return {
|
|
330
330
|
mapComp,
|
|
331
331
|
pageConfig
|