- 添加 .dockerignore 和 .env.example 配置文件 - 添加 .gitignore 忽略规则配置 - 创建服务端代理API路由(_file、_modules、_server) - 集成 Ant Design Vue 组件库并配置SSR样式提取 - 定义API响应类型封装 - 创建基础布局组件(blank、console) - 实现应用中心页面和组件(AppsCenter) - 添加文章列表测试页面 - 配置控制台导航菜单结构 - 实现控制台头部组件 - 创建联系页面表单
106 lines
2.5 KiB
TypeScript
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));
|
|
}
|