resolver-egretimp-plus 0.0.110 → 0.0.112
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 +1 -1
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/analysisComponent.jsx +4 -3
- package/src/components/helper/eventOrchestration.js +17 -5
- package/src/components/packages-web/CustomComponentTable.jsx +2 -2
- package/src/components/packages-web/ElButton.vue +2 -1
- package/src/components/packages-web/ElSelect.vue +2 -1
- package/src/utils/const.js +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, defineAsyncComponent, getCurrentInstance, inject, onBeforeMount, provide, ref } from 'vue'
|
|
2
|
-
import { commonPropsType, definePrivatelyProp, getComponentPropsKeys, hasOwn } from './utils/index.js'
|
|
2
|
+
import { commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, hasOwn } from './utils/index.js'
|
|
3
3
|
import { useVmodels } from './hooks/index.js'
|
|
4
4
|
import { getRenderComponentProps, generateFormItemPolyfill } from './utils/index.js'
|
|
5
5
|
import rulesDriver from './rules/rulesDriver'
|
|
@@ -187,7 +187,6 @@ export default {
|
|
|
187
187
|
const lang = inject('lang')
|
|
188
188
|
const rootValue = inject('rootValue')
|
|
189
189
|
const onClick = (e, { beforeRequestService, afterRequestService } = {}) => {
|
|
190
|
-
e?.stopPropagation?.()
|
|
191
190
|
const context = {
|
|
192
191
|
props,
|
|
193
192
|
dynamicMapComp,
|
|
@@ -201,7 +200,9 @@ export default {
|
|
|
201
200
|
appContext
|
|
202
201
|
}
|
|
203
202
|
attrs?.onClick?.call(context, e) // 如果配置中有点击事件
|
|
204
|
-
|
|
203
|
+
if (findComponent(EXECTE_CLICK_EVENT_COMPONENTS, props.config?.renderby || props.config?.metaType) !== -1 ) {
|
|
204
|
+
executeClickEvents({ beforeRequestService, afterRequestService })
|
|
205
|
+
}
|
|
205
206
|
}
|
|
206
207
|
function executeClickEvents({ beforeRequestService, afterRequestService } = {}) {
|
|
207
208
|
executeEventOrchestration({
|
|
@@ -5,7 +5,19 @@ import { RESULT_CODE, resultToast } from "../../utils/respone"
|
|
|
5
5
|
import { isPromise, parseExtendAttr, unionWith } from "../../utils/index"
|
|
6
6
|
import { buildInRequest } from "../../utils/request"
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function getPathVal(obj = {}, path) {
|
|
9
|
+
let paths = path
|
|
10
|
+
if (typeof path === 'string') {
|
|
11
|
+
paths = path.split('.')
|
|
12
|
+
}
|
|
13
|
+
return paths.reduce((ret, key) => {
|
|
14
|
+
if (ret) {
|
|
15
|
+
return ret[key]
|
|
16
|
+
}
|
|
17
|
+
return null
|
|
18
|
+
}, obj) || ''
|
|
19
|
+
}
|
|
20
|
+
function assignmentPathVal(obj = {}, path, val) {
|
|
9
21
|
let paths = path
|
|
10
22
|
if (typeof path === 'string') {
|
|
11
23
|
paths = path.split('.')
|
|
@@ -39,8 +51,8 @@ export async function dispatchClickEvent(service, { dynamicMapComp, requestTrace
|
|
|
39
51
|
reqData = getReqData(service.inParamMappingList || [], {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
|
|
40
52
|
tableConfig = getTableConfig(service.outParamMappingList, { dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat })
|
|
41
53
|
if (tableConfig?.vm) {
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
assignmentPathVal(reqData, service.pageNum || 'pageNum', tableConfig.vm.page?.pageNum)
|
|
55
|
+
assignmentPathVal(reqData, service.pageSize || 'pageSize', tableConfig.vm.page?.pageSize)
|
|
44
56
|
}
|
|
45
57
|
reqData = {
|
|
46
58
|
...reqData,
|
|
@@ -97,7 +109,7 @@ export async function dispatchClickEvent(service, { dynamicMapComp, requestTrace
|
|
|
97
109
|
// ret.data = {result: {pageTotalCount: 100, result: [{},{},{},{},{}]}}
|
|
98
110
|
initOutParamData(service.outParamMappingList, {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat, outResult: ret.data})
|
|
99
111
|
if (tableConfig?.vm) {
|
|
100
|
-
const total = parseInt(ret.data?.result
|
|
112
|
+
const total = parseInt(getPathVal(ret.data?.result || {}, service.pageTotalCount || 'pageCount'))
|
|
101
113
|
tableConfig.vm.page.total = total
|
|
102
114
|
// tableConfig.vm?.changePage(total, 'total')
|
|
103
115
|
}
|
|
@@ -113,7 +125,7 @@ function getReqData(inParamMappingList = [], {dynamicMapComp, dynamicMapCompKeys
|
|
|
113
125
|
const configCode = configCodes[0]
|
|
114
126
|
if (configCode) {
|
|
115
127
|
const destParamArr = destParam?.split('.') || []
|
|
116
|
-
|
|
128
|
+
assignmentPathVal(ret, destParamArr, dynamicMapComp[configCode]?.refValue)
|
|
117
129
|
|
|
118
130
|
// let currentObj = ret
|
|
119
131
|
// destParamArr.forEach((item, idx) => {
|
|
@@ -226,8 +226,8 @@ export default {
|
|
|
226
226
|
}, (length) => {
|
|
227
227
|
let list = []
|
|
228
228
|
if (length) {
|
|
229
|
-
const newVal = tableData
|
|
230
|
-
list = newVal
|
|
229
|
+
const newVal = tableData.value
|
|
230
|
+
list = newVal?.map?.((row, idx) => {
|
|
231
231
|
const columnsCgs = rowColumnConfgsMap.get(row)
|
|
232
232
|
if (columnsCgs) {
|
|
233
233
|
columnsCgs.forEach(config => {
|
package/src/utils/const.js
CHANGED
|
@@ -35,6 +35,7 @@ export const NOT_NEED_FORM_ITEM_META_TYPE = [
|
|
|
35
35
|
'cmi-dropdown-menu',
|
|
36
36
|
'cmi-divider'
|
|
37
37
|
]
|
|
38
|
+
export const EXECTE_CLICK_EVENT_COMPONENTS = ['ElInput', 'ElButton', 'CmiInput', 'CmiButton']
|
|
38
39
|
export const TRANS_CELL_COMPONETS = ['CmiInput', 'CmiSelect']
|
|
39
40
|
export const NOT_NEED_COL_ITEM_META_TYPE = ['CustomComponentTabPane', 'CustomComponentDialog', 'CustomComponentCol', 'CustomComponentTabPaneH5']
|
|
40
41
|
export const MULTI_PAGE_META_LIST_TYPES = ['CustomComponentTable']
|