Merge pull request #6864 from dataease/pr@dev@fix_echarts_table_index_column

fix(视图-echarts表格): 修复序号列宽度调整无效
This commit is contained in:
wisonic-s 2023-11-27 14:38:08 +08:00 committed by GitHub
commit c1df24d08b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@
<ux-table-column
type="index"
:title="indexLabel"
:width="columnWidth"
/>
<ux-table-column
v-for="field in fields"
@ -302,8 +303,9 @@ export default {
// column width
const containerWidth = this.$refs.tableContainer.offsetWidth
const columnWidth = attr.size.tableColumnWidth ? attr.size.tableColumnWidth : this.columnWidth
if (columnWidth < (containerWidth / this.fields.length)) {
this.columnWidth = containerWidth / this.fields
const fieldsLength = attr.size.showIndex ? this.fields.length + 1 : this.fields.length
if (columnWidth < (containerWidth / fieldsLength)) {
this.columnWidth = containerWidth / fieldsLength
} else {
this.columnWidth = columnWidth
}