Browse Source

Pull request #3917: REPORT-50788 删除数据集更新缓存

Merge in DESIGN/design from ~HADES/design:final/10.0 to final/10.0

* commit '851dec0a40b5b7b2880ee938ecd984103170cb36':
  REPORT-50788 删除数据集更新缓存
final/10.0
Kara 4 years ago
parent
commit
bccee9f48e
  1. 18
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 1
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java

18
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -21,6 +21,8 @@ import com.fr.stable.StringUtils;
import com.fr.stable.js.WidgetName; import com.fr.stable.js.WidgetName;
import com.fr.util.ParameterApplyHelper; import com.fr.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -338,6 +340,22 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
} }
} }
public void removeTableDataParameters(String tdName) {
ParameterProvider[] tableDataParameters = tableDataParametersMap.remove(tdName);
List<Parameter> allParameterList = new ArrayList<>(Arrays.asList(parameters));
List<Parameter> tableDataParameterList = new ArrayList<>();
for (ParameterProvider parameterProvider : tableDataParameters) {
tableDataParameterList.add((Parameter) parameterProvider);
}
allParameterList.removeAll(tableDataParameterList);
parameters = allParameterList.toArray(new Parameter[0]);
}
public void updateAllParameters() {
parameters = getLatestParameters();
}
protected void addGlobalParameters(Map<String, ParameterProvider> map) { protected void addGlobalParameters(Map<String, ParameterProvider> map) {
// 添加全局参数 // 添加全局参数
Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters();

1
designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java

@ -60,6 +60,7 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
TableDataSourceAction.this.getEditingComponent().fireTargetModified(); TableDataSourceAction.this.getEditingComponent().fireTargetModified();
fireDSChanged(tableDataPane.getDsNameChangedMap()); fireDSChanged(tableDataPane.getDsNameChangedMap());
DesignModelAdapter.getCurrentModelAdapter().updateAllParameters();
} }
}); });
reportTableDataDialog.setVisible(true); reportTableDataDialog.setVisible(true);

Loading…
Cancel
Save