{
    template:'${tmpl}',
    data:function(){
      return {
        a:true,
        b:false,
        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:["奥地利","澳大利亚","西班牙","意大利","加拿大","瑞典"],
        activeName: "patentname",
        active:{patentname:"专利名称",applynum:"申请号",publishnum:"公开号",applier:"申请人",inventor:"发明人"},
        input:"",
        checkedoptions:[],
        patenttype:"",
        status:"",
        applydate:"",
        publishdate:"",
        pagesize:20,
        currentpage:1,
        datalist1:{
          patenttype:[
            {code:"fmsq",lable:"发明申请",num:0},
            {code:"syxx",lable:"实用新型",num:0},
            {code:"wgsj",lable:"外观设计",num:0}
          ],
          status:[
            {code:"yx",lable:"有效",num:0},
            {code:"zs",lable:"在审",num:0},
            {code:"wx",lable:"无效",num:0}
          ],
          applydate:[
            {code:"2001",lable:"2001年",num:0},{code:"2002",lable:"2002年",num:0},
            {code:"2003",lable:"2003年",num:0},{code:"2004",lable:"2004年",num:0},
            {code:"2005",lable:"2005年",num:0},{code:"2006",lable:"2006年",num:0},
            {code:"2007",lable:"2007年",num:0},{code:"2008",lable:"2008年",num:0}
          ],
          publishdate:[
            {code:"2001",lable:"2001年",num:0},{code:"2002",lable:"2002年",num:0},
            {code:"2003",lable:"2003年",num:0},{code:"2004",lable:"2004年",num:0},
            {code:"2005",lable:"2005年",num:0},{code:"2006",lable:"2006年",num:0},
            {code:"2007",lable:"2007年",num:0},{code:"2008",lable:"2008年",num:0}
          ]
        },
        isShow:true,
        isShow2:true,
        total:20,
        datalist2:[
          {
            applynum:"200410095872",
            publishnum:"CN1621375A",
            patentname:"人工智能测控仪",
            applier:"汉唐信通（北京）咨询有限公司",
            inventor:"张章；刘备",
            applydate:"2018-12-21",
            publishdate:"2019-01-24",
            articletype:"外观设计"
          }
        ],
      };
    },

    methods:{
      checkClick(){
        this.b=!this.b;
      },
      search(){
        if(!this.input){
          this.$message.warning("输入的搜索关键字不能为空");
          return false;
        };
        var obj={
          lable:this.activeName,
          content:this.input,
          range:{
            china:this.checked,
            main:this.checkedmain,
            other:this.checkedother
          },
          patenttype:this.patenttype,
          status:this.status,
          applydate:this.applydate,
          publishdate:this.publishdate,
          pagesize:this.pagesize,
          currentpage:this.currentpage,
        };
        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/simplesearch",obj).then(function (d) {
          console.log("--------/web/patentycCtl/simplesearch----------");
          console.log(d);
          if(d.status==0){
            loadingbyc.close();
            that.total=d.data.total;
            if(d.data.dataList1.patenttype.length==0){
              d.data.dataList1.patenttype=[
                {code:"发明",lable:"发明申请",num:0},
                {code:"实用新型",lable:"实用新型",num:0},
                {code:"外观设计",lable:"外观设计",num:0}
              ]
            }
            if(d.data.dataList1.status==0){
              d.data.dataList1.status=[
                {code:"有效",lable:"有效",num:0},
                {code:"在审",lable:"在审",num:0},
                {code:"无效",lable:"无效",num:0}
              ]
            }
            that.datalist1=d.data.dataList1;
            that.datalist2=d.data.dataList2;
          }
          that.a=false;that.b=false;
        })

      },
      search1(){
        this.total=0;
        this.currentpage=1;
        this.search();
      },
      search2(){
        this.total=0;
        this.currentpage=1;
        this.checkedoptions=[];
        this.patenttype="";
        this.status="";
        this.applydate="";
        this.publishdate="";
        this.search();
      },
      onclick(){
        this.isShow=!this.isShow;
      },
      onclick2(){
        this.isShow2=!this.isShow2;
      },
      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();
      },
      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=1";
        window.open(url);
      },
      handleClick(){
        this.total=0;
        this.currentpage=1;
        this.checkedoptions=[];
        this.patenttype="";
        this.status="";
        this.applydate="";
        this.publishdate="";
        this.search();
      },
      patenttypeclick(o){
        this.total=0;
        this.currentpage=1;
        this.patenttype=o.code;
        this.checkedoptions.push({name:"patenttype",code:o.code,lable:o.lable});
        this.search();
      },
      handleClose(tag){
        if(tag.name=="patenttype"){
          this.patenttype="";
        }
        if(tag.name=="status"){
          this.status="";
        }
        if(tag.name=="applydate"){
          this.applydate="";
        }
        if(tag.name=="publishdate"){
          this.publishdate="";
        }
        this.total=0;
        this.currentpage=1;
        this.checkedoptions.splice(this.checkedoptions.indexOf(tag), 1);
        this.search();
      },
      statusclick(o){
        this.total=0;
        this.currentpage=1;
        this.status=o.code;
        this.checkedoptions.push({name:"status",code:o.code,lable:o.lable});
        this.search();
      },
      applydateclick(o){
        this.total=0;
        this.currentpage=1;
        this.applydate=o.code;
        this.checkedoptions.push({name:"applydate",code:o.code,lable:o.lable});
        this.search();
      },
      publishdateclick(o){
        this.total=0;
        this.currentpage=1;
        this.publishdate=o.code;
        this.checkedoptions.push({name:"publishdate",code:o.code,lable:o.lable});
        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'
      },
      logoclick(){
        this.a=true;this.b=false;
      },
      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("专眼查-常规检索");

    },
    vname:"gsb-patentsimplesearch"
}
