diff --git a/src/api/system/config/SystemConfig.ts b/src/api/system/config/SystemConfig.ts new file mode 100644 index 0000000..7f542ae --- /dev/null +++ b/src/api/system/config/SystemConfig.ts @@ -0,0 +1,42 @@ +import { defHttp } from '@/utils/http/axios' + +/** + * @description: 系统配置VO + */ +export interface SystemConfigVO { + id?: number + name: string + abbreviation?: string +} + +/** + * @description: 系统配置分页查询参数 + */ +export interface SystemConfigPageReqVO { + name?: string +} + +// 查询系统配置分页列表 +export function getSystemConfigPage(params: SystemConfigPageReqV) { + return defHttp.get({ url: '/system/system-config/page', params }) +} + +// 获取系统配置详情 +export function getSystemConfig(id: number) { + return defHttp.get({ url: `/system/system-config/get?id=${id}` }) +} + +// 新增系统配置 +export function createSystemConfig(data: SystemConfigVO) { + return defHttp.post({ url: '/system/system-config/create', data }) +} + +// 修改系统配置 +export function updateSystemConfig(data: SystemConfigVO) { + return defHttp.put({ url: '/system/system-config/update', data }) +} + +// 删除系统配置 +export function deleteSystemConfig(id: number) { + return defHttp.delete({ url: `/system/system-config/delete?id=${id}` }) +} diff --git a/src/views/system/config/SystemConfig/SystemConfig.ts b/src/views/system/config/SystemConfig/SystemConfig.ts new file mode 100644 index 0000000..1eb8d32 --- /dev/null +++ b/src/views/system/config/SystemConfig/SystemConfig.ts @@ -0,0 +1,47 @@ +import { h } from 'vue' +import { Tag } from 'ant-design-vue' +import type { BasicColumn, FormSchema } from '@/components/Table' + +// 表格列定义 +export const columns: BasicColumn[] = [ + { + title: '系统名称', + dataIndex: 'name', + width: 180, + }, + { + title: '系统简称', + dataIndex: 'abbreviation', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + // 使用 Vben 框架的方式格式化时间 + customRender: ({ text }) => { + return h(Tag, { color: 'blue' }, () => text) + }, + }, +] + +// 弹窗表单定义 +export const formSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, // 隐藏,仅用于表单绑定 + component: 'Input', + }, + { + label: '系统名称', + field: 'name', + required: true, + component: 'Input', + }, + { + label: '系统简称', + field: 'abbreviation', + component: 'Input', + }, +] diff --git a/src/views/system/config/SystemConfig/SystemConfigModal.vue b/src/views/system/config/SystemConfig/SystemConfigModal.vue new file mode 100644 index 0000000..900f159 --- /dev/null +++ b/src/views/system/config/SystemConfig/SystemConfigModal.vue @@ -0,0 +1,66 @@ + + + diff --git a/src/views/system/config/SystemConfig/index.vue b/src/views/system/config/SystemConfig/index.vue new file mode 100644 index 0000000..ac28d6c --- /dev/null +++ b/src/views/system/config/SystemConfig/index.vue @@ -0,0 +1,85 @@ + + +