resolver-egretimp-plus 0.0.209 → 0.0.210
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/theme/element/index.css +1 -1
- package/dist/theme/element/src/components/tabs.scss +5 -0
- package/dist/web/index.js +1 -1
- package/package.json +1 -1
- package/src/components/packages-web/CustomComponentCycleTabPane.vue +26 -2
- package/src/components/packages-web/CustomComponentTabPane.vue +20 -2
- package/src/components/packages-web/CustomComponentTabs.vue +4 -2
- package/src/theme/element/components/tabs.scss +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TabPane v-for="(pageMetaList, $index) in (multiPmPageMetaList || [])" v-bind="{...tabPaneProps}" :key="pageMetaListKeys[pageMetaList.id]" :label="`${lang.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn}-${$index}`" :name="`${props.config?.metaCode}-${$index}`">
|
|
3
|
-
<template #label v-if="pageMetaList.filter(config => config.collapseSlot).length">
|
|
4
|
-
<
|
|
3
|
+
<template #label v-if="labelRenderContentFn || pageMetaList.filter(config => config.collapseSlot).length">
|
|
4
|
+
<component :is="labelRenderContentFn(getLableRenderParams(modelValue?.[$index]))" v-if="labelRenderContentFn"></component>
|
|
5
|
+
<Renderer v-else :modelValue="modelValue?.[$index]" :rowScope="{row: modelValue?.[$index], $index}" @update:modelValues="onUpdateModelValue($event, $index)" :config="pageMetaList.filter(config => config.collapseSlot)"></Renderer>
|
|
5
6
|
</template>
|
|
6
7
|
<ElRow>
|
|
7
8
|
<Renderer :modelValue="modelValue?.[$index]" :rowScope="{row: modelValue?.[$index], $index}" @update:modelValues="onUpdateModelValue($event, $index)" :config="pageMetaList.filter(config => !config.collapseSlot)"></Renderer>
|
|
@@ -14,6 +15,7 @@ import Renderer from '../../renderer.jsx'
|
|
|
14
15
|
import { computed, inject, reactive, watch, defineModel, defineProps } from 'vue'
|
|
15
16
|
import { commonPropsType, cloneDeep, definePrivatelyProp } from '../../utils/index.js'
|
|
16
17
|
import { TabPane } from '../tabs'
|
|
18
|
+
import { h } from 'vue'
|
|
17
19
|
|
|
18
20
|
const props = defineProps({
|
|
19
21
|
...commonPropsType,
|
|
@@ -82,6 +84,28 @@ watch(() => {
|
|
|
82
84
|
}, {
|
|
83
85
|
immediate: true
|
|
84
86
|
})
|
|
87
|
+
|
|
88
|
+
// 自定义渲染label方法
|
|
89
|
+
const labelRenderContentFn = computed(() => {
|
|
90
|
+
if (props.config?.labelRender && typeof props.config?.labelRender == 'function') {
|
|
91
|
+
return (params) => {
|
|
92
|
+
const context = props.config?.labelRender?.(params)
|
|
93
|
+
if (typeof context === 'string') {
|
|
94
|
+
return h('span', context)
|
|
95
|
+
} else {
|
|
96
|
+
return context
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
function getLableRenderParams(tabPaneData) {
|
|
104
|
+
return {
|
|
105
|
+
config: props.config,
|
|
106
|
+
tabPaneData
|
|
107
|
+
}
|
|
108
|
+
}
|
|
85
109
|
</script>
|
|
86
110
|
<style lang="scss">
|
|
87
111
|
.el-tabs__item.is-active {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<TabPane v-bind="{...attrs, ...tabPaneProps, ...polyProps}">
|
|
3
|
-
<template #label v-if="slotsPageMetalist.length">
|
|
4
|
-
<
|
|
3
|
+
<template #label v-if="labelRenderContent || slotsPageMetalist.length">
|
|
4
|
+
<component :is="labelRenderContent" v-if="labelRenderContent"></component>
|
|
5
|
+
<Renderer v-else :config="slotsPageMetalist" v-model="props.refValue.value"></Renderer>
|
|
5
6
|
</template>
|
|
6
7
|
<ElRow>
|
|
7
8
|
<Renderer :config="(props.config.pmPageMetaList || []).filter(config => !config.collapseSlot)" v-model="props.refValue.value"></Renderer>
|
|
@@ -14,6 +15,7 @@ import Renderer from '../../renderer.jsx'
|
|
|
14
15
|
import { computed, inject, useAttrs } from 'vue'
|
|
15
16
|
import { commonPropsType } from '../../utils/index.js'
|
|
16
17
|
import { TabPane } from '../tabs'
|
|
18
|
+
import { h } from 'vue'
|
|
17
19
|
|
|
18
20
|
const props = defineProps({
|
|
19
21
|
...commonPropsType,
|
|
@@ -43,4 +45,20 @@ const tabPaneProps = computed(() => {
|
|
|
43
45
|
}
|
|
44
46
|
return ret
|
|
45
47
|
})
|
|
48
|
+
|
|
49
|
+
// 自定义渲染label方法
|
|
50
|
+
const labelRenderContent = computed(() => {
|
|
51
|
+
const context = props.config?.labelRender?.(getLableRenderParams())
|
|
52
|
+
if (typeof context === 'string') {
|
|
53
|
+
return h('span', context)
|
|
54
|
+
} else {
|
|
55
|
+
return context
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
function getLableRenderParams() {
|
|
59
|
+
return {
|
|
60
|
+
config: props.config,
|
|
61
|
+
tabPaneData: props.refValue.value
|
|
62
|
+
}
|
|
63
|
+
}
|
|
46
64
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Tabs :class="[`tabs-level-${level}`, fullBorder ? 'full-border' : '']" v-bind="transTabsProps" v-model="activeNames">
|
|
2
|
+
<Tabs :class="[`tabs-level-${level}`, isHeaderAuto ? 'tabpane-auto-header' : '', fullBorder ? 'full-border' : '']" v-bind="transTabsProps" v-model="activeNames">
|
|
3
3
|
<Renderer :config="tabpanes" v-model="props.refValue.value"></Renderer>
|
|
4
4
|
</Tabs>
|
|
5
5
|
</template>
|
|
@@ -56,7 +56,9 @@ const activeNames = computed({
|
|
|
56
56
|
})
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
|
-
|
|
59
|
+
const isHeaderAuto = computed(() => {
|
|
60
|
+
return props.config.autoHeader == '1'
|
|
61
|
+
})
|
|
60
62
|
const level = computed(() => {
|
|
61
63
|
return props.config.level || tabpanes.value.find(tabpane => hasOwn(tabpane, 'level'))?.level || 1
|
|
62
64
|
})
|