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 f9c9ddab6b..f2b1e8e5b3 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 @@ -439,9 +439,14 @@ public abstract class DesignTableDataManager { * @throws Exception 异常 */ public static EmbeddedTableData previewTableDataNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar) throws Exception { - return previewTableData(tableDataSource, tabledata, rowCount, true, needLoadingBar); + return previewTableDataNeedInputParameters(tableDataSource, tabledata, rowCount, needLoadingBar, null); } + public static EmbeddedTableData previewTableDataNeedInputParameters(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean needLoadingBar, AutoProgressBar progressBar) throws Exception { + return previewTableData(tableDataSource, tabledata, rowCount, true, needLoadingBar, progressBar); + } + + /** * 预览不需要参数的数据集 * @@ -478,7 +483,16 @@ public abstract class DesignTableDataManager { * @return */ private static EmbeddedTableData previewTableData(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar) throws Exception { - final AutoProgressBar loadingBar = PreviewTablePane.getInstance().getProgressBar(); + return previewTableData(tableDataSource, tabledata, rowCount, isMustInputParameters, needLoadingBar, null); + } + + private static EmbeddedTableData previewTableData(TableDataSource tableDataSource, TableData tabledata, int rowCount, boolean isMustInputParameters, boolean needLoadingBar, AutoProgressBar progressBar) throws Exception { + final AutoProgressBar loadingBar; + if (progressBar == null) { + loadingBar = PreviewTablePane.getInstance().getProgressBar(); + } else { + loadingBar = progressBar; + } ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tabledata); if (ArrayUtils.isEmpty(parameters)) { parameters = tabledata.getParameters(Calculator.createCalculator()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 2cd16b4940..8d8e3a48c6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -372,7 +372,7 @@ public class PreviewTablePane extends BasicPane { connectionBar.close(); } TableDataSource dataSource = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget(); - previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true); + previewTableData = DesignTableDataManager.previewTableDataNeedInputParameters(dataSource, tableData, (int) maxPreviewNumberField.getValue(), true, progressBar); // parameterInputDialog // update之后的parameters,转成一个parameterMap,用于预览TableData PreviewTableModel previewModel = new PreviewTableModel(previewTableData.createDataModel(null), (int) maxPreviewNumberField.getValue());