diff --git a/src/views/infra/bookmark/index.vue b/src/views/infra/bookmark/index.vue index 0693748..bf184be 100644 --- a/src/views/infra/bookmark/index.vue +++ b/src/views/infra/bookmark/index.vue @@ -130,6 +130,9 @@ onMounted(async () => { case 'Action_Save_Resp': handleUserSaveOp() break + case 'App_LoadingStatus': + handleDocumentReady(data) + break } }) }) @@ -237,6 +240,7 @@ async function downloadAndSendCurrentEditFile() { * @param data */ async function handleFileBinary(data: any) { + isPostMessageRead.value = false const { name, type, buffer } = data.Payload const blob = base64ToBlob(buffer, type) const uploadResult = await uploadOneFile({ @@ -305,6 +309,8 @@ function sendMessageToWopiClient(data: any) { /** * 发送消息给第三方调用者 * 用于转发部分WopiClient回调 + * + * ignore:忽略类型 */ function sendMessageToCaller(data: any, ignore: boolean = false) { console.log('已向第三方调用者发送消息') @@ -556,6 +562,21 @@ function handleSendModifyStatus() { }, true) } +/** + * 文件加载完成 + */ +function handleDocumentReady(data: any) { + const Values = data?.Values + const Status = Values?.Status as string + if (Status === 'Document_Loaded') { + sendMessageToCaller({ + ActionId: 'DocumentLoaded', + Payload: null, + Timestamp: Date.now(), + }, true) + } +} + function logEvent(e: MessageEvent) { console.log('=============receive message start=======') console.log(typeof e.data)