|
|
@ -45,6 +45,9 @@ import ResourceRenameModal from './rename' |
|
|
|
import { IRenameFile } from './types' |
|
|
|
import { IRenameFile } from './types' |
|
|
|
import type { Router } from 'vue-router' |
|
|
|
import type { Router } from 'vue-router' |
|
|
|
import styles from './index.module.scss' |
|
|
|
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({ |
|
|
|
export default defineComponent({ |
|
|
|
name: 'File', |
|
|
|
name: 'File', |
|
|
@ -142,6 +145,7 @@ export default defineComponent({ |
|
|
|
serachRef.value |
|
|
|
serachRef.value |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const fileStore = useFileStore() |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
resourceListRef.value = getResourceListState(fileId.value) |
|
|
|
resourceListRef.value = getResourceListState(fileId.value) |
|
|
@ -150,7 +154,20 @@ export default defineComponent({ |
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => router.currentRoute.value.params.id, |
|
|
|
() => router.currentRoute.value.params.id, |
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
() => reload() |
|
|
|
() => { |
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|