forked from github/dataease
Merge pull request #6864 from dataease/pr@dev@fix_echarts_table_index_column
fix(视图-echarts表格): 修复序号列宽度调整无效
This commit is contained in:
commit
c1df24d08b
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user