resolver-egretimp-plus 0.1.102 → 0.1.104
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 +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/analysisComponent.jsx +10 -3
- package/src/components/helper/eventOrchestration.js +3 -3
- package/src/components/helper/resolver.js +0 -1
- package/src/components/packages-H5/CmiPicker.vue +38 -4
- package/src/components/packages-H5/CustomComponentTableH5.vue +18 -0
- package/src/components/packages-web/ElInput.jsx +0 -1
- package/src/hooks/index.js +20 -8
- package/src/utils/render.jsx +11 -3
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, defineAsyncComponent, getCurrentInstance, inject, onBeforeMount, provide, ref, watch } from 'vue'
|
|
2
|
-
import { commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, getComponentSolt, hasOwn, isPlainObject } from './utils/index.js'
|
|
2
|
+
import { COFNGI_KEY_EVENT_FLAG, commonPropsType, definePrivatelyProp, EXECTE_CLICK_EVENT_COMPONENTS, findComponent, getComponentPropsKeys, getComponentSolt, hasOwn, isPlainObject } 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'
|
|
@@ -191,7 +191,14 @@ export default {
|
|
|
191
191
|
const obj = {}
|
|
192
192
|
fnComponentkeys.value.forEach(key => {
|
|
193
193
|
if (hasOwn(props.config, key)) {
|
|
194
|
-
|
|
194
|
+
const config = props.config
|
|
195
|
+
if (COFNGI_KEY_EVENT_FLAG.test(key) && typeof config[key] === 'function') {
|
|
196
|
+
obj[key] = function(...arg) {
|
|
197
|
+
return config[key](...arg, vm)
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
obj[key] = config[key]
|
|
201
|
+
}
|
|
195
202
|
}
|
|
196
203
|
})
|
|
197
204
|
return obj
|
|
@@ -303,7 +310,7 @@ export default {
|
|
|
303
310
|
})
|
|
304
311
|
return () => {
|
|
305
312
|
const componentProps = getFncomponentProps()
|
|
306
|
-
const compProps = getRenderComponentProps({config: props.config, props, component: props.component, modelValue, selects, lang: lang.value})
|
|
313
|
+
const compProps = getRenderComponentProps({config: props.config, props, component: props.component, modelValue, selects, lang: lang.value, vm: instance.proxy})
|
|
307
314
|
const compPropsOnClick = compProps?.onClick
|
|
308
315
|
delete compProps.onClick
|
|
309
316
|
const formItemPolyfill = generateFormItemPolyfill(props.config, lang.value, compProps, _isH5?.value, {
|
|
@@ -266,7 +266,7 @@ export function getTableConfig(outParamMappingList = [], { dynamicMapComp, dynam
|
|
|
266
266
|
const configCode = configCodes[0]
|
|
267
267
|
if (configCode) {
|
|
268
268
|
const compConfig = dynamicMapComp[configCode]
|
|
269
|
-
if (compConfig.metaType === 'CustomComponentTable') {
|
|
269
|
+
if (compConfig.metaType === 'CustomComponentTable' || compConfig.metaType === 'CustomComponentTableH5') {
|
|
270
270
|
return compConfig
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -312,8 +312,8 @@ export function openDailg({
|
|
|
312
312
|
orignParam,
|
|
313
313
|
}
|
|
314
314
|
}) || []
|
|
315
|
-
let mapList = {}
|
|
316
|
-
let selectionsObj = {}
|
|
315
|
+
let mapList = {} // 在返回的是list的数据的时候,我们支持返回数据的key跟父页面的编码不一致,所以这里需要做一个映射
|
|
316
|
+
let selectionsObj = {} // 打开弹框的时候,如果是多选表格数据,这个的作用就是回显已经选择的数据(list数据需要选择主键,也就是primaryKeyFlag)
|
|
317
317
|
|
|
318
318
|
if (isList ) {
|
|
319
319
|
const primaryKeys = []
|
|
@@ -76,7 +76,6 @@ export async function executeLoadServices(services = [], {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
|
|
80
79
|
const ret = await (axiosInstance.value && axiosInstance.value(reqConfig))
|
|
81
80
|
if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
|
|
82
81
|
respCb && respCb(ret?.data?.result)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, defineProps, inject, ref, useAttrs, watch } from 'vue'
|
|
2
|
+
import { computed, defineProps, inject, onMounted, ref, useAttrs, watch } from 'vue'
|
|
3
3
|
import { commonPropsType } from '../../utils/index.js'
|
|
4
4
|
|
|
5
5
|
const filterKey = ref('')
|
|
@@ -145,9 +145,41 @@ watch(open, (val) => {
|
|
|
145
145
|
}, {
|
|
146
146
|
immediate: true
|
|
147
147
|
})
|
|
148
|
+
|
|
148
149
|
function filterChange(e) {
|
|
149
150
|
filterKey.value = e.detail.value
|
|
150
151
|
}
|
|
152
|
+
|
|
153
|
+
onMounted(() => {
|
|
154
|
+
// 支持过滤的时候,因为是上下层级结构,默认情况下头部的高被限制住了,会显示不全,所以这边需要进行webComponent中样式修改
|
|
155
|
+
watch(isFilter, (() => {
|
|
156
|
+
let oldTop = null
|
|
157
|
+
let oldBottom = null
|
|
158
|
+
return (val) => {
|
|
159
|
+
const pickerContentDom = pickerRef.value.shadowRoot?.querySelector('.cmi-picker-content')
|
|
160
|
+
if (pickerContentDom) {
|
|
161
|
+
if (val) {
|
|
162
|
+
const tabStyles = window.getComputedStyle(pickerContentDom)
|
|
163
|
+
oldTop = tabStyles.top
|
|
164
|
+
oldBottom = tabStyles.bottom
|
|
165
|
+
pickerContentDom.style.top = '24vw'
|
|
166
|
+
pickerContentDom.style.bottom = '10.2vw'
|
|
167
|
+
} else {
|
|
168
|
+
if (oldTop) {
|
|
169
|
+
pickerContentDom.style.top = oldTop
|
|
170
|
+
}
|
|
171
|
+
if (oldBottom) {
|
|
172
|
+
pickerContentDom.style.bottom = oldBottom
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
})(), {
|
|
179
|
+
immediate: true
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
})
|
|
151
183
|
</script>
|
|
152
184
|
|
|
153
185
|
<template>
|
|
@@ -182,14 +214,16 @@ function filterChange(e) {
|
|
|
182
214
|
.filter-header-wrap {
|
|
183
215
|
display: flex;
|
|
184
216
|
justify-content: flex-start;
|
|
185
|
-
align-items:
|
|
217
|
+
align-items: start;
|
|
218
|
+
flex-direction: column;
|
|
186
219
|
width: 100%;
|
|
187
220
|
.filte-title {
|
|
188
|
-
|
|
221
|
+
margin-bottom: 6px;
|
|
222
|
+
// max-width: 50%;
|
|
189
223
|
}
|
|
190
224
|
.filter-input {
|
|
191
225
|
flex: 1;
|
|
192
|
-
margin-left: 16px;
|
|
226
|
+
// margin-left: 16px;
|
|
193
227
|
}
|
|
194
228
|
}
|
|
195
229
|
</style>
|
|
@@ -114,6 +114,11 @@ watch(() => page.pageNum, (val) => {
|
|
|
114
114
|
modelValue.value = ret
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
|
|
118
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== start ======
|
|
119
|
+
const serviceFn = props.config?.serviceCurrentChange
|
|
120
|
+
serviceFn?.(val, props, page)
|
|
121
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== end ======
|
|
117
122
|
})
|
|
118
123
|
// 页面大小变动
|
|
119
124
|
watch(() => page.pageSize, (val) => {
|
|
@@ -128,6 +133,11 @@ watch(() => page.pageSize, (val) => {
|
|
|
128
133
|
modelValue.value = ret
|
|
129
134
|
}
|
|
130
135
|
}
|
|
136
|
+
|
|
137
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== start ======
|
|
138
|
+
const serviceFn = props.config?.serviceSizeChange
|
|
139
|
+
serviceFn?.(val, props, page)
|
|
140
|
+
// 以下是配置的点击事件服务所绑定的调用方法 ==== end ======
|
|
131
141
|
})
|
|
132
142
|
|
|
133
143
|
const pmPageMetaList = computed(() => {
|
|
@@ -301,6 +311,14 @@ function normalTableRowValue(row) {
|
|
|
301
311
|
})
|
|
302
312
|
return ret
|
|
303
313
|
}
|
|
314
|
+
|
|
315
|
+
defineExpose({
|
|
316
|
+
page,
|
|
317
|
+
changePage: (val, key) => {
|
|
318
|
+
page[key || 'pageNum'] = val
|
|
319
|
+
},
|
|
320
|
+
})
|
|
321
|
+
|
|
304
322
|
</script>
|
|
305
323
|
<template>
|
|
306
324
|
<div>
|
package/src/hooks/index.js
CHANGED
|
@@ -63,7 +63,7 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
|
63
63
|
}
|
|
64
64
|
const modelValue = props.modelValue
|
|
65
65
|
const metaCode = metaCodeKey
|
|
66
|
-
if (!metaCode) return
|
|
66
|
+
// if (!metaCode) return
|
|
67
67
|
if (!modelValue) {
|
|
68
68
|
// frameSet 表示的是一帧之内重复设置对应metaCode的值
|
|
69
69
|
// 一帧之内重复设置metaCode的值需要进行merge,也就是下面modelValueDeepMerge走的逻辑
|
|
@@ -76,23 +76,35 @@ export function useVModel(config, props, emit, modelKey = 'update:modelValue') {
|
|
|
76
76
|
nextTick(() => {
|
|
77
77
|
config.parent && (config.parent.frameSet = false)
|
|
78
78
|
})
|
|
79
|
-
|
|
79
|
+
let updateValue = {
|
|
80
80
|
[metaCode]: val
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
|
+
if (!metaCode) {
|
|
83
|
+
updateValue = val
|
|
84
|
+
}
|
|
85
|
+
emit('update:modelValue', updateValue)
|
|
82
86
|
} else {
|
|
87
|
+
let updateValue = modelValue?.[metaCode]
|
|
83
88
|
if (config?.frameSet) {
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
if (!metaCode) {
|
|
90
|
+
updateValue = modelValue
|
|
91
|
+
}
|
|
92
|
+
if (updateValue) {
|
|
93
|
+
if (typeof updateValue === 'object' || typeof val === 'object') {
|
|
94
|
+
val = modelValueDeepMerge(updateValue, val)
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
|
-
if (isNonRefType(
|
|
98
|
+
if (isNonRefType(updateValue) && isNonRefType(val) && updateValue === val) {
|
|
91
99
|
// 这边的值没有变,就不用出触发下面的其他动作了
|
|
92
100
|
return
|
|
93
101
|
}
|
|
94
102
|
try {
|
|
95
|
-
|
|
103
|
+
if (!metaCode) {
|
|
104
|
+
props.modelValue = val
|
|
105
|
+
} else {
|
|
106
|
+
props.modelValue[metaCode] = val
|
|
107
|
+
}
|
|
96
108
|
} catch (error) {
|
|
97
109
|
console.log('config', config, metaCode)
|
|
98
110
|
}
|
package/src/utils/render.jsx
CHANGED
|
@@ -37,6 +37,8 @@ import loadModule from './loadModule.js'
|
|
|
37
37
|
import { h } from 'vue'
|
|
38
38
|
import dayjs from 'dayjs'
|
|
39
39
|
|
|
40
|
+
export const COFNGI_KEY_EVENT_FLAG = /^on[A-Z]/
|
|
41
|
+
|
|
40
42
|
// 解析配置中的defStyle属性
|
|
41
43
|
export function parseDefStyle(defStyle) {
|
|
42
44
|
try {
|
|
@@ -453,7 +455,7 @@ export function getComponentForConfig({messageInstance, config, disabled, getNat
|
|
|
453
455
|
}
|
|
454
456
|
|
|
455
457
|
// 获取渲染组件的props配置数据
|
|
456
|
-
export function getRenderComponentProps({ props, component, modelValue, selects, lang }) {
|
|
458
|
+
export function getRenderComponentProps({ props, component, modelValue, selects, lang, vm }) {
|
|
457
459
|
if (!component) return {}
|
|
458
460
|
let config = props.config
|
|
459
461
|
if (findComponent(['CustomComponentTabs'], config.renderby || config.metaType) !== -1) {
|
|
@@ -472,7 +474,13 @@ export function getRenderComponentProps({ props, component, modelValue, selects,
|
|
|
472
474
|
if (propsKeys) {
|
|
473
475
|
propsKeys.forEach(key => {
|
|
474
476
|
if (hasOwn(config, key)) {
|
|
475
|
-
|
|
477
|
+
if (COFNGI_KEY_EVENT_FLAG.test(key) && typeof config[key] === 'function') {
|
|
478
|
+
defprops[key] = function(...arg) {
|
|
479
|
+
return config[key](...arg, vm)
|
|
480
|
+
}
|
|
481
|
+
} else {
|
|
482
|
+
defprops[key] = config[key]
|
|
483
|
+
}
|
|
476
484
|
}
|
|
477
485
|
})
|
|
478
486
|
}
|
|
@@ -1025,7 +1033,7 @@ export function getComponentPropsKeys(comp, config) {
|
|
|
1025
1033
|
let emitsKyes = []
|
|
1026
1034
|
if (config) {
|
|
1027
1035
|
Object.keys(config).forEach(key => {
|
|
1028
|
-
if (
|
|
1036
|
+
if (COFNGI_KEY_EVENT_FLAG.test(key) && !['onVnodeMounted'].includes(key)) {
|
|
1029
1037
|
emitsKyes.push(key)
|
|
1030
1038
|
}
|
|
1031
1039
|
})
|