Browse Source

REPORT-46723 填报智能添加单元格组

bugfix/10.0
hades 4 years ago
parent
commit
e80c07a482
  1. 21
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

21
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -310,9 +310,9 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 单元格组要记录下之前的选中情况 // 单元格组要记录下之前的选中情况
private CellSelection oriCellSelection = null; private CellSelection oriCellSelection = null;
private List<String> newAdd = new ArrayList<String>(); private List<ColumnRow> newAdd = new ArrayList<>();
private List<String> oldAdd = new ArrayList<String>(); private List<ColumnRow> oldAdd = new ArrayList<>();
public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) { public SmartJTablePane4DB(KeyColumnTableModel model, ElementCasePane actionReportPane) {
this(model, actionReportPane, false); this(model, actionReportPane, false);
@ -433,7 +433,8 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (!allColumnRow.contains(columnRow.toString())) { if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow); add.addColumnRow(columnRow);
} }
// 重新更换区域框选单元格后 清理历史框选
oldAdd.clear();
} }
if (add.getSize() > 0) { if (add.getSize() > 0) {
@ -462,7 +463,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (!newAdd.contains(value) && !allColumnRow.contains(value)) { if (!newAdd.contains(value) && !allColumnRow.contains(value)) {
add.addColumnRow(ColumnRow.valueOf(value)); add.addColumnRow(ColumnRow.valueOf(value));
} }
newAdd.add(value); newAdd.add(ColumnRow.valueOf(value));
} }
if (cellElement == null) { if (cellElement == null) {
@ -470,16 +471,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (!allColumnRow.contains(columnRow.toString())) { if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow); add.addColumnRow(columnRow);
} }
newAdd.add(columnRow.toString()); newAdd.add(columnRow);
}
} }
} }
int oldSize = oldAdd.size();
int newSize = newAdd.size();
if (oldSize > newSize && oldAdd.containsAll(newAdd)) {
int diff = oldSize - newSize;
newValue.splice(newValue.getSize() - diff, diff);
} }
// 计算出前后两次选中的差值
oldAdd.removeAll(newAdd);
// 移除差值部分
newValue.removeAll(oldAdd);
oldAdd.clear(); oldAdd.clear();
oldAdd.addAll(newAdd); oldAdd.addAll(newAdd);
} }

Loading…
Cancel
Save