mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-09 20:57:17 +08:00
fix:修复文件管理左侧‘全部’查询问题
This commit is contained in:
@@ -96,7 +96,7 @@ const { mode, selectedFileIds, toggleMode, addSelectedFileItem } = useFileManage
|
|||||||
|
|
||||||
const queryForm = reactive<FileQuery>({
|
const queryForm = reactive<FileQuery>({
|
||||||
name: undefined,
|
name: undefined,
|
||||||
type: route.query.type?.toString() || undefined,
|
type: route.query.type?.toString() !== '0' ? route.query.type?.toString() : undefined,
|
||||||
sort: ['updateTime,desc']
|
sort: ['updateTime,desc']
|
||||||
})
|
})
|
||||||
const paginationOption = reactive({
|
const paginationOption = reactive({
|
||||||
@@ -187,19 +187,19 @@ const handleMulDelete = () => {
|
|||||||
const handleUpload = (options: RequestOption) => {
|
const handleUpload = (options: RequestOption) => {
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
; (async function requestWrap() {
|
; (async function requestWrap() {
|
||||||
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
|
||||||
onProgress(20)
|
onProgress(20)
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append(name as string, fileItem.file as Blob)
|
formData.append(name as string, fileItem.file as Blob)
|
||||||
try {
|
try {
|
||||||
const res = await uploadFile(formData)
|
const res = await uploadFile(formData)
|
||||||
Message.success('上传成功')
|
Message.success('上传成功')
|
||||||
onSuccess(res)
|
onSuccess(res)
|
||||||
search()
|
search()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
onError(error)
|
onError(error)
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
return {
|
return {
|
||||||
abort() {
|
abort() {
|
||||||
controller.abort()
|
controller.abort()
|
||||||
@@ -209,7 +209,12 @@ const handleUpload = (options: RequestOption) => {
|
|||||||
|
|
||||||
onBeforeRouteUpdate((to) => {
|
onBeforeRouteUpdate((to) => {
|
||||||
if (!to.query.type) return
|
if (!to.query.type) return
|
||||||
queryForm.type = to.query.type?.toString()
|
if (to.query.type === '0') {
|
||||||
|
queryForm.type = undefined
|
||||||
|
} else {
|
||||||
|
queryForm.type = to.query.type?.toString()
|
||||||
|
}
|
||||||
|
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user