jack 1 week ago
parent
commit
5f1b846771
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/hooks/useImport.ts

+ 6 - 1
src/hooks/useImport.ts

@@ -1490,7 +1490,12 @@ export default () => {
                   style: borderStyle,
                   style: borderStyle,
                   color: borderColor,
                   color: borderColor,
                 },
                 },
-                cellMinHeight: el.rowHeights[0] ? el.rowHeights[0] * ratio : 36,
+                cellMinHeight: (() => {
+                  const hs = (el.rowHeights || []).filter(h => typeof h === 'number' && h > 0)
+                  if (!hs.length) return 36
+                  const avg = hs.reduce((a, b) => a + b, 0) / hs.length
+                  return +(avg * ratio).toFixed(2)
+                })()
               }
               }
               if (spid) {
               if (spid) {
                 tableElement.spid = spid
                 tableElement.spid = spid