浏览代码

专利检索修改

zhuliu 1 年之前
父节点
当前提交
92ecb168ba

+ 1 - 32
src/views/project/patentCollection/index.vue

@@ -356,38 +356,7 @@ export default {
     },
     // 统计组件传的值
     handleCustomFields(val) {
-      this.searchPatentCheck = []
-      val.forEach(item => {
-        if (item.check && item.check.length > 0) {
-          if (item.filedKind == -1) {
-            this.searchPatentCheck.push(item)
-          } else {
-            var checkName = []
-            if (item.type == 'Array' || item.type == 'tree' || item.type == 'DateTime') {
-              if(item.type == 'tree'){
-                checkName = item.checkData.map(item=>item.name)
-              }else{
-                checkName = item.options.filter(item2 => item.check.includes(item2.id || item2.name)).map(item3 => item3.name);
-              }
-              
-            }
-            var obj = {
-              value: item.value,
-              name: item.name,
-              filedKind: item.filedKind,
-              check: item.check,
-              checkData:item.checkData,
-              checkName: checkName,//自定义栏位多选
-              type: item.type,
-              // ifHaveChild: this.ifHaveChild
-              ifHaveChild: item.ifHaveChild
-
-            }
-            // return
-            this.searchPatentCheck.push(obj)
-          }
-        }
-      })
+      this.searchPatentCheck  = val
       this.$nextTick(() => {
         this.$refs.searchPatent.search2()
       })

+ 51 - 4
src/views/report/components/patentList/components/customFields/components/tab1.vue

@@ -258,11 +258,11 @@ export default {
     },
     // 全选
     handleSelectAll(val) {
-      if (val.findKind == -1) {//自定义字段的全选
+      if (val.filedKind == -1) {//专利本身的全选
         val.check = val.options.map(item => {
           return item.name
         })
-      } else {//专利本身的全选,没有id
+      } else {//其他
         val.check = val.options.map(item => {
           return item.id
         })
@@ -270,10 +270,57 @@ export default {
       if (!val.checkData) {
         val.checkData=[]
       }
+      var field = {
+        filedKind:val.filedKind,
+        groupBy:val.groupBy
+      }
+      if(val.children && val.children.length>0){
+          field.search = val.select
+          var obj1 = val.children.find(item=>{
+            return item.value == val.select
+          })
+          if(obj1){
+            field.show = obj1.label
+          }else{
+            field.show = val.name
+          }
+        }else{
+          field.search = val.value
+          field.show = val.name
+        }
+       
       for(var i = 0;i<val.check.length;i++){
         var obj = {
-          field:val.value,
-          value:val.check[i]
+          field:field,
+          value:{}
+        }
+        var value = val.check[i]
+        if(val.filedKind == -1){
+          if(val.optionValue && val.optionValue.length>0){
+            obj.value.search = value
+            var obj2 = val.optionValue.find(item1=>{
+                return item1.value == value
+            })
+            if(obj2){
+              obj.value.show = obj2.label
+            }else{
+              obj.value.show = value
+            }
+            
+          }else{
+            obj.value.search = value
+            obj.value.show = value
+          }
+        }else{
+          obj.value.search = value
+          var obj2 = val.options.find(item1=>{
+            return item1.id == value
+          })
+          if(obj2){
+            obj.value.show = obj2.name
+          }else{
+            obj.value.show = value
+          }
         }
         val.checkData.push(obj)
       }

+ 76 - 35
src/views/report/components/patentList/components/customFields/index.vue

@@ -131,6 +131,15 @@ export default {
     },
     // 检索条件取消时统计勾选项一并取消//待修改,需要考虑产品架构、技术分类、等id重复的情况
     close() {
+      this.filedAll.forEach(item => {
+          item.check = []
+          item.checkData = []
+        })
+        this.fieldTree.forEach(item=>{
+          item.check = []
+          item.checkData = []
+        })
+      return
       let currentData = this.searchPatentCheck
       // if(currentData.length==0){
         this.field.forEach(item => {
@@ -595,16 +604,65 @@ export default {
           row.checkData=[]
         }
         var obj = {
-          field: (row.children && row.children.length>0)?row.select:row.value,
-          value:value
+          // field: (row.children && row.children.length>0)?row.select:row.value,
+          // value:value,
+          field:{
+            filedKind:row.filedKind,
+            groupBy:row.groupBy
+          },
+          value:{}
+        }
+        if(row.children && row.children.length>0){
+          obj.field.search = row.select
+          var obj1 = row.children.find(item=>{
+            return item.value == row.select
+          })
+          if(obj1){
+            obj.field.show = obj1.label
+          }else{
+            obj.field.show = row.name
+          }
+        }else{
+          obj.field.search = row.value
+          obj.field.show = row.name
+        }
+        if(row.filedKind == -1){
+          if(row.optionValue && row.optionValue.length>0){
+            obj.value.search = value
+            var obj2 = row.optionValue.find(item1=>{
+                return item1.value == value
+            })
+            if(obj2){
+              obj.value.show = obj2.label
+            }else{
+              obj.value.show = value
+            }
+            
+          }else{
+            obj.value.search = value
+            obj.value.show = value
+          }
+        }else{
+          obj.value.search = value
+          var obj2 = row.options.find(item1=>{
+            return item1.id == value
+          })
+          if(obj2){
+            obj.value.show = obj2.name
+          }else{
+            obj.value.show = value
+          }
         }
+        
+
+
         if(name){
           obj.name = name
         }
         row.checkData.push(obj)
       } else {
         var index = row.checkData.findIndex(item => {
-          return item.field == ((row.children && row.children.length>0)?row.select:row.value) && item.value == value
+          return item.field.search == ((row.children && row.children.length>0)?row.select:row.value) && item.value.search == value
         })
         if (index != -1) {
           row.checkData.splice(index,1)
@@ -621,44 +679,27 @@ export default {
         return item.check && item.check.length>0
       })
       let arr = field.concat(fieldTree)
-      var data = []
+      var data = {}
       for (var i = 0; i < arr.length; i++){
-        var item = arr[i]
-        if (item.children && item.children.length > 0) {
-          var obj = {}
-          for (var j = 0; j < item.checkData.length; j++){
-            var item1 = item.checkData[j]
-            if (obj[item1.field]) {
-              obj[item1.field].check.push(item1.value)
-            } else {
-              var obj2 = {
-                ...item
-              }
-              obj2.field1 = obj2.field
-              obj2.value1 = obj2.value
-              obj2.name = obj2.name
-              obj2.field = item1.field
-              obj2.value = item1.field
-              var label = item.children.find(item2 => {
-                return item2.value == item1.field
-              }).label
-              obj2.name = label
-              obj2.check = [item1.value]
-              obj[item1.field] = obj2
+        var checkData = arr[i].checkData
+        for(var j = 0;j<checkData.length;j++){
+          var searchData = checkData[j]
+          var fieldName = JSON.stringify(searchData.field)
+          if(data[fieldName]){
+            data[fieldName].value.push(searchData.value)
+          }else{
+            data[fieldName] = {
+              field:searchData.field,
+              value:[searchData.value],
+              ifHaveChild : this.ifHaveChild,
+              op:searchData.field.groupBy=='company'?'≡':'='
             }
           }
-          for(let key in obj) {
-            data.push(obj[key])
-          }
-          continue;
-        }
-        if ([7, 8, 9].includes(item.filedKind) || (item.filedKind == 0 && item.type == 'tree')) {
-          item.ifHaveChild = this.ifHaveChild
         }
-        data.push(item)
       }
+      var finishData = Object.values(data)
       this.$emit('ifHaveChild', this.ifHaveChild)
-      this.$emit('customTab', data)
+      this.$emit('customTab', finishData)
     },
     // 加载更多
     handleLoading(val) {

+ 1 - 29
src/views/report/components/patentList/components/index.vue

@@ -229,35 +229,7 @@ export default {
     },
     // 统计组件传的值
     handleCustomFields(val) {
-      this.searchPatentCheck = []
-      val.forEach(item => {
-        if (item.check && item.check.length > 0) {
-          if (item.filedKind == -1) {
-            this.searchPatentCheck.push(item)
-          } else {
-            var checkName = []
-            if (item.type == 'Array' || item.type == 'tree' || item.type == 'DateTime') {
-              if(item.type == 'tree'){
-                checkName = item.checkData.map(item=>item.name)
-              }else{
-                checkName = item.options.filter(item2 => item.check.includes(item2.id || item2.name)).map(item3 => item3.name);
-              }
-            }
-            var obj = {
-              value: item.value,
-              name: item.name,
-              filedKind: item.filedKind,
-              check: item.check,
-              checkData:item.checkData,
-              checkName: checkName,//自定义栏位多选
-              type:item.type,
-              ifHaveChild: this.ifHaveChild
-            }
-            // return
-            this.searchPatentCheck.push(obj)
-          }
-        }
-      })
+      this.searchPatentCheck  = val
       this.$nextTick(() => {
         this.$refs.searchPatent.search2()
       })

+ 492 - 0
src/views/report/components/patentList/components/searchPatent-备份.vue

@@ -0,0 +1,492 @@
+<template>
+  <div class="searchPatent">
+    <div style="display: flex;align-items: center;">
+      <el-cascader :options="options" @change="cascaderChange" v-model="value" :show-all-levels="false" size="small"
+        style="width: 150px;"></el-cascader>
+
+      <div style="margin: 0px 10px 0px 10px;">
+        <el-input v-if="!isControl.select" v-model="inputValue" size="small"
+          :placeholder="isControl.placeholder"></el-input>
+        <el-select v-else v-model="inputValue" multiple collapse-tags placeholder="请选择" size="small">
+          <el-option v-for="item in typeStatus[isControl.selectCheck]" :key="item.value" :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </div>
+      <el-button @click="search" type="primary" size="small">检索</el-button>
+
+      <el-popover placement="bottom" v-if="searchStorageText.length > 0" width="260" trigger="click">
+        <div style="height: 200px;overflow-x: auto;">
+          <div v-for="(item, index) in searchStorageText" :key="index">
+            <div style="margin-bottom:10px;background:#F0F9EB;padding: 10px 5px;">
+              <span>{{ item.label }}</span>
+              <span> = </span>
+              <template v-if="Array.isArray(item.inputValue)">
+                <span>(</span>
+                <template v-if="item.filedKind == 0">
+                  <span v-for="(result, i) in item.checkName" :key="result" @click="resultBtn(item, index, i)"
+                    style="cursor: pointer;">{{ result
+                    }}<i class="el-icon-close"></i>
+                    <b v-if="item.checkName.length - 1 > i"> OR </b>
+                  </span></template>
+                <template v-else>
+                  <span v-for="(result, i) in item.inputValue" :key="result" @click="resultBtn(item, index, i)"
+                    style="cursor: pointer;">{{ result
+                    }}<i class="el-icon-close"></i>
+                    <b v-if="item.inputValue.length - 1 > i"> OR </b>
+                  </span>
+                </template>
+                <span>)</span>
+                <!-- <span>({{ item.result.join(' OR ') }})</span> -->
+              </template>
+              <template v-else>
+                <span @click="resultBtn(item, index, 0)" style="cursor: pointer;">({{ item.inputValue }})<i
+                    class="el-icon-close"></i></span>
+              </template>
+            </div>
+          </div>
+        </div>
+
+        <el-button slot="reference" type="primary" size="small" class="margin-left_10">检索式</el-button>
+      </el-popover>
+
+    </div>
+
+
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    // 所有的检索字段(包含自定义字段)
+    searchFiled: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    searchPatentCheck: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+  },
+  data() {
+    return {
+      // 级联面板数据源
+      options: [],
+      value:['text', 'AB'],
+      // 存储条件
+      searchStorage: [],
+      searchStorageText: [],
+      // 专利检索式
+      searchStr: '',
+      // 自定义栏位检索式
+      searchCustomStr: '',
+      // 专利IPC/CPC/UPC/LOC的选项
+      special: {
+        MC: [
+          { value: 'ipcLevel1', label: 'IPC部' },
+          { value: 'ipcLevel2', label: 'IPC大类' },
+          { value: 'ipcLevel3', label: 'IPC小类' },
+          { value: 'ipcLevel4', label: 'IPC大组' },
+          { value: 'ipcLevel5', label: 'IPC小组' },
+        ],
+        CPC: [
+          { value: 'cpcLevel1', label: 'CPC部' },
+          { value: 'cpcLevel2', label: 'CPC大类' },
+          { value: 'cpcLevel3', label: 'CPC小类' },
+          { value: 'cpcLevel4', label: 'CPC大组' },
+          { value: 'cpcLevel5', label: 'CPC小组' },
+        ],
+        UPC: [
+          // { value: '0', label: '分类号' },//老系统有
+          { value: 'upcLevel1', label: 'UPC大类' },
+          { value: 'upcLevel2', label: 'UPC小类' },
+        ],
+        LOC: [
+          // { value: '0', label: '分类号' },//老系统有
+          { value: 'locLevel1', label: 'LOC大类' },
+          { value: 'locLevel2', label: 'LOC小类' },
+        ],
+      },
+      // 类型及状态
+      typeStatus: {
+        //法律状态暂定
+        LG: [
+          { value: '1', label: '有效' },
+          { value: '2', label: '无效' },
+          { value: '3', label: '审中' },
+        ],
+        //专利类型
+        PT: [
+          { value: '1 OR 8', label: '发明' },
+          { value: '2 OR 9', label: '实用新型' },
+          { value: '3', label: '外观' },
+        ],
+        //专利状态
+        SS: [
+          { value: '1', label: '有效' },
+          { value: '2', label: '无效' },
+          { value: '3', label: '审中' },
+        ],
+      },
+      // 控制检索式弹窗显示
+      dialogVisible: false,
+      // 选择的cascader
+      casString: null,
+      // 输入框的值
+      inputValue: '',
+      // 控制显示提示及select
+      isControl: {
+        placeholder: '请输入检索内容'
+      },
+    }
+  },
+  watch: {
+    searchFiled: {
+      deep: true,
+      handler() {
+        this.getGroup()
+      },
+    },
+  },
+  mounted() {
+    this.getGroup()
+  },
+  methods: {
+    // 点击检索式中的检索条件
+    resultBtn(item, index, i) {
+      // if (Array.isArray(item.inputValue)) {
+      //   item.inputValue.splice(i, 1)
+      //   var field = ''
+      //   if(item.filedKind == 0){
+      //     field = 'checkName'
+      //   }else{
+      //     field = 'checkData'
+      //   }
+       
+      //   if (this.searchStorageText[index].inputValue.length == 0) {
+      //     this.searchStorageText.splice(index, 1)
+      //     let spliceName = ''
+      //     if (item.dele == 'storage') {
+      //       spliceName = 'searchStorage'
+      //     } else {
+      //       spliceName = 'searchPatentCheck' 
+      //     }
+      //     let b = this[spliceName].findIndex(itemFind => {
+      //       return itemFind[field] == item[field]
+      //     })
+      //     if(b!=-1){
+      //       this[spliceName].splice(b, 1)
+      //     }
+          
+      //   }
+      //   if (item.checkData && item.checkData.length > 0) {//统计自定义字段
+      //     item.checkData.splice(i, 1)
+      //     if(item.checkName){
+      //       item.checkName.splice(i, 1)
+      //     }
+      //   }
+      // } else {
+      //   let spliceName = ''
+      //   if (item.dele == 'storage') {
+      //     spliceName = 'searchStorage'
+      //   } else {
+      //     spliceName = 'searchPatentCheck'
+      //   }
+      //   let a = this[spliceName].findIndex(itemFind => {
+      //     return itemFind.inputValue == item.inputValue
+      //   })
+      //   if (a != -1) {
+      //     this[spliceName].splice(a, 1)
+      //   }
+      //   this.searchStorageText.splice(index, 1)
+      //   this.searchStr = ''
+      // }
+      this.search2()
+    },
+    // cascader变化事件
+    cascaderChange(val) {
+      this.inputValue = ''
+      // let a = this.options.find(item => {
+      //   return item.value == val[0]
+      // })
+      // this.isControl = a.children.find(item => {
+      //   return item.value == val[1]
+      // })
+      var a = JSON.parse(JSON.stringify(this.options))
+      val.forEach((item1,index) => {
+        if (index == val.length - 1) {
+          this.isControl = a.children.find(item => {
+            return item.value == item1
+          })
+        } else {
+          if (index == 0) {
+            a = a.find(item => {
+              return item.value == item1
+            })
+          } else {
+            a = a.children.find(item => {
+              return item.value == item1
+            })
+          }
+          
+        }
+      })
+      this.isControl.placeholder = '请输入检索内容'
+      if (this.isControl.type == '2') {
+        this.isControl.placeholder = '请输入日期(格式2020 ~ 2023)'
+      }
+      if (val[0] == 'typeStatus') {
+        this.$set(this.isControl, 'select', true)
+        this.$set(this.isControl, 'selectCheck', val[val.length - 1])
+      }
+    },
+    // 存储条件
+    storage() {
+      this.isControl.inputValue = this.inputValue
+      // let isControl = JSON.parse(JSON.stringify(this.isControl))
+      var obj = {
+        field:{
+          search:this.isControl.value,
+          show:this.isControl.label
+        },
+        value:[],
+        op:'='
+      }
+      if(typeof this.isControl.inputValue == 'object'){
+        var arr = this.isControl.inputValue
+        arr.forEach(item=>{
+          var show = item
+          if(this.typeStatus[this.isControl.selectCheck]){
+            var obj2 = this.typeStatus[this.isControl.selectCheck].find(item2=>{
+              return item2.value == item
+            })
+            if(obj2){
+              show = obj2.label
+            }
+          }
+          obj.value.push(
+            {
+              search:item,
+              show:show
+            }
+          )
+        })
+      }else{
+        obj.value.push(
+          {
+            search:this.isControl.inputValue,
+            show:this.isControl.inputValue
+          }
+        )
+      }
+      this.searchStorage.push(obj)
+
+    },
+    getSearchOptionData() {
+      
+      return
+      var data = []
+      this.searchStorage.forEach(item => {
+        data.push(
+          {
+            label: item.label,
+            value: item.value,
+            inputValue: item.inputValue,
+            type: item.type,
+            group: item.group,
+            dele: 'storage',
+          }
+        )
+      })
+      this.searchPatentCheck.forEach(item => {
+        var type = 1
+        data.push(
+          {
+            label: item.name,
+            value: item.value,
+            inputValue: item.checkData.map(i=>i.value),
+            checkName: item.checkName,
+            checkData:item.checkData,
+            filedKind: item.filedKind,
+            type: item.type,
+            ifHaveChild:item.ifHaveChild,
+            group: item.filedKind == -1 ? 'nos' : 'customField',
+            groupBy:item.groupBy,
+            dele: 'patentCheck',
+          }
+        )
+      })
+      this.searchStorageText = data
+      return data
+    },
+    // 页面检索按钮
+    search() {
+      if (!this.isControl.value) {
+        this.$message.error('检索项不能为空')
+        return
+      }
+      if (!this.inputValue) {
+        this.$message.error('检索内容不能为空')
+        return
+      }
+      this.storage()
+      this.search2()
+    },
+    search2() {
+      this.getSearchOptionData()
+      // return
+      this.getSearchStorage()
+    },
+    // 处理检索条件
+    getSearchStorage() {
+      let customFields = []
+      let count = 0
+      // console.log(this.searchStorageText)
+      this.searchStorageText.forEach((item, index) => {
+        var sign = '='
+        if(item.dele == 'patentCheck' && item.groupBy == 'company'){
+          sign = '≡'
+        }
+        if (item.group == 'nos') {
+          if (count == 0) {
+            count++
+            if (Array.isArray(item.inputValue)) {
+              var value = ''
+              item.inputValue.forEach((i,index)=>{
+                if(/\s/.test(i)){
+                  value += `"${i}"`
+                }else{
+                  value += i
+                }
+                if(index!= item.inputValue.length- 1){
+                  value += ' OR '
+                }
+              })
+              if(value){
+                this.searchStr = `${item.value} ${sign} (${value})`
+              }
+              
+            } else {
+              if(item.inputValue){
+                // var values = this.$commonJS.AddQuotationMarks(item.inputValue)
+                // this.searchStr = `${item.value} ${sign} (${values.join('')})`
+                this.searchStr = `${item.value} ${sign} (${item.inputValue})`
+              }
+              
+            }
+
+          } else {
+            count++
+            if (Array.isArray(item.inputValue)) {
+              var value = ''
+              item.inputValue.forEach((i,index)=>{
+                if(/\s/.test(i)){
+                  value += `"${i}"`
+                }else{
+                  value += i
+                }
+                if(index!= item.inputValue.length - 1){
+                  value += ' OR '
+                }
+              })
+              if(value){
+                this.searchStr += ` AND ${item.value} ${sign} (${value})`
+              }
+              
+            } else {
+              if(item.inputValue){
+                // var values = this.$commonJS.AddQuotationMarks(item.inputValue)
+                // this.searchStr += ` AND ${item.value} ${sign} (${values.join('')})`
+                this.searchStr += ` AND ${item.value} ${sign} (${item.inputValue})`
+              }
+              
+            }
+          }
+        } else {
+          let a = {
+            fieldId: item.value,
+            fieldValue: (item.filedKind == 0 || item.filedKind) ? item.inputValue : [this.inputValue],
+            ifHaveChild:item.ifHaveChild
+          }
+          customFields.push(a)
+        }
+      })
+      if (this.searchStorageText.length==0) {
+        this.searchStr = ''
+      }
+      this.$emit('searchValue', { searchStr: this.searchStr, customFields: customFields, })
+    },
+
+
+    getGroup() {
+      if(!this.searchFiled||this.searchFiled.length == 0){
+        return ;
+      }
+      let obj = {
+        text: '文本',
+        number: '号码',
+        typeStatus: '类型及状态',
+        classify: '分类',
+        dateType: '日期',
+        company: '公司/人',
+        typeStatus: '类型及状态',
+        address: '地址',
+        nation: '国家/地区',
+        amount: '引用',
+        customField: '自定义字段',
+      }
+      let filedObj = {}
+      let data = this.searchFiled
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].group == 'nos') {//专利本身
+          if (filedObj[data[i].groupBy]) {
+            filedObj[data[i].groupBy].children.push(data[i])
+          } else {
+            filedObj[data[i].groupBy] = {
+              value: data[i].groupBy,
+              label: obj[data[i].groupBy],
+              children: [
+                data[i]
+              ],
+            }
+          }
+          // 给ipc、cpc、upc、loc添加大小类等
+          // if (['MC', 'CPC', 'UPC', 'LOC'].includes(data[i].value)) {
+          //   for (let j = 0; j < filedObj[data[i].groupBy].children.length; j++) {
+          //     if (!filedObj[data[i].groupBy].children[j].children) {
+          //       filedObj[data[i].groupBy].children[j].children = this.special[filedObj[data[i].groupBy].children[j].value]
+          //     }
+          //   }
+          // }
+        } else {//自定义字段
+          if (filedObj[data[i].group]) {
+            filedObj[data[i].group].children.push(data[i])
+          } else {
+            filedObj[data[i].group] = {
+              value: data[i].group,
+              label: obj[data[i].group],
+              children: [data[i]]
+            }
+          }
+        }
+      }
+      this.options = Object.values(filedObj)
+      if(this.options.length>0){
+        this.cascaderChange(this.value)
+      }
+      
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.searchPatent {
+  // width: 550px;
+}
+</style>

+ 90 - 172
src/views/report/components/patentList/components/searchPatent.vue

@@ -7,7 +7,7 @@
       <div style="margin: 0px 10px 0px 10px;">
         <el-input v-if="!isControl.select" v-model="inputValue" size="small"
           :placeholder="isControl.placeholder"></el-input>
-        <el-select v-else v-model="inputValue" placeholder="请选择" size="small">
+        <el-select v-else v-model="inputValue" multiple collapse-tags placeholder="请选择" size="small">
           <el-option v-for="item in typeStatus[isControl.selectCheck]" :key="item.value" :label="item.label"
             :value="item.value">
           </el-option>
@@ -19,29 +19,17 @@
         <div style="height: 200px;overflow-x: auto;">
           <div v-for="(item, index) in searchStorageText" :key="index">
             <div style="margin-bottom:10px;background:#F0F9EB;padding: 10px 5px;">
-              <span>{{ item.label }}</span>
+              <span>{{ item.field.show }}</span>
               <span> = </span>
-              <template v-if="Array.isArray(item.inputValue)">
+              <template>
                 <span>(</span>
-                <template v-if="item.filedKind == 0">
-                  <span v-for="(result, i) in item.checkName" :key="result" @click="resultBtn(item, index, i)"
-                    style="cursor: pointer;">{{ result
-                    }}<i class="el-icon-close"></i>
-                    <b v-if="item.checkName.length - 1 > i"> OR </b>
-                  </span></template>
-                <template v-else>
-                  <span v-for="(result, i) in item.inputValue" :key="result" @click="resultBtn(item, index, i)"
-                    style="cursor: pointer;">{{ result
-                    }}<i class="el-icon-close"></i>
-                    <b v-if="item.inputValue.length - 1 > i"> OR </b>
-                  </span>
-                </template>
+                <span v-for="(result, i) in item.value" :key="i" @click="resultBtn(item, index, i,1)"  style="cursor: pointer;">
+                  {{ result.show }}
+                  <i v-if="item.value.length > 1" class="el-icon-close"></i>
+                  <b v-if="item.value.length - 1 > i"> OR </b>
+                </span>
                 <span>)</span>
-                <!-- <span>({{ item.result.join(' OR ') }})</span> -->
-              </template>
-              <template v-else>
-                <span @click="resultBtn(item, index, 0)" style="cursor: pointer;">({{ item.inputValue }})<i
-                    class="el-icon-close"></i></span>
+                <span @click="resultBtn(item, index, 0,2)" style="cursor: pointer;"><i class="el-icon-close"></i></span>
               </template>
             </div>
           </div>
@@ -158,55 +146,17 @@ export default {
   },
   methods: {
     // 点击检索式中的检索条件
-    resultBtn(item, index, i) {
-      if (Array.isArray(item.inputValue)) {
-        item.inputValue.splice(i, 1)
-        var field = ''
-        if(item.filedKind == 0){
-          field = 'checkName'
-        }else{
-          field = 'checkData'
-        }
-       
-        if (this.searchStorageText[index].inputValue.length == 0) {
-          this.searchStorageText.splice(index, 1)
-          let spliceName = ''
-          if (item.dele == 'storage') {
-            spliceName = 'searchStorage'
-          } else {
-            spliceName = 'searchPatentCheck' 
-          }
-          let b = this[spliceName].findIndex(itemFind => {
-            return itemFind[field] == item[field]
-          })
-          if(b!=-1){
-            this[spliceName].splice(b, 1)
-          }
-          
-        }
-        if (item.checkData && item.checkData.length > 0) {//统计自定义字段
-          item.checkData.splice(i, 1)
-          if(item.checkName){
-            item.checkName.splice(i, 1)
-          }
-        }
-      } else {
-        let spliceName = ''
-        if (item.dele == 'storage') {
-          spliceName = 'searchStorage'
-        } else {
-          spliceName = 'searchPatentCheck'
+    resultBtn(item, index, i,type) {
+      if(type ==2){
+        this.searchStorageText.splice(index,1)
+      }else if(type == 1){
+        var obj = this.searchStorageText[index]
+        obj.value.splice(i,1)
+        if(obj.value.length == 0){
+          this.searchStorageText.splice(index,1)
         }
-        let a = this[spliceName].findIndex(itemFind => {
-          return itemFind.inputValue == item.inputValue
-        })
-        if (a != -1) {
-          this[spliceName].splice(a, 1)
-        }
-        this.searchStorageText.splice(index, 1)
-        this.searchStr = ''
       }
-      this.search2()
+      this.search2(1)
     },
     // cascader变化事件
     cascaderChange(val) {
@@ -248,44 +198,53 @@ export default {
     // 存储条件
     storage() {
       this.isControl.inputValue = this.inputValue
-      let isControl = JSON.parse(JSON.stringify(this.isControl))
-      this.searchStorage.push(isControl)
-
-    },
-    getSearchOptionData() {
-      var data = []
-      this.searchStorage.forEach(item => {
-        data.push(
-          {
-            label: item.label,
-            value: item.value,
-            inputValue: item.inputValue,
-            type: item.type,
-            group: item.group,
-            dele: 'storage',
+      console.log(this.isControl)
+      var obj = {
+        field:{
+          search:this.isControl.value,
+          show:this.isControl.label,
+          group:this.isControl.group
+        },
+        value:[],
+        op:'='
+      }
+      if(typeof this.isControl.inputValue == 'object'){
+        var arr = this.isControl.inputValue
+        arr.forEach(item=>{
+          var show = item
+          if(this.typeStatus[this.isControl.selectCheck]){
+            var obj2 = this.typeStatus[this.isControl.selectCheck].find(item2=>{
+              return item2.value == item
+            })
+            if(obj2){
+              show = obj2.label
+            }
           }
-        )
-      })
-      this.searchPatentCheck.forEach(item => {
-        var type = 1
-        data.push(
+          obj.value.push(
+            {
+              search:item,
+              show:show
+            }
+          )
+        })
+      }else{
+        obj.value.push(
           {
-            label: item.name,
-            value: item.value,
-            inputValue: item.checkData.map(i=>i.value),
-            checkName: item.checkName,
-            checkData:item.checkData,
-            filedKind: item.filedKind,
-            type: item.type,
-            ifHaveChild:item.ifHaveChild,
-            group: item.filedKind == -1 ? 'nos' : 'customField',
-            groupBy:item.groupBy,
-            dele: 'patentCheck',
+            search:this.isControl.inputValue,
+            show:this.isControl.inputValue
           }
         )
-      })
-      this.searchStorageText = data
-      return data
+      }
+      this.searchStorageText.push(obj)
+
+    },
+    getSearchOptionData() {
+      if(this.searchPatentCheck && this.searchPatentCheck.length>0){
+        for(var i = 0;i<this.searchPatentCheck.length;i++){
+          this.searchStorageText.push(this.searchPatentCheck[i])
+        }
+        // this.searchPatentCheck.length = 0
+      }
     },
     // 页面检索按钮
     search() {
@@ -298,91 +257,50 @@ export default {
         return
       }
       this.storage()
-      this.search2()
+      this.search2(1)
     },
-    search2() {
-      this.getSearchOptionData()
-      // return
+    search2(type) {
+      if(!type){
+        this.getSearchOptionData()
+      }
+      
       this.getSearchStorage()
     },
     // 处理检索条件
     getSearchStorage() {
+      this.searchStr = ''
       let customFields = []
       let count = 0
-      // console.log(this.searchStorageText)
-      this.searchStorageText.forEach((item, index) => {
-        var sign = '='
-        if(item.dele == 'patentCheck' && item.groupBy == 'company'){
-          sign = '≡'
-        }
-        if (item.group == 'nos') {
-          if (count == 0) {
-            count++
-            if (Array.isArray(item.inputValue)) {
-              var value = ''
-              item.inputValue.forEach((i,index)=>{
-                if(/\s/.test(i)){
-                  value += `"${i}"`
-                }else{
-                  value += i
-                }
-                if(index!= item.inputValue.length- 1){
-                  value += ' OR '
-                }
-              })
-              if(value){
-                this.searchStr = `${item.value} ${sign} (${value})`
-              }
-              
-            } else {
-              if(item.inputValue){
-                // var values = this.$commonJS.AddQuotationMarks(item.inputValue)
-                // this.searchStr = `${item.value} ${sign} (${values.join('')})`
-                this.searchStr = `${item.value} ${sign} (${item.inputValue})`
-              }
-              
-            }
-
-          } else {
-            count++
-            if (Array.isArray(item.inputValue)) {
-              var value = ''
-              item.inputValue.forEach((i,index)=>{
-                if(/\s/.test(i)){
-                  value += `"${i}"`
-                }else{
-                  value += i
-                }
-                if(index!= item.inputValue.length - 1){
-                  value += ' OR '
-                }
-              })
-              if(value){
-                this.searchStr += ` AND ${item.value} ${sign} (${value})`
-              }
-              
-            } else {
-              if(item.inputValue){
-                // var values = this.$commonJS.AddQuotationMarks(item.inputValue)
-                // this.searchStr += ` AND ${item.value} ${sign} (${values.join('')})`
-                this.searchStr += ` AND ${item.value} ${sign} (${item.inputValue})`
-              }
-              
-            }
+      this.searchStorageText.forEach(item=>{
+        console.log(item)
+        if(item.field.group == 'nos' || item.field.filedKind == -1){
+          var front = ''
+          if(count!=0){
+            front = ' AND '
+          }else{
+            count ++ 
           }
-        } else {
+          var value = ''
+          if(item.op == '≡'){
+            value = item.value.map(value=>`"${value.search}"`).join(" OR ")
+          }else if(item.op == '='){
+            value = item.value.map(value=>value.search).join(" OR ")
+          }
+            this.searchStr += `${front}${item.field.search} ${item.op} (${value})`
+          
+        }else{
           let a = {
-            fieldId: item.value,
-            fieldValue: (item.filedKind == 0 || item.filedKind) ? item.inputValue : [this.inputValue],
+            fieldId: item.field.search,
+            fieldValue: item.value.map(value=>value.search),
             ifHaveChild:item.ifHaveChild
           }
           customFields.push(a)
         }
       })
-      if (this.searchStorageText.length==0) {
-        this.searchStr = ''
-      }
       this.$emit('searchValue', { searchStr: this.searchStr, customFields: customFields, })
+
+      return
+     
     },