zhuhao 1 year ago
parent
commit
343546e45d

+ 3 - 0
src/api/newApi/file.js

@@ -3,5 +3,8 @@ import axios from "@/utils/axios";
 export default {
   uploadFile(data){
     return axios.post('/fileManager/uploadNormalFile', data)
+  },
+  downLoadFile(params, prop = {}) {
+    return axios.get('/fileManager/downloadFile', {params},prop)
   }
 };

+ 17 - 1
src/api/newApi/patent.js

@@ -117,7 +117,7 @@ export default {
    * @returns 
    */
   getCnPdf(params) {
-    return axios.get("/xiaoshi/patentStar/getCnPdf", {params});
+    return axios.get("/xiaoshi/patentStar/getExternalTextPdf", {params});
   },
   /**
    * 专利详情外部(检索)获得中国专利pdf全文文本
@@ -135,4 +135,20 @@ export default {
   getTextPdf(params) {
     return axios.get("/xiaoshi/patent/getTextPdf", {params});
   },
+  /**
+   * 专利详情外部获得专利附图
+   * @param {*} params 
+   * @returns 
+   */
+  getExternalFigure(params) {
+    return axios.get("/xiaoshi/patentStar/getExternalFigure", {params});
+  },
+  /**
+   * 专利详情内部获得专利附图
+   * @param {*} params 
+   * @returns 
+   */
+  getFigure(params) {
+    return axios.get("/xiaoshi/patent/getFigure", {params});
+  },
 }

+ 113 - 0
src/views/components/dialog/menuDialog/annotation.vue

