Skip to content

Commit 0fb9b9d

Browse files
dataeaseShuxuwei-fit2cloud
authored andcommitted
fix(查询组件): 多选优化
1 parent c374fa1 commit 0fb9b9d

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

core/core-frontend/src/custom-component/v-query/Component.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ const autoStyle = computed(() => {
914914
position: relative;
915915
--ed-font-size-base: v-bind(boxWidth);
916916
917-
:deep(.ed-select-v2 .ed-select-v2__selection .ed-tag) {
917+
:deep(.ed-select-v2 .ed-select-v2__selection .ed-tag),
918+
:deep(.select-trigger .ed-select__tags .ed-tag) {
918919
background-color: v-bind(tagColor);
919920
}
920921

core/core-frontend/src/custom-component/v-query/Select.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@ onMounted(() => {
638638
Boolean(document.querySelector('.datav-preview'))
639639
})
640640
641+
const tagWidth = computed(() => {
642+
return Math.min(getCustomWidth() / 3, 40) + 'px'
643+
})
644+
645+
const tagTextWidth = computed(() => {
646+
return Math.min(getCustomWidth() / 3, 50) - 25 + 'px'
647+
})
648+
641649
defineExpose({
642650
displayTypeChange,
643651
mult,
@@ -730,3 +738,15 @@ defineExpose({
730738
}
731739
}
732740
</style>
741+
742+
<style lang="less" scoped>
743+
:deep(.ed-select-v2__selection) {
744+
.ed-tag {
745+
max-width: v-bind(tagWidth);
746+
}
747+
748+
.ed-select__tags-text {
749+
max-width: v-bind(tagTextWidth) !important;
750+
}
751+
}
752+
</style>

core/core-frontend/src/custom-component/v-query/Tree.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ const init = () => {
135135
getTreeOption()
136136
}
137137
138+
const tagWidth = computed(() => {
139+
return Math.min(getCustomWidth() / 3, 50) + 'px'
140+
})
141+
142+
const tagsWidth = computed(() => {
143+
return getCustomWidth() - 40 + 'px'
144+
})
145+
146+
const tagTextWidth = computed(() => {
147+
return Math.min(getCustomWidth() / 3, 50) - 25 + 'px'
148+
})
149+
138150
const showOrHide = ref(true)
139151
const queryConditionWidth = inject('com-width', Function, true)
140152
const isConfirmSearch = inject('is-confirm-search', Function, true)
@@ -314,4 +326,15 @@ const selectStyle = computed(() => {
314326
:deep(.ed-select-tags-wrapper) {
315327
display: inline-flex !important;
316328
}
329+
330+
:deep(.ed-select__tags) {
331+
max-width: v-bind(tagsWidth) !important;
332+
.ed-tag {
333+
max-width: v-bind(tagWidth);
334+
}
335+
336+
.ed-select__tags-text {
337+
max-width: v-bind(tagTextWidth) !important;
338+
}
339+
}
317340
</style>

0 commit comments

Comments
 (0)