refactor: 重新启用返回按钮功能,确保在场景监控和场景编辑页面中可以返回到父级 iframe 的场景卡片

This commit is contained in:
xudan 2025-09-12 09:11:25 +08:00
parent 5c5d04197e
commit 74cbcc6227
2 changed files with 9 additions and 9 deletions

View File

@ -350,9 +350,9 @@ const contextMenuState = ref<ContextMenuState>(contextMenuManager.getState());
//#endregion
// iframe
// const backToCards = () => {
// window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
// };
const backToCards = () => {
window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
};
//#region
/**
@ -418,7 +418,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
<a-flex justify="space-between" align="center">
<a-typography-text class="title">{{ title }}--{{ isMonitorMode ? '场景监控' : '场景仿真' }}</a-typography-text>
<a-space align="center">
<!-- <a-button @click="backToCards"> 返回 </a-button> -->
<a-button @click="backToCards"> 返回 </a-button>
<a-button type="primary" :loading="isSaving" @click="handleSaveViewState"> 保存比例 </a-button>
</a-space>
</a-flex>

View File

@ -179,10 +179,10 @@ const handleAutoSaveAndRestoreViewState = async () => {
await autoSaveAndRestoreViewState(editor.value, props.id);
};
// // iframe
// const backToCards = () => {
// window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
// };
// iframe
const backToCards = () => {
window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
};
//
const handleAutoCreateStorageConfirm = (actionPoints: any[]) => {
@ -204,7 +204,7 @@ const handleAutoCreateStorageCancel = () => {
<a-flex justify="space-between" align="center">
<a-typography-text class="title">{{ title }} --场景编辑</a-typography-text>
<a-space align="center">
<!-- <a-button @click="backToCards"> 返回 </a-button> -->
<a-button @click="backToCards"> 返回 </a-button>
<a-button type="primary" :loading="isSaving" @click="handleSaveViewState"> 保存比例 </a-button>
<a-button v-if="editable" class="warning" @click="editable = false">
<i class="icon exit size-18 mr-8" />