15c956f323fe362f3838f5e7258241933a185e02.svn-base 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.sinosoft.lz.system.buildConstant.impl;
  2. import java.util.List;
  3. import net.sf.json.JSONObject;
  4. import com.sysmodel.datamodel.xmlmodel.ModelFactory;
  5. import com.sysmodel.datamodel.xmlmodel.able.MdpConstant;
  6. import com.sysmodel.datamodel.xmlmodel.able.SysModel;
  7. import com.sysmodel.datamodel.xmlmodel.able.Template;
  8. import com.sysmodel.datamodel.xmlmodel.impl.PropertyImpl;
  9. import com.sinosoft.lz.system.buildConstant.Common;
  10. import com.sinosoft.lz.system.buildConstant.GetPanelAble;
  11. import com.sinosoft.lz.system.buildConstant.GridPanel;
  12. import com.sinosoft.lz.system.buildConstant.vo.TreePanelVo;
  13. public class TreePanel implements GetPanelAble{
  14. public String getResultPanel(String templateName, String tableName) {
  15. SysModel sysmodel = ModelFactory.getSysmodel();
  16. Template template = sysmodel.getTemplateByName(templateName);
  17. List<PropertyImpl> listProperty = template.getListproperty();
  18. MdpConstant mdpConst = sysmodel.getMdpConstantByName(tableName);
  19. Common common = new Common();
  20. TreePanelVo treeVo = new TreePanelVo();
  21. GridPanel grid = new GridPanel();
  22. String formItems = common.getField(listProperty);
  23. formItems = formItems + ",{xtype : 'hidden',id : 'type',name : 'type',value : ''}";
  24. String gridHeader = grid.getTreeGridPanel(listProperty, tableName);
  25. String gridReader = grid.getGridReader(listProperty);
  26. treeVo.setIsTree("true");
  27. treeVo.setRootFrom(mdpConst.getRootFrom());
  28. treeVo.setFormItems(formItems);
  29. treeVo.setGridHeader(gridHeader);
  30. treeVo.setGridReader(gridReader);
  31. return JSONObject.fromObject(treeVo).toString();
  32. }
  33. }