zhuliu 1 年之前
父節點
當前提交
a8b65fe67c

+ 4 - 0
src/store/modules/highlight.js

@@ -3,6 +3,7 @@ export default {
     contrastList: [],
     piZhuContrastList: [],
     opinionContrastList: [],
+    patentHightLight:{}
   },
 
   mutations: {
@@ -15,6 +16,9 @@ export default {
     SET_PATENT_CONTRAST: (state, contrastList) => {
       state.contrastList = contrastList;
     },
+    SET_PATENT_HIGHLIGHT(state, highlight) {
+      state.patentHightLight = highlight
+    },
   },
 
   actions: {},

+ 1 - 3
src/store/modules/patent.js

@@ -26,9 +26,7 @@ export default {
     SET_PATENT_MENU_LOADING(state, menuLoading) {
       state.menuLoading = menuLoading
     },
-    SET_PATENT_HIGHLIGHT(state, highlight) {
-      state.highlight = highlight
-    },
+    
     SET_PATENT_QUERY_DATA(state, queryData) {
       state.queryData = queryData
     },

+ 5 - 5
src/utils/direct/drag.js

@@ -16,7 +16,6 @@
       tWidth: 0,
       tHeight: 0
     };
-   
     // 给拖动块添加样式
     bar.style.cursor = 'move';
    
@@ -67,7 +66,6 @@
           // 最终移动位置
           var zLeft = 0;
           var zTop = 0;
-   
           zLeft = parseInt(params.left) + disX;
           // 限制X轴范围
           if (zLeft <= -parseInt(params.tWidth / 2)) {
@@ -85,10 +83,12 @@
           if (zTop >= params.cHeight - parseInt(params.tHeight * 0.5)) {
             zTop = params.cHeight - parseInt(params.tHeight * 0.5);
           }
-   
+          target.style.position = 'fixed'
+          
           // 执行移动
-          target.style.left = zLeft - 130 + 'px';
-          target.style.top = zTop - 70 + 'px';
+          target.style.left = zLeft + 'px';
+          target.style.top = zTop + 'px';
+          console.log(target)
         }
    
         if (typeof callback == "function") {

+ 29 - 9
src/views/components/import/conditionImport/searchResult.vue

@@ -42,15 +42,15 @@
             <el-main class="patent-fast-edit-popover" v-loading="selectNumberLoading">
               <div class="btn" @click="handleCancelSelectNumber">取消选择</div>
               <div class="btn" @click="handleSelectNumber(0)">本页选择</div>
-              <div class="btn" @click="handleSelectNumber(1)">全部选择</div>
-              <el-divider></el-divider>
+              <!-- <div class="btn" @click="handleSelectNumber(1)">全部选择</div> -->
+              <!-- <el-divider></el-divider>
               <div class="select-number">
                 <span>从</span>
                 <el-input size="mini" v-model="queryParams.startNumber" @change="change1"></el-input>
                 <span>到</span>
                 <el-input size="mini" v-model="queryParams.endNumber" @change="change2"></el-input>
                 <el-button type="text" size="" @click="handleSelectNumber(2)">确定</el-button>
-              </div>
+              </div> -->
             </el-main>
             <el-button type="info" size="small" class="margin-left_10" slot="reference"> 选择专利<i
                 class="el-icon-arrow-down el-icon--right"></i></el-button>
@@ -149,8 +149,8 @@ export default {
       selectNumberLoading: false,
       loading: false,
       selectedTotal: 0,
-      startNumber: 1,
-      endNumber: 0,
+      startNumber: null,
+      endNumber: null,
       quickSelect: false,
       quickSelectArr: [],
       /**检索式 */
@@ -248,10 +248,10 @@ export default {
         ...this.condition,
         orderBy: this.queryParams.OrderBy,
         orderByType: this.queryParams.OrderByType,
-        startNumber: this.selectedTotal > 0 ? this.startNumber : 1,
-        endNumber: this.selectedTotal > 0 ? this.endNumber : this.total,
-        isAddPatentNos: this.queryParams.isAdd,
-        isDeletePatentNos: this.queryParams.isDelete,
+        // startNumber: this.selectedTotal > 0 ? this.startNumber : 1,
+        // endNumber: this.selectedTotal > 0 ? this.endNumber : this.total,
+        patentNos: this.queryParams.isAdd,
+        // isDeletePatentNos: this.queryParams.isDelete,
       }
       this.$refs.projectListDialog.open(form);
     },
@@ -334,6 +334,7 @@ export default {
           this.$store.commit("SET_PATENT_PARAMS", queryParams);
           this.$s.setSession('queryParams', queryParams)
           this.$store.commit("SET_PATENT_RECORDS", records);
+          this.getImageAndStatus()
           this.loading = false;
         }
       })
