zhuhao před 1 rokem
rodič
revize
80ecd16b09

+ 32 - 0
src/api/newApi/patent.js

@@ -255,4 +255,36 @@ export default {
   deleteHightLight(data) {
     return axios.post("/xiaoshi/hightlightTemplate/delete", data);
   },
+  /**
+   * 批注添加
+   * @param {*} data 
+   * @returns 
+   */
+  addScratchWords(data) {
+    return axios.post("/xiaoshi/scratchWords/add", data);
+  },
+  /**
+   * 批注查询
+   * @param {*} data 
+   * @returns 
+   */
+  queryScratchWords(data) {
+    return axios.post("/xiaoshi/scratchWords/queryScratchWords", data);
+  },
+  /**
+   * 批注更新
+   * @param {*} data 
+   * @returns 
+   */
+  updateDimension(data) {
+    return axios.post("/xiaoshi/scratchWords/update", data);
+  },
+  /**
+   * 批注删除
+   * @param {*} data 
+   * @returns 
+   */
+  removeScratchWords(data) {
+    return axios.post("/xiaoshi/scratchWords/removeScratchWords", data);
+  },
 }

+ 2 - 2
src/utils/window.js

@@ -24,9 +24,9 @@ exports.install = function (Vue) {
     const component = findComponentDownward(this, 'myCommonUse')
     component.checkImg(val)
   }
-  Vue.prototype.selectMark = function (val) {
+  Vue.prototype.selectMark = function (val,type) {
     const component = findComponentDownward(this, 'myCommonUse')
-    component.selectMark(val)
+    component.selectMark(val,type)
   }
 }
 

+ 95 - 28
src/views/components/dialog/menuDialog/annotation.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <el-dialog title="批注" v-draggable :visible.sync="visible" width="500px" custom-class="checkFile" :before-close="cancel"
-      :modal="false" :close-on-click-modal="false" :modal-append-to-body="false">
+    <el-dialog title="批注" v-draggable :visible.sync="visible" width="500px" custom-class="checkFile"
+      :before-close="cancel" :modal="false" :close-on-click-modal="false" :modal-append-to-body="false">
       <div
         style="display:flex;justify-content: space-between;font-size:14px;border-bottom: 1px white solid;padding-bottom: 5px;">
         <p style="font-weight:800;margin:0">{{ userinfo.name }}</p>
@@ -9,7 +9,8 @@
       </div>
       <div>
         <p style="display: flex;align-items: center;"><span style="width: 60px;">内容:</span><span
-            style="width: 100%;"><el-input type="textarea" v-model="mark.text" readonly rows="2"></el-input></span></p>
+            style="width: 100%;"><el-input type="textarea" v-model="mark.markSelectText" readonly
+              rows="2"></el-input></span></p>
       </div>
       <div>
         <p><span>颜色:</span>
@@ -29,33 +30,38 @@
         </p>
       </div>
       <div>
-        <p>
-          <span>使用权限:</span>
+        <p style="display:flex">
+          <!-- createFrom  0默认(专利)1专题库2报告 -->
+          <span>可见范围:</span>
           <span>
-            <el-radio-group v-model="mark.permissionType">
-              <el-radio :label="1">所有人可见</el-radio>
-              <el-radio :label="0">本人可见</el-radio>
+            <el-radio-group v-model="mark.publicScope">
+              <!-- <el-radio :label="1">{{ createFromText[mark.createFrom] }}</el-radio>
+              <el-radio :label="0">非{{ createFromText[mark.createFrom] }}</el-radio> -->
+              <el-radio :label="1">当前位置可见</el-radio>
+              <el-radio :label="0">全部位置可见</el-radio>
             </el-radio-group>
           </span>
         </p>
-        <p style="display:flex" v-if="mark.createFrom">
-          <!-- createFrom  0默认(专利)1专题库2报告 -->
-          <span>可见范围:</span>
+        <p>
+          <span>使用权限:</span>
           <span>
-            <el-switch v-model="mark.rangeType" active-color="#13ce66" inactive-color="#ff4949"
-              :active-text="createFromText[mark.createFrom]">
+            <el-switch v-model="mark.isPublic" active-color="#13ce66" inactive-color="#ff4949" active-text="所有人可见">
             </el-switch>
+            <!-- <el-radio-group v-model="mark.isPublic">
+              <el-radio :label="1">所有人可见</el-radio>
+              <el-radio :label="0">本人可见</el-radio>
+            </el-radio-group> -->
           </span>
         </p>
       </div>
       <div style="user-select: none;">
         <p style="margin-bottom:5px">标注:</p>
