diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 52c9816..ae5a895 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -430,14 +430,7 @@ const addPosition = (mode) => { } const removePosition = (id) => { - let rows = itemInfo.value.rows.filter(row => row.id !== id) - /*rows = rows.sort((a,b) => a.pos - b.pos) - - rows.forEach((row,index) => { - rows[index] = {...row, pos: index + 1} - })*/ - - itemInfo.value.rows = rows + itemInfo.value.rows = itemInfo.value.rows.filter(row => row.id !== id) setPosNumbers() @@ -830,6 +823,11 @@ const setPosNumbers = () => { row.pos = itemInfo.value.rows.filter(i => i.mode === "title").length === 0 ? `${subIndex}` :`${ mainIndex - 1}.${subIndex}` subIndex += 1 } + + if(!row.id) { + row.id = uuidv4() + } + return row }) } @@ -1076,7 +1074,6 @@ const setRowData = (row) => { -