컴포넌트 잠금기능 구현
This commit is contained in:
@@ -103,10 +103,10 @@ export function ReportDesignerCanvas() {
|
||||
const idsToMove =
|
||||
selectedComponentIds.length > 0 ? selectedComponentIds : ([selectedComponentId].filter(Boolean) as string[]);
|
||||
|
||||
// 각 컴포넌트 이동
|
||||
// 각 컴포넌트 이동 (잠긴 컴포넌트는 제외)
|
||||
idsToMove.forEach((id) => {
|
||||
const component = components.find((c) => c.id === id);
|
||||
if (!component) return;
|
||||
if (!component || component.locked) return;
|
||||
|
||||
let newX = component.x;
|
||||
let newY = component.y;
|
||||
@@ -132,12 +132,20 @@ export function ReportDesignerCanvas() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete 키: 삭제
|
||||
// Delete 키: 삭제 (잠긴 컴포넌트는 제외)
|
||||
if (e.key === "Delete") {
|
||||
if (selectedComponentIds.length > 0) {
|
||||
selectedComponentIds.forEach((id) => removeComponent(id));
|
||||
selectedComponentIds.forEach((id) => {
|
||||
const component = components.find((c) => c.id === id);
|
||||
if (component && !component.locked) {
|
||||
removeComponent(id);
|
||||
}
|
||||
});
|
||||
} else if (selectedComponentId) {
|
||||
removeComponent(selectedComponentId);
|
||||
const component = components.find((c) => c.id === selectedComponentId);
|
||||
if (component && !component.locked) {
|
||||
removeComponent(selectedComponentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user