@@ -342,6 +343,25 @@ export default {
         });
 
     },
+    //获取摘要附图和法律状态
+    getImageAndStatus(){
+      this.tableData.forEach(item=>{
+        var params = {
+          appNo: item.rowApplicationNo,
+        }
+        this.$api.getPictureGuid(params).then(response => {
+          if (response.code == 200) {
+            this.$set(item, 'pictureGuid', response.data)
+          }
+        })
+        this.$api.getLegalStatus(params).then(response => {
+          if (response.code == 200) {
+            this.$set(item, 'legalStatus', response.data)
+          }
+        })
+      })
+      
+    },
     handleSelect(data) {
       // this.queryParams.selected = data
     },

+ 191 - 0
src/views/project/components/PatentKeywordsHighlight.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="patent-keywords-highlight">
+    <el-container>
+      <el-header class="patent-keywords-highlight-header">
+        <el-switch v-model="form.enable" active-color="#13ce66" @change="onChange2"></el-switch>
+        <div>
+          <el-button type="primary" size="small" @click="handleAdd" :loading="btnLoading">新增</el-button>
+          <el-button type="success" size="small" @click="handleSave">保存</el-button>
+        </div>
+      </el-header>
+      <el-main class="patent-keywords-highlight-main">
+        <div class="margin-top_10">
+          <el-select v-model="selected" size="small" placeholder="请选择" class="width_100" @change="onChange">
+            <el-option v-for="(item, index) in dataList" :label="item.name" :value="index"></el-option>
+          </el-select>
+          <div v-for="item in form.configs" class="margin-top_10 item">
+            <el-color-picker v-model="item.color" size="small" @change="onChange2"></el-color-picker>
+            <el-input v-model="item.keywords" placeholder="多个关键词请使用';(英文分号)'隔开" size="small" @input="onChange2(true)"></el-input>
+          </div>
+          <div class="delete-button">
+            <el-button type="danger" size="small" @click="handleDelete" v-if="!form._default" :loading="btnLoading2">删除</el-button>
+          </div>
+        </div>
+      </el-main>
+    </el-container>
+
+    <el-dialog :title="title" :visible.sync="visible" width="500px" append-to-body destroy-on-close :before-close="close" top="10vh">
+      <el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px">
+        <el-form-item label="模板名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入模板名称"></el-input>
+        </el-form-item>
+        <el-form-item v-for="item in form.configs">
+          <template slot="label">
+            <el-color-picker v-model="item.color" size="small"></el-color-picker>
+          </template>
+          <el-input v-model="item.keywords" placeholder="请输入专利高亮关键词"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ['projectId'],
+  data() {
+    return {
+      dataList: [],
+      selected: 0,
+      visible: false,
+      title: '管理高亮模板',
+      form: {},
+      btnLoading: false,
+      btnLoading2: false,
+      rules: {
+        name: [{ required: true, message: '请输入专题库名称', trigger: 'blur' },],
+      }
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    close() {
+      this.visible = false
+    },
+    onChange() {
+      this.form = this.dataList[this.selected]
+      this.onChange2()
+    },
+    onChange2(input) {
+      if (!this.form.enable && input) {
+        this.form.enable = true
+      }
+      this.$store.commit('SET_PATENT_HIGHLIGHT', this.form)
+    },
+    getList() {
+      this.dataList = [
+          {
+            "name": "默认模板",
+            "projectId": 425,
+            "userId": 103,
+            "enable": true,
+            "_default": true,
+            "configs": [
+                {
+                    "color": "#5470c6",
+                    "keywords": ""
+                },
+                {
+                    "color": "#91cc75",
+                    "keywords": ""
+                },
+                {
+                    "color": "#fac858",
+                    "keywords": ""
+                },
+                {
+                    "color": "#ee6666",
+                    "keywords": ""
+                },
+                {
+                    "color": "#73c0de",
+                    "keywords": ""
+                }
+            ],
+              "id": 1085
+          }
+        ]
+        this.onChange()
+        return
+      this.$api.getPatentKeywordsHighlight({ projectId: this.projectId }).then(response => {
+        this.dataList = response.data
+        this.selected = 0
+        this.onChange()
+      }).catch(error=>{
+       
+      })
+    },
+    handleAdd() {
+      this.btnLoading = true
+      this.$api.addDefaultPatentKeywordsHighlight({ projectId: this.projectId }).then(response => {
+        this.dataList.push(response.data)
+        this.$message.success('操作成功')
+        this.btnLoading = false
+        this.selected = this.dataList.length - 1
+        this.onChange()
+      }).catch(error => {
+        this.btnLoading = false
+      })
+    },
+    handleSave() {
+      this.visible = true
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          this.$api.updatePatentKeywordsHighlight(this.form).then(response => {
+            this.$message.success('操作成功')
+            this.btnLoading = false
+            this.visible = false
+            this.onChange2()
+          }).catch(error => {
+            this.btnLoading = false
+          })
+        }
+      })
+    },
+    handleDelete() {
+      this.btnLoading2 = true
+      this.$api.deletePatentKeywordsHigh({ id: this.form.id }).then(response => {
+        this.$message.success('操作成功')
+        this.btnLoading2 = false
+        this.dataList.splice(this.selected, 1)
+        this.selected = this.selected - 1
+        this.onChange()
+      }).catch(error => {
+        this.btnLoading2 = false
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.patent-keywords-highlight {
+  .patent-keywords-highlight-header {
+    padding: 25px 0 !important;
+    height: 40px;
+  }
+  .patent-keywords-highlight-main {
+    padding: 0;
+    display: contents;
+    .item {
+      .el-input {
+        width: 88%;
+        float: right;
+      }
+    }
+    .delete-button {
+      margin-top: 10px;
+      text-align: right;
+    }
+  }
+}
+</style>

+ 26 - 27
src/views/project/patentCollection/components/mixins/index.js

@@ -246,36 +246,35 @@ export const handleData = {
         });
 
       }
-      if (!this.highlight.enable || !text) {
+      if (!this.highlight.patentHightLight.enable || !text) {
         return text
       }
 
-      // try {
-
-      //   this.highlight.configs.map(item => {
-      //     const keywords = item.keywords.split(';')
-      //     for (let keyword of keywords) {
-      //       if (!keyword) {
-      //         continue
-      //       }
-      //       let sText = text
-      //       let num = -1
-      //       const rStr = new RegExp(keyword, "g")
-      //       const rHtml = new RegExp("\<.*?\>", "ig")
-      //       const sKey = `<span style="background: ${item.color};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
-      //     }
-      //   })
-
-      // } catch (e) {
-      // }
+      try {
+        this.highlight.patentHightLight.configs.map(item => {
+          const keywords = item.keywords.split(';')
+          for (let keyword of keywords) {
+            if (!keyword) {
+              continue
+            }
+            let sText = text
+            let num = -1
+            const rStr = new RegExp(keyword, "g")
+            const rHtml = new RegExp("\<.*?\>", "ig")
+            const sKey = `<span style="background: ${item.color};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
+          }
+        })
+
+      } catch (e) {
+      }
       // console.log(text);
       return text
     },

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

@@ -24,7 +24,7 @@
 
             <!-- <mySearch :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch> -->
             <el-popover placement="bottom" title="关键词高亮" width="320" trigger="click">
-              <!-- <patent-keywords-highlight :project-id="projectId" /> -->
+              <patent-keywords-highlight :project-id="projectId" />
               <el-button slot="reference" size="small" type="primary" class="margin-right_10 margin-left_10"
                 :disabled="!$permission('/workspace/common/highlight')">
                 高亮<i class="el-icon-arrow-down el-icon--right"></i>
@@ -202,6 +202,7 @@ import reportFileDrawer from '@/views/report/components/drawer/reportFileDrawer.
 import addAndEditReport from '@/views/report/components/dialog/addAndEditReport.vue'
 import PatentBatchIndexVue from './components/dialog/PatentBatchIndex.vue'
 import patentInventorMergeDrawer from './components/drawer/MergeInventor.vue'
+import PatentKeywordsHighlight from '../components/PatentKeywordsHighlight.vue'
 export default {
   mixins: [fastSelectPatent],
   components: {
@@ -216,6 +217,7 @@ export default {
     addAndEditReport,
     PatentBatchIndexVue,
     patentInventorMergeDrawer,
+    PatentKeywordsHighlight
   },
   props: {},
   data() {

+ 4 - 2
src/views/project/patentDetails/components/menu.vue

@@ -120,9 +120,11 @@
 
 <script>
 import PatentLeft from './PatentLeft.vue';
+import PatentKeywordsHighlight from '../../components/PatentKeywordsHighlight.vue';
 export default {
   components: {
-    PatentLeft
+    PatentLeft,
+    PatentKeywordsHighlight
   },
   props: {
     menu:{
@@ -223,7 +225,7 @@ export default {
       }
       if(Object.keys(data).length>0){
         this.patentList.push(...data.data)
-        this.total = data.total>(200 * this.queryParams.size)?(200 * this.queryParams.size):data.total
+        this.total = data.total>10000?10000:data.total
       }
       if(Object.keys(nextData).length>0){
         this.patentList.push(nextData.data[0])

+ 4 - 8
src/views/project/patentDetails/components/patentDetails.vue

@@ -56,9 +56,7 @@
           </div>
 
           <div style="  position: relative; border-top: 1px solid #e6e6e6;text-align: center;" class="menu">
-            <el-link v-for="item in menuList" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value"
-              v-if="!item.show" :disabled="item.value === 'PatentPDF' ? !(patent.pdf && patent.pdf.length > 0) : false"
-              @click.native="handleSelect(item.value)">
+            <el-link v-for="item in menuList" :type="activeMenu === item.value ? 'primary' : undefined" :key="item.value" v-if="!item.show" @click.native="handleSelect(item.value)">
               {{ item.label }}
               <span v-if="item.value == 'PatentImage' || item.value == 'PatentPDF'" @click.stop="ending(item.value)">
                 <el-popover placement="right" width="400" trigger="click">
@@ -317,15 +315,13 @@ export default {
           // this.$set(this.patent, 'affair', response.data.affair)
         }
       })
-    },
+    },  
     //导入到专题库
     importToProject() {
       var form = {
         ...this.condition,
-        startNumber: 0,
-        endNumber: 0,
-        isAddPatentNos: [this.patent.patentNo],
-        isDeletePatentNos: [],
+        patentNos: [this.patent.patentNo],
+        // isDeletePatentNos: [],
       }
       this.$refs.projectListDialog.open(form);
     },

+ 2 - 43
src/views/project/patentDetails/components/patentMessage/PatentBasic.vue

@@ -62,7 +62,7 @@
       <el-col :span="6">
          <el-card shadow="never" class="text-align_center " style="margin-top:50px;" data-type="附图">
           <div style="height: 200px;" class="picture">
-            <el-image  :src="$commonJS.checkViewer(patent.pictureGuid)" :preview-src-list="[$commonJS.checkViewer(patent.pictureGuid)]" :style="{width:patent.imgWidth?patent.imgWidth:'100%',height:patent.imgHeight?patent.imgHeight:'100%'}">
+            <el-image  :src="outside?patent.pictureGuid:$commonJS.checkViewer(patent.pictureGuid)" :preview-src-list="[outside?patent.pictureGuid:$commonJS.checkViewer(patent.pictureGuid)]" :style="{width:patent.imgWidth?patent.imgWidth:'100%',height:patent.imgHeight?patent.imgHeight:'100%'}">
               <div slot="error" class="image-slot">
                 <img src="https://www.patentstar.com.cn/img/Common/nopic.jpg" alt="">
               </div>
@@ -174,50 +174,9 @@ export default {
     }
   },
   watch:{
-    patent(val,oldVal){
-      // if(val!=oldVal){
-      //   this.$nextTick(()=>{
-      //     if(!this.projectId && !this.patent.abstractPath2 && this.patent.publicNo){
-      //       var params = {
-      //         patentCell:4,
-      //         patentNo:this.patent.publicNo,
-      //         appNo:this.patent.applicationNo,
-      //       }
-      //       this.$api.getPatentPart(params).then(response=>{
-      //             if(response.code == 200){
-      //               if(Object.keys(response.data).length>0 && response.data.image.length>0){
-      //                 this.$set(this.patent,'abstractPath2',response.data.image[0].url)
-      //               }else{
-      //                 this.$set(this.patent,'abstractPath2','q')
-      //               }
-                    
-      //               this.getHeight(this.patent.abstractPath2, this.patent)
-      //             }
-      //         })
-      //     }
-      //   })
-      // }
-    }
+
   },
   mounted() {
-    // if(!this.projectId && !this.patent.abstractPath2 && this.patent.publicNo){
-    //   var params = {
-    //     patentCell:4,
-    //     patentNo:this.patent.publicNo,
-    //     appNo:this.patent.applicationNo,
-    //   }
-    //    this.$api.getPatentPart(params).then(response=>{
-    //         if(response.code == 200){
-    //           if(Object.keys(response.data).length>0 && response.data.image.length>0){
-    //             this.$set(this.patent,'abstractPath2',response.data.image[0].url)
-    //           }else{
-    //             this.$set(this.patent,'abstractPath2','q')
-    //           }
-
-    //           this.getHeight(this.patent.abstractPath2, this.patent)
-    //         }
-    //     })
-    // }
   },
 
   methods: {