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

  • 相关阅读:
    js伪数组转数组内部实现
    Vuex核心部分学习参考地址
    vue中让异步代码变成同步的写法
    node.js中文件操作路径和模板标识路径问题
    如果不想安装cnpm又想使用淘宝的服务器来下载,怎么做?
    npm常用命令
    node中模块加载机制
    通过nodejs,简单模拟客户端和服务端进行通信
    vue中非父子组件的传值
    图论1-2
  • 原文地址:https://www.cnblogs.com/pureray-hui/p/12965347.html
Copyright © 2011-2022 走看看