Browse Source

REPORT-21871 批量添加单元格组 合并场景

feature/big-screen
hades 5 years ago
parent
commit
38863dc13b
  1. 22
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

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

@ -27,6 +27,7 @@ import com.fr.design.selection.SelectionListener;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.ColumnRowGroup; import com.fr.stable.ColumnRowGroup;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -451,14 +452,27 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
int r = cellselection.getRow(); int r = cellselection.getRow();
int rs = cellselection.getRowSpan(); int rs = cellselection.getRowSpan();
String allColumnRow = newValue.toString(); String allColumnRow = newValue.toString();
System.out.println("all: " + allColumnRow);
newAdd.clear(); newAdd.clear();
for (int i = 0; i < cs; i++) { for (int i = 0; i < cs; i++) {
for (int j = 0; j < rs; j++) { for (int j = 0; j < rs; j++) {
ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j); TemplateCellElement cellElement = ePane.getEditingElementCase().getTemplateCellElement(c + i, r + j );
if (!allColumnRow.contains(columnRow.toString())) { if (cellElement != null && ((i + c) != 0 || (r + j) != 0)) {
add.addColumnRow(columnRow); String value = cellElement.toString();
System.out.println(newAdd);
if (!newAdd.contains(value) && !allColumnRow.contains(value)) {
add.addColumnRow(ColumnRow.valueOf(value));
}
newAdd.add(value);
}
if (cellElement == null) {
ColumnRow columnRow = ColumnRow.valueOf(c + i, r + j);
if (!allColumnRow.contains(columnRow.toString())) {
add.addColumnRow(columnRow);
}
newAdd.add(columnRow.toString());
} }
newAdd.add(columnRow.toString());
} }
} }
int oldSize = oldAdd.size(); int oldSize = oldAdd.size();

Loading…
Cancel
Save