Some Changes in Pos Numbering

This commit is contained in:
2024-09-26 18:56:19 +02:00
parent 3c5f80f8b5
commit 2458b3573f

View File

@@ -429,22 +429,17 @@ const onChangeTab = (index) => {
}
const setPosNumbers = () => {
let mainIndex = 0
let mainIndex = 1
let subIndex = 1
let index = 1
let rows = itemInfo.value.rows.map(row => {
if(row.mode === 'title') {
mainIndex += 1
row.pos = mainIndex
mainIndex += 1
subIndex = 1
} else if(!['pagebreak','title','text'].includes(row.mode)) {
row.pos = `${mainIndex}.${subIndex}`
row.pos = itemInfo.value.rows.filter(i => i.mode === "title").length === 0 ? `${subIndex}` :`${ mainIndex - 1}.${subIndex}`
subIndex += 1
}
/*if(!['pagebreak','title','text'].includes(row.mode)) {
row.pos = index
index += 1
}*/
return row
})
}