Browse Source

REPORT-114392 FR-FBP版本本地设计适配 修复数据集预览报错

fbp-1.0
Destiny.Lin 5 months ago
parent
commit
01aea3d0bf
  1. 15
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

15
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;

Loading…
Cancel
Save