feat: 更新填充组图层背景命令,增强图层管理和颜色填充功能,优化图层选择和渲染逻辑
This commit is contained in:
@@ -653,35 +653,35 @@ function buildContextMenuItems(layer) {
|
||||
action: () => deleteSelectedLayers(),
|
||||
},
|
||||
// 组合图层
|
||||
{
|
||||
label: "填充图层",
|
||||
icon: "CThemeColor",
|
||||
disabled:
|
||||
layer.isBackground ||
|
||||
layer.isFixed ||
|
||||
!layerManager?.canRasterizeLayer?.(layer.id) ||
|
||||
layer.isGroup ||
|
||||
layer?.children?.length > 0, // 如果是组图层或有子图层则禁用
|
||||
action: () => {
|
||||
// 调用浏览器原生颜色选择器
|
||||
fillColorRef.value.click();
|
||||
currLayerId.value = layer.id;
|
||||
// // 监听颜色选择器的变化
|
||||
// fillColorRef.value.addEventListener("change", () => {
|
||||
// const selectedColor = fillColor.value;
|
||||
// layerManager
|
||||
// .fillLayerBackground(layer.id, selectedColor)
|
||||
// .then(() => {
|
||||
// console.log(`✅ 已填充图层 ${layer.name} 背景颜色: ${selectedColor}`);
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.error(`❌ 填充图层 ${layer.name} 背景颜色失败:`, error);
|
||||
// });
|
||||
// });
|
||||
// 隐藏右键菜单
|
||||
hideContextMenu();
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: "填充图层",
|
||||
// icon: "CThemeColor",
|
||||
// disabled:
|
||||
// layer.isBackground ||
|
||||
// layer.isFixed ||
|
||||
// !layerManager?.canRasterizeLayer?.(layer.id) ||
|
||||
// layer.isGroup ||
|
||||
// layer?.children?.length > 0, // 如果是组图层或有子图层则禁用
|
||||
// action: () => {
|
||||
// // 调用浏览器原生颜色选择器
|
||||
// fillColorRef.value.click();
|
||||
// currLayerId.value = layer.id;
|
||||
// // // 监听颜色选择器的变化
|
||||
// // fillColorRef.value.addEventListener("change", () => {
|
||||
// // const selectedColor = fillColor.value;
|
||||
// // layerManager
|
||||
// // .fillLayerBackground(layer.id, selectedColor)
|
||||
// // .then(() => {
|
||||
// // console.log(`✅ 已填充图层 ${layer.name} 背景颜色: ${selectedColor}`);
|
||||
// // })
|
||||
// // .catch((error) => {
|
||||
// // console.error(`❌ 填充图层 ${layer.name} 背景颜色失败:`, error);
|
||||
// // });
|
||||
// // });
|
||||
// // 隐藏右键菜单
|
||||
// hideContextMenu();
|
||||
// },
|
||||
// },
|
||||
// 组合图层
|
||||
{
|
||||
label: "组合图层",
|
||||
@@ -1512,14 +1512,14 @@ async function moveGroupToGroup(draggedLayer, fromParentId, toParentId, newIndex
|
||||
<div class="layers-panel-inner" @click="handlePanelClick">
|
||||
<div class="layers-header">
|
||||
<!-- 颜色填充选择组件 -->
|
||||
<input
|
||||
<!-- <input
|
||||
class="fillColor-input"
|
||||
v-model="fillColor"
|
||||
ref="fillColorRef"
|
||||
type="color"
|
||||
@change="fillColorChange"
|
||||
style="width: 0; height: 0; opacity: 0"
|
||||
/>
|
||||
/> -->
|
||||
<h3>
|
||||
{{ $t("图层") }}
|
||||
{{ selectedLayerIds.length > 0 ? `(${selectedLayerIds.length})` : "" }}
|
||||
|
||||
Reference in New Issue
Block a user