fix(file): 修正文件管理页面存储类型搜索功能
- 修正FileServiceType枚举,使用语义化的字符串值替代数字值
- 新增FileServiceTypeMapping映射,解决数据库存储值与枚举值不匹配问题
- 新增FILE_SERVICE_DB_OPTIONS选项,专门用于搜索表单的下拉选择
- 更新文件管理页面的存储类型搜索选项,确保搜索功能正常工作
- 保持向后兼容性,数据库存储仍使用数字值('1','2','3')
This commit is contained in:
parent
3b5944e789
commit
f8d1511a5d
@ -58,11 +58,18 @@ export interface FileUploadResult {
|
||||
|
||||
// 文件服务类型枚举
|
||||
export enum FileServiceType {
|
||||
LOCAL = '1', // 本地存储
|
||||
MINIO = '2', // MinIO对象存储
|
||||
OSS = '3', // 阿里云对象存储
|
||||
LOCAL = 'LOCAL', // 本地存储
|
||||
MINIO = 'MINIO', // MinIO对象存储
|
||||
OSS = 'OSS', // 阿里云对象存储
|
||||
}
|
||||
|
||||
// 文件服务类型映射(用于数据库存储)
|
||||
export const FileServiceTypeMapping = {
|
||||
LOCAL: '1',
|
||||
MINIO: '2',
|
||||
OSS: '3',
|
||||
} as const
|
||||
|
||||
// 文件类型枚举
|
||||
export enum FileTypeEnum {
|
||||
ALL = '0', // 全部
|
||||
@ -93,3 +100,10 @@ export const FILE_SERVICE_OPTIONS = [
|
||||
{ label: 'MinIO存储', value: FileServiceType.MINIO },
|
||||
{ label: '阿里云OSS', value: FileServiceType.OSS },
|
||||
]
|
||||
|
||||
// 文件服务类型数据库值选项(用于搜索)
|
||||
export const FILE_SERVICE_DB_OPTIONS = [
|
||||
{ label: '本地存储', value: '1' },
|
||||
{ label: 'MinIO存储', value: '2' },
|
||||
{ label: '阿里云OSS', value: '3' },
|
||||
]
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
v-model:value="searchForm.fileService"
|
||||
placeholder="请选择存储类型"
|
||||
clearable
|
||||
:options="FILE_SERVICE_OPTIONS"
|
||||
:options="FILE_SERVICE_DB_OPTIONS"
|
||||
/>
|
||||
</n-form-item>
|
||||
</n-grid-item>
|
||||
@ -309,7 +309,6 @@ import { PERMISSIONS } from '@/constants/permissions'
|
||||
import {
|
||||
batchDeleteSysFiles,
|
||||
deleteSysFile,
|
||||
FILE_SERVICE_OPTIONS,
|
||||
getSysFileList,
|
||||
uploadFile,
|
||||
} from '@/service/api/system/file'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user