|
|
|
@ -45,9 +45,6 @@ import ResourceRenameModal from './rename'
|
|
|
|
|
import { IRenameFile } from './types' |
|
|
|
|
import type { Router } from 'vue-router' |
|
|
|
|
import styles from './index.module.scss' |
|
|
|
|
import { useFileStore } from '@/store/file/file' |
|
|
|
|
import { queryCurrentResourceById } from '@/service/modules/resources' |
|
|
|
|
import { ResourceFile } from '@/service/modules/resources/types' |
|
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
|
name: 'File', |
|
|
|
@ -145,7 +142,6 @@ export default defineComponent({
|
|
|
|
|
serachRef.value |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
const fileStore = useFileStore() |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
resourceListRef.value = getResourceListState(fileId.value) |
|
|
|
@ -154,20 +150,7 @@ export default defineComponent({
|
|
|
|
|
watch( |
|
|
|
|
() => router.currentRoute.value.params.id, |
|
|
|
|
// @ts-ignore
|
|
|
|
|
() => { |
|
|
|
|
reload() |
|
|
|
|
const currFileId = Number(router.currentRoute.value.params.id) || -1 |
|
|
|
|
|
|
|
|
|
if (currFileId === -1) { |
|
|
|
|
fileStore.setCurrentDir('/') |
|
|
|
|
} else { |
|
|
|
|
queryCurrentResourceById(currFileId).then((res: ResourceFile) => { |
|
|
|
|
if (res.fullName) { |
|
|
|
|
fileStore.setCurrentDir(res.fullName) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
() => reload() |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|