瀏覽代碼

增加key

duy 1 年之前
父節點
當前提交
ac09be6e85
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/views/transfer/write-report.vue

+ 5 - 1
src/views/transfer/write-report.vue

@@ -21,7 +21,7 @@
                 <el-button hc-btn @click="toBackClick">返回主页</el-button>
                 <el-button hc-btn @click="toBackClick">返回主页</el-button>
             </template>
             </template>
 
 
-            <HcOnlineOffice :src="docxUrl" title="测试的文档.docx" :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo" />
+            <HcOnlineOffice :key="dataKey" :src="docxUrl" title="测试的文档.docx" :url="saveUrl" :project-id="projectId" :token="token" :user-info="userInfo" />
         </hc-new-card>
         </hc-new-card>
 
 
         <!-- 短信认证 -->
         <!-- 短信认证 -->
@@ -81,6 +81,8 @@ onMounted(() => {
 const state = ref(1)
 const state = ref(1)
 const docxUrl = ref('')
 const docxUrl = ref('')
 const saveUrl = ref('http://192.168.0.128:8090/blade-archive/archivesauto/callbackSave')
 const saveUrl = ref('http://192.168.0.128:8090/blade-archive/archivesauto/callbackSave')
+const dataId = ref('')
+const dataKey = ref('')
 //const docxUrl = ref('https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx')
 //const docxUrl = ref('https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20230317/e2bdc6581e397b810b46ac7cd71b111b.docx')
 //获取文档地址
 //获取文档地址
 const geDocxUrl = async ()=>{
 const geDocxUrl = async ()=>{
@@ -89,6 +91,8 @@ const geDocxUrl = async ()=>{
     })
     })
     if (!error && code === 200) {
     if (!error && code === 200) {
         docxUrl.value = data['worldUrl']
         docxUrl.value = data['worldUrl']
+        dataId.value = data['id']
+        dataKey.value = dataId.value + '_' + Math.random() + ''
     } else {
     } else {
         docxUrl.value = ''
         docxUrl.value = ''
     }
     }