resolver-egretimp-plus 0.0.219 → 0.0.220
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
|
@@ -63,9 +63,9 @@ const rootInstance = inject('_rootInstance', {})
|
|
|
63
63
|
|
|
64
64
|
const routeQuery= route?.query
|
|
65
65
|
|
|
66
|
-
const buttonAction = (
|
|
66
|
+
const buttonAction = (e, params) => {
|
|
67
67
|
const lastClick = () => {
|
|
68
|
-
attrs?.onClick?.(
|
|
68
|
+
attrs?.onClick?.(e, params) // 如果配置中有点击事件
|
|
69
69
|
}
|
|
70
70
|
const actionKey = props.config?.clickActionKey || props.config?.buttonActionKey || props.config?.hireRelat
|
|
71
71
|
const actionFn = buttonActions[actionKey]
|
|
@@ -103,6 +103,12 @@ const buttonAction = (...arg) => {
|
|
|
103
103
|
lastClick()
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
defineExpose({
|
|
108
|
+
click: (params) => {
|
|
109
|
+
buttonAction(null, params)
|
|
110
|
+
}
|
|
111
|
+
})
|
|
106
112
|
</script>
|
|
107
113
|
|
|
108
114
|
<template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import Renderer from '../../renderer.jsx'
|
|
3
|
-
import { computed, inject, useAttrs, defineEmits, defineProps, ref } from 'vue'
|
|
4
|
-
import { commonPropsType, DISPLAY_HIDDEN } from '../../utils/index.js'
|
|
3
|
+
import { computed, inject, useAttrs, defineEmits, defineProps, ref, watch } from 'vue'
|
|
4
|
+
import { commonPropsType, DISPLAY_HIDDEN, hasOwn } from '../../utils/index.js'
|
|
5
5
|
|
|
6
6
|
defineOptions({
|
|
7
7
|
inheritAttrs: false
|
|
@@ -27,14 +27,35 @@ const collapseProps = computed(() => {
|
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
const pmPageMetaList = computed(() => {
|
|
30
|
-
return props.config?.pmPageMetaList
|
|
30
|
+
return props.config?.pmPageMetaList || []
|
|
31
31
|
})
|
|
32
|
+
|
|
33
|
+
const showPageMeteList = computed(() => {
|
|
34
|
+
return pmPageMetaList.value.filter(item => item.displayType != DISPLAY_HIDDEN && item.hidden != '1')
|
|
35
|
+
})
|
|
36
|
+
|
|
32
37
|
const showCollapseBtn = computed(() => {
|
|
33
|
-
return
|
|
38
|
+
return showPageMeteList.value?.length > collapseLimt.value
|
|
34
39
|
})
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
|
|
41
|
+
// 定位到最后显示的组件在折叠组件中的索引
|
|
42
|
+
const lasetLimitIdx = computed(() => {
|
|
43
|
+
const limt = isCollapse.value ? collapseLimt.value : Number.MAX_VALUE
|
|
44
|
+
return pmPageMetaList.value?.findIndex(item => item == showPageMeteList.value[limt - 1])
|
|
37
45
|
})
|
|
46
|
+
|
|
47
|
+
// 通过监听最后一个显示组件的索引,控制那些组件隐藏(通过collapseHidden控制隐藏)
|
|
48
|
+
watch(lasetLimitIdx, (val) => {
|
|
49
|
+
pmPageMetaList.value?.forEach((item, index) => {
|
|
50
|
+
item.collapseHidden = '0'
|
|
51
|
+
if (val > -1 && index > val) {
|
|
52
|
+
item.collapseHidden = '1'
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}, {
|
|
56
|
+
immediate: true
|
|
57
|
+
})
|
|
58
|
+
|
|
38
59
|
const collapseLabel = computed(() => {
|
|
39
60
|
const isCh = lang?.value?.indexOf('zh') > -1
|
|
40
61
|
return isCollapse.value ? (isCh ? '更多' : 'More') : (isCh ? '收起' : 'Close')
|
|
@@ -48,7 +69,7 @@ function toCollapse() {
|
|
|
48
69
|
<div :style="attrs.style">
|
|
49
70
|
<cmi-collapse v-bind="{...attrs, ...collapseProps}">
|
|
50
71
|
<div class="render-wrap">
|
|
51
|
-
<Renderer :config="
|
|
72
|
+
<Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
|
|
52
73
|
</div>
|
|
53
74
|
<div v-if="showCollapseBtn" class="collapse-wrap">
|
|
54
75
|
<cmi-button type="text" size="small" @click="toCollapse">
|
package/src/utils/render.jsx
CHANGED
|
@@ -971,7 +971,7 @@ function isTransCellMobile(config, disabled) {
|
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
function isHidden({config}) {
|
|
974
|
-
return (typeof config.hidden === 'boolean' && config.hidden) || config.hidden === '1'
|
|
974
|
+
return (typeof config.hidden === 'boolean' && config.hidden) || config.hidden === '1' || config.collapseHidden == '1'
|
|
975
975
|
}
|
|
976
976
|
// 如果父级有一个是hidden了,那就表示hidden了
|
|
977
977
|
function isChainHidden({config}) {
|