Some Changes in Pos Numbering
This commit is contained in:
@@ -429,22 +429,17 @@ const onChangeTab = (index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setPosNumbers = () => {
|
const setPosNumbers = () => {
|
||||||
let mainIndex = 0
|
let mainIndex = 1
|
||||||
let subIndex = 1
|
let subIndex = 1
|
||||||
let index = 1
|
|
||||||
let rows = itemInfo.value.rows.map(row => {
|
let rows = itemInfo.value.rows.map(row => {
|
||||||
if(row.mode === 'title') {
|
if(row.mode === 'title') {
|
||||||
mainIndex += 1
|
|
||||||
row.pos = mainIndex
|
row.pos = mainIndex
|
||||||
|
mainIndex += 1
|
||||||
subIndex = 1
|
subIndex = 1
|
||||||
} else if(!['pagebreak','title','text'].includes(row.mode)) {
|
} 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
|
subIndex += 1
|
||||||
}
|
}
|
||||||
/*if(!['pagebreak','title','text'].includes(row.mode)) {
|
|
||||||
row.pos = index
|
|
||||||
index += 1
|
|
||||||
}*/
|
|
||||||
return row
|
return row
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user