From 960bbada5925f4812e88f29025820a1a65a1290f Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 17 Feb 2025 10:03:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8F=9C=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BA=97=E9=93=BA=E5=91=98=E5=B7=A5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account/menu.ts | 273 ++++++++- src/api/account/shopStaff.ts | 256 ++++++++ src/api/{system => order}/order.ts | 10 +- src/api/system/miniAppPages.ts | 187 ++++++ src/components/CURD/PageModal.vue | 39 +- src/components/CURD/types.ts | 2 + src/enums/MenuTypeEnum.ts | 31 +- src/router/index.ts | 22 +- src/types/global.d.ts | 3 +- src/views/admim/system/menu/index.vue | 558 ++++++++++++++++++ .../admim/system/miniAppPages/config/add.ts | 89 +++ .../system/miniAppPages/config/config.ts | 45 ++ .../system/miniAppPages/config/content.ts | 85 +++ .../admim/system/miniAppPages/config/edit.ts | 86 +++ .../system/miniAppPages/config/search.ts | 21 + src/views/admim/system/miniAppPages/index.vue | 117 ++++ src/views/admim/system/role/index.vue | 26 +- .../admim/system/version/config/content2.ts | 133 ----- src/views/admim/system/version/index.vue | 174 ++---- src/views/order/index/config/config.ts | 2 +- src/views/order/index/config/content.ts | 2 +- src/views/shop/staff.vue | 1 - src/views/shop/staff/components/title.vue | 14 + src/views/shop/staff/config/add.ts | 177 ++++++ src/views/shop/staff/config/config.ts | 29 + src/views/shop/staff/config/content.ts | 62 ++ src/views/shop/staff/config/edit.ts | 177 ++++++ src/views/shop/staff/config/search.ts | 34 ++ src/views/shop/staff/index.vue | 133 +++++ 29 files changed, 2508 insertions(+), 280 deletions(-) create mode 100644 src/api/account/shopStaff.ts rename src/api/{system => order}/order.ts (96%) create mode 100644 src/api/system/miniAppPages.ts create mode 100644 src/views/admim/system/menu/index.vue create mode 100644 src/views/admim/system/miniAppPages/config/add.ts create mode 100644 src/views/admim/system/miniAppPages/config/config.ts create mode 100644 src/views/admim/system/miniAppPages/config/content.ts create mode 100644 src/views/admim/system/miniAppPages/config/edit.ts create mode 100644 src/views/admim/system/miniAppPages/config/search.ts create mode 100644 src/views/admim/system/miniAppPages/index.vue delete mode 100644 src/views/admim/system/version/config/content2.ts delete mode 100644 src/views/shop/staff.vue create mode 100644 src/views/shop/staff/components/title.vue create mode 100644 src/views/shop/staff/config/add.ts create mode 100644 src/views/shop/staff/config/config.ts create mode 100644 src/views/shop/staff/config/content.ts create mode 100644 src/views/shop/staff/config/edit.ts create mode 100644 src/views/shop/staff/config/search.ts create mode 100644 src/views/shop/staff/index.vue diff --git a/src/api/account/menu.ts b/src/api/account/menu.ts index e1fdd00..a4b5197 100644 --- a/src/api/account/menu.ts +++ b/src/api/account/menu.ts @@ -1,14 +1,50 @@ import request from "@/utils/request"; -const baseURL = "account/admin/"; - +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/menus"; const MenuApi = { /** 获取当前用户菜单列表*/ getRoutes() { - return request({ - url: `${baseURL}menus`, + return request({ + url: `${baseURL}`, method: "get", }); }, + /**获取所有菜单 */ + getList(data: getListRequest) { + return request({ + url: `${baseURL}/list`, + method: "get", + params: data + }); + }, + get(id: string) { + return request({ + url: `${baseURL}/detail`, + method: "get", + data: { id } + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data + }); + }, + edit(id: string | number, data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data: { ...data, id } + }); + }, + delete(id: number) { + return request({ + url: `${baseURL}`, + method: "delete", + data: { id } + }); + }, }; export default MenuApi; @@ -27,6 +63,8 @@ export interface RouteVO { path?: string; /** 跳转链接 */ redirect?: string; + title: string, + menuId: string | number, } /** Meta,路由属性 */ export interface Meta { @@ -41,3 +79,230 @@ export interface Meta { /** 路由title */ title?: string; } + +export interface getListRequest { + /** + * 结束时间 + */ + endTime?: string; + /** + * 开始时间 + */ + startTime?: string; + /** + * 菜单名称 + */ + title?: string; + [property: string]: any; +} + +/** + * MenuAddDTO + */ +export interface addRequest { + /** + * 是否选中父级菜单 + */ + activeMenu?: string; + /** + * 是否缓存 + */ + cache?: number; + /** + * 组件 + */ + component?: string; + /** + * 是否隐藏 + */ + hidden?: number; + /** + * 图标 + */ + icon?: string; + /** + * 是否外链 + */ + iFrame?: number; + /** + * 菜单排序 + */ + menuSort?: number; + /** + * 链接地址 + */ + path?: string; + /** + * 权限表示 + */ + permission?: string; + /** + * 上级菜单,不传递则为顶级菜单 + */ + pid?: number; + title: string; + /** + * 菜单类型 0 菜单 1按钮 2接口 + */ + type: number | null; + [property: string]: any; +} +/** + * MenuEditDTO + */ +export interface editRequest { + /** + * 菜单类型 0 菜单 1按钮 2接口 + */ + type: number; + /** + * 是否选中父级菜单 + */ + activeMenu?: string; + /** + * 是否缓存 + */ + cache?: number; + /** + * 组件 + */ + component?: string; + /** + * 是否隐藏 + */ + hidden?: number; + /** + * 图标 + */ + icon?: string; + id: number | string; + /** + * 是否外链 + */ + iFrame?: number; + /** + * 菜单排序 + */ + menuSort?: number; + /** + * 链接地址 + */ + path?: string; + /** + * 权限表示 + */ + permission?: string; + /** + * 上级菜单,不传递则为顶级菜单 + */ + pid?: number; + title: string; + [property: string]: any; +} + +/** + * 菜单结构 + * + * CzgResult«List«MenuVO»» + */ +export interface getListResponse { + code?: number | null; + data?: MenuVO[] | null; + msg?: null | string; + [property: string]: any; +} + +/** +* MenuVO +*/ +export interface MenuVO { + /** + * 是否选中父级菜单 + */ + activeMenu?: string; + /** + * 缓存 + */ + cache?: boolean; + /** + * 子菜单 + */ + children?: MenuVO[]; + /** + * 组件 + */ + component?: string; + /** + * 创建者 + */ + createBy?: string; + /** + * 创建日期 + */ + createTime?: string; + /** + * 隐藏 + */ + hidden?: boolean; + /** + * 图标 + */ + icon?: string; + /** + * 是否外链 + */ + iFrame?: boolean; + /** + * 商户使用 0:否;1:是; + */ + isShop?: number; + /** + * ID + */ + menuId?: number; + /** + * 排序 + */ + menuSort?: number; + /** + * 组件名称 + */ + name?: string; + /** + * 链接地址 + */ + path?: string; + /** + * 权限 + */ + permission?: string; + /** + * 权限集合 + */ + permissions?: string[]; + /** + * 上级菜单ID + */ + pid?: number; + /** + * 子菜单数目 + */ + subCount?: number; + /** + * 菜单标题 + */ + title?: string; + /** + * 菜单类型 0 菜单 1按钮 3接口 + */ + type?: number; + /** + * 更新者 + */ + updateBy?: string; + /** + * 更新时间 + */ + updateTime?: string; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/account/shopStaff.ts b/src/api/account/shopStaff.ts new file mode 100644 index 0000000..a59c1cd --- /dev/null +++ b/src/api/account/shopStaff.ts @@ -0,0 +1,256 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/shopStaff"; +const ShopStaffApi = { + getList(params: getListRequest) { + return request({ + url: `${baseURL}`, + method: "get", + params: params, + }); + }, + get(id: number | string) { + return request({ + url: `${baseURL}/detail`, + method: "get", + params: { id } + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data, + }); + }, + edit(data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data, + }); + }, + delete(id: number | string) { + return request({ + url: `${baseURL}`, + method: "delete", + data: { + id + } + }); + }, +}; + +export default ShopStaffApi; + +export interface getListRequest { + /** + * 员工编号 + */ + code?: string; + /** + * 账号名 + */ + name?: string; + [property: string]: any; +} +/** + * 分页数据 + * + * CzgResult«Page«ShopStaff»» + */ +export interface getListResponse { + code?: number | null; + data?: PageShopStaff; + msg?: null | string; + [property: string]: any; +} + +/** +* Page«ShopStaff» +*/ +export interface PageShopStaff { + /** + * 每页数据数量最大限制。 + */ + maxPageSize?: number | null; + /** + * 是否优化分页查询 COUNT 语句。 + */ + optimizeCountQuery?: boolean | null; + /** + * 当前页码。 + */ + pageNumber?: number | null; + /** + * 每页数据数量。 + */ + pageSize?: number | null; + /** + * 当前页数据。 + */ + records?: ShopStaff[] | null; + /** + * 总页数。 + */ + totalPage?: number | null; + /** + * 总数据数量。 + */ + totalRow?: number | null; + [property: string]: any; +} + +/** +* 店铺员工 实体类。 +* +* ShopStaff +*/ +export interface ShopStaff { + /** + * 员工编号 + */ + code?: null | string; + createTime?: null | string; + /** + * 优惠类型 1 折扣 0 金额 + */ + discountType?: null | string; + /** + * 使用系统用户 sys_user id + */ + id?: number | null; + /** + * 是否允许管理端登录 0:不允许;1:允许 + */ + isManage?: number | null; + /** + * 是否允许pc端登录 0:不允许;1:允许 + */ + isPc?: number | null; + /** + * 最大优惠金额 + */ + maxDiscountAmount?: number | null; + /** + * 员工名称 + */ + name?: null | string; + /** + * shopId + */ + shopId?: number | null; + /** + * 1启用0不启用 + */ + status?: boolean | null; + /** + * master商户账号staff员工 + */ + type?: null | string; + updateTime?: null | string; + [property: string]: any; +} + +/** + * 添加信息 + * + * ShopStaffAddDTO + */ +export interface addRequest { + /** + * 登录账号 + */ + accountName: null | string; + /** + * 登录密码 + */ + accountPwd: null | string; + /** + * 员工编号 + */ + code: null | string; + /** + * 优惠类型 1 折扣 0 金额 + */ + discountType?: number | null; + /** + * 是否允许管理端登录 + */ + isManage?: number | null; + /** + * 是否允许pc登录 + */ + isPc?: number | null; + /** + * 最大优惠金额 + */ + maxDiscountAmount?: number | null; + /** + * 员工姓名 + */ + name?: null | string; + /** + * 手机号 + */ + phone: null | string; + /** + * 角色id + */ + roleId: number | null; + /** + * 1启用0不启用 + */ + status?: number | null; + [property: string]: any; +} + +/** + * 添加信息 + * + * ShopStaffEditDTO + */ +export interface editRequest { + /** + * 登录密码 + */ + accountPwd?: null | string; + /** + * 员工编号 + */ + code?: null | string; + /** + * 优惠类型 1 折扣 0 金额 + */ + discountType?: number | null; + id: number | null; + /** + * 是否允许管理端登录 + */ + isManage?: number | null; + /** + * 是否允许pc登录 + */ + isPc?: number | null; + /** + * 最大优惠金额 + */ + maxDiscountAmount?: number | null; + /** + * 员工姓名 + */ + name?: null | string; + /** + * 手机号 + */ + phone?: null | string; + /** + * 角色id + */ + roleId?: number | null; + /** + * 1启用0不启用 + */ + status?: number | null; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/system/order.ts b/src/api/order/order.ts similarity index 96% rename from src/api/system/order.ts rename to src/api/order/order.ts index e4f77c1..5fec44a 100644 --- a/src/api/system/order.ts +++ b/src/api/order/order.ts @@ -1,6 +1,6 @@ import request from "@/utils/request"; -import { System_BaseUrl } from "@/api/config"; -const baseURL = System_BaseUrl + "/admin/order"; +import { Order_BaseUrl } from "@/api/config"; +const baseURL = Order_BaseUrl + "/admin/order"; const OrderApi = { getList(params: getListRequest) { return request({ @@ -9,9 +9,9 @@ const OrderApi = { params: params, }); }, - add() {}, - edit() {}, - delete() {}, + add() { }, + edit() { }, + delete() { }, }; export default OrderApi; diff --git a/src/api/system/miniAppPages.ts b/src/api/system/miniAppPages.ts new file mode 100644 index 0000000..4023760 --- /dev/null +++ b/src/api/system/miniAppPages.ts @@ -0,0 +1,187 @@ +import request from "@/utils/request"; +import { System_BaseUrl } from "@/api/config"; +const baseURL = System_BaseUrl + "/admin/miniAppPages"; +const VersionApi = { + getList(data: getListRequest) { + return request({ + url: `${baseURL}/page`, + method: "get", + params: data + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data, + }); + }, + edit(data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data, + }); + }, + delete(id: string) { + return request({ + url: `${baseURL}/` + id, + method: "delete", + }); + }, +}; + +export default VersionApi; + +export interface getListRequest { + /** + * 小程序页面名称 + */ + name?: string; + /** + * 页码 + */ + page?: number; + /** + * 小程序页面路径 + */ + path?: string; + /** + * 每页数量 + */ + size?: number; + /** + * 小程序页面状态 -1 查全部 1 启用 0 禁用 + */ + status?: number; + [property: string]: any; +} +/** + * CzgResultPageMiniAppPagesDTO + */ +export interface getListResponse { + code?: number; + data?: PageMiniAppPagesDTO; + msg?: string; + [property: string]: any; +} + +/** +* PageMiniAppPagesDTO +*/ +export interface PageMiniAppPagesDTO { + maxPageSize?: number; + optimizeCountQuery?: boolean; + pageNumber?: number; + pageSize?: number; + records?: MiniAppPagesDTO[]; + totalPage?: number; + totalRow?: number; + [property: string]: any; +} + +/** +* MiniAppPagesDTO +*/ +export interface MiniAppPagesDTO { + /** + * 页面描述 + */ + description?: string; + /** + * 图标 + */ + icon?: string; + /** + * id + */ + id?: number; + /** + * 页面名称 + */ + name?: string; + /** + * 页面路径 + */ + path?: string; + /** + * 排序 + */ + sort?: number; + /** + * 状态 1:启用 0:禁用 + */ + status?: number; + [property: string]: any; +} + + +/** + * MiniAppPagesDTOInsertGroup + */ +export interface addRequest { + /** + * 页面描述 + */ + description?: string; + /** + * 图标 + */ + icon?: string; + /** + * id + */ + id?: number; + /** + * 页面名称 + */ + name: string; + /** + * 页面路径 + */ + path: string; + /** + * 排序 + */ + sort?: number; + /** + * 状态 1:启用 0:禁用 + */ + status?: number; + [property: string]: any; +} + +/** + * MiniAppPagesDTOUpdateGroup + */ +export interface editRequest { + /** + * 页面描述 + */ + description?: string; + /** + * 图标 + */ + icon?: string; + /** + * id + */ + id: number; + /** + * 页面名称 + */ + name: string; + /** + * 页面路径 + */ + path: string; + /** + * 排序 + */ + sort?: number; + /** + * 状态 1:启用 0:禁用 + */ + status?: number; + [property: string]: any; +} \ No newline at end of file diff --git a/src/components/CURD/PageModal.vue b/src/components/CURD/PageModal.vue index 34f5954..a6121a2 100644 --- a/src/components/CURD/PageModal.vue +++ b/src/components/CURD/PageModal.vue @@ -17,7 +17,10 @@ > + +