From 86bb338bd6356a10ce94102551e406217e3389a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Thu, 11 Jul 2024 15:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/param.ts | 67 ++++++++++ src/components/Form/src/BasicForm.vue | 2 +- src/views/data/dictionary/edit.vue | 1 - src/views/data/dictionary/editItem.vue | 15 ++- src/views/data/param/columns.ts | 39 ++++++ src/views/data/param/edit.vue | 125 +++++++++++++++++++ src/views/data/param/index.vue | 162 +++++++++++++++++++++++++ src/views/data/param/querySchemas.ts | 47 +++++++ src/views/system/level/edit.vue | 7 +- src/views/system/loginLog/edit.vue | 2 +- src/views/system/operLog/edit.vue | 1 - src/views/system/position/edit.vue | 7 +- src/views/system/role/auth.vue | 1 - src/views/system/role/edit.vue | 15 ++- 14 files changed, 462 insertions(+), 29 deletions(-) create mode 100644 src/api/data/param.ts create mode 100644 src/views/data/param/columns.ts create mode 100644 src/views/data/param/edit.vue create mode 100644 src/views/data/param/index.vue create mode 100644 src/views/data/param/querySchemas.ts diff --git a/src/api/data/param.ts b/src/api/data/param.ts new file mode 100644 index 0000000..1a695bb --- /dev/null +++ b/src/api/data/param.ts @@ -0,0 +1,67 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 参数列表 + */ +export function getParamList(params?) { + return http.request({ + url: '/param/page', + method: 'GET', + params, + }); +} +export function getParamAllList(params?) { + return http.request({ + url: '/param/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getParamDetail(paramId) { + return http.request({ + url: '/param/detail/'+paramId, + method: 'get', + }); +} +/** + * @description: 添加参数 + */ +export function paramAdd(data:any) { + return http.request({ + url: '/param/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新参数 + */ +export function paramUpdate(data:any) { + return http.request({ + url: '/param/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除参数 + */ +export function paramDelete(paramId) { + return http.request({ + url: '/param/delete/'+paramId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除参数 + */ +export function paramBatchDelete(data:any) { + return http.request({ + url: '/param/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index 7bbe976..1af07fb 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -118,7 +118,7 @@ - + diff --git a/src/views/data/param/columns.ts b/src/views/data/param/columns.ts new file mode 100644 index 0000000..3385421 --- /dev/null +++ b/src/views/data/param/columns.ts @@ -0,0 +1,39 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '职级名称', + prop: 'name', + }, + { + label: '职级状态', + prop: 'status', + render(record) { + return h( + ElTag, + { + type: record.row.status ==1 ? 'success' : 'danger', + }, + { + default: () => (record.row.status ==1 ? '正常' : '禁用'), + }, + ); + }, + }, + { + label: '排序', + prop: 'sort', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/data/param/edit.vue b/src/views/data/param/edit.vue new file mode 100644 index 0000000..2734c70 --- /dev/null +++ b/src/views/data/param/edit.vue @@ -0,0 +1,125 @@ + + diff --git a/src/views/data/param/index.vue b/src/views/data/param/index.vue new file mode 100644 index 0000000..3a3a8c2 --- /dev/null +++ b/src/views/data/param/index.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/data/param/querySchemas.ts b/src/views/data/param/querySchemas.ts new file mode 100644 index 0000000..3239a10 --- /dev/null +++ b/src/views/data/param/querySchemas.ts @@ -0,0 +1,47 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'Input', + label: '参数名称', + componentProps: { + placeholder: '请输入参数名称', + }, + }, + { + field: 'type', + component: 'Select', + label: '参数类型', + componentProps: { + placeholder: '请选择参数类型', + options: [ + { + label: '正常', + value: '1', + }, + { + label: '禁用', + value: '2', + }, + ], + }, + }, + { + field: 'status', + component: 'Select', + label: '参数状态', + componentProps: { + placeholder: '请选择状态', + options: [ + { + label: '正常', + value: '1', + }, + { + label: '禁用', + value: '2', + }, + ], + }, + }, +]; diff --git a/src/views/system/level/edit.vue b/src/views/system/level/edit.vue index 4adc356..0ca2f93 100644 --- a/src/views/system/level/edit.vue +++ b/src/views/system/level/edit.vue @@ -2,7 +2,6 @@ diff --git a/src/views/system/loginLog/edit.vue b/src/views/system/loginLog/edit.vue index 051e949..3eac65a 100644 --- a/src/views/system/loginLog/edit.vue +++ b/src/views/system/loginLog/edit.vue @@ -2,7 +2,7 @@ diff --git a/src/views/system/role/auth.vue b/src/views/system/role/auth.vue index 0c3b879..e8e0a38 100644 --- a/src/views/system/role/auth.vue +++ b/src/views/system/role/auth.vue @@ -2,7 +2,6 @@