{
    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:{
      onsel(c){
       this.refmodel=c;
       /*按照refmodel加载，当前user,去加载数据权限列表值*/
       this.fetchInitAuth();
      },
      fetchInitAuth(){
        var self=this;
          this.$root.postReq("/web/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/dataauthCtl/saveauth",{uid:this.uid,modelname:this.refmodel,arys:this.value3}).then(d=>{
               if(d.status==0){
                  
               }
            });
        }
      },
    },
    vname:"gsb_datapriv"
}
