/** * 跳转至数据字典文本页面 * @param request 请求对象 * @param response 响应对象 * @param modelMap 页面参数集合 * @return 操作结果类型JSON * @author yzp * @history 2018-5-2 下午10:12:27 Create by 【yzp】 */ @RequestMapping("toDictspan.do") public ModelAndView toDictspan(HttpServletRequest request,HttpServletResponse response, ModelMap modelMap) { FormSource source = this.source(request); try { //获取部门,使用 ├ 符合显示层级关系 TagService service = this.createService(); source.add("SF_USERS_DEP_ID", service.beans_comb( new SF_DEPARTMENT() ) ); source.put(modelMap); } catch (Exception e) { logger.error(e); } return new ModelAndView( this.getActionPath("dictspan"), modelMap ); }
public List<?> beans_comb(SF_DEPARTMENT sDepartment)throws Exception { List<?> result = null; List<SF_DEPARTMENT> department = this.beans(sDepartment) ; result = Persistence.beans(SF_DEPARTMENT_COMB.class, department); return result; }
<tr> <td>示例一:使用表单数据源标签绑定数据</td> <td colspan="2"> <div id="SF_USERS_DEP_ID" sf_type="SF_DictSpan" modul="0" modulField="PARENT_ID" textField="DNAME" valueField="ID" init="10000"></div> </td> </tr> <tr> <td>示例二: 不使用表单数据源标签绑定数据</td> <td colspan="2"> <div id="testSpan" sf_type="SF_DictSpan" modul="a" modulField="modul" data="[{key:'key2',value:'2',modul:'a'},{key:'key3',value:'3',modul:'b'},{key:'key4',value:'4',modul:'b'},{key:'key1',value:'1',modul:'a'},]" textField="key" valueField="value" init="1"> </div> </td> </tr>
$("#testSpan").SF_DictSpan().create(); <td>示例二: 不使用表单数据源标签绑定数据</td> <td colspan="2"> <div id="testSpan" sf_type="SF_DictSpan" modul="a" modulField="modul" data="[{key:'key2',value:'2',modul:'a'},{key:'key3',value:'3',modul:'b'},{key:'key4',value:'4',modul:'b'},{key:'key1',value:'1',modul:'a'},]" textField="key" valueField="value" init="1"> </div> <input type="hidden" name="DN_ID" id="DICTIONARYENTRY_ID" /> var option = { "modulUrl" : "system/dict", "modulName" : "数据字典内容项", "bean" : "DICTIONARYITEM", "modulTag" : "DICTIONARYENTRY_ID" };