Browse Source

REPORT-50788 删除数据集更新缓存

final/10.0
hades 4 years ago
parent
commit
5fb883b5a2
  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.util.ParameterApplyHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
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) {
// 添加全局参数
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());
TableDataSourceAction.this.getEditingComponent().fireTargetModified();
fireDSChanged(tableDataPane.getDsNameChangedMap());
DesignModelAdapter.getCurrentModelAdapter().updateAllParameters();
}
});
reportTableDataDialog.setVisible(true);

Loading…
Cancel
Save