diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e595b7..f0b8065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ +## 2024-03-30 + +### 🐛 Bug Fixes | Bug 修复 + +* 修复筛选后路径跳转失败的BUG + ## 2024-03-29 ### ✨ Features | 新功能 diff --git a/src/views/personal/drawer.vue b/src/views/personal/drawer.vue index ec85862..e384bf6 100644 --- a/src/views/personal/drawer.vue +++ b/src/views/personal/drawer.vue @@ -152,6 +152,7 @@ import { useStore } from '@/store/index' import { cosUploadFile } from '@/utils/cos' import {postCreateFile, getFileSize, getPersonalFatherId, getCategory} from './utils' import type { requestCreateFile } from './utils' +import router from "@/router"; const folder = ref() const store = useStore() @@ -187,6 +188,8 @@ watch(selectType, (newVal) => { emit('sendDrawerOptions', 'showRecycle') } else { + const pathList = (sessionStorage.getItem("PathId") as string).split("/") + router.push('/personal/' + pathList[pathList.length - 1]) emit('sendDrawerOptions', 'showFiles') emit('sendDrawerSelectType', newVal) } diff --git a/src/views/personal/files.vue b/src/views/personal/files.vue index 5df93aa..0e31490 100644 --- a/src/views/personal/files.vue +++ b/src/views/personal/files.vue @@ -87,7 +87,6 @@ import type { responsePrivateFilesList, fileData, requestCreateFile } from './ut const store = useStore() const optionTop = ref(0) const optionLeft = ref(0) -const isClassifyFiles = ref(false) const fatherId = ref("") const chooseFileList = ref([]) const fileDetails = ref( @@ -160,9 +159,6 @@ onMounted(async() => { }) onBeforeRouteUpdate(async(to) => { - if (isClassifyFiles.value) { - return - } fatherId.value = to.params.fatherId as string nowFilesList.value = await getPrivateFilesList({ limit: 100, @@ -302,7 +298,6 @@ const optionType = (sendOptions: string) => { // 文件筛选 const classifyFile = async () => { - isClassifyFiles.value = true let category = 0; switch (props.sendRequest.message) { case "file": @@ -360,7 +355,6 @@ const getOptions = (file: fileData, event: any, index: number) => { const toFile = (file: fileData) => { if (file.type === '文件夹') { - isClassifyFiles.value = false fatherId.value = file.fileId router.push({name: 'personal', params: {fatherId: fatherId.value}}) } diff --git a/src/views/personal/personal.vue b/src/views/personal/personal.vue index 09829da..2ce6bf5 100644 --- a/src/views/personal/personal.vue +++ b/src/views/personal/personal.vue @@ -68,7 +68,7 @@ const isShowRecycle = ref(location.href.includes('recycle')) const isLoading = ref(false) const isShowPopup = ref(false) const isShowFiles = ref(!location.href.includes('recycle')) - +let isFirst = false const getPathMsg = (sendPathMsg: any) => { requestMessage.value = { option: sendPathMsg.option, @@ -83,15 +83,21 @@ const getDrawerOptionType = (sendDrawerOptions: string) => { isShowFiles.value = false } else if (sendDrawerOptions === 'showFiles'){ + const pathList = (sessionStorage.getItem("PathId") as string).split("/") + router.push('/personal/' + pathList[pathList.length - 1]) isShowRecycle.value = false isShowFiles.value = true } } const getDrawerSelectType = (sendDrawerSelectType: any) => { + if(isFirst) { requestMessage.value = { - option: "classifyFiles", - message: sendDrawerSelectType + option: "classifyFiles", + message: sendDrawerSelectType } + } else { + isFirst = true + } } const getLoading = (loading: boolean) => { diff --git a/src/views/personal/rename-box.vue b/src/views/personal/rename-box.vue index c430f56..dea7565 100644 --- a/src/views/personal/rename-box.vue +++ b/src/views/personal/rename-box.vue @@ -44,7 +44,8 @@ const confirm = () => { post('/content/updateFile', { fileId: props.sendName.fileId, name: name.value - }).then(() => { + }).then((res:any) => { + name.value = res.name emit('sendRename', { option: 'confirm', message: name.value diff --git a/src/views/personal/utils.ts b/src/views/personal/utils.ts index 1b59c3c..a1bad74 100644 --- a/src/views/personal/utils.ts +++ b/src/views/personal/utils.ts @@ -125,9 +125,8 @@ const downloadFile = (url: string, fileName: string) => { // 请求彻底删除文件 export const postCleanOutFile = async(fileIdList: string[]) :Promise => { - const fileId = fileIdList[0] await post('/content/completelyRemoveFile', { - fileId + fileIds: fileIdList }) .then(() => { successMsg('成功彻底删除') @@ -189,7 +188,6 @@ export const getRecycleFilesList = async(params: requestPrivateFilesList): Promi token: res.token, } }) - console.log(filesList.value); return filesList.value } @@ -235,6 +233,7 @@ export const getPrivateFilesList = async(params: requestPrivateFilesList): Promi fatherNamePath: "", }) const url = '/content/getPrivateFiles' + generateGetRequestURL(params) + console.log(url) await get(url) .then ((res: any) => { filesList.value = {