feat: 新增门店列表页面并修复全局类型错误

1. 新增门店列表页(筛选/统计/表格/抽屉编辑),使用 mockjs 提供接口数据
2. 新增门店相关枚举、API 定义、路由配置
3. 修复 auth.ts loginApi 参数类型不匹配
4. 修复 merchant-center stores 属性路径错误及 merchant prop 类型不兼容
5. 修复 merchant-setting showSubmitButton 不存在于 VbenFormProps
This commit is contained in:
2026-02-15 16:35:22 +08:00
parent 0a161d185e
commit 4be997df63
13 changed files with 1535 additions and 1053 deletions

View File

@@ -0,0 +1,105 @@
import type {
ServiceType,
StoreAuditStatus,
StoreBusinessStatus,
} from '#/enums/storeEnum';
import { requestClient } from '#/api/request';
export * from '#/enums/storeEnum';
/** 门店列表项 */
export interface StoreListItemDto {
/** 门店ID */
id: string;
/** 门店名称 */
name: string;
/** 门店编码 */
code: string;
/** 联系电话 */
contactPhone: string;
/** 店长/负责人 */
managerName: string;
/** 门店地址 */
address: string;
/** 门店封面图 */
coverImage?: string;
/** 营业状态 */
businessStatus: StoreBusinessStatus;
/** 审核状态 */
auditStatus: StoreAuditStatus;
/** 服务方式 */
serviceTypes: ServiceType[];
/** 创建时间 */
createdAt: string;
}
/** 门店统计 */
export interface StoreStatsDto {
/** 门店总数 */
total: number;
/** 营业中 */
operating: number;
/** 休息中 */
resting: number;
/** 待审核 */
pendingAudit: number;
}
/** 门店列表查询参数 */
export interface StoreListQuery {
keyword?: string;
businessStatus?: StoreBusinessStatus;
auditStatus?: StoreAuditStatus;
serviceType?: ServiceType;
page: number;
pageSize: number;
}
/** 分页结果 */
export interface PaginatedResult<T> {
items: T[];
total: number;
page: number;
pageSize: number;
}
/** 创建/编辑门店参数 */
export interface SaveStoreDto {
id?: string;
name: string;
code: string;
contactPhone: string;
managerName: string;
address: string;
coverImage?: string;
businessStatus?: StoreBusinessStatus;
serviceTypes?: ServiceType[];
}
/** 获取门店列表 */
export async function getStoreListApi(params: StoreListQuery) {
return requestClient.get<PaginatedResult<StoreListItemDto>>('/store/list', {
params,
});
}
/** 获取门店统计 */
export async function getStoreStatsApi() {
return requestClient.get<StoreStatsDto>('/store/stats');
}
/** 创建门店 */
export async function createStoreApi(data: SaveStoreDto) {
return requestClient.post('/store/create', data);
}
/** 更新门店 */
export async function updateStoreApi(data: SaveStoreDto) {
return requestClient.post('/store/update', data);
}
/** 删除门店 */
export async function deleteStoreApi(id: string) {
return requestClient.post('/store/delete', { id });
}