From bf43bdbab433669fc6486b39186445b25789387c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sun, 1 Sep 2024 01:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD=E5=92=8C?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cms/domain/model/index.ts | 2 + src/api/common.system/website/index.ts | 106 ++++++ src/api/common.system/website/model/index.ts | 97 +++++ src/api/system/menu/index.ts | 30 ++ src/api/system/website/model/index.ts | 109 ++++-- src/layout/components/header-tools.vue | 2 +- src/layout/index.vue | 10 +- src/utils/common.ts | 1 + src/utils/domain.ts | 6 + src/views/cms/domain/index.vue | 15 +- .../navigation/components/navigation-edit.vue | 24 +- .../cms/website/components/websiteEdit.vue | 28 +- src/views/cms/website/index.vue | 15 +- src/views/oa/website/components/search.vue | 52 +++ .../oa/website/components/websiteEdit.vue | 346 ++++++++++++++++++ src/views/oa/website/index.vue | 291 +++++++++++++++ src/views/shop/goods/index.vue | 6 +- src/views/system/menu/components/clone.vue | 37 +- src/views/system/menu/components/delete.vue | 175 +++++++++ .../system/menu/components/menu-edit.vue | 33 +- src/views/system/menu/index.vue | 12 +- src/views/system/profile/index.vue | 4 +- 22 files changed, 1314 insertions(+), 87 deletions(-) create mode 100644 src/api/common.system/website/index.ts create mode 100644 src/api/common.system/website/model/index.ts create mode 100644 src/views/oa/website/components/search.vue create mode 100644 src/views/oa/website/components/websiteEdit.vue create mode 100644 src/views/oa/website/index.vue create mode 100644 src/views/system/menu/components/delete.vue diff --git a/src/api/cms/domain/model/index.ts b/src/api/cms/domain/model/index.ts index 41076bd..2582456 100644 --- a/src/api/cms/domain/model/index.ts +++ b/src/api/cms/domain/model/index.ts @@ -6,6 +6,8 @@ import type { PageParam } from '@/api'; export interface Domain { // 自增ID id?: number; + // 类型 + type?: number; // 域名 domain?: string; // 主机记录 diff --git a/src/api/common.system/website/index.ts b/src/api/common.system/website/index.ts new file mode 100644 index 0000000..96f6c1a --- /dev/null +++ b/src/api/common.system/website/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { Website, WebsiteParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询网站信息记录表 + */ +export async function pageWebsite(params: WebsiteParam) { + const res = await request.get>>( + MODULES_API_URL + '/common.system/website/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询网站信息记录表列表 + */ +export async function listWebsite(params?: WebsiteParam) { + const res = await request.get>( + MODULES_API_URL + '/common.system/website', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加网站信息记录表 + */ +export async function addWebsite(data: Website) { + const res = await request.post>( + MODULES_API_URL + '/common.system/website', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改网站信息记录表 + */ +export async function updateWebsite(data: Website) { + const res = await request.put>( + MODULES_API_URL + '/common.system/website', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除网站信息记录表 + */ +export async function removeWebsite(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/common.system/website/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除网站信息记录表 + */ +export async function removeBatchWebsite(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/common.system/website/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询网站信息记录表 + */ +export async function getWebsite(id: number) { + const res = await request.get>( + MODULES_API_URL + '/common.system/website/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/common.system/website/model/index.ts b/src/api/common.system/website/model/index.ts new file mode 100644 index 0000000..b6b9be8 --- /dev/null +++ b/src/api/common.system/website/model/index.ts @@ -0,0 +1,97 @@ +import type { PageParam } from '@/api'; + +/** + * 网站信息记录表 + */ +export interface Website { + // 站点ID + websiteId?: number; + // 网站名称 + websiteName?: string; + // 网站标识 + websiteCode?: string; + // 网站LOGO + websiteIcon?: string; + // 网站LOGO + websiteLogo?: string; + // 网站LOGO(深色模式) + websiteDarkLogo?: string; + // 网站类型 + websiteType?: string; + // 网站关键词 + keywords?: string; + // 域名前缀 + prefix?: string; + // 绑定域名 + domain?: string; + // 全局样式 + style?: string; + // 后台管理地址 + adminUrl?: string; + // 应用版本 10免费版 20授权版 30永久授权 + version?: number; + // 服务到期时间 + expirationTime?: string; + // 模版ID + templateId?: number; + // 行业类型(父级) + industryParent?: string; + // 行业类型(子级) + industryChild?: string; + // 企业ID + companyId?: number; + // 所在国家 + country?: string; + // 所在省份 + province?: string; + // 所在城市 + city?: string; + // 所在辖区 + region?: string; + // 经度 + longitude?: string; + // 纬度 + latitude?: string; + // 街道地址 + address?: string; + // 联系电话 + phone?: string; + // 电子邮箱 + email?: string; + // ICP备案号 + icpNo?: string; + // 公安备案 + policeNo?: string; + // 备注 + comments?: string; + // 是否推荐 + recommend?: number; + // 状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停 + status?: number; + // 维护说明 + statusText?: string; + // 关闭说明 + statusClose?: string; + // 全局样式 + styles?: string; + // 排序号 + sortNumber?: number; + // 用户ID + userId?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 网站信息记录表搜索条件 + */ +export interface WebsiteParam extends PageParam { + websiteId?: number; + keywords?: string; +} diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts index f302be2..27104c9 100644 --- a/src/api/system/menu/index.ts +++ b/src/api/system/menu/index.ts @@ -61,6 +61,36 @@ export async function removeMenu(id?: number) { return Promise.reject(new Error(res.data.message)); } +/** + * 批量删除菜单 + */ +export async function removeBatchMenu(data: (number | undefined)[]) { + const res = await request.delete>( + SERVER_API_URL + '/system/menu/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 按顶级目录批量删除菜单 + */ +export async function deleteParentMenu(id?: number) { + const res = await request.delete>( + SERVER_API_URL + '/system/menu/deleteParentMenu/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + + /** * 安装应用 */ diff --git a/src/api/system/website/model/index.ts b/src/api/system/website/model/index.ts index 8dfc0da..b6b9be8 100644 --- a/src/api/system/website/model/index.ts +++ b/src/api/system/website/model/index.ts @@ -1,58 +1,97 @@ -import { WebsiteField } from '@/api/cms/website/field/model'; -import { Navigation } from '@/api/cms/navigation/model'; -import { Link } from '@/api/cms/link/model'; -import { ArrangeCategory } from '@/api/cms/category/model'; +import type { PageParam } from '@/api'; /** - * 菜单 + * 网站信息记录表 */ export interface Website { + // 站点ID websiteId?: number; + // 网站名称 websiteName?: string; + // 网站标识 websiteCode?: string; + // 网站LOGO websiteIcon?: string; + // 网站LOGO websiteLogo?: string; + // 网站LOGO(深色模式) websiteDarkLogo?: string; - keywords?: string; - address?: string; - phone?: string; - email?: string; + // 网站类型 websiteType?: string; - expirationTime?: string; - templateId?: string; - industryParent?: string; - industryChild?: string; - companyId?: number; + // 网站关键词 + keywords?: string; + // 域名前缀 + prefix?: string; + // 绑定域名 domain?: string; - icpNo?: string; - policeNo?: string; - comments?: string; - sortNumber?: number; - createTime?: string; - disabled?: boolean; + // 全局样式 + style?: string; + // 后台管理地址 + adminUrl?: string; + // 应用版本 10免费版 20授权版 30永久授权 + version?: number; + // 服务到期时间 + expirationTime?: string; + // 模版ID + templateId?: number; + // 行业类型(父级) + industryParent?: string; + // 行业类型(子级) + industryChild?: string; + // 企业ID + companyId?: number; + // 所在国家 country?: string; + // 所在省份 province?: string; - recommend?: number; + // 所在城市 city?: string; + // 所在辖区 region?: string; - appId?: number; - fields?: WebsiteField[]; + // 经度 + longitude?: string; + // 纬度 + latitude?: string; + // 街道地址 + address?: string; + // 联系电话 + phone?: string; + // 电子邮箱 + email?: string; + // ICP备案号 + icpNo?: string; + // 公安备案 + policeNo?: string; + // 备注 + comments?: string; + // 是否推荐 + recommend?: number; + // 状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停 status?: number; + // 维护说明 + statusText?: string; + // 关闭说明 + statusClose?: string; + // 全局样式 + styles?: string; + // 排序号 + sortNumber?: number; + // 用户ID + userId?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id tenantId?: number; - tenantName?: string; - navigations?: Navigation[]; - categoryList?: ArrangeCategory[]; - links?: Link[]; - // 配置信息 - config?: any; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; } /** - * 菜单搜索参数 + * 网站信息记录表搜索条件 */ -export interface WebsiteParam { - title?: string; - path?: string; - authority?: string; - parentId?: number; +export interface WebsiteParam extends PageParam { + websiteId?: number; + keywords?: string; } diff --git a/src/layout/components/header-tools.vue b/src/layout/components/header-tools.vue index fde5104..d77db79 100644 --- a/src/layout/components/header-tools.vue +++ b/src/layout/components/header-tools.vue @@ -1,7 +1,7 @@