|
|
@ -16,15 +16,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
import { |
|
|
|
import { defineComponent, onMounted, ref, reactive, Ref } from 'vue' |
|
|
|
defineComponent, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
reactive, |
|
|
|
|
|
|
|
Ref, |
|
|
|
|
|
|
|
watch, |
|
|
|
|
|
|
|
inject |
|
|
|
|
|
|
|
} from 'vue' |
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
NIcon, |
|
|
|
NIcon, |
|
|
|
NSpace, |
|
|
|
NSpace, |
|
|
@ -56,12 +48,10 @@ import { ResourceFile } from '@/service/modules/resources/types' |
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
|
export default defineComponent({ |
|
|
|
name: 'File', |
|
|
|
name: 'File', |
|
|
|
inject: ['reload'], |
|
|
|
|
|
|
|
setup() { |
|
|
|
setup() { |
|
|
|
const router: Router = useRouter() |
|
|
|
const router: Router = useRouter() |
|
|
|
const fileId = ref(Number(router.currentRoute.value.params.id) || -1) |
|
|
|
const fileId = ref(Number(router.currentRoute.value.params.id) || -1) |
|
|
|
|
|
|
|
|
|
|
|
const reload: any = inject('reload') |
|
|
|
|
|
|
|
const resourceListRef = ref() |
|
|
|
const resourceListRef = ref() |
|
|
|
const folderShowRef = ref(false) |
|
|
|
const folderShowRef = ref(false) |
|
|
|
const uploadShowRef = ref(false) |
|
|
|
const uploadShowRef = ref(false) |
|
|
@ -171,24 +161,18 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
} |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
onMounted(() => { |
|
|
|
() => router.currentRoute.value.params.id, |
|
|
|
const currFileId = Number(router.currentRoute.value.params.id) || -1 |
|
|
|
// @ts-ignore
|
|
|
|
if (currFileId === -1) { |
|
|
|
() => { |
|
|
|
fileStore.setCurrentDir('/') |
|
|
|
reload() |
|
|
|
} else { |
|
|
|
const currFileId = Number(router.currentRoute.value.params.id) || -1 |
|
|
|
queryCurrentResourceById(currFileId).then((res: ResourceFile) => { |
|
|
|
|
|
|
|
if (res.fullName) { |
|
|
|
if (currFileId === -1) { |
|
|
|
fileStore.setCurrentDir(res.fullName) |
|
|
|
fileStore.setCurrentDir('/') |
|
|
|
} |
|
|
|
} else { |
|
|
|
}) |
|
|
|
queryCurrentResourceById(currFileId).then((res: ResourceFile) => { |
|
|
|
|
|
|
|
if (res.fullName) { |
|
|
|
|
|
|
|
fileStore.setCurrentDir(res.fullName) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const initBreadcrumb = async (dirs: string[]) => { |
|
|
|
const initBreadcrumb = async (dirs: string[]) => { |
|
|
|
let index = 0 |
|
|
|
let index = 0 |
|
|
|