diff --git a/src/components/EntityPicker.vue b/src/components/EntityPicker.vue index 736829d..36523a5 100644 --- a/src/components/EntityPicker.vue +++ b/src/components/EntityPicker.vue @@ -96,6 +96,15 @@ const paged = computed(() => props.config.paged !== false) /** 占位符:props.placeholder > config.placeholder > 默认 */ const placeholderText = computed(() => props.placeholder || props.config.placeholder || '请选择') +/** + * 浏览面板标题:占位文案本身已以「选择」开头时不再重复前缀 + * (如"选择部门员工关联(按部门分组展示)",否则会变成"选择选择部门员工关联…") + */ +const browseTitle = computed(() => { + const text = placeholderText.value + return /^(请?选择)/.test(text) ? text : `选择${text}` +}) + /** 树分组配置(配置了才启用树形浏览面板) */ const treeGroupConfig = computed(() => props.config.treeGroup || undefined) @@ -566,8 +575,8 @@ onBeforeUnmount(() => { @@ -848,8 +857,8 @@ html.dark { /* 列表:固定高度,内部滚动 */ .entity-picker-browse-list { - min-height: 220px; - max-height: 320px; + min-height: 420px; + max-height: 560px; overflow-y: auto; border: 1px solid var(--el-border-color-light); border-radius: 6px; diff --git a/src/components/MultiEntityPicker.vue b/src/components/MultiEntityPicker.vue index fbe37c4..7f284c6 100644 --- a/src/components/MultiEntityPicker.vue +++ b/src/components/MultiEntityPicker.vue @@ -71,6 +71,15 @@ const value = computed({ const placeholderText = computed(() => props.placeholder || props.config.placeholder || '请选择(可多选)') +/** + * 浏览面板标题:占位文案本身已以「选择」开头时不再重复前缀 + * (否则会变成"选择选择部门员工关联…") + */ +const browseTitle = computed(() => { + const text = placeholderText.value + return /^(请?选择)/.test(text) ? text : `选择${text}` +}) + // ===== 主下拉选项 ===== const options = ref([]) const loading = ref(false) @@ -379,8 +388,8 @@ onBeforeUnmount(() => { @@ -595,8 +604,8 @@ html.dark { } .multi-entity-picker-browse-list { - min-height: 220px; - max-height: 320px; + min-height: 420px; + max-height: 560px; overflow-y: auto; border: 1px solid var(--el-border-color-light); border-radius: 6px;