From 9ac027dd5e22bb42b0b9369a9f6bcca96e29c9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Fri, 12 Jul 2024 13:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/config.ts | 67 ++++++++ src/api/data/notice.ts | 67 ++++++++ src/api/system/tenant.ts | 61 +++++++ src/components/numberInput/index.vue | 68 ++++++++ src/views/data/config/columns.ts | 24 +++ src/views/data/config/edit.vue | 104 ++++++++++++ src/views/data/config/index.vue | 162 +++++++++++++++++++ src/views/data/config/querySchemas.ts | 11 ++ src/views/data/notice/columns.ts | 38 +++++ src/views/data/notice/edit.vue | 127 +++++++++++++++ src/views/data/notice/index.vue | 161 +++++++++++++++++++ src/views/data/notice/querySchemas.ts | 47 ++++++ src/views/system/tenant/columns.ts | 78 +++++++++ src/views/system/tenant/edit.vue | 204 ++++++++++++++++++++++++ src/views/system/tenant/index.vue | 171 ++++++++++++++++++++ src/views/system/tenant/querySchemas.ts | 41 +++++ src/views/system/user/querySchemas.ts | 28 ++-- 17 files changed, 1445 insertions(+), 14 deletions(-) create mode 100644 src/api/data/config.ts create mode 100644 src/api/data/notice.ts create mode 100644 src/api/system/tenant.ts create mode 100644 src/components/numberInput/index.vue create mode 100644 src/views/data/config/columns.ts create mode 100644 src/views/data/config/edit.vue create mode 100644 src/views/data/config/index.vue create mode 100644 src/views/data/config/querySchemas.ts create mode 100644 src/views/data/notice/columns.ts create mode 100644 src/views/data/notice/edit.vue create mode 100644 src/views/data/notice/index.vue create mode 100644 src/views/data/notice/querySchemas.ts create mode 100644 src/views/system/tenant/columns.ts create mode 100644 src/views/system/tenant/edit.vue create mode 100644 src/views/system/tenant/index.vue create mode 100644 src/views/system/tenant/querySchemas.ts diff --git a/src/api/data/config.ts b/src/api/data/config.ts new file mode 100644 index 0000000..192bfcf --- /dev/null +++ b/src/api/data/config.ts @@ -0,0 +1,67 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 配置列表 + */ +export function getConfigList(params?) { + return http.request({ + url: '/config/page', + method: 'GET', + params, + }); +} +export function getConfigAllList(params?) { + return http.request({ + url: '/config/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getConfigDetail(id) { + return http.request({ + url: '/config/detail/'+id, + method: 'get', + }); +} +/** + * @description: 添加配置 + */ +export function configAdd(data:any) { + return http.request({ + url: '/config/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新配置 + */ +export function configUpdate(data:any) { + return http.request({ + url: '/config/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除配置 + */ +export function configDelete(id) { + return http.request({ + url: '/config/delete/'+id, + method: 'DELETE', + }); +} +/** + * @description: 批量删除配置 + */ +export function configBatchDelete(data:any) { + return http.request({ + url: '/config/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/api/data/notice.ts b/src/api/data/notice.ts new file mode 100644 index 0000000..a476a9c --- /dev/null +++ b/src/api/data/notice.ts @@ -0,0 +1,67 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 公告列表 + */ +export function getNoticeList(params?) { + return http.request({ + url: '/notice/page', + method: 'GET', + params, + }); +} +export function getNoticeAllList(params?) { + return http.request({ + url: '/notice/list', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getNoticeDetail(id) { + return http.request({ + url: '/notice/detail/'+id, + method: 'get', + }); +} +/** + * @description: 添加公告 + */ +export function noticeAdd(data:any) { + return http.request({ + url: '/notice/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新公告 + */ +export function noticeUpdate(data:any) { + return http.request({ + url: '/notice/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除公告 + */ +export function noticeDelete(id) { + return http.request({ + url: '/notice/delete/'+id, + method: 'DELETE', + }); +} +/** + * @description: 批量删除公告 + */ +export function noticeBatchDelete(data:any) { + return http.request({ + url: '/notice/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/api/system/tenant.ts b/src/api/system/tenant.ts new file mode 100644 index 0000000..afb89dd --- /dev/null +++ b/src/api/system/tenant.ts @@ -0,0 +1,61 @@ +import { http } from '@/utils/http/axios'; + + +/** + * @description: 获取租户列表 + */ +export function getTenantList(params) { + return http.request({ + url: '/tenant/page', + method: 'get', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getTenantDetail(tenantId) { + return http.request({ + url: '/tenant/detail/'+tenantId, + method: 'get', + }); +} +/** + * @description: 添加租户 + */ +export function tenantAdd(data:any) { + return http.request({ + url: '/tenant/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新租户 + */ +export function tenantUpdate(data:any) { + return http.request({ + url: '/tenant/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除租户 + */ +export function tenantDelete(tenantId) { + return http.request({ + url: '/tenant/delete/'+tenantId, + method: 'DELETE', + }); +} +/** + * @description: 批量删除租户 + */ +export function tenantBatchDelete(data:any) { + return http.request({ + url: '/tenant/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/components/numberInput/index.vue b/src/components/numberInput/index.vue new file mode 100644 index 0000000..c873770 --- /dev/null +++ b/src/components/numberInput/index.vue @@ -0,0 +1,68 @@ + + + + + \ No newline at end of file diff --git a/src/views/data/config/columns.ts b/src/views/data/config/columns.ts new file mode 100644 index 0000000..baca339 --- /dev/null +++ b/src/views/data/config/columns.ts @@ -0,0 +1,24 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '配置名称', + prop: 'name', + }, + { + label: '排序', + prop: 'sort', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/data/config/edit.vue b/src/views/data/config/edit.vue new file mode 100644 index 0000000..717f21d --- /dev/null +++ b/src/views/data/config/edit.vue @@ -0,0 +1,104 @@ + + diff --git a/src/views/data/config/index.vue b/src/views/data/config/index.vue new file mode 100644 index 0000000..b793cdf --- /dev/null +++ b/src/views/data/config/index.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/views/data/config/querySchemas.ts b/src/views/data/config/querySchemas.ts new file mode 100644 index 0000000..acba086 --- /dev/null +++ b/src/views/data/config/querySchemas.ts @@ -0,0 +1,11 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'Input', + label: '配置名称', + componentProps: { + placeholder: '请输入配置名称', + }, + } +]; diff --git a/src/views/data/notice/columns.ts b/src/views/data/notice/columns.ts new file mode 100644 index 0000000..599ec3e --- /dev/null +++ b/src/views/data/notice/columns.ts @@ -0,0 +1,38 @@ +import { h } from 'vue'; +import { ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '标题', + prop: 'title', + }, + { + label: '类型', + prop: 'type', + render(record) { + return h('span', record.row.type === 1 ? '通知' : '公告'); + }, + }, + { + label: '状态', + prop: 'status', + render(record) { + return h('span', record.row.status === 1 ? '正常' : '关闭') + }, + }, + { + label: '点击率', + prop: 'clickNum', + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + }, +]; diff --git a/src/views/data/notice/edit.vue b/src/views/data/notice/edit.vue new file mode 100644 index 0000000..295ac6a --- /dev/null +++ b/src/views/data/notice/edit.vue @@ -0,0 +1,127 @@ + + diff --git a/src/views/data/notice/index.vue b/src/views/data/notice/index.vue new file mode 100644 index 0000000..939de6a --- /dev/null +++ b/src/views/data/notice/index.vue @@ -0,0 +1,161 @@ + + + + + diff --git a/src/views/data/notice/querySchemas.ts b/src/views/data/notice/querySchemas.ts new file mode 100644 index 0000000..516003f --- /dev/null +++ b/src/views/data/notice/querySchemas.ts @@ -0,0 +1,47 @@ +import { FormSchema } from '@/components/Form/index'; +export const schemas: FormSchema[] = [ + { + field: 'title', + 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/tenant/columns.ts b/src/views/system/tenant/columns.ts new file mode 100644 index 0000000..6e5124f --- /dev/null +++ b/src/views/system/tenant/columns.ts @@ -0,0 +1,78 @@ +import { h } from 'vue'; +import { ElAvatar, ElTag } from 'element-plus'; + +export const columns = [ + { + type: 'selection', + }, + { + label: '租户名称', + prop: 'name', + }, + { + label: '租户编码', + prop: 'code', + }, + { + label: '统一社会信用代码', + prop: 'license', + width: 160, + }, + { + label: '人数', + prop: 'number', + }, + { + label: '到期时间', + prop: 'expireTime', + }, + { + label: '联系人姓名', + prop: 'contactUser', + width:140 + }, + { + label: '联系人电话', + prop: 'contactMobile', + width:140 + }, + { + label: '联系人姓名', + prop: 'contactUser', + width:140 + }, + { + label: '联系人邮箱', + prop: 'contactEmail', + width:140 + }, + { + label: '联系人网址', + prop: 'contactSite', + width:140 + }, + { + label: '状态', + prop: 'status', + render(record) { + return h( + ElTag, + { + type: record.row.status ==1 ? 'success' : 'danger', + }, + { + default: () => (record.row.status ==1 ? '正常' : '禁用'), + }, + ); + }, + }, + { + label: '创建人', + prop: 'createUser', + }, + { + label: '创建时间', + prop: 'createTime', + width: 180, + }, +]; diff --git a/src/views/system/tenant/edit.vue b/src/views/system/tenant/edit.vue new file mode 100644 index 0000000..90ea277 --- /dev/null +++ b/src/views/system/tenant/edit.vue @@ -0,0 +1,204 @@ + + + \ No newline at end of file diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue new file mode 100644 index 0000000..93edd96 --- /dev/null +++ b/src/views/system/tenant/index.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/src/views/system/tenant/querySchemas.ts b/src/views/system/tenant/querySchemas.ts new file mode 100644 index 0000000..e3f56f9 --- /dev/null +++ b/src/views/system/tenant/querySchemas.ts @@ -0,0 +1,41 @@ +import { FormSchema } from '@/components/Form/index'; +import { getRoleAllList } from '@/api/system/role'; +export const loadSelectData = async(res)=> { + //这里可以进行数据转换处理 + return (await getRoleAllList({ ...res })).map((item, index) => { + return { + ...item, + label:item.name, + value:item.id, + index, + }; + }); +} +export const schemas: FormSchema[] = [ + { + field: 'name', + component: 'Input', + label: '租户名称', + componentProps: { + placeholder: '请输入租户名称', + }, + }, + { + field: 'status', + component: 'Select', + label: '状态', + componentProps: { + placeholder: '请选择状态', + options: [ + { + label: '正常', + value: '0', + }, + { + label: '禁用', + value: '1', + }, + ], + }, + }, +]; diff --git a/src/views/system/user/querySchemas.ts b/src/views/system/user/querySchemas.ts index 9a87893..8ce4ae3 100644 --- a/src/views/system/user/querySchemas.ts +++ b/src/views/system/user/querySchemas.ts @@ -20,20 +20,20 @@ export const schemas: FormSchema[] = [ placeholder: '请输入用户名', }, }, - { - field: 'role', - component: 'BasicSelect', - label: '角色', - componentProps: { - placeholder: '请选择角色', - block:true, - multiple:true, - request: loadSelectData, - onChange: (e: any) => { - console.log(e); - }, - }, - }, + // { + // field: 'role', + // component: 'BasicSelect', + // label: '角色', + // componentProps: { + // placeholder: '请选择角色', + // block:true, + // multiple:true, + // request: loadSelectData, + // onChange: (e: any) => { + // console.log(e); + // }, + // }, + // }, { field: 'status', component: 'Select',