Tidying in Removing
Added ID Check to SetPosnumber
This commit is contained in:
@@ -430,14 +430,7 @@ const addPosition = (mode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const removePosition = (id) => {
|
const removePosition = (id) => {
|
||||||
let rows = itemInfo.value.rows.filter(row => row.id !== id)
|
itemInfo.value.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
|
|
||||||
setPosNumbers()
|
setPosNumbers()
|
||||||
|
|
||||||
|
|
||||||
@@ -830,6 +823,11 @@ const setPosNumbers = () => {
|
|||||||
row.pos = itemInfo.value.rows.filter(i => i.mode === "title").length === 0 ? `${subIndex}` :`${ mainIndex - 1}.${subIndex}`
|
row.pos = itemInfo.value.rows.filter(i => i.mode === "title").length === 0 ? `${subIndex}` :`${ mainIndex - 1}.${subIndex}`
|
||||||
subIndex += 1
|
subIndex += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!row.id) {
|
||||||
|
row.id = uuidv4()
|
||||||
|
}
|
||||||
|
|
||||||
return row
|
return row
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1076,7 +1074,6 @@ const setRowData = (row) => {
|
|||||||
</UButton>
|
</UButton>
|
||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent>
|
||||||
<UTabs class="p-5" :items="tabItems" @change="onChangeTab" v-if="loaded">
|
<UTabs class="p-5" :items="tabItems" @change="onChangeTab" v-if="loaded">
|
||||||
<template #item="{item}">
|
<template #item="{item}">
|
||||||
|
|||||||
Reference in New Issue
Block a user