|
@@ -60,6 +60,20 @@ export const useComponentMenus = <T extends DrawItem>(
|
|
|
// 置顶 置底
|
|
|
const currentZIndex = useCurrentZIndex();
|
|
|
operateMenus.push(
|
|
|
+ reactive({
|
|
|
+ label: computed(() => (data.value.lock ? "解锁" : "锁定")) as any,
|
|
|
+ handler() {
|
|
|
+ data.value.lock = !data.value.lock;
|
|
|
+ emit("updateShape", { ...data.value });
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ reactive({
|
|
|
+ label: "隐藏",
|
|
|
+ handler() {
|
|
|
+ data.value.hide = true;
|
|
|
+ emit("updateShape", { ...data.value });
|
|
|
+ },
|
|
|
+ })
|
|
|
// {
|
|
|
// label: `上移`,
|
|
|
// icon: Top,
|
|
@@ -76,31 +90,6 @@ export const useComponentMenus = <T extends DrawItem>(
|
|
|
// emit("updateShape", { ...data.value });
|
|
|
// },
|
|
|
// },
|
|
|
- {
|
|
|
- label: `置顶`,
|
|
|
- handler() {
|
|
|
- data.value.zIndex = currentZIndex.max + 1;
|
|
|
- emit("updateShape", { ...data.value });
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- label: `置底`,
|
|
|
- handler() {
|
|
|
- data.value.zIndex = currentZIndex.min - 1;
|
|
|
- emit("updateShape", { ...data.value });
|
|
|
- },
|
|
|
- }
|
|
|
- );
|
|
|
-
|
|
|
- // 锁定 解锁
|
|
|
- operateMenus.push(
|
|
|
- reactive({
|
|
|
- label: computed(() => (data.value.lock ? "解锁" : "锁定")) as any,
|
|
|
- handler() {
|
|
|
- data.value.lock = !data.value.lock;
|
|
|
- emit("updateShape", { ...data.value });
|
|
|
- },
|
|
|
- })
|
|
|
);
|
|
|
|
|
|
if (alignment) {
|
|
@@ -118,17 +107,6 @@ export const useComponentMenus = <T extends DrawItem>(
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 隐藏
|
|
|
- operateMenus.push(
|
|
|
- reactive({
|
|
|
- label: "隐藏",
|
|
|
- handler() {
|
|
|
- data.value.hide = true;
|
|
|
- emit("updateShape", { ...data.value });
|
|
|
- },
|
|
|
- })
|
|
|
- );
|
|
|
-
|
|
|
if (copyHandler) {
|
|
|
const getCopyTransform = useGetShapeCopyTransform(shape);
|
|
|
const status = useMouseShapesStatus();
|
|
@@ -154,7 +132,22 @@ export const useComponentMenus = <T extends DrawItem>(
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ operateMenus.push(
|
|
|
+ {
|
|
|
+ label: `置顶`,
|
|
|
+ handler() {
|
|
|
+ data.value.zIndex = currentZIndex.max + 1;
|
|
|
+ emit("updateShape", { ...data.value });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: `置底`,
|
|
|
+ handler() {
|
|
|
+ data.value.zIndex = currentZIndex.min - 1;
|
|
|
+ emit("updateShape", { ...data.value });
|
|
|
+ },
|
|
|
+ }
|
|
|
+ );
|
|
|
if (!data.value.disableDelete) {
|
|
|
operateMenus.push({
|
|
|
label: `删除`,
|
|
@@ -219,7 +212,7 @@ export const useComponentDescribes = <T extends { id: string }>(
|
|
|
watchEffect((onCleanup) => {
|
|
|
gdescs.set(data.value, descs.value);
|
|
|
onCleanup(() => {
|
|
|
- gdescs.del(data.value.id)
|
|
|
+ gdescs.del(data.value.id);
|
|
|
});
|
|
|
});
|
|
|
watch(
|
|
@@ -261,7 +254,7 @@ export const useComponentStatus = <S extends EntityShape, T extends DrawItem>(
|
|
|
);
|
|
|
const data = useAutomaticData(
|
|
|
() => args.props.data,
|
|
|
- (data) => args.selfData ? data : copy(data)
|
|
|
+ (data) => (args.selfData ? data : copy(data))
|
|
|
);
|
|
|
const [style, pause, resume] = useAnimationMouseStyle({
|
|
|
data: data,
|