{
    template:'${tmpl}',
    data:function(){
        return {
          value3: [],
          ts:["待选择","已授权"],
          refmodel:"",
          uid:"",
          nickname:"",
        };
    },
    mounted:function(){
      this.uid=this.$router.history.current.query.uid;
      this.nickname=this.$router.history.current.query.nickname;
    },
    created:function(){
    },
    methods:{
      backgo(){
        this.$router.go(-1);
      },
      onsel(c){
       this.refmodel=c;
       /*按照refmodel加载，当前user,去加载数据权限列表值*/
       this.fetchInitAuth();
      },
      fetchInitAuth(){
        var self=this;
        self.value3.length=0;
          this.$root.postReq("/web/auth/dataauthCtl/fetchInitAuth",{uid:this.uid,modelname:this.refmodel}).then(d=>{
            if(d.status==0){
              d.data.forEach(r=>{
                self.value3.push(Number(r));
              });
            }
          });
      },
      onchange(vals) {
        console.log(this.value3);
      },
      authsave(){
        if(this.value3.length!=0){
            this.$root.postReq("/web/auth/dataauthCtl/saveauth",{uid:this.uid,modelname:this.refmodel,arys:this.value3}).then(d=>{
               if(d.status==0){
                   this.$message("授权成功.");
               }
            });
        }
      },
    },
    vname:"gsb_datapriv"
}
