From 7065e55ef02f036fa99c99f1d22fa234688f62a8 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 3 Nov 2022 09:26:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-80690=20=E6=B7=BB=E5=8A=A0=E9=80=82?= =?UTF-8?q?=E9=85=8D=E9=80=82=E9=85=8D=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/AbstractCellElementAction.java | 4 ++ .../actions/columnrow/ColumnWidthAction.java | 5 +- .../actions/columnrow/RowHeightAction.java | 4 ++ .../com/fr/quickeditor/CellQuickEditor.java | 50 +++++++++++++++++++ .../cellquick/CellDSColumnEditor.java | 4 +- 5 files changed, 65 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java index 450c326915..52f3539788 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java @@ -9,6 +9,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.grid.GridUtils; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.cell.TemplateCellElement; import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; @@ -76,6 +77,9 @@ public abstract class AbstractCellElementAction extends CellSelectionAction { } } } + if (!ePane.isSelectedOneCell()) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.FILTER); + } ePane.fireTargetModified(); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java index e363ee29e9..8ec7c90331 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnWidthAction.java @@ -4,8 +4,8 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; - import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +32,9 @@ public class ColumnWidthAction extends ColumnRowSizingAction { for (int i = 0; i < columns.length; i++) { report.setColumnWidth(columns[i], len); } + if (columns.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } protected UNIT getIndexLen(int index, ElementCase report){ diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java index 9485dc270a..ff4d63a1e9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/RowHeightAction.java @@ -6,6 +6,7 @@ package com.fr.design.actions.columnrow; import com.fr.design.mainframe.ElementCasePane; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.CellQuickEditor; import com.fr.report.elementcase.ElementCase; import com.fr.stable.unit.UNIT; @@ -32,6 +33,9 @@ public class RowHeightAction extends ColumnRowSizingAction { for (int i = 0; i < rows.length; i++) { report.setRowHeight(rows[i], len); } + if (rows.length > 1) { + CellQuickEditor.record(CellQuickEditor.multipleOperationType.HEIHT_AND_COLUMN); + } } @Override diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 6f060b4f06..c84396b483 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -455,6 +455,9 @@ public abstract class CellQuickEditor extends QuickEditor { if (updateStyle) { // 防止频繁触发保存 + if (!tc.isSelectedOneCell()) { + record(multipleOperationType.FORMAT); + } fireTargetModified(); } @@ -469,4 +472,51 @@ public abstract class CellQuickEditor extends QuickEditor { return formatPane; } + + + /** + * 用于适配记录批量操作的埋点数据 + * + * @param type 批量操作修改类型 + * @return 批量修改类型名称 + */ + public static String record(multipleOperationType type) { + return type.getType(); + } + + /** + * 批量操作的类型 + */ + public enum multipleOperationType { + /** + * 批量修改格式 + */ + FORMAT("FORMAT"), + + /** + * 批量修改数据列的数据设置 + */ + TYPE_OF_DATA("type-of-data"), + + /** + * 批量修改过滤条件 + */ + FILTER("filter"), + + /** + * 批量修改行高列宽 + */ + HEIHT_AND_COLUMN("row-height-and-column-width"); + + + private final String type; + + multipleOperationType(String type) { + this.type = type; + } + + public String getType() { + return type; + } + } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index bd449de01d..575f89fb07 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -319,10 +319,12 @@ public class CellDSColumnEditor extends CellQuickEditor { public void itemStateChanged(ItemEvent e) { CellSelection selection = (CellSelection) tc.getSelection(); Set allCellElements = selection.getCellElements(); - groupPane.update(allCellElements); if (e == null || e.getStateChange() == ItemEvent.DESELECTED) { //分组-高级-自定义点确定的时候传进来null的e,但是这时候应该触发保存 groupPane.update(allCellElements); + if (!tc.isSelectedOneCell()) { + CellQuickEditor.record(multipleOperationType.TYPE_OF_DATA); + } fireTargetModified(); } }