ソースを参照

解决无法查看pdf,无法上传pdf问题,在线查看文档

zhuliu 2 年 前
コミット
7092695962

+ 18 - 0
RMS-FrontEnd/src/api/patent.js

@@ -24,4 +24,22 @@ export default{
     getPatentKeywordsHighlight(params) {
       return axios.get('/v2/patent/keywords/highlight/list', { params })
     },
+
+      /**
+   * 获取说明书文件流
+   */
+  getPatentInstructionFile(params) {
+    return axios({
+      url: '/v2/patent/instruction/file',
+      method: 'post',
+      responseType: 'blob',
+      params: params
+    })
+  },
+  /**
+   * 编辑专利说明书
+   */
+   editPatentInstruction(data) {
+    return axios.post('/v2/patent/instruction/edit', data)
+  },
 }

+ 1 - 1
RMS-FrontEnd/src/config/index.js

@@ -3,5 +3,5 @@ export default {
     host: window.location.host,
     staticURL: process.env.NODE_ENV === 'production' ? 'http://139.224.24.90:8084' : (process.env.NODE_ENV === 'test'?'http://192.168.1.24:8084':'http://192.168.1.24:8084'),
     staticURL2: process.env.NODE_ENV === 'production' ? 'http://139.224.24.90:8081' : 'http://139.224.24.90:8081',
-    pasURL:process.env.NODE_ENV === 'production' ? 'http://139.224.24.90:80' : 'http://localhost:8085',
+    pasURL:process.env.NODE_ENV === 'production' ? window.location.protocol+'//'+window.location.hostname+':80' : window.location.protocol+'//'+window.location.hostname+':8085',
 }

+ 9 - 0
RMS-FrontEnd/src/router/index.js

@@ -222,6 +222,15 @@ const routes = [
         },
         component:() => import('@/views/report/Invalid/InvalidPage/AssignTasks.vue'),
       },
