diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 1a7f121cc5..4b3b058cf8 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -578,7 +578,15 @@ public abstract class DesignTableDataManager { bean.setDataSource(source); bean.setDataName(DataOperator.getTableDataName(source, tabledata)); bean.setParameterMap(parameterMap); - return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); + if (checkBean(bean)) { + return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); + } else { + PreviewDataBean dataBean = new PreviewDataBean(); + dataBean.setDataSource(tabledata); + dataBean.setParameterMap(parameterMap); + return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(dataBean).getTableData(); + } + } catch (Exception e) { throw new TableDataException(e.getMessage(), e); } finally { @@ -597,6 +605,11 @@ public abstract class DesignTableDataManager { } } + private static boolean checkBean(PreviewSourceBean bean) { + // dataName为空说明是新建的,得用tabledata传 + return !bean.getDataName().isEmpty(); + } + private static boolean needInputParams(boolean mustInputParameters, ParameterProvider[] parameters) { if (mustInputParameters && ArrayUtils.isNotEmpty(parameters)) { return true;