Bladeren bron

文件共享

hongrunxia 1 jaar geleden
bovenliggende
commit
079db74473
2 gewijzigde bestanden met toevoegingen van 51 en 1 verwijderingen
  1. 1 0
      index.html
  2. 50 1
      src/views/vent/performance/comment/DeviceModal.vue

+ 1 - 0
index.html

@@ -12,6 +12,7 @@
       window._CONFIG = {};
     </script>
     <script src="/js/liveplayer-lib.min.js"></script>
+    <script type="text/javascript" src="http://47.94.222.6:9050/web-apps/apps/api/documents/api.js"></script>
   </head>
   <body style="background-color: #09172C">
     <script>

+ 50 - 1
src/views/vent/performance/comment/DeviceModal.vue

@@ -9,13 +9,15 @@
     :footer="null"
     destroyOnClose
   >
-    <iframe width="100%" height="100%" src="/fileEdit.html" frameborder="0" scrolling="no"></iframe>
+    <!-- <iframe width="100%" height="100%" src="D:/mky/apps/mky-vent-base/public/fileEdit.html" frameborder="0" scrolling="no"></iframe> -->
     <!-- <FormModal :record="record" @saveOrUpdate="(values) => emit('saveOrUpdate', values)" /> -->
+    <div id="fileEdit"></div>
   </BasicModal>
 </template>
 <script lang="ts" setup>
   import { computed, unref, inject, reactive } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
+import { onMounted } from 'vue';
   // import FormModal from './FormModal.vue';
   // 声明Emits
   // const emit = defineEmits(['saveOrUpdate', 'register']);
@@ -27,6 +29,48 @@
     //重置表单
     setModalProps({ confirmLoading: false });
     Object.assign(record, data.record);
+    
+
+
+    new DocsAPI.DocEditor("fileEdit", // 元素id
+    {
+      type: "desktop",
+      width: "100%",
+      height: "1000px",
+      document: {
+        title: "文档管理",
+        url: "http://192.168.187.1:9999/ventanaly-sharefile/fileServer/onlyOffice/read?id=[[${id}]]",//id表示文件id,后端接口用这个id来加载文件
+        fileType: "docx",//当文件类型为doc、xls、ppt时,对应用docx、xlsx、pptx否则会保存异常。
+        key: "",
+        lang: "zh-CN",
+        permissions: {
+          "download": true,//是否可下载
+          "edit": true,
+          "fillForms": true,
+          "print": true,//是否可打印
+        }
+      },
+      editorConfig: {
+        "lang": "zh-CN",
+        mode: "edit",//view:只读且可复制内容,edit:可编辑
+        "callbackUrl": "http://192.168.187.1:9999/ventanaly-sharefile/fileServer/onlyOffice/save?id=[[${id}]]",//id表示文件id,后端接口用这个id来加载文件
+        "coEditing": {
+          "mode": "fast",
+          "change": true
+        },
+        "customization": {
+          "toolbarNoTabs": true,
+          "autosave": false,//是否自动保存
+          "forcesave": true,//定义保存按钮是否显示
+          "hideRightMenu": true,
+        },
+        //用户信息
+        "user": {
+          "id": "857857", //用户ID
+          "name": "小陈" //用户名称
+        }
+      }
+    });
   });
 
   //设置标题
@@ -47,7 +91,12 @@
 
     // !unref(isUpdate) ? `新增(${record.strname || record.systemname})` : `编辑(${record.strname || record.systemname})`
   );
+
+  onMounted(() => {
+    
+  })
 </script>
+
 <style scoped lang="less">
   ::v-deep .suffix {
     height: 32px;