소스 검색

前端bug修改

zhuliu 1 년 전
부모
커밋
48390ff5c3

+ 5 - 0
src/assets/css/main.scss

@@ -122,6 +122,11 @@
     }
     p{
       margin: 0;
+      cursor: pointer;
+    }
+    p:hover{
+      background-color: #ecf5ff;
+      color: #66b1ff;
     }
   }
 

+ 5 - 0
src/utils/axios.js

@@ -101,6 +101,11 @@ _axios.interceptors.response.use(
       title: '系统错误',
       message: error.response.data.message
     })
+    if(error.response.data.message == '未登录'){
+      Router.push({
+        path: `/login`
+      }).then(r => {})
+    }
     isRefreshing = false
     return Promise.reject(error);
   }

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

@@ -7,7 +7,7 @@
           </mySearch>
         </div>
         <div>
-          <span>分组查询:</span>
+          <span>分组:</span>
           <el-select v-model="groupingValue" size="small" @change="changeGrouping" class="indicia-top-select">
             <el-option v-for="item in groupingOption" :key="item.value" :label="item.label" :value="item.value">
             </el-option>

+ 45 - 14
src/views/project/patentCollection/index.vue

@@ -47,13 +47,25 @@
                 <!-- <el-dropdown-item @click.native="handleQuestion" v-if="$permission('/workspace/event')">事
                   件</el-dropdown-item> -->
                 <el-dropdown-item @click.native="handleField" v-disabled="false">自定义栏位管理</el-dropdown-item>
-                <el-dropdown-item @click.native="exportPDF">导出PDF首页</el-dropdown-item>
+                <!-- <el-dropdown-item @click.native="exportPDF">导出PDF首页</el-dropdown-item> -->
+                <el-dropdown-item>
+                  <el-dropdown trigger="hover" placement="right-start">
+                    <p>
+                      导出PDF首页<i class="el-icon-arrow-right el-icon--right"></i>
+                    </p>
+                    <el-dropdown-menu slot="dropdown">
+                      <el-dropdown-item @click.native="exportPDF(false)">当前全部</el-dropdown-item>
+                      <el-dropdown-item @click.native="exportPDF(true)">当前所选</el-dropdown-item>
+                    </el-dropdown-menu>
+                  </el-dropdown>
+                </el-dropdown-item>
+                
                 <!-- <el-dropdown-item @click.native="handleBatch"
                   :disabled="!($permission('/workspace/folder/batchUploadSpecification') && $r(projectId, [1, 2]))">批量上传说明书</el-dropdown-item>
                 <el-dropdown-item> -->
                 <el-dropdown trigger="hover" placement="right-start">
                   <p>
-                    导出专利<i class="el-icon-arrow-right el-icon--right"></i>
+                    导出Excel档<i class="el-icon-arrow-right el-icon--right"></i>
                   </p>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item @click.native="handleExport(false)">当前全部</el-dropdown-item>
