소스 검색

Merge branch 'product' of http://1.116.113.26:8088/zhuliu/xiaoshi_system into product

zhuhao 1 년 전
부모
커밋
4b8b613a96

+ 4 - 2
src/api/index.js

@@ -10,7 +10,7 @@ import download from "./download";
 import client from "./client";
 import user from "./user";
 import task from "./task";
-import patent from "./patent";
+// import patent from "./patent";
 import admin from "./admin";
 import permission from "./permission";
 import reportManage from "./reportManage";
@@ -35,6 +35,7 @@ import newReport from "./newApi/report"
 import patentMining from "./newApi/patentMining"
 import task2 from "./newApi/task"
 import importAndExport from './newApi/importAndExport'
+import patent from './newApi/patent'
 
 export default {
   ...report,
@@ -69,5 +70,6 @@ export default {
   ...newReport,
   ...patentMining,
   ...task2,
-  ...importAndExport
+  ...importAndExport,
+  ...patent
 }

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

@@ -0,0 +1,10 @@
+
+import axios from "@/utils/axios";
+export default {
+     /**
+     * 专利详情
+     */
+     selectPatentDetail(data) {
+        return axios.post("/xiaoshi/patent/selectPatentDetail", data);
+    },
+}

+ 30 - 0
src/utils/common.js

@@ -2,6 +2,36 @@ import api from '@/api'
 import router from '../router'
 import { Message } from 'element-ui'
 export default {
+  /**
+   * 防抖
+   * @param {Function} func 
+   * @param {Number} duration 
+   * @returns 
+   */
+  debounce(func , duration=500){
+    let timer;
+    return ()=>{
+      clearTimeout(timer)
+      timer = setTimeout(func,duration)
+    }
+  },
+  /**
+   * 节流
+   * @param {Function} func 
+   * @param {Number} delay 
+   * @returns 
+   */
+  throttle(func,delay=2000){
+    let flag = true
+    return ()=>{
+      if(!flag) return;
+      flag = false;
+      setTimeout(()=>{
+        func()
+        flag = true
+      },delay)
+    }
+  },
   //object转字符串
   objectToString(val) {
     var data = []

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

@@ -23,6 +23,10 @@ export const projectData = {
       default: () => {
         return []
       }
+    },
+    //专利号
+    projectId:{
+      default:0
     }
   },
   data() {
@@ -38,7 +42,10 @@ export const projectData = {
     handleClick(row,key){
       this.$router.push(
         {
-          path:'patentDetails/'+row.patentNo
+          path:'patentDetails/'+row.patentNo,
+          query:{
+            projectId:row.id
+          }
         }
       )
     },
@@ -59,7 +66,6 @@ export const handleData = {
     return {
       refresh: true,
       click: false,
-      projectId:''
     }
   },
   mounted() {

+ 2 - 4
src/views/project/patentCollection/index.vue

@@ -143,8 +143,6 @@ export default {
       searchOption: {
         name: localStorage.searchContent,
       },
-      //专利数据库ID
-      projectId: 0,
       //视图方式
       viewList: [
         {
@@ -201,7 +199,7 @@ export default {
   watch: {},
   computed: {
     // 专题库id
-    id() {
+    projectId() {
       return this.$route.query.id
     },
   },
@@ -267,7 +265,7 @@ export default {
       }
       let params = {
         ...this.queryParams,//分页信息
-        projectId: this.id,
+        projectId: this.projectId,
         searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
         orderDTOList: this.sort,//排序信息
       }

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

@@ -20,7 +20,7 @@
               <el-button v-popover:heightPopover size="small"><i class="iconfont icon-wodegaoliang"></i></el-button>
             </el-tooltip>
             <el-tooltip content="对比" placement="top">
-              <el-button size="small" @click="value = !value">
+              <el-button size="small" @click="contrast()">
                 <i v-if="!value" class="iconfont icon-duibi"></i>
                 <i v-else class="iconfont icon-duibi1"></i>
               </el-button>
@@ -98,7 +98,11 @@
 <script>
 export default {
   components: {},
-  props: {},
+  props: {
+    projectId:{
+      default:0
+    }
+  },
   data() {
     return {
         value:false,//对比

+ 39 - 7
src/views/project/patentDetails/components/patentDetails.vue

@@ -2,8 +2,8 @@
   <div class="height_100">
     <el-container>
         <el-header style="min-height: 100px !important;height: auto;">
-            <div class="patent-articles-title-box">
-              <div style="display: flex;justify-content: space-between;align-items: center;">
+            <div style="width:100%">
+              <div style="display: flex;justify-content: space-between;align-items: center;height:50px">
                 <div style="text-align: start;padding-left: 10px;position: relative;">
                   <div style="width: 260px;">
                     <img src="@/assets/visual/fixed.png" width="20px" height="20px"
@@ -49,7 +49,7 @@
                 </div>
               </div>
 
-              <div style="  position: relative; border-top: 1px solid #e6e6e6;text-align: center;">
+              <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)">
@@ -77,8 +77,8 @@
                 <div class="patent-article-left" :style="{ width: showRight ? 'calc(100% - 321px)' : 'calc(100% - 21px)' }">
                     <my-view :position="this.positionList.find(item=>item.value == radio).position" :showView="radio!=1 && activeMenu != activeMenu2">
                         <div slot="left">
-                            <component :activeName="activeName" style="width:100%;padding-right: 10px;"
-                              :is="activeName" :project-id="projectId" :patent="patent" :patentNo="[patent.patentNo]"
+                            <component :activeName="activeMenu" style="width:100%;padding-right: 10px;"
+                              :is="activeMenu" :project-id="projectId" :patent="patent" :patentNo="[patent.patentNo]"
                               :domId="patent.patentNo + '1'" 
                               @refresh="getPatent()"></component>
                         </div>
@@ -119,6 +119,8 @@ import PatentInstruction from './patentMessage/PatentInstruction.vue'
 import PatentFamily from './patentMessage/PatentFamily.vue'
 import PatentStatus from './patentMessage/PatentStatus.vue'
 import PatentPDF from './patentMessage/PatentPDF.vue'
+import {projectData,handleData} from '../../patentCollection/components/mixins/index'
+
 export default {
   components: {
     PatentBasic,
@@ -129,9 +131,13 @@ export default {
     PatentStatus,
     PatentPDF
   },
+  mixins: [projectData,handleData],
   props: {
     projectId:{
         default:0
+    },
+    patentNo:{
+      type:String
     }
   },
   data() {
@@ -240,16 +246,37 @@ export default {
         activeOption: 'PatentField',
         activeMenu: 'PatentBasic',
         activeMenu2: '',
+        value:false,
+        patent:{}
     };
   },
-  watch: {},
+  watch: {
+    patentNo(val){
+      if(val){
+        this.getPatent()
+      }
+    }
+  },
   computed: {},
   created() {},
-  mounted() {},
+  mounted() {
+    this.getPatent()
+  },
   methods: {
     getBiaoZhu(){
 
     },
+    //获取专利信息
+    getPatent(){
+      var params= {
+        patentNo:this.patentNo
+      }
+      this.$api.selectPatentDetail(params).then(response=>{
+        if(response.code == 200){
+          this.patent = response.data
+        }
+      })
+    },
     // 创建报告:无效分析等点击事件
     handleAnalyse(id) {
       this.$api.getProject({ id: this.projectId }).then(response => {
@@ -296,4 +323,9 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
+.menu{
+  .el-link{
+    margin-right: 20px;
+  }
+}
 </style>

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

@@ -164,9 +164,9 @@
 </template>
 
 <script>
-
+import { patentDetails } from './mixins';
 export default {
-  mixins: [],
+  mixins: [patentDetails],
   data() {
     return {
       inputLabelVisible: false,
@@ -175,49 +175,49 @@ 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')
-                    }
+      // 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)
-                  }
-              })
-          }
-        })
-      }
+      //               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')
-              }
+    // 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)
-            }
-        })
-    }
+    //           this.getHeight(this.patent.abstractPath2, this.patent)
+    //         }
+    //     })
+    // }
   },
 
   methods: {

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

@@ -72,10 +72,9 @@
 </template>
 
 <script>
-import { commonMixins } from "./mixins"
-
+import { patentDetails } from './mixins';
 export default {
-  mixins: [commonMixins],
+  mixins: [patentDetails],
   data() {
     return {
       type: 1,

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

@@ -44,10 +44,9 @@
 </template>
 
 <script>
-import { commonMixins } from "./mixins"
-
+import { patentDetails } from './mixins';
 export default {
-  mixins: [commonMixins],
+  mixins: [patentDetails],
   data() {
     return {
       value:25,

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

@@ -14,10 +14,9 @@
 </template>
 
 <script>
-// import { commonMixins,addContrast } from "./mixins"
-// import { patentKeywordsHighlight,changeTranslation } from "@/views/workspace/folder/components/mixins";
+import { patentDetails } from './mixins';
 export default {
-  // mixins: [commonMixins, patentKeywordsHighlight, changeTranslation, addContrast],
+  mixins: [patentDetails],
   data() {
     return {
       height: null,

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

@@ -25,7 +25,9 @@
 </template>
 
 <script>
+import { patentDetails } from './mixins';
 export default {
+  mixins: [patentDetails],
   props: ['patent', 'projectId','pdfType1','sign','patentNo'],
   components: {},
   data() {

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

@@ -32,16 +32,10 @@
 </template>
 
 <script>
-// import { commonMixins, addContrast } from "./mixins";
-// import { patentKeywordsHighlight, changeTranslation} from "@/views/workspace/folder/components/mixins";
+import { patentDetails } from './mixins';
 import html2canvas from "html2canvas"
 export default {
-  // mixins: [
-  //   commonMixins,
-  //   patentKeywordsHighlight,
-  //   changeTranslation,
-  //   addContrast,
-  // ],
+  mixins: [patentDetails],
   data() {
     return {
       expends: [],

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

@@ -24,11 +24,9 @@
 </template>
 
 <script>
-import { commonMixins } from "./mixins"
-
+import { patentDetails } from './mixins';
 export default {
-  components: {  },
-  mixins: [commonMixins],
+  mixins: [patentDetails],
   data() {
     return {
       tableData: [],

+ 25 - 0
src/views/project/patentDetails/components/patentMessage/mixins/index.js

@@ -0,0 +1,25 @@
+import {projectData,handleData} from '@/views/project/patentCollection/components/mixins'
+export const patentDetails={
+    mixins:[projectData,handleData],
+    props:{
+        patent:{
+            default:()=>{
+                return {}
+            }
+        },
+    },
+    computed:{
+        textStyle(){
+          return this.$store.state.patent.style
+        }
+      },
+    methods: {
+        setStyle(){
+            if(!this.textStyle){
+              return false
+            }
+            return 'font-size:'+this.textStyle.size+'px;line-height:'+this.textStyle.lineHeight+';padding:'+this.textStyle.padding[0]+'px '+this.textStyle.padding[1]+'px '+this.textStyle.padding[2]+'px '+this.textStyle.padding[3]+'px'
+        },
+        mouseup(){},
+    },
+}

+ 15 - 7
src/views/project/patentDetails/index.vue

@@ -1,13 +1,13 @@
 <template>
   <div class="height_100 article">
-    <articleMenu @contrast="contrast"></articleMenu>
-    <div class="height_100">
+    <articleMenu @contrast="contrast" :projectId="projectId"></articleMenu>
+    <div class="height_100 content">
         <my-View :showView="showView">
-            <div slot="left">
-              <Patent-Details></Patent-Details>
+            <div slot="left" style="width:100%">
+              <Patent-Details :patentNo="patentNo" :projectId="projectId"></Patent-Details>
             </div>
-            <div slot="right">
-              <Patent-Details></Patent-Details>
+            <div slot="right" style="width:100%">
+              <Patent-Details :patentNo="patentNo" :projectId="projectId"></Patent-Details>
             </div>
         </my-View>
     </div>
@@ -27,10 +27,15 @@ export default {
   data() {
     return {
       showView:false,
+      patentNo:this.$route.params.patentNo
     };
   },
   watch: {},
-  computed: {},
+  computed: {
+    projectId(){
+      return this.$route.query.projectId
+    }
+  },
   created() {},
   mounted() {},
   methods: {
@@ -43,5 +48,8 @@ export default {
 <style lang="scss" scoped>
 .article{
     display: flex;
+    .content{
+      width:100%
+    }
 }
 </style>