账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue element UI中的el-tree组件中,加载时默认选中一些子元素,整个组就会默认选中?
    25
    0

    只要一组中有一个元素被选中,整个组都会被选中,这个怎么解决?

    
    getAttendPerson(item,isGroup){
          var _this = this;
          if(isGroup == 0){//来自部门的
            _this.attendPerson.forEach((item1,index) => {
              if(item.id == item1.extend1 && item1.extend2 == 0){
                _this.officeDfaultChecked.push(item1.userId);
    
              }
            });
    //        console.log(_this.officeDfaultChecked);
    
            _this.officeData.push({
              office:item,
              defaultChecked:_this.officeDfaultChecked,
              defaultExpanded:[item.id]
            });
    //        console.log(_this.officeDfaultChecked);
    
    
    
          }else if(isGroup == 1){//来自小组的数据
            _this.attendPerson.forEach((item1,index) => {
              if(item.groupId == item1.extend1 && item1.extend2 == 1){
                _this.teamDfaultChecked.push(item1.userId);
              }
            });
            _this.teamData.push({
              team:item,
              defaultChecked:_this.teamDfaultChecked,
              defaultExpanded:[item.groupId]
            });
    
          }
        }
      },
        mounted(){
        },
        created() {
            var _this = this;
            //设置当前活动步骤
            this.active = this.edittabActiveElstep;
    
            _this.questionData.list=_this.editQuestionList;
    
            //编辑时,获取参会的处室和人员
            if(_this.isEditOrAdd == "edit"){
                axios.post("/yangfan-server/yfDesignatedAttendEmployees/getYfDesignatedAttendEmployeesAll",qs.stringify({
    
                        trainId:_this.editInfo.id
                    })).then((response)=>{
                    debugger;
                    _this.attendPerson = response.data;
    
                })
            }
            //获取处室(按处室选择参会人员)
            axios.post("/yangfan-server/yfOffice/getAllOffices").then((response)=>{
                var tempTeamData = response.data;
                tempTeamData.forEach((item,index) => {
                    if(_this.isEditOrAdd == "edit"){
                        var isGroup = 0;
                        _this.getAttendPerson(item,isGroup);
                    }else{
    
                        _this.officeData.push({
                            office:item,
                            defaultChecked:[],
                            defaultExpanded:[]
                        });
                    }
    
                });
            })
            //获取分组(按分组选择参会人员)
            axios.post("/yangfan-server/yfTeam/getYfTeamAll").then((response)=>{
                debugger;
                var tempOfficeData = response.data;
                tempOfficeData.forEach((item,index) => {
                    if(_this.isEditOrAdd == "edit"){
                        var isGroup = 1;
                        _this.getAttendPerson(item,isGroup);
                    }else{
    
                        _this.teamData.push({
                            team:item,
                            defaultChecked:[],
                            defaultExpanded:[]
    
                        });
                    }
    
                });
            })
        }
    }
    
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 困城寄她 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部