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

    },
    created:function(){
    },
    methods:{
      beforeedit(row){
        console.log("beforeedit ====================row");
        console.log(row);
        var weblinks= row.weblinks;
        if(weblinks && weblinks.length>0){
          var links = [];
          for(var i=0;i<weblinks.length;i++){
            var link = weblinks[i];
            if(link.id){
              links.push(link.id);
            }
          }
          if(links && links.length>0){
            var obj = JSON.parse( JSON.stringify(row) );
            obj["weblinks"] = links;
            this.$refs.cgrid.$refs.dlgform.setInitData(obj);
          }
        }
      },
       onColFormater(row,column,cellvalue,index){
        if(column.property=="isEnabled"){
          if(row["isEnabled"]){
            return "正常";
          }else{
            return "停用";
          }
        }
         return cellvalue;
       },
       onRowClick(row,key,e){
        if(key=="stopSite"){
          this.modelName="company";
          var url=this.getUrl("initdata");
          row.isEnabled=!row.isEnabled;
          this.$root.postReq(url,row).then(rd=>{
            console.log("................////////////////////////////");
            if(rd.status==0){
              this.$refs.cgrid.fetchData();
            }
          });
        }
       }
    },
    computed: Vuex.mapState({
      headStyle:function(){
        return {"background-color":"white"};
      }
    }),
    vname:"gsb_company"
}
