{
    template:'${tmpl}',
    data:function(){
        return {
            digProducts:[],
            profProducts:[],
            queryProducts:[],
            commonProducts:[],
        }
    },
    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=>{
           if(p.funcCata=="common"){
             this.commonProducts.push(p);
           }
           if(p.funcCata=="query"){
             this.queryProducts.push(p);
           }
           if(p.funcCata=="prof"){
              this.profProducts.push(p);
           }
           if(p.funcCata=="clueDig"){
              this.digProducts.push(p);
           }
         });
      }
    },
    vname:"gsb-workbench"
}
