feat(ui): 重构高级搜索组件并优化布局

- 重构 AiPullDown 组件,使用 v-model 实现双向绑定
- 优化 AiSearchBar 组件样式和布局
- 调整 AiPage 组件中的滚动条样式
This commit is contained in:
aixianling
2024-12-24 17:08:43 +08:00
parent ae83152271
commit 225c0088e1
3 changed files with 50 additions and 29 deletions

View File

@@ -14,8 +14,11 @@
export default {
name: "AiPullDown",
props: {
target: String,
height: {default: 4},
value: Boolean,
},
model: {
prop: 'value',
event: 'expand'
},
data() {
return {
@@ -25,32 +28,34 @@ export default {
methods: {
handleExpand() {
this.expand = !this.expand
if (this.target) {
} else this.$emit('change', this.expandStyle)
}
},
computed: {
btnText() {
return this.expand ? '收起高级搜索' : '展开高级搜索'
},
expandStyle() {
let initStyle = {overflow: 'hidden', height: `${this.height}px`}
this.expand && (initStyle.height = "auto")
return initStyle
return this.expand ? '收起' : '展开'
},
expandIcon() {
return this.expand ? 'iconfont iconDouble_Up' : 'iconfont iconDouble_Down'
}
},
mounted() {
this.$emit("change", this.expandStyle)
watch: {
expand: {
immediate: true, handler(v) {
this.$emit('expand', v)
}
}
}
}
</script>
<style lang="scss" scoped>
.AiPullDown {
display: flex;
position: absolute;
left: 0;
right: 0;
bottom: 24px;
transform: translateY(100%);
background-color: #fff;
.line {
flex: 1;