Jelajahi Sumber

Merge branch 'feat_map' of United_Software/k_online_ui into dev

Jack Zhou 9 bulan lalu
induk
melakukan
76197a694a
1 mengubah file dengan 5 tambahan dan 2 penghapusan
  1. 5 2
      src/utils/table.ts

+ 5 - 2
src/utils/table.ts

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