zhuhao 1 år sedan
förälder
incheckning
7b3bfc2be7

+ 41 - 19
src/views/report/components/patentList/components/customFields/components/tab1.vue

@@ -30,7 +30,7 @@
                 </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-checkbox v-for="source in item.options" :label="source.id || source.name" :key="source.id || 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>
@@ -44,7 +44,7 @@
 
               <!-- 专利本身 -->
               <template v-else>
-                <div v-if="['IPC', 'CPC', 'UPC', 'LOC'].includes(item.value)" style="margin-bottom: 10px;">
+                <div v-if="['MC', '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">
@@ -67,9 +67,12 @@
                 </div>
                 <el-checkbox-group v-model="item.check" @change="onChange">
                   <div class="source-checkbox">
+                    {{ item.value }}
                     <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>
+                        <span class="source-checkbox-label text" :title="source.name">
+                        {{ ['LG','PT','SS'].includes(item.value) ? typeStatus[item.value][source.name] : source.name }}
+                        </span>
                       </el-tooltip>
                       <span class="source-checkbox-count">({{ source.number }})</span>
                     </el-checkbox>
@@ -80,7 +83,7 @@
               <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"
+                <el-button v-if="item.isShowBtn" type="primary" size="small"
                   @click.stop="handleLoading(item)">加载更多</el-button>
               </div>
             </el-collapse-item>
