浏览代码

专利号检索修改

zhuliu 1 年之前
父节点
当前提交
45467bf539

+ 1 - 1
src/views/components/import/conditionImport/patentNoSearch.vue

@@ -38,7 +38,7 @@ export default {
         this.$set(this,'NO','')
     },
     search(){
-        var a = `NO=(${this.NO})`
+        var a =''
         var params = {
             DBType:this.DBType,
             component:'patentNoSearch',

+ 5 - 1
src/views/components/import/conditionImport/search.vue

@@ -162,7 +162,11 @@ export default {
                 DBType:this.DBType,
                 retrieveRecordId:null,
                 ...this.importData,
-                type:4
+                type:4,
+            }
+            if(data.component == 'patentNoSearch'){
+                a.NO = data.data
+                a.component = 'patentNoSearch'
             }
             this.$router.push({
                 path: '/searchResult',

+ 18 - 3
src/views/components/import/conditionImport/searchResult.vue

@@ -16,7 +16,7 @@
         <!-- <div style="max-width:calc(100% - 620px)">
           <p><span>条件:</span>{{ searchData.searchCondition }}</p>
         </div> -->
-        <div style="max-width: 800px;margin-top: 0px;display: flex;justify-content: center;align-items: center;">
+        <div style="max-width: 800px;margin-top: 0px;display: flex;justify-content: center;align-items: center;" v-if="condition.component != 'patentNoSearch'">
           <search :field="field" :searchResult="true" :searchValue="false" :countryList="queryParams.countryList"
             @search="search"></search>
           <p><el-link style="width: 50px;color: #409EFF;" @click="searches">检索式</el-link></p>
@@ -28,7 +28,7 @@
       </el-header>
       <el-main id="patent-list-container" v-loading="loading">
         <div class="height_100">
-          <component ref="patentViewList" :is="viewSelected" :outside="true" :column="columnList" :tableData="tableData"  @clickPatentNo="handleClick"
+          <component ref="patentViewList" :is="viewSelected" :outside="true" :column="columnList" :tableData="tableData"  @clickPatentNo="handleClick" :canSort="condition.component != 'patentNoSearch'?true:false"
             @select-change="handleSelect" :selected.sync="queryParams.selected" :queryParams="queryParams" :patentNoList.sync="patentNoList" :refresh='true'
             :view-field="patentViewField" @on-sort="handleSort" @addSelect="getChoosePatentNo"></component>
         </div>
@@ -379,7 +379,11 @@ export default {
         RowCount: this.queryParams.size, //每页返回条数(最多 50 条)
         OrderBy: this.queryParams.OrderBy, //排序字段:“AD”,“PD”,“GD”, “ID”(检索引擎自生成字段,排序顺序固定)
         OrderByType: this.queryParams.OrderByType, //排序方式:“ASC”,“DESC” 即正序倒序
-        retrieveRecordId: this.queryParams.retrieveRecordId
+        retrieveRecordId: this.queryParams.retrieveRecordId,
+
+        //专利号检索
+        NO:this.condition.NO,
+        redisKey:this.condition.redisKey
       };
       // console.log(this.$s.getSession('retrieveRecordId'),)
       queryParams.params = params;
@@ -394,12 +398,23 @@ export default {
           let records = response.data.data
           this.tableData = records
           params.retrieveRecordId = response.data.retrieveRecordId
+         
           this.queryParams.retrieveRecordId = response.data.retrieveRecordId
           this.$store.commit("SET_PATENT_PARAMS", queryParams);
           this.$s.setSession('queryParams', queryParams)
           this.$store.commit("SET_PATENT_RECORDS", records);
           this.getImageAndStatus()
           this.loading = false;
+          if(response.data.redisKey){
+            this.condition.redisKey = response.data.redisKey
+            this.condition.NO=''
+            this.$router.push({
+              path: '/searchResult',
+              query: {
+                data: JSON.stringify(this.condition),
+              }
+            })
+          }
         }
       })
         .catch((error) => {

+ 16 - 0
src/views/project/patentCollection/components/mixins/index.js

@@ -225,6 +225,22 @@ export const handleData = {
             var text = this.$commonJS.getColumnData(row, obj, prop, data)
             break
         }
+        if(row.searchNo){
+          let keyword = row.searchNo
+          let sText = text
+            let num = -1
+            const rStr = new RegExp(keyword, "g")
+            const rHtml = new RegExp("\<.*?\>", "ig")
+            const sKey = `<span style="background: green;color: #fff">${keyword}</span>`
+            const aHtml = sText.match(rHtml)
+            sText = sText.replace(rHtml, '{~}')
+            sText = sText.replace(rStr, sKey)
+            sText = sText.replace(/{~}/g, () => {
+              num++
+              return aHtml[num]
+            })
+            text = sText
+        }
         // var text = this.$commonJS.getColumnData(row, obj, prop, data)
         // console.log(text,key);
         return this.getViewDom(text, type)

+ 16 - 4
src/views/project/patentCollection/components/views/Table.vue

@@ -23,7 +23,7 @@
 
       <el-table-column v-for="item in column.filter(item => !item.ifHidden)" :width="['abstractStr'].indexOf(item.value)!=-1?'500':'auto'" min-width="200" :fixed="['patentNo'].indexOf(item.value)!=-1?'left':false"
         :render-header="$commonJS.renderHeaderMethods" :key="item.value" :prop="item.field" :label="item.name"
-        :sortable="item.ifSort?'custom':false" align="center">
+        :sortable="(canSort && item.ifSort)?'custom':false" align="center">
         <template slot-scope="scope">
           <div v-if="['patentNo'].includes(item.value)">
             <el-popover placement="right-start" width="500" @show="showPopover(scope.row)" trigger="hover">
@@ -49,9 +49,15 @@
                   </td>
                 </tr>
               </table>
-              <el-link slot="reference" type="primary" @click="handleClick(scope.row, scope.$index)">
-                <span v-html="getView(scope.row, item.value, item.type)"></span>
-              </el-link>
+              <template v-if="scope.row.ifSearch">
+                <el-link slot="reference" type="primary" @click="handleClick(scope.row, scope.$index)">
+                  <span v-html="getView(scope.row, item.value, item.type)"></span>
+                </el-link>
+              </template>
+              <template v-else>
+                  <span v-html="getView(scope.row, item.value, item.type)"></span>
+              </template>
+              
             </el-popover>
           </div>
           <template v-else-if="item.ifPersonal">
@@ -98,6 +104,12 @@
 import { projectData, handleData } from '../mixins/index'
 import { getTableHeight } from '@/views/components/mixins'
 export default {
+  props:{
+    canSort:{
+      type:Boolean,
+      default:true
+    }
+  },
   mixins: [projectData, handleData, getTableHeight],
   components: {