fix(商品编辑): 规格表格高度与横向滚动布局修复

规格表 height 改 max-height(行少时不被拉高),容器允许 flex 收缩使表格在表单内横向滚动、固定右列正常钉住
This commit is contained in:
吴昊天 2026-10-16 15:15:40 +08:00
parent 5ffb105f0d
commit bafe4f667f
2 changed files with 14 additions and 2 deletions

View File

@ -135,7 +135,7 @@
<el-form-item label="商品属性:" class="labeltop" v-if="manyFormValidate.length">
<el-table
row-key="index"
height="700px"
max-height="700px"
:data="manyFormValidate"
style="width: 100%"
:cell-class-name="tableCellClassName"
@ -669,4 +669,10 @@ function objectSpanMethod({ row, column, rowIndex, columnIndex }) {
</script>
<style lang="scss" scoped>
@use '../productAdd.scss' as *;
// 规格表列合计宽超出表单容器时允许 flex 收缩,让 el-table 在容器内横向滚动、fixed right 列正常钉住
.labeltop {
:deep(.el-table) {
min-width: 0;
}
}
</style>

View File

@ -154,6 +154,7 @@
<el-col :span="24" v-if="formValidate.spec_type === 1">
<el-form-item label="商品属性:" class="labeltop" v-if="manyFormValidate.length">
<VirtualScroll
class="spec-table-scroll"
:data="manyFormValidate"
:buffer="50"
:height="62"
@ -163,7 +164,7 @@
<!-- <el-table row-key="id" :data="virtualList" height="500px"> </el-table> -->
<el-table
row-key="index"
height="700px"
max-height="700px"
:data="manyFormValidate"
style="width: 100%"
:cell-class-name="tableCellClassName"
@ -814,6 +815,11 @@ function objectSpanMethod({ row, column, rowIndex, columnIndex }) {
</script>
<style lang="scss" scoped>
@use '../productAdd.scss' as *;
// 规格表列合计宽超出表单容器时允许 flex 收缩(网盘多规格列多,撑破容器会把固定右列一起推出视口),
// 收缩后 el-table 在容器内横向滚动,fixed right 列正常钉住
.spec-table-scroll {
min-width: 0;
}
// 网盘信息输入组(多规格表格/单规格区共用)
.fictitious-netdisk {
display: flex;