合并画布
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { computed, ref, nextTick, inject } from "vue";
|
||||
import { isGroupLayer } from "../../utils/layerHelper";
|
||||
import { findLayerRecursively, isGroupLayer } from "../../utils/layerHelper";
|
||||
import SvgIcon from "../../../SvgIcon/index.vue";
|
||||
import ContextMenu from "./ContextMenu.vue";
|
||||
import LayerItem from "./LayerItem.vue";
|
||||
@@ -691,15 +691,15 @@ function buildContextMenuItems(layer) {
|
||||
hideContextMenu();
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "合并组",
|
||||
icon: "CMergeGroup",
|
||||
disabled: !isGroupLayer || isMultiple,
|
||||
action: () => {
|
||||
mergeGroupLayer(layer.id);
|
||||
hideContextMenu();
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: "合并组", // 不需要了 同栅格化功能一样了
|
||||
// icon: "CMergeGroup",
|
||||
// disabled: !isGroupLayer || isMultiple,
|
||||
// action: () => {
|
||||
// mergeGroupLayer(layer.id);
|
||||
// hideContextMenu();
|
||||
// },
|
||||
// },
|
||||
],
|
||||
},
|
||||
// 图层操作 - 带子菜单
|
||||
@@ -1099,8 +1099,7 @@ async function rasterizeLayer(layerId) {
|
||||
try {
|
||||
const success = await layerManager.rasterizeLayer(layerId);
|
||||
if (success) {
|
||||
const layer = layers.value.find((l) => l.id === layerId);
|
||||
console.log(`✅ 成功栅格化图层: ${layer?.name || layerId}`);
|
||||
console.log(`✅ 成功栅格化图层: ${layerId}`);
|
||||
} else {
|
||||
console.warn("栅格化图层失败");
|
||||
}
|
||||
@@ -1164,6 +1163,11 @@ function moveLayerToBottom(layerId) {
|
||||
console.warn("置底图层失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 事件转发方法
|
||||
const forwardEvent = (eventName, ...args) => {
|
||||
emit(eventName, ...args);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -1281,6 +1285,8 @@ function moveLayerToBottom(layerId) {
|
||||
<!-- 固定层(背景层和固定层) -->
|
||||
<div v-if="fixedLayers.length > 0" class="fixed-layers">
|
||||
<!-- 遍历固定层 -->
|
||||
<!-- :thumbnail-url="getLayerThumbnail(layer.id)" -->
|
||||
|
||||
<LayerItem
|
||||
v-for="layer in fixedLayers"
|
||||
:key="layer.id"
|
||||
@@ -1292,10 +1298,9 @@ function moveLayerToBottom(layerId) {
|
||||
:is-editing="editingLayerId === layer.id"
|
||||
:editing-name="editingLayerName"
|
||||
:can-delete="false"
|
||||
:thumbnail-url="getLayerThumbnail(layer.id)"
|
||||
:isHidenDragHandle="true"
|
||||
@toggle-visibility="
|
||||
(...args) => forwardEvent('toggle-visibility', ...args)
|
||||
(...args) => forwardEvent('toggle-layer-visibility', ...args)
|
||||
"
|
||||
@edit-confirm="(...args) => forwardEvent('edit-confirm', ...args)"
|
||||
@edit-cancel="(...args) => forwardEvent('edit-cancel', ...args)"
|
||||
|
||||
Reference in New Issue
Block a user