From b0c5c6660bfc9a5a72f33e08dc81c450ce34566f Mon Sep 17 00:00:00 2001
From: kerry
Date: Fri, 23 Sep 2022 13:49:45 +0800
Subject: [PATCH 001/310] =?UTF-8?q?REPORT-80745=20FR11=E6=96=B0=E8=87=AA?=
=?UTF-8?q?=E9=80=82=E5=BA=94-=E5=9C=A8=E7=95=8C=E9=9D=A2=E6=9C=89?=
=?UTF-8?q?=E7=BC=A9=E6=94=BE=E6=AF=94=E4=BE=8B=E6=97=B6=EF=BC=8C=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=8D=95=E5=85=83=E6=A0=BC=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E7=BC=A9=E6=94=BE=E7=9A=84=E5=83=8F?=
=?UTF-8?q?=E7=B4=A0=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/grid/AbstractGridHeaderMouseHandler.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
index d9d5cbe53b..97e95a34f4 100644
--- a/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
+++ b/designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
@@ -305,11 +305,14 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
StringBuilder sb = new StringBuilder();
sb.append(String.format("%.2f", new Double(len)))
.append('/').append(String.format("%.2f", new Double(tlen)))
- .append(unit).append('(')
- .append((int)(unitValue.toPixD(resolution))).append('/')
- .append((int)(totalUnitValue.toPixD(resolution)))
- .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"))
- .append(')');
+ .append(unit);
+ if(!DesignerUIModeConfig.getInstance().simulateWebUIMode()){
+ sb.append('(')
+ .append((int)(unitValue.toPixD(resolution))).append('/')
+ .append((int)(totalUnitValue.toPixD(resolution)))
+ .append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"))
+ .append(')');
+ }
return sb.toString();
}
From b854a4ada2932c2f894a72ab8ebb81e06920ccd9 Mon Sep 17 00:00:00 2001
From: "Jimmy.Zheng"
Date: Fri, 23 Sep 2022 13:50:48 +0800
Subject: [PATCH 002/310] =?UTF-8?q?Revert=20"Revert=20"REPORT-70593=20?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E6=8E=A7=E4=BB=B6=E5=90=88=E5=B9=B6=E4=B8=BB?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81""?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 911ca18f
---
.../com/fr/design/gui/core/WidgetOption.java | 7 +-
.../HyperlinkGroupPaneActionProvider.java | 2 +
.../com/fr/design/report/SelectImagePane.java | 67 ++++++-----
.../buttonicon/widget/picture_widget_16.png | Bin 0 -> 1061 bytes
.../widget/picture_widget_designer_bg.png | Bin 0 -> 4933 bytes
.../designer/creator/XCreatorUtils.java | 2 +
.../fr/design/designer/creator/XPicture.java | 74 ++++++++++++
.../com/fr/design/designer/ui/ImgPanel.java | 111 ++++++++++++++++++
.../AccessiblePictureModelEditor.java | 77 ++++++++++++
.../AccessibleUrlLinkModelEditor.java | 57 +++++++++
.../widget/editors/PictureEditor.java | 17 +++
.../widget/editors/UrlLinkEditor.java | 17 +++
.../widget/renderer/PictureRenderer.java | 15 +++
.../widget/renderer/UrlLinkRenderer.java | 16 +++
.../widget/wrappers/PictureModelWrapper.java | 34 ++++++
.../widget/wrappers/UrlLinkModelWrapper.java | 33 ++++++
.../fr/start/module/DesignerActivator.java | 6 +-
.../com/fr/start/preload/ImagePreLoader.java | 1 +
18 files changed, 499 insertions(+), 37 deletions(-)
rename {designer-realize => designer-base}/src/main/java/com/fr/design/report/SelectImagePane.java (96%)
create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png
create mode 100644 designer-base/src/main/resources/com/fr/design/images/form/designer/widget/picture_widget_designer_bg.png
create mode 100644 designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java
create mode 100644 designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java
create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java
diff --git a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java
index 258f558a71..4c9db5a6a0 100644
--- a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java
+++ b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java
@@ -1,6 +1,7 @@
package com.fr.design.gui.core;
import com.fr.base.BaseUtils;
+import com.fr.base.svg.IconUtils;
import com.fr.form.ui.Button;
import com.fr.form.ui.CheckBox;
import com.fr.form.ui.CheckBoxGroup;
@@ -14,6 +15,7 @@ import com.fr.form.ui.ListEditor;
import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.NumberEditor;
import com.fr.form.ui.Password;
+import com.fr.form.ui.PictureWidget;
import com.fr.form.ui.RadioGroup;
import com.fr.form.ui.TextArea;
import com.fr.form.ui.TextEditor;
@@ -142,7 +144,7 @@ public abstract class WidgetOption implements Serializable {
*/
public static WidgetOption[] getFormWidgetIntance() {
return new WidgetOption[]{TEXTEDITOR, LABEL, FREEBUTTON, COMBOBOX, COMBOCHECKBOX, DATEEDITOR,
- NUMBEREDITOR, TREECOMBOBOX, RADIOGROUP, CHECKBOXGROUP, TEXTAREA, PASSWORD, CHECKBOX, TREE, MULTI_FILEEDITOR};
+ NUMBEREDITOR, TREECOMBOBOX, RADIOGROUP, CHECKBOXGROUP, TEXTAREA, PASSWORD, CHECKBOX, TREE, MULTI_FILEEDITOR,PICTURE};
}
public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Date"),
@@ -214,4 +216,7 @@ public abstract class WidgetOption implements Serializable {
public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"),
IframeEditor.class);
+ public static final WidgetOption PICTURE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Image"), IconUtils.readIcon("/com/fr/web/images/form/resources/picture_widget_16.png"),
+ PictureWidget.class);
+
}
diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java
index 525bb5b792..be0d8e8523 100644
--- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java
+++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java
@@ -8,6 +8,8 @@ import com.fr.design.designer.TargetComponent;
*/
public interface HyperlinkGroupPaneActionProvider {
+ String XML_TAG = "HyperlinkGroupPane";
+
/**
* 刷新面板展示
*
diff --git a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java
similarity index 96%
rename from designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java
rename to designer-base/src/main/java/com/fr/design/report/SelectImagePane.java
index bcad15c76c..7781233aac 100644
--- a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java
+++ b/designer-base/src/main/java/com/fr/design/report/SelectImagePane.java
@@ -13,22 +13,24 @@ import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter;
import com.fr.stable.Constants;
-
-import javax.swing.BorderFactory;
-import javax.swing.ButtonGroup;
-import javax.swing.JFileChooser;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
/**
- * 这个类主要用于插入图片时的设置
- */
+ * 这个类主要用于插入图片时的设置
+ * 这个类原本在designer-realize包下面,现在表单也可选择图片,所以应该抽为公用的base包。包名不变,应该不影响插件使用
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:22
+ **/
public class SelectImagePane extends BasicPane {
private ImagePreviewPane previewPane = null;
@@ -39,8 +41,31 @@ public class SelectImagePane extends BasicPane {
private UIRadioButton adjustRadioButton = null;
private Style imageStyle = null;
+ ActionListener layoutActionListener = new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent evt) {
+ setImageStyle();
+ changeImageStyle();
+ }
+ };
private File imageFile;
+ /**
+ * Select picture.
+ */
+ ActionListener selectPictureActionListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent evt) {
+ int returnVal = imageFileChooser
+ .showOpenDialog(SelectImagePane.this);
+ if (returnVal != JFileChooser.CANCEL_OPTION) {
+ File selectedFile = imageFileChooser.getSelectedFile();
+ imageFile = selectedFile;
+ ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, null).dealWithImageFile(returnVal);
+ }
+ }
+ };
public SelectImagePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@@ -102,23 +127,6 @@ public class SelectImagePane extends BasicPane {
imageFileChooser.setMultiSelectionEnabled(false);
}
- /**
- * Select picture.
- */
- ActionListener selectPictureActionListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent evt) {
- int returnVal = imageFileChooser
- .showOpenDialog(SelectImagePane.this);
- if (returnVal != JFileChooser.CANCEL_OPTION) {
- File selectedFile = imageFileChooser.getSelectedFile();
- imageFile = selectedFile;
- ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, null).dealWithImageFile(returnVal);
- }
- }
- };
-
// 调整图片样式,只有水平和垂直对齐以及拉伸。相对于背景,平铺不予考虑。
private void changeImageStyle() {
previewPane.setImageStyle(this.imageStyle);
@@ -137,15 +145,6 @@ public class SelectImagePane extends BasicPane {
}
}
- ActionListener layoutActionListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent evt) {
- setImageStyle();
- changeImageStyle();
- }
- };
-
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image");
diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/picture_widget_16.png
new file mode 100644
index 0000000000000000000000000000000000000000..fbf334ad22a2e3a9985830d225959a6ea40379b0
GIT binary patch
literal 1061
zcmXw%drVUY6vj_`Z{LOD#Mvv1!WaS)2ZL>*!Ic`+!Nd_BgDhZeMr2t8N
zlU$Kp{GO~qQLd2HpFa7Aq5uH7SzIKkR6me!P?Q)+gJb{+Xem_xmmUP01i<7nfg%Y&
z5EQtq7&h*A#jS4yMZvH?#lP-Owgs1WVzDXHn>g6#1Q`LHwG}9y8|Y6kfnWd_Y_!1S
zGVL+j4JkH{IR*DSMQZ^wW^tH!Zif|(FmW)2jGz!VX1={k-8=30nlSk9!1Mf<|HoJ?
z7BE_kwVl^H8$zTLn7lANCnCUUMqwRcz($Y&7ubPL0W7X8zTnMqZT`nIWTk*)15i&f
zh{0%p%#2LY%!0lI;ou+?asW56AmCwvFF=AbUZKsXFQk|ZlNlRr1_zmdqGXt8XR
z;eHYdF_}zsyVbEZYj;wOFJhoMOenb4=&()(!EUz!n@0eR4&V&{Y)eNWHqrMiKH%_#yf^hOl=^;M}Vop`2+HQmg=fr(Ke6C
zj&6zEhC{LZ0WG~X!p{hY#5uKXxnJZHo#U0kt(UqdCo05Zsn%`zvzXZd^0QXT7oM=G
zO0l>2S1lpotI~q06Jc9vSM~^s)u+V^m3OPKxxP6p-gFs@Uu9rq+hBLZkL%^k0|7D6
z(7a{Wmz&=lmhN$P8-kx^@ssvZ!p4vLgdXL0*!8M6g!$;4Fn{6J?4%p_Hg#E47pBOz
z9c8TT4~HHPcNlK}cqRQRaUybDwtR;O;>xapo+CMf&F{;X&oo~&;FcG=zUrx=9*us0
zJHD-GI8yt|Nmo4@Bs~`YU%}?G9)c|UMw?y8ccKQGRh2>!U_~udP_>AeTx}BqgcYJu+yPIDy
zdlN{!t?J^jNAI3lb1dY0$ot`?ouT5RM2@I|ws8Rv6BA=@ZVrz>={x-B(#}PPpiGKx
z24VVy62LPV+;8K&sq@7mc=BP#4uY)W-_3GI`wq{mbO?=_Q>_+BBusJsKYv?S?Ne`f
z{jg*5=?#7zRd-0|15n{Z{W-h@psLnBB#(OX3mj=>XEYkAbUL)mT3@GKzVrI^>y8T1
z&TSBW#xmdKN0u1|sKe_P?N3cfDX3fs96Z_7#1=O}5FVAskHyNY=i^r@FYWwFZuD?-
zbIbXMIsv^v;3JilOINM3+lP_q0Fg8P$GURC$aU@V(s%FP8HmK@NtorfV#NxDj4)J|
zks6vmH3JP};8-kf7SPnu6uA(z9QL{1Jp`L!J?iVS4SRbZS{7J
z1DD-T@dO&(6&naYx4{Gsx`mQ!il&85Ns$sIGUK`h?RH&6tyXKWA_&{mCplfk85)_v
znH0TMG^qa0G1l$`AX_{@0q_jPE%*iSBpFI>3cfp9Q^T`=Z-^jBibSa*KizA>iaf&x
z^M|vDjX&K#x0w*F;2k`8@P{LdaE`UP+eOUmNIdr~BD3~1cXe|E88fgd$bPjUlUmi3
zUjU+@B+&5G>Ya$7tgw=u8_1&CPjj{I#H6~VzQoKS%%Y^dJ;?KWU~&t}wHVUGDq&}5
zqT7A7hlirPXE|^zium&%&-?_eX;O{82vPjbmK_3?S?C{6z8$|(Krw@VFxMv)G@tEC
zftS+2vI^`O4D
zY8pe%AJ~~$9ApZMw(B&ouSs3R$&=V6JweLtN~tJA67?^8^v*OS~BLR9qGd`g-0knK02=x7{&`I50wInE~wGH4*E0_+*SxlmKwGOdrBex
z25i3%>bOZ?M8E;KX)R-knta3wouOB@y?Gd1w^p%Mo4ylpK|Wat^fXfZ5kN|lD6ulK
zd;yqhYj`n9j=Nk!GZAxlBnfz=A_>1!TXQ=DLd3aHW6RF3UvSaU6SX>bY~n{0<><+U
z6$!_!BaKmkv3+$Tv6a(Hd+MzWEAJrOjIfd4P&tJg`b!iAZkZ*%L55IhfK;=T7AM8S1H3R_Nhx>(Bl%b}Ame
zYL2P~>Laq;!!rKMJdthAPJnRSn2?%bgUqUp|Mk@>$-D%N2}Q1`mvKrs5GhN*91
zq1L@h1E3^Xv_)Y}J_!oK$)b1+
zwmf|RT+U
zBKzRybzm@(5`<@RWeOvf7KTHqJ9aN{WtMuvwc(AA&{%bmhF(FzTv>kGO%go5i$Pf*1
z2rtz(Fn>UytqcGoapR&$E3O18Uf5UB-wH$QGfhF93j1qCfG$>Z%d)SpuX~s4gpv}P
zNswiGd3hnl{~2{+h#KG$1JEbH*dCapZ7DZD|I6_OrJ^8{ds{H*@Wxy5a`}M+2h>kE
zL2*d0`RxQTTExUj8o_cdLdyMf_A^?e%r@=xi5NGsmrmDMX&BXed*+KF511AmXJ~_(
zb?~BG$Js)xSEzVJwylE>1&e$|mTE_1(JRz~9kQ3%{7n4=5B=xOqfkY%A7;}L%f$Jt(xgg~B-*f#JUp|Y
zIZJ!A0C3Z&qlvC0i7k3BP_dtSNs6YWh<~G`E0Dl##_ll6=MlFAli>B!7$M2p2h5U;
zGf5rv>L4;V$gsku)5YA=3w+zbRH
zZU*>861=|A(r0$TA-RSew)HD`9=+r15X#kM`It@Sd0;ks0b=
zT;64qW5Lb*x<$#As&GmaXT?z~(mxfG+UN|~AyN4(?D0}XH8GllTGNevVd!Q~r%wi8
zyNj}-6)l?IK*M{8;!Ry)A)4^SME)`mCjt4&-fg6?-a$c@w~-_hkv%U1{H0F%Sutc&
zD>Rl6I~IDuGKt;!yApmbV1#IV;XHSaj1NU)s@bt6D2l3u_X?PjiblQ`&yKt}J6GG*Am|1;h@v@k`#Ylif+(i5VE%xn
z)oAY4ym-D~{iQHo+_h`hM3+%tHdA~*LbDny^=N3IO|5
zH?2^X6}3l`Wkpx7U4ux1^~5%8e|~E%2I+jDT~55RARN;{9?MtBwf&c)JiWjRRu8
zhhvM^z#kn6wzw&UTm)=;3#|gs4-1twX7U@I^V()6tY5;4H08%T85ueOFswg?q$nEr
zaurDWYyeubExnTfNidogl7k&5R^c#)=iVh2VjCT*HW)2o#$GMCpPQl%^c%Q^?
z0iO}@)9Rgt*eZLaFF29+J?3!_<*~kYQj8ne`3?^69=l^}rP%X1YhT~yk(Prv=Uj{V
z>bh|ET%FO8;MSH5Pu+SOC5swZZZnMxIhvS#C$O%f7SEu)1xD
z^U&ZdRP;N}n`f4`sQb*BqUM^v-;PuC|Ln=TWj;~I#*&nnp$FHs%@2OjRR0X$6^Uxr
zHb@uhO`$cr6aDHncu(~RiK)k(TYQe4Iqcc)Lv?V=dHa||$N`}|J^h9RmkutMTlex0
zb_+-Wz=;2XGEB)hUBiIjvw|rx3A<^Fae^kgwqZt>Sn%}!&I(@eqK>>O0P#_3i3N8e
z!c`omdC);_9xc5W&aCz+)-e?bNg_el(oUF%IGRam0kg<|_Pp$0?kmP?QF_U}kl7GE
zG9t2QZJ{Tf9qT6v>v7Ae^@ax*82`qddo$4)&_x%
z9^yakTI#~=vvS`*w+>21_E}{PAc=QEtTw;p2jJ;Caa51mgd)5|)Ng_3NyP6ua6b|I
zn1Jk?sl3b5akP&fPy({dx34C|K7aq>E-L*rwq<|6CqBDJoGm1+nIfKtZCiJe^Ur%s
z@SLzMKjL$=cD8V$Kr?zHOPopx5X{V6URVqT9rT3{
zXA=56q*7_nEY?K5If4&_e%Qsiihh#UhU~bv90KM9*@!S^w#$-RAPYa
zBT{@|bEy1}1x$q_yR?blL-O`+74Yw^y
za-s(~totjXcY3RuNxI<3K@Ai0QW>ns0SD;=6uV6^yIoCrScP1>dX?s8sMUbFLxpzo
z%RtgbU)}>Jyno>wJnRx~!POn3RtKz8v+BP<1^pZcfr-iOx6LkMmhxQW1Hs!c_p$wd
z7TZhl-&L7g37L;FtSTh<)=qC*-%3Rk{F9^s@uaK3={EWQ|D?$im~5W&*A!s!8h;K3
NL`TL%oDNfH{|_#1j
literal 0
HcmV?d00001
diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
index 5e7807698a..10a8fbfb1f 100644
--- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
+++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
@@ -47,6 +47,7 @@ import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.NameWidget;
import com.fr.form.ui.NumberEditor;
import com.fr.form.ui.Password;
+import com.fr.form.ui.PictureWidget;
import com.fr.form.ui.Radio;
import com.fr.form.ui.RadioGroup;
import com.fr.form.ui.TextArea;
@@ -183,6 +184,7 @@ public class XCreatorUtils {
objectMap.put(CardSwitchButton.class, XCardSwitchButton.class);
objectMap.put(CardAddButton.class, XCardAddButton.class);
objectMap.put(WidgetErrorMarker.class, ErrorCreator.class);
+ objectMap.put(PictureWidget.class, XPicture.class);
}
private static void reInitExtra() {
diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java b/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java
new file mode 100644
index 0000000000..7dd23bd4ce
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/designer/creator/XPicture.java
@@ -0,0 +1,74 @@
+package com.fr.design.designer.creator;
+
+import com.fr.design.designer.ui.ImgPanel;
+import com.fr.design.i18n.Toolkit;
+import com.fr.design.layout.FRGUIPaneFactory;
+import com.fr.design.mainframe.widget.editors.PictureEditor;
+import com.fr.design.mainframe.widget.editors.UrlLinkEditor;
+import com.fr.design.mainframe.widget.renderer.PictureRenderer;
+import com.fr.design.mainframe.widget.renderer.UrlLinkRenderer;
+import com.fr.form.ui.PictureWidget;
+import com.fr.general.IOUtils;
+import com.fr.stable.ArrayUtils;
+import java.awt.Dimension;
+import java.awt.Image;
+import java.beans.IntrospectionException;
+import javax.swing.JComponent;
+
+/**
+*
+* 图片控件的creator
+*
+* @author Jimmy.Zheng created on 2022/8/11 21:16
+**/
+public class XPicture extends XWidgetCreator {
+
+ public XPicture(PictureWidget widget, Dimension dimension) {
+ super(widget, dimension);
+ }
+
+ @Override
+ protected String getIconName() {
+ return "picture_widget_16.png";
+ }
+
+ @Override
+ public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
+ return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[]{
+ new CRPropertyDescriptor("picUrl", toData().getClass())
+ .setI18NName(Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Image"))
+ .setEditorClass(PictureEditor.class)
+ .setRendererClass(PictureRenderer.class)
+ .putKeyValue("category", "Fine-Design_Basic_Advanced"),
+ new CRPropertyDescriptor("urlLink", toData().getClass())
+ .setI18NName(Toolkit.i18nText("Fine-Design_Basic_Hyperlink"))
+ .setEditorClass(UrlLinkEditor.class)
+ .setRendererClass(UrlLinkRenderer.class)
+ .putKeyValue(
+ "category", "Fine-Design_Basic_Advanced")});
+ }
+
+ @Override
+ protected JComponent initEditor() {
+ PictureWidget pictureWidget = (PictureWidget) this.data;
+ if (this.editor == null) {
+ this.editor = FRGUIPaneFactory.createBorderLayout_S_Pane();
+ Object value = pictureWidget.getPicUrl().getValue();
+ ImgPanel imgPanel = new ImgPanel();
+ if (value instanceof Image) {
+ imgPanel.setBackgroundImage((Image) value);
+ imgPanel.setImageDisplayMode(pictureWidget.getShowType());
+ } else {
+ imgPanel.setBackgroundImage(IOUtils.readImage("com/fr/design/images/form/designer/widget/picture_widget_designer_bg.png"));
+ imgPanel.setImageDisplayMode(0);
+ }
+ this.editor.add(imgPanel, "Center");
+ }
+ return this.editor;
+ }
+
+ @Override
+ public boolean canEnterIntoParaPane() {
+ return false;
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
new file mode 100644
index 0000000000..05aa8ba465
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
@@ -0,0 +1,111 @@
+package com.fr.design.designer.ui;
+
+import com.fr.general.ImageWithSuffix;
+import java.awt.Graphics;
+import java.awt.Image;
+import javax.swing.JComponent;
+
+
+/**
+*
+* 图片控件中的已选图片展示面板
+*
+* @author Jimmy.Zheng created on 2022/8/11 21:17
+**/
+public class ImgPanel extends JComponent {
+ private static final long serialVersionUID = 1L;
+ private Image backgroundImage;
+ private int imageDisplayMode;
+ private int modeIndex;
+
+ public ImgPanel() {
+ this(null, 0);
+ }
+
+ public ImgPanel(Image image, int modeName) {
+ setBackgroundImage(image);
+ setImageDisplayMode(modeName);
+ }
+
+ public void setBackgroundImage(Image image) {
+ this.backgroundImage = image;
+ repaint();
+ }
+
+ public Image getBackgroundImage() {
+ return this.backgroundImage;
+ }
+
+ public void setImageDisplayMode(int modeName) {
+ if (modeName == 1) {
+ this.modeIndex = 0;
+ }
+
+ if (modeName == 0) {
+ this.imageDisplayMode = 0;
+ this.modeIndex = 1;
+ }
+
+ if (modeName == 2) {
+ this.imageDisplayMode = 2;
+ this.modeIndex = 2;
+ }
+ if (modeName == 4) {
+ this.imageDisplayMode = 4;
+ this.modeIndex = 3;
+ }
+ repaint();
+ }
+
+ public int getImageDisplayMode() {
+ return this.imageDisplayMode;
+ }
+
+ @Override
+ protected void paintComponent(Graphics g) {
+ super.paintComponent(g);
+
+ if (this.backgroundImage != null) {
+ if (this.backgroundImage instanceof ImageWithSuffix) {
+ this.backgroundImage = ((ImageWithSuffix) backgroundImage).getImage();
+ }
+ int width = getWidth();
+ int height = getHeight();
+ int imageWidth = this.backgroundImage.getWidth(this);
+ int imageHeight = this.backgroundImage.getHeight(this);
+
+ switch (this.modeIndex) {
+ case 0:
+ int x = (width - imageWidth) / 2;
+ int y = (height - imageHeight) / 2;
+ g.drawImage(this.backgroundImage, x, y, this);
+ break;
+ case 1:
+ for (int ix = 0; ix < width; ix += imageWidth) {
+ for (int iy = 0; iy < height; iy += imageHeight) {
+ g.drawImage(this.backgroundImage, ix, iy, this);
+ }
+ }
+
+ break;
+ case 2:
+ g.drawImage(this.backgroundImage, 0, 0, width, height, this);
+ break;
+ case 3:
+ double sx = 1.0 * width / imageWidth;
+ double sy = 1.0 * height / imageHeight;
+
+ if (sx > sy) {
+ sx = sy;
+ width = (int) (sx * imageWidth);
+ } else {
+ sy = sx;
+ height = (int) (sy * imageHeight);
+ }
+ int xx = (getWidth() - width) / 2;
+ int yy = (getHeight() - height) / 2;
+ g.drawImage(this.backgroundImage, xx, yy, width, height, this);
+ }
+ }
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java
new file mode 100644
index 0000000000..9e72b5c2ac
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessiblePictureModelEditor.java
@@ -0,0 +1,77 @@
+package com.fr.design.mainframe.widget.accessibles;
+
+import com.fr.base.Style;
+import com.fr.design.DesignModelAdapter;
+import com.fr.design.designer.creator.XPicture;
+import com.fr.design.designer.ui.ImgPanel;
+import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.mainframe.DesignerContext;
+import com.fr.design.mainframe.WidgetPropertyPane;
+import com.fr.design.mainframe.widget.wrappers.PictureModelWrapper;
+import com.fr.design.report.SelectImagePane;
+import com.fr.form.ui.PictureWidget;
+import com.fr.general.ComparatorUtils;
+import com.fr.report.cell.FloatElement;
+import com.fr.report.cell.cellattr.CellImage;
+import javax.swing.JComponent;
+
+
+/**
+*
+* 图片控件的图片选择、编辑器
+*
+* @author Jimmy.Zheng created on 2022/8/11 21:13
+**/
+public class AccessiblePictureModelEditor extends UneditableAccessibleEditor {
+ protected FloatElement element = new FloatElement();
+ private PictureWidget pic;
+
+ public AccessiblePictureModelEditor(PictureWidget pic) {
+ super(new PictureModelWrapper());
+ this.pic = pic;
+ }
+
+ @Override
+ public FloatElement getValue() {
+ return (FloatElement) super.getValue();
+ }
+
+ @Override
+ protected void showEditorPane() {
+ final SelectImagePane imageEditorPane = new SelectImagePane();
+ if (super.getValue() != null) {
+ this.element = ((FloatElement) super.getValue());
+ }
+ this.element.setStyle(Style.getInstance().deriveImageLayout(this.pic.getShowType()));
+ imageEditorPane.populate(this.element);
+ final Object oldValue = this.element.getValue();
+ final Style oldStyle = this.element.getStyle();
+ final String oldname = this.element.getName();
+ imageEditorPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
+ @Override
+ public void doOk() {
+ CellImage cellImage = imageEditorPane.update();
+ if ((!ComparatorUtils.equals(cellImage.getImage(), oldValue)) || (!ComparatorUtils.equals(cellImage.getStyle(), oldStyle))) {
+ AccessiblePictureModelEditor.this.element.setValue(cellImage.getImage());
+ AccessiblePictureModelEditor.this.element.setStyle(cellImage.getStyle());
+ AccessiblePictureModelEditor.this.element.setName(imageEditorPane.getSelectedImage() == null ? oldname : imageEditorPane.getSelectedImage().toString());
+ AccessiblePictureModelEditor.this.setValue(AccessiblePictureModelEditor.this.element);
+ AccessiblePictureModelEditor.this.pic.setShowType(cellImage.getStyle().getImageLayout());
+ AccessiblePictureModelEditor.this.pic.setPicUrl(element);
+ ImgPanel p = AccessiblePictureModelEditor.this.getCurrentImgPanel();
+ p.setBackgroundImage(cellImage.getBufferImage());
+ p.setImageDisplayMode(cellImage.getStyle().getImageLayout());
+ AccessiblePictureModelEditor.this.fireStateChanged();
+ DesignModelAdapter d = DesignModelAdapter.getCurrentModelAdapter();
+ d.fireTargetModified();
+ }
+ }
+ }).setVisible(true);
+ }
+
+ private ImgPanel getCurrentImgPanel() {
+ XPicture xPicture = (XPicture) WidgetPropertyPane.getInstance().getEditingFormDesigner().getSelectionModel().getSelection().getSelectedCreator();
+ JComponent editor = (JComponent) xPicture.getComponent(0);
+ return (ImgPanel) editor.getComponent(0);
+ }
+}
\ No newline at end of file
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java
new file mode 100644
index 0000000000..2dd4b54991
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleUrlLinkModelEditor.java
@@ -0,0 +1,57 @@
+package com.fr.design.mainframe.widget.accessibles;
+
+import com.fr.design.DesignModelAdapter;
+import com.fr.design.dialog.BasicDialog;
+import com.fr.design.dialog.DialogActionAdapter;
+import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
+import com.fr.design.gui.xpane.FormHyperlinkGroupPane;
+import com.fr.design.mainframe.DesignerContext;
+import com.fr.design.mainframe.widget.wrappers.UrlLinkModelWrapper;
+import com.fr.js.NameJavaScriptGroup;
+import com.fr.stable.bridge.StableFactory;
+
+/**
+ * 表单图片控件的链接编辑器
+ * @author Jimmy
+ */
+public class AccessibleUrlLinkModelEditor extends UneditableAccessibleEditor {
+ private FormHyperlinkGroupPane hyperlinkPane;
+
+ public AccessibleUrlLinkModelEditor() {
+ super(new UrlLinkModelWrapper());
+ }
+ /**
+ * 原插件使用
+ * DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop(
+ * HyperlinkGroupPaneActionImpl.getInstance()));
获取{@see this.hyperlinkPane}
+ * 合并插件依赖不到,换种方式 用{@see DesignerActivator将实例注册了}
+ */
+ @Override
+ protected void showEditorPane() {
+ if (this.hyperlinkPane == null) {
+ HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider = StableFactory.getMarkedInstanceObjectFromClass(HyperlinkGroupPaneActionProvider.XML_TAG,HyperlinkGroupPaneActionProvider.class);
+ this.hyperlinkPane = (FormHyperlinkGroupPane) DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop(
+ hyperlinkGroupPaneActionProvider);
+ }
+ BasicDialog dialog = this.hyperlinkPane.showWindow(DesignerContext.getDesignerFrame());
+ dialog.addDialogActionListener(new DialogActionAdapter() {
+ @Override
+ public void doOk() {
+ super.doOk();
+ NameJavaScriptGroup hyperlinks = AccessibleUrlLinkModelEditor.this.hyperlinkPane.updateJSGroup();
+ AccessibleUrlLinkModelEditor.this.setValue(hyperlinks);
+ AccessibleUrlLinkModelEditor.this.fireStateChanged();
+ DesignModelAdapter d = DesignModelAdapter.getCurrentModelAdapter();
+ d.fireTargetModified();
+ }
+ });
+ this.hyperlinkPane.populate(getValue());
+
+ dialog.setVisible(true);
+ }
+
+ @Override
+ public NameJavaScriptGroup getValue() {
+ return (NameJavaScriptGroup) super.getValue();
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java
new file mode 100644
index 0000000000..c7bbff80a3
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/PictureEditor.java
@@ -0,0 +1,17 @@
+package com.fr.design.mainframe.widget.editors;
+
+import com.fr.design.mainframe.widget.accessibles.AccessiblePictureModelEditor;
+import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor;
+import com.fr.form.ui.PictureWidget;
+/**
+*
+* 图片控件的图片选择、编辑器
+*
+* @author Jimmy.Zheng created on 2022/8/11 21:15
+**/
+public class PictureEditor extends AccessiblePropertyEditor {
+
+ public PictureEditor(Object o) {
+ super(new AccessiblePictureModelEditor((PictureWidget) o));
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java
new file mode 100644
index 0000000000..195e8f5250
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/UrlLinkEditor.java
@@ -0,0 +1,17 @@
+package com.fr.design.mainframe.widget.editors;
+
+import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor;
+import com.fr.design.mainframe.widget.accessibles.AccessibleUrlLinkModelEditor;
+
+/**
+*
+* 图片控件的链接编辑器
+*
+* @author Jimmy.Zheng created on 2022/8/11 21:19
+**/
+public class UrlLinkEditor extends AccessiblePropertyEditor {
+
+ public UrlLinkEditor() {
+ super(new AccessibleUrlLinkModelEditor());
+ }
+}
\ No newline at end of file
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java
new file mode 100644
index 0000000000..82fcc85b43
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/PictureRenderer.java
@@ -0,0 +1,15 @@
+package com.fr.design.mainframe.widget.renderer;
+
+import com.fr.design.mainframe.widget.wrappers.PictureModelWrapper;
+
+/**
+ * 图片控件的图片编辑器的EncoderCellRenderer
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:29
+ **/
+public class PictureRenderer extends EncoderCellRenderer {
+
+ public PictureRenderer() {
+ super(new PictureModelWrapper());
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java
new file mode 100644
index 0000000000..a81187d2d5
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/renderer/UrlLinkRenderer.java
@@ -0,0 +1,16 @@
+package com.fr.design.mainframe.widget.renderer;
+
+
+import com.fr.design.mainframe.widget.wrappers.UrlLinkModelWrapper;
+
+/**
+ * 图片控件的链接编辑器的EncoderCellRenderer
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:29
+ **/
+public class UrlLinkRenderer extends EncoderCellRenderer {
+
+ public UrlLinkRenderer() {
+ super(new UrlLinkModelWrapper());
+ }
+}
\ No newline at end of file
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java
new file mode 100644
index 0000000000..ed9fd0a4ac
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/PictureModelWrapper.java
@@ -0,0 +1,34 @@
+package com.fr.design.mainframe.widget.wrappers;
+
+import com.fr.design.Exception.ValidationException;
+import com.fr.design.designer.properties.Decoder;
+import com.fr.design.designer.properties.Encoder;
+import com.fr.report.cell.FloatElement;
+import com.fr.stable.StringUtils;
+
+/**
+ * 图片选择器 {@link com.fr.design.mainframe.widget.accessibles.AccessiblePictureModelEditor}的 Wrapper
+ * 插件中直接移入,未作改动
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:25
+ **/
+public class PictureModelWrapper implements Encoder, Decoder {
+
+ @Override
+ public FloatElement decode(String txt) {
+ return null;
+ }
+
+ @Override
+ public void validate(String txt) throws ValidationException {
+ // do nothing
+ }
+
+ @Override
+ public String encode(FloatElement v) {
+ if (v != null) {
+ return v.getName();
+ }
+ return StringUtils.EMPTY;
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java
new file mode 100644
index 0000000000..a892065ad7
--- /dev/null
+++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/UrlLinkModelWrapper.java
@@ -0,0 +1,33 @@
+package com.fr.design.mainframe.widget.wrappers;
+
+import com.fr.design.Exception.ValidationException;
+import com.fr.design.designer.properties.Decoder;
+import com.fr.design.designer.properties.Encoder;
+import com.fr.js.NameJavaScriptGroup;
+
+/**
+ * 链接选择器 {@link com.fr.design.mainframe.widget.accessibles.AccessibleUrlLinkModelEditor}的 Wrapper
+ * 插件中直接移入,未作改动
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:28
+ **/
+public class UrlLinkModelWrapper implements Encoder, Decoder {
+
+ @Override
+ public NameJavaScriptGroup decode(String txt) {
+ return null;
+ }
+
+ @Override
+ public void validate(String txt) throws ValidationException {
+ // do nothing
+ }
+
+ @Override
+ public String encode(NameJavaScriptGroup v) {
+ if (v.size() > 0) {
+ return v.getNameHyperlink(0).getName();
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
index af32f596c4..92d1fc6a4a 100644
--- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
+++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
@@ -41,6 +41,7 @@ import com.fr.design.form.parameter.FormParaDesigner;
import com.fr.design.fun.ElementUIProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
+import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.design.hyperlink.ReportletHyperlinkPane;
import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.hyperlink.popup.MobilePopupPane;
@@ -55,6 +56,7 @@ import com.fr.design.login.message.DesignerMessageHelper;
import com.fr.design.login.socketio.LoginAuthServer;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.FormHierarchyTreePane;
+import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.design.mainframe.InformationCollector;
import com.fr.design.mainframe.JTemplateEvent;
import com.fr.design.mainframe.WidgetPropertyPane;
@@ -143,14 +145,13 @@ import com.fr.start.common.DesignerStartupPool;
import com.fr.task.Once;
import com.fr.workspace.WorkContext;
import com.fr.xml.ReportXMLUtils;
-
-import javax.swing.SwingWorker;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
+import javax.swing.SwingWorker;
/**
* Created by juhaoyu on 2018/1/31.
@@ -404,6 +405,7 @@ public class DesignerActivator extends Activator implements Prepare {
private static void registerOtherPane() {
StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class);
+ StableFactory.registerMarkedObject(HyperlinkGroupPaneActionProvider.XML_TAG, HyperlinkGroupPaneActionImpl.getInstance());
}
/**
diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java
index 24d23565c0..aad478348f 100644
--- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java
+++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java
@@ -242,6 +242,7 @@ public class ImagePreLoader {
"com/fr/design/images/buttonicon/widget/label_16_normal.svg",
"com/fr/web/images/form/resources/button_16.png",
"com/fr/design/images/buttonicon/widget/button_16.png",
+ "com/fr/web/images/form/resources/picture_widget_16.png",
"com/fr/design/images/buttonicon/widget/button_16_normal.svg",
"com/fr/design/images/buttonicon/widget/files_up.png",
"com/fr/design/images/buttonicon/widget/files_up_normal.svg",
From 9d39612afbc341f37e6afe3cf4337871aa29806b Mon Sep 17 00:00:00 2001
From: rinoux
Date: Sun, 25 Sep 2022 16:37:54 +0800
Subject: [PATCH 003/310] =?UTF-8?q?REPORT-80583=20=E5=A4=9A=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E5=8F=82=E6=95=B0=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/fr/design/data/DesignTableDataManager.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
index 35a539a50c..2b654b6f49 100644
--- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
+++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
@@ -637,8 +637,9 @@ public abstract class DesignTableDataManager {
// 存储过程有些特殊处理
// 这个就简单直接获取暂存列表吧
- // TODO 参数处理?
if (needLoadingBar) {
+ ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData);
+ showParaWindow(parameterMap, parameters);
MultiResultTableDataWrapper.loadingBar.start();
}
return DataOperator.getInstance().previewMultiResultTableData(tableData, parameterMap, 0);
From 177af481bea505bef6ff05677d46684ca25c0b68 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 12:52:18 +0800
Subject: [PATCH 004/310] =?UTF-8?q?REPORT-80491=20linux=E8=AE=BE=E8=AE=A1?=
=?UTF-8?q?=E5=99=A8=E8=B0=83=E7=94=A8=E7=B3=BB=E7=BB=9F=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=A4=B9=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=97=AA=E9=80=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/fr/design/os/impl/SupportOSImpl.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
index 5751c3ecb9..d8eda915b7 100644
--- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
+++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
@@ -152,7 +152,13 @@ public enum SupportOSImpl implements SupportOS {
@Override
public boolean support() {
- return (OperatingSystem.isLinux() && Arch.getArch() == Arch.ARM) || MACOS_12_VERSION_ADAPTER.support();
+ boolean javafxExist = true;
+ try {
+ Class.forName("javafx.stage.FileChooser");
+ } catch (ClassNotFoundException e) {
+ javafxExist = false;
+ }
+ return !javafxExist || (OperatingSystem.isLinux() && Arch.getArch() == Arch.ARM) || MACOS_12_VERSION_ADAPTER.support();
}
},
From 2f8216cd831e7ae6d83d323bfc75e19fb774a8c9 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 13:45:48 +0800
Subject: [PATCH 005/310] =?UTF-8?q?REPORT-75998=20=E8=BF=9B=E5=85=A5?=
=?UTF-8?q?=E5=BC=80=E5=8F=91=E8=80=85=E8=B0=83=E8=AF=95&=E6=9D=83?=
=?UTF-8?q?=E9=99=90=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=E9=80=BB=E8=BE=91?=
=?UTF-8?q?=E5=A4=84=E7=90=86=E3=80=81=E5=AE=8C=E5=96=84=E9=80=9A=E9=85=8D?=
=?UTF-8?q?=E7=AC=A6=E3=80=81=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2=E3=80=81?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8B=BE=E9=80=89=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/AllowAuthorityEditAction.java | 8 ++
.../fr/design/module/DesignModuleFactory.java | 13 +++
.../fr/design/preview/DeveloperPreview.java | 8 ++
.../action/ShowSearchResultAction.java | 4 +-
.../replace/ui/ITReplaceMainDialog.java | 26 +++++-
.../replace/ui/ITReplaceNorthPanel.java | 5 +-
.../replace/ui/ITReplaceSouthPanel.java | 7 +-
.../actions/replace/ui/ITTableButton.java | 1 -
.../actions/replace/ui/ITTableEditorPane.java | 4 +-
.../actions/replace/utils/ShowValueUtils.java | 79 +++++++++++++++----
.../fr/start/module/DesignerActivator.java | 2 +
11 files changed, 133 insertions(+), 24 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
index 1a0509d267..bb26e17118 100644
--- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
@@ -4,11 +4,14 @@ import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
+import com.fr.design.module.DesignModuleFactory;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
+import com.fr.invoke.Reflect;
+import com.fr.log.FineLoggerFactory;
/**
* Author : daisy
@@ -61,6 +64,11 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
+ try {
+ Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
+ } catch (Exception e) {
+ FineLoggerFactory.getLogger().error(e.getMessage(), e);
+ }
//画虚线
return true;
diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
index baed29be47..60a4dfcf18 100644
--- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
+++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
@@ -50,6 +50,7 @@ public class DesignModuleFactory {
private Class ITReplaceAction;
private Class formParaDesigner;
private Class paraPropertyPane;
+ private Class replacePane;
private Class extends HierarchyTreePane> formHierarchyPaneCls;
private Class extends BaseWidgetPropertyPane> widgetPropertyPane;
private Class buttonDetailPaneClass;
@@ -131,6 +132,18 @@ public class DesignModuleFactory {
return instance.ITReplaceAction;
}
+ /**
+ * 注册一下查找替换面板
+ * @param r
+ */
+ public static void registerReplacePane(Class r){
+ instance.replacePane = r;
+ }
+
+ public static Class getReplacePane(){
+ return instance.replacePane;
+ }
+
public static void registerParaPropertyPaneClass(Class p) {
instance.paraPropertyPane = p;
}
diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
index 69e514b408..5c0a623857 100644
--- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
+++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
@@ -6,9 +6,12 @@ import com.fr.design.fun.impl.AbstractPreviewProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
+import com.fr.design.module.DesignModuleFactory;
import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants;
+import com.fr.invoke.Reflect;
+import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
import java.util.Map;
@@ -47,6 +50,11 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate, ?> jt) {
super.onClick(jt);
+ try {
+ Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
+ } catch (Exception e) {
+ FineLoggerFactory.getLogger().error(e.getMessage(), e);
+ }
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
index 601b3d09e5..f555de9689 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
@@ -75,7 +75,7 @@ public enum ShowSearchResultAction implements ShowValue {
} else {
Map stringHashMap = info.getValue();
String content = stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY);
- if (content.contains(str) && StringUtils.isNotEmpty(content)) {
+ if (ShowValueUtils.contains(content,str) && StringUtils.isNotEmpty(content)) {
info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str));
info.getContent().setOldShowStr(content);
info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str));
@@ -416,6 +416,6 @@ public enum ShowSearchResultAction implements ShowValue {
* @return
*/
public boolean isTitleNameValid(Title title, String str){
- return title != null && GeneralUtils.objectToString(title.getTextObject()).contains(str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject()));
+ return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()),str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject()));
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index f145cae021..2a922902f7 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -52,8 +52,9 @@ public class ITReplaceMainDialog extends UIDialog {
private ITReplaceWestPanel westPanel;
private boolean searchFlag;
private String searchStr;
+ private static boolean existed = false;
- private ITReplaceMainDialog() {
+ public ITReplaceMainDialog() {
super(DesignerContext.getDesignerFrame());
init();
}
@@ -66,6 +67,7 @@ public class ITReplaceMainDialog extends UIDialog {
initFrame();
fitScreen();
ITReplaceFlag = true;
+ existed = true;
}
/**
@@ -309,6 +311,28 @@ public class ITReplaceMainDialog extends UIDialog {
}
}
+ /**
+ * 面板是否存在
+ * @return
+ */
+ public static boolean isExisted() {
+ return existed;
+ }
+
+ public static void setExisted(boolean existed) {
+ ITReplaceMainDialog.existed = existed;
+ }
+
+
+ /**
+ * 进入权限编辑状态&开发者调试时关闭面板
+ */
+ public static void close(){
+ if (isExisted()){
+ getInstance().dispose();
+ setExisted(false);
+ }
+ }
/**
* 检测结果是否合法
*/
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java
index bc4e82255f..a4fe1fef0f 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java
@@ -47,6 +47,7 @@ public class ITReplaceNorthPanel {
private static final int HEIGHT = 161;
private static final int BUTTON_WIDTH = 60;
private static final int BUTTON_GAP = 20;
+ private static final int MATCH_WIDTH = 70;
private int findLabelX, findLabelY, findLabelWidth, findLabelHeight;
@@ -83,7 +84,7 @@ public class ITReplaceNorthPanel {
resultLabel = new UILabel();
String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")};
- String[] replaceInputItems = new String[]{""};
+ String[] replaceInputItems = new String[]{StringUtils.EMPTY};
findCombobox = new UIComboBox(findItems.toArray());
rangeCombobox = new UIComboBox(rangeItems);
findInputCombobox = new UIComboBox(findInputItems.toArray()) {
@@ -247,7 +248,7 @@ public class ITReplaceNorthPanel {
private void setUIRadioButtonBounds(int x, int y, int templateWidth) {
matchX = x + templateWidth / 60;
matchY = y + 90;
- matchWidth = templateWidth;
+ matchWidth = MATCH_WIDTH;
matchHeight = 25;
matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
index 7db6b52850..8921dce5ff 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
@@ -18,7 +18,12 @@ public class ITReplaceSouthPanel {
public ITReplaceSouthPanel() {
itTableEditor = new ITTableEditor();
tableEditorPane = new ITTableEditorPane<>(itTableEditor);
- RowSorter sorter = new TableRowSorter(itTableEditor);
+ RowSorter sorter = new TableRowSorter(itTableEditor){
+ @Override
+ public boolean isSortable(int column) {
+ return column != 0 || column != 6;
+ }
+ };
tableEditorPane.getEditTable().setRowSorter(sorter);
tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254));
tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight());
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
index 4c94cc1147..03717a725c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
@@ -43,7 +43,6 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) {
ITReplaceMainDialog.setITReplaceFlag(true);
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString())));
- ReportComponentComposite composite = (ReportComponentComposite) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getCurrentReportComponentPane();
}
ITReplaceMainDialog.setITReplaceFlag(false);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
index 928c2da67d..c35f2ef14d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
@@ -71,7 +71,7 @@ public class ITTableEditorPane extends BasicPane {
int row = ((JTable) e.getSource()).rowAtPoint(e.getPoint());
int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint());
if (col == 0) {
- ITContent content = (ITContent) editTable.getValueAt(row, 7);
+ ITContent content = (ITContent) editTable.getValueAt(row, 6);
if (content.isSelected()) {
content.setSelected(false);
editTable.setValueAt(content.isSelected(), row, col);
@@ -187,7 +187,7 @@ public class ITTableEditorPane extends BasicPane {
*/
public static void selectAllOrNull(Boolean value) {
for (int i = 0; i < getEditTable().getRowCount(); i++) {
- ((ITContent) (getEditTable().getValueAt(i, 7))).setSelected(value);
+ ((ITContent) (getEditTable().getValueAt(i, 6))).setSelected(value);
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index b215a16c6d..b7da5fc23c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -1,9 +1,8 @@
package com.fr.design.actions.replace.utils;
-import com.fr.design.actions.replace.info.Info;
-
+import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
@@ -30,6 +29,20 @@ public class ShowValueUtils {
public static final String ANY_THING_REGEX = ".";
public static final String NUMBER_REGEX = "[0-9]";
public static final String ENGLISH_REGEX = "[a-zA-Z]";
+ private static List specialCharList = new ArrayList<>();
+ static {
+ //正则特殊字符:? * () [] {} ^ $
+ //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理
+ //$同理
+ specialCharList.add("*");
+ specialCharList.add("(");
+ specialCharList.add(")");
+ specialCharList.add("[");
+ specialCharList.add("]");
+ specialCharList.add("{");
+ specialCharList.add("}");
+ specialCharList.add("^");
+ }
/**
* 获取除内容外其他一次性展示所有的内容(名称、水印...)
@@ -42,9 +55,7 @@ public class ShowValueUtils {
if (StringUtils.isEmpty(searchStr)) {
return str;
} else {
- return "" +
- replaceAll(str, searchStr, "" + searchStr + "") +
- "
";
+ return updateHighlight(str, searchStr);
}
}
@@ -57,7 +68,11 @@ public class ShowValueUtils {
* @return 替换后的字符串
*/
public static String replaceAll(String str, String regex, String replacement) {
- return str.replace(regex, replacement);
+ if (ITReplaceMainDialog.isMatched()) {
+ return str.replaceAll(changeRegex(regex), replacement);
+ } else {
+ return str.replace(regex, replacement);
+ }
}
/**
@@ -70,6 +85,10 @@ public class ShowValueUtils {
regex = regex.replace(NUMBER, NUMBER_REGEX);
regex = regex.replace(ENGLISH, ENGLISH_REGEX);
regex = regex.replace(ANY_THING, ANY_THING_REGEX);
+ String change = "\\";
+ for (int i = 0 ; i < specialCharList.size() ; i ++){
+ regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i));
+ }
return regex;
}
@@ -101,18 +120,36 @@ public class ShowValueUtils {
return pairs;
}
+
/**
- * 更新高亮状态
+ * 更新高亮
*
- * @param info
- * @param replaceStr
+ * @param str
+ * @param searchStr
+ * @return
*/
- public static void updateHighlight(Info info, String replaceStr) {
- String s = info.getInfoShowStr(info);
- s = s.replace(info.getContent().getLastSearchStr(), "" + replaceStr + "");
- info.getContent().setShowStr(
- "" + s + "
"
- );
+ public static String updateHighlight(String str, String searchStr) {
+ if (ITReplaceMainDialog.isMatched()) {
+ String result = str;
+ Pattern pattern = Pattern.compile(changeRegex(searchStr));
+ Matcher matcher = pattern.matcher(str);
+ String head = "";
+ String tail = "";
+ int size = head.length() + tail.length();
+ int index = 0;
+ StringBuilder builder = new StringBuilder(str);
+ while (matcher.find()) {
+ builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail);
+ index += size;
+ }
+ return "" +
+ builder.toString() +
+ "
";
+ } else {
+ return "" +
+ replaceAll(str, searchStr, "" + searchStr + "") +
+ "
";
+ }
}
@@ -146,4 +183,16 @@ public class ShowValueUtils {
}
return failReturn;
}
+
+ public static boolean contains(String originStr, String matchStr) {
+ if (ITReplaceMainDialog.isMatched()) {
+ String str = changeRegex(matchStr);
+ Pattern pattern = Pattern.compile(str);
+ Matcher matcher = pattern.matcher(originStr);
+ return matcher.find();
+ } else {
+ return originStr.contains(matchStr);
+ }
+
+ }
}
diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
index af32f596c4..1a04c79ac9 100644
--- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
+++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
@@ -32,6 +32,7 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction;
import com.fr.design.actions.insert.flot.ImageFloatAction;
import com.fr.design.actions.insert.flot.TextBoxFloatAction;
import com.fr.design.actions.replace.ITReplaceAction;
+import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
import com.fr.design.bridge.DesignToolbarProvider;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.env.DesignerWorkspaceLoader;
@@ -466,6 +467,7 @@ public class DesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class);
+ DesignModuleFactory.registerReplacePane(ITReplaceMainDialog.class);
DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class);
DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);
DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class);
From 7f835f9f8f64067203ff4ed8bd54326c72a3c04b Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 14:48:43 +0800
Subject: [PATCH 006/310] =?UTF-8?q?REPORT-75998=20=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E9=80=BB=E8=BE=91=E3=80=81=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E9=80=9A=E9=85=8D=E7=AC=A6=E3=80=81=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=82=AC=E6=B5=AE=E5=85=83=E7=B4=A0=E5=9B=BE=E7=89=87=E5=88=A4?=
=?UTF-8?q?=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../replace/action/SearchManagerCenter.java | 2 +-
.../action/ShowSearchResultAction.java | 31 ++++++++++-------
.../action/content/cell/SearchCellAction.java | 1 +
.../floatelement/SearchFloatAction.java | 5 ++-
.../content/formula/FormulaReplaceObject.java | 34 -------------------
.../cell/SearchCellFormulaManager.java | 2 --
.../design/actions/replace/info/CellInfo.java | 28 ---------------
.../actions/replace/utils/ShowValueUtils.java | 9 ++---
8 files changed, 30 insertions(+), 82 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java
index 211ab41d66..0608bde483 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/SearchManagerCenter.java
@@ -61,7 +61,7 @@ public class SearchManagerCenter {
*/
public enum ManagerType implements SearchManager {
/**
- * 注册单元格不同值类型中自己特有的公式(数据列、子报表、公式、富文本,可自己添加)
+ * 注册单元格不同值类型中自己特有的公式(数据列、子报表、公式,可自己添加)
*/
CELL_FORMULA(0) {
@Override
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
index f555de9689..846263c5a9 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/ShowSearchResultAction.java
@@ -24,6 +24,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.general.GeneralUtils;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.FloatElement;
+import com.fr.report.cell.cellattr.core.RichText;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
import org.jetbrains.annotations.Nullable;
@@ -75,7 +76,7 @@ public enum ShowSearchResultAction implements ShowValue {
} else {
Map stringHashMap = info.getValue();
String content = stringHashMap.getOrDefault(objectContentKey, StringUtils.EMPTY);
- if (ShowValueUtils.contains(content,str) && StringUtils.isNotEmpty(content)) {
+ if (isValueValid(content, str, info)) {
info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str));
info.getContent().setOldShowStr(content);
info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str));
@@ -94,6 +95,11 @@ public enum ShowSearchResultAction implements ShowValue {
cellInfo.getContent().setSelected(true);
}
+ private boolean isValueValid(String content, String str, Info info) {
+ CellElement cellElement = (CellElement) info.getContent().getReplaceObject();
+ return ShowValueUtils.contains(content, str) && StringUtils.isNotEmpty(content) && !(cellElement.getValue() instanceof RichText);
+
+ }
},
/**
* 搜索JS事件
@@ -139,7 +145,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4JS(Map map, List jsInfos, JSInfo info, String str) {
if (map.containsKey(objectNameKey) && StringUtils.isNotEmpty(map.get(objectNameKey))) {
String name = map.get(objectNameKey);
- if (name.contains(str)) {
+ if (ShowValueUtils.contains(name,str)) {
JSInfo nameJSInfo = info.copy();
nameJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str));
nameJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(name, str));
@@ -151,7 +157,7 @@ public enum ShowSearchResultAction implements ShowValue {
}
if (map.containsKey(objectContentKey) && StringUtils.isNotEmpty(map.get(objectContentKey))) {
String content = map.get(objectContentKey);
- if (content.contains(str)) {
+ if (ShowValueUtils.contains(content,str)) {
JSInfo contentJSInfo = info.copy();
contentJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(content, str));
contentJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str));
@@ -195,7 +201,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4SQLContent(Map map, List sqlInfos, SQLInfo info, String str) {
if (map.containsKey(objectContentKey) && StringUtils.isNotEmpty(map.get(objectContentKey))) {
String content = map.get(objectContentKey);
- if (content.contains(str)) {
+ if (ShowValueUtils.contains(content,str)) {
SQLInfo contentJSInfo = info.copy();
contentJSInfo.getContent().setShowStr(ShowValueUtils.getCommonString(content, str));
contentJSInfo.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str));
@@ -231,7 +237,7 @@ public enum ShowSearchResultAction implements ShowValue {
if (((FloatInfo) info).isChartExist()) {
ChartCollection chartCollection = (ChartCollection) floatElement.getValue();
for (int i = 0; i < chartCollection.getChartCount(); i++) {
- if (isTitleNameValid(chartCollection.getChart(i).getTitle(),str)) {
+ if (isTitleNameValid(chartCollection.getChart(i).getTitle(), str)) {
String titleName = GeneralUtils.objectToString(chartCollection.getChart(i).getTitle().getTextObject());
FloatInfo floatInfo = ((FloatInfo) info).copy();
floatInfo.setFloatChartIndex(i);
@@ -244,7 +250,7 @@ public enum ShowSearchResultAction implements ShowValue {
}
}
} else {
- if (GeneralUtils.objectToString(floatElement.getValue()).contains(str)) {
+ if (ShowValueUtils.contains(GeneralUtils.objectToString(floatElement.getValue()), str)) {
FloatInfo floatInfo = ((FloatInfo) info).copy();
setShowInfo(floatInfo, GeneralUtils.objectToString(floatElement.getValue()), str);
floatInfos.add(floatInfo);
@@ -285,7 +291,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4Component(Map stringHashMap, ArrayList componentInfos, ComponentInfo info, String str) {
if (stringHashMap.containsKey(objectContentKey)) {
String content = stringHashMap.get(objectContentKey);
- if (content.contains(str)) {
+ if (ShowValueUtils.contains(content,str)) {
info.getContent().setShowStr(ShowValueUtils.getCommonString(content, str));
info.getContent().setOldShowStr(stringHashMap.get(objectContentKey));
info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(content, str));
@@ -319,7 +325,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4Widget(Map map, List widgetInfos, WidgetInfo info, String str) {
if (map.containsKey(objectNameKey)) {
String name = map.get(objectNameKey);
- if (StringUtils.isNotEmpty(name) && name.contains(str)) {
+ if (StringUtils.isNotEmpty(name) && ShowValueUtils.contains(name,str)) {
WidgetInfo nameInfo = info.copy(info);
nameInfo.getContent().setShowStr(ShowValueUtils.getCommonString(name, str));
nameInfo.getContent().setOldShowStr(map.get(objectNameKey));
@@ -331,7 +337,7 @@ public enum ShowSearchResultAction implements ShowValue {
}
if (map.containsKey(objectWaterMarkKey)) {
String waterMark = map.get(objectWaterMarkKey);
- if (StringUtils.isNotEmpty(waterMark) && waterMark.contains(str)) {
+ if (StringUtils.isNotEmpty(waterMark) && ShowValueUtils.contains(waterMark,str)) {
WidgetInfo widgetInfo = info.copy(info);
widgetInfo.getContent().setShowStr(ShowValueUtils.getCommonString(waterMark, str));
widgetInfo.getContent().setOldShowStr(map.get(objectWaterMarkKey));
@@ -368,7 +374,7 @@ public enum ShowSearchResultAction implements ShowValue {
private void searchMap4Formula(Map stringHashMap, List formulaInfos, FormulaInfo info, String str) {
if (stringHashMap.containsKey(objectContentKey)) {
String name = stringHashMap.get(objectContentKey);
- if (name.contains(str)) {
+ if (ShowValueUtils.contains(name,str)) {
info.getContent().setShowStr(ShowValueUtils.getCommonString(name, str));
info.getContent().setOldShowStr(stringHashMap.get(objectContentKey));
info.getContent().setOperatorArray(ShowValueUtils.getStringStartAndEndIndex(name, str));
@@ -411,11 +417,12 @@ public enum ShowSearchResultAction implements ShowValue {
/**
* 标题是否可用
+ *
* @param title
* @param str
* @return
*/
- public boolean isTitleNameValid(Title title, String str){
- return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()),str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject()));
+ public boolean isTitleNameValid(Title title, String str) {
+ return title != null && ShowValueUtils.contains(GeneralUtils.objectToString(title.getTextObject()), str) && StringUtils.isNotEmpty(GeneralUtils.objectToString(title.getTextObject()));
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
index 826b247e0c..0f2f6d181a 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
@@ -17,6 +17,7 @@ import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.GeneralUtils;
import com.fr.main.impl.WorkBook;
import com.fr.report.cell.CellElement;
+import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.poly.PolyECBlock;
import com.fr.report.report.Report;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
index 6f0a338b90..4a478b596e 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
@@ -7,6 +7,7 @@ import com.fr.design.actions.replace.info.FloatInfo;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
+import com.fr.general.ImageWithSuffix;
import com.fr.main.impl.WorkBook;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
@@ -84,7 +85,9 @@ public class SearchFloatAction implements SearchAction {
if (floatElement.getValue() instanceof ChartCollection) {
floatInfo.setChartExist(true);
}
- result.add(floatInfo);
+ if (!(floatElement.getValue() instanceof ImageWithSuffix)){
+ result.add(floatInfo);
+ }
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
index 720dbab1e8..e002832656 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
@@ -133,40 +133,6 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
return false;
}
},
- /**
- * 富文本
- */
- RICH_CHAR("RichChar") {
- @Override
- public Map getValue(Object... o) {
- HashMap map = new HashMap<>();
- if (o[0] instanceof RichChar) {
- if (StringUtils.isNotEmpty(((RichChar) o[0]).getText())) {
- map.put("content", (((RichChar) o[0]).getText()));
- }
- }
- return map;
- }
-
- @Override
- public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
- Object replaceObject = info.getContent().getReplaceObject();
- if (replaceObject instanceof RichChar) {
- RichChar richChar = (RichChar) replaceObject;
- info.updateOldStr(richChar.getText(), findStr);
- richChar.setText(ShowValueUtils.replaceAll(richChar.getText(), findStr, replaceStr));
- }
- }
-
- @Override
- public boolean check(Info info) {
- if (info.getContent().getReplaceObject() instanceof RichChar){
- RichChar richChar = (RichChar) info.getContent().getReplaceObject();
- return StringUtils.equals(richChar.getText(), info.getContent().getOldShowStr());
- }
- return false;
- }
- },
/**
* KV
*/
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java
index eee99bf203..59982245e3 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaManager.java
@@ -25,8 +25,6 @@ public class SearchCellFormulaManager implements SearchManager {
register(DS_COLUMN, SearchDSColumnFormulaAction.getInstance());
//公式
register(FORMULA, SearchCellFormulaTypeAction.getInstance());
- //富文本
- register(RICH_TEXT, SearchRichFormulaAction.getInstance());
//子报表
register(SUB_REPORT, SearchSubReportFormulaAction.getInstance());
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java
index 94a8f73ce5..e5a6ce4fa2 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/CellInfo.java
@@ -219,34 +219,6 @@ public class CellInfo implements Info {
return ((DSColumn) o.getValue()).getDSName();
}
},
-
- /**
- * 富文本形式
- * 为了不破坏富文本的格式,暂时不对样式不同的文本进行连接替换,每个样式不同的文本都是一个独立的个体
- */
- RICH_TEXT("RichText") {
- @Override
- public void setValue(CellInfo cellInfo, Object o, String findStr, String replaceStr) {
- cellInfo.updateOldStr(GeneralUtils.objectToString(((RichText) o).getContent()), findStr);
- Iterator it = ((RichText) o).charIterator();
- while (it.hasNext()) {
- RichChar richChar = it.next();
- richChar.setText(ShowValueUtils.replaceAll(richChar.getText(), findStr, replaceStr));
- }
- }
-
- @Override
- public void addValue2Map(Object o, HashMap map) {
- map.put("content", ((RichText) o).getContent());
- }
-
- @Override
- public String getCheckValue(Info info) {
- CellElement o = (CellElement) info.getContent().getReplaceObject();
- return ((RichText) o.getValue()).getContent();
- }
- },
-
/**
* 公式类型
*/
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index b7da5fc23c..c0d95e7079 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -31,7 +31,7 @@ public class ShowValueUtils {
public static final String ENGLISH_REGEX = "[a-zA-Z]";
private static List specialCharList = new ArrayList<>();
static {
- //正则特殊字符:? * () [] {} ^ $
+ //正则特殊字符:? * () [] {} ^ $ .
//如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理
//$同理
specialCharList.add("*");
@@ -42,6 +42,7 @@ public class ShowValueUtils {
specialCharList.add("{");
specialCharList.add("}");
specialCharList.add("^");
+ specialCharList.add(".");
}
/**
@@ -82,13 +83,13 @@ public class ShowValueUtils {
* @return
*/
public static String changeRegex(String regex) {
- regex = regex.replace(NUMBER, NUMBER_REGEX);
- regex = regex.replace(ENGLISH, ENGLISH_REGEX);
- regex = regex.replace(ANY_THING, ANY_THING_REGEX);
String change = "\\";
for (int i = 0 ; i < specialCharList.size() ; i ++){
regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i));
}
+ regex = regex.replace(NUMBER, NUMBER_REGEX);
+ regex = regex.replace(ENGLISH, ENGLISH_REGEX);
+ regex = regex.replace(ANY_THING, ANY_THING_REGEX);
return regex;
}
From 92bd5476c6fe342a0f7d7959d6a4b24aac912193 Mon Sep 17 00:00:00 2001
From: rinoux
Date: Mon, 26 Sep 2022 15:00:47 +0800
Subject: [PATCH 007/310] =?UTF-8?q?REPORT-80583=20=E5=A4=9A=E7=BB=93?=
=?UTF-8?q?=E6=9E=9C=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E8=A6=81?=
=?UTF-8?q?=E5=BC=B9=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/data/DesignTableDataManager.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
index 2b654b6f49..2ce2a7d828 100644
--- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
+++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
@@ -625,6 +625,8 @@ public abstract class DesignTableDataManager {
// 把storeProcedure写成xml文件到out
DataCoreXmlUtils.writeXMLStoreProcedure(writer, storeProcedure, null);
if (storeProcedure.getDataModelList().size() > 0 && !storeProcedure.isFirstExpand()) {
+ // 存储过程有些特殊处理
+ // 这个就简单直接获取暂存列表吧
return storeProcedure.getDataModelList().toArray(new ProcedureDataModel[0]);
}
ParameterProvider[] inParameters = DataOperator.getInstance().getStoreProcedureParameters(storeProcedure);
@@ -633,13 +635,14 @@ public abstract class DesignTableDataManager {
showParaWindow(parameterMap, inParameters);
}
storeProcedure.setFirstExpand(false);
+ } else {
+ ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData);
+ if (parameters.length > 0) {
+ showParaWindow(parameterMap, parameters);
+ }
}
- // 存储过程有些特殊处理
- // 这个就简单直接获取暂存列表吧
if (needLoadingBar) {
- ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData);
- showParaWindow(parameterMap, parameters);
MultiResultTableDataWrapper.loadingBar.start();
}
return DataOperator.getInstance().previewMultiResultTableData(tableData, parameterMap, 0);
From 3df37c4bddd4e397e7f72ac4ed692863d46e1a6d Mon Sep 17 00:00:00 2001
From: kerry
Date: Mon, 26 Sep 2022 15:49:51 +0800
Subject: [PATCH 008/310] =?UTF-8?q?REPORT-80444=20=E6=96=B0=E8=87=AA?=
=?UTF-8?q?=E9=80=82=E5=BA=94=E6=8E=A7=E4=BB=B6=E6=A0=B7=E5=BC=8F=E6=95=88?=
=?UTF-8?q?=E6=9E=9C=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../designer/creator/XCreatorUtils.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
index 5e7807698a..9b30a42d45 100644
--- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
+++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
@@ -19,6 +19,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
+import com.fr.design.fit.common.TemplateTool;
import com.fr.design.fun.ChartWidgetOptionProvider;
import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.fun.ParameterWidgetOptionProvider;
@@ -39,6 +40,7 @@ import com.fr.form.ui.ComboCheckBox;
import com.fr.form.ui.DateEditor;
import com.fr.form.ui.EditorHolder;
import com.fr.form.ui.ElementCaseEditor;
+import com.fr.form.ui.FieldEditor;
import com.fr.form.ui.FileEditor;
import com.fr.form.ui.FreeButton;
import com.fr.form.ui.IframeEditor;
@@ -51,6 +53,7 @@ import com.fr.form.ui.Radio;
import com.fr.form.ui.RadioGroup;
import com.fr.form.ui.TextArea;
import com.fr.form.ui.TextEditor;
+import com.fr.form.ui.ToggleButton;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.form.ui.Widget;
@@ -236,14 +239,30 @@ public class XCreatorUtils {
}
public static XCreator createThemedXCreator(Widget widget) {
+
JTemplate,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
if (theme instanceof FormTheme) {
widget = setupTemplateTheme(widget, true, (FormTheme) theme, TemplateThemeCompatible.NONE);
}
+ if (TemplateTool.isCurrentEditingNewJForm()){
+ resetWidgetDefaultProperty(widget);
+ }
return createXCreator(widget);
}
+ /**
+ * 新表单下控件的字体默认都为9pt
+ * @param widget 控件
+ */
+ private static void resetWidgetDefaultProperty(Widget widget) {
+ if (widget.acceptType(FieldEditor.class)) {
+ ((FieldEditor) widget).setFontSize(Widget.DEFAULT_FONT_PT_SIZE);
+ } else if (widget.acceptType(ToggleButton.class)) {
+ ((ToggleButton) widget).setFontSize(Widget.DEFAULT_FONT_PT_SIZE);
+ }
+ }
+
/**
* 创建creator
*
From a3041d2f0ba102fd8a7c0215407cfcd75a626f8e Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 16:05:39 +0800
Subject: [PATCH 009/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E7=BB=84=E5=90=88=E5=9B=BEJS=E3=80=81=E5=85=AC=E5=BC=8F?=
=?UTF-8?q?=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SearchChartCollectionFormulaAction.java | 33 ++++++++++++++-----
.../content/js/SearchChartJSAction.java | 29 ++++++++++++++++
.../actions/replace/info/ReplaceObject.java | 22 +++++--------
3 files changed, 62 insertions(+), 22 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
index 6d85266228..40ff04006c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
@@ -9,6 +9,7 @@ import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
+import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartattr.SwitchTitle;
import com.fr.chart.chartattr.Title;
@@ -28,6 +29,9 @@ import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
+import com.fr.plugin.chart.custom.CustomPlotFactory;
+import com.fr.plugin.chart.custom.VanChartCustomPlot;
+import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.StringUtils;
@@ -92,20 +96,31 @@ public class SearchChartCollectionFormulaAction {
Toolkit.i18nText("Fine-Design_Chart_Animation_Special"),
Toolkit.i18nText("Fine-Design_Chart_Interactive")
);
- if (chart.getPlot() != null) {
- NameJavaScriptGroup javaScriptGroup = chart.getPlot().getHotHyperLink();
- if (javaScriptGroup != null) {
- for (int i = 0; i < javaScriptGroup.size(); i++) {
- NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i);
- conditionContent.addOtherPos(javaScript.getName());
- SearchJSHighlightAction action = SearchJSHighlightAction.getInstance();
- action.searchJSFormulaFromOther(formulaInfos, conditionContent, javaScript.getJavaScript());
- }
+
+ if (chart.getPlot() instanceof VanChartCustomPlot){
+ VanChartCustomPlot plot = chart.getPlot();
+ for (int i = 0 ; i < plot.getCustomPlotList().size() ; i++){
+ ITContent customContent = ITContent.copy(conditionContent);
+ customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i))));
+ dealPlot(formulaInfos,customContent,plot.getCustomPlotList().get(i));
}
+ } else if (chart.getPlot() != null) {
+ dealPlot(formulaInfos,conditionContent,chart.getPlot());
}
}
+ private void dealPlot(List formulaInfos, ITContent content, Plot plot){
+ NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink();
+ if (javaScriptGroup != null) {
+ for (int i = 0; i < javaScriptGroup.size(); i++) {
+ NameJavaScript javaScript = javaScriptGroup.getNameHyperlink(i);
+ content.addOtherPos(javaScript.getName());
+ SearchJSHighlightAction action = SearchJSHighlightAction.getInstance();
+ action.searchJSFormulaFromOther(formulaInfos, content, javaScript.getJavaScript());
+ }
+ }
+ }
private void searchFormulaFromChartPresent(List formulaInfos, ITContent content, TopDefinitionProvider provider) {
searchPresent4Formula(provider.getCategoryPresent(), content, formulaInfos);
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
index bbcb960053..069167260a 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
@@ -7,14 +7,20 @@ import com.fr.design.actions.replace.info.JSInfo;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.actions.replace.utils.SearchJSUtils;
import com.fr.design.i18n.Toolkit;
+import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
+import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
+import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
+import com.fr.plugin.chart.custom.CustomPlotFactory;
+import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.collections.combination.Pair;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -60,7 +66,30 @@ public class SearchChartJSAction {
chartContent.addOtherPos(chartCollection.getChart(i).getChartName());
//坐标轴
searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i));
+ //组合图表-条件属性-超链特判
+ dealCustomPlot(jsInfos, conditionContent,chartCollection.getChart(i));
+ }
+ }
+ private void dealCustomPlot(List jsInfos, ITContent conditionContent, Chart chart) {
+ if (chart.getPlot() instanceof VanChartCustomPlot){
+ VanChartCustomPlot customPlot = chart.getPlot();
+ for (VanChartPlot plot : customPlot.getCustomPlotList()){
+ NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink();
+ if (javaScriptGroup != null){
+ for (int i = 0 ; i < javaScriptGroup.size();i++){
+ if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl){
+ ITContent content = ITContent.copy(conditionContent);
+ content.addOtherPos(
+ CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot)),
+ javaScriptGroup.getNameHyperlink(i).getName()
+ );
+ content.setReplaceObject(javaScriptGroup.getNameHyperlink(i));
+ jsInfos.add(new JSInfo(content));
+ }
+ }
+ }
+ }
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index 9f06a2d716..240ac6ba36 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -46,7 +46,7 @@ public enum ReplaceObject implements DealWithInfoValue {
} else {
NameJavaScript javaScript = ((NameJavaScript) (info.getContent().getReplaceObject()));
info.updateOldStr(javaScript.getName(), findStr);
- javaScript.setName(javaScript.getName().replaceAll(findStr, replaceStr));
+ javaScript.setName(ShowValueUtils.replaceAll(javaScript.getName(), findStr, replaceStr));
}
}
@@ -87,15 +87,13 @@ public enum ReplaceObject implements DealWithInfoValue {
@Override
public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
if (((JSInfo) info).isContent()) {
- if (operatorArray.size() > 0) {
- JavaScriptImpl javaScript = (JavaScriptImpl) ((Listener) (info.getContent().getReplaceObject())).getAction();
- info.updateOldStr(javaScript.getContent(), findStr);
- javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr));
- }
+ JavaScriptImpl javaScript = (JavaScriptImpl) ((Listener) (info.getContent().getReplaceObject())).getAction();
+ info.updateOldStr(javaScript.getContent(), findStr);
+ javaScript.setContent(ShowValueUtils.replaceAll(javaScript.getContent(), findStr, replaceStr));
} else {
Listener listener = ((Listener) ((info.getContent().getReplaceObject())));
info.updateOldStr(listener.getName(), findStr);
- listener.setName(listener.getName().replaceAll(findStr, replaceStr));
+ listener.setName(ShowValueUtils.replaceAll(listener.getName(), findStr, replaceStr));
}
}
@@ -135,12 +133,10 @@ public enum ReplaceObject implements DealWithInfoValue {
@Override
public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
if (((JSInfo) info).isContent()) {
- if (operatorArray.size() > 0) {
- VanChartHtmlLabel htmlLabel = ((VanChartHtmlLabel) (info.getContent().getReplaceObject()));
- StringBuilder stringBuilder = new StringBuilder(htmlLabel.getCustomText());
- info.updateOldStr(htmlLabel.getCustomText(), findStr);
- htmlLabel.setCustomText(ShowValueUtils.replaceAll(htmlLabel.getCustomText(), findStr, replaceStr));
- }
+ VanChartHtmlLabel htmlLabel = ((VanChartHtmlLabel) (info.getContent().getReplaceObject()));
+ StringBuilder stringBuilder = new StringBuilder(htmlLabel.getCustomText());
+ info.updateOldStr(htmlLabel.getCustomText(), findStr);
+ htmlLabel.setCustomText(ShowValueUtils.replaceAll(htmlLabel.getCustomText(), findStr, replaceStr));
}
}
From eca25b845df9100f487390816f1d9c90a78c9af0 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 16:14:26 +0800
Subject: [PATCH 010/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A=E3=80=81=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/cell/SearchCellAction.java | 1 -
.../content/floatelement/SearchFloatAction.java | 2 +-
.../chart/SearchChartCollectionFormulaAction.java | 10 +++++-----
.../condition/SearchFormulaConditionAction.java | 1 -
.../action/content/js/SearchChartJSAction.java | 12 ++++++------
.../design/actions/replace/utils/ShowValueUtils.java | 12 +++++++++---
6 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
index 0f2f6d181a..826b247e0c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
@@ -17,7 +17,6 @@ import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.GeneralUtils;
import com.fr.main.impl.WorkBook;
import com.fr.report.cell.CellElement;
-import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.poly.PolyECBlock;
import com.fr.report.report.Report;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
index 4a478b596e..4eaa574bea 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
@@ -85,7 +85,7 @@ public class SearchFloatAction implements SearchAction {
if (floatElement.getValue() instanceof ChartCollection) {
floatInfo.setChartExist(true);
}
- if (!(floatElement.getValue() instanceof ImageWithSuffix)){
+ if (!(floatElement.getValue() instanceof ImageWithSuffix)) {
result.add(floatInfo);
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
index 40ff04006c..aadf2aee41 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java
@@ -97,20 +97,20 @@ public class SearchChartCollectionFormulaAction {
Toolkit.i18nText("Fine-Design_Chart_Interactive")
);
- if (chart.getPlot() instanceof VanChartCustomPlot){
+ if (chart.getPlot() instanceof VanChartCustomPlot) {
VanChartCustomPlot plot = chart.getPlot();
- for (int i = 0 ; i < plot.getCustomPlotList().size() ; i++){
+ for (int i = 0; i < plot.getCustomPlotList().size(); i++) {
ITContent customContent = ITContent.copy(conditionContent);
customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i))));
- dealPlot(formulaInfos,customContent,plot.getCustomPlotList().get(i));
+ dealPlot(formulaInfos, customContent, plot.getCustomPlotList().get(i));
}
} else if (chart.getPlot() != null) {
- dealPlot(formulaInfos,conditionContent,chart.getPlot());
+ dealPlot(formulaInfos, conditionContent, chart.getPlot());
}
}
- private void dealPlot(List formulaInfos, ITContent content, Plot plot){
+ private void dealPlot(List formulaInfos, ITContent content, Plot plot) {
NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink();
if (javaScriptGroup != null) {
for (int i = 0; i < javaScriptGroup.size(); i++) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java
index c6b8533219..44d495018b 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java
@@ -21,7 +21,6 @@ public class SearchFormulaConditionAction implements SearchConditionFormula {
}
-
@Override
public void searchFormulaFromCondition(List formulaInfos, ITContent content, Condition condition) {
if (((FormulaCondition) (condition)).getFormula() != null) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
index 069167260a..ad97655263 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java
@@ -67,18 +67,18 @@ public class SearchChartJSAction {
//坐标轴
searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i));
//组合图表-条件属性-超链特判
- dealCustomPlot(jsInfos, conditionContent,chartCollection.getChart(i));
+ dealCustomPlot(jsInfos, conditionContent, chartCollection.getChart(i));
}
}
private void dealCustomPlot(List jsInfos, ITContent conditionContent, Chart chart) {
- if (chart.getPlot() instanceof VanChartCustomPlot){
+ if (chart.getPlot() instanceof VanChartCustomPlot) {
VanChartCustomPlot customPlot = chart.getPlot();
- for (VanChartPlot plot : customPlot.getCustomPlotList()){
+ for (VanChartPlot plot : customPlot.getCustomPlotList()) {
NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink();
- if (javaScriptGroup != null){
- for (int i = 0 ; i < javaScriptGroup.size();i++){
- if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl){
+ if (javaScriptGroup != null) {
+ for (int i = 0; i < javaScriptGroup.size(); i++) {
+ if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl) {
ITContent content = ITContent.copy(conditionContent);
content.addOtherPos(
CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot)),
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index c0d95e7079..8f962667d3 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -1,7 +1,6 @@
package com.fr.design.actions.replace.utils;
-
import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
@@ -30,6 +29,7 @@ public class ShowValueUtils {
public static final String NUMBER_REGEX = "[0-9]";
public static final String ENGLISH_REGEX = "[a-zA-Z]";
private static List specialCharList = new ArrayList<>();
+
static {
//正则特殊字符:? * () [] {} ^ $ .
//如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理
@@ -84,8 +84,8 @@ public class ShowValueUtils {
*/
public static String changeRegex(String regex) {
String change = "\\";
- for (int i = 0 ; i < specialCharList.size() ; i ++){
- regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i));
+ for (int i = 0; i < specialCharList.size(); i++) {
+ regex = regex.replace(specialCharList.get(i), change + specialCharList.get(i));
}
regex = regex.replace(NUMBER, NUMBER_REGEX);
regex = regex.replace(ENGLISH, ENGLISH_REGEX);
@@ -185,6 +185,12 @@ public class ShowValueUtils {
return failReturn;
}
+ /**
+ * 支持通配符的contains
+ * @param originStr
+ * @param matchStr
+ * @return
+ */
public static boolean contains(String originStr, String matchStr) {
if (ITReplaceMainDialog.isMatched()) {
String str = changeRegex(matchStr);
From b583847db8be588f2797de936ea9aaecb35511b6 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 16:33:58 +0800
Subject: [PATCH 011/310] =?UTF-8?q?REPORT-75998=20=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E9=AD=94=E6=9C=AF=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../replace/ui/ITReplaceSouthPanel.java | 6 +++++-
.../actions/replace/ui/ITTableEditor.java | 6 +++---
.../actions/replace/ui/ITTableEditorPane.java | 10 +++++-----
.../actions/replace/utils/ShowValueUtils.java | 20 +++++++++----------
4 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
index 8921dce5ff..a240eba967 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java
@@ -14,6 +14,10 @@ import java.awt.Color;
public class ITReplaceSouthPanel {
ITTableEditorPane tableEditorPane;
ITTableEditor itTableEditor;
+ //勾选框索引
+ public static final int CHECKBOX_INDEX = 0;
+ //ITContent在表格的列索引
+ public static final int CONTENT_INDEX = 6;
public ITReplaceSouthPanel() {
itTableEditor = new ITTableEditor();
@@ -21,7 +25,7 @@ public class ITReplaceSouthPanel {
RowSorter sorter = new TableRowSorter(itTableEditor){
@Override
public boolean isSortable(int column) {
- return column != 0 || column != 6;
+ return column != CHECKBOX_INDEX || column != CONTENT_INDEX;
}
};
tableEditorPane.getEditTable().setRowSorter(sorter);
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
index 45e209f3a8..5c57e6d6a1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
@@ -48,8 +48,8 @@ public class ITTableEditor extends UITableModelAdapter {
this.setDefaultEditor(ITTableButton.class, new ITTableButton());
this.setDefaultRenderer(ITTableButton.class, new ITTableButton());
- this.createTable().getColumnModel().getColumn(6).setMaxWidth(50);
- this.createTable().getColumnModel().getColumn(0).setMaxWidth(50);
+ this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(50);
+ this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(50);
}
@@ -81,7 +81,7 @@ public class ITTableEditor extends UITableModelAdapter {
*/
@Override
public boolean isCellEditable(int row, int col) {
- return col == 6 || col == 0;
+ return col == ITReplaceSouthPanel.CONTENT_INDEX || col == ITReplaceSouthPanel.CHECKBOX_INDEX;
}
/**
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
index c35f2ef14d..a9fe470edd 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
@@ -70,8 +70,8 @@ public class ITTableEditorPane extends BasicPane {
public void mouseClicked(MouseEvent e) {
int row = ((JTable) e.getSource()).rowAtPoint(e.getPoint());
int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint());
- if (col == 0) {
- ITContent content = (ITContent) editTable.getValueAt(row, 6);
+ if (col == ITReplaceSouthPanel.CHECKBOX_INDEX) {
+ ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX);
if (content.isSelected()) {
content.setSelected(false);
editTable.setValueAt(content.isSelected(), row, col);
@@ -116,7 +116,7 @@ public class ITTableEditorPane extends BasicPane {
if (e.getClickCount() > 0) {
//获得选中列
int selectColumn = tableHeader.columnAtPoint(e.getPoint());
- if (selectColumn == 0) {
+ if (selectColumn == ITReplaceSouthPanel.CHECKBOX_INDEX) {
boolean value = !selectBox.isSelected();
selectBox.setSelected(value);
selectAllOrNull(value);
@@ -152,7 +152,7 @@ public class ITTableEditorPane extends BasicPane {
label.setHorizontalAlignment(SwingConstants.LEFT);
selectBox.setHorizontalAlignment(SwingConstants.CENTER);
selectBox.setBorderPainted(true);
- JComponent component = (column == 0) ? selectBox : label;
+ JComponent component = (column == ITReplaceSouthPanel.CHECKBOX_INDEX) ? selectBox : label;
component.setForeground(tableHeader.getForeground());
component.setBackground(tableHeader.getBackground());
component.setFont(tableHeader.getFont());
@@ -187,7 +187,7 @@ public class ITTableEditorPane extends BasicPane {
*/
public static void selectAllOrNull(Boolean value) {
for (int i = 0; i < getEditTable().getRowCount(); i++) {
- ((ITContent) (getEditTable().getValueAt(i, 6))).setSelected(value);
+ ((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value);
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index 8f962667d3..fa28c6de8b 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -79,18 +79,18 @@ public class ShowValueUtils {
/**
* 转换正则表达式
*
- * @param regex
+ * @param regexStr
* @return
*/
- public static String changeRegex(String regex) {
+ public static String changeRegex(String regexStr) {
String change = "\\";
for (int i = 0; i < specialCharList.size(); i++) {
- regex = regex.replace(specialCharList.get(i), change + specialCharList.get(i));
+ regexStr = regexStr.replace(specialCharList.get(i), change + specialCharList.get(i));
}
- regex = regex.replace(NUMBER, NUMBER_REGEX);
- regex = regex.replace(ENGLISH, ENGLISH_REGEX);
- regex = regex.replace(ANY_THING, ANY_THING_REGEX);
- return regex;
+ regexStr = regexStr.replace(NUMBER, NUMBER_REGEX);
+ regexStr = regexStr.replace(ENGLISH, ENGLISH_REGEX);
+ regexStr = regexStr.replace(ANY_THING, ANY_THING_REGEX);
+ return regexStr;
}
/**
@@ -170,13 +170,13 @@ public class ShowValueUtils {
* 支持正则表达式的indexOf
*
* @param str
- * @param regex
+ * @param regexStr
* @return
*/
- public static int indexOf(String str, String regex) {
+ public static int indexOf(String str, String regexStr) {
CharSequence inputStr = str;
int failReturn = -1;
- String patternStr = changeRegex(regex);
+ String patternStr = changeRegex(regexStr);
Pattern pattern = Pattern.compile(patternStr);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.find()) {
From a0c4924612e8c9afb9f03d25a14e5988cdf6c4ba Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Mon, 26 Sep 2022 17:46:01 +0800
Subject: [PATCH 012/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=85=AC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SearchCommit2DBJSFormulaAction.java | 16 ++++++++
.../SearchExportJSFormulaAction.java | 15 +++++++
.../widget/SearchDateEditorFormulaAction.java | 4 +-
.../widget/SearchTreeEditorFormulaAction.java | 40 +++++++++++++------
4 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
index 76ad5ee2bb..dec08034ab 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
@@ -1,5 +1,6 @@
package com.fr.design.actions.replace.action.content.formula.highlight.javascript;
+import com.fr.base.Formula;
import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionFormula;
import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionManager;
import com.fr.design.actions.replace.info.FormulaInfo;
@@ -10,6 +11,7 @@ import com.fr.js.Commit2DBJavaScript;
import com.fr.js.JavaScript;
import com.fr.write.DBManipulation;
import com.fr.write.DMLConfigJob;
+import com.fr.write.config.ColumnConfig;
import com.fr.write.config.DMLConfig;
import java.util.List;
@@ -41,12 +43,26 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
private void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) {
DMLConfig dmlConfig = dbManipulation.getDmlConfig();
+ //值中的公式
+ dealWithColumnValue(formulaInfos, content, dmlConfig);
//处理提交条件中的公式
dealWithCommit2DBCondition(formulaInfos, content, dmlConfig);
//处理DBManipulation
dealWithSubmitJob(formulaInfos, content, dmlConfig);
}
+ private void dealWithColumnValue(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
+ for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) {
+ ColumnConfig columnConfig = dmlConfig.getColumnConfig(i);
+ if (columnConfig.getColumnValue() instanceof Formula) {
+ ITContent configContent = ITContent.copy(content);
+ configContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value"));
+ configContent.setReplaceObject(columnConfig.getColumnValue());
+ formulaInfos.add(new FormulaInfo(configContent));
+ }
+ }
+ }
+
private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) {
//这边自定义事件不需要处理,只处理提交事件
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
index 716c2d908f..d19970c218 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
@@ -1,11 +1,14 @@
package com.fr.design.actions.replace.action.content.formula.highlight.javascript;
+import com.fr.base.Formula;
+import com.fr.base.Parameter;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.i18n.Toolkit;
import com.fr.js.ExportJavaScript;
import com.fr.js.JavaScript;
import com.fr.js.SingleJavaScript;
+import com.fr.stable.ParameterProvider;
import java.util.List;
@@ -26,8 +29,10 @@ public class SearchExportJSFormulaAction implements SearchJSFormula {
public void searchJSFormulaFromOther(List formulaInfos, ITContent content, JavaScript javaScript) {
//如果导出当前模板,可以存公式的地方就是命名方式-自定义
if (((ExportJavaScript) javaScript).isCurrentTemplate()) {
+ content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current"));
dealSingleJavaScript(formulaInfos, content, ((ExportJavaScript) javaScript).getCurrentTemplateJavaScript());
} else {
+ content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Other"));
List list = ((ExportJavaScript) javaScript).getJsListForOtherTemplates();
if (isListExist(list)) {
for (SingleJavaScript singleJavaScript : list) {
@@ -51,6 +56,16 @@ public class SearchExportJSFormulaAction implements SearchJSFormula {
);
formulaInfos.add(new FormulaInfo(newContent));
}
+ if (!javaScript.isExtendParameters()) {
+ ITContent paraContent = ITContent.copy(content);
+ for (ParameterProvider parameter : javaScript.getParameters()) {
+ if (parameter.getValue() instanceof Formula) {
+ paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value"));
+ paraContent.setReplaceObject(parameter.getValue());
+ formulaInfos.add(new FormulaInfo(paraContent));
+ }
+ }
+ }
}
/**
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java
index 67548b4157..28bd17c9b5 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchDateEditorFormulaAction.java
@@ -34,7 +34,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc
if (dateEditor.getEndDateFM() != null && StringUtils.isNotEmpty(dateEditor.getEndDateFM().getContent())) {
ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(dateEditor.getEndDateFM());
- newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_End_Time"));
+ newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_FS_End_Date"));
formulaInfos.add(new FormulaInfo(newContent));
}
}
@@ -44,7 +44,7 @@ public class SearchDateEditorFormulaAction extends AbstractSearchWidgetFormulaAc
if (dateEditor.getStartDateFM() != null && StringUtils.isNotEmpty(dateEditor.getStartDateFM().getContent())) {
ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(dateEditor.getStartDateFM());
- newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Chart_Start_Time"));
+ newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_FS_Start_Date"));
formulaInfos.add(new FormulaInfo(newContent));
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java
index d1251c5b8c..3a36eb510c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/SearchTreeEditorFormulaAction.java
@@ -1,11 +1,15 @@
package com.fr.design.actions.replace.action.content.formula.widget;
+import com.fr.data.Dictionary;
+import com.fr.data.impl.FormulaDictionary;
import com.fr.data.impl.FormulaDisplayDictionary;
+import com.fr.data.impl.TableDataDictionary;
import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.i18n.Toolkit;
+import com.fr.form.ui.DictionaryContainer;
import com.fr.form.ui.TreeEditor;
import com.fr.form.ui.tree.LayerConfig;
import com.fr.stable.StringUtils;
@@ -37,28 +41,38 @@ public class SearchTreeEditorFormulaAction extends AbstractSearchWidgetFormulaAc
if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() != null) {
//LayerConfig[] 急速分层构建
//TreeNodeWrapper 普通分层构建
- if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof LayerConfig[]) {
- LayerConfig[] layerConfigs = (LayerConfig[]) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig();
+ //TableDataDictionary 自动构建
+ Object object = ((TreeEditor) content.getReplaceObject()).getBuildModelConfig();
+ if (object instanceof LayerConfig[]) {
+ LayerConfig[] layerConfigs = (LayerConfig[]) object;
dealWithLayerConfigs(layerConfigs, content, formulaInfos);
- } else if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof TreeNodeWrapper) {
- TreeNodeWrapper wrapper = (TreeNodeWrapper) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig();
+ } else if (object instanceof TreeNodeWrapper) {
+ TreeNodeWrapper wrapper = (TreeNodeWrapper) object;
dealWithTreeNodeWrapper(wrapper, content, formulaInfos);
+ } else if (object instanceof TableDataDictionary) {
+ TableDataDictionary tableDataDictionary = (TableDataDictionary) object;
+ if (tableDataDictionary.getFormula() != null) {
+ ITContent autoContent = ITContent.copy(content);
+ autoContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Auto_Build"),
+ Toolkit.i18nText("Fine-Design_Basic_Display_Value")
+ );
+ autoContent.setReplaceObject(tableDataDictionary.getFormula());
+ formulaInfos.add(new FormulaInfo(autoContent));
+ }
}
+
}
}
}
private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List formulaInfos) {
for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) {
- if (((FormulaDisplayDictionary) attr.getDictionary()).getFormula() != null
- && StringUtils.isNotEmpty(((FormulaDisplayDictionary) attr.getDictionary()).getFormula().getContent())) {
- ITContent newContent = ITContent.copy(content);
- newContent.setReplaceObject(((FormulaDisplayDictionary) attr.getDictionary()).getFormula());
- newContent.addOtherPos(
- Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"),
- Toolkit.i18nText("Fine-Design_Basic_Layer_Build")
- );
- formulaInfos.add(new FormulaInfo(newContent));
+ if (attr.getDictionary() != null) {
+ DictionaryType type = DictionaryType.match(attr.getDictionary().getClass().getSimpleName());
+ if (type != null) {
+ type.searchFormulaFromDictionary(content, formulaInfos, attr.getDictionary());
+ }
}
}
}
From d64049244c7723940aa9e24d40bfa778c20f029f Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 10:06:10 +0800
Subject: [PATCH 013/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?=
=?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/AllowAuthorityEditAction.java | 11 ++------
.../actions/help/replace/ITReplaceHelper.java | 19 ++++++++++++++
.../actions/help/replace/ITReplaceUtils.java | 26 +++++++++++++++++++
.../fr/design/preview/DeveloperPreview.java | 9 +++----
.../SearchCommit2DBJSFormulaAction.java | 4 +--
.../replace/ui/ITReplaceMainDialog.java | 11 ++++----
.../actions/replace/utils/ShowValueUtils.java | 10 +++++--
7 files changed, 65 insertions(+), 25 deletions(-)
create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
create mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
index bb26e17118..c7287ad838 100644
--- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
@@ -1,17 +1,14 @@
package com.fr.design.actions;
-import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
+import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
-import com.fr.design.module.DesignModuleFactory;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
-import com.fr.invoke.Reflect;
-import com.fr.log.FineLoggerFactory;
/**
* Author : daisy
@@ -64,11 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
- try {
- Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
- } catch (Exception e) {
- FineLoggerFactory.getLogger().error(e.getMessage(), e);
- }
+ ITReplaceUtils.close();
//画虚线
return true;
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
new file mode 100644
index 0000000000..755a69ef63
--- /dev/null
+++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
@@ -0,0 +1,19 @@
+package com.fr.design.actions.help.replace;
+
+
+/**
+ * 定义一些底层操作
+ *
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-27
+ */
+public interface ITReplaceHelper {
+
+
+ /**
+ * 关闭面板
+ */
+ void close();
+
+}
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
new file mode 100644
index 0000000000..fe7ba9d8c3
--- /dev/null
+++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
@@ -0,0 +1,26 @@
+package com.fr.design.actions.help.replace;
+
+import com.fr.design.module.DesignModuleFactory;
+import com.fr.log.FineLoggerFactory;
+
+/**
+ * 工具类
+ *
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-27
+ */
+public class ITReplaceUtils {
+
+
+ /**
+ * 进入权限编辑&开发者调试时要关闭面板
+ */
+ public static void close(){
+ try {
+ DesignModuleFactory.getReplacePane().newInstance().close();
+ } catch (Exception e) {
+ FineLoggerFactory.getLogger().error(e.getMessage(), e);
+ }
+ }
+}
diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
index 5c0a623857..e8be79b641 100644
--- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
+++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
@@ -1,5 +1,7 @@
package com.fr.design.preview;
+import com.fr.design.actions.help.replace.ITReplaceHelper;
+import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.impl.AbstractPreviewProvider;
@@ -10,7 +12,6 @@ import com.fr.design.module.DesignModuleFactory;
import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants;
-import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
@@ -50,11 +51,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate, ?> jt) {
super.onClick(jt);
- try {
- Reflect.on(DesignModuleFactory.getReplacePane().newInstance()).call("close");
- } catch (Exception e) {
- FineLoggerFactory.getLogger().error(e.getMessage(), e);
- }
+ ITReplaceUtils.close();
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
index dec08034ab..946dc0d31c 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
@@ -52,7 +52,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
}
private void dealWithColumnValue(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
- for (int i = 0; i < dmlConfig.getColumnConfigCount(); i++) {
+ for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) {
ColumnConfig columnConfig = dmlConfig.getColumnConfig(i);
if (columnConfig.getColumnValue() instanceof Formula) {
ITContent configContent = ITContent.copy(content);
@@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
}
private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
- for (int i = 0; i < dmlConfig.getSubmitJobCount(); i++) {
+ for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) {
//这边自定义事件不需要处理,只处理提交事件
if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) {
ITContent newContent = ITContent.copy(content);
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index 2a922902f7..f6c82d8890 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -1,16 +1,14 @@
package com.fr.design.actions.replace.ui;
+import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.actions.replace.action.ShowSearchResultAction;
import com.fr.design.actions.replace.info.Info;
-import com.fr.design.actions.replace.utils.ShowValueUtils;
-
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.file.HistoryTemplateListCache;
-import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
@@ -41,7 +39,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
* @version 11.0
* created by Destiny.Lin on 2022-08-10
*/
-public class ITReplaceMainDialog extends UIDialog {
+public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
List extends Info> searchResultList = new ArrayList<>();
private static boolean ITReplaceFlag = false;
private static boolean matched = false;
@@ -315,7 +313,7 @@ public class ITReplaceMainDialog extends UIDialog {
* 面板是否存在
* @return
*/
- public static boolean isExisted() {
+ public boolean isExisted() {
return existed;
}
@@ -327,7 +325,8 @@ public class ITReplaceMainDialog extends UIDialog {
/**
* 进入权限编辑状态&开发者调试时关闭面板
*/
- public static void close(){
+ @Override
+ public void close(){
if (isExisted()){
getInstance().dispose();
setExisted(false);
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index fa28c6de8b..7ea1bdbbd0 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -140,7 +140,7 @@ public class ShowValueUtils {
int index = 0;
StringBuilder builder = new StringBuilder(str);
while (matcher.find()) {
- builder.replace(matcher.start() + index, matcher.end() + index, head + matcher.group() + tail);
+ builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail);
index += size;
}
return "" +
@@ -148,12 +148,18 @@ public class ShowValueUtils {
"
";
} else {
return "" +
- replaceAll(str, searchStr, "" + searchStr + "") +
+ replaceAll(str, searchStr, "" + changeHtmlStr(searchStr) + "") +
"
";
}
}
+ private static String changeHtmlStr(String searchStr){
+ String showStr = searchStr;
+ showStr = showStr.replace("<","<");
+ showStr = showStr.replace(">", ">");
+ return showStr;
+ }
/**
* 集合是否不为空
From 2162f3568574a8f8cea9c430d2521ff931856074 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 10:08:08 +0800
Subject: [PATCH 014/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?=
=?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/fr/design/module/DesignModuleFactory.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
index 60a4dfcf18..2c75509f52 100644
--- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
+++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
@@ -1,6 +1,7 @@
package com.fr.design.module;
import com.fr.base.chart.BaseChartCollection;
+import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.gui.chart.MiddleChartDialog;
@@ -136,11 +137,11 @@ public class DesignModuleFactory {
* 注册一下查找替换面板
* @param r
*/
- public static void registerReplacePane(Class r){
+ public static void registerReplacePane(Class r) {
instance.replacePane = r;
}
- public static Class getReplacePane(){
+ public static Class getReplacePane() {
return instance.replacePane;
}
From a35cfde57c6883266c66b7b3f0cfd12c249d8853 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 11:16:14 +0800
Subject: [PATCH 015/310] =?UTF-8?q?REPORT-75998=20=E6=94=B9=E5=8F=98?=
=?UTF-8?q?=E5=BA=95=E5=B1=82=E5=85=B3=E9=97=AD=E9=9D=A2=E6=9D=BF=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F=E3=80=81=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=88=99=E8=A1=A8?=
=?UTF-8?q?=E8=BE=BE=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/AllowAuthorityEditAction.java | 4 +-
.../actions/help/replace/ITReplaceUtils.java | 26 ------------
.../fr/design/module/DesignModuleFactory.java | 12 +++---
.../fr/design/preview/DeveloperPreview.java | 5 +--
.../replace/ui/ITReplaceMainDialog.java | 20 ++++-----
.../replace/utils/ReplaceOperator.java | 41 +++++++++++++++++++
.../actions/replace/utils/ShowValueUtils.java | 7 ++--
.../fr/start/module/DesignerActivator.java | 5 ++-
8 files changed, 63 insertions(+), 57 deletions(-)
delete mode 100644 designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
index c7287ad838..2b1ad225ac 100644
--- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
@@ -1,9 +1,9 @@
package com.fr.design.actions;
import com.fr.base.vcs.DesignerMode;
-import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
+import com.fr.design.module.DesignModuleFactory;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
@@ -61,7 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
- ITReplaceUtils.close();
+ DesignModuleFactory.getReplaceOperator().close();
//画虚线
return true;
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
deleted file mode 100644
index fe7ba9d8c3..0000000000
--- a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceUtils.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.fr.design.actions.help.replace;
-
-import com.fr.design.module.DesignModuleFactory;
-import com.fr.log.FineLoggerFactory;
-
-/**
- * 工具类
- *
- * @author Destiny.Lin
- * @version 11.0
- * created by Destiny.Lin on 2022-09-27
- */
-public class ITReplaceUtils {
-
-
- /**
- * 进入权限编辑&开发者调试时要关闭面板
- */
- public static void close(){
- try {
- DesignModuleFactory.getReplacePane().newInstance().close();
- } catch (Exception e) {
- FineLoggerFactory.getLogger().error(e.getMessage(), e);
- }
- }
-}
diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
index 2c75509f52..166ea80b1f 100644
--- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
+++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
@@ -51,7 +51,7 @@ public class DesignModuleFactory {
private Class ITReplaceAction;
private Class formParaDesigner;
private Class paraPropertyPane;
- private Class replacePane;
+ private static ITReplaceHelper replaceHelper;
private Class extends HierarchyTreePane> formHierarchyPaneCls;
private Class extends BaseWidgetPropertyPane> widgetPropertyPane;
private Class buttonDetailPaneClass;
@@ -135,14 +135,14 @@ public class DesignModuleFactory {
/**
* 注册一下查找替换面板
- * @param r
+ * @param
*/
- public static void registerReplacePane(Class r) {
- instance.replacePane = r;
+ public static void registerReplace(ITReplaceHelper replace) {
+ replaceHelper = replace;
}
- public static Class getReplacePane() {
- return instance.replacePane;
+ public static ITReplaceHelper getReplaceOperator() {
+ return replaceHelper;
}
public static void registerParaPropertyPaneClass(Class p) {
diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
index e8be79b641..07d40053c1 100644
--- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
+++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
@@ -1,7 +1,5 @@
package com.fr.design.preview;
-import com.fr.design.actions.help.replace.ITReplaceHelper;
-import com.fr.design.actions.help.replace.ITReplaceUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.impl.AbstractPreviewProvider;
@@ -12,7 +10,6 @@ import com.fr.design.module.DesignModuleFactory;
import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants;
-import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
import java.util.Map;
@@ -51,7 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate, ?> jt) {
super.onClick(jt);
- ITReplaceUtils.close();
+ DesignModuleFactory.getReplaceOperator().close();
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index f6c82d8890..784821b8fd 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -6,6 +6,7 @@ import com.fr.design.actions.replace.action.ShowSearchResultAction;
import com.fr.design.actions.replace.info.Info;
+import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.file.HistoryTemplateListCache;
@@ -29,6 +30,7 @@ import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
+import java.util.regex.Pattern;
import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
@@ -39,7 +41,7 @@ import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
* @version 11.0
* created by Destiny.Lin on 2022-08-10
*/
-public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
+public class ITReplaceMainDialog extends UIDialog {
List extends Info> searchResultList = new ArrayList<>();
private static boolean ITReplaceFlag = false;
private static boolean matched = false;
@@ -81,7 +83,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
}
}
}
- instance.fitScreen();
+ setExisted(true);
return instance;
}
@@ -285,6 +287,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
itTableEditor.clear();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
setSearchStr(searchStr);
+ ShowValueUtils.containPattern = Pattern.compile(ShowValueUtils.changeRegex(searchStr));
ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()));
if (searchAction != null) {
searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate));
@@ -313,7 +316,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
* 面板是否存在
* @return
*/
- public boolean isExisted() {
+ public static boolean isExisted() {
return existed;
}
@@ -322,16 +325,7 @@ public class ITReplaceMainDialog extends UIDialog implements ITReplaceHelper {
}
- /**
- * 进入权限编辑状态&开发者调试时关闭面板
- */
- @Override
- public void close(){
- if (isExisted()){
- getInstance().dispose();
- setExisted(false);
- }
- }
+
/**
* 检测结果是否合法
*/
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
new file mode 100644
index 0000000000..4ce50e4ef4
--- /dev/null
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
@@ -0,0 +1,41 @@
+package com.fr.design.actions.replace.utils;
+
+import com.fr.design.actions.help.replace.ITReplaceHelper;
+import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
+
+/**
+ * 操作面板
+ *
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-27
+ */
+public class ReplaceOperator implements ITReplaceHelper {
+
+ /**
+ * 进入权限编辑状态&开发者调试时关闭面板
+ */
+ @Override
+ public void close(){
+ if (isExisted()){
+ ITReplaceMainDialog.getInstance().dispose();
+ setExisted(false);
+ }
+ }
+
+ /**
+ * 面板是否存在
+ * @return
+ */
+ public boolean isExisted(){
+ return ITReplaceMainDialog.isExisted();
+ }
+
+ /**
+ * 设置面板存在属性
+ * @param existed
+ */
+ public void setExisted(boolean existed){
+ ITReplaceMainDialog.setExisted(existed);
+ }
+}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index 7ea1bdbbd0..438c3d98c7 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -28,6 +28,7 @@ public class ShowValueUtils {
public static final String ANY_THING_REGEX = ".";
public static final String NUMBER_REGEX = "[0-9]";
public static final String ENGLISH_REGEX = "[a-zA-Z]";
+ public static Pattern containPattern;
private static List specialCharList = new ArrayList<>();
static {
@@ -182,8 +183,7 @@ public class ShowValueUtils {
public static int indexOf(String str, String regexStr) {
CharSequence inputStr = str;
int failReturn = -1;
- String patternStr = changeRegex(regexStr);
- Pattern pattern = Pattern.compile(patternStr);
+ Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(inputStr);
if (matcher.find()) {
return matcher.start();
@@ -199,8 +199,7 @@ public class ShowValueUtils {
*/
public static boolean contains(String originStr, String matchStr) {
if (ITReplaceMainDialog.isMatched()) {
- String str = changeRegex(matchStr);
- Pattern pattern = Pattern.compile(str);
+ Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(originStr);
return matcher.find();
} else {
diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
index 1a04c79ac9..7e937911c3 100644
--- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
+++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
@@ -32,7 +32,7 @@ import com.fr.design.actions.insert.flot.FormulaFloatAction;
import com.fr.design.actions.insert.flot.ImageFloatAction;
import com.fr.design.actions.insert.flot.TextBoxFloatAction;
import com.fr.design.actions.replace.ITReplaceAction;
-import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
+import com.fr.design.actions.replace.utils.ReplaceOperator;
import com.fr.design.bridge.DesignToolbarProvider;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.env.DesignerWorkspaceLoader;
@@ -467,12 +467,13 @@ public class DesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class);
- DesignModuleFactory.registerReplacePane(ITReplaceMainDialog.class);
DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class);
DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);
DesignModuleFactory.registerFormHierarchyPaneClass(FormHierarchyTreePane.class);
DesignModuleFactory.registerWidgetPropertyPaneClass(WidgetPropertyPane.class);
DesignModuleFactory.registerButtonDetailPaneClass(FormSubmitButtonDetailPane.class);
+
+ DesignModuleFactory.registerReplace(new ReplaceOperator());
DesignModuleFactory.registerParameterReader(new FormParameterReader());
StableFactory.registerMarkedClass(BaseJForm.XML_TAG, NewJForm.class);
From 69ae4d6c1159eb4edc0ef43f1c8e3cf61b175550 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 11:19:21 +0800
Subject: [PATCH 016/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/actions/replace/utils/ShowValueUtils.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index 438c3d98c7..19ab2758f3 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -133,7 +133,7 @@ public class ShowValueUtils {
public static String updateHighlight(String str, String searchStr) {
if (ITReplaceMainDialog.isMatched()) {
String result = str;
- Pattern pattern = Pattern.compile(changeRegex(searchStr));
+ Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(str);
String head = "";
String tail = "";
From 77ee617fe3e38b1bd1152112dd06572dfca825b1 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 11:27:34 +0800
Subject: [PATCH 017/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=AD=A3?=
=?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=85=A5=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../highlight/javascript/SearchCommit2DBJSFormulaAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
index 946dc0d31c..99ed9774ce 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
@@ -64,7 +64,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
}
private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
- for (int i = 0, len = dmlConfig.getColumnConfigCount(); i < len; i++) {
+ for (int i = 0, len = dmlConfig.getSubmitJobCount(); i < len; i++) {
//这边自定义事件不需要处理,只处理提交事件
if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) {
ITContent newContent = ITContent.copy(content);
From c1c17b85932d5138940757dfc8c6648d93c64aee Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 12:05:19 +0800
Subject: [PATCH 018/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=85=83?=
=?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E6=8E=92=E5=BA=8F=E4=B8=AD?=
=?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/AllowAuthorityEditAction.java | 1 +
.../fr/design/module/DesignModuleFactory.java | 4 +++
.../fr/design/preview/DeveloperPreview.java | 1 +
.../actions/replace/ITReplaceAction.java | 1 +
.../content/formula/FormulaReplaceObject.java | 30 +++++++++++++++++++
.../replace/ui/ITReplaceMainDialog.java | 14 ---------
.../replace/utils/ReplaceOperator.java | 22 ++------------
7 files changed, 40 insertions(+), 33 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
index 2b1ad225ac..546a702979 100644
--- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
+++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
@@ -61,6 +61,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
+ //进入时要关闭查找替换面板
DesignModuleFactory.getReplaceOperator().close();
//画虚线
diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
index 166ea80b1f..272daa7f5c 100644
--- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
+++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
@@ -141,6 +141,10 @@ public class DesignModuleFactory {
replaceHelper = replace;
}
+ /**
+ * 获取查找替换面板的操作类
+ * @return
+ */
public static ITReplaceHelper getReplaceOperator() {
return replaceHelper;
}
diff --git a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
index 07d40053c1..176c44fe01 100644
--- a/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
+++ b/designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
@@ -48,6 +48,7 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate, ?> jt) {
super.onClick(jt);
+ //进入时要关闭查找替换面板
DesignModuleFactory.getReplaceOperator().close();
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java
index 1a9f67bb8a..358dc19652 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java
@@ -55,6 +55,7 @@ public class ITReplaceAction extends UpdateAction {
*/
public void actionPerformed(ActionEvent event) {
ITReplaceMainDialog mainFrame = ITReplaceMainDialog.getInstance();
+ mainFrame.fitScreen();
mainFrame.setVisible(true);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
index e002832656..6260565551 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
@@ -22,6 +22,7 @@ import com.fr.main.impl.WorkBook;
import com.fr.report.cell.cellattr.CellInsertPolicyAttr;
import com.fr.report.cell.cellattr.core.RichChar;
import com.fr.report.cell.cellattr.core.group.DSColumn;
+import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.stable.FormulaProvider;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
@@ -495,6 +496,35 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
public boolean check(Info info) {
return true;
}
+ },
+ /**
+ * 排序
+ */
+ FORMULA_SORT_EXPRESSION("FormulaSortExpression"){
+ @Override
+ public Map getValue(Object... o) {
+ HashMap map = new HashMap<>();
+ if (StringUtils.isNotEmpty(((FormulaSortExpression) o[0]).getFormula())) {
+ map.put("content", ((FormulaSortExpression) o[0]).getFormula());
+ }
+ return map;
+ }
+
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ Object replaceObject = info.getContent().getReplaceObject();
+ info.updateOldStr((((FormulaSortExpression) replaceObject).getFormula()), findStr);
+ ((FormulaSortExpression) replaceObject).setFormula(ShowValueUtils.replaceAll((((FormulaSortExpression) replaceObject).getFormula()), findStr, replaceStr));
+ }
+
+ @Override
+ public boolean check(Info info) {
+ if (info.getContent().getReplaceObject() instanceof FormulaSortExpression){
+ FormulaSortExpression sortExpression = (FormulaSortExpression) info.getContent().getReplaceObject();
+ return StringUtils.equals(sortExpression.getFormula(), info.getContent().getOldShowStr());
+ }
+ return false;
+ }
}
;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index 784821b8fd..f6fd8b6dc4 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -52,7 +52,6 @@ public class ITReplaceMainDialog extends UIDialog {
private ITReplaceWestPanel westPanel;
private boolean searchFlag;
private String searchStr;
- private static boolean existed = false;
public ITReplaceMainDialog() {
super(DesignerContext.getDesignerFrame());
@@ -67,7 +66,6 @@ public class ITReplaceMainDialog extends UIDialog {
initFrame();
fitScreen();
ITReplaceFlag = true;
- existed = true;
}
/**
@@ -83,7 +81,6 @@ public class ITReplaceMainDialog extends UIDialog {
}
}
}
- setExisted(true);
return instance;
}
@@ -312,17 +309,6 @@ public class ITReplaceMainDialog extends UIDialog {
}
}
- /**
- * 面板是否存在
- * @return
- */
- public static boolean isExisted() {
- return existed;
- }
-
- public static void setExisted(boolean existed) {
- ITReplaceMainDialog.existed = existed;
- }
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
index 4ce50e4ef4..e405c6be5f 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
@@ -13,29 +13,13 @@ import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
public class ReplaceOperator implements ITReplaceHelper {
/**
- * 进入权限编辑状态&开发者调试时关闭面板
+ * 关闭面板
+ * (当前关闭时机:进入权限编辑状态&开发者调试)
*/
@Override
public void close(){
- if (isExisted()){
- ITReplaceMainDialog.getInstance().dispose();
- setExisted(false);
- }
+ ITReplaceMainDialog.getInstance().dispose();
}
- /**
- * 面板是否存在
- * @return
- */
- public boolean isExisted(){
- return ITReplaceMainDialog.isExisted();
- }
- /**
- * 设置面板存在属性
- * @param existed
- */
- public void setExisted(boolean existed){
- ITReplaceMainDialog.setExisted(existed);
- }
}
From b4e8ed97828082f02625541dee39c59acbf0a540 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 15:59:02 +0800
Subject: [PATCH 019/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8A=A5=E8=A1=A8=E5=A1=AB=E6=8A=A5=E5=B1=9E?=
=?UTF-8?q?=E6=80=A7=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...laceHelper.java => ITReplaceOperator.java} | 2 +-
.../content/formula/FormulaReplaceObject.java | 2 +-
.../action/content/formula/FormulaTag.java | 13 +++
.../formula/cell/SearchCellFormulaAction.java | 3 +
.../SearchHighlightFormulaManager.java | 16 ++-
.../SearchCommit2DBJSFormulaAction.java | 17 ++-
.../javascript/SearchJSHighlightAction.java | 6 +-
.../present/SearchPresentHighlightAction.java | 91 ++++++++++++++++
.../value/SearchValueHighlightAction.java | 70 ++++++++++++
.../template/SearchTemplateFormulaAction.java | 101 ++++++++++++++++--
.../action/content/js/SearchWebJSAction.java | 3 +-
.../action/content/sql/SearchSQLAction.java | 3 +-
.../actions/replace/info/ReplaceObject.java | 1 -
.../actions/replace/info/base/SearchTag.java | 4 +
.../replace/ui/ITReplaceMainDialog.java | 1 -
.../replace/utils/ReplaceOperator.java | 4 +-
16 files changed, 306 insertions(+), 31 deletions(-)
rename designer-base/src/main/java/com/fr/design/actions/help/replace/{ITReplaceHelper.java => ITReplaceOperator.java} (85%)
create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java
create mode 100644 designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java
similarity index 85%
rename from designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
rename to designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java
index 755a69ef63..bbaaedd651 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceHelper.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/replace/ITReplaceOperator.java
@@ -8,7 +8,7 @@ package com.fr.design.actions.help.replace;
* @version 11.0
* created by Destiny.Lin on 2022-09-27
*/
-public interface ITReplaceHelper {
+public interface ITReplaceOperator {
/**
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
index 6260565551..02cd18810e 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
@@ -196,7 +196,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
/**
* present
*/
- PRESENT("Present") {
+ FORMULA_PRESENT("FormulaPresent") {
@Override
public Map getValue(Object... o) {
HashMap map = new HashMap<>();
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
index c5c12d3bfc..532a530883 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
@@ -1,6 +1,7 @@
package com.fr.design.actions.replace.action.content.formula;
import com.fr.chart.chartdata.MeterReportDefinition;
+import com.fr.data.VerifyItem;
import com.fr.design.actions.replace.info.DealWithInfoValue;
import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.SearchTag;
@@ -92,6 +93,18 @@ public enum FormulaTag implements DealWithInfoValue {
definition.setEndAreaName(ShowValueUtils.replaceAll(GeneralUtils.objectToString(definition.getEndAreaName()), findStr, replaceStr));
}
}
+ },
+ /**
+ * 模板填报属性数据校验提示
+ */
+ WRITE_ATTR_MESSAGE(SearchTag.WRITE_ATTR_MESSAGE) {
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof VerifyItem) {
+ VerifyItem item = (VerifyItem) info.getContent().getHoldObject();
+ item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr));
+ }
+ }
};
int index;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
index 9cfdd43433..b58008e7bc 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
@@ -106,6 +106,9 @@ public class SearchCellFormulaAction implements SearchCellFormula {
//处理HighlightAction
SearchHighlightFormulaAction searchHighlightAction = SearchHighlightFormulaAction.getInstance();
ITContent newContent = ITContent.copy(cellInfo.getContent());
+ newContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"),
+ highlightGroup.getHighlight(i).getName());
searchHighlightAction.dealWithHighlightAction(newContent, formulaInfos, highlightAction);
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java
index 28a5b752a9..290731f8f6 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaManager.java
@@ -3,6 +3,8 @@ package com.fr.design.actions.replace.action.content.formula.highlight;
import com.fr.design.actions.replace.action.SearchAction;
import com.fr.design.actions.replace.action.SearchManager;
import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction;
+import com.fr.design.actions.replace.action.content.formula.highlight.present.SearchPresentHighlightAction;
+import com.fr.design.actions.replace.action.content.formula.highlight.value.SearchValueHighlightAction;
import java.util.HashMap;
import java.util.Map;
@@ -17,19 +19,23 @@ import java.util.Map;
public class SearchHighlightFormulaManager implements SearchManager {
private Map highlightType = new HashMap<>();
public static final String HYPERLINK_HIGHLIGHT_ACTION = "HyperlinkHighlightAction";
+ public static final String PRESENT_HIGHLIGHT_ACTION = "PresentHighlightAction";
+ public static final String VALUE_HIGHLIGHT_ACTION = "ValueHighlightAction";
+
private SearchHighlightFormulaManager() {
//这边控件类型不做处理,在SearchWidgetFormulaAction统一处理即可
//条件属性-超级链接
register(HYPERLINK_HIGHLIGHT_ACTION, SearchJSHighlightAction.getInstance());
- //条件属性-...
- // TODO: 2022/9/14 条件属性的其他类型
+ //条件属性-形态
+ register(PRESENT_HIGHLIGHT_ACTION, SearchPresentHighlightAction.getInstance());
+ //条件属性-新值
+ register(VALUE_HIGHLIGHT_ACTION, SearchValueHighlightAction.getInstance());
}
-
@Override
public void registerAction(String tag, SearchAction searchAction) {
- if (searchAction instanceof SearchHighlightFormula){
+ if (searchAction instanceof SearchHighlightFormula) {
register(tag, (SearchHighlightFormula) searchAction);
}
}
@@ -42,7 +48,7 @@ public class SearchHighlightFormulaManager implements SearchManager {
/**
* 注册
*
- * @param tag 用于匹配的类型tag
+ * @param tag 用于匹配的类型tag
* @param searchHighlightFormula 对应的实现类
*/
private void register(String tag, SearchHighlightFormula searchHighlightFormula) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
index 99ed9774ce..1b1c352741 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
@@ -11,6 +11,7 @@ import com.fr.js.Commit2DBJavaScript;
import com.fr.js.JavaScript;
import com.fr.write.DBManipulation;
import com.fr.write.DMLConfigJob;
+import com.fr.write.NameSubmitJob;
import com.fr.write.config.ColumnConfig;
import com.fr.write.config.DMLConfig;
@@ -41,7 +42,13 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
}
}
- private void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) {
+ /**
+ * 处理DBManipulation
+ * @param formulaInfos
+ * @param content
+ * @param dbManipulation
+ */
+ public void dealWithDBManipulation(List formulaInfos, ITContent content, DBManipulation dbManipulation) {
DMLConfig dmlConfig = dbManipulation.getDmlConfig();
//值中的公式
dealWithColumnValue(formulaInfos, content, dmlConfig);
@@ -66,12 +73,14 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
private void dealWithSubmitJob(List formulaInfos, ITContent content, DMLConfig dmlConfig) {
for (int i = 0, len = dmlConfig.getSubmitJobCount(); i < len; i++) {
//这边自定义事件不需要处理,只处理提交事件
- if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob) {
+ NameSubmitJob job = dmlConfig.getNameSubmitJob(i);
+ if (job != null && job.getSubmitJob() instanceof DMLConfigJob) {
ITContent newContent = ITContent.copy(content);
newContent.addOtherPos(
- Toolkit.i18nText("Fine-Design_Basic_Write_Submit_Event")
+ Toolkit.i18nText("Fine-Design_Basic_Write_Submit_Event"),
+ job.getName()
);
- dealWithDBManipulation(formulaInfos, newContent, (((DMLConfigJob) dmlConfig.getSubmitJob(i)).getDBManipulation()));
+ dealWithDBManipulation(formulaInfos, newContent, (((DMLConfigJob) job.getSubmitJob()).getDBManipulation()));
}
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java
index 4d2bd573b8..40c31abe9e 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java
@@ -34,11 +34,7 @@ public class SearchJSHighlightAction implements SearchJSFormula {
for (int i = 0; i < nameJavaScriptGroup.size(); i++) {
//单元格条件属性-属性-超级链接里面参数的公式统一判断获取一下
ITContent newContent = ITContent.copy(content);
- newContent.addOtherPos(
- Toolkit.i18nText("Fine-Design_Basic_Cell"),
- Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"),
- nameJavaScriptGroup.getNameHyperlink(i).getName()
- );
+ newContent.addOtherPos(nameJavaScriptGroup.getNameHyperlink(i).getName());
addFormulaInfosFromJSPara(formulaInfos, newContent, nameJavaScriptGroup.getNameHyperlink(i).getJavaScript());
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java
new file mode 100644
index 0000000000..6826ff3fd1
--- /dev/null
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/present/SearchPresentHighlightAction.java
@@ -0,0 +1,91 @@
+package com.fr.design.actions.replace.action.content.formula.highlight.present;
+
+import com.fr.base.Formula;
+import com.fr.base.present.DictPresent;
+import com.fr.base.present.FormulaPresent;
+import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormula;
+import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction;
+import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType;
+import com.fr.design.actions.replace.info.FormulaInfo;
+import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.i18n.Toolkit;
+import com.fr.report.cell.TemplateCellElement;
+import com.fr.report.cell.cellattr.highlight.HighlightAction;
+import com.fr.report.cell.cellattr.highlight.PresentHighlightAction;
+
+import java.util.List;
+
+/**
+ * 条件属性-属性-形态
+ *
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-27
+ */
+public class SearchPresentHighlightAction implements SearchHighlightFormula {
+
+ private SearchPresentHighlightAction() {
+ }
+
+
+ @Override
+ public void dealWithHighlightAction(ITContent content, List formulaInfos, HighlightAction highlightAction) {
+ if (highlightAction instanceof PresentHighlightAction) {
+ ITContent newContent = ITContent.copy(content);
+ newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Present"));
+ PresentHighlightAction action = (PresentHighlightAction) highlightAction;
+ //公式形态
+ if (action.getPresent() instanceof FormulaPresent) {
+ newContent.setReplaceObject(action.getPresent());
+ formulaInfos.add(new FormulaInfo(newContent));
+ } else if (action.getPresent() instanceof DictPresent) {
+ //数据字典
+ DictPresent present = (DictPresent) action.getPresent();
+ if (present.getDictionary() != null) {
+ DictionaryType type = DictionaryType.match(present.getDictionary().getClass().getSimpleName());
+ if (type != null) {
+ type.searchFormulaFromDictionary(newContent, formulaInfos, present.getDictionary());
+ }
+ }
+ } else if (action.getValue() instanceof Formula) {
+ //普通
+ newContent.setReplaceObject(action.getValue());
+ formulaInfos.add(new FormulaInfo(newContent));
+
+ }
+ }
+ }
+
+ /**
+ * 获取单例
+ *
+ * @return
+ */
+ public static SearchPresentHighlightAction getInstance() {
+ return SearchPresentHighlightActionEnum.SINGLETON.getInstance();
+ }
+
+ /**
+ * 枚举实现单例
+ */
+ private enum SearchPresentHighlightActionEnum {
+ /**
+ * 单例实现
+ */
+ SINGLETON;
+ private SearchPresentHighlightAction instance;
+
+ SearchPresentHighlightActionEnum() {
+ instance = new SearchPresentHighlightAction();
+ }
+
+ /**
+ * 拿到对象
+ *
+ * @return
+ */
+ public SearchPresentHighlightAction getInstance() {
+ return instance;
+ }
+ }
+}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java
new file mode 100644
index 0000000000..1d692c197a
--- /dev/null
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/value/SearchValueHighlightAction.java
@@ -0,0 +1,70 @@
+package com.fr.design.actions.replace.action.content.formula.highlight.value;
+
+import com.fr.base.Formula;
+import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormula;
+import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchMobileHyperlinkFormulaAction;
+import com.fr.design.actions.replace.info.FormulaInfo;
+import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.i18n.Toolkit;
+import com.fr.report.cell.cellattr.highlight.HighlightAction;
+import com.fr.report.cell.cellattr.highlight.ValueHighlightAction;
+
+import java.util.List;
+
+/**
+ * 条件属性-新值-公式
+ *
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-27
+ */
+public class SearchValueHighlightAction implements SearchHighlightFormula {
+ private SearchValueHighlightAction() {
+ }
+
+ @Override
+ public void dealWithHighlightAction(ITContent content, List formulaInfos, HighlightAction highlightAction) {
+ if (highlightAction instanceof ValueHighlightAction) {
+ ValueHighlightAction action = (ValueHighlightAction) highlightAction;
+ if (action.getValue() instanceof Formula) {
+ ITContent valueContent = ITContent.copy(content);
+ valueContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_New_Value"));
+ valueContent.setReplaceObject(action.getValue());
+ formulaInfos.add(new FormulaInfo(valueContent));
+ }
+ }
+ }
+
+ /**
+ * 获取单例
+ *
+ * @return
+ */
+ public static SearchValueHighlightAction getInstance() {
+ return SearchValueHighlightActionEnum.SINGLETON.getInstance();
+ }
+
+ /**
+ * 枚举实现单例
+ */
+ private enum SearchValueHighlightActionEnum {
+ /**
+ * 单例实现
+ */
+ SINGLETON;
+ private SearchValueHighlightAction instance;
+
+ SearchValueHighlightActionEnum() {
+ instance = new SearchValueHighlightAction();
+ }
+
+ /**
+ * 拿到对象
+ *
+ * @return
+ */
+ public SearchValueHighlightAction getInstance() {
+ return instance;
+ }
+ }
+}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
index 39c98dda3f..9c57f2ad00 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
@@ -5,11 +5,22 @@ import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.base.io.AttrMark;
import com.fr.base.iofile.attr.WatermarkAttr;
+import com.fr.data.Verifier;
+import com.fr.data.VerifyItem;
+import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchCommit2DBJSFormulaAction;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
+import com.fr.main.impl.WorkBook;
import com.fr.report.core.ReportUtils;
+import com.fr.report.report.Report;
+import com.fr.report.worksheet.WorkSheet;
+import com.fr.report.write.BuiltInSQLSubmiter;
+import com.fr.report.write.ReportWriteAttr;
+import com.fr.report.write.SubmitVisitor;
+import com.fr.report.write.ValueVerifier;
+import com.fr.stable.CommonUtils;
import java.util.List;
@@ -33,8 +44,79 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false);
+ //参数
searchTemplateParaFormula(jTemplate, formulaInfos, content);
+ //水印
searchTemplateWaterMarkFormula(jTemplate, formulaInfos, content);
+ //报表填报属性
+ searchTemplateWriteAttrFormula(jTemplate, formulaInfos, content);
+ }
+
+ private void searchTemplateWriteAttrFormula(JTemplate jTemplate, List formulaInfos, ITContent content) {
+ if (jTemplate.getTarget() instanceof WorkBook) {
+ WorkBook workBook = (WorkBook) jTemplate.getTarget();
+ for (int i = 0, len = workBook.getReportCount(); i < len; i++) {
+ Report report = workBook.getReport(i);
+ if (report instanceof WorkSheet) {
+ ITContent sheetContent = ITContent.copy(content);
+ sheetContent.setSheetName(workBook.getReportName(i));
+ sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Report_Write_Attributes"));
+ dealWorkSheetAttr(formulaInfos, sheetContent, (WorkSheet) report);
+ }
+ }
+ }
+ }
+
+ private void dealWorkSheetAttr(List formulaInfos, ITContent sheetContent, WorkSheet report) {
+ ReportWriteAttr attr = report.getAttributeTarget(ReportWriteAttr.XML_TAG);
+ if (attr != null){
+ //提交
+ for (int i = 0 ,len = attr.getSubmitVisitorCount(); i < len ; i ++){
+ SubmitVisitor visitor = attr.getSubmitVisitor(i);
+ ITContent submitContent = ITContent.copy(sheetContent);
+ submitContent.addOtherPos(Toolkit.i18nText("FIne-Design_Basic_Submit"));
+ dealBuiltSQLSubmiter4Formula(formulaInfos, submitContent, visitor);
+ }
+
+ //数据校验
+ for (int i = 0 , len = attr.getValueVerifierCount() ;i < len ; i++){
+ Verifier verifier = attr.getVerifier(i);
+ if (verifier instanceof ValueVerifier){
+ ITContent content = ITContent.copy(sheetContent);
+ content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"));
+ dealValueVerifier4Formula(formulaInfos,content, (ValueVerifier) verifier);
+ }
+ }
+ }
+
+ }
+
+ private void dealValueVerifier4Formula(List formulaInfos, ITContent content, ValueVerifier verifier) {
+ ITContent verifyContent = ITContent.copy(content);
+ verifyContent.addOtherPos(verifier.getName());
+ for (int i = 0,len = verifier.getVerifyItemsCount() ;i < len ; i ++){
+ VerifyItem item = verifier.getVerifyItem(i);
+ if (item.getFormula() != null){
+ ITContent formulaContent = ITContent.copy(verifyContent);
+ formulaContent.setReplaceObject(item.getFormula());
+ formulaInfos.add(new FormulaInfo(formulaContent));
+ }
+ if (CommonUtils.canBeFormula(item.getMessage())){
+ ITContent messageContent = ITContent.copy(verifyContent);
+ messageContent.setReplaceObject(item.getMessage());
+ messageContent.setHoldObject(item);
+ formulaInfos.add(new FormulaInfo(messageContent));
+ }
+ }
+ }
+
+ private void dealBuiltSQLSubmiter4Formula(List formulaInfos, ITContent submitContent, SubmitVisitor visitor) {
+ if (visitor instanceof BuiltInSQLSubmiter){
+ BuiltInSQLSubmiter submiter = (BuiltInSQLSubmiter) visitor;
+ ITContent content = ITContent.copy(submitContent);
+ content.addOtherPos(submiter.getName());
+ SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos,content, submiter.getDBManipulation());
+ }
}
@Override
@@ -60,15 +142,16 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
}
}
- Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters();
- for (Parameter parameter : globalParameters) {
- if (parameter.getValue() instanceof Formula) {
- ITContent paraContent = ITContent.copy(content);
- paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter_Source_Type_Server"));
- paraContent.setReplaceObject(parameter);
- formulaInfos.add(new FormulaInfo(paraContent));
- }
- }
+ ////全局类二期再做
+ //Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters();
+ //for (Parameter parameter : globalParameters) {
+ // if (parameter.getValue() instanceof Formula) {
+ // ITContent paraContent = ITContent.copy(content);
+ // paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Parameter_Source_Type_Server"));
+ // paraContent.setReplaceObject(parameter);
+ // formulaInfos.add(new FormulaInfo(paraContent));
+ // }
+ //}
}
/**
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
index 0e35fa525f..0ceec53617 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
@@ -59,7 +59,8 @@ public class SearchWebJSAction implements SearchJS {
private void addJSInfos2ListFromWeb(JTemplate jTemplate, List jsInfos) {
- dealServerWebAttr(jTemplate, jsInfos);
+ ////服务器相关二期再做
+ //dealServerWebAttr(jTemplate, jsInfos);
dealTemplateWebAttr(jTemplate, jsInfos);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java
index f37f6acac1..f36e3afbeb 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/sql/SearchSQLAction.java
@@ -36,7 +36,8 @@ public class SearchSQLAction implements SearchAction {
content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false);
addModelDataInfos2Array(jTemplate, content, sqlInfos);
- addServerDataInfos2Array(content, sqlInfos);
+ ////服务器的数据二期再查询
+ //addServerDataInfos2Array(content, sqlInfos);
setSqlInfos(sqlInfos);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index 240ac6ba36..3d615e18a9 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -2,7 +2,6 @@ package com.fr.design.actions.replace.info;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.replace.utils.ShowValueUtils;
-import com.fr.design.data.DesignTableDataManager;
import com.fr.form.event.Listener;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index 2106c51c0f..f7bbff40e7 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -32,6 +32,10 @@ public class SearchTag {
* 终点区域名
*/
public static final int CHART_AREA_END_NAME = 5;
+ /**
+ * 模板填报属性数据校验提示
+ */
+ public static final int WRITE_ATTR_MESSAGE = 6;
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index f6fd8b6dc4..de4628b590 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -1,7 +1,6 @@
package com.fr.design.actions.replace.ui;
-import com.fr.design.actions.help.replace.ITReplaceHelper;
import com.fr.design.actions.replace.action.ShowSearchResultAction;
import com.fr.design.actions.replace.info.Info;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
index e405c6be5f..be6dc6eb1d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ReplaceOperator.java
@@ -1,6 +1,6 @@
package com.fr.design.actions.replace.utils;
-import com.fr.design.actions.help.replace.ITReplaceHelper;
+import com.fr.design.actions.help.replace.ITReplaceOperator;
import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
/**
@@ -10,7 +10,7 @@ import com.fr.design.actions.replace.ui.ITReplaceMainDialog;
* @version 11.0
* created by Destiny.Lin on 2022-09-27
*/
-public class ReplaceOperator implements ITReplaceHelper {
+public class ReplaceOperator implements ITReplaceOperator {
/**
* 关闭面板
From 49ac7e25e38f59e5f7b7c992d44cc5ea19576bbf Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Tue, 27 Sep 2022 16:06:53 +0800
Subject: [PATCH 020/310] =?UTF-8?q?REPORT-75998=20=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SearchCommit2DBJSFormulaAction.java | 1 +
.../template/SearchTemplateFormulaAction.java | 20 +++++++++----------
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
index 1b1c352741..54e971ee3e 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java
@@ -44,6 +44,7 @@ public class SearchCommit2DBJSFormulaAction implements SearchJSFormula {
/**
* 处理DBManipulation
+ *
* @param formulaInfos
* @param content
* @param dbManipulation
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
index 9c57f2ad00..6c8419512d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
@@ -69,9 +69,9 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
private void dealWorkSheetAttr(List formulaInfos, ITContent sheetContent, WorkSheet report) {
ReportWriteAttr attr = report.getAttributeTarget(ReportWriteAttr.XML_TAG);
- if (attr != null){
+ if (attr != null) {
//提交
- for (int i = 0 ,len = attr.getSubmitVisitorCount(); i < len ; i ++){
+ for (int i = 0, len = attr.getSubmitVisitorCount(); i < len; i++) {
SubmitVisitor visitor = attr.getSubmitVisitor(i);
ITContent submitContent = ITContent.copy(sheetContent);
submitContent.addOtherPos(Toolkit.i18nText("FIne-Design_Basic_Submit"));
@@ -79,12 +79,12 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
}
//数据校验
- for (int i = 0 , len = attr.getValueVerifierCount() ;i < len ; i++){
+ for (int i = 0, len = attr.getValueVerifierCount(); i < len; i++) {
Verifier verifier = attr.getVerifier(i);
- if (verifier instanceof ValueVerifier){
+ if (verifier instanceof ValueVerifier) {
ITContent content = ITContent.copy(sheetContent);
content.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Verify_Data_Verify"));
- dealValueVerifier4Formula(formulaInfos,content, (ValueVerifier) verifier);
+ dealValueVerifier4Formula(formulaInfos, content, (ValueVerifier) verifier);
}
}
}
@@ -94,14 +94,14 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
private void dealValueVerifier4Formula(List formulaInfos, ITContent content, ValueVerifier verifier) {
ITContent verifyContent = ITContent.copy(content);
verifyContent.addOtherPos(verifier.getName());
- for (int i = 0,len = verifier.getVerifyItemsCount() ;i < len ; i ++){
+ for (int i = 0, len = verifier.getVerifyItemsCount(); i < len; i++) {
VerifyItem item = verifier.getVerifyItem(i);
- if (item.getFormula() != null){
+ if (item.getFormula() != null) {
ITContent formulaContent = ITContent.copy(verifyContent);
formulaContent.setReplaceObject(item.getFormula());
formulaInfos.add(new FormulaInfo(formulaContent));
}
- if (CommonUtils.canBeFormula(item.getMessage())){
+ if (CommonUtils.canBeFormula(item.getMessage())) {
ITContent messageContent = ITContent.copy(verifyContent);
messageContent.setReplaceObject(item.getMessage());
messageContent.setHoldObject(item);
@@ -111,11 +111,11 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
}
private void dealBuiltSQLSubmiter4Formula(List formulaInfos, ITContent submitContent, SubmitVisitor visitor) {
- if (visitor instanceof BuiltInSQLSubmiter){
+ if (visitor instanceof BuiltInSQLSubmiter) {
BuiltInSQLSubmiter submiter = (BuiltInSQLSubmiter) visitor;
ITContent content = ITContent.copy(submitContent);
content.addOtherPos(submiter.getName());
- SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos,content, submiter.getDBManipulation());
+ SearchCommit2DBJSFormulaAction.getInstance().dealWithDBManipulation(formulaInfos, content, submiter.getDBManipulation());
}
}
From 8cb8c26b26d67e93fdc8543abc156ad50537113a Mon Sep 17 00:00:00 2001
From: "Jimmy.Zheng"
Date: Tue, 27 Sep 2022 16:35:10 +0800
Subject: [PATCH 021/310] =?UTF-8?q?REPORT-70593=20=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=90=88=E5=B9=B6=E4=B8=BB=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/designer/ui/ImgPanel.java | 56 ++++++++++---------
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
index 05aa8ba465..1c17c56c34 100644
--- a/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
+++ b/designer-form/src/main/java/com/fr/design/designer/ui/ImgPanel.java
@@ -1,17 +1,17 @@
package com.fr.design.designer.ui;
import com.fr.general.ImageWithSuffix;
+import com.fr.stable.Constants;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JComponent;
/**
-*
-* 图片控件中的已选图片展示面板
-*
-* @author Jimmy.Zheng created on 2022/8/11 21:17
-**/
+ * 图片控件中的已选图片展示面板
+ *
+ * @author Jimmy.Zheng created on 2022/8/11 21:17
+ **/
public class ImgPanel extends JComponent {
private static final long serialVersionUID = 1L;
private Image backgroundImage;
@@ -27,40 +27,41 @@ public class ImgPanel extends JComponent {
setImageDisplayMode(modeName);
}
+ public Image getBackgroundImage() {
+ return this.backgroundImage;
+ }
+
public void setBackgroundImage(Image image) {
this.backgroundImage = image;
repaint();
}
- public Image getBackgroundImage() {
- return this.backgroundImage;
+ public int getImageDisplayMode() {
+ return this.imageDisplayMode;
}
public void setImageDisplayMode(int modeName) {
- if (modeName == 1) {
- this.modeIndex = 0;
- }
-
- if (modeName == 0) {
- this.imageDisplayMode = 0;
- this.modeIndex = 1;
- }
-
- if (modeName == 2) {
- this.imageDisplayMode = 2;
- this.modeIndex = 2;
- }
- if (modeName == 4) {
- this.imageDisplayMode = 4;
- this.modeIndex = 3;
+ switch (modeName) {
+ case Constants.IMAGE_CENTER:
+ this.modeIndex = 0;
+ break;
+ case Constants.IMAGE_TILED:
+ this.imageDisplayMode = 0;
+ this.modeIndex = 1;
+ break;
+ case Constants.IMAGE_EXTEND:
+ this.imageDisplayMode = 2;
+ this.modeIndex = 2;
+ break;
+ case Constants.IMAGE_ADJUST:
+ this.imageDisplayMode = 4;
+ this.modeIndex = 3;
+ break;
+ default:
}
repaint();
}
- public int getImageDisplayMode() {
- return this.imageDisplayMode;
- }
-
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
@@ -105,6 +106,7 @@ public class ImgPanel extends JComponent {
int xx = (getWidth() - width) / 2;
int yy = (getHeight() - height) / 2;
g.drawImage(this.backgroundImage, xx, yy, width, height, this);
+ default:
}
}
}
From ac73c3f1699f26a23ed742cad05e380a678fe5dd Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 10:58:20 +0800
Subject: [PATCH 022/310] =?UTF-8?q?REPORT-81231=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91alphafine?=
=?UTF-8?q?=E4=B8=8D=E9=80=89=E6=8B=A9=E4=BB=BB=E4=BD=95TAB=EF=BC=8C?=
=?UTF-8?q?=E7=82=B9=E5=87=BBalphafine,=E6=97=A5=E5=BF=97=E4=B8=AD?=
=?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=8A=A5=E9=94=99=20REPORT-81241=E3=80=90?=
=?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F?=
=?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91?=
=?UTF-8?q?=E5=90=8E=E7=9A=84=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0?=
=?UTF-8?q?=E5=8F=8D=E5=BA=94=20REPORT-80752=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E5=8A=A8?=
=?UTF-8?q?=E6=80=81=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?=
=?UTF-8?q?=EF=BC=8C=E8=8B=A5=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E5=9C=A8?=
=?UTF-8?q?=E9=A6=96=E4=B8=AA=E4=B9=9F=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=20REPORT-81211=E3=80=90=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92=E4=BB=B6=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=8E=A8=E8=8D=90=E4=B8=8E?=
=?UTF-8?q?=E8=A7=86=E8=A7=89=E5=9B=BEUI=E4=B8=8D=E4=B8=80=E8=87=B4=201?=
=?UTF-8?q?=E3=80=81=E5=B1=8F=E8=94=BD=E6=8A=A5=E9=94=99=202=E3=80=81?=
=?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=AE=BE=E7=BD=AEreload=E6=96=B9=E6=B3=95=20?=
=?UTF-8?q?3=E3=80=81=E6=94=B9=E4=B8=8Bui?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineConfigManager.java | 8 +++
.../fr/design/remote/button/IconButton.java | 10 +++-
.../mainframe/alphafine/AlphaFineHelper.java | 2 +-
.../alphafine/component/AlphaFineFrame.java | 1 +
.../component/RecommendSearchLabel.java | 2 +-
.../alphafine/component/SearchHintPane.java | 5 +-
.../download/FineMarketDownloadManager.java | 9 +--
.../alphafine/preview/DefaultContentPane.java | 8 +++
.../preview/DefaultPluginContentPane.java | 58 ++++++++++++++++---
.../alphafine/search/SearchWorkerManager.java | 3 +-
10 files changed, 83 insertions(+), 23 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
index c74ddaa65a..2e78d1062d 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
@@ -484,6 +484,14 @@ public class AlphaFineConfigManager implements XMLable {
this.showTemplateShop = showTemplateShop;
}
+ /**
+ * 是否展示alphafine窗口,设置-搜索范围 0勾选,则不显示
+ */
+ public boolean needShowAlphaFineDialog() {
+ return hasTemplateShop() || isContainDocument() || isContainPlugin() ||
+ isContainAction() || isProductDynamics() || isContainMyTemplate();
+ }
+
/**
* 返回tab显示顺序
*/
diff --git a/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java b/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java
index 598ec7f057..d2d04b8d4c 100644
--- a/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java
+++ b/designer-base/src/main/java/com/fr/design/remote/button/IconButton.java
@@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils;
+import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
@@ -15,14 +16,19 @@ import java.awt.Graphics2D;
import java.awt.Point;
public final class IconButton extends JButton {
- public IconButton() {
+
+ public IconButton(Icon icon) {
super(StringUtils.EMPTY);
setContentAreaFilled(false);
setFocusPainted(false);
- setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_tab_close_normal.png"));
+ setIcon(icon);
setBorder(null);
}
+ public IconButton() {
+ this(BaseUtils.readIcon("com/fr/design/remote/images/icon_tab_close_normal.png"));
+ }
+
@Override
protected void paintBorder(Graphics g) {
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
index 441bd03ac6..126e883d9b 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
@@ -58,7 +58,7 @@ public class AlphaFineHelper {
* 弹出alphafine搜索面板
*/
public static void showAlphaFineDialog(boolean forceOpen) {
- if (!AlphaFineConfigManager.isALPHALicAvailable()) {
+ if (!AlphaFineConfigManager.isALPHALicAvailable() || !AlphaFineConfigManager.getInstance().needShowAlphaFineDialog()) {
return;
}
if (alphaFineDialog == null) {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
index 8e9a4d3cdd..0269480b60 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
@@ -920,6 +920,7 @@ public class AlphaFineFrame extends JFrame {
this.productNewsSearchWorkerManager.doSearch(searchTextBean);
this.documentWorkerManager.doSearch(searchTextBean);
this.pluginSearchWorkerManager.doSearch(searchTextBean);
+ this.templateResourceSearchWorkerManager.doSearch(searchTextBean);
}
/**
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java
index 8d3b760706..f7e017024f 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java
@@ -23,7 +23,7 @@ public class RecommendSearchLabel extends JPanel {
private static final Color RECOMMEND_SEARCH_KEY_BLUE = new Color(0x419bf9);
public RecommendSearchLabel(String title, @NotNull List tips) {
- this.setLayout(new FlowLayout(FlowLayout.LEFT));
+ this.setLayout(new FlowLayout(FlowLayout.CENTER));
this.setBackground(Color.WHITE);
JLabel recommend = new JLabel(title);
this.add(recommend);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java
index adc5fc8352..83a2fdffcd 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java
@@ -31,8 +31,9 @@ public class SearchHintPane extends JPanel {
private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title");
private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search");
private static final Icon ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg");
- private static final int HEIGHT = 305;
+ private static final int HEIGHT = 200;
private static final int WIDTH = 300;
+ private static final int TITLE_LABEL_HEIGHT = 30;
private static final int TITLE_FONT_SIZE = 14;
public SearchHintPane() {
@@ -45,6 +46,7 @@ public class SearchHintPane extends JPanel {
public SearchHintPane(List hints, Icon icon, String title) {
setLayout(new BorderLayout());
+ setBorder(BorderFactory.createEmptyBorder(40,0,0,0));
setBackground(Color.white);
setPreferredSize(new Dimension(WIDTH, HEIGHT));
setAlignmentY(SwingConstants.CENTER);
@@ -64,6 +66,7 @@ public class SearchHintPane extends JPanel {
description.setFont(DesignUtils.getDefaultGUIFont().applySize(TITLE_FONT_SIZE));
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
description.setHorizontalAlignment(SwingConstants.CENTER);
+ description.setPreferredSize(new Dimension(WIDTH, TITLE_LABEL_HEIGHT));
return description;
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
index 29172f94ef..127d2002b0 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
@@ -2,7 +2,6 @@ package com.fr.design.mainframe.alphafine.download;
import com.fr.base.svg.IconUtils;
import com.fr.common.util.Strings;
-import com.fr.decision.webservice.v10.log.download.utils.LogZipUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.extra.Process;
import com.fr.design.i18n.Toolkit;
@@ -14,7 +13,6 @@ import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper;
import com.fr.design.mainframe.toast.SimpleToast;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
-import com.fr.stable.pinyin.ChineseHelper;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileSystemView;
@@ -82,11 +80,8 @@ public class FineMarketDownloadManager {
if (fileName.endsWith(FineMarketConstants.ZIP)) {
File file = new File(fileName);
File parentDir = file.getParentFile();
- if (ChineseHelper.containChinese(fileName)) {
- IOUtils.unzip(file, parentDir.getAbsolutePath(), LogZipUtils.GBK);
- } else {
- IOUtils.unzip(file, parentDir.getAbsolutePath());
- }
+ // TODO:之前用的gbk解码太容易乱码了。这里应该自动识别编码,然后解压,但是要添加1个三方包,可能会赶不上发布。所以先暂时用utf8顶着。
+ IOUtils.unzip(file, parentDir.getAbsolutePath(), "UTF-8");
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java
index 56c14dc28a..99c312e882 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java
@@ -35,6 +35,14 @@ public class DefaultContentPane extends JPanel {
this.searchWorkerManager.showDefault(this);
}
+ /**
+ * 显示搜索结果
+ */
+ public void showResult(JPanel result) {
+ add(result);
+ repaint();
+ }
+
public DefaultContentPane() {
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java
index fc9838e9fb..9ed5003d36 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java
@@ -10,8 +10,9 @@ import com.fr.design.mainframe.alphafine.search.manager.SearchProviderRegistry;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
+import javax.swing.JPanel;
import javax.swing.SwingWorker;
-import java.awt.BorderLayout;
+import java.awt.CardLayout;
import java.util.ArrayList;
import java.util.List;
@@ -25,18 +26,46 @@ import java.util.List;
public class DefaultPluginContentPane extends DefaultContentPane {
private static final String[] HINTS = CloudCenter.getInstance().acquireConf("alphafine.plugin.recommend", "JS,API,JSON").split(",");
- // 左边展示内容,右边展示搜索提示
+ private static final String LOADING_PANE = "loading";
+ private static final String NETWORK_ERROR = "networkError";
+ private static final String RESULT_PANE = "result";
private SearchWorkerManager searchWorkerManager;
private CellType cellType;
+ private AlphaFineFrame parentWindow;
+ private CardLayout cardLayout;
+ private SearchLoadingPane searchLoadingPane;
+ private NetWorkFailedPane netWorkFailedPane;
+ private SwingWorker worker;
+
public DefaultPluginContentPane(CellType cellType, AlphaFineFrame parentWindow) {
super();
- this.setLayout(new BorderLayout());
+ this.cellType = cellType;
+ this.parentWindow = parentWindow;
+ this.cardLayout = new CardLayout();
+ this.setLayout(cardLayout);
this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE);
- new SwingWorker() {
+ initPanel();
+ add(searchLoadingPane, LOADING_PANE);
+ add(netWorkFailedPane, NETWORK_ERROR);
+ worker = createWorker();
+ worker.execute();
+ }
+
+ private void initPanel() {
+ this.searchLoadingPane = new SearchLoadingPane();
+ this.netWorkFailedPane = new NetWorkFailedPane(()-> reload());
+ }
+
+ private void switchPane(String tag) {
+ cardLayout.show(this, tag);
+ }
+
+ private SwingWorker createWorker() {
+ return new SwingWorker() {
@Override
protected Boolean doInBackground() throws Exception {
- add(new SearchLoadingPane());
+ switchPane(LOADING_PANE);
return AlphaFineHelper.isNetworkOk();
}
@@ -45,9 +74,8 @@ public class DefaultPluginContentPane extends DefaultContentPane {
super.done();
try {
boolean networkOk = get();
- removeAll();
if (!networkOk) {
- add(new NetWorkFailedPane());
+ switchPane(NETWORK_ERROR);
} else {
List searchKeys = new ArrayList<>();
for (String s : HINTS) {
@@ -64,10 +92,22 @@ public class DefaultPluginContentPane extends DefaultContentPane {
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
-
}
- }.execute();
+ };
+ }
+
+ @Override
+ public void showResult(JPanel result) {
+ add(result, RESULT_PANE);
+ switchPane(RESULT_PANE);
+ }
+ /**
+ * 网络异常时,重新加载
+ */
+ public void reload() {
+ worker = createWorker();
+ worker.execute();
}
public CellType getCellType() {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java
index bca8904a13..cdacd681d7 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java
@@ -135,8 +135,7 @@ public class SearchWorkerManager implements SearchManager {
searchResultPane.getSearchResultList().setModel(searchListModel);
searchResultPane.getSearchResultList().setSelectedIndex(0);
searchResultPane.getSearchResultList().requestFocus();
- defaultContentPane.add(searchResultPane);
- SwingUtilities.invokeLater(()->defaultContentPane.repaint());
+ SwingUtilities.invokeLater(()->defaultContentPane.showResult(searchResultPane));
}
@Override
From 1c781a2c9be59d2b5a8829d9cb8afd2bf2d3a30e Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 11:02:33 +0800
Subject: [PATCH 023/310] =?UTF-8?q?REPORT-81231=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91alphafine?=
=?UTF-8?q?=E4=B8=8D=E9=80=89=E6=8B=A9=E4=BB=BB=E4=BD=95TAB=EF=BC=8C?=
=?UTF-8?q?=E7=82=B9=E5=87=BBalphafine,=E6=97=A5=E5=BF=97=E4=B8=AD?=
=?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=8A=A5=E9=94=99=20REPORT-81241=E3=80=90?=
=?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F?=
=?UTF-8?q?=E3=80=91=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91?=
=?UTF-8?q?=E5=90=8E=E7=9A=84=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0?=
=?UTF-8?q?=E5=8F=8D=E5=BA=94=20REPORT-80752=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E5=8A=A8?=
=?UTF-8?q?=E6=80=81=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?=
=?UTF-8?q?=EF=BC=8C=E8=8B=A5=E6=8F=92=E4=BB=B6=E4=B8=AD=E5=BF=83=E5=9C=A8?=
=?UTF-8?q?=E9=A6=96=E4=B8=AA=E4=B9=9F=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=20REPORT-81211=E3=80=90=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92=E4=BB=B6=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97=E6=9F=A5=E8=AF=A2=E7=9A=84=E6=8E=A8=E8=8D=90=E4=B8=8E?=
=?UTF-8?q?=E8=A7=86=E8=A7=89=E5=9B=BEUI=E4=B8=8D=E4=B8=80=E8=87=B4=201?=
=?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9pr?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/download/FineMarketDownloadManager.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
index 127d2002b0..bc195865ac 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java
@@ -11,6 +11,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.model.TemplateResource;
import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper;
import com.fr.design.mainframe.toast.SimpleToast;
+import com.fr.file.FileCommonUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
@@ -81,7 +82,7 @@ public class FineMarketDownloadManager {
File file = new File(fileName);
File parentDir = file.getParentFile();
// TODO:之前用的gbk解码太容易乱码了。这里应该自动识别编码,然后解压,但是要添加1个三方包,可能会赶不上发布。所以先暂时用utf8顶着。
- IOUtils.unzip(file, parentDir.getAbsolutePath(), "UTF-8");
+ IOUtils.unzip(file, FileCommonUtils.getAbsolutePath(parentDir), "UTF-8");
}
}
From e24487da1e02f7369dd2e239d958524cfe586c2a Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 11:07:44 +0800
Subject: [PATCH 024/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?=
=?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/fr/design/module/DesignModuleFactory.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
index 272daa7f5c..bab9bb1ac8 100644
--- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
+++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
@@ -1,7 +1,7 @@
package com.fr.design.module;
import com.fr.base.chart.BaseChartCollection;
-import com.fr.design.actions.help.replace.ITReplaceHelper;
+import com.fr.design.actions.help.replace.ITReplaceOperator;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.gui.chart.MiddleChartDialog;
@@ -51,7 +51,7 @@ public class DesignModuleFactory {
private Class ITReplaceAction;
private Class formParaDesigner;
private Class paraPropertyPane;
- private static ITReplaceHelper replaceHelper;
+ private static ITReplaceOperator replaceHelper;
private Class extends HierarchyTreePane> formHierarchyPaneCls;
private Class extends BaseWidgetPropertyPane> widgetPropertyPane;
private Class buttonDetailPaneClass;
@@ -137,7 +137,7 @@ public class DesignModuleFactory {
* 注册一下查找替换面板
* @param
*/
- public static void registerReplace(ITReplaceHelper replace) {
+ public static void registerReplace(ITReplaceOperator replace) {
replaceHelper = replace;
}
@@ -145,7 +145,7 @@ public class DesignModuleFactory {
* 获取查找替换面板的操作类
* @return
*/
- public static ITReplaceHelper getReplaceOperator() {
+ public static ITReplaceOperator getReplaceOperator() {
return replaceHelper;
}
From 63a48b68867360453e5ad50ab24357540d55670f Mon Sep 17 00:00:00 2001
From: "Jimmy.Zheng"
Date: Wed, 28 Sep 2022 11:23:51 +0800
Subject: [PATCH 025/310] =?UTF-8?q?Revert=20"REPORT-70593=20=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=E6=8E=A7=E4=BB=B6=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=8E=9F=E6=8F=92=E4=BB=B6=E7=A6=81=E7=94=A8?=
=?UTF-8?q?=E3=80=82=E6=96=B9=E6=A1=88=E5=8F=82=E8=80=83https://kms.finere?=
=?UTF-8?q?s.com/pages/viewpage.action=3FpageId=3D457117391"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit 1c5d2aa9
---
.../src/main/java/com/fr/start/module/DesignerActivator.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
index e7a00a4f19..9787a12158 100644
--- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
+++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
@@ -160,7 +160,6 @@ public class DesignerActivator extends Activator implements Prepare {
private LogHandler logHandler = null;
private static final String PLUGIN_EXPORT_IMAGE_SETTING = "com.fr.plugin.exportimagesettings.v11";
- private static final String PICTURE_WIDGET_PLUGIN_ID = "com.fr.plugin.widget.picture.v11";
private final Once pushUpdateTask = new Once(new Runnable() {
@Override
public void run() {
@@ -552,7 +551,6 @@ public class DesignerActivator extends Activator implements Prepare {
private void prepareDefaultEmbedPluginInfo() {
addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PLUGIN_EXPORT_IMAGE_SETTING));
- addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PICTURE_WIDGET_PLUGIN_ID));
}
private void startBBSLoginAuthServer() {
From a0a92ce1c472388a467e99e7339aba29598c227b Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 14:38:43 +0800
Subject: [PATCH 026/310] =?UTF-8?q?REPORT-75998=20=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=85=AC=E5=BC=8F?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E9=AB=98=E4=BA=AE=E3=80=81=E6=8C=89=E9=92=AE=E7=BD=AE=E7=81=B0?=
=?UTF-8?q?=E3=80=81=E6=90=9C=E7=B4=A2sheet=E5=90=8D=E7=A7=B0=E5=85=AC?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/formula/FormulaTag.java | 12 ++++++++
.../formula/data/SearchDataFormulaAction.java | 4 +--
.../template/SearchTemplateFormulaAction.java | 25 ++++++++++++++++
.../actions/replace/info/base/SearchTag.java | 5 ++++
.../replace/ui/ITReplaceMainDialog.java | 29 +++++++++++++++++++
.../actions/replace/ui/ITTableEditorPane.java | 16 +++++++++-
6 files changed, 88 insertions(+), 3 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
index 532a530883..0a20c503ce 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
@@ -7,6 +7,7 @@ import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.general.GeneralUtils;
+import com.fr.main.impl.WorkBook;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.stable.collections.combination.Pair;
import org.jetbrains.annotations.Nullable;
@@ -105,6 +106,17 @@ public enum FormulaTag implements DealWithInfoValue {
item.setMessage(ShowValueUtils.replaceAll(item.getMessage(), findStr, replaceStr));
}
}
+ },
+ SHEET_NAME(SearchTag.SHEET_NAME) {
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof WorkBook) {
+ WorkBook workBook = (WorkBook) info.getContent().getHoldObject();
+ int sheetId = Integer.parseInt(info.getContent().getSheetID());
+ String name = workBook.getReportName(sheetId);
+ workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr));
+ }
+ }
};
int index;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java
index aa296a0721..3d4c66adc0 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/data/SearchDataFormulaAction.java
@@ -31,8 +31,8 @@ public class SearchDataFormulaAction implements SearchFormula {
//模板数据集
dealTemplateData(jTemplate, formulaInfos);
- //服务器数据集
- dealServerData(formulaInfos);
+ ////服务器数据集二期再考虑
+ //dealServerData(formulaInfos);
}
private void dealServerData(List fomulaInfos) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
index 6c8419512d..de653dd706 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
@@ -10,8 +10,13 @@ import com.fr.data.VerifyItem;
import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchCommit2DBJSFormulaAction;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.actions.replace.info.base.SearchTag;
+import com.fr.design.file.HistoryTemplateListCache;
+import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
+import com.fr.design.mainframe.ReportComponentComposite;
+import com.fr.design.mainframe.SheetNameTabPane;
import com.fr.main.impl.WorkBook;
import com.fr.report.core.ReportUtils;
import com.fr.report.report.Report;
@@ -50,6 +55,26 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
searchTemplateWaterMarkFormula(jTemplate, formulaInfos, content);
//报表填报属性
searchTemplateWriteAttrFormula(jTemplate, formulaInfos, content);
+ //sheet名称
+ searchTemplateSheetNameFormula(jTemplate, formulaInfos, content);
+ }
+
+ private void searchTemplateSheetNameFormula(JTemplate jTemplate, List formulaInfos, ITContent content) {
+ if (jTemplate.getTarget() instanceof WorkBook) {
+ WorkBook workBook = (WorkBook) jTemplate.getTarget();
+ for (int i = 0, len = workBook.getReportCount(); i < len; i++) {
+ String name = workBook.getReportName(i);
+ if (CommonUtils.canBeFormula(name)) {
+ ITContent sheetContent = ITContent.copy(content);
+ sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Replace_Sheet"));
+ sheetContent.setReplaceObject(name);
+ sheetContent.setHoldObject(workBook);
+ sheetContent.setTag(SearchTag.SHEET_NAME);
+ sheetContent.setSheetID(String.valueOf(i));
+ formulaInfos.add(new FormulaInfo(sheetContent));
+ }
+ }
+ }
}
private void searchTemplateWriteAttrFormula(JTemplate jTemplate, List formulaInfos, ITContent content) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index f7bbff40e7..b4163f57bf 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -36,6 +36,11 @@ public class SearchTag {
* 模板填报属性数据校验提示
*/
public static final int WRITE_ATTR_MESSAGE = 6;
+ /**
+ * sheet名称
+ */
+ public static final int SHEET_NAME = 7;
+
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index de4628b590..96ee17b6cd 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -51,6 +51,8 @@ public class ITReplaceMainDialog extends UIDialog {
private ITReplaceWestPanel westPanel;
private boolean searchFlag;
private String searchStr;
+ private static final int FIRST_ROW = 0;
+ public static int selectCount = 0;
public ITReplaceMainDialog() {
super(DesignerContext.getDesignerFrame());
@@ -117,6 +119,7 @@ public class ITReplaceMainDialog extends UIDialog {
northPane.getFindInputCombobox().setEditable(true);
northPane.getReplaceInputCombobox().setEditable(false);
+ northPane.getReplaceButton().setEnabled(false);
((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input"));
((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input"));
@@ -282,9 +285,13 @@ public class ITReplaceMainDialog extends UIDialog {
templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID();
itTableEditor.clear();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
+ //更新搜索内容
setSearchStr(searchStr);
+ //处理通配符的regexStr
ShowValueUtils.containPattern = Pattern.compile(ShowValueUtils.changeRegex(searchStr));
+ //获取搜索目标
ShowSearchResultAction searchAction = ShowSearchResultAction.match(GeneralUtils.objectToString(northPane.getFindCombobox().getSelectedItem()));
+ //搜索
if (searchAction != null) {
searchResultList = searchAction.addMatchResult(searchStr, searchAction.showSearchValue(jTemplate));
itTableEditor.add(searchResultList);
@@ -295,7 +302,15 @@ public class ITReplaceMainDialog extends UIDialog {
itTableEditor.fireTableDataChanged();
northPane.refreshFindInputComboBoxItems();
setSearchFlag(true);
+ selectCount = searchResultList.size();
+ //如果有结果,默认选中第一行
+ if (searchResultList.size() > 0){
+ getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW);
+ northPane.getReplaceButton().setEnabled(true);
+ }
+
+ //设置替换输入框的可用性
if (StringUtils.isNotEmpty(searchStr)) {
((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true);
northPane.getReplaceInputCombobox().setEditable(true);
@@ -309,7 +324,21 @@ public class ITReplaceMainDialog extends UIDialog {
}
+ public ITReplaceSouthPanel getSouthPanel() {
+ return southPanel;
+ }
+
+ public void setSouthPanel(ITReplaceSouthPanel southPanel) {
+ this.southPanel = southPanel;
+ }
+
+ public ITReplaceNorthPanel getNorthPane() {
+ return northPane;
+ }
+ public void setNorthPane(ITReplaceNorthPanel northPane) {
+ this.northPane = northPane;
+ }
/**
* 检测结果是否合法
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
index a9fe470edd..4d2f39718d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
@@ -75,9 +75,13 @@ public class ITTableEditorPane extends BasicPane {
if (content.isSelected()) {
content.setSelected(false);
editTable.setValueAt(content.isSelected(), row, col);
+ ITReplaceMainDialog.selectCount--;
+ ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0);
} else {
content.setSelected(true);
editTable.setValueAt(content.isSelected(), row, col);
+ ITReplaceMainDialog.selectCount++;
+ ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true);
}
}
@@ -120,6 +124,11 @@ public class ITTableEditorPane extends BasicPane {
boolean value = !selectBox.isSelected();
selectBox.setSelected(value);
selectAllOrNull(value);
+ if (value) {
+ ITReplaceMainDialog.selectCount = getEditTable().getRowCount();
+ } else {
+ ITReplaceMainDialog.selectCount = 0;
+ }
tableHeader.repaint();
table.repaint();
}
@@ -130,6 +139,7 @@ public class ITTableEditorPane extends BasicPane {
/**
* 刷新表头
+ *
* @param table
*/
public void refreshHeader(JTable table) {
@@ -186,7 +196,11 @@ public class ITTableEditorPane extends BasicPane {
* @param value
*/
public static void selectAllOrNull(Boolean value) {
- for (int i = 0; i < getEditTable().getRowCount(); i++) {
+ int len = getEditTable().getRowCount();
+ if (len > 0) {
+ ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(value);
+ }
+ for (int i = 0; i < len; i++) {
((ITContent) (getEditTable().getValueAt(i, ITReplaceSouthPanel.CONTENT_INDEX))).setSelected(value);
}
}
From dfa49d772c205e419d1473a3df5e497d1f450214 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 14:41:51 +0800
Subject: [PATCH 027/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/replace/action/content/formula/FormulaTag.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
index 0a20c503ce..fd2367f3be 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
@@ -107,6 +107,9 @@ public enum FormulaTag implements DealWithInfoValue {
}
}
},
+ /**
+ * sheet名称
+ */
SHEET_NAME(SearchTag.SHEET_NAME) {
@Override
public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
From cd7fa16fa186189d2e8edcab23a24b6895ae7f6f Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 16:13:21 +0800
Subject: [PATCH 028/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=201=E3=80=81=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E4=BA=91?=
=?UTF-8?q?=E7=AB=AF=E5=8F=98=E9=87=8F=E7=9A=84=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineCloudConstants.java | 204 +++++++++++++-----
.../alphafine/cell/model/BottomModel.java | 2 +-
.../alphafine/cell/model/DocumentModel.java | 4 +-
.../alphafine/cell/model/PluginModel.java | 6 +-
.../alphafine/cell/model/RobotModel.java | 4 +-
.../alphafine/component/AlphaFineDialog.java | 2 +-
.../preview/HelpDocumentNoResultPane.java | 2 +-
.../preview/NoResultWithLinkPane.java | 2 +-
.../alphafine/preview/RobotPreviewPane.java | 2 +-
.../manager/impl/ComplementAdviceManager.java | 2 +-
.../search/manager/impl/HotIssuesManager.java | 2 +-
.../manager/impl/PluginSearchManager.java | 6 +-
.../impl/ProductNewsSearchManager.java | 4 +-
.../manager/impl/RecommendSearchManager.java | 2 +-
.../manager/impl/SimilarSearchManager.java | 2 +-
.../alphafine/cell/model/ModelTest.java | 4 +-
16 files changed, 174 insertions(+), 76 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
index 5e527d9916..b1ff5d8606 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
@@ -3,8 +3,7 @@ package com.fr.design.actions.help.alphafine;
import com.fr.general.CloudCenter;
/**
- * 需要从云端获取的常量单独放一起
- * 以防AlphaFineConstants被加载时,CloudCenter还没启动,导致常量获取不到。
+ * 云端变量统一管理
*
* @author Link
* @version 11.0
@@ -12,55 +11,154 @@ import com.fr.general.CloudCenter;
*/
public class AlphaFineCloudConstants {
- public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI");
-
- public static final String SEARCH_ALL_PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI");
-
- public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo");
-
- public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo");
-
- public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view");
-
- public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search");
-
- public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info");
-
- public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image");
-
- public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record");
-
- public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search");
-
- public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search");
-
- public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search");
-
- public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search");
-
- public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm");
-
- public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web");
-
- public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview");
-
- public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
-
- public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");
-
- private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start");
-
- private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path");
-
- private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path");
-
- private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path");
-
- private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary");
-
- private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document");
-
- private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]";
-
- public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND);
+ /**
+ * get PluginSearchUrl
+ */
+ public static String getPluginSearchUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI");
+ };
+
+ /**
+ * get SearchAllPluginUrl
+ */
+ public static String getSearchAllPluginUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI");
+ }
+
+ /**
+ * get PluginUrl
+ */
+ public static String getPluginUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo");
+ }
+
+ /**
+ * get ReuseUrl
+ */
+ public static String getReuseUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo");
+ }
+
+ /**
+ * get DocumentDocUrl
+ */
+ public static String getDocumentDocUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.doc_view");
+ }
+
+ /**
+ * get DocumentSearchUrl
+ */
+ public static String getDocumentSearchUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.doc_search");
+ }
+
+ /**
+ * get DocumentInformationUrl
+ */
+ public static String getDocumentInformationUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.doc_info");
+ }
+
+ /**
+ * get PluginImageUrl
+ */
+ public static String getPluginImageUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image");
+ }
+
+ /**
+ * get CloudServerUrl
+ */
+ public static String getCloudServerUrl() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.record");
+ }
+
+ /**
+ * get SearchApi
+ */
+ public static String getSearchApi() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search");
+ }
+
+ /**
+ * get SimilarSearchUrlPrefix
+ */
+ public static String getSimilarSearchUrlPrefix() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.similar_search");
+ }
+
+ /**
+ * get ComplementAdviceSearchUrlPrefix
+ */
+ public static String getComplementAdviceSearchUrlPrefix() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.advice_search");
+ }
+
+ /**
+ * get AlphaHotSearch
+ */
+ public static String getAlphaHotSearch() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.hot_search");
+ }
+
+ /**
+ * get AlphaGoToForum
+ */
+ public static String getAlphaGoToForum() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm");
+ }
+
+ /**
+ * get AlphaGoToWeb
+ */
+ public static String getAlphaGoToWeb() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.go_web");
+ }
+
+ /**
+ * get AlphaPreview
+ */
+ public static String getAlphaPreview() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.preview");
+ }
+
+ /**
+ * get AlphaCid
+ */
+ public static String getAlphaCid() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
+ }
+
+ /**
+ * get AlphaCidUserGroupInfo
+ */
+ public static String getAlphaCidUserGroupInfo() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");
+ }
+
+ /**
+ * get DefaultRecommend
+ */
+ public static String getDefaultRecommend() {
+ String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start");
+ String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path");
+ String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path");
+ String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path");
+ String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary");
+ String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document");
+ return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," +
+ "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," +
+ "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," +
+ "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," +
+ "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," +
+ "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]";
+ }
+
+ /**
+ * get AlphaHelpRecommend
+ */
+ public static String getAlphaHelpRecommend() {
+ return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend());
+ }
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java
index fff60ea1f6..7699879484 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java
@@ -48,7 +48,7 @@ public class BottomModel extends AlphaCellModel {
@Override
public void doAction() {
try {
- Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_GO_TO_FORUM));
+ Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaGoToForum()));
} catch (IOException | URISyntaxException e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
index 8fa7ca2515..e5c1638f75 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
@@ -26,8 +26,8 @@ public class DocumentModel extends AlphaCellModel {
public DocumentModel(String name, String content, int documentId) {
super(name, content, CellType.DOCUMENT);
this.documentId = documentId;
- this.informationUrl = AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentId;
- this.documentUrl = AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentId + ".html";
+ this.informationUrl = AlphaFineCloudConstants.getDocumentInformationUrl() + documentId;
+ this.documentUrl = AlphaFineCloudConstants.getDocumentDocUrl() + documentId + ".html";
}
public DocumentModel(String name, String content, int documentId, int searchCount) {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
index 7eda90015d..f936376bb2 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
@@ -36,9 +36,9 @@ public class PluginModel extends AlphaCellModel {
this.price = price;
this.pluginId = pluginId;
if (getType() == CellType.PLUGIN) {
- this.informationUrl = AlphaFineCloudConstants.PLUGIN_URL + id;
+ this.informationUrl = AlphaFineCloudConstants.getPluginUrl() + id;
} else {
- this.informationUrl = AlphaFineCloudConstants.REUSE_URL + id;
+ this.informationUrl = AlphaFineCloudConstants.getReuseUrl() + id;
}
}
@@ -99,7 +99,7 @@ public class PluginModel extends AlphaCellModel {
@Override
public void doAction() {
- if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) {
+ if ((StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) || !WorkContext.getCurrent().isLocal()) {
return;
}
WebViewDlgHelper.createPluginDialog(getName());
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
index 79e02f18e0..4c304d107f 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
@@ -47,7 +47,7 @@ public class RobotModel extends AlphaCellModel {
public static String getContent(String titleStr) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr);
- String url = AlphaFineCloudConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token;
+ String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token;
try {
String result = HttpToolbox.get(url);
@@ -84,7 +84,7 @@ public class RobotModel extends AlphaCellModel {
@Override
public void doAction() {
try {
- Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8)));
+ Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8)));
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage());
} catch (URISyntaxException e) {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
index f7112c27a6..dab1051258 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
@@ -969,7 +969,7 @@ public class AlphaFineDialog extends UIDialog {
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));
para.put("content", object.toString());
- HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.CLOUD_SERVER_URL, para, true);
+ HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.getCloudServerUrl(), para, true);
httpClient.asGet();
if (!httpClient.isServerAlive()) {
FineLoggerFactory.getLogger().error("Failed to sent data to server!");
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
index 87a27cd29d..bee71f5859 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
@@ -98,7 +98,7 @@ public class HelpDocumentNoResultPane extends JPanel {
private Map generateMap() {
- JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.ALPHA_HELP_RECOMMEND);
+ JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.getAlphaHelpRecommend());
Map linkMap = new LinkedHashMap<>();
for (int i = 0, len = jsonArray.size(); i < len; i++) {
JSONObject json = jsonArray.getJSONObject(i);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java
index 31082f9e44..0159959de2 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java
@@ -34,7 +34,7 @@ public class NoResultWithLinkPane extends NoResultPane {
String[] para1 = title.split(TAG_A_START);
String[] para2 = para1[1].split(TAG_A_END);
- MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) {
+ MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) {
@Override
protected void initListener(String link) {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java
index 7df9e3d4cc..2340766925 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java
@@ -61,7 +61,7 @@ public class RobotPreviewPane extends JPanel {
.replaceAll("\\('", StringUtils.EMPTY)
.replaceAll("'\\)", StringUtils.EMPTY);
try {
- Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8)));
+ Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8)));
} catch (IOException | URISyntaxException e1) {
FineLoggerFactory.getLogger().error(e1.getMessage());
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
index 8a9acb87c6..8aaa0abd5e 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
@@ -41,7 +41,7 @@ public class ComplementAdviceManager {
SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
- String url = AlphaFineCloudConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token;
+ String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
index 5346e05ec1..a0815c2e3b 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
@@ -75,7 +75,7 @@ public class HotIssuesManager {
public String[][] getHotIssues() {
try {
- String result = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_HOT_SEARCH);
+ String result = HttpToolbox.get(AlphaFineCloudConstants.getAlphaHotSearch());
JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result);
if(jsonArray != null){
for (int i = 0; i < HOT_ITEM_NUM; i++) {
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
index f9729d1712..babf9f4865 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
@@ -74,7 +74,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
int searchCount = object.optInt("searchCount");
String imageUrl = null;
try {
- imageUrl = isFromCloud ? AlphaFineCloudConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic");
+ imageUrl = isFromCloud ? AlphaFineCloudConstants.getPluginImageUrl() + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.getPluginImageUrl().length()), "utf8") : object.optString("pic");
} catch (UnsupportedEncodingException e) {
FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage());
}
@@ -126,7 +126,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
for (int j = 0; j < searchText.length; j++) {
try {
String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8);
- String url = AlphaFineCloudConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey;
+ String url = AlphaFineCloudConstants.getPluginSearchUrl() + "?keyword=" + encodedKey;
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result);
@@ -174,7 +174,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
public SearchResult getDefaultResult() {
this.defaultModelList = new SearchResult();
try {
- String url = AlphaFineCloudConstants.SEARCH_ALL_PLUGIN_URL;
+ String url = AlphaFineCloudConstants.getSearchAllPluginUrl();
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java
index c20d3bb48b..f4299fc7e3 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java
@@ -83,7 +83,7 @@ public class ProductNewsSearchManager {
public List getProductNewsList() throws Exception {
productNewsList = new ArrayList<>();
idSet = new HashSet<>();
- String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_CID);
+ String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.getAlphaCid());
AlphaFineHelper.checkCancel();
JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr);
JSONArray jsonArray = cidJSON.getJSONArray("data");
@@ -151,7 +151,7 @@ public class ProductNewsSearchManager {
* 根据用户组id,查询用户组信息(改用户组中的所有设计器id)
* */
private Set searchUserGroupInfo(String userGroupId) {
- String url = AlphaFineCloudConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId;
+ String url = AlphaFineCloudConstants.getAlphaCidUserGroupInfo() + AlphaFineConstants.SEARCH_BY_ID + userGroupId;
Set idSet = new HashSet<>();
try {
String jsonStr = HttpToolbox.get(url);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
index 88872d2d8b..d0fcbd3b0c 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
@@ -60,7 +60,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
for (int j = 0; j < searchText.length; j++) {
searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
try {
- String url = AlphaFineCloudConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]);
+ String url = AlphaFineCloudConstants.getSearchApi() + CodeUtils.cjkEncode(searchText[j]);
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
index 5e08795ef1..18afdcaeba 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
@@ -48,7 +48,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider {
SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
- String url = AlphaFineCloudConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token;
+ String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java
index 2311514d17..8c62b827ee 100644
--- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java
+++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java
@@ -14,8 +14,8 @@ public class ModelTest {
Assert.assertEquals("name", documentModel.getName());
Assert.assertEquals("content", documentModel.getContent());
Assert.assertEquals(1, documentModel.getDocumentId());
- Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl());
- Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl());
+ Assert.assertEquals(AlphaFineCloudConstants.getDocumentDocUrl() + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl());
+ Assert.assertEquals(AlphaFineCloudConstants.getDocumentInformationUrl() + documentModel.getDocumentId(), documentModel.getInformationUrl());
Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl());
Assert.assertEquals(CellType.DOCUMENT, documentModel.getType());
Assert.assertEquals(true, documentModel.hasAction());
From f4b7b83f913d786320f748449b65a6e9676bca59 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 16:17:45 +0800
Subject: [PATCH 029/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=20=E4=BF=AE=E6=94=B9pr?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../design/mainframe/alphafine/cell/model/PluginModel.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
index f936376bb2..0bdb1ec669 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
@@ -98,8 +98,10 @@ public class PluginModel extends AlphaCellModel {
@Override
public void doAction() {
-
- if ((StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) || !WorkContext.getCurrent().isLocal()) {
+ if (StringUtils.isBlank(this.pluginId) && StringUtils.isBlank(this.getName())) {
+ return;
+ }
+ if (!WorkContext.getCurrent().isLocal()) {
return;
}
WebViewDlgHelper.createPluginDialog(getName());
From 4cb4577ceac45a2461bdfca6c907932fe7d7b9e9 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 16:29:05 +0800
Subject: [PATCH 030/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85sheet?=
=?UTF-8?q?=E5=90=8D=E7=A7=B0=E3=80=81=E4=BF=AE=E5=A4=8D=E5=AE=9A=E4=BD=8D?=
=?UTF-8?q?=E5=90=8E=E6=BB=9A=E5=8A=A8=E4=B8=8D=E5=88=B0=E4=BD=8D=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../formula/template/SearchTemplateFormulaAction.java | 5 ++++-
.../main/java/com/fr/design/mainframe/WorkSheetDesigner.java | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
index de653dd706..0f9124721f 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
@@ -66,7 +66,10 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
String name = workBook.getReportName(i);
if (CommonUtils.canBeFormula(name)) {
ITContent sheetContent = ITContent.copy(content);
- sheetContent.addOtherPos(Toolkit.i18nText("Fine-Design_Replace_Sheet"));
+ sheetContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Replace_Sheet"),
+ name
+ );
sheetContent.setReplaceObject(name);
sheetContent.setHoldObject(workBook);
sheetContent.setTag(SearchTag.SHEET_NAME);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java
index 0529cf82a3..629f71b6bb 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkSheetDesigner.java
@@ -217,9 +217,9 @@ public class WorkSheetDesigner extends ReportComponent
Date: Wed, 28 Sep 2022 16:38:28 +0800
Subject: [PATCH 031/310] 111111111
---
.../main/java/com/fr/design/file/HistoryTemplateListPane.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
index 2dc56cc9da..c62a7fef39 100644
--- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
+++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
@@ -27,6 +27,7 @@ public class HistoryTemplateListPane implements CallbackEvent {
synchronized (HistoryTemplateListPane.class) {
if (THIS == null) {
THIS = new HistoryTemplateListPane();
+ int a = 111;
}
}
}
From dd77af15e0b8ef8786b1661218c74faea77cd93d Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 16:55:11 +0800
Subject: [PATCH 032/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7?=
=?UTF-8?q?-=E5=85=B6=E4=BB=96-=E5=86=85=E5=AE=B9=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=E7=9A=84=E5=85=AC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/formula/FormulaTag.java | 13 +++++++++
.../formula/cell/SearchCellFormulaAction.java | 27 +++++++++++++++++++
.../actions/replace/info/base/SearchTag.java | 4 +++
3 files changed, 44 insertions(+)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
index fd2367f3be..ff8755974b 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
@@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.general.GeneralUtils;
import com.fr.main.impl.WorkBook;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
+import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.stable.collections.combination.Pair;
import org.jetbrains.annotations.Nullable;
@@ -120,6 +121,18 @@ public enum FormulaTag implements DealWithInfoValue {
workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr));
}
}
+ },
+ /**
+ * 单元格属性-其他-内容提示
+ */
+ CELL_TOOL_TIP(SearchTag.CELL_TOOL_TIP) {
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof CellGUIAttr) {
+ CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject();
+ attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr));
+ }
+ }
};
int index;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
index b58008e7bc..67593b12a7 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
@@ -20,12 +20,14 @@ import com.fr.general.data.Condition;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement;
+import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.highlight.DefaultHighlight;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HighlightGroup;
import com.fr.report.core.sort.common.CellSortAttr;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.report.core.sort.sortexpression.SortExpression;
+import com.fr.stable.CommonUtils;
import java.util.List;
@@ -69,6 +71,8 @@ public class SearchCellFormulaAction implements SearchCellFormula {
searchCellSortAttr4Formula(cellInfo, formulaInfos);
//单元格属性-形态
searchCellPresent4Formula(cellInfo, formulaInfos);
+ //单元格属性-其他-内容提示-自定义
+ searchCellToolTip4Formula(cellInfo, formulaInfos);
//单元格属性-其他-插入策略
searchCellInsertPolicy4Formula(cellInfo, formulaInfos);
//单元格条件属性-参数-公式
@@ -84,6 +88,29 @@ public class SearchCellFormulaAction implements SearchCellFormula {
}
+ private void searchCellToolTip4Formula(CellInfo cellInfo, List formulaInfos) {
+ if (cellInfo.getContent().getReplaceObject() instanceof TemplateCellElement) {
+ TemplateCellElement cellElement = (TemplateCellElement) cellInfo.getContent().getReplaceObject();
+ if (isCellGUIAttrValid(cellElement.getCellGUIAttr())) {
+ CellGUIAttr attr = cellElement.getCellGUIAttr();
+ ITContent attrContent = ITContent.copy(cellInfo.getContent());
+ attrContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"),
+ Toolkit.i18nText("Fine-Design_Report_Other"),
+ Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"),
+ Toolkit.i18nText("Fine-Design_Basic_Custom")
+ );
+ attrContent.setReplaceObject(attr.getTooltipText());
+ attrContent.setHoldObject(attr);
+ formulaInfos.add(new FormulaInfo(attrContent));
+ }
+ }
+ }
+
+ private boolean isCellGUIAttrValid(CellGUIAttr attr) {
+ return attr != null && attr.isCustomTooltip() && CommonUtils.canBeFormula(attr.getTooltipText());
+ }
+
private void searchCellHyperLink4Formula(CellInfo cellInfo, List formulaInfos) {
NameJavaScriptGroup nameJavaScriptGroup = ((CellElement) cellInfo.getContent().getReplaceObject()).getNameHyperlinkGroup();
if (nameJavaScriptGroup != null) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index b4163f57bf..1bbba05b35 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -40,6 +40,10 @@ public class SearchTag {
* sheet名称
*/
public static final int SHEET_NAME = 7;
+ /**
+ * 单元格属性-其他-内容提示
+ */
+ public static final int CELL_TOOL_TIP = 8;
From 22d54f426c60f698d8eafc551f487cfd7bc3eb37 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 16:57:51 +0800
Subject: [PATCH 033/310] =?UTF-8?q?REPORT-81324=20alphafine=E9=80=82?=
=?UTF-8?q?=E9=85=8D=E5=B8=86=E8=BD=AF=E5=B8=82=E5=9C=BA=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=2011=E4=B8=8D=E8=83=BD=E6=90=9C=E5=88=B010=E7=9A=84=E6=A8=A1?=
=?UTF-8?q?=E6=9D=BF=E8=B5=84=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/search/helper/FineMarketClientHelper.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
index f4add755e5..22c6b4c45c 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
@@ -48,6 +48,7 @@ public class FineMarketClientHelper {
private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey();
public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info");
public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url");
+ public static final String VERSION = "&version=11.0";
public static final String FILE_DOWNLOAD = "file/download/";
public static final String PACKAGE_DOWNLOAD = "package/download/";
public static final String TEMPLATES_PARENT_PACKAGE = "parent/";
@@ -268,7 +269,7 @@ public class FineMarketClientHelper {
}
public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException {
- String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name;
+ String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION;
String jsonString = HttpToolbox.get(url);
JSONObject jsonObject = new JSONObject(jsonString);
String responseState = (String) jsonObject.get(RESPONSE_STATE);
From c032eb0d0c35294c0033cb1f72e13d89bc04cf28 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Wed, 28 Sep 2022 16:58:03 +0800
Subject: [PATCH 034/310] =?UTF-8?q?REPORT-75998=20=E8=A1=A5=E5=85=85?=
=?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=A4=84=E7=90=86=E7=9A=84Tag?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/formula/cell/SearchCellFormulaAction.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
index 67593b12a7..39ccf32585 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
@@ -14,6 +14,7 @@ import com.fr.design.actions.replace.info.CellInfo;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.data.Condition;
@@ -102,6 +103,7 @@ public class SearchCellFormulaAction implements SearchCellFormula {
);
attrContent.setReplaceObject(attr.getTooltipText());
attrContent.setHoldObject(attr);
+ attrContent.setTag(SearchTag.CELL_TOOL_TIP);
formulaInfos.add(new FormulaInfo(attrContent));
}
}
From 6285908bd85522b54b8715ef38d49033ad250175 Mon Sep 17 00:00:00 2001
From: levy
Date: Wed, 28 Sep 2022 19:55:55 +0800
Subject: [PATCH 035/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E9=97=AE=E9=A2=98=E5=8E=9F?=
=?UTF-8?q?=E5=9B=A0=EF=BC=9A=201=E3=80=81=E9=83=A8=E5=88=86=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8=E6=8D=A2?=
=?UTF-8?q?=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=82=202=E3=80=81=E5=8E=9F?=
=?UTF-8?q?=E5=85=88=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE?=
=?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA?=
=?UTF-8?q?=E5=AE=9A=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C?=
=?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E3=80=82=20=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=EF=BC=9A=201?=
=?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=82=202=E3=80=81=E5=B1=80=E9=83=A8?=
=?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=89=E3=80=82=203=E3=80=81=E8=AE=BE=E7=BD=AE=E5=8F=B3?=
=?UTF-8?q?=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=89=8D=EF=BC=8C=E6=A0=B9?=
=?UTF-8?q?=E6=8D=AE=E5=BD=93=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83?=
=?UTF-8?q?=E7=A1=AE=E5=AE=9A=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../design/actions/file/PreferencePane.java | 19 +++++++++----------
.../design/carton/FeedbackToolboxDialog.java | 3 +--
.../design/file/HistoryTemplateListPane.java | 1 -
.../fr/design/file/MutilTempalteTabPane.java | 14 +++++++++++++-
4 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
index fdc0a46ae8..46485409bb 100644
--- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
+++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
@@ -119,6 +119,7 @@ public class PreferencePane extends BasicPane {
private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5;
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
+ private static final int PREFERENCE_LABEL_MAX_WIDTH = 460;
private static final int OFFSET_HEIGHT = 60;
private static final String TYPE = "pressed";
@@ -423,22 +424,20 @@ public class PreferencePane extends BasicPane {
private void createFunctionPane(JPanel generalPane) {
JPanel topVerticalTitledBorderPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Basic_Preference_Function"));
- JPanel upper = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
- JPanel lower = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
- topVerticalTitledBorderPane.add(upper);
- topVerticalTitledBorderPane.add(lower);
+ JPanel supportUndoPanel = new JPanel(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
+ topVerticalTitledBorderPane.add(supportUndoPanel);
generalPane.add(topVerticalTitledBorderPane);
//添加supportUndo选择项
supportUndoCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Support_Undo"));
- upper.add(supportUndoCheckBox);
+ supportUndoPanel.add(supportUndoCheckBox);
//添加maxUndoLimit
//String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"};
String[] undoTimes = {i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + i18nText("Fine-Design_Basic_Time(s)")
, MAX_UNDO_LIMIT_15 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + i18nText("Fine-Design_Basic_Time(s)")};
maxUndoLimit = new UIComboBox(undoTimes);
- upper.add(maxUndoLimit);
+ supportUndoPanel.add(maxUndoLimit);
//不支持撤销则不能选择撤销可缓存,也不能设置最大撤销次数
supportUndoCheckBox.addActionListener(new ActionListener() {
@@ -452,14 +451,14 @@ public class PreferencePane extends BasicPane {
//添加supportDefaultParentCalculate选择项
supportDefaultParentCalculateCheckBox = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate"));
- upper.add(supportDefaultParentCalculateCheckBox);
+ topVerticalTitledBorderPane.add(supportDefaultParentCalculateCheckBox);
//添加是否展示打开模板提示缺少插件选择项
showTemplateMissingPlugin = new UICheckBox(
i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin"));
- upper.add(showTemplateMissingPlugin);
+ topVerticalTitledBorderPane.add(showTemplateMissingPlugin);
startWithEmptyFile = new UICheckBox(i18nText("Fine-Design_Basic_Preference_Start_Empty_File"));
- lower.add(startWithEmptyFile);
+ topVerticalTitledBorderPane.add(startWithEmptyFile);
}
private void createEditPane(JPanel generalPane) {
@@ -661,7 +660,7 @@ public class PreferencePane extends BasicPane {
startupPageEnabledCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Check_Text"));
startupPane.add(startupPageEnabledCheckBox);
- UILabel descLabel = new UILabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"));
+ UILabel descLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Startup_Page_Config_Desc"), PREFERENCE_LABEL_MAX_WIDTH);
descLabel.setForeground(new Color(51, 51, 52, (int)Math.round(0.5 * 255)));
startupPane.add(descLabel);
}
diff --git a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
index c7192eb099..877f6993c0 100644
--- a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
+++ b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
@@ -94,8 +94,7 @@ public class FeedbackToolboxDialog extends JDialog {
private JPanel createInfoPane() {
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10);
UILabel title = new UILabel();
- //空格布局会好看一点
- title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
+ title.setText(Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
//判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空
boolean cartonExists = SwitchForSwingChecker.isCartonExists();
if (cartonExists) {
diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
index c62a7fef39..2dc56cc9da 100644
--- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
+++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
@@ -27,7 +27,6 @@ public class HistoryTemplateListPane implements CallbackEvent {
synchronized (HistoryTemplateListPane.class) {
if (THIS == null) {
THIS = new HistoryTemplateListPane();
- int a = 111;
}
}
}
diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
index 480edea346..53b262c4f7 100644
--- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
+++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
@@ -24,6 +24,7 @@ import com.fr.design.utils.TemplateUtils;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.file.FILE;
import com.fr.general.ComparatorUtils;
+import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
@@ -67,6 +68,7 @@ import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D;
import java.util.List;
+import java.util.Locale;
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
@@ -197,7 +199,17 @@ public class MutilTempalteTabPane extends JComponent {
height += 25;
}
}
- menu.setPreferredSize(new Dimension(170, height));
+ //当前i18n适配中英日,其中英日字符串长度较长,需调整popupMenu的宽度
+ //后续版本可考虑读取字符串像素宽度,以自适应调整menu
+ int popupMenuWidth;
+ if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.US)){
+ popupMenuWidth = 350;
+ }else if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.JAPAN)){
+ popupMenuWidth = 240;
+ }else {
+ popupMenuWidth = 170;
+ }
+ menu.setPreferredSize(new Dimension(popupMenuWidth, height));
GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight());
}
}
From da5b635450794685b542129bb48ec3b8aec4c231 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Wed, 28 Sep 2022 21:40:20 +0800
Subject: [PATCH 036/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=20=E4=BF=AE=E6=94=B9pr?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineCloudConstants.java | 25 ++++++++-----------
.../search/helper/FineMarketClientHelper.java | 11 +++++---
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
index b1ff5d8606..ee85b7078d 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
@@ -12,14 +12,14 @@ import com.fr.general.CloudCenter;
public class AlphaFineCloudConstants {
/**
- * get PluginSearchUrl
+ * 获取插件搜索api
*/
public static String getPluginSearchUrl() {
return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI");
};
/**
- * get SearchAllPluginUrl
+ * 帆软市场里全部插件api
*/
public static String getSearchAllPluginUrl() {
return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI");
@@ -47,21 +47,21 @@ public class AlphaFineCloudConstants {
}
/**
- * get DocumentSearchUrl
+ * 帮助文档搜索api
*/
public static String getDocumentSearchUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.doc_search");
}
/**
- * get DocumentInformationUrl
+ * 帮助文档信息api
*/
public static String getDocumentInformationUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.doc_info");
}
/**
- * get PluginImageUrl
+ * 插件图片api
*/
public static String getPluginImageUrl() {
return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image");
@@ -96,14 +96,14 @@ public class AlphaFineCloudConstants {
}
/**
- * get AlphaHotSearch
+ * 获取热门问题
*/
public static String getAlphaHotSearch() {
return CloudCenter.getInstance().acquireUrlByKind("af.hot_search");
}
/**
- * get AlphaGoToForum
+ * 跳转论坛url
*/
public static String getAlphaGoToForum() {
return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm");
@@ -124,23 +124,20 @@ public class AlphaFineCloudConstants {
}
/**
- * get AlphaCid
+ * cid系统的产品动态api
*/
public static String getAlphaCid() {
return CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
}
/**
- * get AlphaCidUserGroupInfo
+ * cid系统的 用户组信息api
*/
public static String getAlphaCidUserGroupInfo() {
return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");
}
- /**
- * get DefaultRecommend
- */
- public static String getDefaultRecommend() {
+ private static String getDefaultRecommend() {
String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start");
String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path");
String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path");
@@ -156,7 +153,7 @@ public class AlphaFineCloudConstants {
}
/**
- * get AlphaHelpRecommend
+ * 获取默认推荐帮助文档url
*/
public static String getAlphaHelpRecommend() {
return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend());
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
index 22c6b4c45c..1f9d5fb09a 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
@@ -48,12 +48,13 @@ public class FineMarketClientHelper {
private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey();
public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info");
public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url");
- public static final String VERSION = "&version=11.0";
+ public static final String VERSION = "version";
+ private static final String CURRENT_VERSION = "11.0";
public static final String FILE_DOWNLOAD = "file/download/";
public static final String PACKAGE_DOWNLOAD = "package/download/";
public static final String TEMPLATES_PARENT_PACKAGE = "parent/";
public static final String TEMPLATES_TAGS = "filter";
- public static final String NAME_SEARCH = "?searchKeyword=";
+ public static final String NAME_SEARCH = "searchKeyword";
public static final String RESPONSE_STATE = "state";
public static final String RESPONSE_SUCCESS = "ok";
@@ -269,8 +270,10 @@ public class FineMarketClientHelper {
}
public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException {
- String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION;
- String jsonString = HttpToolbox.get(url);
+ Map params = new HashMap();
+ params.put(NAME_SEARCH, name);
+ params.put(VERSION, CURRENT_VERSION);
+ String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params);
JSONObject jsonObject = new JSONObject(jsonString);
String responseState = (String) jsonObject.get(RESPONSE_STATE);
if (RESPONSE_SUCCESS.equals(responseState)) {
From 66fead7e41b408d064df7c4e4f74a6e6f47ee619 Mon Sep 17 00:00:00 2001
From: levy
Date: Thu, 29 Sep 2022 09:14:49 +0800
Subject: [PATCH 037/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?=
=?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?=
=?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?=
=?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?=
=?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?=
=?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?=
=?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?=
=?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?=
=?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/file/MutilTempalteTabPane.java | 15 ++++-----------
.../com/fr/design/i18n/dimension_en.properties | 3 ++-
.../com/fr/design/i18n/dimension_ja_JP.properties | 3 ++-
.../com/fr/design/i18n/dimension_ko_KR.properties | 3 ++-
.../com/fr/design/i18n/dimension_zh.properties | 3 ++-
.../com/fr/design/i18n/dimension_zh_TW.properties | 3 ++-
6 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
index 53b262c4f7..aa352b4bcb 100644
--- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
+++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
@@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.imenu.UIScrollPopUpMenu;
+import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
@@ -199,17 +200,9 @@ public class MutilTempalteTabPane extends JComponent {
height += 25;
}
}
- //当前i18n适配中英日,其中英日字符串长度较长,需调整popupMenu的宽度
- //后续版本可考虑读取字符串像素宽度,以自适应调整menu
- int popupMenuWidth;
- if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.US)){
- popupMenuWidth = 350;
- }else if(ComparatorUtils.equals(GeneralContext.getLocale(), Locale.JAPAN)){
- popupMenuWidth = 240;
- }else {
- popupMenuWidth = 170;
- }
- menu.setPreferredSize(new Dimension(popupMenuWidth, height));
+ //根据当前i18n语言环境,动态调整popupMenu的宽度
+ menu.setPreferredSize(new Dimension((int)DesignSizeI18nManager.getInstance().
+ i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(),height));
GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight());
}
}
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
index 7f249d1a5e..f26123e3d6 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
@@ -21,4 +21,5 @@ com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
-com.fr.design.report.WatermarkSettingPane=720*600
\ No newline at end of file
+com.fr.design.report.WatermarkSettingPane=720*600
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65
\ No newline at end of file
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
index ec876154ae..9c9105b416 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
@@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*165
com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
-com.fr.design.report.WatermarkSettingPane=720*600
\ No newline at end of file
+com.fr.design.report.WatermarkSettingPane=720*600
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
\ No newline at end of file
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
index dd8e8571b5..f05f8a3925 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
@@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
-com.fr.design.report.WatermarkSettingPane=720*600
\ No newline at end of file
+com.fr.design.report.WatermarkSettingPane=720*600
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
\ No newline at end of file
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
index 44ea2f3bd8..d8b31cf103 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
@@ -22,4 +22,5 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
-com.fr.design.report.WatermarkSettingPane=720*600
\ No newline at end of file
+com.fr.design.report.WatermarkSettingPane=720*600
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
\ No newline at end of file
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
index 90d082cc9f..dc92be1a0c 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
@@ -20,4 +20,5 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
-com.fr.design.report.WatermarkSettingPane=720*600
\ No newline at end of file
+com.fr.design.report.WatermarkSettingPane=720*600
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
\ No newline at end of file
From 6181f58a03cb0bb0d5810078aa1c12ecd864d8d0 Mon Sep 17 00:00:00 2001
From: levy
Date: Thu, 29 Sep 2022 10:18:27 +0800
Subject: [PATCH 038/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?=
=?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?=
=?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?=
=?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?=
=?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?=
=?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?=
=?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?=
=?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?=
=?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/carton/FeedbackToolboxDialog.java | 6 +++---
.../java/com/fr/design/file/MutilTempalteTabPane.java | 10 +++++-----
.../com/fr/design/i18n/dimension_en.properties | 2 +-
.../com/fr/design/i18n/dimension_ja_JP.properties | 2 +-
.../com/fr/design/i18n/dimension_ko_KR.properties | 2 +-
.../com/fr/design/i18n/dimension_zh.properties | 2 +-
.../com/fr/design/i18n/dimension_zh_TW.properties | 2 +-
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
index 877f6993c0..83d6e24ac8 100644
--- a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
+++ b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java
@@ -94,7 +94,7 @@ public class FeedbackToolboxDialog extends JDialog {
private JPanel createInfoPane() {
JPanel northPane = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 10);
UILabel title = new UILabel();
- title.setText(Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
+ title.setText(" " + Toolkit.i18nText("Fine-Design_Basic_Carton_Record_Lag_Time") + ": ");
//判断一下当天是否有卡顿日志记录,如果有将日期设置为当天,如果没有设置为空
boolean cartonExists = SwitchForSwingChecker.isCartonExists();
if (cartonExists) {
@@ -343,8 +343,8 @@ public class FeedbackToolboxDialog extends JDialog {
/**
* 导出卡顿日志到本地或远程服务器WEB-INF下
*
- * @param sourceFile 导出的卡顿日志所在文件夹
- * @param path 文件需要导出到的路径
+ * @param sourceFile 导出的卡顿日志所在文件夹
+ * @param path 文件需要导出到的路径
* @param sourceFilePath 导出的卡顿日志所在文件夹的路径
*/
private void exportCartonLog(File sourceFile, String path, String sourceFilePath) {
diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
index aa352b4bcb..3589d9812e 100644
--- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
+++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
@@ -201,8 +201,8 @@ public class MutilTempalteTabPane extends JComponent {
}
}
//根据当前i18n语言环境,动态调整popupMenu的宽度
- menu.setPreferredSize(new Dimension((int)DesignSizeI18nManager.getInstance().
- i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(),height));
+ menu.setPreferredSize(new Dimension((int) DesignSizeI18nManager.getInstance().
+ i18nDimension("com.fr.design.file.MultiTemplateTabPane.popUpMenu").getWidth(), height));
GUICoreUtils.showPopupMenu(menu, MutilTempalteTabPane.getInstance(), e.getX(), MutilTempalteTabPane.getInstance().getY() - 1 + MutilTempalteTabPane.getInstance().getHeight());
}
}
@@ -339,7 +339,7 @@ public class MutilTempalteTabPane extends JComponent {
}
}
- private void closeTemplate(JTemplate, ?>[] templates, JTemplate, ?> currentTemplate) {
+ private void closeTemplate(JTemplate, ?>[] templates, JTemplate, ?> currentTemplate) {
for (int i = 0; i < templates.length; i++) {
if (option.shouldClose(tplIndex, i)) {
JTemplate, ?> jTemplate = templates[i];
@@ -940,7 +940,7 @@ public class MutilTempalteTabPane extends JComponent {
/**
* 后台关闭当前编辑模板
*/
- public void closeCurrentTpl(){
+ public void closeCurrentTpl() {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
this.setIsCloseCurrent(true);
this.closeFormat(jTemplate);
@@ -1164,7 +1164,7 @@ public class MutilTempalteTabPane extends JComponent {
boolean completed = WorkerManager.getInstance().isCompleted(template.getTarget().getTemplateID());
if (!completed) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
- Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName()));
+ Toolkit.i18nText("Fine-Design_Close_Template_Tip", template.getEditingFILE().getName()));
return;
}
}
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
index f26123e3d6..0205e6ea2b 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
@@ -22,4 +22,4 @@ com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
-com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65
\ No newline at end of file
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
index 9c9105b416..9b143294f3 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
@@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
-com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
\ No newline at end of file
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
index f05f8a3925..e0f0130224 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
@@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=95*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
-com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
\ No newline at end of file
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
index d8b31cf103..d1e84b4618 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
@@ -23,4 +23,4 @@ com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
-com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
\ No newline at end of file
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
index dc92be1a0c..c00c2b8a9a 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
@@ -21,4 +21,4 @@ com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
-com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
\ No newline at end of file
+com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
From 188125ad26f530a02f9d040edb2d7722bb5d6524 Mon Sep 17 00:00:00 2001
From: levy
Date: Thu, 29 Sep 2022 10:53:50 +0800
Subject: [PATCH 039/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?=
=?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?=
=?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?=
=?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?=
=?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?=
=?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?=
=?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?=
=?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?=
=?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 +
1 file changed, 1 insertion(+)
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
index c00c2b8a9a..3b493f6df2 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
@@ -22,3 +22,4 @@ com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
+
From 747f3518dc26edd85ebf5787388dfa75a5ba5bcf Mon Sep 17 00:00:00 2001
From: levy
Date: Thu, 29 Sep 2022 10:55:42 +0800
Subject: [PATCH 040/310] =?UTF-8?q?REPORT-80251=20=E8=8B=B1=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BD=E9=99=85=E5=8C=96=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=911=E3=80=81=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97=E7=9A=84label=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E6=9C=AA=E5=81=9A=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E8=AE=BE=E7=BD=AE=E3=80=822=E3=80=81?=
=?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=95=8C=E9=9D=A2=E5=8F=B3=E9=94=AE=E5=BC=B9?=
=?UTF-8?q?=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6=E8=A2=AB=E5=9B=BA=E5=AE=9A?=
=?UTF-8?q?=EF=BC=8C=E6=9C=AA=E8=80=83=E8=99=91=E4=B8=8D=E5=90=8C=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E7=9A=84=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98=E3=80=82?=
=?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911?=
=?UTF-8?q?=E3=80=81=E6=9B=B4=E6=94=B9label=E4=B8=BA=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E6=8D=A2=E8=A1=8C=E3=80=822=E3=80=81=E5=B1=80=E9=83=A8?=
=?UTF-8?q?=E5=BE=AE=E8=B0=83UI=EF=BC=88=E6=A8=AA=E6=8E=92=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=98=E7=AB=96=E6=8E=92=EF=BC=8C=E5=B7=B2=E4=B8=8E?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A=E6=97=A0=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=EF=BC=89=E3=80=823=E3=80=81=E6=A0=B9=E6=8D=AE=E5=BD=93?=
=?UTF-8?q?=E5=89=8D=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E7=A1=AE=E5=AE=9A?=
=?UTF-8?q?=E5=8F=B3=E9=94=AE=E5=BC=B9=E5=87=BA=E6=A1=86=E5=AE=BD=E5=BA=A6?=
=?UTF-8?q?=E3=80=82=20=E3=80=90Review=E5=BB=BA=E8=AE=AE=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 -
1 file changed, 1 deletion(-)
diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
index 3b493f6df2..c00c2b8a9a 100644
--- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
+++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
@@ -22,4 +22,3 @@ com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
-
From c726fd6c071148ff4bc8d4b3c362a4799a9aebb9 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Thu, 29 Sep 2022 11:47:49 +0800
Subject: [PATCH 041/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=20=E6=B7=BB=E5=8A=A0url=E7=BC=96=E7=A0=81=20=E6=8F=90=E5=8F=96?=
=?UTF-8?q?=E5=B8=B8=E9=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineCloudConstants.java | 76 +++++++++++++------
.../alphafine/cell/model/PluginModel.java | 10 ++-
.../search/helper/FineMarketClientHelper.java | 4 +-
.../manager/impl/ComplementAdviceManager.java | 7 +-
.../manager/impl/DocumentSearchManager.java | 2 +-
.../manager/impl/SimilarSearchManager.java | 7 +-
6 files changed, 74 insertions(+), 32 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
index ee85b7078d..35b363eb71 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
@@ -11,139 +11,165 @@ import com.fr.general.CloudCenter;
*/
public class AlphaFineCloudConstants {
+ private static final String PLUGIN_SEARCH_API = "plugin.searchAPI";
+ private static final String PLUGIN_ALL_SEARCH_API = "plugin.all.searchAPI";
+ private static final String AF_PLUGIN_INFO = "af.pluginInfo";
+ private static final String AF_REUSE_INFO = "af.reuseInfo";
+ private static final String AF_DOC_VIEW = "af.doc_view";
+ private static final String AF_DOC_SEARCH = "af.doc_search";
+ private static final String AF_DOC_INFO = "af.doc_info";
+ private static final String AF_PLUGIN_IMAGE = "af.plugin_image";
+ private static final String AF_RECORD = "af.record";
+ private static final String AF_CLOUD_SEARCH = "af.cloud_search";
+ private static final String AF_SIMILAR_SEARCH = "af.similar_search";
+ private static final String AF_ADVICE_SEARCH = "af.advice_search";
+ private static final String AF_HOT_SEARCH = "af.hot_search";
+ private static final String AF_GO_FORUM = "af.go_fourm";
+ private static final String AF_GO_WEB = "af.go_web";
+ private static final String AF_PREVIEW = "af.preview";
+ private static final String AF_CID_NEW = "af.cid.new";
+ private static final String AF_CID_USER_GROUP_INFO = "af.cid.user.group.info";
+ private static final String AF_HELP_QUICK_START = "af.help.quick.start";
+ private static final String AF_HELP_REPORT_LEARNING_PATH = "af.help.report.learning.path";
+ private static final String AF_HELP_PARAM_LEARNING_PATH = "af.help.param.learning.path";
+ private static final String AF_HELP_FILL_LEARNING_PATH = "af.help.fill.learning.path";
+ private static final String AF_HELP_API_SUMMARY = "af.help.api.summary";
+ private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document";
+ private static final String AF_RECOMMEND = "af.recommend";
+
/**
* 获取插件搜索api
*/
public static String getPluginSearchUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI");
+ return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_SEARCH_API);
};
/**
* 帆软市场里全部插件api
*/
public static String getSearchAllPluginUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI");
+ return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_ALL_SEARCH_API);
}
/**
* get PluginUrl
*/
public static String getPluginUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO);
}
/**
* get ReuseUrl
*/
public static String getReuseUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO);
}
/**
* get DocumentDocUrl
*/
public static String getDocumentDocUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.doc_view");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW);
}
/**
* 帮助文档搜索api
*/
public static String getDocumentSearchUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.doc_search");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_SEARCH);
}
/**
* 帮助文档信息api
*/
public static String getDocumentInformationUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.doc_info");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_INFO);
}
/**
* 插件图片api
*/
public static String getPluginImageUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_IMAGE);
}
/**
* get CloudServerUrl
*/
public static String getCloudServerUrl() {
- return CloudCenter.getInstance().acquireUrlByKind("af.record");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD);
}
/**
* get SearchApi
*/
public static String getSearchApi() {
- return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH);
}
/**
* get SimilarSearchUrlPrefix
*/
public static String getSimilarSearchUrlPrefix() {
- return CloudCenter.getInstance().acquireUrlByKind("af.similar_search");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH);
}
/**
* get ComplementAdviceSearchUrlPrefix
*/
public static String getComplementAdviceSearchUrlPrefix() {
- return CloudCenter.getInstance().acquireUrlByKind("af.advice_search");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH);
}
/**
* 获取热门问题
*/
public static String getAlphaHotSearch() {
- return CloudCenter.getInstance().acquireUrlByKind("af.hot_search");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_HOT_SEARCH);
}
/**
* 跳转论坛url
*/
public static String getAlphaGoToForum() {
- return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_GO_FORUM);
}
/**
* get AlphaGoToWeb
*/
public static String getAlphaGoToWeb() {
- return CloudCenter.getInstance().acquireUrlByKind("af.go_web");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB);
}
/**
* get AlphaPreview
*/
public static String getAlphaPreview() {
- return CloudCenter.getInstance().acquireUrlByKind("af.preview");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW);
}
/**
* cid系统的产品动态api
*/
public static String getAlphaCid() {
- return CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_CID_NEW);
}
/**
* cid系统的 用户组信息api
*/
public static String getAlphaCidUserGroupInfo() {
- return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");
+ return CloudCenter.getInstance().acquireUrlByKind(AF_CID_USER_GROUP_INFO);
}
private static String getDefaultRecommend() {
- String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start");
- String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path");
- String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path");
- String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path");
- String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary");
- String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document");
+ String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START);
+ String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH);
+ String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH);
+ String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH);
+ String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY);
+ String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT);
return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," +
"{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," +
"{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," +
@@ -156,6 +182,6 @@ public class AlphaFineCloudConstants {
* 获取默认推荐帮助文档url
*/
public static String getAlphaHelpRecommend() {
- return CloudCenter.getInstance().acquireUrlByKind("af.recommend", getDefaultRecommend());
+ return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, getDefaultRecommend());
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
index 0bdb1ec669..9c60db3192 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java
@@ -104,7 +104,15 @@ public class PluginModel extends AlphaCellModel {
if (!WorkContext.getCurrent().isLocal()) {
return;
}
- WebViewDlgHelper.createPluginDialog(getName());
+ openPluginStore(getName());
+ }
+
+ /**
+ * 打开插件商城
+ * 方便埋点
+ */
+ private void openPluginStore(String name) {
+ WebViewDlgHelper.createPluginDialog(name);
}
@Override
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
index 1f9d5fb09a..42b28cfe8a 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
@@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.search.helper;
+import com.fr.base.login.ClientHelper;
import com.fr.design.DesignerEnvManager;
import com.fr.design.extra.PluginConstants;
import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager;
@@ -12,6 +13,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.market.key.FineMarketPublicKeyHolder;
import com.fr.security.SecurityToolbox;
+import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.HttpException;
@@ -327,7 +329,7 @@ public class FineMarketClientHelper {
* */
private void initTags() throws IOException {
tags = new HashMap<>();
- String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS;
+ String url = FINE_MARKET_TEMPLATE_INFO + ClientHelper.urlEncode(TEMPLATES_TAGS, EncodeConstants.ENCODING_UTF_8);
String jsonString = HttpToolbox.get(url);
JSONObject jsonObject = new JSONObject(jsonString);
String responseState = (String) jsonObject.get(RESPONSE_STATE);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
index 8aaa0abd5e..a00803210e 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
@@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.search.manager.impl;
+import com.fr.base.login.ClientHelper;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
@@ -7,6 +8,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
+import com.fr.stable.EncodeConstants;
import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
@@ -40,8 +42,9 @@ public class ComplementAdviceManager {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) {
SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
- String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
- String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
+ String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
+ String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg);
+ String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
index 0c8ef70536..69c34ba61c 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
@@ -71,7 +71,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
long start = System.currentTimeMillis();
- String url = AlphaFineCloudConstants.DOCUMENT_SEARCH_URL + searchText[j];
+ String url = AlphaFineCloudConstants.getDocumentSearchUrl() + searchText[j];
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
index 18afdcaeba..102ead1bb2 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
@@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.search.manager.impl;
+import com.fr.base.login.ClientHelper;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
@@ -13,6 +14,7 @@ import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
+import com.fr.stable.EncodeConstants;
import com.fr.third.org.apache.commons.codec.digest.DigestUtils;
/**
@@ -47,8 +49,9 @@ public class SimilarSearchManager implements AlphaFineSearchProvider {
}
SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
- String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
- String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token;
+ String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
+ String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg);
+ String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
From c7f87592a4bbfac239d8cdf4b76f9fdfd8b72fa3 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 13:40:36 +0800
Subject: [PATCH 042/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8-=E5=85=AC=E5=BC=8F?=
=?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=8B=BE=E9=80=89=E6=A1=86=E7=9A=84=E5=88=B7=E6=96=B0?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E6=9F=A5=E6=89=BE=E6=A1=86=E6=97=A0?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E6=9B=BF=E6=8D=A2=E6=A1=86=E7=A6=81?=
=?UTF-8?q?=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/formula/FormulaTag.java | 19 ++++++++
.../formula/widget/DictionaryType.java | 9 +++-
.../actions/replace/info/FormulaInfo.java | 16 ++-----
.../actions/replace/info/base/SearchTag.java | 8 ++++
.../replace/ui/ITReplaceMainDialog.java | 27 +++++++-----
.../actions/replace/ui/ITTableEditorPane.java | 44 +++++++++++++------
6 files changed, 83 insertions(+), 40 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
index ff8755974b..c3f3c83a1d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
@@ -2,6 +2,7 @@ package com.fr.design.actions.replace.action.content.formula;
import com.fr.chart.chartdata.MeterReportDefinition;
import com.fr.data.VerifyItem;
+import com.fr.data.impl.FormulaDictionary;
import com.fr.design.actions.replace.info.DealWithInfoValue;
import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.SearchTag;
@@ -133,6 +134,24 @@ public enum FormulaTag implements DealWithInfoValue {
attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr));
}
}
+ },
+ DICT_EXCUTE(SearchTag.DICT_EXCUTE) {
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof FormulaDictionary) {
+ FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject();
+ dictionary.setExcuteFormula(ShowValueUtils.replaceAll(dictionary.getExcuteFormula(), findStr, replaceStr));
+ }
+ }
+ },
+ DICT_PRODUCE(SearchTag.DICT_PRODUCE) {
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof FormulaDictionary) {
+ FormulaDictionary dictionary = (FormulaDictionary) info.getContent().getHoldObject();
+ dictionary.setProduceFormula(ShowValueUtils.replaceAll(dictionary.getProduceFormula(), findStr, replaceStr));
+ }
+ }
};
int index;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java
index 22d4cb3959..6a55aebf9b 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/DictionaryType.java
@@ -6,6 +6,7 @@ import com.fr.data.impl.FormulaDictionary;
import com.fr.data.impl.TableDataDictionary;
import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.i18n.Toolkit;
import org.jetbrains.annotations.Nullable;
@@ -32,23 +33,27 @@ public enum DictionaryType implements DictionaryAction {
//显示值
if (formulaDictionary.getExcuteFormula() != null) {
ITContent excuteContent = ITContent.copy(content);
- excuteContent.setReplaceObject(dictionary);
+ excuteContent.setReplaceObject(formulaDictionary.getExcuteFormula());
excuteContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"),
Toolkit.i18nText("Fine-Design_Basic_Formula"),
Toolkit.i18nText("Fine-Design_Basic_Display_Value")
);
+ excuteContent.setHoldObject(dictionary);
+ excuteContent.setTag(SearchTag.DICT_EXCUTE);
formulaInfos.add(new FormulaInfo(excuteContent));
}
//实际值
if (formulaDictionary.getProduceFormula() != null) {
ITContent produceContent = ITContent.copy(content);
- produceContent.setReplaceObject(dictionary);
+ produceContent.setReplaceObject(formulaDictionary.getProduceFormula());
produceContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"),
Toolkit.i18nText("Fine-Design_Basic_Formula"),
Toolkit.i18nText("Fine-Design_Basic_Actual_Value")
);
+ produceContent.setHoldObject(dictionary);
+ produceContent.setTag(SearchTag.DICT_PRODUCE);
formulaInfos.add(new FormulaInfo(produceContent));
}
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java
index 73a0750cb8..ce2ecd36c6 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/FormulaInfo.java
@@ -40,14 +40,7 @@ public class FormulaInfo implements Info {
@Override
public Map getValue(Object... o) {
Map map = new HashMap<>();
- //这边比较特殊,存的都是FormulaDictionary ,特殊判断一下
- if (this.content.getOtherPos().contains(DISPLAY)) {
- map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getExcuteFormula());
- } else if (this.content.getOtherPos().contains(ACTUAL)) {
- map.put("content", ((FormulaDictionary) this.getContent().getReplaceObject()).getProduceFormula());
- } else {
- map = getCommonValue();
- }
+ map = getCommonValue();
return map;
}
@@ -70,11 +63,8 @@ public class FormulaInfo implements Info {
@Override
public Boolean checkValid() {
- FormulaReplaceObject formulaReplaceObject = FormulaReplaceObject.match(this.content.getReplaceObject().getClass().getSimpleName());
- if (formulaReplaceObject != null) {
- return formulaReplaceObject.check(this);
- }
- return false;
+ //校验二期才完善,目前都给过
+ return true;
}
private Map getCommonValue() {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index 1bbba05b35..956d3ff386 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -44,6 +44,14 @@ public class SearchTag {
* 单元格属性-其他-内容提示
*/
public static final int CELL_TOOL_TIP = 8;
+ /**
+ * 数据字典-公式-显示值
+ */
+ public static final int DICT_EXCUTE = 9;
+ /**
+ * 数据字典-公式-实际值
+ */
+ public static final int DICT_PRODUCE = 10;
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index 96ee17b6cd..4843df57f4 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.file.HistoryTemplateListCache;
+import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
@@ -22,6 +23,7 @@ import com.fr.stable.StringUtils;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
@@ -117,8 +119,10 @@ public class ITReplaceMainDialog extends UIDialog {
JPanel center = new JPanel(new BorderLayout());
+ UIComboBox replaceComboBox = northPane.getReplaceInputCombobox();
northPane.getFindInputCombobox().setEditable(true);
- northPane.getReplaceInputCombobox().setEditable(false);
+ replaceComboBox.setEnabled(false);
+ replaceComboBox.setEditable(true);
northPane.getReplaceButton().setEnabled(false);
((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input"));
@@ -160,7 +164,8 @@ public class ITReplaceMainDialog extends UIDialog {
private void replace() {
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText();
- if (StringUtils.equals(getSearchStr(), searchStr)) {
+ //替换内容为空需要触发搜索
+ if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) {
if (isITReplaceValid() && checkTemplateChanged(searchResultList)) {
for (Info info : searchResultList) {
if (info.getContent().isSelected()) {
@@ -298,7 +303,8 @@ public class ITReplaceMainDialog extends UIDialog {
northPane.getResultLabel().setText("" + Toolkit.i18nText("Fine-Design_Replace_Search_Finish") + "" + searchResultList.size() + "" + Toolkit.i18nText("Fine-Design_Replace_Result"));
}
ITTableEditorPane.ITHeaderRenderer renderer = (ITTableEditorPane.ITHeaderRenderer) getEditTable().getTableHeader().getDefaultRenderer();
- renderer.refreshHeader(getEditTable());
+ //刷新表头,并且重新勾选中表头全选框
+ renderer.refreshHeader(getEditTable(), true);
itTableEditor.fireTableDataChanged();
northPane.refreshFindInputComboBoxItems();
setSearchFlag(true);
@@ -306,18 +312,17 @@ public class ITReplaceMainDialog extends UIDialog {
//如果有结果,默认选中第一行
if (searchResultList.size() > 0){
getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW);
- northPane.getReplaceButton().setEnabled(true);
}
-
- //设置替换输入框的可用性
- if (StringUtils.isNotEmpty(searchStr)) {
- ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(true);
- northPane.getReplaceInputCombobox().setEditable(true);
+ //更新替换按钮可用性
+ if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0){
+ northPane.getReplaceButton().setEnabled(false);
} else {
- ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setEditable(false);
- northPane.getReplaceInputCombobox().setEditable(false);
+ northPane.getReplaceButton().setEnabled(true);
}
+
+ //设置替换输入框的可用性
+ northPane.getReplaceInputCombobox().setEnabled(StringUtils.isNotEmpty(searchStr));
} else {
//todo
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
index 4d2f39718d..0a743d34eb 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
@@ -72,17 +72,8 @@ public class ITTableEditorPane extends BasicPane {
int col = ((JTable) e.getSource()).columnAtPoint(e.getPoint());
if (col == ITReplaceSouthPanel.CHECKBOX_INDEX) {
ITContent content = (ITContent) editTable.getValueAt(row, ITReplaceSouthPanel.CONTENT_INDEX);
- if (content.isSelected()) {
- content.setSelected(false);
- editTable.setValueAt(content.isSelected(), row, col);
- ITReplaceMainDialog.selectCount--;
- ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0);
- } else {
- content.setSelected(true);
- editTable.setValueAt(content.isSelected(), row, col);
- ITReplaceMainDialog.selectCount++;
- ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true);
- }
+ //改变面板的各个状态
+ changeComponentStatus(content, row, col);
}
}
@@ -90,10 +81,35 @@ public class ITTableEditorPane extends BasicPane {
UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
pane.add(scrollPane, BorderLayout.CENTER);
+ }
-
+ /**
+ * 改变面板的各个状态(替换按钮、表头勾选框)
+ * @param content
+ * @param row
+ * @param col
+ */
+ public void changeComponentStatus(ITContent content, int row, int col) {
+ if (content.isSelected()) {
+ content.setSelected(false);
+ editTable.setValueAt(content.isSelected(), row, col);
+ ITReplaceMainDialog.selectCount--;
+ //如果没有选中,替换按钮需要置灰
+ ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(ITReplaceMainDialog.selectCount > 0);
+ } else {
+ content.setSelected(true);
+ editTable.setValueAt(content.isSelected(), row, col);
+ ITReplaceMainDialog.selectCount++;
+ ITReplaceMainDialog.getInstance().getNorthPane().getReplaceButton().setEnabled(true);
+ }
+ //更新表头的勾选框状态
+ if (editTable.getTableHeader().getDefaultRenderer() instanceof ITHeaderRenderer) {
+ ITHeaderRenderer renderer = (ITHeaderRenderer) editTable.getTableHeader().getDefaultRenderer();
+ renderer.refreshHeader(editTable, ITReplaceMainDialog.selectCount >= editTable.getRowCount());
+ }
}
+
public UITableModelAdapter getTableModel() {
return tableModel;
}
@@ -142,8 +158,8 @@ public class ITTableEditorPane extends BasicPane {
*
* @param table
*/
- public void refreshHeader(JTable table) {
- selectBox.setSelected(true);
+ public void refreshHeader(JTable table, boolean value) {
+ selectBox.setSelected(value);
int rowHeight = table.getRowHeight();
table.updateUI();
table.setRowHeight(rowHeight);
From 9f293a456bbf5956f3bc72f8b5eeaf524bba9c9b Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 14:11:34 +0800
Subject: [PATCH 043/310] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8-=E5=85=AC=E5=BC=8F?=
=?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E3=80=81=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=8B=BE=E9=80=89=E6=A1=86=E7=9A=84=E5=88=B7=E6=96=B0?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=E3=80=81=E6=9F=A5=E6=89=BE=E6=A1=86=E6=97=A0?=
=?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=B6=E6=9B=BF=E6=8D=A2=E6=A1=86=E7=A6=81?=
=?UTF-8?q?=E7=94=A8=20REPORT-75998=20=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E6=A8=A1=E6=9D=BFWeb=E5=B1=9E=E6=80=A7=E5=BC=95=E7=94=A8JS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/js/SearchWebJSAction.java | 20 +++++++
.../actions/replace/info/ReplaceObject.java | 58 ++++++++++++++++---
.../actions/replace/info/base/SearchTag.java | 4 ++
3 files changed, 75 insertions(+), 7 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
index 0ceec53617..725d1280db 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
@@ -4,6 +4,7 @@ import com.fr.design.actions.replace.info.JSInfo;
import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.actions.replace.utils.SearchJSUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
@@ -19,6 +20,7 @@ import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.web.attr.ReportWebAttr;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -86,12 +88,30 @@ public class SearchWebJSAction implements SearchJS {
content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false);
addWebContent2Array(webAttr);
+ //处理引用JS
+ dealImportJS(content,jsInfos,webAttr);
for (int i = 0; i < arrayList.size(); i++) {
addJSInfos2ListFromArray(content, jsInfos, arrayList.get(i));
}
}
}
+ private void dealImportJS(ITContent content, List jsInfos, ReportWebAttr webAttr) {
+ if (webAttr != null){
+ for (String jsStr : webAttr.getJSImport()){
+ ITContent jsContent = ITContent.copy(content);
+ jsContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Report_Web_Attributes"),
+ Toolkit.i18nText("Fine-Design_Report_Import_JavaScript")
+ );
+ jsContent.setReplaceObject(jsStr);
+ jsContent.setHoldObject(webAttr);
+ jsContent.setTag(SearchTag.IMPORT_JS);
+ jsInfos.add(new JSInfo(jsContent));
+ }
+ }
+ }
+
private void addJSInfos2ListFromServerWebAttr(ITContent content, List jsInfos, WebContent webContent) {
ITContent newContent = ITContent.copy(content);
if (SERVER_MAP.containsKey(webContent.getClass().getSimpleName())) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index 3d615e18a9..d803f31012 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -3,13 +3,16 @@ package com.fr.design.actions.replace.info;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.form.event.Listener;
+import com.fr.general.GeneralUtils;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
+import com.fr.web.attr.ReportWebAttr;
import org.jetbrains.annotations.Nullable;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -184,36 +187,77 @@ public enum ReplaceObject implements DealWithInfoValue {
return StringUtils.equals(javaScript.getContent(), info.getContent().getOldShowStr());
}
},
+ /**
+ * 模板Web属性——引用JS
+ */
+ IMPORT_JS("String") {
+ @Override
+ public Map getValue(Object... o) {
+ HashMap map = new HashMap<>();
+ addValue2Map(contentKey, GeneralUtils.objectToString(o[0]), map);
+ return map;
+ }
+
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof ReportWebAttr) {
+ ReportWebAttr attr = (ReportWebAttr) info.getContent().getHoldObject();
+ List jsImports = Arrays.asList(attr.getJSImport());
+ String jsName = GeneralUtils.objectToString(info.getContent().getReplaceObject());
+ for (int i = 0, len = jsImports.size(); i < len; i++) {
+ if (StringUtils.equals(jsImports.get(i), jsName)) {
+ jsImports.set(i, ShowValueUtils.replaceAll(jsName, findStr, replaceStr));
+ }
+ }
+ attr.clearJSImportList();
+ for (int i = 0, len = jsImports.size(); i < len; i++) {
+ attr.addJSImport(jsImports.get(i));
+ }
+ }
+ }
+
+ @Override
+ public String getInfoShowStr(Info info) {
+ return GeneralUtils.objectToString(info.getContent().getReplaceObject());
+ }
+
+ @Override
+ boolean check(Info info) {
+ return true;
+ }
+ },
/**
* DBTableData——SQL
*/
DB_TABLE_DATA("DBTableData") {
@Override
- boolean check(Info info) {
+ boolean check (Info info){
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
return StringUtils.equals(dbTableData.getQuery(), info.getContent().getOldShowStr());
}
@Override
- public Map getValue(Object... o) {
+ public Map getValue (Object...o){
HashMap map = new HashMap<>();
addValue2Map(contentKey, ((DBTableData) o[0]).getQuery(), map);
return map;
}
@Override
- public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ public void setValue (Info info, String findStr, String
+ replaceStr, List < Pair < Integer, Integer >> operatorArray){
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
info.updateOldStr(dbTableData.getQuery(), findStr);
dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr));
- //todo DesignTableDataManager
}
@Override
- public String getInfoShowStr(Info info) {
+ public String getInfoShowStr (Info info){
return info.getInfoShowStr(info);
}
- };
+ }
+
+ ;
String name;
@@ -256,4 +300,4 @@ public enum ReplaceObject implements DealWithInfoValue {
abstract boolean check(Info info);
-}
+ }
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index 956d3ff386..b5e202bcb1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -52,6 +52,10 @@ public class SearchTag {
* 数据字典-公式-实际值
*/
public static final int DICT_PRODUCE = 10;
+ /**
+ * 引用JS
+ */
+ public static final int IMPORT_JS = 11;
From 9094e69ddf871eb27bde8e3d2843dac3eac98b24 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 14:11:34 +0800
Subject: [PATCH 044/310] =?UTF-8?q?REPORT-75998=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=A8=A1=E6=9D=BFWeb=E5=B1=9E=E6=80=A7?=
=?UTF-8?q?=E5=BC=95=E7=94=A8JS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../action/content/js/SearchWebJSAction.java | 20 +++++++
.../actions/replace/info/ReplaceObject.java | 58 ++++++++++++++++---
.../actions/replace/info/base/SearchTag.java | 4 ++
3 files changed, 75 insertions(+), 7 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
index 0ceec53617..725d1280db 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchWebJSAction.java
@@ -4,6 +4,7 @@ import com.fr.design.actions.replace.info.JSInfo;
import com.fr.design.actions.replace.info.base.ITContent;
+import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.actions.replace.utils.SearchJSUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JTemplate;
@@ -19,6 +20,7 @@ import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.web.attr.ReportWebAttr;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -86,12 +88,30 @@ public class SearchWebJSAction implements SearchJS {
content.setTemplateName(jTemplate.getTemplateName());
content.setJumpAble(false);
addWebContent2Array(webAttr);
+ //处理引用JS
+ dealImportJS(content,jsInfos,webAttr);
for (int i = 0; i < arrayList.size(); i++) {
addJSInfos2ListFromArray(content, jsInfos, arrayList.get(i));
}
}
}
+ private void dealImportJS(ITContent content, List jsInfos, ReportWebAttr webAttr) {
+ if (webAttr != null){
+ for (String jsStr : webAttr.getJSImport()){
+ ITContent jsContent = ITContent.copy(content);
+ jsContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Report_Web_Attributes"),
+ Toolkit.i18nText("Fine-Design_Report_Import_JavaScript")
+ );
+ jsContent.setReplaceObject(jsStr);
+ jsContent.setHoldObject(webAttr);
+ jsContent.setTag(SearchTag.IMPORT_JS);
+ jsInfos.add(new JSInfo(jsContent));
+ }
+ }
+ }
+
private void addJSInfos2ListFromServerWebAttr(ITContent content, List jsInfos, WebContent webContent) {
ITContent newContent = ITContent.copy(content);
if (SERVER_MAP.containsKey(webContent.getClass().getSimpleName())) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index 3d615e18a9..d803f31012 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -3,13 +3,16 @@ package com.fr.design.actions.replace.info;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.form.event.Listener;
+import com.fr.general.GeneralUtils;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair;
+import com.fr.web.attr.ReportWebAttr;
import org.jetbrains.annotations.Nullable;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -184,36 +187,77 @@ public enum ReplaceObject implements DealWithInfoValue {
return StringUtils.equals(javaScript.getContent(), info.getContent().getOldShowStr());
}
},
+ /**
+ * 模板Web属性——引用JS
+ */
+ IMPORT_JS("String") {
+ @Override
+ public Map getValue(Object... o) {
+ HashMap map = new HashMap<>();
+ addValue2Map(contentKey, GeneralUtils.objectToString(o[0]), map);
+ return map;
+ }
+
+ @Override
+ public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ if (info.getContent().getHoldObject() instanceof ReportWebAttr) {
+ ReportWebAttr attr = (ReportWebAttr) info.getContent().getHoldObject();
+ List jsImports = Arrays.asList(attr.getJSImport());
+ String jsName = GeneralUtils.objectToString(info.getContent().getReplaceObject());
+ for (int i = 0, len = jsImports.size(); i < len; i++) {
+ if (StringUtils.equals(jsImports.get(i), jsName)) {
+ jsImports.set(i, ShowValueUtils.replaceAll(jsName, findStr, replaceStr));
+ }
+ }
+ attr.clearJSImportList();
+ for (int i = 0, len = jsImports.size(); i < len; i++) {
+ attr.addJSImport(jsImports.get(i));
+ }
+ }
+ }
+
+ @Override
+ public String getInfoShowStr(Info info) {
+ return GeneralUtils.objectToString(info.getContent().getReplaceObject());
+ }
+
+ @Override
+ boolean check(Info info) {
+ return true;
+ }
+ },
/**
* DBTableData——SQL
*/
DB_TABLE_DATA("DBTableData") {
@Override
- boolean check(Info info) {
+ boolean check (Info info){
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
return StringUtils.equals(dbTableData.getQuery(), info.getContent().getOldShowStr());
}
@Override
- public Map getValue(Object... o) {
+ public Map getValue (Object...o){
HashMap map = new HashMap<>();
addValue2Map(contentKey, ((DBTableData) o[0]).getQuery(), map);
return map;
}
@Override
- public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) {
+ public void setValue (Info info, String findStr, String
+ replaceStr, List < Pair < Integer, Integer >> operatorArray){
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
info.updateOldStr(dbTableData.getQuery(), findStr);
dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr));
- //todo DesignTableDataManager
}
@Override
- public String getInfoShowStr(Info info) {
+ public String getInfoShowStr (Info info){
return info.getInfoShowStr(info);
}
- };
+ }
+
+ ;
String name;
@@ -256,4 +300,4 @@ public enum ReplaceObject implements DealWithInfoValue {
abstract boolean check(Info info);
-}
+ }
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
index 956d3ff386..b5e202bcb1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
@@ -52,6 +52,10 @@ public class SearchTag {
* 数据字典-公式-实际值
*/
public static final int DICT_PRODUCE = 10;
+ /**
+ * 引用JS
+ */
+ public static final int IMPORT_JS = 11;
From 8548304e6266631af204bc8ff46a68c1fe79f5c3 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 14:22:14 +0800
Subject: [PATCH 045/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E9=83=A8=E5=88=86=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/actions/replace/info/ReplaceObject.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index d803f31012..53bd77a4d1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -244,8 +244,7 @@ public enum ReplaceObject implements DealWithInfoValue {
}
@Override
- public void setValue (Info info, String findStr, String
- replaceStr, List < Pair < Integer, Integer >> operatorArray){
+ public void setValue (Info info, String findStr, String replaceStr, List < Pair < Integer, Integer >> operatorArray){
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
info.updateOldStr(dbTableData.getQuery(), findStr);
dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr));
@@ -255,9 +254,7 @@ public enum ReplaceObject implements DealWithInfoValue {
public String getInfoShowStr (Info info){
return info.getInfoShowStr(info);
}
- }
-
- ;
+ };
String name;
From c0ebf7f3cf9cabc0c550dd56d27277b630f2814b Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 14:44:01 +0800
Subject: [PATCH 046/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=A1=E9=AA=8C=E8=AE=A1=E6=95=B0=E9=94=99?=
=?UTF-8?q?=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../content/formula/template/SearchTemplateFormulaAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
index 0f9124721f..0dd6919558 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/template/SearchTemplateFormulaAction.java
@@ -107,7 +107,7 @@ public class SearchTemplateFormulaAction implements SearchTemplateFormula {
}
//数据校验
- for (int i = 0, len = attr.getValueVerifierCount(); i < len; i++) {
+ for (int i = 0, len = attr.getVerifierCount(); i < len; i++) {
Verifier verifier = attr.getVerifier(i);
if (verifier instanceof ValueVerifier) {
ITContent content = ITContent.copy(sheetContent);
From 34750dd81b6c50f2e67b2b388def15a0a0076345 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Thu, 29 Sep 2022 15:18:33 +0800
Subject: [PATCH 047/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9Burl=E7=BC=96=E7=A0=81=20?=
=?UTF-8?q?=E7=BB=99=E4=B8=80=E4=BA=9B=E5=B8=B8=E9=87=8F=E5=8A=A0=E6=B3=A8?=
=?UTF-8?q?=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineCloudConstants.java | 31 ++++++++++---------
.../alphafine/cell/model/RobotModel.java | 4 ++-
.../manager/impl/ComplementAdviceManager.java | 2 +-
.../manager/impl/SimilarSearchManager.java | 2 +-
4 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
index 35b363eb71..6f8b296aaa 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
@@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine;
+import com.fr.design.i18n.Toolkit;
import com.fr.general.CloudCenter;
/**
@@ -52,21 +53,21 @@ public class AlphaFineCloudConstants {
}
/**
- * get PluginUrl
+ * 获取插件信息api
*/
public static String getPluginUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO);
}
/**
- * get ReuseUrl
+ * 获取组件信息api
*/
public static String getReuseUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO);
}
/**
- * get DocumentDocUrl
+ * 获取帮助文档url
*/
public static String getDocumentDocUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW);
@@ -94,28 +95,28 @@ public class AlphaFineCloudConstants {
}
/**
- * get CloudServerUrl
+ * 获取云端接口,用于上传alphafine搜索记录
*/
public static String getCloudServerUrl() {
return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD);
}
/**
- * get SearchApi
+ * 获取搜索api,输入搜索词,返回fr的相关功能
*/
public static String getSearchApi() {
return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH);
}
/**
- * get SimilarSearchUrlPrefix
+ * 获取模糊搜索api前缀,输入搜索词,返回alphaFine相关内容,插件,文档,功能等
*/
public static String getSimilarSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH);
}
/**
- * get ComplementAdviceSearchUrlPrefix
+ * 补全建议搜索结果 api,与AF_SIMILAR_SEARCH接口类似,但是返回的信息更全
*/
public static String getComplementAdviceSearchUrlPrefix() {
return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH);
@@ -136,14 +137,14 @@ public class AlphaFineCloudConstants {
}
/**
- * get AlphaGoToWeb
+ * 推荐搜索api,输入搜索词,返回猜你想搜的内容(html格式)
*/
public static String getAlphaGoToWeb() {
return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB);
}
/**
- * get AlphaPreview
+ * 帆软智能客服页面url
*/
public static String getAlphaPreview() {
return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW);
@@ -170,12 +171,12 @@ public class AlphaFineCloudConstants {
String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH);
String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY);
String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT);
- return "[{\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," +
- "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," +
- "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," +
- "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," +
- "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," +
- "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]";
+ return "[{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start") + "\", \"link\":\"" + quickStartUrl + "\"}," +
+ "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning") + "\", \"link\":\"" + reportLearningPath + "\"}," +
+ "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning") + "\", \"link\":\"" + parameterLearningPath + "\"}," +
+ "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning") + "\", \"link\":\"" + fillLearningPath + "\"}," +
+ "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary") + "\", \"link\":\"" + apiSummary + "\"}," +
+ "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document") + "\", \"link\":\"" + monthlyDocument + "\"} ]";
}
/**
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
index 4c304d107f..493bf0de7b 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java
@@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.cell.model;
+import com.fr.base.login.ClientHelper;
import com.fr.design.actions.help.alphafine.AlphaFineCloudConstants;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType;
@@ -46,8 +47,9 @@ public class RobotModel extends AlphaCellModel {
}
public static String getContent(String titleStr) {
+ String encodedTitleStr = ClientHelper.urlEncode(titleStr, EncodeConstants.ENCODING_UTF_8);
String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr);
- String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token;
+ String url = AlphaFineCloudConstants.getAlphaGoToWeb() + encodedTitleStr + "&token=" + token;
try {
String result = HttpToolbox.get(url);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
index a00803210e..dbe810c8ea 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java
@@ -43,7 +43,7 @@ public class ComplementAdviceManager {
SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
- String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg);
+ String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try {
String result = HttpToolbox.get(url);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
index 102ead1bb2..dc7866301e 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java
@@ -50,7 +50,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider {
SearchResult allModelList = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8);
- String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg);
+ String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]);
String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8);
try {
String result = HttpToolbox.get(url);
From 3d8e0d5e6336e4b25c51fa072cd8b08d15d0c8cb Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Thu, 29 Sep 2022 15:58:03 +0800
Subject: [PATCH 048/310] =?UTF-8?q?REPORT-81241=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E6=8F=92?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83=E6=96=AD=E7=BD=91=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E6=97=A0=E5=8F=8D=E5=BA=94?=
=?UTF-8?q?=20=E5=88=A0=E9=99=A4json=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C?=
=?UTF-8?q?=E7=94=A8jsonarry=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/AlphaFineCloudConstants.java | 36 ++++++++++++-------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
index 6f8b296aaa..9fb243d1e8 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineCloudConstants.java
@@ -2,6 +2,10 @@ package com.fr.design.actions.help.alphafine;
import com.fr.design.i18n.Toolkit;
import com.fr.general.CloudCenter;
+import com.fr.json.JSONArray;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* 云端变量统一管理
@@ -38,6 +42,9 @@ public class AlphaFineCloudConstants {
private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document";
private static final String AF_RECOMMEND = "af.recommend";
+ private static final String LINK_NAME = "name";
+ private static final String LINK_URL = "link";
+
/**
* 获取插件搜索api
*/
@@ -165,18 +172,23 @@ public class AlphaFineCloudConstants {
}
private static String getDefaultRecommend() {
- String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START);
- String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH);
- String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH);
- String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH);
- String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY);
- String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT);
- return "[{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start") + "\", \"link\":\"" + quickStartUrl + "\"}," +
- "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning") + "\", \"link\":\"" + reportLearningPath + "\"}," +
- "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning") + "\", \"link\":\"" + parameterLearningPath + "\"}," +
- "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning") + "\", \"link\":\"" + fillLearningPath + "\"}," +
- "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary") + "\", \"link\":\"" + apiSummary + "\"}," +
- "{\"name\":\"" + Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document") + "\", \"link\":\"" + monthlyDocument + "\"} ]";
+ String[][] links = new String[][]{
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START)},
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH)},
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH)},
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH)},
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY)},
+ {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT)}
+ };
+ JSONArray jsonArray = new JSONArray();
+ for (String[] link : links) {
+ Map map = new HashMap<>();
+ map.put(LINK_NAME, link[0]);
+ map.put(LINK_URL, link[1]);
+ jsonArray.put(map);
+ }
+
+ return jsonArray.toString();
}
/**
From 5c716eb147fc6032a824395baa85f9de91c7181e Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Thu, 29 Sep 2022 17:36:40 +0800
Subject: [PATCH 049/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=AE=8C=E6=88=90=E5=90=8E=E6=89=93=E5=BC=80?=
=?UTF-8?q?=E6=96=B0=E6=A8=A1=E6=9D=BF=E6=97=A0=E6=9F=A5=E6=89=BE=E5=86=85?=
=?UTF-8?q?=E5=AE=B9=E4=B8=8D=E7=AC=A6=E7=9A=84=E6=8F=90=E7=A4=BA=EF=BC=8C?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=85=A5img=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../replace/ui/ITReplaceMainDialog.java | 55 ++++-----
.../actions/replace/ui/ITTableButton.java | 9 +-
.../actions/replace/utils/ShowValueUtils.java | 108 ++++++++++++++++--
3 files changed, 130 insertions(+), 42 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
index 4843df57f4..54e6a3bff4 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
@@ -48,13 +48,14 @@ public class ITReplaceMainDialog extends UIDialog {
private static boolean matched = false;
private static volatile ITReplaceMainDialog instance = null;
private static String templateID;
+ private static String templateName;
private ITReplaceNorthPanel northPane;
private ITReplaceSouthPanel southPanel;
private ITReplaceWestPanel westPanel;
private boolean searchFlag;
private String searchStr;
private static final int FIRST_ROW = 0;
- public static int selectCount = 0;
+ public static int selectCount = 0;
public ITReplaceMainDialog() {
super(DesignerContext.getDesignerFrame());
@@ -165,8 +166,9 @@ public class ITReplaceMainDialog extends UIDialog {
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
String replaceStr = ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).getText();
//替换内容为空需要触发搜索
- if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) {
- if (isITReplaceValid() && checkTemplateChanged(searchResultList)) {
+ if (isITReplaceValid() && checkTemplateChanged(searchResultList)) {
+ if (StringUtils.equals(getSearchStr(), searchStr) && StringUtils.isNotEmpty(replaceStr)) {
+ HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true);
for (Info info : searchResultList) {
if (info.getContent().isSelected()) {
info.setValue(info, searchStr, replaceStr, info.getContent().getOperatorArray());
@@ -175,29 +177,26 @@ public class ITReplaceMainDialog extends UIDialog {
southPanel.getTableEditorPane().update();
northPane.refreshReplaceInputComboBoxItems();
ITTableEditorPane.getEditTable().repaint();
- HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified(true);
setSearchFlag(false);
- search();
- } else {
- Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")};
- int optionSelected = FineJOptionPane.showOptionDialog(
- ITReplaceMainDialog.this,
- Toolkit.i18nText("Fine-Design_Replace_Message"),
- Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.ERROR_MESSAGE,
- null,
- // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框)
- options,
- options[0]
- );
- //如果选择了重新查找,则再查找一遍
- if (optionSelected == 0) {
- search();
- }
}
- } else {
search();
+ } else {
+ Object[] options = new Object[]{Toolkit.i18nText("Fine-Design_Replace_Search_Again"), Toolkit.i18nText("Fine-Design_Basic_Cancel")};
+ int optionSelected = FineJOptionPane.showOptionDialog(
+ ITReplaceMainDialog.this,
+ Toolkit.i18nText("Fine-Design_Replace_Message"),
+ Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.ERROR_MESSAGE,
+ null,
+ // 如果传null, 则按钮为 optionType 类型所表示的按钮(也就是确认对话框)
+ options,
+ options[0]
+ );
+ //如果选择了重新查找,则再查找一遍
+ if (optionSelected == 0) {
+ search();
+ }
}
@@ -220,7 +219,8 @@ public class ITReplaceMainDialog extends UIDialog {
*/
public boolean isITReplaceValid() {
if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) {
- return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID);
+ return StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID(), templateID)
+ && StringUtils.equals(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateName(), templateName);
} else {
return false;
}
@@ -288,6 +288,7 @@ public class ITReplaceMainDialog extends UIDialog {
if (JTemplate.isValid(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate())) {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
templateID = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget().getTemplateID();
+ templateName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateName();
itTableEditor.clear();
String searchStr = ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).getText();
//更新搜索内容
@@ -310,12 +311,12 @@ public class ITReplaceMainDialog extends UIDialog {
setSearchFlag(true);
selectCount = searchResultList.size();
//如果有结果,默认选中第一行
- if (searchResultList.size() > 0){
- getEditTable().addRowSelectionInterval(FIRST_ROW,FIRST_ROW);
+ if (searchResultList.size() > 0) {
+ getEditTable().addRowSelectionInterval(FIRST_ROW, FIRST_ROW);
}
//更新替换按钮可用性
- if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0){
+ if (StringUtils.isEmpty(searchStr) || searchResultList.size() == 0) {
northPane.getReplaceButton().setEnabled(false);
} else {
northPane.getReplaceButton().setEnabled(true);
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
index 03717a725c..d64946d09d 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
@@ -6,13 +6,14 @@ import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
-import com.fr.design.mainframe.ReportComponentComposite;
+import com.fr.file.FILEFactory;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
+import com.fr.stable.project.ProjectConstants;
+
import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
-import javax.swing.SwingUtilities;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.Component;
@@ -42,7 +43,9 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
ITContent content = (ITContent) getEditTable().getValueAt(getEditTable().getEditingRow(), 6);
if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) {
ITReplaceMainDialog.setITReplaceFlag(true);
- HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(new TRL(GeneralUtils.objectToString(content.getTrlString())));
+ TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString()));
+ DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(ProjectConstants.REPORTLETS_NAME + FILEFactory.SEPARATOR + content.getTemplateName()));
+ HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl);
}
ITReplaceMainDialog.setITReplaceFlag(false);
}
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index 19ab2758f3..6c7b16cdd1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -28,6 +28,25 @@ public class ShowValueUtils {
public static final String ANY_THING_REGEX = ".";
public static final String NUMBER_REGEX = "[0-9]";
public static final String ENGLISH_REGEX = "[a-zA-Z]";
+ public static final char LEFT_HTML_CHAR = '<';
+ public static final char RIGHT_HTML_CHAR = '>';
+ public static final String HEAD = "";
+ public static final String TAIL = "";
+ public static final String FONT_HEAD = "";
+ public static final String FONT_TAIL = "";
+ public static final String HTML = "";
+ public static final String NOBR = "";
+ public static final String HTML_TAIL = "";
+ public static final String NOBR_TAIL = "";
+ public static final int HEAD_LEN = HEAD.length();
+ public static final int TAIL_LEN = TAIL.length();
+ public static final int FONT_HEAD_LEN = FONT_HEAD.length();
+ public static final int FONT_TAIL_LEN = FONT_TAIL.length();
+ public static final int HTML_LEN = HTML.length();
+ public static final int HTML_TAIL_LEN = HTML_TAIL.length();
+ public static final int NOBR_LEN = NOBR.length();
+ public static final int NOBR_TAIL_LEN = NOBR_TAIL.length();
+
public static Pattern containPattern;
private static List specialCharList = new ArrayList<>();
@@ -135,33 +154,97 @@ public class ShowValueUtils {
String result = str;
Pattern pattern = containPattern;
Matcher matcher = pattern.matcher(str);
- String head = "";
- String tail = "";
- int size = head.length() + tail.length();
+ int size = FONT_HEAD.length() + FONT_TAIL.length();
int index = 0;
StringBuilder builder = new StringBuilder(str);
while (matcher.find()) {
- builder.replace(matcher.start() + index, matcher.end() + index, head + changeHtmlStr(matcher.group()) + tail);
+ builder.replace(matcher.start() + index, matcher.end() + index, FONT_HEAD + changeHtmlStr(matcher.group()) + FONT_TAIL);
index += size;
+ index += getIncreaseCount(matcher.group());
}
- return "" +
- builder.toString() +
- "
";
+
+ return changeOriginHtmlStr(HEAD + builder.toString() + TAIL);
} else {
- return "" +
- replaceAll(str, searchStr, "" + changeHtmlStr(searchStr) + "") +
- "
";
+ String ans = HEAD + replaceAll(str, searchStr, FONT_HEAD + changeHtmlStr(searchStr) + FONT_TAIL) + TAIL;
+ return changeOriginHtmlStr(ans);
+ }
+
+ }
+
+ /**
+ * 用于处理原字符串中的尖括号
+ */
+ private static String changeOriginHtmlStr(String str) {
+ int count = 0;
+ int different = 3;
+ StringBuilder builder = new StringBuilder(str);
+ for (int i = 0; i < str.length(); i++) {
+ char c = str.charAt(i);
+ if (c == LEFT_HTML_CHAR) {
+ if (!checkValid(str, i)) {
+ builder.replace(i + count, i + count + 1, "<");
+ count += different;
+ }
+ }
}
+ return builder.toString();
+ }
+ private static boolean checkValid(String str, int i) {
+ int leftLen = str.length() - (i + 1);
+ return checkStrValid(str, i, leftLen, HTML_LEN, HTML) ||
+ checkStrValid(str, i, leftLen, HTML_TAIL_LEN, HTML_TAIL) ||
+ checkStrValid(str, i, leftLen, FONT_HEAD_LEN, FONT_HEAD) ||
+ checkStrValid(str, i, leftLen, FONT_TAIL_LEN, FONT_TAIL) ||
+ checkStrValid(str, i, leftLen, NOBR_LEN, NOBR) ||
+ checkStrValid(str, i, leftLen, NOBR_TAIL_LEN, NOBR_TAIL);
}
- private static String changeHtmlStr(String searchStr){
+ /**
+ * 是否是所指定的字符串
+ *
+ * @param str
+ * @param i
+ * @param leftLen
+ * @return
+ */
+ private static boolean checkStrValid(String str, int i, int leftLen, int len, String checkStr) {
+ if (leftLen < len - 1) {
+ return false;
+ } else {
+ return StringUtils.equals(str.substring(i, i + len), checkStr);
+ }
+ }
+
+
+ /**
+ * 用于处理搜索的字符中的尖括号
+ *
+ * @param searchStr
+ * @return
+ */
+ private static String changeHtmlStr(String searchStr) {
String showStr = searchStr;
- showStr = showStr.replace("<","<");
+ showStr = showStr.replace("<", "<");
showStr = showStr.replace(">", ">");
return showStr;
}
+ private static int getIncreaseCount(String str) {
+ int count = 0;
+ int leftDifferent = 3;
+ int rightDifferent = 2;
+ for (int i = 0; i < str.length(); i++) {
+ if (str.charAt(i) == LEFT_HTML_CHAR) {
+ count += leftDifferent;
+ }
+ if (str.charAt(i) == RIGHT_HTML_CHAR) {
+ count += rightDifferent;
+ }
+ }
+ return count;
+ }
+
/**
* 集合是否不为空
*
@@ -193,6 +276,7 @@ public class ShowValueUtils {
/**
* 支持通配符的contains
+ *
* @param originStr
* @param matchStr
* @return
From 0afa23c3c33303301601d293090b6e3e9fe38acd Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Fri, 30 Sep 2022 10:32:30 +0800
Subject: [PATCH 050/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2=E6=9D=BF=E4=B8=8D=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E7=9A=84bug=E3=80=81=E4=BC=98=E5=8C=96=E9=AD=94?=
=?UTF-8?q?=E6=9C=AF=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../actions/replace/info/ReplaceObject.java | 7 +++++++
.../actions/replace/utils/ShowValueUtils.java | 18 +++++++++++-------
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
index 53bd77a4d1..48a4dbf644 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/ReplaceObject.java
@@ -1,7 +1,10 @@
package com.fr.design.actions.replace.info;
import com.fr.data.impl.DBTableData;
+import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.replace.utils.ShowValueUtils;
+import com.fr.design.data.DesignTableDataManager;
+import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.form.event.Listener;
import com.fr.general.GeneralUtils;
import com.fr.js.JavaScriptImpl;
@@ -248,6 +251,10 @@ public enum ReplaceObject implements DealWithInfoValue {
DBTableData dbTableData = (DBTableData) info.getContent().getReplaceObject();
info.updateOldStr(dbTableData.getQuery(), findStr);
dbTableData.setQuery(ShowValueUtils.replaceAll(dbTableData.getQuery(), findStr, replaceStr));
+ //清除缓存
+ DesignTableDataManager.removeSelectedColumnNames(dbTableData.getName());
+ //收缩菜单
+ TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
}
@Override
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index 6c7b16cdd1..d7baa0a733 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -46,6 +46,14 @@ public class ShowValueUtils {
public static final int HTML_TAIL_LEN = HTML_TAIL.length();
public static final int NOBR_LEN = NOBR.length();
public static final int NOBR_TAIL_LEN = NOBR_TAIL.length();
+ /**
+ * <转变为<的长度差
+ */
+ public static final int LEFT_DIFFERENT = 3;
+ /**
+ * >转变为>的长度差
+ */
+ public static final int RIGHT_DIFFERENT = 2;
public static Pattern containPattern;
private static List specialCharList = new ArrayList<>();
@@ -168,7 +176,6 @@ public class ShowValueUtils {
String ans = HEAD + replaceAll(str, searchStr, FONT_HEAD + changeHtmlStr(searchStr) + FONT_TAIL) + TAIL;
return changeOriginHtmlStr(ans);
}
-
}
/**
@@ -176,14 +183,13 @@ public class ShowValueUtils {
*/
private static String changeOriginHtmlStr(String str) {
int count = 0;
- int different = 3;
StringBuilder builder = new StringBuilder(str);
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (c == LEFT_HTML_CHAR) {
if (!checkValid(str, i)) {
builder.replace(i + count, i + count + 1, "<");
- count += different;
+ count += LEFT_DIFFERENT;
}
}
}
@@ -232,14 +238,12 @@ public class ShowValueUtils {
private static int getIncreaseCount(String str) {
int count = 0;
- int leftDifferent = 3;
- int rightDifferent = 2;
for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == LEFT_HTML_CHAR) {
- count += leftDifferent;
+ count += LEFT_DIFFERENT;
}
if (str.charAt(i) == RIGHT_HTML_CHAR) {
- count += rightDifferent;
+ count += RIGHT_DIFFERENT;
}
}
return count;
From ac7943ba9acb7bc079e6b331901135d1fff8146a Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Fri, 30 Sep 2022 10:56:56 +0800
Subject: [PATCH 051/310] =?UTF-8?q?REPORT-81483=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=9111.0?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=9C=80=E8=A6=81=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E6=90=9C=E7=B4=A210.0&11.0=E7=9A=84=E6=A8=A1=E6=9D=BF=201?=
=?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AF=B7=E6=B1=82=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=202=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8F=82?=
=?UTF-8?q?=E6=95=B0=E7=BC=96=E7=A0=81=E6=96=B9=E5=BC=8F=203=E3=80=81?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E9=87=8D=E8=BD=BD=E4=BA=8B=E4=BB=B6?=
=?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=87=8D=E8=BD=BD=E5=8A=A8=E7=94=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../alphafine/component/AlphaFineFrame.java | 2 +-
.../search/helper/FineMarketClientHelper.java | 13 ++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
index 0269480b60..e74108fee9 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
@@ -915,7 +915,7 @@ public class AlphaFineFrame extends JFrame {
if (StringUtils.isEmpty(text)) {
return;
}
- searchLoadingPane = new SearchLoadingPane();
+ initSearchLoadingPane();
SearchTextBean searchTextBean = new SearchTextBean(text, segmentationResult);
this.productNewsSearchWorkerManager.doSearch(searchTextBean);
this.documentWorkerManager.doSearch(searchTextBean);
diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
index 42b28cfe8a..817a47cca4 100644
--- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
+++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
@@ -50,13 +50,11 @@ public class FineMarketClientHelper {
private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey();
public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info");
public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url");
- public static final String VERSION = "version";
- private static final String CURRENT_VERSION = "11.0";
public static final String FILE_DOWNLOAD = "file/download/";
public static final String PACKAGE_DOWNLOAD = "package/download/";
public static final String TEMPLATES_PARENT_PACKAGE = "parent/";
public static final String TEMPLATES_TAGS = "filter";
- public static final String NAME_SEARCH = "searchKeyword";
+ public static final String NAME_SEARCH = "?searchKeyword=";
public static final String RESPONSE_STATE = "state";
public static final String RESPONSE_SUCCESS = "ok";
@@ -271,11 +269,12 @@ public class FineMarketClientHelper {
}
}
+ /**
+ * 通过名字搜索模板信息
+ */
public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException {
- Map params = new HashMap();
- params.put(NAME_SEARCH, name);
- params.put(VERSION, CURRENT_VERSION);
- String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params);
+ String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8);
+ String jsonString = HttpToolbox.get(url);
JSONObject jsonObject = new JSONObject(jsonString);
String responseState = (String) jsonObject.get(RESPONSE_STATE);
if (RESPONSE_SUCCESS.equals(responseState)) {
From 03e4e616d290e63c7c9d2e1d8aacdd44c738ad9c Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Fri, 30 Sep 2022 11:30:46 +0800
Subject: [PATCH 052/310] =?UTF-8?q?REPORT-81416=20=E8=AE=BE=E8=AE=A1?=
=?UTF-8?q?=E5=99=A8=E9=97=AA=E9=80=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/carton/EventDispatchThreadHangMonitor.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
index f472d901a1..56ccaa2c48 100644
--- a/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
+++ b/designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
@@ -7,7 +7,6 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstantsBase;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
-import com.fr.third.ibm.icu.text.SimpleDateFormat;
import org.jetbrains.annotations.NotNull;
import javax.swing.SwingUtilities;
@@ -22,6 +21,7 @@ import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
+import java.text.SimpleDateFormat;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
From 1023ff0713ac4c656b370f9620ea9644b032f66d Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Fri, 30 Sep 2022 14:36:14 +0800
Subject: [PATCH 053/310] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?=
=?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?=
=?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?=
=?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
按钮交互逻bug
---
.../actions/help/alphafine/component/CustomSortPane.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
index 747b8d8ce0..adb63730de 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
@@ -153,7 +153,11 @@ public class CustomSortPane extends JPanel {
if (order == 0) {
top.setEnabled(false);
up.setEnabled(false);
+ down.setEnabled(true);
+ bottom.setEnabled(true);
} else if (order == sortItemPane.getComponentCount() - 1) {
+ up.setEnabled(true);
+ top.setEnabled(true);
down.setEnabled(false);
bottom.setEnabled(false);
} else {
From 3ce6caba58ad04bfb4abf8250f472ed240241fd8 Mon Sep 17 00:00:00 2001
From: "Link.Zhao"
Date: Fri, 30 Sep 2022 14:46:03 +0800
Subject: [PATCH 054/310] =?UTF-8?q?REPORT-81222=E3=80=90=E8=BF=90=E8=90=A5?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA?=
=?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F=E5=85=88=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E9=A6=96=E4=B8=AA=E5=86=8D=E7=82=B9=E5=87=BB=E6=9C=80=E5=90=8E?=
=?UTF-8?q?=E4=B8=80=E4=B8=AA=EF=BC=8C=E4=B8=8A=E4=B8=8B=E7=AE=AD=E5=A4=B4?=
=?UTF-8?q?=E7=BD=AE=E7=81=B0=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
按钮交互逻bug
---
.../alphafine/component/CustomSortPane.java | 31 ++++++++++++-------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
index adb63730de..c544bbac0b 100644
--- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
+++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
@@ -85,6 +85,7 @@ public class CustomSortPane extends JPanel {
top.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, 0);
+ setToolbarEnable(false, false, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@@ -94,6 +95,7 @@ public class CustomSortPane extends JPanel {
bottom.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1);
+ setToolbarEnable(true, true, false, false);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@@ -103,6 +105,7 @@ public class CustomSortPane extends JPanel {
up.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1);
+ setToolbarEnable(true, true, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@@ -112,6 +115,7 @@ public class CustomSortPane extends JPanel {
down.addActionListener(e -> {
SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1);
+ setToolbarEnable(true, true, true, true);
CustomSortPane.this.revalidate();
CustomSortPane.this.repaint();
refreshCurrentOrder();
@@ -151,23 +155,26 @@ public class CustomSortPane extends JPanel {
private void disableButton() {
int order = sortItemPane.getComponentZOrder(selectedLabel);
if (order == 0) {
- top.setEnabled(false);
- up.setEnabled(false);
- down.setEnabled(true);
- bottom.setEnabled(true);
+ setToolbarEnable(false, false, true, true);
} else if (order == sortItemPane.getComponentCount() - 1) {
- up.setEnabled(true);
- top.setEnabled(true);
- down.setEnabled(false);
- bottom.setEnabled(false);
+ setToolbarEnable(true, true, false, false);
} else {
- up.setEnabled(true);
- top.setEnabled(true);
- down.setEnabled(true);
- bottom.setEnabled(true);
+ setToolbarEnable(true, true, true, true);
}
}
+ /**
+ * 设置 置顶,上移,下移,置底 按钮的状态
+ * true:启用
+ * false:关闭
+ */
+ private void setToolbarEnable(boolean top, boolean up, boolean down, boolean bottom) {
+ this.top.setEnabled(top);
+ this.up.setEnabled(up);
+ this.down.setEnabled(down);
+ this.bottom.setEnabled(bottom);
+ }
+
private void refreshCurrentOrder() {
String[] currentTabOrder = parentPane.getCurrentOrder();
HashSet selectedTab = new HashSet<>();
From 9d4d5f6473a2c1b6b52aa3cf124a90a856014074 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Fri, 30 Sep 2022 14:55:57 +0800
Subject: [PATCH 055/310] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E5=A4=9A=E7=BA=A7=E8=8F=9C=E5=8D=95=E4=B8=8B=E6=97=A0=E6=B3=95?=
=?UTF-8?q?=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../replace/action/content/cell/SearchCellAction.java | 1 +
.../content/component/SearchComponentAction.java | 1 +
.../content/floatelement/SearchFloatAction.java | 1 +
.../action/content/widget/SearchWidgetAction.java | 1 +
.../design/actions/replace/info/base/ITContent.java | 11 +++++++++++
.../fr/design/actions/replace/ui/ITTableButton.java | 2 +-
6 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
index 826b247e0c..2711069847 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java
@@ -61,6 +61,7 @@ public class SearchCellAction implements SearchAction {
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
content.addTRL(jTemplate.getTemplateName());
+ content.setTemplatePath(jTemplate.getPath());
if (jTemplate.getTarget() instanceof Form) {
setCellInfos(dealForm(jTemplate));
} else if (jTemplate.getTarget() instanceof WorkBook) {
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java
index 336aa93745..fd741fdf7e 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/component/SearchComponentAction.java
@@ -50,6 +50,7 @@ public class SearchComponentAction implements SearchAction {
Form form = (Form) jTemplate.getTarget();
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
+ content.setTemplatePath(jTemplate.getPath());
content.addTRL(jTemplate.getTemplateName());
content.setFrmFlag(true);
//处理最底层form组件
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
index 4eaa574bea..13398be1f1 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java
@@ -44,6 +44,7 @@ public class SearchFloatAction implements SearchAction {
Report report = workBook.getReport(i);
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
+ content.setTemplatePath(jTemplate.getPath());
content.setSheetID(String.valueOf(i));
content.setSheetName(workBook.getReportName(i));
content.addTRL(jTemplate.getTemplateName());
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java
index 66ca91dd15..32a21bee54 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/widget/SearchWidgetAction.java
@@ -44,6 +44,7 @@ public class SearchWidgetAction implements SearchAction {
ArrayList widgetInfos = new ArrayList<>();
ITContent content = new ITContent();
content.setTemplateName(jTemplate.getTemplateName());
+ content.setTemplatePath(jTemplate.getPath());
//这边拿SearchCellAction里的CellInfo来查找,由于在SearchCellAction里面已经考虑了决策报表和普通报表两种情况了,这边就不用再做区分
addCellWidget2Array(widgetInfos, jTemplate);
content.addTRL(jTemplate.getTemplateName());
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java
index afa9847f37..ee83e77534 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/ITContent.java
@@ -19,6 +19,7 @@ public class ITContent implements Cloneable {
private String sheetID;
private String sheetName;
private String templateName;
+ private String templatePath;
private String blockName;
/**
* 一些不好定位的位置先用字符串展示出来就好
@@ -90,6 +91,7 @@ public class ITContent implements Cloneable {
this.trlString = StringUtils.EMPTY;
this.operatorArray = new ArrayList<>();
this.holdObject = new Object();
+ this.templatePath = StringUtils.EMPTY;
}
@@ -117,6 +119,7 @@ public class ITContent implements Cloneable {
result.setJumpAble(content.isJumpAble());
result.setHoldObject(content.getHoldObject());
result.setTag(content.getTag());
+ result.setTemplatePath(content.getTemplatePath());
}
return result;
}
@@ -205,6 +208,14 @@ public class ITContent implements Cloneable {
this.showObject = showObject;
}
+ public String getTemplatePath() {
+ return templatePath;
+ }
+
+ public void setTemplatePath(String templatePath) {
+ this.templatePath = templatePath;
+ }
+
/**
* 添加位置信息
*
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
index d64946d09d..1a73d3fcb3 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableButton.java
@@ -44,7 +44,7 @@ public class ITTableButton extends AbstractCellEditor implements TableCellEditor
if (StringUtils.isNotEmpty(GeneralUtils.objectToString(content.getTrlString()))) {
ITReplaceMainDialog.setITReplaceFlag(true);
TRL trl = new TRL(GeneralUtils.objectToString(content.getTrlString()));
- DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(ProjectConstants.REPORTLETS_NAME + FILEFactory.SEPARATOR + content.getTemplateName()));
+ DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(content.getTemplatePath()));
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().navigate(trl);
}
ITReplaceMainDialog.setITReplaceFlag(false);
From 05aad1deddada9f60b4474d1b7c5cfc588ac0e36 Mon Sep 17 00:00:00 2001
From: "Destiny.Lin"
Date: Fri, 30 Sep 2022 16:19:17 +0800
Subject: [PATCH 056/310] =?UTF-8?q?REPORT-75998=20=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E5=8C=B9=E9=85=8D?=
=?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?=
=?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E6=8E=A7=E4=BB=B6=E4=BA=8B=E4=BB=B6?=
=?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0=E4=B8=AD?=
=?UTF-8?q?=E7=9A=84JS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SearchExportJSFormulaAction.java | 6 +-
.../actions/replace/utils/SearchJSUtils.java | 25 ++++
.../actions/replace/utils/ShowValueUtils.java | 8 +-
.../replace/utils/ShowValueUtilsTest.java | 107 ++++++++++++++++++
4 files changed, 143 insertions(+), 3 deletions(-)
create mode 100644 designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
index d19970c218..32b5721a52 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java
@@ -27,7 +27,7 @@ public class SearchExportJSFormulaAction implements SearchJSFormula {
@Override
public void searchJSFormulaFromOther(List formulaInfos, ITContent content, JavaScript javaScript) {
- //如果导出当前模板,可以存公式的地方就是命名方式-自定义
+ //如果导出当前模板,可以存公式的地方就是命名方式-自定义、参数设置
if (((ExportJavaScript) javaScript).isCurrentTemplate()) {
content.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current"));
dealSingleJavaScript(formulaInfos, content, ((ExportJavaScript) javaScript).getCurrentTemplateJavaScript());
@@ -42,6 +42,8 @@ public class SearchExportJSFormulaAction implements SearchJSFormula {
}
}
+
+
public boolean isListExist(List list) {
return list != null && list.size() > 0;
}
@@ -57,8 +59,8 @@ public class SearchExportJSFormulaAction implements SearchJSFormula {
formulaInfos.add(new FormulaInfo(newContent));
}
if (!javaScript.isExtendParameters()) {
- ITContent paraContent = ITContent.copy(content);
for (ParameterProvider parameter : javaScript.getParameters()) {
+ ITContent paraContent = ITContent.copy(content);
if (parameter.getValue() instanceof Formula) {
paraContent.addOtherPos(Toolkit.i18nText("Fine-Design_Basic_Base_Value"));
paraContent.setReplaceObject(parameter.getValue());
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java
index a63dabeb77..d04b02aa26 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/SearchJSUtils.java
@@ -12,6 +12,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.form.event.Listener;
import com.fr.form.ui.Widget;
import com.fr.general.GeneralUtils;
+import com.fr.js.Commit2DBJavaScript;
import com.fr.js.JavaScript;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
@@ -49,10 +50,34 @@ public class SearchJSUtils {
ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(listener);
SearchJSUtils.addJSInfos(jsInfos, new JSInfo(newContent));
+ } else if (javaScript instanceof Commit2DBJavaScript){
+ dealCommit2DBJS(jsInfos, content, (Commit2DBJavaScript) javaScript);
}
}
}
+ private static void dealCommit2DBJS(List jsInfos, ITContent content, Commit2DBJavaScript javaScript) {
+ if (!javaScript.getDBManipulation().isEmpty()) {
+ //处理回调函数
+ dealWithCallBack(jsInfos, content, javaScript);
+ }
+ }
+
+ private static void dealWithCallBack(List jsInfos, ITContent content, Commit2DBJavaScript commit2DBJavaScript) {
+ JavaScript javaScript = commit2DBJavaScript.getCallBack();
+ ITContent newContent = ITContent.copy(content);
+ newContent.addOtherPos(
+ Toolkit.i18nText("Fine-Design_Basic_Set_Callback_Function")
+ );
+ if (javaScript instanceof JavaScriptImpl) {
+ newContent.setReplaceObject(javaScript);
+ jsInfos.add(new JSInfo(newContent));
+ } else if (javaScript instanceof Commit2DBJavaScript){
+ dealCommit2DBJS(jsInfos, newContent, (Commit2DBJavaScript) javaScript);
+ }
+ }
+
+
/**
* 获取HtmlLabel数组
*
diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
index d7baa0a733..b7b46539b3 100644
--- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
+++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java
@@ -59,9 +59,11 @@ public class ShowValueUtils {
private static List specialCharList = new ArrayList<>();
static {
- //正则特殊字符:? * () [] {} ^ $ .
+ //正则特殊字符:? * () [] {} ^ $ . \ + |
//如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理
//$同理
+ specialCharList.add("\\");
+ specialCharList.add("/");
specialCharList.add("*");
specialCharList.add("(");
specialCharList.add(")");
@@ -71,6 +73,10 @@ public class ShowValueUtils {
specialCharList.add("}");
specialCharList.add("^");
specialCharList.add(".");
+ specialCharList.add("+");
+ specialCharList.add("|");
+ specialCharList.add("!");
+
}
/**
diff --git a/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java b/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java
new file mode 100644
index 0000000000..d31511bddc
--- /dev/null
+++ b/designer-realize/src/test/java/com/fr/design/actions/replace/utils/ShowValueUtilsTest.java
@@ -0,0 +1,107 @@
+package com.fr.design.actions.replace.utils;
+
+import junit.framework.TestCase;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Destiny.Lin
+ * @version 11.0
+ * created by Destiny.Lin on 2022-09-30
+ */
+public class ShowValueUtilsTest extends TestCase {
+
+
+ public void testChangeRegex() {
+
+ /**
+ * 字符"."
+ */
+ String regex = ".";
+ String str = "=\"通配符:我(){}[]是*cu/r?y+单!^个字|+符串/?\\?.\"";
+ Pattern pattern = Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher = pattern.matcher(str);
+ assertTrue(matcher.find());
+ while (matcher.find()){
+ assertEquals(".", matcher.group());
+ }
+
+ /**
+ * 字符"?"
+ */
+ regex = "??.";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher1 = pattern.matcher(str);
+ assertTrue(matcher1.find());
+ while (matcher1.find()){
+ assertEquals("\\?.", matcher1.group());
+ }
+
+ /**
+ * 字符"\"
+ */
+ regex = "?\\";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher2 = pattern.matcher(str);
+ assertTrue(matcher2.find());
+ while (matcher2.find()){
+ assertEquals("?\\", matcher2.group());
+ }
+
+ /**
+ * 字符"/"
+ */
+ regex = "/";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher3 = pattern.matcher(str);
+ assertTrue(matcher3.find());
+ while (matcher3.find()){
+ assertEquals("/", matcher3.group());
+ }
+
+ /**
+ * 字符"*"
+ */
+ regex = "*";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher4 = pattern.matcher(str);
+ assertTrue(matcher4.find());
+ while (matcher4.find()){
+ assertEquals("*", matcher4.group());
+ }
+
+ /**
+ * 字符"(){}[]"
+ */
+ regex = "(){}[]";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher5 = pattern.matcher(str);
+ assertTrue(matcher5.find());
+ while (matcher5.find()){
+ assertEquals("(){}[]", matcher5.group());
+ }
+
+ /**
+ * 字符"^"
+ */
+ regex = "!^";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher6 = pattern.matcher(str);
+ assertTrue(matcher6.find());
+ while (matcher6.find()){
+ assertEquals("!^", matcher6.group());
+ }
+
+ /**
+ * 字符"|+"
+ */
+ regex = "|+";
+ pattern =Pattern.compile(ShowValueUtils.changeRegex(regex));
+ Matcher matcher7 = pattern.matcher(str);
+ assertTrue(matcher7.find());
+ while (matcher7.find()){
+ assertEquals("|+", matcher7.group());
+ }
+ }
+}
\ No newline at end of file
From 5d8d998af3079ef02d7e77d22a8d31be716fb912 Mon Sep 17 00:00:00 2001
From: Starryi
Date: Fri, 30 Sep 2022 17:43:14 +0800
Subject: [PATCH 057/310] =?UTF-8?q?REPORT-81336=20FR11=E5=86=B3=E7=AD=96?=
=?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=8A=A5=E8=A1=A8=E5=9D=97-=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=E9=80=80=E5=87=BA=EF=BC=8C=E7=BC=96=E8=BE=91=E5=86=85?=
=?UTF-8?q?=E5=AE=B9=E4=B8=A2=E5=A4=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
【问题原因】
1. 将主题应用到模板上时,需要遍历模板对象查找颜色对象,以更新
其颜色。优化后的更新方案,使用了基于clone的值修改,即利用clone
方法遍历执行特征,在FineColor等类的clone方法内,修改返回值的颜
色值,使得Form.clone可以返回一个应用了主题色的新表单对象。
于是就需要使用新的表单对象更新模板,以及设计器界面。
2. 撤销回退时,因为撤销前后模板的主题可能会发生变化,所以需要应用
新主题到模板。所以撤销回退时,需要调用setTemplateTheme
3. BUG发生的直接原因是当主题应用到模板上时,仅仅更新了target,
没有更新报表块编辑界面内ElementCase对象,导致后续在报表块上的更新
保存在了一个无效的,与Target失去联系的ElementCase上了
4. 还有一个BUG: 报表块的撤销回退,没有更新Target,仅仅更新了
ElementCase,导致后续主题更新以及主题色更新时,新Target基于
旧Target产生,所以新Target中的ElementCase还是旧的ElementCase,
从而报表块内的撤销回退无效.
【改动思路】
1. 当编辑报表块时更新主题,需要更新报表块编辑界面内的ElementCase
2. 报表块撤销回退时,更新Target
---
.../java/com/fr/design/mainframe/JForm.java | 63 ++++++++++++-------
1 file changed, 42 insertions(+), 21 deletions(-)
diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java
index a142ee297c..e3162e9ef6 100644
--- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java
+++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java
@@ -704,8 +704,8 @@ public class JForm extends JTemplate