resolver-egretimp-plus 0.1.39 → 0.1.40
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/theme/element/index.css +1 -1
- package/dist/theme/element/src/components/form.scss +7 -0
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/components/packages-H5/CustomComponentTabPaneH5.vue +7 -3
- package/src/components/packages-H5/CustomComponentTabsH5.vue +25 -12
- package/src/rules/parseCondition.js +0 -1
- package/src/theme/element/components/form.scss +7 -0
- package/src/utils/render.jsx +8 -1
package/package.json
CHANGED
|
@@ -9,9 +9,13 @@ const props = defineProps({
|
|
|
9
9
|
const attrs = useAttrs()
|
|
10
10
|
const tabProps = computed(() => {
|
|
11
11
|
return {
|
|
12
|
-
label:
|
|
12
|
+
label: props?.config?.hidden == '1' ?
|
|
13
|
+
'' :
|
|
14
|
+
lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
|
|
13
15
|
name: props.config?.metaCode,
|
|
14
|
-
disabled: props
|
|
16
|
+
disabled: props?.config?.hidden == '1' ?
|
|
17
|
+
true :
|
|
18
|
+
props.config?.editFlag == '0'
|
|
15
19
|
}
|
|
16
20
|
})
|
|
17
21
|
const modelValue = defineModel()
|
|
@@ -22,7 +26,7 @@ const pmPageMetaList = computed(() => {
|
|
|
22
26
|
</script>
|
|
23
27
|
|
|
24
28
|
<template>
|
|
25
|
-
<cmi-tab-content
|
|
29
|
+
<cmi-tab-content v-bind="{...attrs, ...tabProps}" :style="props.config?.style">
|
|
26
30
|
<slot>
|
|
27
31
|
<Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
|
|
28
32
|
</slot>
|
|
@@ -19,26 +19,36 @@ const activeNames = computed({
|
|
|
19
19
|
get() {
|
|
20
20
|
const currentTab = tabpanes.value.find(tab => tab.defaultShowFlag == '1')
|
|
21
21
|
const currentCycleTab = tabpanes.value.find(tab => tab.currentCode)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
if (currentTab) {
|
|
23
|
+
return currentTab?.isCycle == '1' ? `${currentTab.metaCode}-0` : currentTab.metaCode
|
|
24
|
+
}
|
|
25
|
+
if (currentCycleTab) {
|
|
26
|
+
return currentCycleTab.currentCode
|
|
27
|
+
}
|
|
28
|
+
if (tabpanes.value[0]) {
|
|
29
|
+
if (assertMetaType(tabpanes.value[0], 'CustomComponentCycleTabPaneH5') || tabpanes.value[0]?.isCycle == '1') {
|
|
30
|
+
return `${tabpanes.value[0].metaCode}-0`
|
|
31
|
+
} else {
|
|
32
|
+
return tabpanes.value[0].metaCode
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
},
|
|
26
36
|
set(val) {
|
|
27
37
|
tabpanes.value.forEach(tab => {
|
|
28
|
-
if (tab
|
|
38
|
+
if (assertMetaType(tab, 'CustomComponentCycleTabPaneH5') || tab?.isCycle == '1') {
|
|
39
|
+
if (/^cycleTabpane-(\d+)$/.test(val)) {
|
|
40
|
+
tab.currentCode = val
|
|
41
|
+
} else {
|
|
42
|
+
tab.currentCode = ''
|
|
43
|
+
}
|
|
44
|
+
} else if (tab.metaType === 'CustomComponentTabPaneH5') {
|
|
29
45
|
if (tab.metaCode === val) {
|
|
30
46
|
tab.defaultShowFlag = '1'
|
|
31
47
|
} else {
|
|
32
48
|
tab.defaultShowFlag = '0'
|
|
33
49
|
}
|
|
34
50
|
}
|
|
35
|
-
|
|
36
|
-
if (new RegExp(`^${tab.metaCode}-(\d+)$`).test(val)) {
|
|
37
|
-
tab.currentCode = val
|
|
38
|
-
} else {
|
|
39
|
-
tab.currentCode = ''
|
|
40
|
-
}
|
|
41
|
-
}
|
|
51
|
+
|
|
42
52
|
})
|
|
43
53
|
}
|
|
44
54
|
})
|
|
@@ -77,11 +87,14 @@ const customClass = computed(() => {
|
|
|
77
87
|
}
|
|
78
88
|
})
|
|
79
89
|
|
|
90
|
+
function assertMetaType(config, metaType) {
|
|
91
|
+
return config.renderby === metaType || config.metaType === metaType
|
|
92
|
+
}
|
|
80
93
|
</script>
|
|
81
94
|
|
|
82
95
|
<template>
|
|
83
96
|
<cmi-tabs :class="customClass" v-bind="{...attrs, ...tabProps}">
|
|
84
|
-
<CustomComponentTabPaneH5
|
|
97
|
+
<CustomComponentTabPaneH5
|
|
85
98
|
v-for="tabpane in tabpanes" :config="tabpane" :key="tabpane.metaId"
|
|
86
99
|
>
|
|
87
100
|
<Renderer :config="tabpane?.pmPageMetaList || []" :additionConfigs="[tabpane]" :modelValue="getValue(tabpane.metaCode)" @update:modelValue="(val) => { onUpdateModelValue(val, tabpane.metaCode) }"></Renderer>
|
package/src/utils/render.jsx
CHANGED
|
@@ -710,7 +710,9 @@ function generateFormItemPc (config, lang, compProps, params,) {
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
|
|
713
|
-
const slots = {
|
|
713
|
+
const slots = {
|
|
714
|
+
error: (info) => createFormLabelErrorTip(info, config, lang)
|
|
715
|
+
}
|
|
714
716
|
slots[slotName] = () => node
|
|
715
717
|
if (isFormItem && slotName !== 'label') {
|
|
716
718
|
slots.label = () => createFormLable(config, lang)
|
|
@@ -987,6 +989,11 @@ function createFormLable(config, lang = 'zh') {
|
|
|
987
989
|
</div>
|
|
988
990
|
)
|
|
989
991
|
}
|
|
992
|
+
function createFormLabelErrorTip(info, config, lang='zh') {
|
|
993
|
+
return (
|
|
994
|
+
<span title={info.error} class="el-form-item__error polyfill-form-item_error">{info.error}</span>
|
|
995
|
+
)
|
|
996
|
+
}
|
|
990
997
|
|
|
991
998
|
export function getComponentPropsKeys(comp, config) {
|
|
992
999
|
let propsKeys = []
|