feat: 新增文件管理

This commit is contained in:
2024-04-12 22:10:30 +08:00
parent 9c9a29ae05
commit df14bd00dd
22 changed files with 1203 additions and 0 deletions

View File

@@ -18,3 +18,8 @@ export function listRoleDict(query?: { name: string; status: number }) {
export function listCommonDict(code: string) {
return http.get<LabelValueState[]>(`${BASE_URL}/dict/${code}`)
}
/** @desc 上传文件 */
export function uploadFile(data: FormData) {
return http.post(`${BASE_URL}/file`, data)
}

19
src/apis/system/file.ts Normal file
View File

@@ -0,0 +1,19 @@
import http from '@/utils/http'
import type * as System from './type'
const BASE_URL = '/system/file'
/** @desc 查询文件列表 */
export function listFile(query: System.FileQuery) {
return http.get<System.FileItem[]>(`${BASE_URL}/list`, query)
}
/** @desc 修改文件 */
export function updateFile(data: any, id: string) {
return http.put(`${BASE_URL}/${id}`, data)
}
/** @desc 删除文件 */
export function deleteFile(ids: string | Array<string>) {
return http.del(`${BASE_URL}/${ids}`)
}

View File

@@ -1,4 +1,5 @@
export * from './dept'
export * from './log'
export * from './dict'
export * from './file'
export * from './storage'

View File

@@ -91,6 +91,25 @@ export interface DictItemQuery extends PageQuery {
dictId: string
}
/** 系统文件类型 */
export type FileItem = {
id: string
name: string
size: number
url: string
extension: string
type: number
storageId: string
createUserString: string
createTime: string
updateUserString: string
updateTime: string
}
export interface FileQuery extends PageQuery {
name?: string
type?: string
}
/** 系统存储类型 */
export type StorageResp = {
id: string