feat: [planning-design] 스토리보드 페이지 복사 기능 추가

This commit is contained in:
김보곤
2026-03-07 23:51:53 +09:00
parent 3e3ea03139
commit c6b6bbdf92

View File

@@ -1344,6 +1344,8 @@
<div class="sb-topbar-sep"></div>
<button style="padding:4px 10px; border:1px solid #e2e8f0; border-radius:6px; font-size:11px; cursor:pointer; background:#fff; color:#374151;"
@click="sbAddPage()">+ 페이지 추가</button>
<button style="padding:4px 10px; border:1px solid #e2e8f0; border-radius:6px; font-size:11px; cursor:pointer; background:#fff; color:#2563eb;"
@click="sbDuplicatePage()">페이지 복사</button>
<button style="padding:4px 10px; border:1px solid #e2e8f0; border-radius:6px; font-size:11px; cursor:pointer; background:#fff; color:#ef4444;"
x-show="sb.pages.length > 1"
@click="sbDeletePage()">페이지 삭제</button>
@@ -2848,6 +2850,23 @@ function planningCanvas() {
this.autoSave();
},
sbDuplicatePage() {
const page = this.sbCurrentPage;
if (!page) return;
const copy = JSON.parse(JSON.stringify(page));
copy.id = 'pg_' + Date.now();
copy.screenName = (copy.screenName || '화면') + ' (복사)';
// 블록 id도 새로 생성
if (copy.blocks) {
copy.blocks.forEach(blk => {
blk.id = 'blk_' + Date.now() + '_' + Math.random().toString(36).slice(2, 5);
});
}
this.sb.pages.splice(this.sb.currentPageIndex + 1, 0, copy);
this.sb.currentPageIndex = this.sb.currentPageIndex + 1;
this.autoSave();
},
sbDeletePage() {
if (this.sb.pages.length <= 1) return;
if (!confirm('이 페이지를 삭제하시겠습니까?')) return;