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

    },
    created:function(){
    },
    methods:{
       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=this.getUrl("update");
           row.isEnabled=!row.isEnabled;
           this.$root.postReq(url,row).then(rd=>{
             console.log("................////////////////////////////");
             if(rd.status==0){
               this.$refs.userGrid.fetchData();
             }
           });
         }

         console.log($(e.target).text());
       }
    },
    computed: Vuex.mapState({
      count:state=>state.count,
      headStyle:function(){
        return {"background-color":"white"};
      }
    }),
    vname:"gsb-users"
}
