forked from b2894lxlx/tuanwei-admin
调整
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { LawLegalDocConfig, LawLegalDocConfigParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询法律文书配置
|
||||
*/
|
||||
export async function pageLawLegalDocConfig(params: LawLegalDocConfigParam) {
|
||||
const res = await request.get<ApiResult<PageResult<LawLegalDocConfig>>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询法律文书配置列表
|
||||
*/
|
||||
export async function listLawLegalDocConfig(params?: LawLegalDocConfigParam) {
|
||||
const res = await request.get<ApiResult<LawLegalDocConfig[]>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加法律文书配置
|
||||
*/
|
||||
export async function addLawLegalDocConfig(data: LawLegalDocConfig) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改法律文书配置
|
||||
*/
|
||||
export async function updateLawLegalDocConfig(data: LawLegalDocConfig) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除法律文书配置
|
||||
*/
|
||||
export async function removeLawLegalDocConfig(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除法律文书配置
|
||||
*/
|
||||
export async function removeBatchLawLegalDocConfig(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询法律文书配置
|
||||
*/
|
||||
export async function getLawLegalDocConfig(id: number) {
|
||||
const res = await request.get<ApiResult<LawLegalDocConfig>>(
|
||||
MODULES_API_URL + '/law/law-legal-doc-config/' + id
|
||||
);
|
||||
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