diff --git a/src/api/alert/exa/index.ts b/src/api/alert/exa/index.ts index ba7fe5f..4660a8c 100644 --- a/src/api/alert/exa/index.ts +++ b/src/api/alert/exa/index.ts @@ -77,3 +77,5 @@ export function deletePoint(ItemName: string) { export function importTemplate() { return defHttp.get({ url: '/alert/exa/get-import-template', responseType: 'blob' }) } + + diff --git a/src/api/infra/file/index.ts b/src/api/infra/file/index.ts index fc071a6..195a93c 100644 --- a/src/api/infra/file/index.ts +++ b/src/api/infra/file/index.ts @@ -13,6 +13,7 @@ export interface FileVO { export interface FilePageReqVO extends PageParam { path?: string + name?: string type?: string createTime?: Date[] } diff --git a/src/views/file/file.data.ts b/src/views/file/file.data.ts new file mode 100644 index 0000000..43b43ec --- /dev/null +++ b/src/views/file/file.data.ts @@ -0,0 +1,86 @@ +import type { BasicColumn, FormSchema } from '@/components/Table' +import { useRender } from '@/components/Table' + +export const columns: BasicColumn[] = [ + { + title: '编号', + dataIndex: 'id', + width: 100, + }, + { + title: '文件名', + dataIndex: 'name', + width: 200, + }, + // { + // title: '文件 URL', + // dataIndex: 'url', + // width: 180, + // customRender: ({ text }) => { + // return useRender.renderImg(text) + // }, + // }, + // { + // title: '文件路径', + // dataIndex: 'path', + // width: 180, + // }, + { + title: '文件大小', + dataIndex: 'size', + width: 120, + customRender: ({ text }) => { + const unitArr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] + const srcSize = Number.parseFloat(text) + const index = Math.floor(Math.log(srcSize) / Math.log(1024)) + const size = srcSize / 1024 ** index + return `${size.toFixed(2)} ${unitArr[index]}` + }, + }, + { + title: '文件类型', + dataIndex: 'type', + width: 100, + customRender: ({ text }) => { + return useRender.renderTag(text) + }, + }, + // { + // title: '文件内容', + // dataIndex: 'content', + // width: 180, + // customRender: ({ text }) => { + // return useRender.renderImg(text) + // }, + // }, + { + title: '上传时间', + dataIndex: 'createTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + }, + }, +] + +export const searchFormSchema: FormSchema[] = [ + { + label: '文件路径', + field: 'path', + component: 'Input', + show: false, + colProps: { span: 8 }, + }, + { + label: '文件名', + field: 'name', + component: 'Input', + colProps: { span: 8 }, + }, + { + label: '创建时间', + field: 'createTime', + component: 'RangePicker', + colProps: { span: 8 }, + }, +] diff --git a/src/views/file/index.vue b/src/views/file/index.vue new file mode 100644 index 0000000..6f0bb27 --- /dev/null +++ b/src/views/file/index.vue @@ -0,0 +1,130 @@ + + +