| | |
| | | import com.vci.ubcs.codeapply.swing.RealTextField; |
| | | import com.vci.ubcs.codeapply.swing.VCIJComboxBox; |
| | | import com.vci.ubcs.codeapply.utils.ConfigUtils; |
| | | import com.vci.ubcs.codeapply.utils.HttpUtil; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import net.bytebuddy.implementation.bytecode.Throw; |
| | | import net.logstash.logback.encoder.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | |
| | | /**系统只加载代码项 如果libName不为空,直接获取对应的代码项**/ |
| | | Map<String,String> condtionMap=new HashMap<>(); |
| | | condtionMap.put("codeClassId", rmType.getOid()); |
| | | R r=HttpUtil.sendGet(url+"/getCodeRuleByClassifyFullInfo",condtionMap,new HashMap<>()); |
| | | R r= HttpUtil.sendGet(url+"/getCodeRuleByClassifyFullInfo",condtionMap,new HashMap<>()); |
| | | CodeRuleVO codeRuleVO=new CodeRuleVO(); |
| | | if(r.isSuccess()){ |
| | | Object object= r.getData(); |
| | |
| | | cbx.setModel(model); |
| | | compt = cbx; |
| | | } |
| | | } else if(StringUtils.isNotBlank(attrObj.getReferConfig())){//参照的需要设置成下拉框,并且只读 |
| | | VCIJComboBox cbx = new VCIJComboBox(); |
| | | DefaultComboBoxModel model = new DefaultComboBoxModel(); |
| | | KeyValue keyValue = new KeyValue(); |
| | | keyValue.setValue(""); |
| | | keyValue.setKey(""); |
| | | AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue); |
| | | model.addElement(wrapper); |
| | | cbx.setModel(model); |
| | | compt = cbx; |
| | | } else { // 不存在取值范围则按类型生成不同的控件 |
| | | if (attrObj.getAttributeDataType().equals(VciFieldTypeEnum.VTBoolean)) { // Boolean类型 |
| | | VCIJComboBox cbx = new VCIJComboBox(); |
| | |
| | | ownerDialog = new VCIJDialog(); |
| | | ownerDialog.setSize(880, 500); |
| | | }*/ |
| | | final String referTempId = tempPropObj.getReferBtmId(); |
| | | //final String referTempId = tempPropObj.getReferBtmId(); |
| | | final RMDataReferTempDialog dialog = new RMDataReferTempDialog(this,tempPropObj); |
| | | dialog.setDialogCallback(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | /*LinkedList<RMDataObject> list = dialog.getRMDataMainPanel().getTablePanel().getSelectedRowObjects(); |
| | | if(dialog.isFromTableDoubleClick()){ |
| | | KeyValue keyValue=new KeyValue(); |
| | | /*if(dialog.isFromTableDoubleClick()){ |
| | | int index = dialog.getRMDataMainPanel().getTablePanel().getTable().getSelectedRow(); |
| | | list.clear(); |
| | | list.add(dialog.getRMDataMainPanel().getTablePanel().getTableModel().getList().get(index).getObject()); |
| | | } |
| | | |
| | | RMDataObject rmDataObj = list.get(0);//选择的引用模板数据 |
| | | LinkedHashMap<String, Integer> innnerNamesMaps = rmDataObj.getInnerNameIndexMap(); |
| | | String[] datas = rmDataObj.getDatas(); |
| | | for(CodeClassifyTemplateAttrVO obj : tempPropList) { |
| | | if(obj.getReferTempId().equals(referTempId)) { |
| | | AttributeObject attrObj = getAttrObjById(obj.getReferAttrId()); |
| | | JComponent comp = attrIdToCtrlMaps.get(obj.getId()); |
| | | if(comp instanceof VCIJTextField) { |
| | | int index = innnerNamesMaps.get(attrObj.getInternalname()); |
| | | }*/ |
| | | keyValue= dialog.getKeyValue(); |
| | | //for(CodeClassifyTemplateAttrVO obj : tempPropList) { |
| | | if(attrIdToCtrlMaps.containsKey(tempPropObj.getId())) { |
| | | JComponent comp = attrIdToCtrlMaps.get(tempPropObj.getId()); |
| | | /*if(comp instanceof VCIJTextField) { |
| | | int index = innnerNamesMaps.get(tempPropObj.getInternalname()); |
| | | ((VCIJTextField) comp).setText(datas[index]); |
| | | }else if (comp instanceof VCIJCalendarPanel) { |
| | | int index = innnerNamesMaps.get(attrObj.getInternalname()); |
| | | int index = innnerNamesMaps.get(tempPropObj.getInternalname()); |
| | | ((VCIJCalendarPanel) comp).setDateString(datas[index]); |
| | | } else if (comp instanceof VCIJComboBox) { |
| | | int index = innnerNamesMaps.get(attrObj.getId()); |
| | | ((VCIJComboBox) comp).setSelectedIndex(index); |
| | | } else */ |
| | | if (comp instanceof VCIJComboBox) { |
| | | //DefaultComboBoxModel model = new DefaultComboBoxModel(); |
| | | if(keyValue!=null) { |
| | | AttrRangObjectWarper wrapper = new AttrRangObjectWarper(keyValue); |
| | | ((VCIJComboBox) comp).getModel().setSelectedItem(wrapper); |
| | | } |
| | | //model.addElement(wrapper); |
| | | //((VCIJComboBox) comp).setModel(model); |
| | | } |
| | | } |
| | | }*/ |
| | | //} |
| | | |
| | | } |
| | | }); |