+      {
+        path:'/checkFile',
+        name:'/checkFile',
+        meta:{
+          aside:true,
+          hiddenHeader:true
+        },
+        component:() => import('@/views/components/common/menu/component/checkFile.vue'),
+      }
     ]
   },
   {

+ 59 - 0
RMS-FrontEnd/src/views/components/common/menu/component/checkFile.vue

@@ -0,0 +1,59 @@
+<template>
+    <div>
+        <div class="header">
+            <div>{{ FileName }}</div>
+            <div>
+                <el-link style="font-size: 16px" @click="downLoad"><i class="fa el-icon-download"></i><span style="margin-left:10px">下载</span></el-link>
+            </div>
+        </div>
+        <div style="display:flex;justify-content: center;">
+            <iframe v-if="isPicture == 0" :src="FileUrl" frameborder="0" width="100%" :height="height"></iframe>
+            <el-image v-else :src="FileUrl" width="100%" :preview-src-list="srcList"></el-image>
+        </div>
+        
+    </div>
+</template>
+<script>
+import { downLoad2 } from '@/utils'
+export default {
+    data() {
+        return {
+            FileName:'',
+            height:document.documentElement.clientHeight - 200,
+            srcList:[],
+        }
+    },
+    computed:{
+        row(){
+            return JSON.parse(this.$route.query.row);
+        },
+        FileUrl(){
+            return this.$route.query.FileUrl
+        },
+        isPicture(){
+            return this.$route.query.isPicture
+        }
+    },
+    mounted(){
+        console.log(this.isPicture)
+        this.FileName = this.row.name?this.row.name+'.'+this.row.suffix:this.row.fileName
+        if(this.isPicture){
+            this.srcList = [this.FileUrl]
+        }
+        
+    },
+    methods: {
+        downLoad(){
+            downLoad2(this.row.url) 
+        },
+    },
+}
+</script>
+<style lang="scss" scoped>
+    .header{
+        padding: 0 20px;
+        display: flex;
+        justify-content: space-around;
+        align-items: center;
+    }
+</style>

+ 221 - 0
RMS-FrontEnd/src/views/components/common/menu/index.vue

@@ -0,0 +1,221 @@
+<template>
+    <div :class="menuStyle" @mouseover="mouseover" @mouseout="mouseout">
+        <div class="menu-button" @click="getMenu">
+            <div class="line-box">
+                <div class="line"></div>
+                <div class="line"></div>
+                <div class="line"></div>
+            </div>
+        </div>
+        <ul class="menu-list" >
+            <li @click="downLoad"><i class="fa el-icon-download"></i><span>下载</span></li>
+            <li @click="preview"><i class="fa el-icon-view"></i><span>预览</span></li>
+            <li @click="delFile"><i class="fa el-icon-delete"></i><span>删除</span></li>
+        </ul>
+    </div>
+</template>
+<script>
+import { downLoad2 } from '@/utils'
+
+export default {
+    props:['data'],
+    data() {
+        return {
+            menuStyle:'menu-box',
+            active:false,
+        }
+    },
+    watch:{
+
+    },
+    methods:{
+        getMenu(){
+            // if(!this.active){
+            //    this.menuStyle = 'menu-box active' 
+            //    this.$emit('getKey',this.data.id)
+            // }else{
+            //     this.menuStyle = 'menu-box' 
+            // }
+            // this.active = !this.active
+        },
+        mouseover(){
+            this.menuStyle = 'menu-box active' 
+            this.active = true
+        },
+        mouseout(){
+            this.menuStyle = 'menu-box' 
+            this.active = false
+        },
+        downLoad(){
+            downLoad2(this.data.url) 
+        },
+        preview(){
+            var item = this.data
+            var arr = ['png','jpeg','bmp','jpg']
+            if(arr.includes(item.suffix)){
+                var FileUrl = this.$p + item.url
+                var isPicture = 1
+            }else if(item.suffix == 'pdf'){
+                var FileUrl = this.$p + item.url
+                var isPicture = 0
+            }else{
+                var FileUrl =  'http://192.168.1.24:8012/onlinePreview?url='+ btoa(encodeURIComponent(this.$p + item.url))
+                var isPicture = 0
+            }
+            const router = this.$router.resolve({
+                path: '/checkFile',
+                query: {
+                    row: JSON.stringify(item),
+                    FileUrl: FileUrl,
+                    isPicture:isPicture
+                }
+            })
+            window.open(router.href, '_blank');
+        },
+        delFile(){
+            this.$emit('delFile',this.data.id)
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+    .menu-button{
+        width: 25px;
+        height: 25px;
+        background-color: white;
+        border-radius: 50%;
+        // box-shadow: 0 0 0 4px rgba(92,103,255,0.3);
+        color: #fff;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        position: relative;
+        
+        cursor: pointer;
+        transition: 0.2s ease-in;
+    }
+    .menu-button:hover{
+        background-color: white;
+        z-index: 1;
+        // box-shadow: 0 0 0 8px rgba(92,103,255,0.3);
+    }
+    .menu-button .line-box{
+        width: 10px;
+        height: 10px;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        cursor: pointer;
+        transition: transform 0.3s ease-out;
+    }
+    .menu-button .line{
+        background-color: black;
+        width: 100%;
+        height: 2px;
+        border-radius: 2px;
+    }
+    .menu-button .line:first-child{
+        width: 50%;
+        transform-origin: right;
+        transition: transform 0.3s ease-in-out;
+    }
+    .menu-button .line:last-child{
+        width: 50%;
+        align-self: flex-end;
+        transform-origin: left;
+        transition: transform 0.3s ease-in-out;
+    }
+    .menu-list{
+        width: 80px;
+        // height: 160px;
+        background-color: #fff;
+        border-radius: 8px;
+        border: 1px solid rgb(172, 169, 169);
+        list-style: none;
+        padding: 6px;
+        // box-shadow: 0 0 4px 4px rgba(92,103,255,0.15);
+        position: absolute;
+        right: 10px;
+        bottom: 10px;
+        opacity: 0;
+        transform: scale(0);
+        transform-origin: bottom right;
+        transition: 0.3s ease;
+        transition: delay 0.3s;
+    }
+    .menu-list li{
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        // padding: 10px;
+        color: #343470;
+        cursor: pointer;
+        position: relative;
+        opacity: 0;
+        transform:  translateX(-10px);
+        transition: 0.2s ease-in;
+    }
+    .menu-list li:hover{
+        color: #5c67ff;
+    }
+    .menu-list li::before{
+        content: '';
+        width: calc(100% - 24px);
+        height: 1px;
+        background-color: rgba(92,103,255,0.1);
+        position: absolute;
+        bottom: 0;
+        left: 12px;
+    }
+    .menu-list li:last-child::before{
+        display: none;
+    }
+    .menu-list .fa{
+        font-size: 18px;
+        width: 18px;
+        height: 18px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+    .menu-list span{
+        font-size: 14px;
+        margin-left: 8px;
+    }
+    .active{
+        position: relative;
+    }
+    .active .line-box{
+        transform: rotate(-45deg);
+    }
+    .active .line-box .line:first-child{
+        transform: rotate(-90deg) translateX(1px);
+    }
+    .active .line-box .line:last-child{
+        transform: rotate(-90deg) translateX(-1px);
+    }
+    .active .menu-list{
+        margin: 0;
+        opacity: 1;
+        transform: scale(1);
+    }
+    .active .menu-list li{
+        animation: fade-in-item 0.4s linear forwards;
+    }
+    .active .menu-list li:nth-child(1){
+        animation-delay: 0.1s;
+    }
+    .active .menu-list li:nth-child(2){
+        animation-delay: 0.2s;
+    }
+    .active .menu-list li:nth-child(3){
+        animation-delay: 0.3s;
+    }
+    
+    @keyframes fade-in-item{
+        100%{
+            transform: translateX(0);
+            opacity: 1;
+        }
+    }
+</style>

+ 4 - 2
RMS-FrontEnd/src/views/layout/index.vue

@@ -40,7 +40,7 @@
           </el-menu>
         </el-aside>
         <el-container>
-          <el-header>
+          <el-header v-if="!hiddenHeader">
             <span v-if="header" style="margin-left:20px">
               <span v-if="!report.taskName"> 报告名称:{{ report.reportName?report.reportName:report.name}}</span>
               <span v-else>
@@ -79,6 +79,7 @@ export default {
   data() {
     return {
       header:false,
+      hiddenHeader:false,
       report:{},
       isCollapse: true,
       activeMenu: this.$route.meta.active,
@@ -94,7 +95,7 @@ export default {
       this.aside = this.$route.meta.aside || false
       this.activeMenu = to.meta.active
       this.header = this.$route.meta.showHeader
-      
+      this.hiddenHeader = this.$route.meta.hiddenHeader
     },
     header(val){
       if(val){
@@ -114,6 +115,7 @@ export default {
   async mounted() {
     this.aside = this.$route.meta.aside || false
     this.header = this.$route.meta.showHeader
+    this.hiddenHeader = this.$route.meta.hiddenHeader
     // console.log(this.showTask);
     this.$store.commit('SET_PATENT_CONTRAST', [])
     this.$store.commit('SET_PREFIX', '/admin')

+ 12 - 1
RMS-FrontEnd/src/views/report/reportDetails/components/basicMessage.vue

@@ -39,7 +39,13 @@
                 </el-form-item>
                 <el-form-item :label="noEdit1?'附件':'上传附件:'">
                 <div v-if="form.reportFiles" class="upload-file">
-                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;"><p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name+'.'+item.suffix:item.fileName}}</p> <p style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1"><i class="el-icon-close"></i></p></div>
+                    <div v-for="item in form.reportFiles" style="margin:0;display:flex;justify-content:space-around;align-items:center;">
+                      <p style="margin:0;width:calc(100% - 40px);overflow: hidden;white-space: nowrap;text-overflow:ellipsis;cursor: pointer" @click="checkFile(item)">{{item.name?item.name+'.'+item.suffix:item.fileName}}</p> 
+                      <!-- <div style="margin:0;" @click="delFile(item.id)" v-if="!noEdit1">
+                        <i class="el-icon-close"></i>
+                      </div> -->
+                      <Menu :data="item" @delFile="delFile"></Menu>
+                    </div>
                 </div>
                 <el-upload v-if="!noEdit1" ref="upload" class="upload-file" drag action="#" :auto-upload="false" :show-file-list="true" :on-change="onChange" multiple   :on-preview="handlePreview" :on-remove="handleRemove">
                     <i :class="!file ? 'el-icon-upload' : 'el-icon-refresh'"></i>
@@ -61,9 +67,13 @@
 
 <script>
 import { PatentDetails } from "@/views/components/common/mixins";
+import Menu from '@/views/components/common/menu/index.vue'
 import { downLoad2 } from "@/utils";
 export default {
     mixins:[PatentDetails],
+    components:{
+      Menu
+    },
     props:['reportId','noEdit'],
     data() {
         return {
@@ -93,6 +103,7 @@ export default {
     },
     methods: {
       checkFile(item){
+        return false;
         var arr = ['png','jpeg','bmp','jpg']
         if(arr.includes(item.suffix)){
           this.FileVisible = true