diff --git a/README.md b/README.md index 6e155bd..7342b83 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ 使用方式: 1、插件安装后,打开设计器,菜单栏会多出一个【闪电】按钮 - 2、点击按钮,会打开一个页面,显示正在编辑的模板 - 3、模板中会显示当前编辑的是哪个报表块 + 2、点击按钮,会打开弹出框,显示正在编辑的模板 + 3、弹出框中会显示当前编辑的是哪个“报表块” 如果是多sheet,会显示是第几个sheet(从0开始); 如果是聚合报表,会显示报表块block的名称; 如果是决策报表,会显示报表块report的名称 diff --git a/build/install/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.zip b/build/install/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.zip index 9e61ae3..9a56582 100644 Binary files a/build/install/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.zip and b/build/install/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.zip differ diff --git a/build/libs/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar b/build/libs/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar index 6e35a56..e5ad3a0 100644 Binary files a/build/libs/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar and b/build/libs/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar differ diff --git a/build/temp/plugin/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar b/build/temp/plugin/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar index 6e35a56..e5ad3a0 100644 Binary files a/build/temp/plugin/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar and b/build/temp/plugin/fine-plugin-com.fr.plugin.cafe_expand-1.0.0.jar differ diff --git a/build/temp/plugin/plugin.xml b/build/temp/plugin/plugin.xml index 88b4ae6..b6c6327 100644 --- a/build/temp/plugin/plugin.xml +++ b/build/temp/plugin/plugin.xml @@ -12,6 +12,7 @@ + diff --git a/plugin.xml b/plugin.xml index 88b4ae6..b6c6327 100644 --- a/plugin.xml +++ b/plugin.xml @@ -12,6 +12,7 @@ + diff --git a/src/main/java/com/fr/plugin/cafe_expand/designerhelp/ExpandUniversalLocaleBridge.java b/src/main/java/com/fr/plugin/cafe_expand/designerhelp/ExpandUniversalLocaleBridge.java new file mode 100644 index 0000000..a668313 --- /dev/null +++ b/src/main/java/com/fr/plugin/cafe_expand/designerhelp/ExpandUniversalLocaleBridge.java @@ -0,0 +1,10 @@ +package com.fr.plugin.cafe_expand.designerhelp; + +import com.fr.stable.fun.impl.AbstractLocaleFinder; + +public class ExpandUniversalLocaleBridge extends AbstractLocaleFinder { + @Override + public String find() { + return "com/fr/plugin/cafe_expand/config/locale/expand"; + } +} diff --git a/src/main/java/com/fr/plugin/cafe_expand/designerhelp/JumpToAnalysis.java b/src/main/java/com/fr/plugin/cafe_expand/designerhelp/JumpToAnalysis.java index 18c4f6f..8d7b588 100644 --- a/src/main/java/com/fr/plugin/cafe_expand/designerhelp/JumpToAnalysis.java +++ b/src/main/java/com/fr/plugin/cafe_expand/designerhelp/JumpToAnalysis.java @@ -1,20 +1,23 @@ package com.fr.plugin.cafe_expand.designerhelp; +import com.fr.base.BaseUtils; import com.fr.design.fun.impl.AbstractDsinFrameUpButtonProvider; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.JForm; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JWorkBook; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.mainframe.*; import com.fr.design.utils.DesignUtils; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.IOUtils; import com.fr.locale.InterProviderFactory; +import com.fr.plugin.cafe_expand.function.DoExpandFile; import com.fr.plugin.cafe_expand.function.UnitTools; import com.fr.record.analyzer.EnableMetrics; import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.poly.PolyECBlock; import com.fr.third.springframework.util.FileCopyUtils; - +import com.fr.third.springframework.util.StringUtils; import javax.swing.*; import java.awt.event.ActionEvent; import java.io.File; @@ -23,7 +26,8 @@ import java.io.InputStreamReader; import java.util.ArrayList; /** - * 设计器工具栏添加按钮 跳转到检测模板 + * 设计器工具栏添加按钮 + * 弹出框配置扩展操作 * */ @EnableMetrics public class JumpToAnalysis extends AbstractDsinFrameUpButtonProvider { @@ -36,7 +40,7 @@ public class JumpToAnalysis extends AbstractDsinFrameUpButtonProvider { @Override public UIButton[] getUpButtons(int menuState) { UIButton btn = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_web/cache.png")); - btn.setToolTipText(InterProviderFactory.getProvider().getLocText("行列扩展分析")); + btn.setToolTipText(InterProviderFactory.getProvider().getLocText("cafe_expand_assist")); btn.addActionListener(new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { @@ -60,56 +64,120 @@ public class JumpToAnalysis extends AbstractDsinFrameUpButtonProvider { else if(template instanceof JForm) position="frm:"+template.getSelectElementCase().getWidgetName(); - visitTc(filePath,position); - } - }); - return new UIButton[]{ - btn - }; - } + //visitTc(filePath,position); - public static void visitTc(String path,String position) - { - copyRvealFile(); + JDialog fr = new JDialog(); + fr.setSize(400, 250); + GUICoreUtils.centerWindow(fr); + fr.setResizable(false); + fr.setTitle(InterProviderFactory.getProvider().getLocText("cafe_expand_assist")); + fr.setIconImage(BaseUtils.readImageWithCache("/com/fr/design/images/m_web/cache.png")); - String route="/view/report"; - ArrayList parameter = new ArrayList(); - ArrayList parameter_value = new ArrayList(); - parameter.add("viewlet"); - parameter_value.add("testcase/expand_analysis.cpt"); + String[] item = new String[]{InterProviderFactory.getProvider().getLocText("insert"), InterProviderFactory.getProvider().getLocText("delete")}; - parameter.add("filePath"); - parameter_value.add(path); + //路径 位置------------------------------------ + JPanel panel_path = new JPanel(); + panel_path.add(new UILabel(InterProviderFactory.getProvider().getLocText("local_path"))); + panel_path.add(new UILabel(filePath)); - parameter.add("position"); - parameter_value.add(position); + JPanel panel_position = new JPanel(); + panel_position.add(new UILabel(InterProviderFactory.getProvider().getLocText("report_position"))); + panel_position.add(new UILabel(position)); - parameter.add("op"); - parameter_value.add("write"); + //插入列------------------------------------ + JPanel panel_col = new JPanel(); - DesignUtils.visitEnvServerByParameters(route, (String[])parameter.toArray(new String[0]), (String[])parameter_value.toArray(new String[0])); - } + panel_col.add(new UILabel(InterProviderFactory.getProvider().getLocText("col_expand"))); + + String[] item_col = new String[]{"A列前", "A列后", "B列后", "C列后", "D列后", "E列后", "F列后", "G列后", "H列后", "I列后", "J列后", "K列后", "L列后", "M列后", "N列后", "O列后", "P列后", "Q列后", "R列后", "S列后", "T列后", "U列后", "V列后", "W列后", "X列后", "Y列后", "Z列后", "AA列后", "AB列后", "AC列后", "AD列后", "AE列后", "AF列后", "AG列后", "AH列后", "AI列后", "AJ列后", "AK列后", "AL列后", "AM列后", "AN列后", "AO列后", "AP列后", "AQ列后", "AR列后", "AS列后", "AT列后", "AU列后", "AV列后", "AW列后", "AX列后", "AY列后", "AZ列后"}; + UIComboBox col_position = new UIComboBox(item_col); + panel_col.add(col_position); + + UIComboBox col_type = new UIComboBox(item); + panel_col.add(col_type); + + UITextField col_num = new UITextField(5); + panel_col.add(col_num); + + panel_col.add(new UILabel("列")); + + //插入行------------------------------------------------------------ + JPanel panel_row = new JPanel(); + + panel_row.add(new UILabel(InterProviderFactory.getProvider().getLocText("row_expand"))); + + UITextField row_position = new UITextField(3); + panel_row.add(row_position); + + panel_row.add(new UILabel("行后")); + UIComboBox row_type = new UIComboBox(item); + panel_row.add(row_type); - /** - * 拷贝插件中的模板到报表目录下 - * */ - public static void copyRvealFile() - { - String path=JumpToAnalysis.class.getClass().getResource("/").getPath(); - path=path.substring(0, path.indexOf("WEB-INF") + 7) + "/reportlets/testcase/expand_analysis.cpt"; - - File f=new File(path); - if(!f.exists()) { - f.getParentFile().mkdir(); - String str = null; - try { - str = FileCopyUtils.copyToString(new InputStreamReader(JumpToAnalysis.class.getClassLoader().getResourceAsStream("expand_analysis.cpt"), "utf-8")); - - UnitTools.writeToMb(str, path); - } catch (IOException e) { - e.printStackTrace(); + UITextField row_num = new UITextField(5); + panel_row.add(row_num); + + panel_row.add(new UILabel("行")); + + //提交按钮------------------------------------------------------------ + JPanel panel_submit = new JPanel(); + UIButton button_row = new UIButton(InterProviderFactory.getProvider().getLocText("submit")); + panel_submit.add(button_row); + + + //结果展示---------------------------------------------------------- + JPanel panel_result=new JPanel(); + UILabel lable_result=new UILabel(); + panel_result.add(lable_result); + + + String finalPosition = position; + button_row.addActionListener(ee -> { + DoExpandFile d=new DoExpandFile(); + String arr[]=new String[4]; + arr[0]=filePath; + arr[1]= finalPosition; + + String row = row_position.getText()+":"+row_type.getSelectedIndex()+":"+row_num.getText(); + String col = col_position.getSelectedIndex()+":"+col_type.getSelectedIndex()+":"+col_num.getText(); + + if(StringUtils.isEmpty(col_num.getText())) + col=""; + if(StringUtils.isEmpty(row_num.getText())) + row=""; + + if(!StringUtils.isEmpty(row) || !StringUtils.isEmpty(col)) { + arr[2] = col; + arr[3] = row; + + String result = d.run(arr).toString(); + try { + DesignerFrameFileDealerPane.getInstance().getSelectedOperation().refresh(); + DesignerFrameFileDealerPane.getInstance().stateChange(); + lable_result.setText(InterProviderFactory.getProvider().getLocText("file_after_change") + result); + } catch (Exception e1) { + lable_result.setText(InterProviderFactory.getProvider().getLocText("error_info") + e1.getMessage()); + } + } + else + lable_result.setText(InterProviderFactory.getProvider().getLocText("attention_info")); + }); + + Box vBox = Box.createVerticalBox(); + vBox.add(panel_path); + vBox.add(panel_position); + vBox.add(panel_col); + vBox.add(panel_row); + vBox.add(panel_submit); + vBox.add(panel_result); + + fr.add(vBox); + fr.setModalityType(JDialog.ModalityType.APPLICATION_MODAL); // 设置模式类型。 + fr.setVisible(true); } - } + }); + return new UIButton[]{ + btn + }; } } \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/cafe_expand/function/UnitTools.java b/src/main/java/com/fr/plugin/cafe_expand/function/UnitTools.java index 171183d..b36f39c 100644 --- a/src/main/java/com/fr/plugin/cafe_expand/function/UnitTools.java +++ b/src/main/java/com/fr/plugin/cafe_expand/function/UnitTools.java @@ -11,7 +11,9 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.util.List; import java.util.Map; - +/** + * 工具 + * */ public class UnitTools { public static String colRow[] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", diff --git a/src/main/resources/1.png b/src/main/resources/1.png deleted file mode 100644 index a6e33eb..0000000 Binary files a/src/main/resources/1.png and /dev/null differ diff --git a/src/main/resources/2.png b/src/main/resources/2.png deleted file mode 100644 index 385a63d..0000000 Binary files a/src/main/resources/2.png and /dev/null differ diff --git a/src/main/resources/3.png b/src/main/resources/3.png deleted file mode 100644 index c28598f..0000000 Binary files a/src/main/resources/3.png and /dev/null differ diff --git a/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand.properties b/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand.properties new file mode 100644 index 0000000..4da45c2 --- /dev/null +++ b/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand.properties @@ -0,0 +1,11 @@ +cafe_expand_assist=cafe_expand_assist +insert=insert +delete=delete +local_path=local_path +report_position=report_position +submit=submit +file_after_change=file_afert_change +error_info=error_info +attention_info=attention:please fill in the expand value +col_expand=col expand at +row_expand=rol expand at \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand_zh_CN.properties b/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand_zh_CN.properties new file mode 100644 index 0000000..2900de7 --- /dev/null +++ b/src/main/resources/com/fr/plugin/cafe_expand/config/locale/expand_zh_CN.properties @@ -0,0 +1,11 @@ +cafe_expand_assist=\u8f85\u52a9\u884c\u5217\u6269\u5c55 +insert=\u63d2\u5165 +delete=\u5220\u9664 +local_path=\u5f53\u524d\u64cd\u4f5c\u6a21\u677f\u8def\u5f84\uff1a +report_position=\u62a5\u8868\u5757\u4f4d\u7f6e\uff1a +submit=\u786e\u5b9a +file_after_change=\u53d8\u66f4\u540e\u7684\u6a21\u677f\u4e3a\uff1a +error_info=\u9519\u8bef\uff1a +attention_info=\u63d0\u793a\uff1a\u8bf7\u586b\u5199\u9700\u8981\u6269\u5c55\u884c\u5217\u7684\u503c +col_expand=\u6269\u5c55\u5217\uff1a\u5728 +row_expand=\u6269\u5c55\u884c\uff1a\u5728\u7b2c \ No newline at end of file diff --git a/src/main/resources/expand_analysis.cpt b/src/main/resources/expand_analysis.cpt deleted file mode 100644 index 2885c54..0000000 --- a/src/main/resources/expand_analysis.cpt +++ /dev/null @@ -1,817 +0,0 @@ - - - - - - - - - - - - -tpS9pn7o^TY^)/i@AT:>AS^:uR##?@Y=.b -@Ntf=#GBERh.SW^WgcX3R`b60I=-$aT#[1gQ6HCU38\S9.EL\g&$IPH,aL5Nn4LogC]A$PGTA -bH6Kn,a[pF3XS?F2'Yq(U!K@NqE%Da_Z).NB9EC9d![R(=Qu#[YA@W)4jXsGs]A23e@@cb-.Q -KKl(T"Aremc*?=$^g*0@\12nH1#/(\I2Te?.=2g_U`e;gjT8~ -]]> - - - - - - - - - - -^V]A?.Oc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 && len(F9) <> 0, CONCATENATE(C9, ":", D9, ":", F9), "")]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 && len(F12) <> 0, CONCATENATE(C12, ":", E12, ":", F12), "")]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
-
- - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -