diff --git a/src/api/infra/fileList/index.ts b/src/api/infra/file/index.ts similarity index 54% rename from src/api/infra/fileList/index.ts rename to src/api/infra/file/index.ts index 48b3c991..f64bc0d6 100644 --- a/src/api/infra/fileList/index.ts +++ b/src/api/infra/file/index.ts @@ -1,16 +1,5 @@ import request from '@/config/axios' -export interface FileVO { - id: number - configId: number - path: string - name: string - url: string - size: string - type: string - createTime: Date -} - export interface FilePageReqVO extends PageParam { path?: string type?: string @@ -18,11 +7,11 @@ export interface FilePageReqVO extends PageParam { } // 查询文件列表 -export const getFilePageApi = (params: FilePageReqVO) => { +export const getFilePage = (params: FilePageReqVO) => { return request.get({ url: '/infra/file/page', params }) } // 删除文件 -export const deleteFileApi = (id: number) => { +export const deleteFile = (id: number) => { return request.delete({ url: '/infra/file/delete?id=' + id }) } diff --git a/src/api/infra/fileConfig/index.ts b/src/api/infra/fileConfig/index.ts index 2151141c..2f096706 100644 --- a/src/api/infra/fileConfig/index.ts +++ b/src/api/infra/fileConfig/index.ts @@ -31,36 +31,36 @@ export interface FileConfigPageReqVO extends PageParam { } // 查询文件配置列表 -export const getFileConfigPageApi = (params: FileConfigPageReqVO) => { +export const getFileConfigPage = (params: FileConfigPageReqVO) => { return request.get({ url: '/infra/file-config/page', params }) } // 查询文件配置详情 -export const getFileConfigApi = (id: number) => { +export const getFileConfig = (id: number) => { return request.get({ url: '/infra/file-config/get?id=' + id }) } // 更新文件配置为主配置 -export const updateFileConfigMasterApi = (id: number) => { +export const updateFileConfigMaster = (id: number) => { return request.put({ url: '/infra/file-config/update-master?id=' + id }) } // 新增文件配置 -export const createFileConfigApi = (data: FileConfigVO) => { +export const createFileConfig = (data: FileConfigVO) => { return request.post({ url: '/infra/file-config/create', data }) } // 修改文件配置 -export const updateFileConfigApi = (data: FileConfigVO) => { +export const updateFileConfig = (data: FileConfigVO) => { return request.put({ url: '/infra/file-config/update', data }) } // 删除文件配置 -export const deleteFileConfigApi = (id: number) => { +export const deleteFileConfig = (id: number) => { return request.delete({ url: '/infra/file-config/delete?id=' + id }) } // 测试文件配置 -export const testFileConfigApi = (id: number) => { +export const testFileConfig = (id: number) => { return request.get({ url: '/infra/file-config/test?id=' + id }) } diff --git a/src/locales/en.ts b/src/locales/en.ts index 1600a19f..4f4d4895 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -297,7 +297,8 @@ export default { typeCreate: 'Dict Type Create', typeUpdate: 'Dict Type Eidt', dataCreate: 'Dict Data Create', - dataUpdate: 'Dict Data Eidt' + dataUpdate: 'Dict Data Eidt', + fileUpload: 'File Upload' }, dialog: { dialog: 'Dialog', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7c5742c4..6f46f1ab 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -297,7 +297,8 @@ export default { typeCreate: '字典类型新增', typeUpdate: '字典类型编辑', dataCreate: '字典数据新增', - dataUpdate: '字典数据编辑' + dataUpdate: '字典数据编辑', + fileUpload: '上传文件' }, dialog: { dialog: '弹窗', diff --git a/src/views/infra/file/form.vue b/src/views/infra/file/form.vue new file mode 100644 index 00000000..8550d440 --- /dev/null +++ b/src/views/infra/file/form.vue @@ -0,0 +1,82 @@ + + + + + 将文件拖到此处,或 点击上传 + + + 提示:仅允许导入 jpg、png、gif 格式文件! + + + + + + + + + + + + diff --git a/src/views/infra/file/index.vue b/src/views/infra/file/index.vue new file mode 100644 index 00000000..0f63ea28 --- /dev/null +++ b/src/views/infra/file/index.vue @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + 搜索 + 重置 + + 上传文件 + + + + + + + + + + + + + + + + + + 删除 + + + + + + + + + + + + diff --git a/src/views/infra/fileConfig/fileConfig.data.ts b/src/views/infra/fileConfig/fileConfig.data.ts deleted file mode 100644 index d0f64869..00000000 --- a/src/views/infra/fileConfig/fileConfig.data.ts +++ /dev/null @@ -1,77 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - name: [required], - storage: [required], - config: { - basePath: [required], - host: [required], - port: [required], - username: [required], - password: [required], - mode: [required], - endpoint: [required], - bucket: [required], - accessKey: [required], - accessSecret: [required], - domain: [required] - } -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - primaryTitle: '配置编号', - action: true, - actionWidth: '400px', - columns: [ - { - title: '配置名', - field: 'name', - isSearch: true - }, - { - title: '存储器', - field: 'storage', - dictType: DICT_TYPE.INFRA_FILE_STORAGE, - dictClass: 'number', - isSearch: true - }, - { - title: '主配置', - field: 'master', - dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, - dictClass: 'boolean' - }, - { - title: t('form.remark'), - field: 'remark', - form: { - component: 'Input', - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/fileConfig/form.vue b/src/views/infra/fileConfig/form.vue new file mode 100644 index 00000000..a23aac9f --- /dev/null +++ b/src/views/infra/fileConfig/form.vue @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 主动模式 + 主动模式 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/infra/fileConfig/index.vue b/src/views/infra/fileConfig/index.vue index 9d796a65..3b683e4e 100644 --- a/src/views/infra/fileConfig/index.vue +++ b/src/views/infra/fileConfig/index.vue @@ -1,294 +1,201 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - + - + - - - - + + - - - - - - - - - - - - - - - 主动模式 - 主动模式 - - - - - - - - - - - - - - - - - - - - - - + + 搜索 + 重置 + + 新增 + - - - - - - + + + + + + + + + + + + + + + + + + - - - - + + + + 编辑 + + + 主配置 + + 测试 + + 删除 + + + + + + + + + + - diff --git a/src/views/infra/fileList/fileList.data.ts b/src/views/infra/fileList/fileList.data.ts deleted file mode 100644 index 29be6dae..00000000 --- a/src/views/infra/fileList/fileList.data.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - action: true, - columns: [ - { - title: '文件名', - field: 'name' - }, - { - title: '文件路径', - field: 'path', - isSearch: true - }, - { - title: 'URL', - field: 'url', - table: { - cellRender: { - name: 'XPreview' - } - } - }, - { - title: '文件大小', - field: 'size', - formatter: 'formatSize' - }, - { - title: '文件类型', - field: 'type', - isSearch: true - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/fileList/index.vue b/src/views/infra/fileList/index.vue deleted file mode 100644 index cda8b68d..00000000 --- a/src/views/infra/fileList/index.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - {{ row.url }} - - - - - - - - - - - 将文件拖到此处,或点击上传 - - 请上传 .jpg, .png, .gif 标准格式文件 - - - - - - - - - - -