fix: gotoParent
This commit is contained in:
parent
bc9948659b
commit
80d2ed681f
1 changed files with 2 additions and 1 deletions
|
|
@ -64,7 +64,6 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
||||||
const pathArray: string[] = pathname.split('/').filter(Boolean)
|
const pathArray: string[] = pathname.split('/').filter(Boolean)
|
||||||
|
|
||||||
currentDept.value = pathArray.length
|
currentDept.value = pathArray.length
|
||||||
|
|
||||||
if (pathArray.length >= 4) {
|
if (pathArray.length >= 4) {
|
||||||
currentFolder.value = []
|
currentFolder.value = []
|
||||||
|
|
||||||
|
|
@ -72,6 +71,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
||||||
|
|
||||||
let current: (typeof data.value)[number] | undefined
|
let current: (typeof data.value)[number] | undefined
|
||||||
current = data.value.find((v) => v.name === pathArray[0])
|
current = data.value.find((v) => v.name === pathArray[0])
|
||||||
|
|
||||||
if (current && updateStatus) current.status = true
|
if (current && updateStatus) current.status = true
|
||||||
current = current?.folder.find((v) => v.name === pathArray[1])
|
current = current?.folder.find((v) => v.name === pathArray[1])
|
||||||
if (current && updateStatus) current.status = true
|
if (current && updateStatus) current.status = true
|
||||||
|
|
@ -80,6 +80,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
|
||||||
current = current?.folder.find((v) => v.name === pathArray[3])
|
current = current?.folder.find((v) => v.name === pathArray[3])
|
||||||
if (current && updateStatus) current.status = true
|
if (current && updateStatus) current.status = true
|
||||||
|
|
||||||
|
currentPath.value = pathname
|
||||||
return loader.hide()
|
return loader.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue