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/README.md b/README.md index 97fb75b..8137a30 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ 基于 Vue3 + Vite5+ TypeScript5 + Element-Plus + Pinia 等主流技术栈构建 +## 宝塔 + +101.37.12.135:19928/mianban +chaozg +chaozg123 + ## API文档 [超掌柜收银机](https://app.apifox.com/project/5827475) 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/api/account/table.ts b/src/api/account/table.ts index 0991f28..7e3b3ca 100644 --- a/src/api/account/table.ts +++ b/src/api/account/table.ts @@ -34,7 +34,7 @@ const API = { delete(id: number | string) { return request({ url: `${baseURL}`, - method: "post", + method: "delete", data: { id }, }); } diff --git a/src/api/product/index.ts b/src/api/product/index.ts index f0776ba..b0cc00c 100644 --- a/src/api/product/index.ts +++ b/src/api/product/index.ts @@ -62,4 +62,306 @@ export interface Responseres { [property: string]: any; } -export default AuthAPI; \ No newline at end of file +export default AuthAPI; + + +export interface Response { + code: number; + data: Data; + msg: string; + [property: string]: any; +} + +export interface Data { + pageNumber: string; + pageSize: string; + records: Record[]; + totalPage: string; + totalRow: string; + [property: string]: any; +} + +export interface Record { + /** + * 分类id + */ + categoryId: string; + /** + * 分类名称 + */ + categoryName: string; + /** + * 封面图url + */ + coverImg: string; + /** + * 创建时间 + */ + createTime: string; + /** + * 定时上下架周期 + */ + days: string; + /** + * 起用结束时间 + */ + endTime: string; + /** + * 团购卷分类,可有多个分类 + */ + groupCategoryId: string; + /** + * 套餐内容 + */ + groupSnap: GroupSnap[]; + /** + * 套餐类型,0 固定套餐 1可选套餐 + */ + groupType: number; + /** + * 商品id + */ + id: string; + /** + * 封面图urls + */ + images: string[]; + /** + * 是否允许临时改价 + */ + isAllowTempModifyPrice: number; + /** + * 是否逻辑删除 + */ + isDel: number; + /** + * 是否推荐 + */ + isHot: number; + /** + * 退款是否退回库存 + */ + isRefundStock: number; + /** + * 是否上架 + */ + isSale: number; + /** + * 是否售罄 + */ + isSoldStock: number; + /** + * 是否启用库存 + */ + isStock: number; + /** + * 会员最低价 + */ + lowMemberPrice: number; + /** + * 商品最低价 + */ + lowPrice: number; + /** + * 商品名称 + */ + name: string; + /** + * 打包费 + */ + packFee: number; + /** + * 套餐详情入参使用 + */ + proGroupVo: string[]; + selectSpecInfo: { [key: string]: any }; + /** + * 店铺id + */ + shopId: string; + /** + * 商品介绍 + */ + shortTitle: string; + /** + * sku集合 + */ + skuList: SkuList[]; + /** + * 排序值 + */ + sort: number; + /** + * 规格完整名称 + */ + specFullName: string; + /** + * 规格id + */ + specId: null; + /** + * 规格名称 + */ + specName: string; + /** + * 起用开始时间 + */ + startTime: string; + /** + * 库存 + */ + stockNumber: number; + /** + * 商品类型,single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券 + */ + type: string; + /** + * 单位id + */ + unitId: string; + /** + * 单位名称 + */ + unitName: string; + /** + * 更新时间 + */ + updateTime: string; + /** + * 库存警戒线 + */ + warnLine: number; + /** + * 重量 + */ + weight?: number; + [property: string]: any; +} + +export interface GroupSnap { + /** + * 套餐内商品总数 + */ + count: number; + /** + * 套餐内商品列表 + */ + goods: Good[]; + /** + * 可选套餐几选几,固定套餐没有值 + */ + number: number; + /** + * 可选套餐名称 + */ + title: string; + [property: string]: any; +} + +export interface Good { + /** + * 商品数量 + */ + number: string; + /** + * 商品单价 + */ + price: number; + /** + * 商品ID + */ + proId: number; + /** + * 商品名称 + */ + proName: string; + /** + * skuId + */ + skuId: number; + /** + * sku名称 + */ + skuName: string; + /** + * 单位名称 + */ + unitName: string; + [property: string]: any; +} + +export interface SkuList { + /** + * 条形码 + */ + barCode: string; + /** + * 成本价 + */ + costPrice: number; + /** + * 封面图 + */ + coverImg: string; + /** + * 创建时间 + */ + createTime: string; + /** + * sku-id + */ + id: string; + /** + * 是否已删除 + */ + isDel: number; + /** + * 是否上架 + */ + isGrounding: number; + /** + * 是否售罄 + */ + isPauseSale: number; + /** + * 会员价 + */ + memberPrice: number; + /** + * 原价 + */ + originPrice: number; + /** + * 商品id + */ + productId: string; + /** + * 销量 + */ + realSalesNumber: number; + /** + * 售价 + */ + salePrice: number; + /** + * 店铺id + */ + shopId: string; + /** + * 规格详情 + */ + specInfo: string; + /** + * 起售数量 + */ + suitNum: number; + /** + * 更新时间 + */ + updateTime: string; + /** + * 重量 + */ + weight: 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 c820190..b9c9ac7 100644 --- a/src/components/CURD/PageModal.vue +++ b/src/components/CURD/PageModal.vue @@ -1,9 +1,20 @@