|
|
@@ -16,13 +16,15 @@ export const autoWidth = (tableData: VxeGridProps, grid: VxeGridInstance, custom
|
|
|
let curStr = ''
|
|
|
let width = 0
|
|
|
const field = column.field
|
|
|
+ const language = localStorage.getItem('lang') || 'English'
|
|
|
+ const isChinese = language === 'Chinese (Simplified)' || language === 'Chinese (Traditional)'
|
|
|
// 判断表头的宽度
|
|
|
if (column.title.length < 12) {
|
|
|
- width = column.title.length * 11 + 40
|
|
|
+ width = column.title.length * (isChinese ? 14 : 11) + 40
|
|
|
} else if (column.title.length < 20) {
|
|
|
- width = column.title.length * 10 + 30
|
|
|
+ width = column.title.length * (isChinese ? 13 : 10) + 30
|
|
|
} else {
|
|
|
- width = column.title.length * 7 + 40
|
|
|
+ width = column.title.length * (isChinese ? 10 : 7) + 40
|
|
|
}
|
|
|
const curData = data.length > 1000 ? data.slice(0, 1000) : data
|
|
|
// 判断表格内容的宽度
|