@@ -118,31 +121,50 @@ export default {
     return {
       // 专利IPC/CPC/UPC/LOC的选项
       special: {
-        IPC: [
-          { value: 'ipcLevel1', label: '部' },
-          { value: 'ipcLevel2', label: '大类' },
-          { value: 'ipcLevel3', label: '小类' },
-          { value: 'ipcLevel4', label: '大组' },
-          { value: 'ipcLevel5', label: '小组' },
+        MC: [
+          { value: 'IC', label: '部' },
+          { value: 'IC2', label: '大类' },
+          { value: 'IC3', label: '小类' },
+          { value: 'IC4', label: '大组' },
+          { value: 'IC5', label: '小组' },
         ],
         CPC: [
-          { value: 'cpcLevel1', label: '部' },
-          { value: 'cpcLevel2', label: '大类' },
-          { value: 'cpcLevel3', label: '小类' },
-          { value: 'cpcLevel4', label: '大组' },
-          { value: 'cpcLevel5', label: '小组' },
+          { value: 'CPC', label: '部' },
+          { value: 'CPC2', label: '大类' },
+          { value: 'CPC3', label: '小类' },
+          { value: 'CPC4', label: '大组' },
+          { value: 'CPC5', label: '小组' },
         ],
         UPC: [
           // { value: '0', label: '分类号' },//老系统有
-          { value: 'upcLevel1', label: '大类' },
-          { value: 'upcLevel2', label: '小类' },
+          { value: 'UPC', label: '大类' },
+          { value: 'UPC2', label: '小类' },
         ],
         LOC: [
           // { value: '0', label: '分类号' },//老系统有
-          { value: 'locLevel1', label: '大类' },
-          { value: 'locLevel2', label: '小类' },
+          { value: 'LOC', label: '大类' },
+          { value: 'LOC2', label: '小类' },
         ],
       },
+      typeStatus: {
+        LG: {//法律状态暂定
+          1: '有效',
+          2: '无效',
+          3: '审中',
+        },
+        PT: {//专利类型
+          1: '发明',
+          8: '发明',
+          2: '实用新型',
+          9: '实用新型',
+          3: '外观',
+        },
+        SS: {//专利状态
+          1: '有效',
+          2: '无效',
+          3: '审中',
+        },
+      },
     }
   },
   watch: {

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

@@ -96,9 +96,8 @@ export default {
   },
   watch: {
     searchOption: {
-      deep: true,
       handler() {
-        // this.esCountAnalysis({})
+        this.refreshOptions()
       },
     },
   },
@@ -109,18 +108,32 @@ export default {
     this.getAllCountColumns()
   },
   methods: {
+    // 条件改变时刷新已打开的折叠面板
+    refreshOptions() {
+      for (let i = 0; i < this.activeName.length; i++) {
+        var row = this.field.find(item => {
+          return item.value + 'a' + item.filedKind == this.activeName[i]
+        })
+        this.getOptions(row)
+      }
+    },
     // 检索条件取消时统计勾选项一并取消
     close() {
-      // console.log(this.searchPatentCheck);
       let data = this.searchPatentCheck
+      // return
       for (let i = 0; i < data.length; i++) {
-        console.log(data[i]);
-        let a = this.field.filter(item => {
-          return item.value == data[i].value
-        })
-        if (a) {
-          a[0].check = data[i].check
+
+        if (data[i].filedKind == 0 && data[i].type == 'tree') {
+          
+        } else {
+          let a = this.field.filter(item => {
+            return item.value == data[i].value
+          })
+          if (a) {
+            a[0].check = data[i].check
+          }
         }
+
       }
     },
     // 树点击不关联模式
@@ -184,7 +197,7 @@ export default {
     esCountAnalysis(row) {
       var countVOS = []
       if (row.filedKind == -1) {//专利本身栏位(专利著录)
-        let value = ['IPC', 'CPC', 'UPC', 'LOC'].includes(row.value) ? row.select : row.value
+        let value = ['MC', 'CPC', 'UPC', 'LOC'].includes(row.value) ? row.select : row.value
         countVOS = [
           {
             field: value,
@@ -201,7 +214,8 @@ export default {
             fieldId: row.value,
             valueOne: row.valueOne,
             valueTwo: row.valueTwo,
-            topN: row.topN,
+            
+            topN: 999,//自定义栏位没有加载更多
             ifHaveChild: row.type == 'tree' ? this.ifHaveChild : false,
             fieldType: row.type
           },
@@ -241,11 +255,20 @@ export default {
                 }
               }
             } else {//专利本身搜索字段
-              this.$set(data[index], 'options', res.data.detailDTOS)
+              let arr = res.data.detailDTOS.filter(item => {
+                return item.name != '其他'
+              })
+              this.$set(data[index], 'options', arr)
+              this.$set(data[index], 'topN', data[index].options[0].topN)
+              if (data[index].options.length == data[index].topN) {//判断加载更多按钮是否存在
+                this.$set(data[index], 'isShowBtn', true)
+              } else {
+                this.$set(data[index], 'isShowBtn', false)
+              }
             }
             this.$set(data[index], 'check', [])
-            this.$set(data[index], 'allNumber', res.data.allNumber)
-            this.$set(data[index], 'topN', res.data.topN)
+            // this.$set(data[index], 'allNumber', res.data.allNumber)
+
           }
         }
       })
@@ -311,6 +334,11 @@ export default {
       this.$api.getAllCountColumns(params).then(res => {
         if (res.code == 200) {
           this.filedAll = []
+          res.data.data.forEach(item => {
+            if (item.filedKind == -1) {
+              item.value = item.field
+            }
+          })
           var data = res.data.data
           this.handleFiled(data)
         }
@@ -366,20 +394,20 @@ export default {
         }
       })
     },
-    // 设置ipc、cpc、loc、upc默认值
+    // 设置ipc、cpc、loc、upc选择默认值
     getSelect(data) {
       switch (data.value) {
-        case 'IPC':
-          this.$set(data, 'select', 'ipcLevel1')
+        case 'MC':
+          this.$set(data, 'select', 'IC')
           break;
         case 'CPC':
-          this.$set(data, 'select', 'cpcLevel1')
+          this.$set(data, 'select', 'CPC')
           break;
         case 'UPC':
-          this.$set(data, 'select', 'upcLevel1')
+          this.$set(data, 'select', 'UPC')
           break;
         case 'LOC':
-          this.$set(data, 'select', 'locLevel1')
+          this.$set(data, 'select', 'LOC')
           break;
 
         default:

+ 14 - 10
src/views/report/components/patentList/components/index.vue

@@ -163,12 +163,10 @@ export default {
         if (item.check && item.check.length > 0) {
           if (item.filedKind == -1) {
             this.searchPatentCheck.push(item)
-
           } else {
-            // console.log(item);
             var checkName = []
-            if (item.type == 'Array') {
-              checkName = item.options.filter(item2 => item.check.includes(item2.id)).map(item3 => item3.name); 
+            if (item.type == 'Array' || item.type == 'tree' || item.type == 'DateTime') {
+              checkName = item.options.filter(item2 => item.check.includes(item2.id || item2.name)).map(item3 => item3.name); 
             }
             var obj = {
               value: item.value,
@@ -179,7 +177,7 @@ export default {
               type:item.type,
               ifHaveChild: this.ifHaveChild
             }
-            console.log(item, obj);
+            // return
             this.searchPatentCheck.push(obj)
           }
         }
@@ -235,8 +233,18 @@ export default {
       await this.$api.getQueryFields(params).then(res => {
         if (res.code == 200) {
           let conditionDTOList = JSON.parse(JSON.stringify(res.data.data[0].conditionDTOList))
+          let field=conditionDTOList.filter(item => {
+            return item.group == 'nos'
+          })
+          let custom = conditionDTOList.filter(item => {
+            return item.group == 'customField'
+          })
+          let customField = custom.filter(item => {
+            return item.type != 'tree' && item.type != 'Array'
+          })
+          let arr = field.concat(customField)
           // 搜索字段
-          let searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
+          this.searchFiled = this.$commonJS.getField(arr, (u) => u.ifSearch == true, {
             label: 'name',
             value: 'field',
             type: 'type',
@@ -244,10 +252,6 @@ export default {
             fieldType: 'fieldType',
             groupBy: 'groupBy',
           })
-          // 处理自定义栏位筛选
-          this.searchFiled = searchFiled.filter(item => {
-            return item.type != 'tree' 
-          })
         }
       })
     },

+ 68 - 38
src/views/report/components/patentList/components/searchPatent.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="width: 550px;">
+  <div class="searchPatent">
     <div style="display: flex;align-items: center;">
       <el-cascader :options="options" @change="cascaderChange" :show-all-levels="false" size="small"
         style="width: 150px;"></el-cascader>
@@ -8,36 +8,42 @@
         <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 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" width="260" trigger="click">
-        <div v-for="(item, index) in searchStorageText" :key="item.value">
-          <div style="margin-bottom:10px;background:#F0F9EB">
-            <span>{{ item.label }}</span>
-            <span> = </span>
-            <template v-if="item.type == 'Array'">
-              <span>(</span>
-              <template v-if="item.filedKind == 0">
-                <span v-for="(result, i) in item.checkName" :key="result" @click="resultBtn(item, index, i)">{{ result
-                }}<i class="el-icon-close"></i>
-                  <b v-if="item.checkName.length - 1 > i"> OR </b>
-                </span></template>
+      <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="item.value">
+            <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 v-for="(result, i) in item.inputValue" :key="result" @click="resultBtn(item, index, i)">{{ result
-                }}<i class="el-icon-close"></i>
-                  <b v-if="item.inputValue.length - 1 > i"> OR </b>
-                </span>
+                <span @click="resultBtn(item, index, 0)" style="cursor: pointer;">({{ item.inputValue }})<i
+                    class="el-icon-close"></i></span>
               </template>
-              <span>)</span>
-              <!-- <span>({{ item.result.join(' OR ') }})</span> -->
-            </template>
-            <template v-else>
-              <span @click="resultBtn(item, index, 0)">{{ item.inputValue }}<i class="el-icon-close"></i></span>
-            </template>
+            </div>
           </div>
         </div>
 
@@ -105,6 +111,27 @@ export default {
           { 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
@@ -131,9 +158,6 @@ export default {
   methods: {
     // 点击检索式中的检索条件
     resultBtn(item, index, i) {
-      // console.log('点击率', item, index, i);
-      // console.log(item);
-      // return
       if (Array.isArray(item.inputValue)) {
         item.inputValue.splice(i, 1)
         if (this.searchStorageText[index].inputValue.length == 0) {
@@ -145,9 +169,8 @@ export default {
             spliceName = 'searchPatentCheck'
           }
           this[spliceName].splice(index, 1)
-          // console.log(this.searchStorage, this.searchPatentCheck);
         }
-        if (item.checkName && item.checkName.length > 0) {
+        if (item.checkName && item.checkName.length > 0) {//统计自定义字段
           item.checkName.splice(i, 1)
         }
       } else {
@@ -170,6 +193,7 @@ export default {
     },
     // cascader变化事件
     cascaderChange(val) {
+      this.inputValue = ''
       let a = this.options.find(item => {
         return item.value == val[0]
       })
@@ -182,6 +206,7 @@ export default {
       }
       if (val[0] == 'typeStatus') {
         this.$set(this.isControl, 'select', true)
+        this.$set(this.isControl, 'selectCheck', val[val.length - 1])
       }
     },
     // 存储条件
@@ -193,7 +218,6 @@ export default {
     },
     getSearchOptionData() {
       var data = []
-      // console.log(this.searchStorage, this.searchPatentCheck);
       this.searchStorage.forEach(item => {
         data.push(
           {
@@ -207,7 +231,6 @@ export default {
         )
       })
       this.searchPatentCheck.forEach(item => {
-        console.log(item);
         var type = 1
         data.push(
           {
@@ -223,7 +246,6 @@ export default {
         )
       })
       this.searchStorageText = data
-      console.log(this.searchStorageText);
       return data
     },
     // 页面检索按钮
@@ -239,10 +261,11 @@ export default {
     // 处理检索条件
     getSearchStorage() {
       let customFields = []
-      // console.log(this.searchStorageText);
+      let count = 0
       this.searchStorageText.forEach((item, index) => {
         if (item.group == 'nos') {
-          if (index == 0) {
+          if (count == 0) {
+            count++
             if (Array.isArray(item.inputValue)) {
               this.searchStr = `${item.value} = (${item.inputValue.join(' OR ')})`
             } else {
@@ -250,6 +273,7 @@ export default {
             }
 
           } else {
+            count++
             if (Array.isArray(item.inputValue)) {
               this.searchStr += ` AND ${item.value} = (${item.inputValue.join(' OR ')})`
             } else {
@@ -259,12 +283,15 @@ export default {
         } else {
           let a = {
             fieldId: item.value,
-            value: item.filedKind ? item.inputValue : [this.inputValue],
+            value: (item.filedKind == 0 || item.filedKind) ? item.inputValue : [this.inputValue],
           }
           customFields.push(a)
         }
       })
-      // console.log(this.searchStr,this.searchStorage,this.searchPatentCheck);
+      if (this.searchStorageText==0) {
+        this.searchStr = ''
+      }
+      // console.log(this.searchStr,customFields,this.searchStorage,this.searchPatentCheck,this.searchStorageText);
       this.$emit('searchValue', { searchStr: this.searchStr, customFields: customFields, })
     },
 
@@ -316,7 +343,6 @@ export default {
               children: [data[i]]
             }
           }
-          // console.log(filedObj);
         }
       }
       this.options = Object.values(filedObj)
@@ -325,4 +351,8 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.searchPatent {
+  width: 550px;
+}
+</style>