From 095a18b8531921bb90653bb9dd840beb39f39bca Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Mon, 18 Mar 2024 16:31:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=82=E6=95=B0=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/param/index.ts | 29 ++++++++ src/api/system/param/types.ts | 11 +++ src/views/system/param/ParamFormModal.vue | 52 ++++++++++++++ src/views/system/param/data.ts | 60 ++++++++++++++++ src/views/system/param/index.vue | 87 +++++++++++++++++++++++ 5 files changed, 239 insertions(+) create mode 100644 src/api/system/param/index.ts create mode 100644 src/api/system/param/types.ts create mode 100644 src/views/system/param/ParamFormModal.vue create mode 100644 src/views/system/param/data.ts create mode 100644 src/views/system/param/index.vue diff --git a/src/api/system/param/index.ts b/src/api/system/param/index.ts new file mode 100644 index 00000000..766a3b9b --- /dev/null +++ b/src/api/system/param/index.ts @@ -0,0 +1,29 @@ +import type { GetParamListParams, Param } from './types' +import { defHttp } from '@/utils/http/axios' + +export function getParamList(params: GetParamListParams) { + return defHttp.get({ + url: '/param/page', + params, + }) +} + +export function createParam(data: Partial) { + return defHttp.post({ + url: '/param/save', + data, + }) +} + +export function updateParam(data: Partial) { + return defHttp.post({ + url: '/param/update', + data, + }) +} + +export function deleteParam(id: string) { + return defHttp.post({ + url: `/param/remove?id=${id}`, + }) +} diff --git a/src/api/system/param/types.ts b/src/api/system/param/types.ts new file mode 100644 index 00000000..ace2824d --- /dev/null +++ b/src/api/system/param/types.ts @@ -0,0 +1,11 @@ +export interface GetParamListParams extends PageParam { + paramName?: string + paramKey?: string +} + +export interface Param { + id: string + paramName: string + paramKey: string + paramValue: string +} diff --git a/src/views/system/param/ParamFormModal.vue b/src/views/system/param/ParamFormModal.vue new file mode 100644 index 00000000..8dff859a --- /dev/null +++ b/src/views/system/param/ParamFormModal.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/views/system/param/data.ts b/src/views/system/param/data.ts new file mode 100644 index 00000000..f507f769 --- /dev/null +++ b/src/views/system/param/data.ts @@ -0,0 +1,60 @@ +import type { BasicColumn, FormSchema } from '@/components/Table' + +export const columns: BasicColumn[] = [ + { + title: '参数名称', + dataIndex: 'paramName', + }, + { + title: '参数键名', + dataIndex: 'paramKey', + }, + { + title: '参数键值', + dataIndex: 'paramValue', + }, +] + +export const searchFormSchema: FormSchema[] = [ + { + label: '参数名称', + field: 'paramName', + component: 'Input', + colProps: { + span: 6, + }, + }, + { + label: '参数键名', + field: 'paramKey', + component: 'Input', + colProps: { + span: 6, + }, + }, +] + +export const formSchema: FormSchema[] = [ + { + label: '参数名称', + field: 'paramName', + fields: ['id'], + required: true, + component: 'Input', + }, + { + label: '参数键名', + field: 'paramKey', + required: true, + component: 'Input', + }, + { + label: '参数键值', + field: 'paramValue', + required: true, + component: 'InputTextArea', + componentProps: { + rows: 8, + }, + }, +] diff --git a/src/views/system/param/index.vue b/src/views/system/param/index.vue new file mode 100644 index 00000000..9ad30d78 --- /dev/null +++ b/src/views/system/param/index.vue @@ -0,0 +1,87 @@ + + +