fix(查询组件): 多选优化

This commit is contained in:
dataeaseShu
2025-04-29 15:32:31 +08:00
committed by xuwei-fit2cloud
parent c374fa1d93
commit 0fb9b9d135
3 changed files with 45 additions and 1 deletions

View File

@@ -914,7 +914,8 @@ const autoStyle = computed(() => {
position: relative;
--ed-font-size-base: v-bind(boxWidth);
:deep(.ed-select-v2 .ed-select-v2__selection .ed-tag) {
:deep(.ed-select-v2 .ed-select-v2__selection .ed-tag),
:deep(.select-trigger .ed-select__tags .ed-tag) {
background-color: v-bind(tagColor);
}

View File

@@ -638,6 +638,14 @@ onMounted(() => {
Boolean(document.querySelector('.datav-preview'))
})
const tagWidth = computed(() => {
return Math.min(getCustomWidth() / 3, 40) + 'px'
})
const tagTextWidth = computed(() => {
return Math.min(getCustomWidth() / 3, 50) - 25 + 'px'
})
defineExpose({
displayTypeChange,
mult,
@@ -730,3 +738,15 @@ defineExpose({
}
}
</style>
<style lang="less" scoped>
:deep(.ed-select-v2__selection) {
.ed-tag {
max-width: v-bind(tagWidth);
}
.ed-select__tags-text {
max-width: v-bind(tagTextWidth) !important;
}
}
</style>

View File

@@ -135,6 +135,18 @@ const init = () => {
getTreeOption()
}
const tagWidth = computed(() => {
return Math.min(getCustomWidth() / 3, 50) + 'px'
})
const tagsWidth = computed(() => {
return getCustomWidth() - 40 + 'px'
})
const tagTextWidth = computed(() => {
return Math.min(getCustomWidth() / 3, 50) - 25 + 'px'
})
const showOrHide = ref(true)
const queryConditionWidth = inject('com-width', Function, true)
const isConfirmSearch = inject('is-confirm-search', Function, true)
@@ -314,4 +326,15 @@ const selectStyle = computed(() => {
:deep(.ed-select-tags-wrapper) {
display: inline-flex !important;
}
:deep(.ed-select__tags) {
max-width: v-bind(tagsWidth) !important;
.ed-tag {
max-width: v-bind(tagWidth);
}
.ed-select__tags-text {
max-width: v-bind(tagTextWidth) !important;
}
}
</style>