Browse Source

专利的检索

zhuhao 1 year ago
parent
commit
8438e3fbc5

+ 12 - 3
src/api/newApi/common.js

@@ -157,9 +157,9 @@ export default {
   * @param {*} data 
   * @returns 
   */
-  esCountSearch(data) {
-    return axios.post("/xiaoshi/patent/esCountSearch", data);
-  },
+  // esCountSearch(data) {
+  //   return axios.post("/xiaoshi/patent/esCountSearch", data);
+  // },
   /**
   * 获取检索栏位
   * @param {*} data 
@@ -208,5 +208,14 @@ export default {
   setShowCountColumns(data) {
     return axios.post("/xiaoshi/personField/setShowCountColumns", data);
   },
+  /**
+  * 获取统计数据
+  * @param {*} data 
+  * @returns 
+  */
+  esCountAnalysis(data) {
+    return axios.post("/xiaoshi/patent/esCountAnalysis", data);
+  },
+
 
 };

+ 1 - 2
src/utils/model/retrieval/search.vue

@@ -99,7 +99,7 @@ export default {
       value: null,
       field: {},
       searchOptions: [],
-      innerChange:false
+      innerChange: false
     };
   },
   watch: {
@@ -112,7 +112,6 @@ export default {
     searchValue: {
       deep: true,
       handler(n, o) {
-        console.log(this.SearchFields);
         if (!this.inner) {
           this.getSearchOptions()
         } else {

+ 7 - 4
src/views/components/dialog/fields.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-dialog custom-class="myFields" title="显示栏位管理" :visible.sync="dialogVisible" width="300px"
+    <el-dialog custom-class="myFields" :title="sign?'筛选字段':'显示栏位管理'" :visible.sync="dialogVisible" width="300px"
       :before-close="handleClose" :close-on-click-modal="false" :append-to-body="true">
       <div>
         <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
@@ -123,13 +123,16 @@ export default {
         })
       }
       this.loading = true
-      console.log(params, apiItem);
-      console.log(apiItem);
       this.$api[apiItem](params).then((response) => {
         if (response.code == 200) {
           this.loading = false
           this.handleClose()
-          this.$emit('getFieldList', this.filedList)
+          if (this.sign) {
+            this.$emit('getFieldList', params.value)
+          } else {
+            this.$emit('getFieldList', this.filedList)
+          }
+          
         }
       }).catch(error => {
         this.loading = false

+ 0 - 333
src/views/report/components/patentList/components/customFields.vue

@@ -1,333 +0,0 @@
-<template>
-  <div class="patent-tree-filter">
-    <el-container>
-      <el-header class="basic_header">
-        <el-tabs v-model="activeNameTabs" @tab-click="handleClick" type="card" style="width:100%">
-          <el-tab-pane v-for="item in menu" :key='item.path' :label="item.label" :name="item.path"></el-tab-pane>
-        </el-tabs>
-      </el-header>
-      <el-main>
-        <component :is="activeNameTabs" :projectId="projectId" :taskId="taskId" :field="field" :fieldTree="fieldTree"
-          @collapseChange="handleCollapse" @search="handleSearch">
-          <div slot="footerBtn">
-            <el-button type="primary" size="small" @click="handleMore">更多过滤项</el-button>
-          </div>
-        </component>
-      </el-main>
-    </el-container>
-
-    <fieldsVue ref="fieldsVue" type="patent" :projectId="projectId" :taskId="taskId" :sign="true"
-      @getFieldList="getFieldList"></fieldsVue>
-  </div>
-</template>
-
-<script>
-import queryPage from './tab1.vue'
-import selectPage from './tab2.vue'
-import fieldsVue from '@/views/components/dialog/fields.vue'
-export default {
-  props: {
-    projectId: {
-      default: null
-    },
-    taskId: {
-      default: null
-    },
-  },
-  components: {
-    queryPage,
-    selectPage,
-    fieldsVue,
-  },
-  data() {
-    return {
-      activeNameTabs: 'queryPage',
-      menu: [
-        {
-          label: '查询筛选',
-          path: 'queryPage'
-        },
-        {
-          label: '分类选择',
-          path: 'selectPage'
-        },
-      ],
-      // 存放数据
-      field: [],
-      fieldTree: [],
-      // 勾选的数据
-      valObj: {
-        valueOne: '',
-        valueTwo: '',
-      },
-      // 总数据
-      customFields: [],
-      // 是否重新创建dom
-      ifShow: true,
-      // 所有的统计栏位
-      filedAll: [],
-    }
-  },
-  watch: {
-
-  },
-  async mounted() {
-    // 获取显示的统计栏位
-    await this.getShowCountColumns()
-    // 获取所有统计栏位的数据
-    this.getAllCountColumns()
-  },
-  methods: {
-    // 点击面板中的搜索
-    handleSearch({ row, }) {
-      this.getShowCountColumns(row)
-      this.getAllCountColumns(row)
-    },
-    // 点击当前面板
-    async handleCollapse({ row, sign}) {
-      if (row.filedKind == -1) {//专利著录//调用专利著录的统计接口?
-
-      } else if (row.filedKind == 0) {//调用查询自定义字段选项
-        await this.queryCustomOption(row ,sign)
-        this.$nextTick(() => {
-          this.esCountSearch(row)
-        })
-      } else {
-
-      }
-    },
-    // 查询自定义栏位选项数据
-    async queryCustomOption(row,sign) {
-      let params = {
-        customFieldId: row.value,
-      }
-      await this.$api.queryCustomOption(params).then(response => {
-        if (response.code == 200) {
-          if (sign == 'check') {
-            this.$set(row, 'options', response.data.data)
-          } else {
-            this.$set(row, 'child', response.data.data)
-          }
-          this.$set(row,'check',[])
-        }
-      }).catch(error => {
-
-      })
-    },
-    // 获取统计数字
-    esCountSearch(val,sign) {
-      let params = [{
-        field: 'field',
-        fieldId: val.value,
-        valueOne: this.valObj.valueOne || '',
-        valueTwo: this.valObj.valueTwo || '',
-      }]
-      this.$api.esCountSearch(params).then(response => {
-        if (response.code == 200) {
-          this.$set(val, 'nums', response.data.detailDTOS)
-          this.refresh()
-        }
-      }).catch(error => {
-        this.$set(val, 'nums', [])
-      })
-    },
-    // 获取所有的统计栏位
-    getAllCountColumns() {
-      let params = {
-        projectId: this.projectId,
-        taskId: this.taskId,
-      }
-      this.$api.getAllCountColumns(params).then(res => {
-        if (res.code == 200) {
-          this.handleFiled(res.data.data)
-        }
-      })
-    },
-    // 给数据添加ifHidden
-    handleFiled(data) {
-      for (var i = 0; i < data.length; i++) {
-        data[i].ifHidden = true
-        if (data[i].filedKind != -1 && data[i].filedKind != 0) {
-          continue;
-        }
-        for (var j = 0; j < this.field.length; j++) {
-          if (data[i].name == this.field[j].name && data[i].filedKind == this.field[j].filedKind) {
-            data[i].ifHidden = false
-            break;
-          }
-        }
-      }
-      // 查询筛选:只展示非树类型
-      this.filedAll = data.filter(item => {
-        if (item.filedKind == -1 || (item.filedKind == 0 && item.type != 'tree')) {
-          return item
-        }
-      })
-      // 分类选择:获取树类型
-      this.fieldTree = data.filter(item2 => {
-        if ([7, 8, 9].includes(item2.filedKind) || (item2.filedKind == 0 && item2.type == 'tree')) {
-          return item2
-        }
-      })
-    },
-    // 获取显示的统计栏位
-    async getShowCountColumns() {
-      let params = {
-        projectId: this.projectId,
-        taskId: this.taskId,
-      }
-      await this.$api.getShowCountColumns(params).then(res => {
-        if (res.code == 200) {
-          //filedKind-1专利著录 0自定义字段 7产品 8产品类别 9技术分类
-          var data = res.data.data
-          // 查询筛选:获取非树类型
-          this.field = data.filter(item => {
-            if (item.filedKind == -1 || (item.filedKind == 0 && item.type != 'tree')) {
-              return item
-            }
-          })
-        }
-      })
-    },
-    // 过滤组件传的值
-    getFieldList(val) {
-      this.getShowCountColumns()
-      this.getAllCountColumns()
-    },
-    // 更多过滤项
-    handleMore() {
-      this.$refs.fieldsVue.open(this.filedAll)
-    },
-  }
-}
-</script>
-
-<style lang="scss">
-.patent-tree-filter {
-  height: 100%;
-
-  .patent-tree-filter-main {
-    height: 100%;
-    padding: 10px 0;
-
-    .no-data {
-      text-align: center;
-      color: #6b6868;
-    }
-  }
-
-  .change-show-type {
-    font-size: 13px;
-
-    .change-show-type-info {
-      color: #6b6868;
-      padding-left: 10px;
-    }
-
-    .el-form-item__label {
-      padding: 0 !important;
-      line-height: 20px;
-    }
-
-    .el-form-item__content {
-      height: 30px;
-      line-height: 30px;
-    }
-  }
-}
-
-.patent-query-filter-search {
-  display: flex;
-}
-
-.patent-query-filter-search-input {
-  margin-right: 5px;
-}
-
-.patent-query-filter-search-bottom {
-  text-align: center;
-  margin-top: 10px;
-}
-
-.year-data-picker {
-  width: 200px;
-  display: flex;
-  justify-content: space-between;
-
-  .el-input__prefix {
-    display: none;
-  }
-
-  .el-input__inner {
-    padding: 10px;
-    text-align: center;
-  }
-}
-
-.year-data-input {
-  width: 100px;
-}
-
-.source-checkbox {
-  margin-top: 10px;
-
-  span {
-    display: inline-block;
-    font-size: 13px;
-  }
-
-  .el-checkbox {
-    display: block;
-  }
-
-  .el-checkbox__label {
-    position: relative;
-    top: 5px;
-  }
-
-  .source-checkbox-count {
-    color: #409EFF;
-    position: relative;
-    top: -4px;
-    left: 10px;
-  }
-
-  .source-checkbox-label {
-    max-width: 190px;
-    padding-left: 5px;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-  }
-}
-
-.query-read-status {
-  font-size: 12px;
-  height: 25px;
-  line-height: 25px;
-  cursor: pointer;
-  background: #dcdcdc;
-  border-radius: 3px;
-  padding: 0 5px;
-
-  span {
-    display: inline-block;
-  }
-
-  .a {}
-
-  .b {
-    text-align: center;
-    width: 30px;
-  }
-
-  .c {
-    padding-left: 5px;
-  }
-}
-
-.query-read-status_is-active {
-  background: #409EFF !important;
-  color: #ffffff !important;
-}
-</style>

+ 34 - 0
src/views/report/components/patentList/components/customFields/components/mixins/index.js

@@ -0,0 +1,34 @@
+export default {
+  props: {
+
+  },
+  data() {
+    return {
+      activeNames: [],
+      
+    }
+  },
+  watch: {
+
+  },
+  methods: {
+    // 点击面板
+    handleChange(data, type) {
+      var item = data[data.length - 1]
+      this.$emit('collapseClick', item, this.activeNames, type)
+    },
+    // 处理专利文件数字
+    getCount(field, value) {
+      var num = 0
+      if (field.nums) {
+        var obj = field.nums.find(item => {
+          return item.name == value
+        })
+        if (obj) {
+          num = obj.number
+        }
+        return num
+      }
+    },
+  },
+}

+ 226 - 0
src/views/report/components/patentList/components/customFields/components/tab1.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="customFieldsTab1 height_100">
+    <el-container>
+      <el-main class="" style="overflow-y: auto;">
+        <template v-if="field.length > 0">
+          <el-collapse v-model="activeNames" @change="handleChange" style="margin: 0px 5px 0px 5px;">
+
+            <el-collapse-item v-for="item in field" :title="item.name" :name="item.value + 'a' + item.filedKind"
+              :key="item.value">
+
+              <!-- 自定义字段 -->
+              <template v-if="item.filedKind != -1">
+                <div style="display:flex;margin-bottom: 10px;">
+                  <div v-if="['Integer', 'DateTime'].includes(item.type)" class="year-data-picker">
+                    <template v-if="item.type == 'DateTime'">
+                      <el-date-picker clear-icon v-model="item.valueOne" size="small" type="year" value-format="yyyy"
+                        placeholder="请选择时间"></el-date-picker>
+                      <span style="margin: 5px;">至</span>
+                      <el-date-picker clear-icon v-model="item.valueTwo" size="small" type="year" value-format="yyyy"
+                        placeholder="请选择时间"></el-date-picker>
+                    </template>
+                    <template v-else>
+                      <el-input size="small" v-model="item.valueOne" placeholder="请输入"></el-input>
+                      <span style="margin: 5px;">至</span>
+                      <el-input size="small" v-model="item.valueTwo" placeholder="请输入"></el-input>
+                    </template>
+                    <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
+                      icon="el-icon-search" circle></el-button>
+                  </div>
+                </div>
+                <el-checkbox-group v-model="item.check" @change="onChange">
+                  <div class="source-checkbox">
+                    <el-checkbox v-for="source in item.options" :label="source.id" :key="source.id">
+                      <el-tooltip :content="source.name" placement="top" effect="light">
+                        <span class="source-checkbox-label text" :title="source.name">{{ source.name }}</span>
+                      </el-tooltip>
+                      <!-- <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span> -->
+                      <span v-if="source.id" class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
+                      <span v-else class="source-checkbox-count">({{ source.number }})</span>
+                    </el-checkbox>
+                  </div>
+                </el-checkbox-group>
+              </template>
+
+              <!-- 专利本身 -->
+              <template v-else>
+                <div v-if="['IPC', 'CPC', 'UPC', 'LOC'].includes(item.value)" style="margin-bottom: 10px;">
+                  <el-select v-model="item.select" @change="selectChange($event, item)" placeholder="请选择" size="small">
+                    <el-option v-for="item in special[item.value]" :key="item.value" :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </div>
+                <div style="display: flex;align-items: center;">
+                  <template v-if="item.type == 'DateTime'">
+                    <el-date-picker clear-icon v-model="item.valueOne" size="small" type="year" value-format="yyyy"
+                      placeholder="请选择时间"></el-date-picker>
+                    <span style="margin: 5px;">至</span>
+                    <el-date-picker clear-icon v-model="item.valueTwo" size="small" type="year" value-format="yyyy"
+                      placeholder="请选择时间"></el-date-picker>
+                  </template>
+                  <template v-else>
+                    <el-input size="small" v-model="item.valueOne" placeholder="请输入内容"></el-input>
+                  </template>
+                  <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
+                    icon="el-icon-search" circle></el-button>
+                </div>
+                <el-checkbox-group v-model="item.check" @change="onChange">
+                  <div class="source-checkbox">
+                    <el-checkbox v-for="source in item.options" :label="source.name" :key="source.name">
+                      <el-tooltip :content="source.name" placement="top" effect="light">
+                        <span class="source-checkbox-label text" :title="source.name">{{ source.name }}</span>
+                      </el-tooltip>
+                      <span class="source-checkbox-count">({{ source.number }})</span>
+                    </el-checkbox>
+                  </div>
+                </el-checkbox-group>
+              </template>
+
+              <div class="patent-query-filter-search-bottom">
+                <el-button type="success" size="small" @click.stop="handleSelectAll(item)">全选</el-button>
+                <el-button type="danger" size="small" @click.stop="handleSelectCancel(item)">取消</el-button>
+                <el-button v-if="item.allNumber > item.topN" type="primary" size="small"
+                  @click.stop="handleLoading(item)">加载更多</el-button>
+              </div>
+            </el-collapse-item>
+          </el-collapse>
+        </template>
+        <template v-else>
+          <div>暂无数据</div>
+        </template>
+      </el-main>
+      <!-- <el-footer style="display: flex;align-items: center;justify-content: end;">
+        <slot name="footerBtn"></slot>
+
+      </el-footer> -->
+    </el-container>
+
+  </div>
+</template>
+
+<script>
+import mixins from './mixins/index'
+export default {
+  mixins: [mixins],
+  props: {
+    field: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+  },
+  components: {
+
+  },
+  data() {
+    return {
+      // 专利IPC/CPC/UPC/LOC的选项
+      special: {
+        IPC: [
+          { value: 'ipcLevel1', label: '部' },
+          { value: 'ipcLevel2', label: '大类' },
+          { value: 'ipcLevel3', label: '小类' },
+          { value: 'ipcLevel4', label: '大组' },
+          { value: 'ipcLevel5', label: '小组' },
+        ],
+        CPC: [
+          { value: 'cpcLevel1', label: '部' },
+          { value: 'cpcLevel2', label: '大类' },
+          { value: 'cpcLevel3', label: '小类' },
+          { value: 'cpcLevel4', label: '大组' },
+          { value: 'cpcLevel5', label: '小组' },
+        ],
+        UPC: [
+          // { value: '0', label: '分类号' },//老系统有
+          { value: 'upcLevel1', label: '大类' },
+          { value: 'upcLevel2', label: '小类' },
+        ],
+        LOC: [
+          // { value: '0', label: '分类号' },//老系统有
+          { value: 'locLevel1', label: '大类' },
+          { value: 'locLevel2', label: '小类' },
+        ],
+      },
+    }
+  },
+  watch: {
+
+  },
+  mounted() {
+
+  },
+  methods: {
+    //  专利IPC/CPC/UPC/LOC的选项变化
+    selectChange(val, data) {
+      this.$emit('selectChange', { val: val, data: data })
+    },
+
+    // 点击折叠面板中的搜索
+    handleSearch(row) {
+      if (row.filedKind == 0) {
+        if (row.valueOne && row.valueTwo) {
+          this.$emit('search', row)
+        } else {
+          this.$message.error('请输入完整的搜索范围')
+          return
+        }
+      } else {
+        this.$emit('search', row)
+      }
+
+    },
+
+    // 选中的数据
+    onChange(data, field) {
+      // console.log(data, field);
+      // var obj = {
+      //   fieldId: field.value,
+      //   fieldType: field.fieldType,
+      //   value: [],
+      //   isStatistic: true,
+      // }
+      // let arr = []
+      // arr.push(obj)
+      // this.$emit('customTab', arr)
+      // console.log(obj);
+    },
+    // 全选
+    handleSelectAll(val) {
+      if (val.id) {//自定义字段的全选
+        val.check = val.options.map(item => {
+          return item.id
+        })
+      } else {//专利本身的全选,没有id
+        val.check = val.options.map(item => {
+          return item.name
+        })
+      }
+
+    },
+    // 取消
+    handleSelectCancel(val) {
+      val.check = []
+    },
+    // 加载更多
+    handleLoading(val) {
+      this.$emit('handleLoading', val)
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.customFieldsTab1 {
+  .text {
+    /* 超出10个字隐藏,之所以设置11em是因为省略号占一个位置 */
+    max-width: 11em;
+    overflow: hidden;
+    /* 显示省略符号来代表被修剪的文本。 */
+    text-overflow: ellipsis;
+    /* 文本不换行 */
+    white-space: nowrap;
+  }
+}
+</style>

+ 94 - 0
src/views/report/components/patentList/components/customFields/components/tab2.vue

@@ -0,0 +1,94 @@
+<template>
+  <div>
+    <template v-if="fieldTree.length > 0">
+      <template>
+        <div style="margin-bottom: 10px;">
+          <span style="font-size: 14px;">开启关联模式</span>
+          <el-switch style="display: block" v-model="ifHaveChild" active-color="#13ce66" inactive-color="#ff4949"
+            active-text="描述:主分类包含子分类" inactive-text="" @change="switchChange">
+          </el-switch>
+        </div>
+      </template>
+      <div>
+        <el-collapse v-model="activeNames" @change="handleChange($event, 2)" style="margin: 0px 5px 0px 5px;">
+          <el-collapse-item v-for="item in fieldTree" :title="item.name" :name="item.value + 'a' + item.filedKind"
+            :key="item.value">
+            <div v-if="ifShow">
+              <el-tree @check-change="onChangeTree($event, item)" :ref="item.value" :data="item.options" node-key="id"
+                check-strictly default-expand-all :props="{ children: 'child', label: 'name' }">
+                <span class="custom-tree-node" slot-scope="{ node, data }">
+                  <el-checkbox-group v-model="item.check">
+                    <el-checkbox :label="data.id">{{ data.name }}({{ getCount(item, data.id) }})</el-checkbox>
+                  </el-checkbox-group>
+                </span>
+              </el-tree>
+            </div>
+
+          </el-collapse-item>
+        </el-collapse>
+      </div>
+
+    </template>
+    <template v-else>
+      <div>暂无数据</div>
+    </template>
+  </div>
+</template>
+
+<script>
+import mixins from './mixins'
+export default {
+  mixins: [mixins],
+  props: {
+    fieldTree: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+  },
+  data() {
+    return {
+      ifShow: true,
+      // 是否关联子分类false不关联,true关联
+      ifHaveChild: false,
+    }
+  },
+  watch: {
+    // fieldTree: {
+    //   handler() {
+    //     this.ifShow = false
+    //     this.$nextTick(() => {
+    //       this.ifShow = true
+    //     })
+    //   },
+    //   deep: true
+    // }
+  },
+  mounted() {
+
+  },
+  methods: {
+    switchChange(val) {
+      this.$emit('switchChange', val)
+    },
+
+    // 选中的值
+    onChangeTree(data, field) {//当前节点的数据,当前栏位的数据 
+      // console.log(data, field);
+      // var obj = {
+      //   fieldId: field.value,
+      //   fieldType: field.fieldType,
+      //   value: [],
+      //   isStatistic:true,
+      // }
+      // let arr = []
+      // arr.push(obj)
+      // this.$emit('customTab',arr)
+      // console.log(obj);
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 520 - 0
src/views/report/components/patentList/components/customFields/index.vue

@@ -0,0 +1,520 @@
+<template>
+  <div class="patent-tree-filter">
+    <el-container>
+      <el-header class="basic_header">
+        <el-tabs v-model="activeNameTabs" type="card" style="width:100%">
+          <el-tab-pane v-for="item in menu" :key='item.path' :label="item.label" :name="item.path"></el-tab-pane>
+        </el-tabs>
+      </el-header>
+      <el-main>
+        <component :is="activeNameTabs" v-on="$listeners" :field="field" :activeName.sync="activeName"
+          :fieldTree="fieldTree" @collapseClick="handleCollapse" @search="handleSearch" @handleLoading="handleLoading"
+          @switchChange="switchChange" @selectChange="selectChange">
+          <!-- <div slot="footerBtn">
+            <el-button type="primary" size="small" @click="handleMore">更多过滤项</el-button>
+          </div> -->
+        </component>
+      </el-main>
+      <el-footer>
+        <div style="display: flex;align-items: center;justify-content: end;">
+          <el-button type="primary" size="small" v-if="activeNameTabs == 'queryPage'"
+            @click="handleMore">更多过滤项</el-button>
+          <el-button type="primary" size="small" @click="sure">确认</el-button>
+        </div>
+
+      </el-footer>
+    </el-container>
+
+    <fieldsVue ref="fieldsVue" type="patent" :projectId="projectId" :taskId="taskId" :sign="true"
+      @getFieldList="getFieldList"></fieldsVue>
+  </div>
+</template>
+
+<script>
+import queryPage from './components/tab1.vue'
+import selectPage from './components/tab2.vue'
+import fieldsVue from '@/views/components/dialog/fields.vue'
+export default {
+  props: {
+    projectId: {
+      default: null
+    },
+    taskId: {
+      default: null
+    },
+    // 检索条件
+    searchOption: {
+      default: () => {
+        return ''
+      }
+    },
+    // 自定义栏位检索条件
+    customFields: {
+      default: () => {
+        return []
+      }
+    },
+  },
+  components: {
+    queryPage,
+    selectPage,
+    fieldsVue,
+  },
+  data() {
+    return {
+      activeNameTabs: 'queryPage',
+      menu: [
+        {
+          label: '查询筛选',
+          path: 'queryPage'
+        },
+        {
+          label: '分类选择',
+          path: 'selectPage'
+        },
+      ],
+      // 存放数据非树
+      field: [],
+      // 存放数据树
+      fieldTree: [],
+      // 所有的统计栏位
+      filedAll: [],
+
+      //已打开过的折叠面板
+      activeName: [],
+      //正在打开的折叠面板
+      activeName2: [],
+      // 树不关联模式
+      ifHaveChild: false,
+    }
+  },
+  watch: {
+
+  },
+  async mounted() {
+    // 获取显示的统计栏位
+    await this.getShowCountColumns()
+    // 获取所有统计栏位的数据
+    this.getAllCountColumns()
+  },
+  methods: {
+    // 树点击不关联模式
+    async switchChange(val) {
+      this.ifHaveChild = val
+      for (let i = 0; i < this.activeName.length; i++) {
+        var row = this.fieldTree.find(item => {
+          return item.value + 'a' + item.filedKind == this.activeName[i]
+        })
+        await this.getOptions(row)
+      }
+    },
+    // ipc、cpc、loc、upc切换选择
+    selectChange({val:val,data:data}) {
+      this.getOptions(data)
+    },
+    // 点击面板中的搜索
+    handleSearch(row) {
+      this.getOptions(row)
+    },
+    // 点击当前面板
+    async handleCollapse(current, data, type) {
+      this.activeName = [...new Set(this.activeName.concat(data))]
+      if (current && this.activeName2.indexOf(current) == -1) {
+        this.activeName2.push(current)
+        var currentField = this.filedAll
+        if (type == 2) {
+          currentField = this.fieldTree
+        }
+        var row = currentField.find(item => {
+          return item.value + 'a' + item.filedKind == current
+        })
+        // 设置ipc、cpc、loc、upc选择
+        this.getSelect(row)
+        await this.getOptions(row)
+      }
+    },
+    //获取选项
+    async getOptions(row) {
+      if (row) {
+        if (row.filedKind != -1 && (row.type == 'Array' || row.type == 'tree')) {
+          switch (row.filedKind + '') {
+            case '0':
+              await this.queryCustomOption(row)
+              break;
+            case '7':
+              await this.queryProductCategory(row, 2)
+              break;
+            case '8':
+              await this.queryProductCategory(row, 1)
+              break;
+            case '9':
+              await this.queryProductCategory(row, 3)
+              break;
+          }
+        }
+        //查统计todo统计接口
+        this.esCountAnalysis(row)
+      }
+    },
+    esCountAnalysis(row) {
+      var countVOS = []
+      if (row.filedKind == -1) {//专利本身栏位(专利著录)
+        let value = ['IPC','CPC','UPC','LOC'].includes(row.value) ? row.select : row.value
+        countVOS = [
+          {
+            field: value,
+            valueOne: row.valueOne,
+            valueTwo: row.valueTwo,
+            topN: row.topN,
+            // fieldType: row.type
+          }
+        ]
+      } else {//
+        countVOS = [
+          {
+            field: 'field',
+            fieldId: row.value,
+            valueOne: row.valueOne,
+            valueTwo: row.valueTwo,
+            topN: row.topN,
+            ifHaveChild: row.type == 'tree' ? this.ifHaveChild : false,
+            fieldType: row.type
+          },
+        ]
+      }
+
+      let params = {
+        condition: this.searchOption || '',//检索条件
+        projectId: this.projectId,//项目id
+        taskId: this.taskId,//任务id
+        countVOS: countVOS,//栏位的聚合入参
+        customFields: this.customFields,//自定义栏位查询
+        // valueOne: row.valueOne,//搜索第一个栏位的值
+        // valueTwo: row.valueTwo,//搜索第二个栏位的值
+        // topN: row.topN,//显示条数
+        // ifHaveChild: this.ifHaveChild,//是否开启不关联模式
+      }
+      this.$api.esCountAnalysis(params).then(res => {
+        if (res.code == 200) {
+          var data = []
+          if (row.type != 'tree') {
+            data = this.field
+          } else {
+            data = this.fieldTree
+          }
+          var index = data.findIndex(item => {
+            return item.value == row.value && item.filedKind == row.filedKind
+          })
+          if (index != -1) {//非专利本身搜索字段
+            if (data[index].filedKind != -1 && (data[index].type == 'Array' || data[index].type == 'tree')) {
+              data[index].nums = []
+              for (let i = 0; i < res.data.detailDTOS.length; i++) {
+                if (!isNaN(parseInt(res.data.detailDTOS[i].name))) {
+                  data[index].nums.push(res.data.detailDTOS[i])
+                } else {
+                  data[index].options.push(res.data.detailDTOS[i])
+                }
+              }
+            } else {//专利本身搜索字段
+              this.$set(data[index], 'options', res.data.detailDTOS)
+            }
+            this.$set(data[index], 'check', [])
+            this.$set(data[index], 'allNumber', res.data.allNumber)
+            this.$set(data[index], 'topN', res.data.topN)
+          }
+        }
+      })
+    },
+    // 查询自定义栏位选项数据
+    async queryCustomOption(row) {
+      let params = {
+        customFieldId: row.value,
+      }
+      await this.$api.queryCustomOption(params).then(response => {
+        if (response.code == 200) {
+          var data = []
+          if (row.type != 'tree') {
+            data = this.field
+          } else {
+            data = this.fieldTree
+          }
+          var index = data.findIndex(item => {
+            return item.value == row.value && item.filedKind == row.filedKind
+          })
+          if (index != -1) {
+            this.$set(data[index], 'options', response.data.data)
+            this.$set(data[index], 'check', [])
+          }
+        }
+      }).catch(error => {
+        this.$set(row, 'option', [])
+        this.$set(row, 'check', [])
+      })
+    },
+    //获取产品或产品类别架构以及技术分类
+    async queryProductCategory(item, type) {
+      let params = {
+        projectId: this.projectId,
+        taskId: this.taskId,
+        type: type,//类型:1产品类别,2产品,3技术分类,4自定义树
+        typeId: item.value,//产品或类别id
+      }
+      await this.$api.queryTreeNodeTree(params).then(res => {
+        if (res.code == 200) {
+          if (row.type != 'tree') {
+            var index = this.fieldTree.findIndex(item => {
+              return item.value == row.value && item.filedKind == row.filedKind
+            })
+            if (index != -1) {
+              this.$set(this.fieldTree[index], 'options', response.data.data)
+              this.$set(this.fieldTree[index], 'check', [])
+            }
+          }
+        }
+      }).catch(err => {
+        this.$set(row, 'option', [])
+        this.$set(row, 'check', [])
+      })
+    },
+
+    // 获取所有的统计栏位
+    getAllCountColumns() {
+      let params = {
+        projectId: this.projectId,
+        taskId: this.taskId,
+      }
+      this.$api.getAllCountColumns(params).then(res => {
+        if (res.code == 200) {
+          this.filedAll = []
+          var data = res.data.data
+          this.handleFiled(data)
+        }
+      })
+    },
+    // 给数据添加ifHidden
+    handleFiled(data) {
+      for (var i = 0; i < data.length; i++) {
+        // 分类选择:获取树类型
+        if ([7, 8, 9].includes(data[i].filedKind) || (data[i].filedKind == 0 && data[i].type == 'tree')) {
+          this.fieldTree.push(data[i])
+          continue;
+        }
+        data[i].ifHidden = true
+        if (data[i].filedKind != -1 && data[i].filedKind != 0) {
+          continue;
+        }
+        for (var j = 0; j < this.field.length; j++) {
+          if (data[i].name == this.field[j].name && data[i].filedKind == this.field[j].filedKind) {
+            data[i].ifHidden = false
+            break;
+          }
+        }
+        //获取非树(不包括数字、文本)
+        if (data[i].filedKind == 0 && (data[i].type == 'String' || data[i].type == 'Integer')) {
+
+        } else {
+          this.filedAll.push(data[i])
+        }
+
+      }
+    },
+
+    // 获取显示的统计栏位
+    async getShowCountColumns() {
+      let params = {
+        projectId: this.projectId,
+        taskId: this.taskId,
+      }
+      await this.$api.getShowCountColumns(params).then(res => {
+        if (res.code == 200) {
+          //filedKind-1专利著录 0自定义字段 7产品 8产品类别 9技术分类
+          var data = res.data.data
+          // 查询筛选:获取非树类型
+          this.field = data.filter(item => {
+            if (item.filedKind == -1 || (item.filedKind == 0 && item.type != 'tree')) {
+              return item
+            }
+          })
+          this.field.forEach(item => {
+            this.getSelect(item)
+          })
+        }
+      })
+    },
+    // 设置ipc、cpc、loc、upc默认值
+    getSelect(data) {
+      switch (data.value) {
+        case 'IPC':
+          this.$set(data, 'select', 'ipcLevel1')
+          break;
+        case 'CPC':
+          this.$set(data, 'select', 'cpcLevel1')
+          break;
+        case 'UPC':
+          this.$set(data, 'select', 'upcLevel1')
+          break;
+        case 'LOC':
+          this.$set(data, 'select', 'locLevel1')
+          break;
+
+        default:
+          break;
+      }
+    },
+    // 过滤组件传的值
+    getFieldList(val) {
+      // this.field = val//筛选字段没有更新
+      this.getShowCountColumns()
+      this.getAllCountColumns()
+    },
+
+    // 更多过滤项
+    handleMore() {
+      this.$refs.fieldsVue.open(this.filedAll)
+    },
+    //确认检索
+    sure() {
+      let field = JSON.parse(JSON.stringify(this.field))
+      let fieldTree = JSON.parse(JSON.stringify(this.fieldTree))
+      let arr = field.concat(fieldTree)
+      this.$emit('ifHaveChild', this.ifHaveChild)
+      this.$emit('customTab', arr)
+    },
+    // 加载更多
+    handleLoading(val) {
+      val.topN += 10
+      this.getOptions(val)
+    },
+  }
+}
+</script>
+
+<style lang="scss">
+.patent-tree-filter {
+  height: 100%;
+
+  .patent-tree-filter-main {
+    height: 100%;
+    padding: 10px 0;
+
+    .no-data {
+      text-align: center;
+      color: #6b6868;
+    }
+  }
+
+  .change-show-type {
+    font-size: 13px;
+
+    .change-show-type-info {
+      color: #6b6868;
+      padding-left: 10px;
+    }
+
+    .el-form-item__label {
+      padding: 0 !important;
+      line-height: 20px;
+    }
+
+    .el-form-item__content {
+      height: 30px;
+      line-height: 30px;
+    }
+  }
+}
+
+.patent-query-filter-search {
+  display: flex;
+}
+
+.patent-query-filter-search-input {
+  margin-right: 5px;
+}
+
+.patent-query-filter-search-bottom {
+  text-align: center;
+  margin-top: 10px;
+}
+
+.year-data-picker {
+  width: 200px;
+  display: flex;
+  justify-content: space-between;
+
+  .el-input__prefix {
+    display: none;
+  }
+
+  .el-input__inner {
+    padding: 10px;
+    text-align: center;
+  }
+}
+
+.year-data-input {
+  width: 100px;
+}
+
+.source-checkbox {
+  margin-top: 10px;
+
+  span {
+    display: inline-block;
+    font-size: 13px;
+  }
+
+  .el-checkbox {
+    display: block;
+  }
+
+  .el-checkbox__label {
+    position: relative;
+    top: 5px;
+  }
+
+  .source-checkbox-count {
+    color: #409EFF;
+    position: relative;
+    top: -4px;
+    left: 10px;
+  }
+
+  .source-checkbox-label {
+    max-width: 190px;
+    padding-left: 5px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+  }
+}
+
+.query-read-status {
+  font-size: 12px;
+  height: 25px;
+  line-height: 25px;
+  cursor: pointer;
+  background: #dcdcdc;
+  border-radius: 3px;
+  padding: 0 5px;
+
+  span {
+    display: inline-block;
+  }
+
+  .a {}
+
+  .b {
+    text-align: center;
+    width: 30px;
+  }
+
+  .c {
+    padding-left: 5px;
+  }
+}
+
+.query-read-status_is-active {
+  background: #409EFF !important;
+  color: #ffffff !important;
+}
+</style>

+ 51 - 20
src/views/report/components/patentList/components/index.vue

@@ -13,9 +13,10 @@
                     @click="showRight = !showRight"></i>
                 </el-tooltip>
               </div>
-              <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
-              </mySearch>
-              <!-- <searchPopover :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></searchPopover> -->
+              <!-- <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
+              </mySearch> -->
+              <searchPatent :searchFiled="searchFiled" :searchPatentCheck="searchPatentCheck"
+                @searchValue="handleSearchValue"></searchPatent>
             </div>
             <el-button v-if="taskId" type="primary" size="small" @click="handleFieldManage">显示栏位管理</el-button>
             <div v-else style="display:flex;align-items:center">
@@ -47,7 +48,8 @@
           </el-header>
           <el-main class="height_100">
             <component :is='components' :tableData="tableData" :column="fieldList" :projectId="projectId"
-              @on-sort="handleSort" :queryParams="queryParams" @clickPatentNo="handleClick"></component>
+              @on-sort="handleSort" :queryParams="queryParams" @clickPatentNo="handleClick"
+              @ifHaveChild="handleIfHaveChild"></component>
           </el-main>
           <el-footer class="pagination">
             <el-pagination background layout="total, sizes, prev, pager, next, jumper"
@@ -58,7 +60,8 @@
         </el-container>
       </div>
       <div class="height_100 right" v-show="showRight">
-        <customFields :projectId="projectId" :taskId="taskId" @customFields="handleCustomFields"></customFields>
+        <customFields :projectId="projectId" :taskId="taskId" :searchOption="searchOption" :customFields="customFields"
+          @customTab="handleCustomFields"></customFields>
       </div>
     </div>
 
@@ -69,8 +72,8 @@
 <script>
 import field from '@/views/components/dialog/fields.vue';
 import PatentTableListView from '@/views/project/patentCollection/components/views/Table.vue'
-import customFields from './customFields.vue';
-import searchPopover from './searchPopover.vue'
+import customFields from './customFields/index.vue';
+import searchPatent from './searchPatent.vue'
 export default {
   props: {
     taskId: {
@@ -96,7 +99,7 @@ export default {
     PatentTableListView,
     field,
     customFields,
-    searchPopover,
+    searchPatent,
   },
   data() {
     return {
@@ -125,6 +128,13 @@ export default {
       fieldList: [],
       // 存放自定义栏位的筛选数据
       customFields: [],
+      // 统计勾选的值(自定义字段)
+      statisticsCustom: [],
+      // 统计勾选的值(专利著录(专利本身))
+      searchPatentCheck: [],
+      // 分类选择是否关联子类
+      ifHaveChild: false,
+      // 
     }
   },
   computed: {},
@@ -134,10 +144,34 @@ export default {
     await this.getColumn()
   },
   methods: {
+    // 处理后的条件
+    handleSearchValue({ searchStr, customFields }) {
+      this.getList(searchStr,customFields)
+    },
+    // 树类型是否包括子分类
+    handleIfHaveChild(val) {
+      this.ifHaveChild = val
+    },
     // 统计组件传的值
     handleCustomFields(val) {
-      this.customFields = val
-      this.getList()
+      this.searchPatentCheck = []
+      val.forEach(item => {
+        if (item.check && item.check.length > 0) {
+          if (item.filedKind == -1) {
+            this.searchPatentCheck.push(item)
+
+          } else {
+            var obj = {
+              fieldId: item.value,
+              fieldType: item.fieldType,
+              filedKind: item.filedKind,
+              value: item.check,
+              ifHaveChild: this.ifHaveChild
+            }
+            this.searchPatentCheck.push(obj)
+          }
+        }
+      })
     },
     // 处理任务
     handleClick(row, location) {
@@ -192,7 +226,8 @@ export default {
             value: 'field',
             type: 'type',
             group: 'group',
-            fieldType:'fieldType'
+            fieldType: 'fieldType',
+            groupBy: 'groupBy',
           })
           // 处理自定义栏位筛选
           this.searchFiled = searchFiled.filter(item => {
@@ -206,13 +241,12 @@ export default {
     search(val) {
       let params = {}
       val.forEach(item => {
-        console.log(item)
         if (item.group != 'nos') {
           this.customFields = []
           var obj = {
             fieldId: item.value,
             fieldType: item.fieldType,
-            value:item.type=='3'?item.searchValue.map(id=>id.value):[item.searchValue.label]
+            value: item.type == '3' ? item.searchValue.map(id => id.value) : [item.searchValue.label]
           }
           this.customFields.push(obj)
         } else {
@@ -224,24 +258,21 @@ export default {
             params[item.value] = item.searchValue.label
           }
         }
-        
+
       })
       this.searchOption = params
       // 调用查询接口
       this.queryParams.current = 1
       this.getList()
     },
-    handleCustom(){
-      
-    },
     //获取专利列表
-    getList() {
+    getList(searchStr,customFields) {
       let params = {
         ...this.queryParams,//分页信息
         projectId: this.projectId,
         taskId: this.taskId,
-        searchQuery: this.$commonJS.objectToString(this.searchOption || {}),//检索条件
-        customFields: this.customFields,
+        searchQuery: searchStr || '',//检索条件
+        customFields: customFields || [],
         orderDTOList: this.sort,//排序信息
       }
       this.$api.QueryPatent(params).then(res => {

+ 329 - 0
src/views/report/components/patentList/components/searchPatent.vue

@@ -0,0 +1,329 @@
+<template>
+  <div style="width: 550px;">
+    <div style="display: flex;align-items: center;">
+      <el-cascader :options="options" @change="cascaderChange" :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" placeholder="请选择" size="small">
+          <el-option v-for="item in options" :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-button @click="lookSearch" type="text" size="">检索式</el-button>
+    </div>
+
+    <el-dialog title="查看/编辑检索式" :visible.sync="dialogVisible" width="800px" :before-close="handleClose">
+
+      <p><b>检索式专利检索</b><span style="margin-left:10px">[例: TI=计算机 ]</span></p>
+      <div>
+        <el-input type="textarea" :rows="4" readonly v-model="searchStr"></el-input>
+      </div>
+      <p><b>检索式自定义栏位检索</b><span style="margin-left:10px"></span></p>
+      <div>
+        <el-input type="textarea" :rows="4" readonly v-model="searchCustomStr"></el-input>
+      </div>
+
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="handleClose">取 消</el-button>
+        <el-button type="primary" @click="handleFinish">检 索</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import field from '@/api/field'
+export default {
+  props: {
+    // 所有的检索字段(包含自定义字段)
+    searchFiled: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    searchPatentCheck: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+  },
+  data() {
+    return {
+      // 级联面板数据源
+      options: [],
+      // 存储条件
+      searchStorage: [],
+      // 专利检索式
+      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小类' },
+        ],
+      },
+      // 控制检索式弹窗显示
+      dialogVisible: false,
+      // 选择的cascader
+      casString: null,
+      // 输入框的值
+      inputValue: '',
+      // 控制显示提示及select
+      isControl: {
+        placeholder: '请输入检索内容'
+      },
+    }
+  },
+  watch: {
+    searchFiled: {
+      deep: true,
+      handler() {
+        this.getGroup()
+      },
+    },
+    // 统计传过来的条件
+    searchPatentCheck: {
+      deep: true,
+      handler() {
+        this.storage2()
+      },
+    },
+  },
+  mounted() {
+
+  },
+  methods: {
+    // cascader变化事件
+    cascaderChange(val) {
+      this.isControl.placeholder = '请输入检索内容'
+      this.isControl.customField = false
+      if (val[0] == 'dateType') {
+        this.isControl.placeholder = '请输入日期(格式2020 ~ 2023)'
+      }
+      if (val[0] == 'customField') {
+        this.isControl.customField = true
+        let a = this.options.filter(item => {
+          return item.value == 'customField'
+        })
+        let b = a[0].children.filter(item => {
+          return item.value == val[1]
+        })
+        if (b && b[0].type == '2') {
+          this.isControl.placeholder = '请输入日期(格式2020 ~ 2023)'
+        }
+      }
+      if (val[0] == 'typeStatus') {
+        this.$set(this.isControl, 'select', true)
+      }
+      console.log(this.isControl);
+      this.casString = val[val.length - 1]
+    },
+    // 存储条件(统计)
+    storage2() {
+      console.log(this.searchPatentCheck);
+      if (this.searchPatentCheck.length > 0) {
+        let obj = {}
+        let data = this.searchPatentCheck
+        for (let i = 0; i < data.length; i++) {
+          if (data[i].filedKind == -1) {//统计专利本身栏位
+            obj = {
+              [data[i].value]: data[i].check.length > 1 ? `(${data[i].check.join(' OR ')})` : data[i].check[0]
+            }
+          } else {//统计自定义字段栏位
+            obj = {
+              fieldId: data[i].fieldId,
+              value: data[i].value,
+            }
+          }
+
+        }
+        this.searchStorage.push(obj)
+        this.getSearchStorage()
+        console.log(this.searchStorage);
+      }
+    },
+    // 存储条件
+    storage() {
+      let obj = {}
+      if (!this.isControl.customField) {//专利本身
+        obj = {
+          [this.casString]: this.inputValue.indexOf('OR') != -1 ? `(${this.inputValue})` : this.inputValue
+        }
+      } else {//自定义栏位
+        obj = {
+          fieldId: this.casString,
+          value: [this.inputValue],
+        }
+      }
+      this.searchStorage.push(obj)
+    },
+    // 页面检索按钮
+    search() {
+      this.storage()
+      this.getSearchStorage()
+    },
+    getSearchStorage() {
+      if (this.searchStorage.length > 0) {
+        let data = this.searchStorage
+        let customFields = []
+        for (let i = 0; i < data.length; i++) {
+          if (!data[i].fieldId) {//专利本身
+            if (i == 0) {
+              for (let k in data[i]) {
+                this.searchStr = `${k}=${data[i][k]}`
+              }
+            } else {
+              for (let k in data[i]) {
+                this.searchStr += ` AND ${k}=${data[i][k]}`
+              }
+            }
+          } else {//自定义栏位
+            customFields.push(data[i])
+          }
+        }
+        console.log(this.searchStr, customFields);
+        this.$emit('searchValue', { searchStr: this.searchStr, customFields: customFields, })
+      }
+    },
+    // 查看检索式
+    lookSearch() {
+      this.dialogVisible = true
+    },
+    // 弹窗检索按钮
+    handleFinish() {
+      this.handleClose()
+    },
+    // 关闭查看、编辑检索式弹窗
+    handleClose() {
+      this.dialogVisible = false
+    },
+    getGroup() {
+      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]]
+            }
+          }
+          // console.log(filedObj);
+        }
+      }
+      this.options = Object.values(filedObj)
+    },
+
+    search1() {
+      console.log(this.casString, this.inputValue);
+      if (this.casString && this.inputValue) {
+        if (!this.searchValue[this.casString]) {
+          this.searchValue[this.casString] = []
+          this.searchValue[this.casString].push(this.inputValue)
+        } else {
+          this.searchValue[this.casString].push(this.inputValue)
+        }
+        if (Object.keys(this.searchValue).length > 0) {
+          let arr = Object.keys(this.searchValue)
+          for (let i = 0; i < arr.length; i++) {
+            if (i == 0) {
+              if (this.searchValue[arr[i]].length > 1) {
+                this.searchStr = `${arr[i]} = (${this.searchValue[arr[i]].join(' OR ')})`
+              } else {
+                if (this.inputValue.indexOf('OR') != -1) {
+                  this.searchStr = `${arr[i]} = (${this.searchValue[arr[i]][0]})`
+                } else {
+                  this.searchStr = `${arr[i]} = ${this.searchValue[arr[i]][0]}`
+                }
+              }
+            } else {
+              if (this.searchValue[arr[i]].length > 1) {
+                this.searchStr += ` AND ${arr[i]} = (${this.searchValue[arr[i]].join(' OR ')})`
+              } else {
+                if (this.inputValue.indexOf('OR') != -1) {
+                  this.searchStr += ` AND ${arr[i]} = (${this.searchValue[arr[i]][0]})`
+                } else {
+                  this.searchStr += ` AND ${arr[i]} = ${this.searchValue[arr[i]][0]}`
+                }
+
+              }
+            }
+          }
+        }
+        console.log(this.searchStr);
+        console.log(this.searchValue);
+        this.inputValue = ''
+      } else {
+        this.$message.error('请选择栏位并输入需要搜索的内容')
+      }
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 0 - 132
src/views/report/components/patentList/components/searchPopover.vue

@@ -1,132 +0,0 @@
-<template>
-  <div>
-    <template v-if="searchOptions.length > 0">
-      <el-popover placement="bottom" title="" width="300" trigger="hover" class="margin-left_10">
-        <div class="main">
-          <div v-for="(item, index) in searchOptions" :key="item.value" class="box">
-            <el-alert type="success" :closable="false">
-              <div class="content">
-                <span class="color-black">{{ item.label }}</span>
-                <b class="padding_0_5">=</b>
-                <span class="color-black">
-                  <span v-if="item.type == 3">
-                    <span class="padding_0_5">(</span>
-                    <span v-for="(data, i) in item.searchValue" :key="data.label">
-                      <span class="query-data-label" @click="handleCancelQueryParams(item, index, i)">{{ data.label }}<i
-                          class="el-icon-close"></i></span>
-                      <b v-if="item.searchValue.length - 1 > i" class="padding_0_5 color-primary">OR</b>
-                    </span>
-                    <span class="padding_0_5">)</span>
-                  </span>
-                  <span v-else>
-                    <span class="query-data-label" @click="handleCancelQueryParams(item, index)">{{ item.searchValue.label
-                    }}<i class="el-icon-close"></i></span>
-                  </span>
-                </span>
-              </div>
-            </el-alert>
-          </div>
-        </div>
-        <el-button slot="reference" size="small" type="primary" style="width:100%">
-          检索条件<i class="el-icon-arrow-down el-icon--right"></i>
-        </el-button>
-      </el-popover>
-    </template>
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    searchValue: {
-      default: () => {
-        return {};
-      },
-    },
-    SearchFields: {
-      default: () => {
-        return [];
-      },
-    },
-  },
-  data() {
-    return {
-      searchOptions: [],
-      inner: false,
-    }
-  },
-  watch: {
-    SearchFields() {
-      // if (this.innerChange) {
-      //   return
-      // }
-      // this.getLabel()
-    },
-    searchValue: {
-      deep: true,
-      handler(n, o) {
-        console.log(n, this.searchValue, this.searchOptions);
-        if (!this.inner) {
-          this.getSearchOptions()
-        } else {
-          this.inner = false
-        }
-
-      }
-    }
-  },
-  mounted() {
-    this.getSearchOptions()
-  },
-  methods: {
-    getSearchOptions() {
-      this.searchOptions = []
-      if (Object.keys(this.searchValue).length > 0) {
-        Object.keys(this.searchValue).forEach(key => {
-          if (this.searchValue[key] || (typeof this.searchValue[key] == 'object' && this.searchValue[key].length > 0)) {
-            var field = this.SearchFields.find(item => {
-              return item.value == key
-            })
-            if (!field) {
-              return false
-            }
-            if (typeof this.searchValue[key] == 'object') {
-              this.searchOptions.push(
-                {
-                  ...field,
-                  searchValue: field.options.filter(item => {
-                    return this.searchValue[key].indexOf(item.value) != -1
-                  })
-                }
-              )
-            } else {
-              this.searchOptions.push(
-                {
-                  ...field,
-                  searchValue: {
-                    label: this.searchValue[key]
-                  }
-                }
-              )
-            }
-          }
-        })
-      }
-    },
-    handleCancelQueryParams(data, index, i) {
-      this.inner = true
-      if (data.type == 3) {
-        data.searchValue.splice(i, 1)
-        if (data.searchValue.length == 0) {
-          this.searchOptions.splice(index, 1)
-        }
-      } else {
-        this.searchOptions.splice(index, 1)
-      }
-      this.$emit('search', this.searchOptions)
-    },
-  },
-}
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 143
src/views/report/components/patentList/components/tab1.vue

@@ -1,143 +0,0 @@
-<template>
-  <div class="height_100">
-    <el-container>
-      <el-main class="" style="overflow-y: auto;">
-        <template>
-          <el-collapse v-model="activeNames" style="margin: 0px 5px 0px 5px;">
-
-            <el-collapse-item v-for="item in field" :title="item.name" :name="item.value" :key="item.value"
-              @click.native.stop="handleChange(item)">
-
-              <div @click.stop="handleStop">
-                <div style="display:flex;margin-bottom: 10px;">
-                  <div v-if="[1].includes(item.type)" class="year-data-picker">
-                    <el-date-picker clear-icon size="small" type="year" value-format="yyyy"
-                      placeholder="请选择时间"></el-date-picker>
-                    <span style="margin: 5px;">至</span>
-                    <el-date-picker clear-icon size="small" type="year" value-format="yyyy"
-                      placeholder="请选择时间"></el-date-picker>
-                  </div>
-                  <template v-if="![4, 5].includes(item.type)">
-                    <el-input size="small" placeholder="请输入查询内容"></el-input>
-                    <el-button @click.stop="handleSearch(item)" size="small" type="primary" class="margin-left_10"
-                      icon="el-icon-search" circle></el-button>
-                  </template>
-                </div>
-                <el-checkbox-group v-model="item.check" @change.stop="onChange($event, item)">
-                  <div class="source-checkbox" v-if="ifShow">
-                    <el-checkbox v-for="source in item.options" :label="source.id" :key="source.id">
-                      <span class="source-checkbox-label" :title="source.name">{{ source.name }}</span>
-                      <span class="source-checkbox-count">({{ getCount(item, source.id) }})</span>
-                    </el-checkbox>
-                  </div>
-                </el-checkbox-group>
-
-                <div class="patent-query-filter-search-bottom">
-                  <el-button type="success" size="small" @click.stop="handleSelectAll(item)">全选</el-button>
-                  <el-button type="danger" size="small" @click.stop="handleSelectCancel(item)">取消</el-button>
-                </div>
-              </div>
-            </el-collapse-item>
-          </el-collapse>
-        </template>
-      </el-main>
-      <el-footer style="display: flex;align-items: center;justify-content: end;">
-        <slot name="footerBtn"></slot>
-
-      </el-footer>
-    </el-container>
-
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    field: {
-      type: Array,
-      default: () => {
-        return []
-      }
-    },
-    checkArr: {
-      type: Array,
-      default: () => {
-        return []
-      }
-    },
-  },
-  components: {
-
-  },
-  data() {
-    return {
-      activeNames: [],
-      ifShow: true,
-    }
-  },
-  watch: {
-    field: {
-      handler() {
-        this.ifShow = false
-        this.$nextTick(() => {
-          this.ifShow = true
-        })
-      },
-      deep: true
-    }
-  },
-  mounted() {
-
-  },
-  methods: {
-    handleStop(){},   
-    // 处理专利文件数字
-    getCount(field, value) {
-      var num = 0
-      if (field.nums) {
-        var obj = field.nums.find(item => {
-          return item.name == value
-        })
-        if (obj) {
-          num = obj.number
-        }
-        return num
-      }
-    },
-    // 点击面板
-    handleChange(row) {
-      console.log(row);
-      this.$emit('collapseChange', { row: row, sign: 'check' })
-    },
-    // 点击折叠面板中的搜索
-    handleSearch(val) {
-      this.$emit('search', { row: val })
-    },
-    // 选中的数据
-    onChange(data, field) {
-      console.log(data, field);
-      var obj = {
-        fieldId: field.value,
-        fieldType: field.fieldType,
-        value: [],
-      }
-      let arr = []
-      arr.push(obj)
-      this.$emit('customTab',arr)
-      console.log(obj);
-    },
-    // 全选
-    handleSelectAll(val) {
-      val.check = val.options.map(item => {
-        return item.id
-      })
-    },
-    // 取消
-    handleSelectCancel(val) {
-      val.check=[]
-    },
-  },
-}
-</script>
-
-<style lang="scss" scoped></style>

+ 0 - 97
src/views/report/components/patentList/components/tab2.vue

@@ -1,97 +0,0 @@
-<template>
-  <div>
-    <template v-if="fieldTree.length > 0">
-      <el-collapse v-model="activeNames" style="margin: 0px 5px 0px 5px;">
-        <el-collapse-item v-for="item in fieldTree" :title="item.name" :name="item.value" :key="item.value"
-          @click.native.stop="handleChange(item)">
-          <div v-if="ifShow">
-            <el-tree @check-change="onChangeTree($event, item.value)" :ref="item.value" :data="item.child" show-checkbox
-              node-key="id" check-strictly default-expand-all :props="{ children: 'child', label: 'name' }">
-              <div class="custom-filter-tree-node" slot-scope="{ node, data }">
-                <span class="name">{{ data.name }}</span>
-                <span class="total">({{ getCount(item, data.id) }})</span>
-              </div>
-            </el-tree>
-          </div>
-
-        </el-collapse-item>
-      </el-collapse>
-    </template>
-    <template v-else>
-      <div>暂无数据</div>
-    </template>
-  </div>
-</template>
-
-<script>
-export default {
-  props: {
-    fieldTree: {
-      type: Array,
-      default: () => {
-        return []
-      }
-    },
-  },
-  data() {
-    return {
-      activeNames: [],
-      ifShow:true,
-    }
-  },
-  watch: {
-    fieldTree: {
-      handler() {
-        this.ifShow = false
-        this.$nextTick(() => {
-          this.ifShow = true
-        })
-      },
-      deep: true
-    }
-  },
-  mounted() {
-
-  },
-  methods: {
-    // 处理专利文件数字
-    getCount(field, value) {
-      var num = 0
-      if (field.nums) {
-        var obj = field.nums.find(item => {
-          return item.name == value
-        })
-        if (obj) {
-          num = obj.number
-        }
-        return num
-      }
-    },
-    // 点击面板
-    handleChange(row) {
-      this.$emit('collapseChange', { row: row, sign: 'tree' })
-    },
-    // 选中的值
-    onChangeTree(filed, filedId) {//当前节点的数据,当前栏位的数据 
-      if (this.valObj.treeArr && this.valObj.treeArr.length > 0) {
-        let index = this.valObj.treeArr.findIndex(item => {
-          return item == filed.id
-        })
-        if (index != -1) {
-          this.valObj.treeArr.splice(index, 1)
-        } else {
-          this.valObj.treeArr.push(filed.id)
-        }
-      } else {
-        this.valObj.treeArr.push(filed.id)
-      }
-      let obj = {
-        [filedId]: this.valObj.treeArr
-      }
-      this.handleFiledData(obj, filedId)
-    },
-  },
-}
-</script>
-
-<style lang="scss" scoped></style>