{
    template:'${tmpl}',
    data:function(){
        return {
            patProducts:[],
        }
    },
    mounted:function(){
      this.fetchData();
      /*this.$refs.refcard.changeButtonState();*/

    },
    created:function(){

    },
    methods:{
      useTool:function(code,id){
          var that=this;
          this.$root.postReq("/web/productCtl/addVisitCount",{"productId":id}).then(function(d){
            console.log(d);
            if(d!=null){
              for(var i=0;i<that.$store.state.products.length;i++){
                if(id==that.$store.state.products[i].id){
                  that.$store.state.products[i].useSta=d;
                }
              }
            }
          });
          this.$root.hideHeader();
          $(window).trigger("resize");
          if(code=="profitcenter"){
            this.$router.push("/products/profitcenter"+"/"+id);
            return;
          }
          this.$router.push("/products/"+code+"/"+id);
      },
      urlImg:function(img){
        return "url("+img+")";
      },
      fetchData:function(){
         console.log("product..................................");
         this.$store.state.products.forEach(p=>{
           console.log(p.funcCata);
           if(p.funcCata=="pat"){
              this.patProducts.push(p);
           }
           if(p.code=="invoice" || p.code=="profitcenter"){
              this.patProducts.push(p);
           }
         });
      }
    },
    vname:"gsb-patentworkbench"
}