@@ -0,0 +1,113 @@
+<template>
+  <div>
+    <el-dialog title="批注" v-draggable :visible.sync="visible" width="500px" custom-class="checkFile"
+      :before-close="close" :modal="false" :close-on-click-modal="false" :modal-append-to-body="false">
+      <!-- <div class="pizhu" style="display:none;"> -->
+        <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>
+          <p style="margin:0">{{ getDate() }}</p>
+        </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>
+        </div>
+        <div>
+          <p><span>颜色:</span>
+            <span>
+              <el-input type="color" size="small" class="changeColor" v-model="mark.color"
+                style="user-select:none;width:100px" @input="changeColor()"> </el-input>
+            </span>
+          </p>
+          <p><span>类型:</span>
+            <span>
+              <el-radio-group v-model="mark.scratchType" @change="changeRadio">
+                <el-radio :label="2">波浪线</el-radio>
+                <el-radio :label="0">下划线</el-radio>
+                <el-radio :label="1">高亮</el-radio>
+              </el-radio-group>
+            </span>
+          </p>
+        </div>
+        <div>
+          <p>
+            <span>使用权限:</span>
+            <span>
+              <el-radio-group v-model="mark.permissionType" @change="changePower()">
+                <el-radio :label="1">所有人可见</el-radio>
+                <el-radio :label="0">本人可见</el-radio>
+              </el-radio-group>
+            </span>
+          </p>
+          <p style="display:flex" v-if="mark.rangeId">
+            <span>可见范围:</span>
+            <span>
+              <el-switch v-model="mark.rangeType" active-color="#13ce66" inactive-color="#ff4949" active-text="本专题库可见">
+              </el-switch>
+              <!-- <el-checkbox-group v-model="mark.rangeType" @change="changeRange">
+                    <el-checkbox label="1">本专题库</el-checkbox>
+                    <el-checkbox label="2">本报告</el-checkbox>
+                    <el-checkbox label="3">本专利</el-checkbox>
+                  </el-checkbox-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>
+        </div>
+        <div style="display:flex;justify-content: flex-end;">
+          <span style="cursor: pointer;" @click="cancelPizhu">取消</span>
+          <span style="margin-left:15px;cursor: pointer;" v-if="mark.id" @click="deletePizhu">删除</span>
+          <span style="margin-left:15px;cursor: pointer;" @click="submitPizhu">确定</span>
+        </div>
+      <!-- </div> -->
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+export default {
+  data() {
+    return {
+      // 控制弹窗开关
+      visible: false,
+      // 批注的内容
+      mark: {
+        text: '',
+        color: '#ff0000',
+        scratchType: 2,//类型
+        permissionType: 0,//使用权限
+        remark:'',
+      },
+    }
+  },
+  computed: {
+    ...mapGetters(['userinfo', 'projectId','contextMenu']),
+  },
+  mounted() {
+
+  },
+  methods: {
+    // 显示时间
+    getDate() {
+      let date = new Date()
+      var Y = date.getFullYear().toString()
+      var m = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1).toString() : "0" + (date.getMonth() + 1)
+      var d = date.getDate() > 9 ? date.getDate().toString() : "0" + date.getDate()
+      var H = date.getHours() > 9 ? date.getHours().toString() : "0" + date.getHours()
+      var M = date.getMinutes() > 9 ? date.getMinutes().toString() : "0" + date.getMinutes()
+      var S = date.getSeconds() > 9 ? date.getSeconds().toString() : "0" + date.getSeconds()
+      return Y + '-' + m + '-' + d + ' ' + H + ':' + M + ':' + S
+    },
+    // 打开弹窗
+    open() {
+      console.log(this.projectId,this.contextMenu);
+      this.visible=true
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 6 - 1
src/views/layout/components/contextMenu.vue

@@ -2,15 +2,19 @@
   <div>
     <myContextMenu @operateDirectory="getMethod"></myContextMenu>
     <contrast ref="contrast"></contrast>
+    <!-- 批注 -->
+    <annotation ref="annotation"></annotation>
   </div>
 </template>
 
 <script>
 import {mapGetters} from 'vuex'
 import contrast from '@/views/components/dialog/menuDialog/contrast.vue'
+import annotation from '@/views/components/dialog/menuDialog/annotation.vue'
 export default {
   components: {
-    contrast
+    contrast,
+    annotation,
   },
   props: {},
   data() {
@@ -72,6 +76,7 @@ export default {
     //批注
     mark(){
       console.log('批注')
+      this.$refs.annotation.open()
     },
     //修改颜色
     changeColor(){

+ 1 - 1
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>

+ 84 - 55
src/views/project/patentDetails/components/patentMessage/PatentImage.vue

@@ -2,24 +2,30 @@
   <div class="patent-image">
     <div class="block">
       <div class="demonstration">图片大小:</div>
-      <el-slider v-model="value"  @change="changeWidth" :min="25" :max="100" style="padding-left:90px"></el-slider>
+      <el-slider v-model="value" @change="changeWidth" :min="25" :max="100" style="padding-left:90px"></el-slider>
     </div>
     <div class="imageCard">
-      <el-card class="preview" v-for="(item, index) in patent.image" :key="index" shadow="hover" :style="{width:width}">
-          <div slot="header" class="card-header" v-if="projectId">
-            <span></span>
-            <el-button :disabled="!$permission('/workspace/details/figureDelete')" class="delete" type="text" @click="handleDelete(item)">删除</el-button>
-            <el-button :disabled="!$permission('/workspace/details/figuremodify')" class="edit" type="text" @click="handleEdit(item)">编辑</el-button>
-          </div>
-          <div class="text-align_center">
-            <el-image :src="!projectId?item.url:getImagePath(item.url)" :preview-src-list="srcList" style="height: 100%; min-height:125px;"></el-image>
-          </div>
+      <el-card class="preview" v-for="(item, index) in patent.image" :key="index" shadow="hover" :style="{ width: width }">
+        <div slot="header" class="card-header" v-if="projectId">
+          <span></span>
+          <el-button :disabled="!$permission('/workspace/details/figureDelete')" class="delete" type="text"
+            @click="handleDelete(item)">删除</el-button>
+          <el-button :disabled="!$permission('/workspace/details/figuremodify')" class="edit" type="text"
+            @click="handleEdit(item)">编辑</el-button>
+        </div>
+        <div class="text-align_center">
+          <el-image :src="outside ? item : $commonJS.checkViewer(item)" :preview-src-list="srcList"
+            style="height: 100%; min-height:125px;"></el-image>
+        </div>
       </el-card>
     </div>
 
-    <div type="primary" class="up" v-if="$permission('/workspace/details/figureUpdata')&& projectId && $r(projectId,[1,2])" @click="handleAdd">上传图片</div>   
+    <div type="primary" class="up"
+      v-if="$permission('/workspace/details/figureUpdata') && projectId && $r(projectId, [1, 2])" @click="handleAdd">上传图片
+    </div>
 
-    <el-dialog :title="title" :visible.sync="visible" width="500px" append-to-body destroy-on-close :before-close="close" top="22vh">
+    <el-dialog :title="title" :visible.sync="visible" width="500px" append-to-body destroy-on-close :before-close="close"
+      top="22vh">
       <el-form :model="form">
         <el-form-item label="是否设置为摘要附图">
           <el-radio-group v-model="form.status">
@@ -28,7 +34,8 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="上传图片">
-          <el-upload class="upload-file" drag action="#" :auto-upload="false" :show-file-list="false" :on-change="onChange">
+          <el-upload class="upload-file" drag action="#" :auto-upload="false" :show-file-list="false"
+            :on-change="onChange">
             <i :class="!file ? 'el-icon-upload' : 'el-icon-refresh'"></i>
             <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
             <div class="el-upload__tip" slot="tip"></div>
@@ -49,8 +56,8 @@ export default {
   mixins: [patentDetails],
   data() {
     return {
-      value:25,
-      width:"25%",
+      value: 25,
+      width: "25%",
       srcList: [],
       url: '',
       title: '',
@@ -61,49 +68,60 @@ export default {
     }
   },
   watch: {
-    patentId() {
-      this.srcList = this.patent.image.map(item => this.getImagePath(item.url))
-    },
-    'patent'(){
-
-    },
-    patentNo(){
-      if(!this.projectId){
+    patentNo() {
+      if (this.outside) {
         this.getData()
       }
     }
   },
   mounted() {
-    if(this.patent.image){
-      this.srcList = this.patent.image.map(item => this.getImagePath(item.url))
-    }else{
-      if(!this.projectId){
-        this.getData()
-      }
+    // outside为true是外部
+    if (this.outside) {//外部
+      this.getData()
+    } else {
+      this.refresh()
     }
-    
-    // console.log(this.patent)
   },
   methods: {
-    getData(){
+    // 获得外部的附图
+    getData() {
       var params = {
-            patentCell:4,
-            patentNo:this.patent.publicNo,
-            appNo:this.patent.applicationNo,
+        appNo: this.patent.rowApplicationNo,
+      }
+      this.$api.getExternalFigure(params).then(response => {
+        if (response.code == 200) {
+          if (response.data.length>0) {
+            this.$set(this.patent, 'image', response.data)
+            this.$set(this, 'srcList', response.data)
+          } else {
+            this.$set(this.patent, 'image', [])
+            this.$set(this, 'srcList', [])
           }
-        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,'image',response.data.image)
-              }else{
-                this.$set(this.patent,'image',[])
-              }
-              this.srcList = this.patent.image.map(item=>item.url)
-            }
-        })
+        }
+      })
     },
-    changeWidth(){
-      this.width=this.value+'%'
+    // 获取内部的附图
+    refresh() {
+      var params = {
+        appNo: this.patent.appNo,
+      }
+      this.$api.getFigure(params).then(response => {
+        if (response.code == 200) {
+          if (response.data.length>0) {
+            this.$set(this.patent, 'image', response.data)
+            let srcList=response.data.map(item=>{
+              return this.$commonJS.checkViewer(item)
+            })
+            this.$set(this, 'srcList', srcList)
+          } else {
+            this.$set(this.patent, 'image', [])
+            this.$set(this, 'srcList', [])
+          }
+        }
+      })
+    },
+    changeWidth() {
+      this.width = this.value + '%'
     },
     close() {
       this.visible = false
@@ -183,9 +201,9 @@ export default {
 </script>
 
 <style lang="scss">
-.up{
+.up {
   width: 70px;
-  height:30px;
+  height: 30px;
   line-height: 30px;
   color: rgb(65, 65, 224);
   cursor: pointer;
@@ -193,56 +211,67 @@ export default {
   right: 20px;
   top: 0px;
 }
-.up:hover{
+
+.up:hover {
   border-bottom: 1px solid rgb(45, 45, 235);
 }
-.block{
+
+.block {
   width: 60%;
   margin: 0 auto;
 }
-.imageCard{
+
+.imageCard {
   display: flex;
   flex-direction: row;
   flex-wrap: wrap;
   justify-content: center;
 }
-.demonstration{
+
+.demonstration {
   float: left;
   line-height: 38px;
   text-align: center;
 }
+
 .patent-image {
   position: relative;
+
   .delete {
     float: right;
     padding: 3px 0;
     color: red;
     padding-left: 10px;
   }
+
   .edit {
     float: right;
     padding: 3px 0;
   }
+
   .add {
     font-size: 80px;
     color: #6b6868;
     margin-top: 60px;
   }
+
   .preview {
     // height: 300px;
     margin-right: 20px;
     cursor: pointer;
     text-align: center;
+
     .card-header {
       height: 20px;
     }
+
     .el-card__header {
       border-bottom: 1px solid #EBEEF5;
       font-weight: normal;
     }
   }
+
   .el-image {
     width: 100%;
   }
-}
-</style>
+}</style>

+ 33 - 64
src/views/project/patentDetails/components/patentMessage/PatentPDF.vue

@@ -5,12 +5,12 @@
         <el-button size="small" :type="pdfType === 1 ? 'primary' : ''" @click="handleSelect(1)">授权文档</el-button>
         <el-button size="small" :type="pdfType === 0 ? 'primary' : ''" @click="handleSelect(0)">公开文档</el-button>
       </el-button-group>
-      <el-upload class="float_right" action="#" :auto-upload="false" :show-file-list="false" :on-change="handleChange"
+      <!-- <el-upload class="float_right" action="#" :auto-upload="false" :show-file-list="false" :on-change="handleChange"
         :multiple="false">
         <el-button type="success" size="small" :loading="btnLoading" v-if="projectId"
           :disabled="!($permission('/workspace/details/updataInstruction') && $r(projectId, [1, 2]))">上传文档</el-button>
         <div slot="tip" class="el-upload__tip"></div>
-      </el-upload>
+      </el-upload> -->
     </div>
     <iframe v-if="show" :src="src" frameborder="0" :height="height" width="100%"></iframe>
     <div v-else class="no-pdf-file">
@@ -73,57 +73,25 @@ export default {
       }
       this.$api.getCnPdf(params).then(response => {
         if (response.code == 200) {
-          // if (Object.keys(response.data).length == 0) {
-          //   return false
-          // }
-          // if (response.data.pdf.length == 0) {
-          //   return false
-          // }
           this.$set(this.patent, 'pdf', response.data)
           this.getSrc()
-          // var index = this.patent.pdf.findIndex(item => {
-          //   return item.type == 2
-          // })
-          // if (index != -1) {
-          //   this.pdfType = 2
-          // } else {
-          //   this.pdfType = 1
-          // }
-          // this.getPDFSrc(this.pdfType)
-
         }
       })
     },
-    // getPDFSrc(type) {
-    //   let blob = this.base64ToBlob(this.patent.pdf.find(item => { return item.type == type }))
-    //   this.$set(this, 'src', URL.createObjectURL(blob))
-    //   this.$nextTick(() => {
-    //     this.show = true
-    //   })
-    // },
-    // base64ToBlob(row) {
-    //   var dataUrl = row.pictureStringData
-    //   let bstr = window.atob(dataUrl)
-    //   let n = bstr.length
-    //   let u8arr = new Uint8Array(n)
-    //   while (n--) {
-    //     u8arr[n] = bstr.charCodeAt(n);
-    //   }
-    //   return new Blob([u8arr], { type: "application/pdf" });
-    // },
     // 内部专利根据guid获取路径
     getSrc() {
       let obj = this.patent.pdf.find(item => {
         return item.type == this.pdfType
       })
-      if (this.outside) {
-        this.src = obj.pdfGuid
-      } else {
-        if (obj) {
-          this.src = this.$commonJS.checkViewer(obj.pdfGuid)
-          // console.log(this.src);
-        }
+      // if (this.outside) {
+      //   var src = obj.pdfGuid
+      //   this.src = `http://${this.$c.staticURL}:8012/onlinePreview?url=` + btoa(encodeURIComponent(src + '&fullfilename=test.pdf'))
+      // } else {
+      if (obj) {//外部内部都是返回guid
+        var src = this.$commonJS.checkViewer(obj.pdfGuid)
+        this.src = `http://${this.$c.staticURL}:8012/onlinePreview?url=` + btoa(encodeURIComponent(src + '&fullfilename=test.pdf'))
       }
+      // }
       this.$nextTick(() => {
         this.show = true
       })
@@ -138,28 +106,29 @@ export default {
         this.getSrc()
       }
     },
-    handleChange(file, fileList) {
-      if (file.name.split('.')[1].toLowerCase() !== 'pdf') {
-        this.$message.error('请选择PDF格式文件')
-        return false
-      }
-      let formData = new FormData()
-      formData.append('file', file.raw)
-      formData.append('type', this.pdfType)
-      formData.append('patentNo', this.patent.patentNo)
-      if (this.pdf) {
-        formData.append('url', this.pdf.url)
-      }
-      this.btnLoading = true
-      this.$api.editPatentInstruction(formData).then(response => {
-        this.$message.success('操作成功')
-        this.btnLoading = false
-        this.$emit('refresh')
-        this.refresh()
-      }).catch(error => {
-        this.btnLoading = false
-      })
-    },
+    // 上传文档
+    // handleChange(file, fileList) {
+    //   if (file.name.split('.')[1].toLowerCase() !== 'pdf') {
+    //     this.$message.error('请选择PDF格式文件')
+    //     return false
+    //   }
+    //   let formData = new FormData()
+    //   formData.append('file', file.raw)
+    //   formData.append('type', this.pdfType)
+    //   formData.append('patentNo', this.patent.patentNo)
+    //   if (this.pdf) {
+    //     formData.append('url', this.pdf.url)
+    //   }
+    //   this.btnLoading = true
+    //   this.$api.editPatentInstruction(formData).then(response => {
+    //     this.$message.success('操作成功')
+    //     this.btnLoading = false
+    //     this.$emit('refresh')
+    //     this.refresh()
+    //   }).catch(error => {
+    //     this.btnLoading = false
+    //   })
+    // },
     // 请求内部pdf的guid
     refresh() {
       this.show = false