From 9d4d8e8097510ef69232081c2d44bc7c7d537e40 Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Sun, 5 Dec 2021 23:38:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55240:=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=85=B3=E4=BA=8E=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=BC=95=E6=93=8E=E7=9A=84=E8=AE=BE=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ReportEnginePane.java | 96 +++++++++++-------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index 6d1f2ef0a..220b64a49 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -53,11 +53,15 @@ public class ReportEnginePane extends BasicBeanPane { private JPanel outLineEngineSettingPane; private JLayeredPane engineSettingPane; private UICheckBox clientPaging; - private UICheckBox pageQueryBox; + private UICheckBox lineEnginePageQueryBox; + private UICheckBox engineXPageQueryBox; + private UICheckBox rowCountBox; private JPanel outPagingEngineSelectPane; private JPanel outEngineXSettingPane; - private JPanel pageQueryPane; - private IntegerEditor countPerPageEditor; + private JPanel lineEnginePageQueryPane; + private JPanel engineXPageQueryPane; + private IntegerEditor lineEngineCountPerPageEditor; + private IntegerEditor engineXCountPerPageEditor; private WorkSheet worksheet; private List radioButtons = new ArrayList<>(2); @@ -115,39 +119,53 @@ public class ReportEnginePane extends BasicBeanPane { return pagingEngineSelectPane; } - - /** * 目前先屏蔽,后面新引擎显示页码再加上相关代码 * */ private void createEngineXSettingPane(){ outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); outEngineXSettingPane.setBounds(0, 0, 570, 240); + JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); + JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + engineXPageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); + engineXPageQueryBox.setSelected(false); + pageQueryBoxPanel.add(engineXPageQueryBox); + engineXSettingPane.add(pageQueryBoxPanel); + engineXCountPerPageEditor = new IntegerEditor(new Integer(30)); + engineXCountPerPageEditor.setPreferredSize(new Dimension(120, 20)); + engineXPageQueryPane = createPageQueryPane(engineXCountPerPageEditor); + engineXPageQueryPane.setVisible(false); + engineXSettingPane.add(engineXPageQueryPane); + engineXPageQueryBox.addActionListener(new SelectActionListener(engineXPageQueryBox, engineXPageQueryPane)); + JPanel rowCountPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + //todo 改一下国际化文件 + rowCountBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_Count")); + rowCountBox.setSelected(false); + rowCountPanel.add(rowCountBox); + engineXSettingPane.add(rowCountPanel); + outEngineXSettingPane.add(engineXSettingPane); } private void createLineEngineSettingPane(){ outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); outLineEngineSettingPane.setBounds(0, 0, 570, 240); - JPanel lineEngineSettingPane = createCommonEngineSettingPane(); + JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); + JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + lineEnginePageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); + lineEnginePageQueryBox.setSelected(false); + pageQueryBoxPanel.add(lineEnginePageQueryBox); + lineEngineSettingPane.add(pageQueryBoxPanel); + lineEngineCountPerPageEditor = new IntegerEditor(new Integer(30)); + lineEngineCountPerPageEditor.setPreferredSize(new Dimension(120, 20)); + lineEnginePageQueryPane = createPageQueryPane(lineEngineCountPerPageEditor); + lineEnginePageQueryPane.setVisible(false); + lineEngineSettingPane.add(lineEnginePageQueryPane); + lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane)); JPanel tipPane = createTipPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); lineEngineSettingPane.add(tipPane); outLineEngineSettingPane.add(lineEngineSettingPane); } - private JPanel createCommonEngineSettingPane(){ - JPanel commonEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); - JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - pageQueryBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); - pageQueryBox.setSelected(false); - pageQueryBoxPanel.add(pageQueryBox); - commonEngineSettingPane.add(pageQueryBoxPanel); - pageQueryPane = createPageQueryPane(); - pageQueryPane.setVisible(false); - commonEngineSettingPane.add(pageQueryPane); - pageQueryBox.addActionListener(new SelectActionListener(pageQueryBox, pageQueryPane)); - return commonEngineSettingPane; - } - private JPanel createTipPane(String tipText){ JPanel tipPane = new JPanel(); UILabel tip = new UILabel(tipText, SwingConstants.LEFT); @@ -156,12 +174,10 @@ public class ReportEnginePane extends BasicBeanPane { return tipPane; } - private JPanel createPageQueryPane() { + private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) { double p = TableLayout.PREFERRED; double rowSize[] = {p, p}; double columnSize[] = {p, p}; - countPerPageEditor = new IntegerEditor(new Integer(30)); - countPerPageEditor.setPreferredSize(new Dimension(120, 20)); Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage") + ":"), countPerPageEditor}}; JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); @@ -232,9 +248,7 @@ public class ReportEnginePane extends BasicBeanPane { return; } clientPaging.setSelected(ob.isClientPaging()); - if (clientPaging.isSelected()){ - outPagingEngineSelectPane.setVisible(true); - } + outPagingEngineSelectPane.setVisible(clientPaging.isSelected()); engineSettingPane.setVisible(true); radioButtons.get(0).setSelected(ob.getEngineState() == LayerReportAttr.ENGINE_X); radioButtons.get(1).setSelected(ob.getEngineState() == LayerReportAttr.LINE_ENGINE); @@ -242,33 +256,39 @@ public class ReportEnginePane extends BasicBeanPane { engineSettingPane.moveToFront(outEngineXSettingPane); outEngineXSettingPane.setVisible(true); outLineEngineSettingPane.setVisible(false); + engineXCountPerPageEditor.setValue(new Integer(ob.getCountPerPage())); + engineXPageQueryBox.setSelected(ob.isPageQuery()); + engineXPageQueryPane.setVisible(ob.isPageQuery()); }else { engineSettingPane.moveToFront(outLineEngineSettingPane); outEngineXSettingPane.setVisible(false); outLineEngineSettingPane.setVisible(true); + lineEngineCountPerPageEditor.setValue(new Integer(ob.getCountPerPage())); + lineEnginePageQueryBox.setSelected(ob.isPageQuery()); + lineEnginePageQueryPane.setVisible(ob.isPageQuery()); } - countPerPageEditor.setValue(new Integer(ob.getCountPerPage())); - if (ob.isPageQuery()) { - pageQueryBox.setSelected(true); - pageQueryPane.setVisible(true); - } else { - pageQueryBox.setSelected(false); - pageQueryPane.setVisible(false); - } + rowCountBox.setSelected(ob.isEnableRowCount()); } @Override public LayerReportAttr updateBean() { //这里注意一下怎么更新的,后续可能存在判断为空的调用,从而对老引擎造成影响。 LayerReportAttr attr = new LayerReportAttr(); - attr.setPageQuery(pageQueryBox.isSelected()); - attr.setCountPerPage(Math.min(500, (countPerPageEditor.getValue()).intValue())); attr.setClientPaging(clientPaging.isSelected()); for (int i = 0; i < radioButtons.size(); i++){ if (radioButtons.get(i).isSelected()){ attr.setEngineState(i); } } + if (attr.getEngineState() == LayerReportAttr.ENGINE_X){ + attr.setEnableRowCount(rowCountBox.isSelected()); + attr.setCountPerPage(engineXCountPerPageEditor.getValue().intValue()); + attr.setPageQuery(engineXPageQueryBox.isSelected()); + }else { + attr.setPageQuery(lineEnginePageQueryBox.isSelected()); + attr.setCountPerPage(lineEngineCountPerPageEditor.getValue()); + } + attr.setEnableRowCount(rowCountBox.isSelected()); return attr; } @@ -286,8 +306,8 @@ public class ReportEnginePane extends BasicBeanPane { } public void setDefaultAttr(){ clientPaging.setSelected(false); - countPerPageEditor.setValue(30); - pageQueryBox.setSelected(false); + lineEngineCountPerPageEditor.setValue(30); + lineEnginePageQueryBox.setSelected(false); radioButtons.get(0).setSelected(false); radioButtons.get(1).setSelected(false); }