xuzhancheng 2 weeks ago
parent
commit
b139fbfe0a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      yudao-ui-admin-vue3/src/utils/reportUtil.ts

+ 2 - 2
yudao-ui-admin-vue3/src/utils/reportUtil.ts

@@ -302,10 +302,10 @@ export const handleCopy = (spread) => {
  * 从 sheet 数据源提取所有字段值(兼容 table 绑定字段)
  */
 export const collectSheetDataSource = (sheet): Record<string, any> => {
-  const rT = sheet.getDataSource().rT
+  if(!sheet.getDataSource()) return {}
+  const rT = sheet.getDataSource().rT || {}
   const result: Record<string, any> = { ...rT }
 
-  const tables = sheet.tables?.all() || []
   for (const table of tables) {
     const tableBindingPath = table.bindingPath()
     if (tableBindingPath) {