diff --git a/kicc-ui/src/api/system/config.ts b/kicc-ui/src/api/system/config.ts new file mode 100644 index 00000000..5de22eb8 --- /dev/null +++ b/kicc-ui/src/api/system/config.ts @@ -0,0 +1,25 @@ +import { ConfigParams, Config, ConfigResult } from './model/configModel' +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from "/@/utils/is"; + +enum Api { + Page = '/system_proxy/system/config/list', + Save = '/system_proxy/system/config/save', + Update = '/system_proxy/system/config/update', + Remove = '/system_proxy/system/config/remove', +} + +export const list = (params: ConfigParams) => + defHttp.get({ url: Api.Page, params }); + + +export const set = (params: Config) => { + if (isDef(params.id)) { + return defHttp.put({ url: Api.Update, params }); + }else { + return defHttp.post({ url: Api.Save, params }); + } +} + +export const remove = (params: {ids: string}) => + defHttp.get({ url: Api.Page + `/${params.ids}` }); \ No newline at end of file diff --git a/kicc-ui/src/api/system/model/configModel.ts b/kicc-ui/src/api/system/model/configModel.ts new file mode 100644 index 00000000..d8b3c1e5 --- /dev/null +++ b/kicc-ui/src/api/system/model/configModel.ts @@ -0,0 +1,57 @@ +// 引入基础包 +import { Page, R, CommonEntity } from '/@/api/model'; + +export type ConfigParams = { + /** + * 参数主键 + */ + id: string; + + /** + * 参数名称 + */ + name: string; + + /** + * 参数键名 + */ + key: string; + + /** + * 系统内置 0:是,1否 + */ + isSys:string; + +} & Page; + + +export interface Config extends CommonEntity { + /** + * 参数主键 + */ + id: string; + + /** + * 参数名称 + */ + name: string; + + /** + * 参数键名 + */ + key: string; + + /** + * 参数键值 + */ + value:string; + + /** + * 系统内置 0:是,1否 + */ + isSys:string; + +} + + +export type ConfigResult = R; \ No newline at end of file diff --git a/kicc-ui/src/views/system/config/ConfigModal.vue b/kicc-ui/src/views/system/config/ConfigModal.vue new file mode 100644 index 00000000..c307ae75 --- /dev/null +++ b/kicc-ui/src/views/system/config/ConfigModal.vue @@ -0,0 +1,64 @@ + + diff --git a/kicc-ui/src/views/system/config/config.data.ts b/kicc-ui/src/views/system/config/config.data.ts new file mode 100644 index 00000000..ad2f750c --- /dev/null +++ b/kicc-ui/src/views/system/config/config.data.ts @@ -0,0 +1,143 @@ +/** + * @program: kicc-ui + * @description: 角色模块动态渲染配置 + * @author: entfrm开发团队-王翔 + * @create: 2022/4/21 + */ + +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; + +export const columns: BasicColumn[] = [ + { + title: '参数名称', + dataIndex: 'name', + width: 200 + }, + { + title: '参数键名', + dataIndex: 'key', + width: 200 + }, + { + title: '参数键值', + dataIndex: 'value', + width: 200 + }, + { + title: '系统内置', + dataIndex: 'isSys', + width: 120, + customRender: ({record}) => { + let text = ''; + if (record.isSys === '0'){ + text = '是'; + }else { + text = '否'; + } + return h(Tag, ()=> text); + } + }, + { + title: '备注', + dataIndex: 'remarks', + customRender: ({record}) => { + return record.remarks || h(Tag, {color: 'red'}, () => '暂无数据'); + } + }, + { + title: '创建时间', + dataIndex: 'createTime' + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '参数名称', + component: 'Input', + componentProps: { + placeholder: '请输入角色名称', + }, + colProps: {span: 8} + }, + { + field: 'key', + label: '参数键名', + component: 'Input', + componentProps: { + placeholder: '请输入参数键名', + }, + colProps: {span: 8} + }, + { + field: 'isSys', + label: '系统内置', + component: 'Select', + componentProps: { + options: [ + {label: '是', value: '0'}, + {label: '否', value: '1'} + ] + }, + colProps: {span: 7} + } +]; + +export const formSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false + }, + { + field: 'name', + label: '参数名称', + required: true, + component: 'Input', + colProps: { + span: 12 + } + }, + { + field: 'key', + label: '参数键名', + component: 'Input', + required: true, + colProps: { + span: 12 + } + }, + { + field: 'value', + label: '参数键值', + component: 'Input', + required: true, + colProps: { + span: 12 + } + }, + { + field: 'isSys', + label: '系统内置', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + {label: '是', value: '0'}, + {label: '否', value: '1'} + ], + }, + colProps: { + span: 12 + } + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; diff --git a/kicc-ui/src/views/system/config/index.vue b/kicc-ui/src/views/system/config/index.vue new file mode 100644 index 00000000..56eb163d --- /dev/null +++ b/kicc-ui/src/views/system/config/index.vue @@ -0,0 +1,132 @@ + +