Browse Source

REPORT-101800 修改单元格内容的格式,单元格内容会清空

【问题原因】编辑一个新的单元格时,对单元格属性进行修改,之前的方式 getCellElements 拿到的并不是实际正在编辑的单元格,拿到的是一个手动创建的对象(单元格内容为null),后续对单元格进行更新时,单元格的内容被覆盖更新为null。
【改动思路】获取当前编辑的所有单元格均使用 getAllCellElements
new-design
Leo.Qin 11 months ago
parent
commit
b59f1ccce4
  1. 4
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  2. 2
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java
  3. 6
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

4
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -815,10 +815,6 @@ public class CellSelection extends Selection {
return cellElements;
}
public Set<TemplateCellElement> getCellElements() {
return cellElements;
}
@Override
public void populatePropertyPane(ElementCasePane ePane) {
CellElementPropertyPane.getInstance().reInit(ePane);

2
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -442,7 +442,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
CellSelection cs = (CellSelection) tc.getSelection();
TemplateElementCase editingElementCase = tc.getEditingElementCase();
Set<TemplateCellElement> allCellElements = cs.getCellElements();
Set<TemplateCellElement> allCellElements = cs.getAllCellElements(editingElementCase);
Style oldStyle = cellElement == null ? Style.DEFAULT_STYLE : cellElement.getStyle();
Style style = formatPane.update(oldStyle);
for (TemplateCellElement cellElement : allCellElements) {

6
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -241,7 +241,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
dataPane.update(cellElement);
CellSelection selection = (CellSelection) tc.getSelection();
Set<TemplateCellElement> allCellElements = selection.getCellElements();
Set<TemplateCellElement> allCellElements = selection.getAllCellElements(tc.getEditingElementCase());
groupPane.update(allCellElements);
}
@ -319,7 +319,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
@Override
public void itemStateChanged(ItemEvent e) {
CellSelection selection = (CellSelection) tc.getSelection();
Set<TemplateCellElement> allCellElements = selection.getCellElements();
Set<TemplateCellElement> allCellElements = selection.getAllCellElements(tc.getEditingElementCase());
if (e == null || e.getStateChange() == ItemEvent.DESELECTED) {
//分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存
groupPane.update(allCellElements);
@ -351,7 +351,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
if (!selectedOneCell) {
// 只有在批量操作的时候才需要判断是否隐藏条件面板
CellSelection selection = (CellSelection) tc.getSelection();
boolean sameDSName = checkSameDSName(selection.getCellElements());
boolean sameDSName = checkSameDSName(selection.getAllCellElements(tc.getEditingElementCase()));
conditionPane.setVisible(sameDSName);
} else {
conditionPane.setVisible(true);

Loading…
Cancel
Save