{
    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,

      };
    },

    methods:{
      delectsearchwords(){
        this.searwords="";
      },
      clicksearch(){
        this.currentpage=1;
        this.total=0;
        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);
              if(d.status==0){
                loadingbyc.close();
                that.total=d.data.total;
                that.datalist=d.data.dataList;
                that.a=true;
              }

            })
          }
      },
      handleSizeChange(val){
        console.log("------------handleSizeChange--------------");
        console.log(val);
        this.pagesize=val;
        this.currentpage=1;
        this.search();
      },
      handleCurrentChange(val){
        console.log("------------handleCurrentChange--------------");
        console.log(val);
        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("p#");
        var url = base[0] + "p#/patentdetail?applynum=" + row.applynum + "&publishnum=" + row.publishnum+"&activeIndex=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();
      },
    },
    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"
}
