fix(context-menu): 添加播放模式属性,优化存储菜单显示逻辑
This commit is contained in:
parent
fa8f6aa063
commit
d1aa9ab66b
@ -14,6 +14,7 @@
|
|||||||
:menu-x="x"
|
:menu-x="x"
|
||||||
:menu-y="y"
|
:menu-y="y"
|
||||||
:main-menu-width="mainMenuWidth"
|
:main-menu-width="mainMenuWidth"
|
||||||
|
:is-playback-mode="isPlaybackMode"
|
||||||
@action-complete="handleActionComplete"
|
@action-complete="handleActionComplete"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ interface Props {
|
|||||||
storageLocations?: StorageLocationInfo[];
|
storageLocations?: StorageLocationInfo[];
|
||||||
robotId?: string; // 改为传递机器人ID
|
robotId?: string; // 改为传递机器人ID
|
||||||
apiBaseUrl?: string;
|
apiBaseUrl?: string;
|
||||||
|
isPlaybackMode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
|
|||||||
@ -32,12 +32,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="arrow-icon">▶</div>
|
<div v-if="!isPlaybackMode" class="arrow-icon">▶</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 库位操作子菜单 - 使用 Ant Design Dropdown -->
|
<!-- 库位操作子菜单 - 使用 Ant Design Dropdown -->
|
||||||
<a-dropdown
|
<a-dropdown
|
||||||
v-if="showSubMenu && selectedLocation"
|
v-if="!isPlaybackMode && showSubMenu && selectedLocation"
|
||||||
:open="!!showSubMenu"
|
:open="!!showSubMenu"
|
||||||
:trigger="[]"
|
:trigger="[]"
|
||||||
:placement="undefined"
|
:placement="undefined"
|
||||||
@ -100,6 +100,7 @@ interface Props {
|
|||||||
menuX: number;
|
menuX: number;
|
||||||
menuY: number;
|
menuY: number;
|
||||||
mainMenuWidth: number;
|
mainMenuWidth: number;
|
||||||
|
isPlaybackMode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DOOR_AREA_TYPE } from '@api/map/door-area';
|
import { DOOR_AREA_TYPE } from '@api/map/door-area';
|
||||||
import { LockState } from '@meta2d/core';
|
import { LockState } from '@meta2d/core';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
@ -184,7 +184,7 @@ watch(selectedDate, (date) => {
|
|||||||
if (date) {
|
if (date) {
|
||||||
const startOfDayTimestamp = date.startOf('day').valueOf();
|
const startOfDayTimestamp = date.startOf('day').valueOf();
|
||||||
// [修复] 确保传入的时间戳没有毫秒
|
// [修复] 确保传入的时间戳没有毫秒
|
||||||
playback.seek(Math.floor(startOfDayTimestamp / 1000) * 1000);
|
playback.seek(Math.floor(startOfDayTimestamp ) );
|
||||||
// The total duration is now relative to the start of the day
|
// The total duration is now relative to the start of the day
|
||||||
playback.totalDuration.value = 24 * 60 * 60 * 1000;
|
playback.totalDuration.value = 24 * 60 * 60 * 1000;
|
||||||
// Set current time to the beginning of the selected day for the slider
|
// Set current time to the beginning of the selected day for the slider
|
||||||
@ -198,7 +198,7 @@ const handleSeek = (relativeTime: number) => {
|
|||||||
// 乐观更新,立即将前端时间状态同步到用户选择的时间点
|
// 乐观更新,立即将前端时间状态同步到用户选择的时间点
|
||||||
playback.currentTime.value = absoluteTimestamp;
|
playback.currentTime.value = absoluteTimestamp;
|
||||||
// [修复] 确保传入的时间戳没有毫秒
|
// [修复] 确保传入的时间戳没有毫秒
|
||||||
playback.seek(Math.floor(absoluteTimestamp / 1000) * 1000);
|
playback.seek(Math.floor(absoluteTimestamp ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ onMounted(async () => {
|
|||||||
selectedDate.value = debugDate;
|
selectedDate.value = debugDate;
|
||||||
// 直接 seek 到指定的时间点,而不是当天的开始
|
// 直接 seek 到指定的时间点,而不是当天的开始
|
||||||
// [修复] 确保传入的时间戳没有毫秒
|
// [修复] 确保传入的时间戳没有毫秒
|
||||||
playback.seek(Math.floor(debugDate.valueOf() / 1000) * 1000);
|
playback.seek(Math.floor(debugDate.valueOf() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// [移除] 不再需要在这里初始化机器人,交由 onFirstAmrData 回调处理
|
// [移除] 不再需要在这里初始化机器人,交由 onFirstAmrData 回调处理
|
||||||
@ -853,6 +853,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
|
|||||||
:storage-locations="contextMenuState.storageLocations"
|
:storage-locations="contextMenuState.storageLocations"
|
||||||
:robot-id="contextMenuState.robotInfo?.id"
|
:robot-id="contextMenuState.robotInfo?.id"
|
||||||
:token="EDITOR_KEY"
|
:token="EDITOR_KEY"
|
||||||
|
:is-playback-mode="isPlaybackMode"
|
||||||
@close="handleCloseContextMenu"
|
@close="handleCloseContextMenu"
|
||||||
@action-complete="handleActionComplete"
|
@action-complete="handleActionComplete"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user