{
    template:'${tmpl}',
    data:function(){
        return {
          multipleSelection: [],
          isSingleSelect:false,
          bizCode:'',
        }
    },
    mounted:function(){

    },
    created:function(){
      if(this.codePath.indexOf("appuser")>=0){
        this.bizCode="appuser";
      }else{
        this.bizCode="allusers";
      }
    },
    methods:{
      validateformmethod(rule,value,cbk){
        if(rule.field=="mobile"){
          if(/^1[23456789]\d{9}$/.test(value) == false){
              return cbk("请检查号码格式!");
          }
        }
        return cbk();
      },
       onColFormater(row,column,cellvalue,index){
         if(column.property=="isEnabled"){
           if(row["isEnabled"]){
             return "正常";
           }else{
             return "停用";
           }
         }
         if(column.property=="Roles"){
           var tmp=[];
           var ids=[];
           row["Roles"].forEach(s=>{
             tmp.push(s.name);
             ids.push(s.id);
           });
           row.roles=ids;
           return tmp.join(",");
         }
         return cellvalue;
       },
       handleSelectionChange:function(val){
         this.multipleSelection = val;
         console.log(val);
       },
       fetchData:function(){

       },
       onRowClick(row,key,e){
         console.log("................////////////////////////////");
         if(key=="stopUser"){
           this.modelName="user";
           var url="/web/auth/userCtl/update";
           row.isEnabled=!row.isEnabled;
           this.$root.postReq(url,row).then(rd=>{
             console.log("................////////////////////////////");
             if(rd.status==0){
               this.$refs.userGrid.fetchData();
             }
           });
         }
         if(key=="datapriv"){
           this.$router.push({path:"/datapriv",query:{
            uid:row.id,
            nickname:row.nickName,
          }});
         }
       }
    },
    computed: Vuex.mapState({
      headStyle:function(){
        return {"background-color":"white"};
      }
    }),
    vname:"gsb-users"
}
