From e82a4ce86573b80292a1d69c592c8a3d6b91ba81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 16 Dec 2025 16:27:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(credit):=20=E6=96=B0=E5=A2=9E=E5=8F=B8?= =?UTF-8?q?=E6=B3=95=E6=A1=88=E4=BB=B6=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加司法案件模型定义及API接口 - 实现司法案件分页查询、列表查询、新增、修改、删除及批量删除功能 - 开发司法案件编辑弹窗组件,支持表单验证和数据提交 - 创建搜索组件,支持关键词搜索、添加、导入和批量删除操作 - 构建司法案件主页面,集成表格展示、编辑弹窗及导入功能 - 实现司法案件导入功能,支持Excel文件上传及模板下载 - 配置开发环境API地址,确保接口请求正常 - 添加司法案件导入弹窗组件,支持拖拽上传及文件类型校验 --- .env.development | 2 +- src/api/credit/creditJudiciary/index.ts | 126 ++++++ src/api/credit/creditJudiciary/model/index.ts | 69 ++++ .../components/credit-judiciary-import.vue | 93 +++++ .../components/creditJudiciaryEdit.vue | 285 +++++++++++++ .../creditJudiciary/components/search.vue | 90 ++++ src/views/credit/creditJudiciary/index.vue | 384 ++++++++++++++++++ 7 files changed, 1048 insertions(+), 1 deletion(-) create mode 100644 src/api/credit/creditJudiciary/index.ts create mode 100644 src/api/credit/creditJudiciary/model/index.ts create mode 100644 src/views/credit/creditJudiciary/components/credit-judiciary-import.vue create mode 100644 src/views/credit/creditJudiciary/components/creditJudiciaryEdit.vue create mode 100644 src/views/credit/creditJudiciary/components/search.vue create mode 100644 src/views/credit/creditJudiciary/index.vue diff --git a/.env.development b/.env.development index b8ccd8b..fbcc74b 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_NAME=后台管理(开发环境) -#VITE_API_URL=http://127.0.0.1:9200/api +VITE_API_URL=http://127.0.0.1:9200/api #VITE_SERVER_API_URL=http://127.0.0.1:8000/api diff --git a/src/api/credit/creditJudiciary/index.ts b/src/api/credit/creditJudiciary/index.ts new file mode 100644 index 0000000..90394c7 --- /dev/null +++ b/src/api/credit/creditJudiciary/index.ts @@ -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>>( + '/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>( + '/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>( + '/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>( + '/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>( + '/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>( + '/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>( + '/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>( + '/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)); +} diff --git a/src/api/credit/creditJudiciary/model/index.ts b/src/api/credit/creditJudiciary/model/index.ts new file mode 100644 index 0000000..b1bce68 --- /dev/null +++ b/src/api/credit/creditJudiciary/model/index.ts @@ -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; +} diff --git a/src/views/credit/creditJudiciary/components/credit-judiciary-import.vue b/src/views/credit/creditJudiciary/components/credit-judiciary-import.vue new file mode 100644 index 0000000..0b1a865 --- /dev/null +++ b/src/views/credit/creditJudiciary/components/credit-judiciary-import.vue @@ -0,0 +1,93 @@ + + + + diff --git a/src/views/credit/creditJudiciary/components/creditJudiciaryEdit.vue b/src/views/credit/creditJudiciary/components/creditJudiciaryEdit.vue new file mode 100644 index 0000000..2b5494a --- /dev/null +++ b/src/views/credit/creditJudiciary/components/creditJudiciaryEdit.vue @@ -0,0 +1,285 @@ + + + + diff --git a/src/views/credit/creditJudiciary/components/search.vue b/src/views/credit/creditJudiciary/components/search.vue new file mode 100644 index 0000000..00e4dd6 --- /dev/null +++ b/src/views/credit/creditJudiciary/components/search.vue @@ -0,0 +1,90 @@ + + + + diff --git a/src/views/credit/creditJudiciary/index.vue b/src/views/credit/creditJudiciary/index.vue new file mode 100644 index 0000000..87a4f2c --- /dev/null +++ b/src/views/credit/creditJudiciary/index.vue @@ -0,0 +1,384 @@ + + + + + + +