ZaiZai há 1 ano atrás
pai
commit
5f82e28fd9

+ 11 - 8
src/utils/tools.js

@@ -1,11 +1,14 @@
-import split from 'split.js'
-
-//分割
-export const setDomSplit = (ele = [], options = {}) => {
-    //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
-    setTimeout(() => {
-        split(ele, options)
-    }, 500)
+//动态加载线上js文件
+export const addDocumentsJs = () => {
+    return new Promise((resolve) => {
+        const script = document.createElement('script')
+        script.src = 'http://47.110.251.215:6831/web-apps/apps/api/documents/api.js'
+        script.type = 'text/javascript'
+        document.head.appendChild(script)
+        script.onload = () => {
+            resolve()
+        }
+    })
 }
 
 //判断是否为网址

+ 4 - 2
src/views/project/debit/project/components/report/template.vue

@@ -1,6 +1,6 @@
 <template>
-    <hc-new-dialog v-model="isShow" is-table widths="1024px" title="修改报表模板" @save="modalSave">
-        11111
+    <hc-new-dialog v-model="isShow" is-table widths="95%" title="修改报表模板" @save="modalSave">
+        <hc-online-office :src="docxUrl" title="测试的文档.docx" />
     </hc-new-dialog>
 </template>
 
@@ -37,6 +37,8 @@ watch(isShow, (val) => {
     }
 })
 
+const docxUrl = ref('https://bladex-chongqing-info.oss-cn-hangzhou.aliyuncs.com//upload/20231023/0663b9e290b8d038003cc95bbe3d9422.xlsx')
+
 const modalSave = () => {
     emit('finish')
 }

+ 2 - 1
src/views/project/debit/project/report.vue

@@ -47,6 +47,7 @@ import { onMounted, ref } from 'vue'
 import rowDataInfo from './components/report/row-data.vue'
 import reportForm from './components/report/report-form.vue'
 import reportTemplate from './components/report/template.vue'
+import { addDocumentsJs } from '~uti/tools'
 
 defineOptions({
     name: 'ProjectDebitProjectReport',
@@ -54,7 +55,7 @@ defineOptions({
 
 //渲染完成
 onMounted(() => {
-
+    addDocumentsJs()
 })
 
 //搜索表单