|
@@ -32,8 +32,7 @@ export const autoWidth = (tableData: VxeGridProps, grid: VxeGridInstance) => {
|
|
|
})
|
|
})
|
|
|
// column.title.length > curStr.length && (curStr = column.title)
|
|
// column.title.length > curStr.length && (curStr = column.title)
|
|
|
// 表头的宽度如果小于表格内容的宽度
|
|
// 表头的宽度如果小于表格内容的宽度
|
|
|
- if (width < curStr.length * 11 + 20) {
|
|
|
|
|
- // width = curStr.length * 10 + 20
|
|
|
|
|
|
|
+ if (width < curStr.length * 11) {
|
|
|
if (curStr.length > 20) {
|
|
if (curStr.length > 20) {
|
|
|
width = curStr.length * 9 + 40
|
|
width = curStr.length * 9 + 40
|
|
|
} else {
|
|
} else {
|
|
@@ -44,6 +43,10 @@ export const autoWidth = (tableData: VxeGridProps, grid: VxeGridInstance) => {
|
|
|
// width < 100 && (width = 100)
|
|
// width < 100 && (width = 100)
|
|
|
// 最终宽度不能超过400
|
|
// 最终宽度不能超过400
|
|
|
width > 400 && (width = 400)
|
|
width > 400 && (width = 400)
|
|
|
|
|
+ // 如果字段是Mode,则固定宽度为80
|
|
|
|
|
+ if (field === 'Mode') {
|
|
|
|
|
+ width = 80
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
columnsWidth.push({
|
|
columnsWidth.push({
|
|
|
width,
|
|
width,
|