From 7c4c873078a48f9e0cf2afe3679e86d7260e669a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 23 Mar 2021 15:45:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?CHART-18348=20=E8=B0=83=E6=95=B4=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BB=84=E4=BB=B6=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/com/fr/design/editor/script/editor.js | 4 ++-- .../resources/com/fr/design/editor/script/editor.model.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index 3786e47ef..ec4de690d 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -74,10 +74,10 @@ }], layouts: [{ type: "bi.left", - rgap: 5 + rgap: 2 }], value: this.model.mode, - width: 125 + width: 170 }, this._getToolBar()], height: 24 }, { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js index e1ee49645..06f7bf2bf 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js @@ -18,7 +18,7 @@ return [{ type: "bi.single_select_radio_item", text: BI.i18nText("BI-Basic_Auto"), - width: 50, + width: 70, logic: { dynamic: true }, @@ -27,7 +27,7 @@ }, { type: "bi.single_select_radio_item", text: BI.i18nText("BI-Basic_Custom"), - width: 60, + width: 80, logic: { dynamic: true }, From 6ce46d57e2132851d49dec173c26bdfdbbf58450 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 23 Mar 2021 16:50:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-50030=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=A4=96=E8=BE=B9=E6=A1=86=E8=AE=BE=E7=BD=AE=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=86=85=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8E=E9=BB=91=E8=89=B2=E4=B8=8D=E4=B8=80=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 选中表格中区域后,设置边框颜色为黑色,勾选右侧外边框,表格中选中区域的 单元格都出现右边框,正确的效果是只有选中区域右侧的单元格有右边框。 目前代码中更新单元格边框的逻辑是 1. 首先将边框面板的单元格样式直接写入每个单元格中(此时单元格边样式对象值是不对的,需要进行修正) 2. 根据选中区域的单元格样式(旧样式)和边框面板中的样式(新样式)进行比较 3. 决定指定单元格边框是否使用新样式 问题出现在: 1. 无法获取当前选中区域的单元格样式(旧样式),因为已经被污染了. 2. 获取到的边框面板样式不对,导致比较结果出错 3. 只在单元格边框使用新样式时,才重写单元格边框样式对象,不使用新样式时,会继续使用被污染的值. 问题 【改动思路】 1. 在更新边框前,获取选中区域的单元格样式 2. 修改边框面板样式对象的创建逻辑 3. 不使用新样式时,重写单元格边框为旧样式 --- .../com/fr/design/gui/style/BorderPane.java | 30 +++++++++++++++---- .../cell/settingpane/CellStylePane.java | 5 +++- .../settingpane/style/CustomStylePane.java | 4 +-- .../cell/settingpane/style/StylePane.java | 5 ++-- .../java/com/fr/design/style/BorderUtils.java | 23 +++++++++++++- 5 files changed, 54 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 0dcfe4c21..9f948e7a1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -217,18 +217,36 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse int lineStyle = currentLineCombo.getSelectedLineStyle(); Color lineColor = currentLineColorPane.getSelectObject(); CellBorderStyle cellBorderStyle = new CellBorderStyle(); - cellBorderStyle.setTopColor(lineColor); + if (topToggleButton.isSelected()) { + cellBorderStyle.setTopColor(lineColor); + } cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setBottomColor(lineColor); + + if (bottomToggleButton.isSelected()) { + cellBorderStyle.setBottomColor(lineColor); + } cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setLeftColor(lineColor); + + if (leftToggleButton.isSelected()) { + cellBorderStyle.setLeftColor(lineColor); + } cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setRightColor(lineColor); + + if (rightToggleButton.isSelected()) { + cellBorderStyle.setRightColor(lineColor); + } cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setVerticalColor(lineColor); + + if (verticalToggleButton.isSelected()) { + cellBorderStyle.setVerticalColor(lineColor); + } cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - cellBorderStyle.setHorizontalColor(lineColor); + + if (horizontalToggleButton.isSelected()) { + cellBorderStyle.setHorizontalColor(lineColor); + } cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); + if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) { outerToggleButton.setSelected(true); } else { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 370677860..4bfd9fa46 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.Style; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; +import com.fr.design.style.BorderUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.report.cell.DefaultTemplateCellElement; @@ -67,6 +68,7 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public void updateBeans() { + Object[] selectionCellBorderObjects = BorderUtils.createCellBorderObject(elementCasePane); if (stylePane.getSelectedIndex() == 1) { Style s = stylePane.updateBean(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); @@ -110,7 +112,8 @@ public class CellStylePane extends AbstractCellAttrPane { } } } - stylePane.updateBorder();// border必须特别处理 + // border必须特别处理 + stylePane.updateBorder(selectionCellBorderObjects); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java index 2d7277239..268dbebe6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java @@ -136,8 +136,8 @@ public class CustomStylePane extends MultiTabPane