{
    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();
             }
           });
         }
         if(key=="datapriv"){
           console.log(row.nickName);
           this.$root.pushx({
             title:"数据授权",
             name:"/datapriv",
             params:{
               uid:row.id,
               nickname:row.nickName,
             }
           });
         }

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