|
@@ -69,7 +69,7 @@ import Actions from "@/components/actions-merge/index.vue";
|
|
|
|
|
|
import type { ActionsProps, ActionsItem } from "@/components/actions/index.vue";
|
|
|
import { listener } from "@/components/drawing/hook";
|
|
|
-import { getOffset } from "@/utils/event";
|
|
|
+import { clickListener, getOffset } from "@/utils/event";
|
|
|
import { useRMenus } from "@/components/right-menu";
|
|
|
|
|
|
const active = useActive();
|
|
@@ -155,19 +155,20 @@ const reset = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+let unMount: (() => void) | null = null;
|
|
|
useViewStack(() =>
|
|
|
togetherCallback([
|
|
|
showLeftPanoStack.push(ref(true)),
|
|
|
showRightPanoStack.push(computed(() => !!custom.currentModel)),
|
|
|
modelsChangeStoreStack.push(ref(true)),
|
|
|
- listener(
|
|
|
- document.querySelector("#layout-app") as HTMLElement,
|
|
|
- "contextmenu",
|
|
|
- (ev) => {
|
|
|
- const pixel = getOffset(ev);
|
|
|
+ clickListener(
|
|
|
+ document.querySelector("#layout-app") as HTMLDivElement,
|
|
|
+ (pixel) => {
|
|
|
const pos = sdk.getPositionByScreen(pixel);
|
|
|
- if (custom.currentModel) {
|
|
|
- useRMenus(pixel, [
|
|
|
+ if (!custom.currentModel) return;
|
|
|
+ unMount && unMount();
|
|
|
+ setTimeout(() => {
|
|
|
+ unMount = useRMenus(pixel, [
|
|
|
{
|
|
|
label: "移动到这里",
|
|
|
icon: "close",
|
|
@@ -176,8 +177,9 @@ useViewStack(() =>
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
|
- }
|
|
|
- }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 2
|
|
|
),
|
|
|
() => (currentItem.value = null),
|
|
|
])
|