diff --git a/.env.development b/.env.development index 9aea75f..fc90eae 100644 --- a/.env.development +++ b/.env.development @@ -13,7 +13,7 @@ VITE_APP_API_URL=https://tapi.cashier.sxczgkj.cn/ # 正式 # VITE_APP_API_URL=http://localhost:8989 # 本地 # WebSocket 端点(不配置则关闭),线上 ws://api.youlai.tech/ws ,本地 ws://localhost:8989/ws -VITE_APP_WS_ENDPOINT= +VITE_APP_WS_ENDPOINT=wss://sockets.sxczgkj.com/wss # 启用 Mock 服务 VITE_MOCK_DEV_SERVER=false diff --git a/README.md b/README.md index a9c6529..97fb75b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ 订单,支付相关: 商品,耗材相关: 系统相关: +购物车websocket + ## 项目特色 diff --git a/package.json b/package.json index d093947..14f1072 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "path-to-regexp": "^8.2.0", "pinia": "^2.3.1", "qs": "^6.14.0", + "sockjs-client": "^1.6.1", "sortablejs": "^1.15.6", "vue": "^3.5.13", "vue-i18n": "^11.1.0", diff --git a/src/api/account/activate.ts b/src/api/account/activate.ts new file mode 100644 index 0000000..e3d46b5 --- /dev/null +++ b/src/api/account/activate.ts @@ -0,0 +1,85 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/activate"; +const API = { + + getList() { + return request({ + url: `${baseURL}`, + method: "get", + }); + }, + edit(data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data: data, + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data: data, + }); + } +} +export default API; + +export interface addRequest { + /** + * 充值金额 + */ + amount?: number; + /** + * 优惠卷id + */ + couponId?: number; + /** + * 赠送金额 + */ + giftAmount?: number; + /** + * 赠送积分 + */ + giftPoints?: number; + /** + * 是否赠送优惠卷 0否 1是 + */ + isGiftCoupon?: number; + /** + * 优惠卷数量 + */ + num?: number; + [property: string]: any; +} + +export interface editRequest { + /** + * 充值金额 + */ + amount: number; + /** + * 优惠卷id + */ + couponId?: number; + /** + * 赠送金额 + */ + giftAmount?: number; + /** + * 赠送积分 + */ + giftPoints?: number; + id: number; + /** + * 是否赠送优惠卷 0否 1是 + */ + isGiftCoupon?: number; + /** + * 优惠卷数量 + */ + num?: number; + shopId?: number; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/account/menu.ts b/src/api/account/menu.ts index a4b5197..ba291ef 100644 --- a/src/api/account/menu.ts +++ b/src/api/account/menu.ts @@ -21,7 +21,7 @@ const MenuApi = { return request({ url: `${baseURL}/detail`, method: "get", - data: { id } + params: { id } }); }, add(data: addRequest) { @@ -195,7 +195,7 @@ export interface editRequest { /** * 上级菜单,不传递则为顶级菜单 */ - pid?: number; + pid: number | string | null; title: string; [property: string]: any; } diff --git a/src/api/account/permission.ts b/src/api/account/permission.ts new file mode 100644 index 0000000..038b653 --- /dev/null +++ b/src/api/account/permission.ts @@ -0,0 +1,22 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin"; +const ShopStaffApi = { + // 获取店铺权限列表 + getshopPermission() { + return request({ + url: `${baseURL}/shopPermission`, + method: "get", + }); + }, + // 获取员工对应的权限id + getPermission(id: number | string) { + return request({ + url: `${baseURL}/shopStaff/permission`, + method: "get", + params: { id } + }); + }, +}; + +export default ShopStaffApi; diff --git a/src/api/account/role.ts b/src/api/account/role.ts index faea2a6..52007cd 100644 --- a/src/api/account/role.ts +++ b/src/api/account/role.ts @@ -17,20 +17,29 @@ const RoleApi = { data, }); }, - update(data: editRequest) { - return request({ + update(id: number | string | null, data: editRequest) { + const requestData = { ...data, id }; + return request({ url: `${baseURL}`, method: "put", - data, + data: requestData, }); }, delete(data: delRequest) { return request({ url: `${baseURL}`, - method: "put", + method: "delete", data, }); }, + // 获取角色对应的菜单id + getMenu(id: number) { + return request({ + url: `${baseURL}/menu`, + method: "get", + params: { id }, + }); + }, }; export default RoleApi; @@ -226,3 +235,4 @@ export interface delResponse { [property: string]: any; } /** delete end */ + diff --git a/src/api/account/shopMerchant.ts b/src/api/account/shopMerchant.ts new file mode 100644 index 0000000..25418b9 --- /dev/null +++ b/src/api/account/shopMerchant.ts @@ -0,0 +1,55 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/shopMerchant"; +const API = { + get(shopId: string | number) { + return request({ + url: `${baseURL}`, + method: "get", + headers: { + shopId: shopId + } + }); + }, + edit(shopId: string | number, data: shopMerchantType) { + return request({ + url: `${baseURL}`, + method: "put", + data: data, + headers: { + shopId: shopId + } + }); + } +} +export default API; +/** + * ShopMerchantEditDTO + */ +export interface shopMerchantType { + /** + * 支付宝appid + */ + alipaySmallAppid: null | string; + /** + * 商户应用id + */ + appId: null | string; + /** + * 商户秘钥 + */ + appSecret: null | string; + /** + * 支付密码 + */ + payPassword: null | string; + /** + * 支付系统商户id + */ + storeId: null | string; + /** + * 微信appid + */ + wechatSmallAppid: null | string; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/account/shopUser.ts b/src/api/account/shopUser.ts new file mode 100644 index 0000000..4831704 --- /dev/null +++ b/src/api/account/shopUser.ts @@ -0,0 +1,160 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/shopUser"; +const API = { + // 获取店铺用户概述信息 + getSummary(data: getSummaryRequest) { + return request({ + url: `${baseURL}/summary`, + method: "get", + params: data + }); + }, + getList(data: getListRequest) { + return request({ + url: `${baseURL}`, + method: "get", + params: data + }); + }, + edit(shopId: string | number, data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data: data, + headers: { + shopId: shopId + } + }); + }, + // 店铺用户余额修改 + editMoney(shopId: string | number, data: editMoneyRequest) { + return request({ + url: `${baseURL}/money`, + method: "put", + data: data, + headers: { + shopId: shopId + } + }); + }, + add(shopId: string | number, data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data: data, + headers: { + shopId: shopId + } + }); + } +} +export default API; + +export interface getSummaryRequest { + /** + * 0 非vip 1 vip + */ + isVip?: number; + [property: string]: any; +} +export interface getListRequest { + /** + * 0 非vip 1 vip + */ + isVip?: number; + /** + * 昵称或手机号 + */ + key?: string; + [property: string]: any; +} + +/** + * ShopUserEditDTO + */ +export interface editRequest { + /** + * 生日 + */ + birthDay?: null | string; + /** + * 对应shopUserid + */ + id: number | null; + /** + * 昵称 + */ + nickName?: null | string; + /** + * 性别 0女 1男 + */ + sex?: number | null; + [property: string]: any; +} + +/** + * ShopUserMoneyEditDTO + */ +export interface editMoneyRequest { + /** + * 对应shopUserid + */ + id: number | null; + /** + * 浮动金额 + */ + money: number | null; + /** + * 备注 + */ + remark?: null | string; + /** + * 0减少 1增加 + */ + type: number | null; + [property: string]: any; +} + +/** + * ShopUserAddDTO + */ +export interface addRequest { + /** + * 账户积分 + */ + accountPoints?: number | null; + /** + * 钱包余额 + */ + amount?: number | null; + /** + * 会员生日 + */ + birthDay?: null | string; + /** + * 用户头像 + */ + headImg?: null | string; + /** + * 是否会员, + */ + isVip?: number | null; + /** + * 用户昵称 + */ + nickName: null | string; + /** + * 电话号码 + */ + phone: null | string; + /** + * 0-女 1男 + */ + sex?: number | null; + /** + * 用户Id + */ + userId: number | null; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/account/table.ts b/src/api/account/table.ts new file mode 100644 index 0000000..0991f28 --- /dev/null +++ b/src/api/account/table.ts @@ -0,0 +1,128 @@ +import request from "@/utils/request"; +import { Account_BaseUrl } from "@/api/config"; +const baseURL = Account_BaseUrl + "/admin/shopTable"; +const API = { + // 批量生成桌码 + fasetAdd(num: number) { + return request({ + url: `${baseURL}/code`, + method: "post", + data: { num }, + }); + }, + getList(data: getListRequest) { + return request({ + url: `${baseURL}`, + method: "get", + params: data + }); + }, + edit(data: editRequest) { + return request({ + url: `${baseURL}`, + method: "put", + data: data, + }); + }, + add(data: addRequest) { + return request({ + url: `${baseURL}`, + method: "post", + data: data, + }); + }, + delete(id: number | string) { + return request({ + url: `${baseURL}`, + method: "post", + data: { id }, + }); + } +} +export default API; +/** + * ShopTableAddDTO + */ +export interface addRequest { + /** + * 区域id + */ + areaId?: number | null; + /** + * 是否自动清台 + */ + autoClear?: number | null; + /** + * 客座数 + */ + capacity: number | null; + /** + * 结束数字 + */ + end: number | null; + /** + * 台桌前缀 + */ + sign: null | string; + /** + * 起始数字 + */ + start: number | null; + [property: string]: any; +} + +/** + * ShopTableDTO + */ +export interface editRequest { + /** + * 区域Id + */ + areaId?: number | null; + /** + * 自动清台 0手动 1自动 + */ + autoClear?: number | null; + /** + * 自增id + */ + id: number | null; + /** + * 是否接受网络预定 + */ + isPredate?: number | null; + /** + * 客座数,允许的客座数量 + */ + maxCapacity?: number | null; + name?: null | string; + /** + * 网络预定台桌支付金额 + */ + predateAmount?: number | null; + /** + * 二维码 + */ + qrcode?: null | string; + /** + * 台桌排序 + */ + sort?: number | null; + /** + * idle-空闲 using-使用中 subscribe预定,closed--关台, opening 开台中,cleaning 台桌清理中 + */ + status?: null | string; + [property: string]: any; +} + +export interface getListRequest { + /** + * 区域id + */ + areaId?: number; + /** + * 桌码 + */ + tableCode?: string; + [property: string]: any; +} \ No newline at end of file diff --git a/src/api/system/user.ts b/src/api/system/user.ts index fcd4c8d..e893e3d 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -216,7 +216,7 @@ export default UserAPI; export interface UserInfo { /** 用户ID */ userId?: number; - + id?: number | string; /** 用户名 */ username?: string; diff --git a/src/components/CURD/PageContent.vue b/src/components/CURD/PageContent.vue index d005bed..972aa64 100644 --- a/src/components/CURD/PageContent.vue +++ b/src/components/CURD/PageContent.vue @@ -8,37 +8,58 @@ @@ -67,36 +88,68 @@ - + @@ -191,32 +263,68 @@ @@ -232,18 +340,33 @@ - + - + @@ -253,10 +376,16 @@ - - + + @@ -277,17 +406,35 @@ - + - + - + :drag="true" + :limit="1" + :auto-upload="false" + :on-exceed="handleFileExceed" + >
将文件拖到此处,或 @@ -296,8 +443,13 @@