feat(credit): 新增司法案件管理功能
- 添加司法案件模型定义及API接口 - 实现司法案件分页查询、列表查询、新增、修改、删除及批量删除功能 - 开发司法案件编辑弹窗组件,支持表单验证和数据提交 - 创建搜索组件,支持关键词搜索、添加、导入和批量删除操作 - 构建司法案件主页面,集成表格展示、编辑弹窗及导入功能 - 实现司法案件导入功能,支持Excel文件上传及模板下载 - 配置开发环境API地址,确保接口请求正常 - 添加司法案件导入弹窗组件,支持拖拽上传及文件类型校验
This commit is contained in:
126
src/api/credit/creditJudiciary/index.ts
Normal file
126
src/api/credit/creditJudiciary/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CreditJudiciary, CreditJudiciaryParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询司法案件
|
||||
*/
|
||||
export async function pageCreditJudiciary(params: CreditJudiciaryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CreditJudiciary>>>(
|
||||
'/credit/credit-judiciary/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询司法案件列表
|
||||
*/
|
||||
export async function listCreditJudiciary(params?: CreditJudiciaryParam) {
|
||||
const res = await request.get<ApiResult<CreditJudiciary[]>>(
|
||||
'/credit/credit-judiciary',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加司法案件
|
||||
*/
|
||||
export async function addCreditJudiciary(data: CreditJudiciary) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-judiciary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改司法案件
|
||||
*/
|
||||
export async function updateCreditJudiciary(data: CreditJudiciary) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/credit/credit-judiciary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除司法案件
|
||||
*/
|
||||
export async function removeCreditJudiciary(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-judiciary/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除司法案件
|
||||
*/
|
||||
export async function removeBatchCreditJudiciary(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-judiciary/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询司法案件
|
||||
*/
|
||||
export async function getCreditJudiciary(id: number) {
|
||||
const res = await request.get<ApiResult<CreditJudiciary>>(
|
||||
'/credit/credit-judiciary/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入司法案件
|
||||
*/
|
||||
export async function importCreditJudiciaries(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-judiciary/import',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
69
src/api/credit/creditJudiciary/model/index.ts
Normal file
69
src/api/credit/creditJudiciary/model/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 司法案件
|
||||
*/
|
||||
export interface CreditJudiciary {
|
||||
// ID
|
||||
id?: number;
|
||||
// 案件名称
|
||||
name?: string;
|
||||
// 案号
|
||||
code?: string;
|
||||
// 类型, 0普通用户, 1招投标
|
||||
type?: number;
|
||||
// 案由
|
||||
reason?: string;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 案件类型
|
||||
infoType?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 案件进程
|
||||
caseProgress?: string;
|
||||
// 案件身份
|
||||
caseIdentity?: string;
|
||||
// 法院
|
||||
court?: string;
|
||||
// 进程日期
|
||||
processDate?: string;
|
||||
// 案件金额(元)
|
||||
caseAmount?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 到期时间
|
||||
expirationTime?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 司法案件搜索条件
|
||||
*/
|
||||
export interface CreditJudiciaryParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user