diff --git a/src/api/contractReview/ContractualCaseFiles/index.ts b/src/api/contractReview/ContractualCaseFiles/index.ts new file mode 100644 index 0000000..5cf62a7 --- /dev/null +++ b/src/api/contractReview/ContractualCaseFiles/index.ts @@ -0,0 +1,98 @@ +import { defHttp } from '@/utils/http/axios'; +import { ID, IDS, commonExport } from '@/api/base'; +import { ContractualCaseFilesVO, ContractualCaseFilesForm, ContractualCaseFilesQuery } from './model'; + +/** + * 查询合同案例文件列表 + * @param params + * @returns + */ +export function ContractualCaseFilesList(params?: ContractualCaseFilesQuery) { + return defHttp.get({ url: '/productManagement/ContractualCaseFiles/list', params }); +} + +/** + * 导出合同案例文件列表 + * @param params + * @returns + */ +export function ContractualCaseFilesExport(params?: ContractualCaseFilesQuery) { + return commonExport('/productManagement/ContractualCaseFiles/export', params ?? {}); +} + +/** + * 查询合同案例文件详细 + * @param id id + * @returns + */ +export function ContractualCaseFilesInfo(id: ID) { + return defHttp.get({ url: '/productManagement/ContractualCaseFiles/' + id }); +} + +/** + * 新增合同案例文件 + * @param data + * @returns + */ +export function ContractualCaseFilesAdd(data: ContractualCaseFilesForm) { + return defHttp.postWithMsg({ url: '/productManagement/ContractualCaseFiles', data }); +} + +/** + * 更新合同案例文件 + * @param data + * @returns + */ +export function ContractualCaseFilesUpdate(data: ContractualCaseFilesForm) { + return defHttp.putWithMsg({ url: '/productManagement/ContractualCaseFiles', data }); +} + +/** + * 更新合同案例文件状态 + * @param id 主键 + * @param status 状态 + * @returns + */ +export function ContractualCaseFilesUpdateStatus(id: ID, status: string) { + return defHttp.putWithMsg({ + url: '/productManagement/ContractualCaseFiles/updateStatus', + data: { id, isEffective: status } + }); +} + +/** + * 删除合同案例文件 + * @param id id + * @returns + */ +export function ContractualCaseFilesRemove(id: ID | IDS) { + return defHttp.deleteWithMsg({ url: '/productManagement/ContractualCaseFiles/' + id },); +} + +/** + * 获取案例条款列表 + * @param id 案例文件ID + * @returns + */ +export function ContractualCaseFilesArticles(id: ID) { + return defHttp.get({ url: '/productManagement/ContractualCaseFiles/articles/' + id }); +} + +/** + * 生成案例PDF文档(查看详情) + * @param id 案例文件ID + * @returns PDF响应数据 + */ +export function ContractualCaseFilesViewPdf(id: ID) { + return defHttp.get( + { + url: '/productManagement/ContractualCaseFiles/view/' + id, + responseType: 'blob', + timeout: 1000 * 60 * 10, + headers: { + Accept: 'application/pdf', + } + }, + { isReturnNativeResponse: true } + ); +} \ No newline at end of file diff --git a/src/api/contractReview/ContractualCaseFiles/model.ts b/src/api/contractReview/ContractualCaseFiles/model.ts new file mode 100644 index 0000000..a3f819c --- /dev/null +++ b/src/api/contractReview/ContractualCaseFiles/model.ts @@ -0,0 +1,76 @@ +import type { BaseEntity, PageQuery } from '@/api/base'; + +export interface ContractualCaseFilesVO extends BaseEntity { + /** 主键ID */ + id?: string | number; + + /** 案例名称 */ + caseName?: string; + + /** 案例描述 */ + caseDescription?: string; + + /** 案例类型 */ + caseType?: string; + + /** 发布日期 */ + publishDate?: string; + + /** 是否有效(Y:有效 N:无效) */ + isEffective?: string; + + /** 处理状态 */ + progressStatus?: string; + + /** OSS文件ID */ + ossId?: string | number; +} + +export interface ContractualCaseFilesForm extends BaseEntity { + /** 主键ID */ + id?: string | number; + + /** 案例名称 */ + caseName?: string; + + /** 案例描述 */ + caseDescription?: string; + + /** 案例类型 */ + caseType?: string; + + /** 发布日期 */ + publishDate?: string; + + /** 是否有效(Y:有效 N:无效) */ + isEffective?: string; + + /** 处理状态 */ + progressStatus?: string; + + /** OSS文件ID */ + ossId?: string | number; +} + +export interface ContractualCaseFilesQuery extends PageQuery { + /** 案例名称 */ + caseName?: string; + + /** 案例类型 */ + caseType?: string; + + /** 发布日期 */ + publishDate?: string; + + /** 日期范围查询-开始日期 */ + publishDateStart?: string; + + /** 日期范围查询-结束日期 */ + publishDateEnd?: string; + + /** 是否有效(Y:有效 N:无效) */ + isEffective?: string; + + /** 处理状态 */ + progressStatus?: string; +} \ No newline at end of file diff --git a/src/api/contractReview/ContractualRegulationNames/index.ts b/src/api/contractReview/ContractualRegulationNames/index.ts new file mode 100644 index 0000000..c7eb04c --- /dev/null +++ b/src/api/contractReview/ContractualRegulationNames/index.ts @@ -0,0 +1,98 @@ +import { defHttp } from '@/utils/http/axios'; +import { ID, IDS, commonExport } from '@/api/base'; +import { ContractualRegulationNamesVO, ContractualRegulationNamesForm, ContractualRegulationNamesQuery } from './model'; + +/** + * 查询合同法规名称列表 + * @param params + * @returns + */ +export function ContractualRegulationNamesList(params?: ContractualRegulationNamesQuery) { + return defHttp.get({ url: '/productManagement/ContractualRegulationNames/list', params }); +} + +/** + * 导出合同法规名称列表 + * @param params + * @returns + */ +export function ContractualRegulationNamesExport(params?: ContractualRegulationNamesQuery) { + return commonExport('/productManagement/ContractualRegulationNames/export', params ?? {}); +} + +/** + * 查询合同法规名称详细 + * @param id id + * @returns + */ +export function ContractualRegulationNamesInfo(id: ID) { + return defHttp.get({ url: '/productManagement/ContractualRegulationNames/' + id }); +} + +/** + * 新增合同法规名称 + * @param data + * @returns + */ +export function ContractualRegulationNamesAdd(data: ContractualRegulationNamesForm) { + return defHttp.postWithMsg({ url: '/productManagement/ContractualRegulationNames', data }); +} + +/** + * 更新合同法规名称 + * @param data + * @returns + */ +export function ContractualRegulationNamesUpdate(data: ContractualRegulationNamesForm) { + return defHttp.putWithMsg({ url: '/productManagement/ContractualRegulationNames', data }); +} + +/** + * 更新合同法规名称状态 + * @param id 主键 + * @param status 状态 + * @returns + */ +export function ContractualRegulationNamesUpdateStatus(id: ID, status: string) { + return defHttp.putWithMsg({ + url: '/productManagement/ContractualRegulationNames/updateStatus', + data: { id, isEffective: status } + }); +} + +/** + * 删除合同法规名称 + * @param id id + * @returns + */ +export function ContractualRegulationNamesRemove(id: ID | IDS) { + return defHttp.deleteWithMsg({ url: '/productManagement/ContractualRegulationNames/' + id },); +} + +/** + * 获取法规条款列表 + * @param id 法规ID + * @returns + */ +export function ContractualRegulationNamesArticles(id: ID) { + return defHttp.get({ url: '/productManagement/ContractualRegulationNames/articles/' + id }); +} + +/** + * 生成法规PDF文档(查看详情) + * @param id 法规ID + * @returns PDF响应数据 + */ +export function ContractualRegulationNamesViewPdf(id: ID) { + return defHttp.get( + { + url: '/productManagement/ContractualRegulationNames/view/' + id, + responseType: 'blob', + timeout: 1000 * 60 * 10, + headers: { + Accept: 'application/pdf', + } + }, + { isReturnNativeResponse: true } + ); +} diff --git a/src/api/contractReview/ContractualRegulationNames/model.ts b/src/api/contractReview/ContractualRegulationNames/model.ts new file mode 100644 index 0000000..0ea6a85 --- /dev/null +++ b/src/api/contractReview/ContractualRegulationNames/model.ts @@ -0,0 +1,98 @@ +import { BaseEntity, PageQuery } from '@/api/base'; + +export interface ContractualRegulationNamesVO { + /** + * 主键ID + */ + id: string | number; + + /** + * 法规名称 + */ + regulationName: string; + + /** + * 法规描述 + */ + regulationDescription: string; + + /** + * 发布日期 + */ + publishDate: string; + + /** + * 是否有效(Y:有效 N:无效) + */ + isEffective: string; + + /** + * 当前状态 + */ + progressStatus?: string; + + /** + * OSS文件ID + */ + ossId?: string | number; +} + +export interface ContractualRegulationNamesForm extends BaseEntity { + /** + * 主键ID + */ + id?: string | number; + + /** + * 法规名称 + */ + regulationName?: string; + + /** + * 法规描述 + */ + regulationDescription?: string; + + /** + * 发布日期 + */ + publishDate?: string; + + /** + * 是否有效(Y:有效 N:无效) + */ + isEffective?: string; + + /** + * 当前状态 + */ + progressStatus?: string; + + /** + * OSS文件ID + */ + ossId?: string | number; +} + +export interface ContractualRegulationNamesQuery extends PageQuery { + + /** + * 法规名称 + */ + regulationName?: string; + + /** + * 发布日期 + */ + publishDate?: string; + + /** + * 是否有效(Y:有效 N:无效) + */ + isEffective?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/src/api/contractReview/ContractualTaskResults/index.ts b/src/api/contractReview/ContractualTaskResults/index.ts new file mode 100644 index 0000000..2687239 --- /dev/null +++ b/src/api/contractReview/ContractualTaskResults/index.ts @@ -0,0 +1,133 @@ +import { defHttp } from '@/utils/http/axios'; +import { ID, IDS } from '@/api/base'; +import { ContractualTaskResultDetailVO } from './model'; +import { message } from 'ant-design-vue'; + +/** + * 通用文件下载函数 + * @param url 下载地址 + * @param onError 错误处理回调 + * @returns Promise 下载是否成功 + */ +export async function useDownload( + url: string, + onError?: (error: any) => void +): Promise { + try { + const response = await defHttp.get( + { + url, + responseType: 'blob', + timeout: 60000, // 设置较长的超时时间 + }, + { + isReturnNativeResponse: true, + // 自定义错误处理 + errorMessageMode: 'none', + } + ); + + // 检查响应类型 + const contentType = response.headers['content-type']; + if (contentType && contentType.includes('application/json')) { + // 如果返回的是JSON(通常是错误信息),转换并抛出 + const reader = new FileReader(); + reader.onload = () => { + const error = JSON.parse(reader.result as string); + message.error(error.message || '下载失败'); + onError?.(error); + }; + reader.readAsText(response.data); + return false; + } + + // 获取文件名 + const contentDisposition = response.headers['content-disposition']; + let fileName = ''; + + if (contentDisposition) { + const matches = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/); + if (matches && matches[1]) { + fileName = decodeURIComponent(matches[1].replace(/['"]/g, '')); + } + } + + // 创建Blob对象 + const blob = new Blob([response.data], { + type: contentType || 'application/octet-stream' + }); + + if ((window.navigator as any).msSaveOrOpenBlob) { + // 针对IE的处理 + (window.navigator as any).msSaveOrOpenBlob(blob, fileName); + } else { + // 现代浏览器的处理 + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = fileName; + link.style.display = 'none'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + } + + return true; + } catch (error: any) { + console.error('下载失败:', error); + message.error(error.message || '下载失败,请稍后重试'); + onError?.(error); + return false; + } +} + +/** + * 根据任务id查询详细分类的合同任务结果 + * @param taskId 任务ID + * @returns 详细的合同任务结果列表 + */ +export function getDetailResultsByTaskId(taskId: ID) { + return defHttp.get({ url: '/productManagement/ContractualTaskResults/taskDetail/' + taskId }); +} + +/** + * 下载合同任务结果 + * @param id id + * @returns + */ +export function ContractualTaskResultDownload(id: ID | IDS) { + return useDownload(`/productManagement/ContractualTaskResults/downloadResult/${id}`); +} + +/** + * 获取合同任务PDF文件流 + * @param taskId 任务ID + * @returns Promise + */ +export function getPdfStream(taskId: ID): Promise { + return defHttp.get( + { + url: `/productManagement/ContractualTaskResults/getPdfStream/${taskId}`, + responseType: 'blob', + timeout:600000 + }, + { + isReturnNativeResponse: true, + errorMessageMode: 'none', + } + ).then(response => response.data); +} + +/** + * 更新合同任务结果项的状态(已读/采纳) + * @param id 结果项ID + * @param field 字段名(isRead/isAdopted) + * @param value 值(0/1) + * @returns + */ +export function updateResultItemStatus(id: ID, field: 'isRead' | 'isAdopted', value: '0' | '1') { + return defHttp.putWithMsg({ + url: `/productManagement/ContractualTaskResults/updateResultItemStatus/${id}/${field}/${value}` + }); +} \ No newline at end of file diff --git a/src/api/contractReview/ContractualTaskResults/model.ts b/src/api/contractReview/ContractualTaskResults/model.ts new file mode 100644 index 0000000..616bb6a --- /dev/null +++ b/src/api/contractReview/ContractualTaskResults/model.ts @@ -0,0 +1,99 @@ +import { BaseEntity, PageQuery } from '@/api/base'; + +export interface ContractualTaskResultsVO { + /** + * 任务结果 + */ + result?: string; +} + +export interface ContractualTaskResultDetailVO { + /** + * 分类名称 + */ + name: string; + /** + * 结果列表 + */ + results: { + /** + * 唯一标识ID + */ + id?: string; + /** + * 序号 + */ + serialNumber?: number; + /** + * 问题点名称 + */ + issueName?: string; + /** + * 原文 + */ + originalText?: string; + /** + * 比对原文 + */ + comparedText?: string; + /** + * 修改后的内容 + */ + modifiedContent?: string; + /** + * 展示修改情况 + */ + modificationDisplay?: string; + /** + * 存在的问题 + */ + existingIssues?: string; + /** + * 审查依据 + */ + reviewBasis?: { + /** + * 审查内容 + */ + reviewContent?: string; + /** + * 审查点 + */ + reviewPoints?: string[]; + }; + /** + * 是否已读 + */ + isRead?: string; + /** + * 是否采纳 + */ + isAdopted?: string; + }[]; +} + +export interface ContractualTaskResultsForm extends BaseEntity { +} + +export interface ContractualTaskResultsQuery extends PageQuery { + + /** + * id + */ + id?: string | number; + + /** + * 任务id + */ + contractualTaskId?: string | number; + + /** + * 任务结果 + */ + result?: string; + + /** + * 日期范围参数 + */ + params?: any; +} \ No newline at end of file diff --git a/src/api/contractReview/ContractualTasks/index.ts b/src/api/contractReview/ContractualTasks/index.ts index 5cd87d7..afa91f3 100644 --- a/src/api/contractReview/ContractualTasks/index.ts +++ b/src/api/contractReview/ContractualTasks/index.ts @@ -1,6 +1,6 @@ import { defHttp } from '@/utils/http/axios'; import { ID, IDS, commonExport } from '@/api/base'; -import { ContractualTasksVO, ContractualTasksForm, ContractualTasksQuery } from './model'; +import { ContractualTasksVO, ContractualTasksForm, ContractualTasksQuery, StartContractReviewRequest } from './model'; /** * 查询合同任务列表 @@ -64,3 +64,15 @@ export function ContractualTasksRemove(id: ID | IDS) { export function AnalyzeContract(ossId: string) { return defHttp.get({ url: '/productManagement/ContractualTasks/analyzeContract', params: { ossId } }); } + + +export function StartReview(data: StartContractReviewRequest) { + return defHttp.postWithMsg({ + url: '/productManagement/ContractualTasks/startReview', + data, + timeout: 300000 // 5分钟超时,因为可能需要等待Python处理 + }); +} + +// 导出类型定义 +export type { StartContractReviewRequest } from './model'; diff --git a/src/api/contractReview/ContractualTasks/model.ts b/src/api/contractReview/ContractualTasks/model.ts index beee4fb..a253126 100644 --- a/src/api/contractReview/ContractualTasks/model.ts +++ b/src/api/contractReview/ContractualTasks/model.ts @@ -113,3 +113,114 @@ export interface ContractualTasksQuery extends PageQuery { */ params?: any; } +/** + * 启动合同审查 + * @param data 审查配置数据 + * @returns + */ +export interface StartContractReviewRequest { + ossId: string; + reviewTypes: string[]; + reviewData: ReviewData; + visitedTabs: string[]; +} + +/** + * 审查数据结构 + */ +export interface ReviewData { + /** + * 实质性审查数据 + */ + substantive?: SubstantiveData; + + /** + * 合规性审查数据 + */ + compliance?: ComplianceData; + + /** + * 一致性审查数据 + */ + consistency?: ConsistencyData; +} + +/** + * 实质性审查数据 + */ +export interface SubstantiveData { + /** + * 合同类型ID列表 + */ + contractTypeIds?: string[]; + + /** + * 审查立场/视角 + */ + position?: string; + + /** + * 审查类型 + */ + reviewType?: string; + + /** + * 特别说明 + */ + specialNote?: string; +} + +/** + * 合规性审查数据 + */ +export interface ComplianceData { + /** + * 关注要点 + */ + focusPoints?: string[]; + + /** + * 行业类型 + */ + industry?: string; + + /** + * 合规级别 + */ + level?: string; + + /** + * 适用法规列表 + */ + regulations?: string[]; + + /** + * 审查类型 + */ + type?: string; +} + +/** + * 一致性审查数据 + */ +export interface ConsistencyData { + /** + * 文件类型 + */ + fileTypes?: string[]; + + /** + * 检查维度 + */ + dimensions?: string[]; + + /** + * 偏差级别 + */ + deviationLevel?: string; + + /** + * 特别说明 + */ + specialNote?: string; +} \ No newline at end of file diff --git a/src/api/documentReview/DocumentTaskResults/index.ts b/src/api/documentReview/DocumentTaskResults/index.ts index 8059cb5..88523f5 100644 --- a/src/api/documentReview/DocumentTaskResults/index.ts +++ b/src/api/documentReview/DocumentTaskResults/index.ts @@ -114,14 +114,7 @@ export function DocumentTaskResultsInfo(id: ID) { return defHttp.get({ url: '/productManagement/DocumentTaskResults/' + id }); } -/** - * 根据任务id查询文档任务结果详细 - * @param id id - * @returns - */ -export function DocumentTaskResultsInfoByTaskId(id: ID) { - return defHttp.get({ url: '/productManagement/DocumentTaskResults/task/' + id }); -} + /** * 根据任务id查询详细分类的文档任务结果 diff --git a/src/assets/images/markup-logo.svg b/src/assets/images/markup-logo.svg deleted file mode 100644 index fc0dbdf..0000000 --- a/src/assets/images/markup-logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/contractReview/ContractualCaseFiles/AddModal.vue b/src/views/contractReview/ContractualCaseFiles/AddModal.vue new file mode 100644 index 0000000..4d813f4 --- /dev/null +++ b/src/views/contractReview/ContractualCaseFiles/AddModal.vue @@ -0,0 +1,497 @@ +