{
    template:'${tmpl}',
    data:function(){
        return {
            obj:{},
            tableFrom:[
                '序号','企业名称','专利总量','专利关键词','行业','竞争指数','操作'
            ],
            entName: '',
            year: ''
        }
    },
    mounted:function(){

    },
    created:function(){
        this.entName=this.$router.history.current.query.entName || "";
        this.year=this.$router.history.current.query.year || "";
        console.log(this.entName, this.year);
        if (this.entName) {
            this.analysisInfo();
        }
    },
    methods:{
        contrast(val) {
            this.$root.pushx({
                name:"/enterprisecontrast",
                params:{
                    name1: val.companyname,
                    text1: val.keyword,
                    name2: this.entName,
                    text2: this.obj.keyword
                }
            });
        },
        fanhui() {
            this.$root.pushx({
                name:"/businessdecisions",
                params:{}
            });
        },
        keyDealwith(value) {
            let array = value.split(',')[0].split('、');
            let arr1 = [];
            for (let i = 0; i < array.length; i++) {
                if ( i > 1 && i <= 5) {
                    arr1.push(array[i])
                }
            };
            return arr1.join(',')
        },
        keyDealwith2(value) {
            let array = value.split(',');
            let arr1 = [];
            for (let i = 0; i < array.length; i++) {
                if ( i <= 4) {
                    arr1.push(array[i])
                }
            };
            return arr1.join(',')
        },
        analysisInfo(){
            var obj={companyname:""};
            if(this.entName ){
                obj.companyname=this.entName;
            }else{
                return ;
            }
            this.$root.showMask();
            this.$root.getReq("web/patentycCtl/competitionAnalysisInfo",obj).then(d=>{
                console.log(d);
                if(d && d.status==0){
                    for (let i = 0; i < d.data.competeinfo.length; i++) {
                        d.data.competeinfo[i]['keys'] = this.keyDealwith2(d.data.competeinfo[i].keyword)
                    }
                    this.obj = d.data;
                    this.obj['keys'] = this.keyDealwith(d.data.businessscope)
                }
                this.$root.hideMask();
            }).catch(e=>{
                this.$root.hideMask();
            })
        },
    },
    computed:{
 
    },
    vname:"gsb-competitiveanalysis"
}
