From 0758aef0fb9a96d383ce9eea2500a15e2af8f7bf Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 19 Feb 2025 11:27:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=97=E9=93=BA=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E3=80=8B=E5=91=98=E5=B7=A5=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 - .env.production | 11 + src/api/account/permission.ts | 57 +- src/api/account/shopArea.ts | 78 + src/components/CURD/PageModal.vue | 84 +- src/store/modules/permission.ts | 1 - src/utils/request.ts | 1 - src/utils/websocket.ts | 6 +- src/views/data/index copy.vue | 1479 ++++++++++++++++ src/views/data/index.vue | 1480 +---------------- src/views/login/index.vue | 4 +- .../staff/components/select-permission.vue | 53 +- src/views/shop/staff/config/add.ts | 21 +- src/views/shop/staff/config/edit.ts | 22 +- src/views/shop/staff/index.vue | 69 +- 15 files changed, 1843 insertions(+), 1526 deletions(-) create mode 100644 src/api/account/shopArea.ts create mode 100644 src/views/data/index copy.vue diff --git a/.env.development b/.env.development index fc90eae..d0b36c9 100644 --- a/.env.development +++ b/.env.development @@ -6,11 +6,8 @@ VITE_APP_BASE_API=/dev-api # 接口地址 -# VITE_APP_API_URL=https://admintestpapi.sxczgkj.cn/ # 线上 VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 正式 -# VITE_APP_API_URL=https://api.youlai.tech # 线上 -# VITE_APP_API_URL=http://localhost:8989 # 本地 # WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss diff --git a/.env.production b/.env.production index 17729b6..72449c3 100644 --- a/.env.production +++ b/.env.production @@ -4,3 +4,14 @@ VITE_APP_BASE_API = '/prod-api' # WebSocket端点(可选) #VITE_APP_WS_ENDPOINT=wss://api.youlai.tech/ws + +# 接口地址 + +VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 正式 + + +# WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws +VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss + +# 启用 Mock 服务 +VITE_MOCK_DEV_SERVER=false diff --git a/src/api/account/permission.ts b/src/api/account/permission.ts index 038b653..8530815 100644 --- a/src/api/account/permission.ts +++ b/src/api/account/permission.ts @@ -4,14 +4,14 @@ const baseURL = Account_BaseUrl + "/admin"; const ShopStaffApi = { // 获取店铺权限列表 getshopPermission() { - return request({ + return request({ url: `${baseURL}/shopPermission`, method: "get", }); }, // 获取员工对应的权限id getPermission(id: number | string) { - return request({ + return request({ url: `${baseURL}/shopStaff/permission`, method: "get", params: { id } @@ -20,3 +20,56 @@ const ShopStaffApi = { }; export default ShopStaffApi; + +/** + * 权限列表 + * + * CzgResult«List«ShopPermission»» + */ +export interface PermissionResonpseResponse { + code?: number | null; + data?: ShopPermission[] | null; + msg?: null | string; + [property: string]: any; +} + +/** +* 店铺权限 实体类。 +* +* ShopPermission +*/ +export interface ShopPermission { + children?: ShopPermission[] | null; + /** + * 权限code,为了区分采用汉语拼音 + */ + code?: null | string; + createTime?: null | string; + id: string; + /** + * 是否重要: 重要对应页面红色 + */ + isImportant?: number | null; + /** + * 权限名称 + */ + label?: null | string; + /** + * 层级 + */ + level?: number | null; + /** + * 上级ID + */ + parentId?: number | null; + /** + * 排序 + */ + sort?: number | null; + /** + * 权限类型:staff 员工, + */ + type?: null | string; + updateTime?: null | string; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/account/shopArea.ts b/src/api/account/shopArea.ts new file mode 100644 index 0000000..db9a4ea --- /dev/null +++ b/src/api/account/shopArea.ts @@ -0,0 +1,78 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/shopArea"; +const ShopStaffApi = { + getList(params: getListRequest) { + return request({ + url: `${baseURL}`, + method: "get", + params + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data + }); + }, + edit(data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data + }); + }, + delete(id: string | number) { + return request({ + url: `${baseURL}`, + method: "delete", + data: { id } + }); + }, +}; + +export default ShopStaffApi; + +export interface getListRequest { + /** + * 区域名称 + */ + name?: string; + page?: string; + size?: string; + [property: string]: any; +} +/** + * ShopAreaEditDTO + */ +export interface editRequest { + /** + * id + */ + id: number | null; + /** + * 区域名称 + */ + name?: null | string; + /** + * 排序 + */ + sort?: number | null; + [property: string]: any; +} + +/** + * ShopAreaAddDTO + */ +export interface addRequest { + /** + * 区域名称 + */ + name: null | string; + /** + * 排序 + */ + sort?: number | null; + [property: string]: any; +} \ No newline at end of file diff --git a/src/components/CURD/PageModal.vue b/src/components/CURD/PageModal.vue index ef74130..78af5eb 100644 --- a/src/components/CURD/PageModal.vue +++ b/src/components/CURD/PageModal.vue @@ -1,9 +1,20 @@