zoukankan      html  css  js  c++  java
  • 关于多项勾选 复选框

    <div class="col-xs-6">
    <div class="form-group">
    <label class="control-label col-sm-4" title="">
    <span class="required hide">*</span> ${text('用户管理区域')}:<i class="fa icon-question hide"></i></label>
    <div class="col-sm-8">
    <#form:treeselect id="employeeAreaList" title="${text('管理区域选择')}"
    value="${@ListUtils.extractToString(areaList!, 'areaCode', ',')}"
    labelValue="${@ListUtils.extractToString(areaList!, 'areaName', ',')}"
    url="${ctx}/sys/area/treeData" checkbox="true"
    class="" allowClear="true"/>
    <#form:hidden name="employeeAreaListJson"/>
    </div>
    </div>
    </div>

    Controller:

    // 查询用户所关联的权限管理地址信息
    if (StringUtils.isNotBlank(employee.getEmpCode())){
    Area area = new Area();
    area.setAreaCode(employee.getEmpCode());
    List<Area> areaList = areaService.findList(area);
    model.addAttribute("areaList", areaList);
    }

    Entity:

    private List<UserArea> employeeAreaList=ListUtils.newArrayList();  //用户包含的权限地区信息

    public List<UserArea> getEmployeeAreaList() {
    return employeeAreaList;
    }

    public void setEmployeeAreaListJson(String jsonString) {
    //获取用户对应的权限地址集合
    List<String> list = JsonMapper.fromJson(jsonString, List.class);
    if (list != null){
    //遍历该集合
    for (String val : list){
    if (StringUtils.isNotBlank(val)){
    UserArea e = new UserArea();
    e.setUserCode(this.getUserCode());
    e.setAreaCode(val);
    this.employeeAreaList.add(e);
            }
         }
      }
    }

  • 相关阅读:
    144环形链表
    83. 删除排序链表中的重复元素
    21合并两个有序链表
    PyCharm2020激活破解教程
    Python正课目录
    2条pip命令解决Python项目依赖的导出和导出
    pip离线安装模块
    Python正课149 —— luffy项目 User表的配置
    Python正课148 —— luffy项目 数据库配置
    解决:django中LookupError No installed app with label 'admin'
  • 原文地址:https://www.cnblogs.com/pureray-hui/p/12965347.html
Copyright © 2011-2022 走看看