fix(context-menu): 添加播放模式属性,优化存储菜单显示逻辑

This commit is contained in:
xudan 2025-10-30 11:06:57 +08:00
parent fa8f6aa063
commit d1aa9ab66b
3 changed files with 10 additions and 6 deletions

View File

@ -14,6 +14,7 @@
:menu-x="x"
:menu-y="y"
:main-menu-width="mainMenuWidth"
:is-playback-mode="isPlaybackMode"
@action-complete="handleActionComplete"
/>
@ -48,6 +49,7 @@ interface Props {
storageLocations?: StorageLocationInfo[];
robotId?: string; // ID
apiBaseUrl?: string;
isPlaybackMode?: boolean;
}
interface Emits {

View File

@ -32,12 +32,12 @@
</div>
</div>
</div>
<div class="arrow-icon"></div>
<div v-if="!isPlaybackMode" class="arrow-icon"></div>
</div>
<!-- 库位操作子菜单 - 使用 Ant Design Dropdown -->
<a-dropdown
v-if="showSubMenu && selectedLocation"
v-if="!isPlaybackMode && showSubMenu && selectedLocation"
:open="!!showSubMenu"
:trigger="[]"
:placement="undefined"
@ -100,6 +100,7 @@ interface Props {
menuX: number;
menuY: number;
mainMenuWidth: number;
isPlaybackMode?: boolean;
}
interface Emits {

View File

@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup lang="ts">
import { DOOR_AREA_TYPE } from '@api/map/door-area';
import { LockState } from '@meta2d/core';
import { message } from 'ant-design-vue';
@ -184,7 +184,7 @@ watch(selectedDate, (date) => {
if (date) {
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
playback.totalDuration.value = 24 * 60 * 60 * 1000;
// 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.seek(Math.floor(absoluteTimestamp / 1000) * 1000);
playback.seek(Math.floor(absoluteTimestamp ) );
}
};
@ -463,7 +463,7 @@ onMounted(async () => {
selectedDate.value = debugDate;
// seek
// []
playback.seek(Math.floor(debugDate.valueOf() / 1000) * 1000);
playback.seek(Math.floor(debugDate.valueOf() ) );
}
// [] onFirstAmrData
@ -853,6 +853,7 @@ const handleGlobalKeydown = (event: KeyboardEvent) => {
:storage-locations="contextMenuState.storageLocations"
:robot-id="contextMenuState.robotInfo?.id"
:token="EDITOR_KEY"
:is-playback-mode="isPlaybackMode"
@close="handleCloseContextMenu"
@action-complete="handleActionComplete"
/>