@@ -600,7 +612,7 @@ export default {
     //导出专利
     async handleExport(val) {
       if (val) {
-        if (this.startNumber < 0 && this.endNumber < 1 || this.queryParams.isAdd.length == 0) {
+        if ( this.endNumber < 1 || this.queryParams.isAdd.length == 0) {
           this.$message.error('请先选择专利')
           return false
         }
@@ -628,18 +640,37 @@ export default {
       window.open(router.href, '_blank')
     },
     //PDF首页导出
-    exportPDF() {
-      let params = {
-        projectId: this.projectId,
-        searchQuery: this.searchStr || '',//检索条件
-        customFields: this.customFields || [],//自定义字段的检索
-        isAdd: this.queryParams.isAdd,
-        isDelete: this.queryParams.isDelete,
-        startNumber: this.startNumber,
-        // endNumber: this.endNumber,
-        endNumber: this.total,//默认是当前全部
-        orderDTOList:this.sort,
+    exportPDF(sign) {
+      if (sign) {
+        if ( this.endNumber < 1 || this.queryParams.isAdd.length == 0) {
+          this.$message.error('请先选择专利')
+          return false
+        }
+      }
+      if(sign){
+        var params = {
+          projectId: this.projectId,
+          searchQuery: this.searchStr || '',//检索条件
+          customFields: this.customFields || [],//自定义字段的检索
+          isAdd: this.queryParams.isAdd,
+          isDelete: this.queryParams.isDelete,
+          startNumber: this.startNumber,
+          endNumber: this.endNumber,
+          orderDTOList:this.sort,
+        }
+      }else{
+        var params = {
+          projectId: this.projectId,
+          searchQuery: this.searchStr || '',//检索条件
+          customFields: this.customFields || [],//自定义字段的检索
+          isAdd: [],
+          isDelete: [],
+          startNumber: 1,
+          endNumber: this.total,//默认是当前全部
+          orderDTOList:this.sort,
+        }
       }
+      
       this.$api.exportPDFFirstPage(params).then(res => {
         if (res.code == 200) {
           const h = this.$createElement;

+ 4 - 1
src/views/project/patentDetails/components/PatentField.vue

@@ -153,7 +153,9 @@ export default {
       var order = this.customField[current].sysOrder
       this.customField[current].sysOrder = this.customField[next].sysOrder
       this.customField[next].sysOrder = order
-      this.customField.splice(this.customField[current], 0, this.customField[next])
+      var temp = JSON.parse(JSON.stringify(this.customField[current]))
+      this.customField[current] = JSON.parse(JSON.stringify(this.customField[next]))
+      this.customField[next] = temp
       let params = {
         taskId: this.taskId,
         projectId: this.projectId,
@@ -164,6 +166,7 @@ export default {
         if (res.code == 200) {
           this.$message('移动成功')
           // this.getCustomField()
+          this.$forceUpdate()
         }
       })
     },

+ 119 - 0
src/views/project/patentDetails/components/PatentMark.vue

@@ -0,0 +1,119 @@
+<template>
+  <div class="content">
+    <div class="item" v-for="item in patentMark" :key="item.id" :style="{'background':item.markColor}">
+      <el-popover
+        placement="bottom"
+        width="200"
+        trigger="hover">
+      <div>
+        <p><span style="color: #409EFF;">栏位:</span><span>{{ item.fieldName }}</span></p>
+        <!-- <p>栏位:{{ item.scratchField }}</p> -->
+        <p><span style="color: #409EFF;" class="noWrap">选中文本:</span>{{ item.text }}</p>
+        <p v-if="item.remark" class="noWrap"><span style="color: #409EFF;">标注:</span>{{ item.remark }}</p>
+      </div>
+      <div slot="reference" style="height:100%;width:100%" @click.prevent.stop="runTo(item)"></div>
+      </el-popover>
+    </div>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+export default {
+  props:['patentNo','reportType'],
+  data() {
+    return {
+      patentMark:[]
+    }
+  },
+  computed: {
+    ...mapGetters(['highlight']),
+  },
+  watch: {
+    patentNo(val) {
+      this.getPatentMark()
+    },
+  },
+  mounted() {
+    this.getPatentMark()
+  },
+  methods: {
+    getPatentMark() {
+      var contrastList = []
+      var pizhu = this.highlight.piZhuContrastList
+      if(this.reportType == 1 || this.reportType == 2){
+        contrastList = this.highlight.contrastList
+      }
+      var data = contrastList.concat(pizhu)
+      this.$nextTick(() => {
+        this.patentMark=[]
+        var a = ['摘要', '权利要求', '说明书']
+        // var b = data.filter(item => {
+        //   if(item.patentNo == this.patentNo){
+        //     var obj = {
+        //       id:item.id,
+        //       position:item.position || item.markSite,
+        //       fieldName:item.fieldName || item.markSelectField,
+        //       markColor:item.markColor,
+        //       text:item.evidenceText || item.markSelectText,
+        //       patentNo:item.patentNo,
+        //       markType:item.markType,
+        //       remark:item.markNoteText
+        //     }
+        //     return obj
+        //   }
+        // })
+        var b = []
+        for(var i = 0;i<data.length;i++){
+          var item = data[i]
+          if(item.patentNo == this.patentNo){
+            var obj = {
+              id:item.id,
+              position:item.position || item.markSite,
+              fieldName:item.fieldName || item.markSelectField,
+              markColor:item.markColor,
+              text:item.evidenceText || item.markSelectText,
+              patentNo:item.patentNo,
+              markType:item.markType,
+              remark:item.markNoteText,
+              highlightType:item.position?'c':'p'
+            }
+            b.push(obj)
+          }
+        }
+        console.log(b,data)
+        /**方案四 */
+        var c = []
+        a.forEach((item,index) => {
+          c[index] = b.filter(item2 => {
+            return item2.fieldName.indexOf(item) != -1
+          })
+          c[index].sort((a, b) => {
+            return a.position - b.position
+          })
+        })
+        this.patentMark = [].concat(...c)
+      })
+    },
+    runTo(val) {
+      this.$emit('biaozhu',val)
+    }
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.item{
+  width: 8px;
+  height: 8px;
+  border: 1px solid black;
+  margin:2px 2px;
+}
+.content{
+  max-width: 300px;
+  max-height: 50px;
+  overflow: auto;
+  display: flex;
+  flex-wrap: wrap;
+}
+</style>

+ 46 - 26
src/views/project/patentDetails/components/patentDetails.vue

@@ -29,11 +29,13 @@
                 </el-link>
               </div>
             </div>
-            <!-- <PatentMark :patentNo="patent.patentNo" @biaozhu="getBiaoZhu"></PatentMark> -->
             <div v-if="outside">
               <el-button type="primary" size="small" @click="importToProject">导入专利</el-button>
             </div>
             <div style="display: flex;justify-content: space-between;margin-right: 10px;align-items: center;" v-else>
+              <!-- <div>
+                <PatentMark :patentNo="patent.patentNo" :reportType="reportType" @biaozhu="getBiaoZhu"></PatentMark>
+              </div> -->
               <el-dropdown size="medium" style="margin-right:10px">
                 <el-button type="primary" size="small">
                   创建报告<i class="el-icon-arrow-down el-icon--right"></i>
@@ -81,7 +83,7 @@
             <my-view :position="this.positionList.find(item => item.value == radio).position"
               :showView="radio != 1 && activeMenu != activeMenu2">
               <div slot="left">
-                <component :activeName="activeMenu" style="width:100%;padding-right: 10px;" :is="activeMenu"
+                <component :activeName="activeName" style="width:100%;padding-right: 10px;" :is="activeMenu"
                   :evidence="evidence" :signPatentNo="signPatentNo" :reportType="reportType" :project-id="projectId"
                   :outside="outside" :projectType="projectType" :patent="patent" :patentNo="patent.patentNo"
                   :domId="$commonJS.uuid(36)" @refresh="getPatent()"></component>
@@ -144,6 +146,7 @@ import { projectData, handleData } from '../../patentCollection/components/mixin
 import PatentField from './PatentField.vue'
 import addAndEditReport from '@/views/report/components/dialog/addAndEditReport.vue'
 import projectListDialog from "@/views/components/import/conditionImport/components/projectListDialog.vue";
+import PatentMark from './PatentMark.vue'
 export default {
   components: {
     PatentBasic,
@@ -164,7 +167,8 @@ export default {
 
     PatentField,
     addAndEditReport,
-    projectListDialog
+    projectListDialog,
+    PatentMark
   },
   mixins: [projectData, handleData],
   props: {
@@ -310,13 +314,13 @@ export default {
       activeMenu: 'PatentBasic',
       activeMenu2: '',
       patent: {},
+      activeName:'0',
     };
   },
   watch: {
     patentNo(val) {
       if (val && !this.fix) {
         this.getPatent()
-        this.getPiZhuData(val)
       }
     }
   },
@@ -329,7 +333,7 @@ export default {
   mounted() {
     this.getSignPermission()
     this.getPatent()
-    this.getPiZhuData()
+    
   },
   methods: {
     async getSignPermission(){
@@ -339,25 +343,7 @@ export default {
         this.signPermission = false
       }
     },
-    // 获取批注
-    getPiZhuData(val) {
-      let params = {
-        patentNo: val ? val : this.patentNo,
-        projectId: this.projectId,
-      }
-      this.$api.queryScratchWords(params).then(response => {
-        if (response.code == 200) {
-          if (this.highlight.piZhuContrastList.length > 0) {
-            var a = this.highlight.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)
-        }
-      })
-    },
+    
     // 获取外部摘要附图的guid,获取外部的法律状态
     getData() {
       var params = {
@@ -383,8 +369,42 @@ export default {
       }
       this.$refs.projectListDialog.open(form);
     },
-    getBiaoZhu() {
-
+    //获取需要跳转的批注
+    getBiaoZhu(val) {
+      if (val.fieldName.indexOf('摘要')!=-1) {
+        this.activeMenu = 'PatentBasic'
+      } else { 
+        this.activeMenu = this.menuList.find(item => {
+          return val.fieldName.indexOf(item.label)!=-1
+        }).value
+          if (val.fieldName.indexOf('译文') !=-1) {
+          this.activeName = '1'
+          } else {
+            this.activeName='0'
+          }
+      }
+      this.handleSelect(this.activeMenu)
+      
+        this.tiaozhuan(val)
+    },
+    tiaozhuan(val) {
+      var dom = `.${val.highlightType}${val.id}`
+      let target = document.querySelector(dom)
+      target.scrollIntoView({
+        block: 'start',
+        inline: 'nearest',
+        behavior: 'smooth'
+      })
+      // const href = `#${id}`
+      // const anchor = document.createElement('a');
+      //   anchor.href = href;
+      //   anchor.style.display = "none";
+      //   document.body.appendChild(anchor);
+      //   setTimeout(function () {
+      //     anchor.click();
+      //     document.body.removeChild(anchor);
+      //   }, 66);
+      //   return true;
     },
     //获取专利信息
     getPatent() {

+ 1 - 0
src/views/project/patentDetails/components/patentMessage/PatentPDF.vue

@@ -41,6 +41,7 @@ export default {
   },
   watch: {
     patentNo() {
+      this.pdfType = 1
       if (this.outside) {
         this.getData()
       }else{

+ 9 - 1
src/views/project/patentDetails/components/patentMessage/mixins/index.js

@@ -20,15 +20,23 @@ export const patentDetails = {
     },
     patentNo:{
       default:null
+    },
+    activeName:{
+      default:'0'
     }
   },
   data() {
     return {
-      name: '0',
+      name: this.activeName,
       anchorOffset: null,
       loading:false
     }
   },
+  watch:{
+    activeName(){
+      this.name = this.activeName
+    }
+  },
   computed: {
     ...mapGetters(["contextMenu"]),
     textStyle() {

+ 26 - 1
src/views/project/patentDetails/index.vue

@@ -107,7 +107,8 @@ export default {
       this.$store.commit("SET_PATENT_CONTRAST",[])
       this.getContrast()
     }
-    
+    this.$store.commit('SET_PATENT_PIZHU_CONTRAST', [])
+    this.getPiZhuData()
   },
   methods: {
     //获取对比记录
@@ -136,6 +137,7 @@ export default {
             var data = response.data.data.map(item=>{
               item.signPatentNo = this.signPatentNo
               item.projectId = this.projectId
+              item.patentNo = this.evidenceData.literatureNo
               return item
             })
             contrastList.push(...data)
@@ -144,6 +146,25 @@ export default {
         }
       })
     },
+    // 获取批注
+    getPiZhuData(val) {
+      let params = {
+        patentNo: val ? val : this.patentNo,
+        projectId: this.projectId,
+      }
+      this.$api.queryScratchWords(params).then(response => {
+        if (response.code == 200) {
+          if (this.highlight.piZhuContrastList.length > 0) {
+            var a = this.highlight.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)
+        }
+      })
+    },
     // 获取协同按钮
     getMenuPrice() {
       if (this.reportType == 4 && !this.taskId) {
@@ -197,6 +218,10 @@ export default {
       } else {
         this.patentNo = val
       }
+      if(this.reportType == 1 || this.reportType == 2){
+        this.getContrast()
+      }
+      this.getPiZhuData()
       this.$router.push(
         {
           path: '/patentDetails/' + this.patentNo,