12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package com.sinosoft.lz.system.buildConstant.impl;
- import java.util.List;
- import net.sf.json.JSONObject;
- import com.sysmodel.datamodel.xmlmodel.ModelFactory;
- import com.sysmodel.datamodel.xmlmodel.able.MdpConstant;
- import com.sysmodel.datamodel.xmlmodel.able.SysModel;
- import com.sysmodel.datamodel.xmlmodel.able.Template;
- import com.sysmodel.datamodel.xmlmodel.impl.PropertyImpl;
- import com.sinosoft.lz.system.buildConstant.Common;
- import com.sinosoft.lz.system.buildConstant.GetPanelAble;
- import com.sinosoft.lz.system.buildConstant.GridPanel;
- import com.sinosoft.lz.system.buildConstant.vo.TreePanelVo;
- public class TreePanel implements GetPanelAble{
- public String getResultPanel(String templateName, String tableName) {
- SysModel sysmodel = ModelFactory.getSysmodel();
- Template template = sysmodel.getTemplateByName(templateName);
- List<PropertyImpl> listProperty = template.getListproperty();
- MdpConstant mdpConst = sysmodel.getMdpConstantByName(tableName);
- Common common = new Common();
- TreePanelVo treeVo = new TreePanelVo();
- GridPanel grid = new GridPanel();
- String formItems = common.getField(listProperty);
- formItems = formItems + ",{xtype : 'hidden',id : 'type',name : 'type',value : ''}";
- String gridHeader = grid.getTreeGridPanel(listProperty, tableName);
- String gridReader = grid.getGridReader(listProperty);
- treeVo.setIsTree("true");
- treeVo.setRootFrom(mdpConst.getRootFrom());
- treeVo.setFormItems(formItems);
- treeVo.setGridHeader(gridHeader);
- treeVo.setGridReader(gridReader);
- return JSONObject.fromObject(treeVo).toString();
- }
- }
|