From a1db831093e3dfcf7a57ffdcfd4c0261ceaba9d2 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Fri, 31 Jul 2020 13:44:46 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-33518=20=E3=80=9010.0.7=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E4=BB=8E=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=87=8F?= =?UTF-8?q?=E8=A1=A8=E5=8F=96=E6=95=B0=E5=BB=BA=E7=AB=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=EF=BC=8C=E9=A2=84=E8=A7=88=E4=B8=8D=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 18 ++++++++++++++++-- .../datapane/preview/PreviewTablePane.java | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) 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());