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);
            }
         }
      }
    }

  • 相关阅读:
    ip报文
    常见端口
    navicat15 破解版
    谷歌跨域设置
    CSS flex弹性布局来做 页面底部自适应:页面高度不足时,在底部显示;页面高度超出时,随页面滚动(亲测有效)
    phpstorm 2019 激活码
    aes cbc模式
    Vue的安装及使用快速入门
    从SVN服务器端彻底删除错误提交版本
    Nginx配置https和wss
  • 原文地址:https://www.cnblogs.com/pureray-hui/p/12965347.html
Copyright © 2011-2022 走看看