调整
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { YxeSelfReport, YxeSelfReportParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import type { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
export async function pageYxeSelfReport(params: YxeSelfReportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<YxeSelfReport>>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function listYxeSelfReport(params?: YxeSelfReportParam) {
|
||||
const res = await request.get<ApiResult<YxeSelfReport[]>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function addYxeSelfReport(data: YxeSelfReport) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateYxeSelfReport(data: YxeSelfReport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function removeYxeSelfReport(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function removeBatchYxeSelfReport(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getYxeSelfReport(id: number) {
|
||||
const res = await request.get<ApiResult<YxeSelfReport>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function exportYxeSelfReport(params?: YxeSelfReportParam) {
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
MODULES_API_URL + '/yxe/yxe-self-report/export',
|
||||
params
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Reference in New Issue
Block a user