wucl пре 9 месеци
родитељ
комит
958840bd07
4 измењених фајлова са 25 додато и 13 уклоњено
  1. 4 3
      package.json
  2. 2 2
      src/views/DocView.vue
  3. 13 2
      src/views/personal/readonlyDetail.vue
  4. 6 6
      src/views/personal/todoDetail.vue

+ 4 - 3
package.json

@@ -29,6 +29,7 @@
     "e-vue-contextmenu": "^0.1.3",
     "echarts": "^5.4.3",
     "element-ui": "^2.15.14",
+    "exact": "^1.0.1",
     "format": "^0.2.2",
     "fuse.js": "^6.2.0",
     "html2canvas": "^1.0.0-rc.7",
@@ -36,7 +37,7 @@
     "js-base64": "^2.6.2",
     "js-cookie": "^2.2.1",
     "js-md5": "^0.7.3",
-    "js-pageoffice": "6.3.1",
+    "js-pageoffice": "^6.3.1",
     "jspdf": "^2.0.0",
     "lodash": "^4.17.21",
     "lodash.merge": "^4.6.2",
@@ -58,8 +59,8 @@
     "vue-piczoom": "^1.0.6",
     "vue-router": "^3.2.0",
     "vuex": "^3.4.0",
-    "webpack-spritesmith": "^1.1.0",
-    "webStorage": "^2.1.1"
+    "webStorage": "^2.1.1",
+    "webpack-spritesmith": "^1.1.0"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "^4.4.0",

+ 2 - 2
src/views/DocView.vue

@@ -1,6 +1,5 @@
 <template>
     <div class="doc">
-      演示: 文档<br /><br />
       <!-- 此div用来加载PageOffice客户端控件,其中div的高宽及位置就决定了控件的大小及位置 -->
       <div style="width:auto; height:900px;" v-html="poHtmlCode"></div>
     </div>
@@ -35,7 +34,8 @@
         //使用SaveFilePage属性设置后端保存方法的Controller路由地址,这个地址必须从"/"开始,并且也可以向此路由地址传递json字符串参数,示例如下:
         let saveFileUrl = "/doc/saveFile";
         let paramValue = new URLSearchParams(this.open_params);//为了简单起见,这里直接使用打开时的参数。
-        pageofficectrl.SaveFilePage = `${saveFileUrl}?${paramValue.toString()}`;
+        // pageofficectrl.SaveFilePage = `${saveFileUrl}?${paramValue.toString()}`;
+        pageofficectrl.SaveFilePage = `${saveFileUrl}`;
         //在这里写您保存前的代码
         pageofficectrl.WebSave();
         //在这里写您保存后的代码,比如判断保存结果pageofficectrl.CustomSaveResult

+ 13 - 2
src/views/personal/readonlyDetail.vue

@@ -891,6 +891,7 @@ import BackgroundInfo from '@/components/personalForms/backgroundInfo'
 import SellingAbilityInfo from '@/components/personalForms/sellingAbilityInfo'
 import existPNG from '@/assets/images/exist.png'
 import emptyPNG from '@/assets/images/empty.png'
+import { POBrowser } from 'js-pageoffice'
 
 export default {
   name: 'personalTodoDetail',
@@ -1502,7 +1503,8 @@ export default {
 
     handleAttachmentPreview(file) {
       // window.open(file.url)
-      this.officeFileView(file.name, file.url);
+      // this.officeFileView(name,url);
+      this.openPageoffice(file.name, file.url);
     },
     // 文档预览
     officeFileView(name, url) {
@@ -1543,7 +1545,16 @@ export default {
             link.click();
         })
       }
-    }
+    },
+    openPageoffice(fileName,fileUrl) {
+       let paramJson={};
+       paramJson.file_id=1;
+       paramJson.file_name=fileUrl;
+       let paramString=JSON.stringify(paramJson);
+       //openWindow()第三个参数用来向弹出的PageOffice浏览器(POBrowser)窗口传递参数(参数长度不限),支持json格式字符串。
+       //此处为了方便演示,我们传递了file_id和file_name两个参数,具体以您实际开发为准。
+      POBrowser.openWindow('/admin/#/showDoc', 'width=1150px;height=900px;',paramString);
+     },
   }
 }
 </script>

+ 6 - 6
src/views/personal/todoDetail.vue

@@ -858,7 +858,7 @@
                   :disabled="!statementProd.isOnline">加盖公章</el-button>
                 <el-button type="text" class="button" @click="genProductionFile(1)" >系统生成</el-button>
               </div>
-              <a href="#" @click.prevent="open_pageoffice()">打开文件</a>
+              <!-- <a href="#" @click.prevent="openPageoffice()">打开文件</a> -->
             </div>
             <el-upload style="position: relative; top: -10px; padding: 10px;"
               :action="'/api/personalProduction/upload/' + target.id + '/1'" :file-list="statementProd.files" :limit="1"
@@ -2286,7 +2286,8 @@ export default {
     },
     handleAttachmentPreview(file) {
       // window.open(file.url)
-      this.officeFileView(file.name, file.url);
+      // this.officeFileView(name,url);
+      this.openPageoffice(file.name,file.url);
     },
     handleRemoveFile(file, fileList) {
       this.$confirm('请确认是否移除已存在的报告?', '提示', {
@@ -2745,15 +2746,14 @@ export default {
       this.decideProduction = false;
       this.checkStateFlag = false;
     },
-    open_pageoffice() {
+    openPageoffice(fileName,fileUrl) {
        let paramJson={};
        paramJson.file_id=1;
-       paramJson.file_name="/dfs/2024/09/29/2024090029结果报告.docx";
+       paramJson.file_name=fileUrl;
        let paramString=JSON.stringify(paramJson);
        //openWindow()第三个参数用来向弹出的PageOffice浏览器(POBrowser)窗口传递参数(参数长度不限),支持json格式字符串。
        //此处为了方便演示,我们传递了file_id和file_name两个参数,具体以您实际开发为准。
-      POBrowser.openWindow('/showDoc', 'width=1150px;height=900px;',paramString);
-
+      POBrowser.openWindow('/admin/#/showDoc', 'width=1150px;height=900px;',paramString);
      },
   }
 }