bugfix: 删除sketch

This commit is contained in:
2026-03-31 11:39:42 +08:00
parent d6f1985cb0
commit fcc5fd66f8
4 changed files with 62 additions and 34 deletions

View File

@@ -57,13 +57,15 @@
// VersionTreeIndexRef.value.getVersionTree()
}
const handleDeleteSketch = (deletedId: string) => {
sketchList.value = sketchList.value.filter((item) => {
if (typeof item === 'object') {
return Object.keys(item)[0] !== deletedId
}
return true
})
const handleDeleteSketch = (id) => {
sketchList.value = sketchList.value
.map((sketchItem) => {
if (sketchItem.hasOwnProperty(id)) {
delete sketchItem[id]
}
return sketchItem
})
.filter((sketchItem) => Object.keys(sketchItem).length > 0)
}
const handleSetTitle = (title: string) => {
@@ -93,7 +95,7 @@
const handleGetProjectInfoAndHistory = () => {
handleOpenSketch()
getProjectInfo({ id: route.params.id }).then((res) => {
if(!res) {
if (!res) {
router.push({ name: 'mainInput' })
ElMessage.warning(t('Home.notFound'))
return