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-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 {

View File

@ -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 {

View File

@ -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"
/> />