Revert "style: 更新 Ant Select 样式和高度调整"

This reverts commit 72af0d4976.
This commit is contained in:
rd
2025-09-15 11:57:50 +08:00
parent 72af0d4976
commit afae130304
2 changed files with 27 additions and 29 deletions

View File

@ -15,7 +15,7 @@
@change="handleChange" @change="handleChange"
> >
<Option v-for="(item, index) in options" :key="index" :value="item.id" :label="item.name"> <Option v-for="(item, index) in options" :key="index" :value="item.id" :label="item.name">
<div class="flex items-center h-full"> <div class="flex items-center">
<img v-if="item.icon" :src="item.icon" class="w-16px h-16px mr-8px rounded-4px" /> <img v-if="item.icon" :src="item.icon" class="w-16px h-16px mr-8px rounded-4px" />
{{ item.name }} {{ item.name }}
</div> </div>
@ -48,7 +48,7 @@ const props = defineProps({
maxTagCount: { maxTagCount: {
type: Number, type: Number,
default: 3, default: 3,
}, },
allClear: { allClear: {
type: Boolean, type: Boolean,
default: true, default: true,
@ -56,7 +56,7 @@ const props = defineProps({
allowSearch: { allowSearch: {
type: Boolean, type: Boolean,
default: false, default: false,
}, }
}); });
const emits = defineEmits(['update:modelValue', 'change']); const emits = defineEmits(['update:modelValue', 'change']);
@ -79,4 +79,4 @@ const handleChange = (value) => {
selectedValues.value = value; selectedValues.value = value;
emits('change', value); emits('change', value);
}; };
</script> </script>

View File

@ -5,11 +5,9 @@
border-color: #d7d7d9 !important; border-color: #d7d7d9 !important;
background-color: #fff !important; background-color: #fff !important;
align-items: center; align-items: center;
.ant-select-selection-search-input { .ant-select-selection-search-input {
height: 100% !important; height: 100% !important;
} }
.ant-select-selection-placeholder { .ant-select-selection-placeholder {
color: var(--Text-4, #737478); color: var(--Text-4, #737478);
font-family: $font-family-regular; font-family: $font-family-regular;
@ -18,7 +16,6 @@
font-weight: 400; font-weight: 400;
line-height: 22px; line-height: 22px;
} }
.ant-select-selection-item { .ant-select-selection-item {
color: var(--Text-4, #211f24); color: var(--Text-4, #211f24);
font-family: $font-family-regular; font-family: $font-family-regular;
@ -27,7 +24,6 @@
font-weight: 400; font-weight: 400;
} }
} }
&:focus, &:focus,
&-focused { &-focused {
.ant-select-selector { .ant-select-selector {
@ -36,53 +32,38 @@
box-shadow: 0 0 0 0 var(--color-primary-light-2) !important; box-shadow: 0 0 0 0 var(--color-primary-light-2) !important;
} }
} }
&.ant-select-status-error { &.ant-select-status-error {
border-color: $color-error !important; border-color: $color-error !important;
} }
} }
.ant-select { .ant-select {
.ant-select-selector { .ant-select-selector {
height: 32px !important; height: 32px !important;
.ant-select-selection-item {
height: 32px;
}
} }
&.ant-select-lg { &.ant-select-lg {
.ant-select-selector { .ant-select-selector {
height: 36px !important; height: 36px !important;
.ant-select-selection-item {
height: 36px;
}
} }
} }
&.ant-select-sm { &.ant-select-sm {
.ant-select-selector { .ant-select-selector {
height: 28px !important; height: 28px !important;
.ant-select-selection-item {
height: 28px;
}
} }
} }
&.ant-select-multiple { &.ant-select-multiple {
.ant-select-selector { .ant-select-selector {
min-height: 32px; padding: 0 12px 0 4px !important;
height: fit-content !important;
padding-left: 4px !important;
.ant-select-selection-overflow-item { .ant-select-selection-overflow-item {
.ant-select-selection-item { .ant-select-selection-item {
height: 24px;
line-height: 24px;
border-radius: 4px; border-radius: 4px;
background: #e6e6e8; background: #E6E6E8;
border: none; border: none;
padding: 1px 8px; padding: 1px 8px;
@ -95,19 +76,18 @@
&.ant-select-lg { &.ant-select-lg {
.ant-select-selector { .ant-select-selector {
min-height: 36px;
.ant-select-selection-overflow-item { .ant-select-selection-overflow-item {
.ant-select-selection-item { .ant-select-selection-item {
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
} }
} }
} }
} }
&.ant-select-sm { &.ant-select-sm {
.ant-select-selector { .ant-select-selector {
min-height: 28px;
.ant-select-selection-overflow-item { .ant-select-selection-overflow-item {
.ant-select-selection-item { .ant-select-selection-item {
height: 22px; height: 22px;
@ -117,8 +97,26 @@
font-size: 12px; font-size: 12px;
} }
} }
} }
} }
} }
} }
}
.ant-select.ant-select-single {
.ant-select-selector {
height: 32px !important;
}
&.ant-select-lg {
.ant-select-selector {
height: 36px !important;
}
}
&.ant-select-sm {
.ant-select-selector {
height: 28px !important;
}
}
} }