优化网站导航模块

This commit is contained in:
2024-08-23 22:28:24 +08:00
parent 1d81fa9270
commit 13832d9de0
964 changed files with 90774 additions and 31362 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Period, PeriodParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询场地时段
*/
export async function pagePeriod(params: PeriodParam) {
const res = await request.get<ApiResult<PageResult<Period>>>(
MODULES_API_URL + '/booking/period/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询场地时段列表
*/
export async function listPeriod(params?: PeriodParam) {
const res = await request.get<ApiResult<Period[]>>(
MODULES_API_URL + '/booking/period',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加场地时段
*/
export async function addPeriod(data: Period) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/period',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改场地时段
*/
export async function updatePeriod(data: Period) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/period',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除场地时段
*/
export async function removePeriod(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/period/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除场地时段
*/
export async function removeBatchPeriod(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/period/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询场地时段
*/
export async function getPeriod(id: number) {
const res = await request.get<ApiResult<Period>>(
MODULES_API_URL + '/booking/period/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,61 @@
import type { PageParam } from '@/api';
import { BookingField } from '@/api/booking/bookingField/model';
/**
* 场地时段
*/
export interface Period {
//
periodId?: number;
// 时段
timePeriod?: string;
timePeriod1?: string;
timePeriod2?: string;
// 价格
price?: number;
// 每日不同价格
prices?: string;
// 半场价格
halfPrice?: number;
// 每日不同半场价格
halfPrices?: string;
// 儿童价
childrenPrice?: number;
// 星期选择
week?: string;
// 排序
sortNumber?: number;
// 关联id
merchantId?: number;
// 是否关闭1开启2关闭
isStatus?: number;
// 是否免费1免费2收费
isFree?: number;
// 开始时间
startTime?: string;
// 备注
comments?: string;
// 状态
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
// 场地列表
fieldList?: BookingField[];
}
/**
* 场地时段搜索条件
*/
export interface PeriodParam extends PageParam {
periodId?: number;
keywords?: string;
dateTime?: string;
isStatus?: number;
timePeriod?: string;
merchantId?: number;
week?: number;
startTime?: string;
half?: number;
}