-        <el-input v-model="mark.remark" type="textarea" class="my-input-preview"></el-input>
+        <el-input v-model="mark.markOteText" type="textarea" class="my-input-preview"></el-input>
       </div>
       <div style="display:flex;justify-content: flex-end;align-items:center;">
         <el-button type="text" @click="cancel">取消</el-button>
         <el-button type="text" v-if="mark.id" @click="handleDelete">删除</el-button>
-        <el-button type="text"  @click="submit">确定</el-button>
+        <el-button type="text" @click="submit">确定</el-button>
       </div>
     </el-dialog>
   </div>
@@ -72,49 +78,92 @@ export default {
       mark: {},
       // 可见范围
       createFromText: {
-        0: '本专利可见',
-        1: '本专利数据库可见',
-        2: '本报告可见',
+        '0': '本专利可见',
+        '1': '本专利数据库可见',
+        '2': '本报告可见',
       }
     }
   },
   computed: {
-    ...mapGetters(['userinfo', 'projectId', 'contextMenu']),
+    ...mapGetters(['userinfo', 'contextMenu']),
+    // 批注相关信息
+    piZhuContrastList() {
+      return this.$store.state.highlight.piZhuContrastList
+    },
   },
   mounted() {
 
   },
   methods: {
+    // 点击波浪线等样式直接调用
+    submit2() {
+      this.getData()
+      this.submit()
+    },
+    // 查询批注
+    queryScratchWords() {
+      let params = {
+        patentNo: this.contextMenu.mark.patentNo,
+        projectId: this.contextMenu.mark.projectId
+      }
+      this.$api.queryScratchWords(params).then(response => {
+        if (response.code == 200) {
+          if (this.piZhuContrastList.length > 0) {
+            var a = this.piZhuContrastList.filter(item => {
+              return item.patentNo != params.patentNo
+            }).concat(response.data.data)
+          } else {
+            var a = response.data.data
+          }
+          this.$store.commit('SET_PATENT_PIZHU_CONTRAST', a)
+        }
+      })
+    },
     // 确定
     submit() {
-      console.log(this.mark);
+      // console.log(this.mark.id);
       if (this.mark.id) {
-        this.$api.edit(this.mark).then(response => {
+        this.$api.updateDimension(this.mark).then(response => {
           if (response.code == 200) {
             this.$message.success('修改批注成功')
+            let index = this.piZhuContrastList.findIndex(item => {
+              return item.id == this.mark.id
+            })
+            if (index != -1) {
+              this.piZhuContrastList.splice(index, 1, this.mark)
+            }
             this.cancel()
           }
         }).catch(error => {
           this.$message.error('修改批注失败')
         })
       } else {
-        this.$api.add(this.mark).then(response => {
+        this.$api.addScratchWords(this.mark).then(response => {
           if (response.code == 200) {
             this.$message.success('添加批注成功')
+            var piZhuContrastList = this.piZhuContrastList
+            this.mark.id = response.data.data
+            piZhuContrastList.push(this.mark)
+            this.$store.commit('SET_PATENT_PIZHU_CONTRAST', piZhuContrastList)
             this.cancel()
           }
         }).catch(error => {
-          this.$message.error('添加批注失败')
+          // this.$message.error('添加批注失败')
         })
       }
     },
     // 删除
     handleDelete() {
-      console.log('批注删除');
       let ids = [this.mark.id]
-      this.$api.dele(ids).then(response => {
+      this.$api.removeScratchWords(ids).then(response => {
         if (response.code == 200) {
           this.$message.success('删除批注成功')
+          let index = this.piZhuContrastList.findIndex(item => {
+            return item.id == this.mark.id
+          })
+          if (index != -1) {
+            this.piZhuContrastList.splice(index, 1)
+          }
           this.cancel()
         }
       }).catch(error => {
@@ -123,7 +172,6 @@ export default {
     },
     // 取消
     cancel() {
-      console.log(1);
       this.visible = false
     },
     // 显示时间
@@ -137,10 +185,29 @@ export default {
       var S = date.getSeconds() > 9 ? date.getSeconds().toString() : "0" + date.getSeconds()
       return Y + '-' + m + '-' + d + ' ' + H + ':' + M + ':' + S
     },
+    getData() {
+      let mark = this.contextMenu.mark
+      this.mark = {
+        Id: mark.Id,
+        id: mark.id,//已添加数据的id
+        patentNo: mark.patentNo,//专利号
+        isPublic: mark.id ? mark.isPublic : mark.permissionType,//是否所有人可见
+        markColor: mark.markColor,//标注颜色
+        markOteText: mark.markOteText,//标注备注
+        markType: mark.markType,//标注方式(波浪线)
+        markSelectField: mark.id ? mark.markSelectField : mark.column,//标注栏位
+        markSelectText: mark.id ? mark.markSelectText : mark.text,//标注文本
+        markSite: mark.id ? mark.markSite : mark.position,//选中文本的起始位置
+        publicScope: mark.id ? mark.publicScope : 1,//标注的权限范围(本专利可见、本专题库可见、本报告可见都是传1,在所有地方可见是传0)
+        createFrom: mark.createFrom,//是在哪里进行的标注
+        projectId: mark.projectId,//项目id
+      }
+    },
     // 打开弹窗
     open() {
-      console.log(this.projectId, this.contextMenu);
-      this.mark = this.contextMenu.mark
+      // console.log(this.projectId, this.contextMenu, this.contextMenu.mark.createFrom);
+      this.getData()
+      // console.log(this.mark, this.contextMenu.mark.createFrom);
       this.visible = true
     },
   },

+ 1 - 1
src/views/components/indicia/components/indicia.vue

@@ -155,7 +155,7 @@ export default {
           search:this.searchOptions,
         }
       }
-      this.$api.queryScratchS(params).then((res) => {
+      this.$api.queryScratchWords(params).then((res) => {
         if (res.code == 200) {
           this.tableCollapseList = res.data.records
           if (!val) {

+ 69 - 37
src/views/layout/components/contextMenu.vue

@@ -9,7 +9,7 @@
 </template>
 
 <script>
-import {mapGetters} from 'vuex'
+import { mapGetters } from 'vuex'
 import contrast from '@/views/components/dialog/menuDialog/contrast.vue'
 import annotation from '@/views/components/dialog/menuDialog/annotation.vue'
 export default {
@@ -21,46 +21,80 @@ export default {
   props: {},
   data() {
     return {
-      showImg:false,
-      imgSrc:'',
+      showImg: false,
+      imgSrc: '',
     };
   },
   watch: {},
   computed: {
     ...mapGetters(["highlight"])
   },
-  created() {},
+  created() { },
   mounted() {
     // window.selectMark = this.selectMark
   },
   methods: {
     //查看图片
-    checkImg(e){
+    checkImg(e) {
       this.imgSrc = e.target.src
-    	this.showImg = true
+      this.showImg = true
     },
     //关闭图片弹窗
-    closeViewer(){
+    closeViewer() {
       this.showImg = false
     },
-     //点击图标回显数据
-     selectMark(id, selectType) {
-      var Id = id.substring(1,id.length)
-      if (selectType=='p') {//批注
-        var index = this.piZhuContrastList.findIndex(item => {
-        if (item.id == Id) {
-          // 清空currentSelectObj,否则Id与id同时存在
-          this.$store.commit("SET_PATENT_INDEX", item)
-        }
-        return item.id == Id
+    //点击图标回显数据
+    selectMark(id, selectType) {
+      var Id = id.substring(1, id.length)
+      if (selectType == 'p') {//批注
+        var index = this.highlight.piZhuContrastList.findIndex(item => {
+          if (item.id == Id) {
+            // 清空currentSelectObj,否则Id与id同时存在
+            this.$store.commit("SET_PATENT_INDEX", item)
+          }
+          return item.id == Id
         })
         if (index != -1) {
+          document.addEventListener("click", function (e) {
+          //   console.log(e.clientX)
+          //   console.log(e.clientY)
+          //   var menuContent = []
+          // if (this.reportType == 1 || this.reportType == 2) {
+          //   menuContent = [
+          //     {
+          //       name: "对比",
+          //       method: "contrast",
+          //     }
+          //   ]
+          // }
+          // this.$store.commit("SET_CONTEXT_MENU", {
+          //   clientX: 200,
+          //   clientY: 200,
+          //   displayContextMenu: true,
+          //   menuContent: menuContent
+          // })
+          })
+          // var menuContent = []
+          // if (this.reportType == 1 || this.reportType == 2) {
+          //   menuContent = [
+          //     {
+          //       name: "对比",
+          //       method: "contrast",
+          //     }
+          //   ]
+          // }
+          // this.$store.commit("SET_CONTEXT_MENU", {
+          //   clientX: 200,
+          //   clientY: 200,
+          //   displayContextMenu: true,
+          //   menuContent: menuContent
+          // })
           // 打开批注框
           this.$refs.annotation.open()
         }
       } else if (selectType == 'c') {//对比
-        let a=this.highlight.contrastList.find(item => {
-          return item.id==Id
+        let a = this.highlight.contrastList.find(item => {
+          return item.id == Id
         })
         a.column = a.fieldName
         a.text = a.evidenceText
@@ -68,45 +102,43 @@ export default {
         this.contrast()
       } else if (selectType == 'o') {
       }
-      
+
     },
-    getMethod(type){
-        if(this[type]){
-           this[type]() 
-        }
+    getMethod(type) {
+      if (this[type]) {
+        this[type]()
+      }
     },
     //波浪线
-    wave(){
-        console.log('波浪线')
+    wave() {
+      this.$refs.annotation.submit2()
     },
     //下划线
-    underscore(){
-      console.log('下划线')
+    underscore() {
+      this.$refs.annotation.submit2()
     },
     //高亮
-    addHighlight(){
-      console.log('高亮')
+    addHighlight() {
+      this.$refs.annotation.submit2()
     },
     //批注
-    mark(){
-      console.log('批注')
+    mark() {
       this.$refs.annotation.open()
     },
     //修改颜色
-    changeColor(){
+    changeColor() {
       console.log('修改颜色')
     },
     //对比
-    contrast(){
+    contrast() {
       console.log('对比')
       this.$refs.contrast.open()
     },
     //删除批注
-    deleteMark(){
+    deleteMark() {
       console.log('删除')
     },
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 58 - 22
src/views/project/components/PatentKeywordsHighlight.vue

@@ -2,7 +2,7 @@
   <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>
+        <el-switch v-model="form.ifEnable" 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>
@@ -15,16 +15,19 @@
           </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>
+            <el-input v-model="item.description" 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>
+            <el-button type="danger" size="small" @click="handleDelete" v-if="!form.ifDefault"
+              :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-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>
@@ -33,7 +36,7 @@
           <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-input v-model="item.description" placeholder="请输入专利高亮关键词"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -58,7 +61,38 @@ export default {
       btnLoading2: false,
       rules: {
         name: [{ required: true, message: '请输入专题库名称', trigger: 'blur' },],
-      }
+      },
+      templateLst: [
+        {
+          "name": "新模板",
+          "projectId": this.projectId,
+          // "userId": 103,
+          "ifEnable": true,
+          "ifDefault": true,
+          "configs": [
+            {
+              "color": "#5470c6",
+              "description": ""
+            },
+            {
+              "color": "#91cc75",
+              "description": ""
+            },
+            {
+              "color": "#fac858",
+              "description": ""
+            },
+            {
+              "color": "#ee6666",
+              "description": ""
+            },
+            {
+              "color": "#73c0de",
+              "description": ""
+            }
+          ],
+        }
+      ],
     }
   },
   mounted() {
@@ -73,8 +107,8 @@ export default {
       this.onChange2()
     },
     onChange2(input) {
-      if (!this.form.enable && input) {
-        this.form.enable = true
+      if (!this.form.ifEnable && input) {
+        this.form.ifEnable = true
       }
       this.$store.commit('SET_PATENT_HIGHLIGHT', this.form)
     },
@@ -85,28 +119,28 @@ export default {
       //       "name": "默认模板",
       //       "projectId": 425,
       //       "userId": 103,
-      //       "enable": true,
-      //       "_default": true,
+      //       "ifEnable": true,
+      //       "ifDefault": true,
       //       "configs": [
       //           {
       //               "color": "#5470c6",
-      //               "keywords": ""
+      //               "description": ""
       //           },
       //           {
       //               "color": "#91cc75",
-      //               "keywords": ""
+      //               "description": ""
       //           },
       //           {
       //               "color": "#fac858",
-      //               "keywords": ""
+      //               "description": ""
       //           },
       //           {
       //               "color": "#ee6666",
-      //               "keywords": ""
+      //               "description": ""
       //           },
       //           {
       //               "color": "#73c0de",
-      //               "keywords": ""
+      //               "description": ""
       //           }
       //       ],
       //         "id": 1085
@@ -115,21 +149,21 @@ export default {
       //   this.onChange()
       //   return
       let params = {
-        projectId:this.projectId
+        projectId: this.projectId
       }
       this.$api.queryHightLight(params).then(response => {
         this.dataList = response.data
         this.selected = 0
         this.onChange()
-      }).catch(error=>{
-       
+      }).catch(error => {
+
       })
     },
     // 新增按钮
     handleAdd() {
       this.btnLoading = true
       let params = {
-        projectId: this.projectId
+        projectId: this.projectId,
       }
       this.$api.saveOrUpdate(params).then(response => {
         this.dataList.push(response.data)
@@ -164,7 +198,7 @@ export default {
     // 删除高亮
     handleDelete() {
       this.btnLoading2 = true
-      let ids=[this.form.id]
+      let ids = [this.form.id]
       this.$api.deletePatentKeywordsHigh(ids).then(response => {
         this.$message.success('操作成功')
         this.btnLoading2 = false
@@ -185,19 +219,21 @@ export default {
     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>
+}</style>

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

@@ -282,7 +282,7 @@ export const handleData = {
       var arr1 = ['color', 'Type', 'Id', 'column', 'index', 'text', 'remark', 'temNode', 'selectType']
       var obj = {
         // 'piZhuContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'text', 'remark'],
-        'piZhuContrastList': ['markColor', 'markType', 'id', 'scratchField', 'position', 'text', 'remark'],
+        'piZhuContrastList': ['markColor', 'markType', 'id', 'markSelectField', 'markSite', 'markSelectText', 'markOteText'],
         'contrastList': ['markColor', 'markType', 'id', 'fieldName', 'position', 'evidenceText'],
         // 'opinionContrastList': ['color', 'scratchType', 'id', 'scratchField', 'position', 'content'],
         'opinionContrastList': ['markColor', 'markType', 'id', 'scratchField', 'position', 'content'],
@@ -446,14 +446,14 @@ export const highlight = {
       let el = selectObject.temNode;
       // 将当前页面获取到的字符串进行处理,返回当前页面所有的标签及文本
       var splitStrings = this.SplitHtmlTag1(el);
-      let bgColor = selectObject.markColor;
+      let bgColor = selectObject.color;
       if (!bgColor) {
         selectObject.color = 'yellow'
       }
-
+      
       // 添加线及高亮(2:波浪线,0:下划线,1:高亮)
       var style = ''
-      switch (selectObject.Type) {
+      switch (selectObject.Type + '') {
         case '0'://下划线
           style = `text-decoration-line: underline;text-decoration-color: ${selectObject.color}`
           break;

+ 15 - 14
src/views/project/patentDetails/components/patentDetails.vue

@@ -293,6 +293,7 @@ export default {
     patentNo(val) {
       if (val) {
         this.getPatent()
+        this.getPiZhuData(val)
       }
     }
   },
@@ -314,27 +315,27 @@ export default {
   methods: {
     // 获取批注
     getPiZhuData(val) {
-      if (val) {
-        var index = this.piZhuContrastList.findIndex(item => {
-          item.patentNo == val
-        })
-        if (index != -1) {
-          return false;
-        }
-      }
+      
+      // if (val) {
+      //   var index = this.piZhuContrastList.findIndex(item => {
+      //     item.patentNo == val
+      //   })
+      //   if (index != -1) {
+      //     return false;
+      //   }
+      // }
       let params = {
-        patentNo: val ? val : this.patent.patentNo,
-        id: this.reportId,
-        createFrom: this.reportId ? 2 : 0
+        patentNo: val ? val : this.patentNo,
+        projectId:this.projectId,
       }
-      this.$api.scratchWordsQuery(params).then(response => {
+      this.$api.queryScratchWords(params).then(response => {
         if (response.code == 200) {
           if (this.piZhuContrastList.length > 0) {
             var a = this.piZhuContrastList.filter(item => {
               return item.patentNo != params.patentNo
-            }).concat(response.data)
+            }).concat(response.data.data)
           } else {
-            var a = response.data
+            var a = response.data.data
           }
           this.$store.commit('SET_PATENT_PIZHU_CONTRAST', a)
         }

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

@@ -46,7 +46,7 @@ export default {
     //   this.refresh()
     // },
     patentNo() {
-      if (!this.outside) {
+      if (this.outside) {
         this.getData()
       }
     }
@@ -56,7 +56,7 @@ export default {
   },
   mounted() {
     this.handleResize()
-    if (!this.outside) {
+    if (this.outside) {
       this.getData()
     }
   },