{
    template:'${tmpl}',
    data:function(){
      return {
        checkAll:true,
        isIndeterminate:false,
        cities1:["中国大陆","香港","澳门","台湾"],
        cities2:["EPO","WIPO","美国","日本","韩国","英国","法国","德国","俄罗斯","瑞士"],
        cities3:["奥地利","澳大利亚","西班牙","意大利","加拿大","瑞典"],
        isIndeterminate1: false,
        checkAll1:true,
        isIndeterminate2: false,
        checkAll2:true,
        isIndeterminate3: false,
        checkAll3:true,
        checked:["中国大陆","香港","澳门","台湾"],
        checkedmain:["EPO","WIPO","美国","日本","韩国","英国","法国","德国","俄罗斯","瑞士"],
        checkedother:["奥地利","澳大利亚","西班牙","意大利","加拿大","瑞典"],
        form:{
          patentname:"",
          abstract:"",
          applydate1:"",
          applydate2:"",
          publishdate1:"",
          publishdate2:"",
          grantdate1:"",
          grantdate2:"",
          applynum:"",
          publishnum:"",
          priornum:"",
          ipc:"",
          applier:"",
          inventor:""
        },
        searwords:"",
        total:20,
        currentpage:1,
        pagesize:20,
        datalist:[],
        a:false,

        isIndeterminateAnalysis: false,
        checkAllAnalysis:false,
        multipleSelection:[],
        checkListAnalysis:[],

      };
    },

    methods:{
      delectsearchwords(){
        this.searwords="";
      },
      clicksearch(){
        this.currentpage=1;
        this.total=0;
        /*清楚勾选的痕迹*/
        this.checkAllAnalysis=false;
        this.checkListAnalysis=[];
        this.multipleSelection=[];
        this.search();
      },
      search(){
        if((this.form.applydate1&&!this.form.applydate2)||(!this.form.applydate1&&this.form.applydate2)){
            this.$message.warning("请选择完整的申请日期");
            return false;
        }
        if((this.form.publishdate1&&!this.form.publishdate2)||(!this.form.publishdate1&&this.form.publishdate2)){
          this.$message.warning("请选择完整的公开日期");
          return false;
        }
        if((this.form.grantdate1&&!this.form.grantdate2)||(!this.form.grantdate1&&this.form.grantdate2)){
          this.$message.warning("请选择完整的授权日期");
          return false;
        }
        if(!this.form.patentname&&!this.form.abstract&&!this.form.applynum&&
            !this.form.publishnum&&!this.form.priornum&&!this.form.ipc&&!this.form.applier&&
            !this.form.inventor&&!this.form.applydate1&&!this.form.applydate2&&
            !this.form.publishdate1&&!this.form.publishdate2&&
            !this.form.grantdate1&&!this.form.grantdate2){
              this.$message.warning("请先输入检索条件！");
              return false;
        }else{
          var obj={
            range:{
              china:this.checked,
              main:this.checkedmain,
              other:this.checkedother
            },
            pagesize:this.pagesize,
            currentpage:this.currentpage,
            patentname:this.form.patentname,
            abstract:this.form.abstract,
            applydate1:this.form.applydate1,
            applydate2:this.form.applydate2,
            publishdate1:this.form.publishdate1,
            publishdate2:this.form.publishdate2,
            grantdate1:this.form.grantdate1,
            grantdate2:this.form.grantdate2,
            applynum:this.form.applynum,
            publishnum:this.form.publishnum,
            priornum:this.form.priornum,
            ipc:this.form.ipc,
            applier:this.form.applier,
            inventor:this.form.inventor
          };
          var that=this;
          console.log(obj);
          const loadingbyc = this.$loading({
              lock: true,
              text: 'Loading',
              spinner: 'el-icon-loading',
              background: 'rgba(0, 0, 0, 0.7)'
          });
          this.$root.postReq("/web/patentycCtl/advancedsearch",obj).then(function (d) {
            console.log("--------/web/patentycCtl/advancedsearch----------");
            console.log(d);
            $('.app-main').animate({scrollTop: 0},100);
            if(d.status==0){
              loadingbyc.close();
              that.total=d.data.total;
              that.datalist=d.data.dataList;
              that.a=true;
              if(that.checkAllAnalysis){
                that.$nextTick(function(){
                  that.datalist.forEach(d=>{
                    that.$refs.multipleTable.toggleRowSelection(d,true);
                  })
                })
              }else{
                that.$nextTick(function(){
                  for(var i=0;i<that.checkListAnalysis.length;i++){
                    if(that.currentpage==that.checkListAnalysis[i].pageNo){
                      for (var j=0;j<that.checkListAnalysis[i].data.length;j++){
                        that.datalist.forEach(d=>{
                          if(d.applynum==that.checkListAnalysis[i].data[j].applynum){
                            that.$refs.multipleTable.toggleRowSelection(d,true);
                          }
                        })
                      }
                    }
                  }
                })
              }
            }
          })
        }
      },
      handleSizeChange(val){
        console.log("------------handleSizeChange--------------");
        console.log(val);
        this.pagesize=val;
        this.currentpage=1;
        /*清楚勾选的痕迹*/
        this.checkAllAnalysis=false;
        this.checkListAnalysis=[];
        this.multipleSelection=[];
        this.search();
      },
      handleCurrentChange(val){
        console.log("------------handleCurrentChange--------------");
        console.log(val);
        if(!this.checkAllAnalysis){
          var bool=true;
          for(var i=0;i< this.checkListAnalysis.length;i++){
            if(this.checkListAnalysis[i].pageNo==this.currentpage){
              bool=false;
              this.checkListAnalysis[i].data=this.multipleSelection;
              break;
            }
          }
          if(bool){
            var item={pageNo:this.currentpage,data:this.multipleSelection};
            this.checkListAnalysis.push(item);
          }
        }
        this.currentpage=val;
        this.search();
      },
      tableHeaderColor({row, column, rowIndex, columnIndex}){
        if (rowIndex === 0) {
          return 'background: #F5F5F5;color:#333333;text-align:center'
        }
      },
      tableRowStyle({ row, rowIndex }) {
        return 'height:50px;text-align:center'
      },
      patentdetail(row){
        console.log(row);
        var localurl = location.href;
        var base = localurl.split("#");
        var url = base[0] + "#/patentdetail";
        this.$root.windowOpen({
          url:url,
          title:"专利详情",
          params:[
            {name:"applynum",value:row.applynum},
            {name:"publishnum",value:row.publishnum},
            {name:"activeIndex",value:2}
          ]
        })
        /*window.open(url);*/
      },
      gainsearchwords(){
        console.log(this.form);
        this.searwords="";
        if(this.form.patentname){
          if(!this.searwords){
            this.searwords=this.searwords+"专利名称=("+this.form.patentname+")";
          }else{
            this.searwords=this.searwords+" AND 专利名称=("+this.form.patentname+")";
          }
        };
        if(this.form.abstract){
          if(!this.searwords){
            this.searwords=this.searwords+"摘要=("+this.form.abstract+")";
          }else{
            this.searwords=this.searwords+" AND 摘要=("+this.form.abstract+")";
          }
        };
        if(this.form.applydate1&&this.form.applydate2){
          if(!this.searwords){
            this.searwords=this.searwords+"申请日期=("+this.form.applydate1+"至"+this.form.applydate2+")";
          }else{
            this.searwords=this.searwords+" AND 申请日期=("+this.form.applydate1+"至"+this.form.applydate2+")";
          }
        }else if(!this.form.applydate1&&!this.form.applydate2){

        }else{
          this.$message.warning("请选择完整的申请日期");
        };
        if(this.form.publishdate1&&this.form.publishdate2){
          if(!this.searwords){
            this.searwords=this.searwords+"公开日期=("+this.form.publishdate1+"至"+this.form.publishdate2+")";
          }else{
            this.searwords=this.searwords+" AND 公开日期=("+this.form.publishdate1+"至"+this.form.publishdate2+")";
          }
        }else if(!this.form.publishdate1&&!this.form.publishdate2){

        }else{
          this.$message.warning("请选择完整的公开日期");
        };
        if(this.form.grantdate1&&this.form.grantdate2){
          if(!this.searwords){
            this.searwords=this.searwords+"授权日期=("+this.form.grantdate1+"至"+this.form.grantdate2+")";
          }else{
            this.searwords=this.searwords+" AND 授权日期=("+this.form.grantdate1+"至"+this.form.grantdate2+")";
          }
        }else if(!this.form.grantdate1&&!this.form.grantdate2){

        }else{
          this.$message.warning("请选择完整的授权日期");
        };
        if(this.form.applynum){
          if(!this.searwords){
            this.searwords=this.searwords+"专利申请号=("+this.form.applynum+")";
          }else{
            this.searwords=this.searwords+" AND 专利申请号=("+this.form.applynum+")";
          }
        };
        if(this.form.publishnum){
          if(!this.searwords){
            this.searwords=this.searwords+"专利公开号=("+this.form.publishnum+")";
          }else{
            this.searwords=this.searwords+" AND 专利公开号=("+this.form.publishnum+")";
          }
        };
        if(this.form.priornum){
          if(!this.searwords){
            this.searwords=this.searwords+"专利优先权号=("+this.form.priornum+")";
          }else{
            this.searwords=this.searwords+" AND 专利优先权号=("+this.form.priornum+")";
          }
        };
        if(this.form.ipc){
          if(!this.searwords){
            this.searwords=this.searwords+"国际分类号（IPC）=("+this.form.ipc+")";
          }else{
            this.searwords=this.searwords+" AND 国际分类号（IPC）=("+this.form.ipc+")";
          }
        };
        if(this.form.applier){
          if(!this.searwords){
            this.searwords=this.searwords+"申请（专利权）人=("+this.form.applier+")";
          }else{
            this.searwords=this.searwords+" AND 申请（专利权）人=("+this.form.applier+")";
          }
        };
        if(this.form.inventor){
          if(!this.searwords){
            this.searwords=this.searwords+"发明人=("+this.form.inventor+")";
          }else{
            this.searwords=this.searwords+" AND 发明人=("+this.form.inventor+")";
          }
        };

      },
      handleCheckAllChange(val) {
        this.checked =val ? this.cities1:[];
        this.checkAll1=this.checked===this.cities1;
        this.isIndeterminate1=this.checked.length > 0 && this.checked.length < this.cities1.length;
        this.checkedmain=val ? this.cities2:[];
        this.checkAll2=this.checkedmain===this.cities2;
        this.isIndeterminate2=this.checkedmain.length > 0 && this.checkedmain.length < this.cities2.length;
        this.checkedother=val ? this.cities3:[];
        this.checkAll3=this.checkedother===this.cities3;
        this.isIndeterminate3=this.checkedother.length > 0 && this.checkedother.length < this.cities3.length;
      },
      check(){
        if(this.checkAll1&&this.checkAll2&&this.checkAll3){
          this.checkAll=true;
          this.isIndeterminate=false;
        }else{
          this.checkAll=false;
          this.isIndeterminate=true;
        }
      },
      handleCheckAllChange1(val) {
        this.checked =val ? this.cities1:[];
        this.isIndeterminate1=false;
        this.check();
      },
      handleCheckedCitiesChange1(value) {
        let checkedCount = value.length;
        this.checkAll1 = checkedCount === this.cities1.length;
        this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.cities1.length;
        this.check();
      },
      handleCheckAllChange2(val) {
        this.checkedmain =val ? this.cities2:[];
        this.isIndeterminate2=false;
        this.check();
      },
      handleCheckedCitiesChange2(value) {
        let checkedCount = value.length;
        this.checkAll2 = checkedCount === this.cities2.length;
        this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.cities2.length;
        this.check();
      },
      handleCheckAllChange3(val) {
        this.checkedother =val ? this.cities3:[];
        this.isIndeterminate3=false;
        this.check();
      },
      handleCheckedCitiesChange3(value) {
        let checkedCount = value.length;
        this.checkAll3 = checkedCount === this.cities3.length;
        this.isIndeterminate3 = checkedCount > 0 && checkedCount < this.cities3.length;
        this.check();
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      handleCheckAllChangeAnalysis(val){
        this.multipleSelection =val ? this.datalist:[];
        this.toggleSelection(this.multipleSelection);
        this.isIndeterminateAnalysis=false;
      },
      toggleSelection(rows){
        if (rows.length!=0) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        }else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      patentAnalysis(){
        var localurl = location.href;
        var base = localurl.split("#");
        if((this.checkAllAnalysis)||(!this.checkAllAnalysis && this.multipleSelection.length==0)){
          url=base[0] + "#/patentanalysis";
          var obj={
            total:this.total,
            range:{
              china:this.checked,
              main:this.checkedmain,
              other:this.checkedother
            },
            patentname:this.form.patentname,
            abstract:this.form.abstract,
            applydate1:this.form.applydate1,
            applydate2:this.form.applydate2,
            publishdate1:this.form.publishdate1,
            publishdate2:this.form.publishdate2,
            grantdate1:this.form.grantdate1,
            grantdate2:this.form.grantdate2,
            applynum:this.form.applynum,
            publishnum:this.form.publishnum,
            priornum:this.form.priornum,
            ipc:this.form.ipc,
            applier:this.form.applier,
            inventor:this.form.inventor
          };
          localStorage.setItem("patentyc_patentanalysis",JSON.stringify(obj));
          this.$root.windowOpen({
            url:url,
            title:"专利分析",
            params:[
              {name:"search",value:"advanceall"}
            ]
          })
          /*window.open(url);*/
        }else{
          url=base[0] + "#/patentanalysis";
          if(!this.checkAllAnalysis){
            var bool=true;
            for(var i=0;i< this.checkListAnalysis.length;i++){
              if(this.checkListAnalysis[i].pageNo==this.currentpage){
                bool=false;
                this.checkListAnalysis[i].data=this.multipleSelection;
                break;
              }
            }
            if(bool){
              var item={pageNo:this.currentpage,data:this.multipleSelection};
              this.checkListAnalysis.push(item);
            }
          }
          var list="";
          for(var i=0;i<this.checkListAnalysis.length;i++){
            for(var j=0;j<this.checkListAnalysis[i].data.length;j++){
              if(list.length>0){
                list=list+","+this.checkListAnalysis[i].data[j].applynum;
              }else{
                list=this.checkListAnalysis[i].data[j].applynum;
              }
            }
          }
          var num=list.split(",").length;
          var obj={
            total:num,
            applynumList:list.split(",")
          };
          localStorage.setItem("patentyc_patentanalysis",JSON.stringify(obj));
          this.$root.windowOpen({
            url:url,
            title:"专利分析",
            params:[
              {name:"search",value:"advanceother"}
            ]
          })
          /*window.open(url);*/
        }
      }

    },
    mounted:function(){
      $("#patentyc").text("专眼查-高级检索");
      $(".b").hide();
      $(".a").mouseleave(function(e){
        $(".b").hide();
      });
      $(".a").mousemove(function(e){
        setTimeout(()=>{
          var v=(e.pageX-100)+"px";
          var t=(e.pageY-720)+"px";
          $(".b").css({left:v,top:t});
          $(".b").show();
        });
      });
   },
    vname:"gsb-patentadvancedsearch"
}
