mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-08 22:57:11 +08:00
修复文件管理数量刷新问题
This commit is contained in:
@@ -26,6 +26,7 @@ import { FileTypeList } from '@/constant/file'
|
||||
import { useChart } from '@/hooks'
|
||||
import { type FileStatisticsResp, getFileStatistics } from '@/apis/system'
|
||||
import { formatFileSize } from '@/utils'
|
||||
import mittBus from '@/utils/mitt'
|
||||
|
||||
use([TitleComponent, TooltipComponent, LegendComponent, PieChart, CanvasRenderer])
|
||||
|
||||
@@ -106,6 +107,9 @@ const getStatisticsData = async () => {
|
||||
|
||||
onMounted(() => {
|
||||
getStatisticsData()
|
||||
mittBus.on('file-total-refresh', () => {
|
||||
getStatisticsData()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@@ -103,7 +103,7 @@ import { type FileItem, type FileQuery, deleteFile, listFile, uploadFile } from
|
||||
import { ImageTypes, OfficeTypes } from '@/constant/file'
|
||||
import 'viewerjs/dist/viewer.css'
|
||||
import { downloadByUrl } from '@/utils/downloadFile'
|
||||
|
||||
import mittBus from '@/utils/mitt'
|
||||
import type { ExcelConfig } from '@/components/FilePreview/type'
|
||||
|
||||
const FilePreview = defineAsyncComponent(() => import('@/components/FilePreview/index.vue'))
|
||||
@@ -195,6 +195,7 @@ const handleRightMenuClick = async (mode: string, fileInfo: FileItem) => {
|
||||
await deleteFile(fileInfo.id)
|
||||
Message.success('删除成功')
|
||||
search()
|
||||
mittBus.emit('file-total-refresh')
|
||||
},
|
||||
})
|
||||
} else if (mode === 'rename') {
|
||||
@@ -221,6 +222,7 @@ const handleMulDelete = () => {
|
||||
await deleteFile(selectedFileIds.value)
|
||||
Message.success('删除成功')
|
||||
search()
|
||||
mittBus.emit('file-total-refresh')
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -240,6 +242,8 @@ const handleUpload = (options: RequestOption) => {
|
||||
search()
|
||||
} catch (error) {
|
||||
onError(error)
|
||||
} finally {
|
||||
mittBus.emit('file-total-refresh')
|
||||
}
|
||||
})()
|
||||
return {
|
||||
|
Reference in New Issue
Block a user