优化网站导航模块

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 { BookingPeriod, BookingPeriodParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询场地时段
*/
export async function pageBookingPeriod(params: BookingPeriodParam) {
const res = await request.get<ApiResult<PageResult<BookingPeriod>>>(
MODULES_API_URL + '/booking/booking-period/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询场地时段列表
*/
export async function listBookingPeriod(params?: BookingPeriodParam) {
const res = await request.get<ApiResult<BookingPeriod[]>>(
MODULES_API_URL + '/booking/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 addBookingPeriod(data: BookingPeriod) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-period',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改场地时段
*/
export async function updateBookingPeriod(data: BookingPeriod) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-period',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除场地时段
*/
export async function removeBookingPeriod(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-period/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除场地时段
*/
export async function removeBatchBookingPeriod(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/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 getBookingPeriod(id: number) {
const res = await request.get<ApiResult<BookingPeriod>>(
MODULES_API_URL + '/booking/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,49 @@
import type { PageParam } from '@/api';
/**
* 场地时段
*/
export interface BookingPeriod {
//
periodId?: number;
// 时段
timePeriod?: string;
// 价格
price?: string;
// 每日不同价格
prices?: string;
// 半场价格
halfPrice?: string;
// 每日不同半场价格
halfPrices?: string;
// 儿童价
childrenPrice?: string;
// 星期选择
week?: string;
// 排序
sortNumber?: number;
// 关联id
merchantId?: number;
// 是否关闭0开启1关闭
isStatus?: string;
// 是否免费0免费1收费
isFree?: string;
// 开始时间
startTime?: string;
// 备注
comments?: string;
// 状态
status?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 场地时段搜索条件
*/
export interface BookingPeriodParam extends PageParam {
periodId?: number;
keywords?: string;
}