Files
dvcp_v2_webapp/ui/packages/layout/AiSearchBar.vue
aixianling 67c4c8032e style(layout): 调整搜索栏左侧区域高度
- 将 .left 类的 height 属性从3px
- 此调整旨在 32px 修改为 3优化搜索栏的视觉效果和布局
2024-12-27 16:48:33 +08:00

98 lines
1.6 KiB
Vue

<template>
<section class="AiSearchBar" :class="{bottomBorder,isSingleRow,expand}">
<div class="left">
<div class="flex wrap content">
<slot name="left"/>
</div>
</div>
<div class="right" v-if="$slots.right">
<slot name="right"/>
</div>
<ai-pull-down v-if="!isSingleRow" v-model="expand"/>
</section>
</template>
<script>
export default {
name: "AiSearchBar",
props: {
bottomBorder: Boolean,
size: {default: "small"}
},
computed: {
isSingleRow: v => v.height <= 45
},
data() {
return {
height: 0,
expand: false
}
},
mounted() {
this.height = this.$el.querySelector(".left .content").getBoundingClientRect().height
},
}
</script>
<style lang="scss" scoped>
.AiSearchBar {
display: grid;
gap: 10px;
grid-template-columns: 1fr auto;
padding-bottom: 32px;
position: relative;
height: 64px;
overflow: hidden;
&.isSingleRow {
height: 44px;
padding-bottom: 12px;
}
&.bottomBorder {
border-bottom: 1px solid #eee;
}
&.expand {
height: auto;
.left{
height: auto;
}
}
.left {
padding-top: 1px;
height: 33px;
overflow: hidden;
.content {
gap: 8px;
}
}
:deep(.right ) {
display: flex;
align-items: center;
flex-shrink: 0;
align-self: flex-start;
width: 280px;
.el-input {
width: 280px;
}
* + button, * + div, * + section {
margin-left: 8px;
}
}
.el-input {
width: auto;
}
}
:deep( .searchLeftZone > .el-button), :deep( .searchRightZone > .el-button ) {
margin-left: 0;
}
</style>