From 3415d4587c08954eb85e5861f2db04030592fd9e Mon Sep 17 00:00:00 2001 From: xiongcz Date: Fri, 25 Apr 2025 17:47:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(autocode):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=B1=BB=E5=9E=8B=E5=B1=9E=E6=80=A7=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 docTypeValue 变量用于存储文档类型值 - 修改文档类型属性设置逻辑,使用 docTypeValue 替代 leftMostCodeRuleNameString - 优化文档创建后数据集模板带出逻辑 --- .../generatcode/NewCodeItemDialog.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java index 03c4498..27800a6 100644 --- a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java +++ b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java @@ -135,6 +135,7 @@ public class NewCodeItemDialog extends Dialog { //ǷΪĵ private boolean isDoc = false; private String leftMostCodeRuleNameString = ""; + private String docTypeValue = ""; // ӢĶ private SashForm sashFormCodeView; private CTabItem codeTreeCTab; @@ -660,8 +661,8 @@ public class NewCodeItemDialog extends Dialog { //20250425 ѡеıд뵽Ҳĵ String currentPropName = cnProp.getDisplayName();//ǰĶor System.out.println("ǰUILabel="+currentPropName); - if(currentPropName != null && currentPropName.equals("ĵ") && leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.equals("")){ - System.out.println("ĵƥɹֵΪѡб="+leftMostCodeRuleNameString); + if(currentPropName != null && currentPropName.equals("ĵ") && docTypeValue != null && !docTypeValue.equals("")){ + System.out.println("ĵƥɹֵΪѡб="+docTypeValue); isDocType = true; } @@ -674,7 +675,7 @@ public class NewCodeItemDialog extends Dialog { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); // text.setText(cnProp.getDefaultValue()); if (isDocType){ - text.setText(leftMostCodeRuleNameString); + text.setText(docTypeValue); }else { text.setText(cnProp.getDefaultValue()); } @@ -683,7 +684,7 @@ public class NewCodeItemDialog extends Dialog { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); // text.setText("0"); if (isDocType){ - text.setText(leftMostCodeRuleNameString); + text.setText(docTypeValue); }else { text.setText("0"); } @@ -699,7 +700,7 @@ public class NewCodeItemDialog extends Dialog { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); // text.setText("0"); if (isDocType){ - text.setText(leftMostCodeRuleNameString); + text.setText(docTypeValue); }else { text.setText("0"); } @@ -722,7 +723,7 @@ public class NewCodeItemDialog extends Dialog { new String[] { "true", "false" }); // new // comb.setText(cnProp.getDefaultValue()); // Combo(propTable, if (isDocType){ - comb.setText(leftMostCodeRuleNameString); + comb.setText(docTypeValue); }else { comb.setText(cnProp.getDefaultValue()); } @@ -1692,9 +1693,7 @@ public class NewCodeItemDialog extends Dialog { System.out.println("ڶ: " + secondPart); if (firstPart.equals(leftMostCodeRuleNameString)) { //secondPartҲеԡĵ - - - + docTypeValue = secondPart; break; }else { continue; @@ -1703,12 +1702,6 @@ public class NewCodeItemDialog extends Dialog { } else { System.out.println("ַδҵ = š"); } - - - - - - } } } @@ -3227,8 +3220,15 @@ public class NewCodeItemDialog extends Dialog { // } //20250425 ĵ󣬸 ID= ݼģ - if (newComp != null){ + if (newComp != null && isDoc){ + if (leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.isEmpty()){ + //1.òѯȡ汾ݼ + + + //2.ݼϴ½汾 + + } } if (targetObject != null) {