Files
generator/dict/admin/src/api/clinic/clinicAppointment/index.ts
赵忠林 ba6896855a feat(admin): 添加管理后台logo文件- 新增128x128尺寸的SVG格式logo文件
- 使用Method Draw工具创建矢量图形
- 包含背景层和图层1的基础结构
- 支持透明背景显示
- 为管理后台界面提供品牌标识- 便于后续UI组件中引用和展示
2025-10-18 09:16:51 +08:00

106 lines
2.5 KiB
TypeScript

import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ClinicAppointment, ClinicAppointmentParam } from './model';
/**
* 分页查询挂号
*/
export async function pageClinicAppointment(params: ClinicAppointmentParam) {
const res = await request.get<ApiResult<PageResult<ClinicAppointment>>>(
'/clinic/clinic-appointment/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询挂号列表
*/
export async function listClinicAppointment(params?: ClinicAppointmentParam) {
const res = await request.get<ApiResult<ClinicAppointment[]>>(
'/clinic/clinic-appointment',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加挂号
*/
export async function addClinicAppointment(data: ClinicAppointment) {
const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-appointment',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改挂号
*/
export async function updateClinicAppointment(data: ClinicAppointment) {
const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-appointment',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除挂号
*/
export async function removeClinicAppointment(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-appointment/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除挂号
*/
export async function removeBatchClinicAppointment(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-appointment/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询挂号
*/
export async function getClinicAppointment(id: number) {
const res = await request.get<ApiResult<ClinicAppointment>>(
'/clinic/clinic-appointment/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}