From dde919231fc1b9ba3f138296aee83317f19e7def Mon Sep 17 00:00:00 2001 From: zhouhaibin Date: Thu, 12 Jun 2025 16:19:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=88=E5=90=8C=E5=AE=A1?= =?UTF-8?q?=E6=9F=A5=E7=9A=84=E4=BC=98=E5=8C=96=E5=92=8C=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E7=9A=84=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContractualRegulationNames/index.ts | 8 + .../ContractualTaskResults/index.ts | 19 + .../contractReview/ContractualTasks/model.ts | 62 +- src/components/Preview/index.ts | 1 + .../src/PdfPreview}/PageSelectModal.vue | 38 +- .../src/PdfPreview/PdfPreviewComponent.vue | 499 ++++++ .../src/PdfPreview/ReviewPdfContainer.vue | 247 +++ .../Preview/src/PdfPreview/index.ts | 2 + src/components/UniversalResultDrawer.vue | 1344 +++++++++++++++++ src/configs/contractTaskConfigs.ts | 166 ++ src/configs/documentTaskConfigs.ts | 229 +++ src/configs/taskConfigTypes.ts | 65 + src/configs/taskConfigs.ts | 68 + src/configs/universalTaskConfigs.ts | 405 +++++ .../ContractualResultDetailDrawer.vue | 1069 +------------ .../ContractualTasks/ContractualTasks.data.ts | 64 +- .../components/ComplianceContent.vue | 382 ++--- .../components/ConsistencyContent.vue | 4 +- .../components/InferenceReview.vue | 14 +- .../configs/reviewTypeConfigs.ts | 190 +++ .../contractReview/ContractualTasks/index.vue | 22 +- .../contractReview/ContractualTasks/list.vue | 20 +- .../DocumentTasks/ResultDetailDrawer.vue | 1006 +----------- 23 files changed, 3601 insertions(+), 2323 deletions(-) rename src/{views/documentReview/DocumentTasks => components/Preview/src/PdfPreview}/PageSelectModal.vue (59%) create mode 100644 src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue create mode 100644 src/components/Preview/src/PdfPreview/ReviewPdfContainer.vue create mode 100644 src/components/Preview/src/PdfPreview/index.ts create mode 100644 src/components/UniversalResultDrawer.vue create mode 100644 src/configs/contractTaskConfigs.ts create mode 100644 src/configs/documentTaskConfigs.ts create mode 100644 src/configs/taskConfigTypes.ts create mode 100644 src/configs/taskConfigs.ts create mode 100644 src/configs/universalTaskConfigs.ts create mode 100644 src/views/contractReview/ContractualTasks/configs/reviewTypeConfigs.ts diff --git a/src/api/contractReview/ContractualRegulationNames/index.ts b/src/api/contractReview/ContractualRegulationNames/index.ts index c7eb04c..941d8d6 100644 --- a/src/api/contractReview/ContractualRegulationNames/index.ts +++ b/src/api/contractReview/ContractualRegulationNames/index.ts @@ -96,3 +96,11 @@ export function ContractualRegulationNamesViewPdf(id: ID) { { isReturnNativeResponse: true } ); } + +/** + * 获取有效法规名称列表(用于合规性审查) + * @returns + */ +export function ContractualRegulationNamesEffectiveList() { + return defHttp.get({ url: '/productManagement/ContractualRegulationNames/effective/list' }); +} diff --git a/src/api/contractReview/ContractualTaskResults/index.ts b/src/api/contractReview/ContractualTaskResults/index.ts index 2687239..5658d08 100644 --- a/src/api/contractReview/ContractualTaskResults/index.ts +++ b/src/api/contractReview/ContractualTaskResults/index.ts @@ -119,6 +119,25 @@ export function getPdfStream(taskId: ID): Promise { ).then(response => response.data); } +/** + * 获取招投标文件PDF文件流 + * @param taskId 任务ID + * @returns Promise + */ +export function getBidPdfStream(taskId: ID): Promise { + return defHttp.get( + { + url: `/productManagement/ContractualTaskResults/getBidPdfStream/${taskId}`, + responseType: 'blob', + timeout:600000 + }, + { + isReturnNativeResponse: true, + errorMessageMode: 'none', + } + ).then(response => response.data); +} + /** * 更新合同任务结果项的状态(已读/采纳) * @param id 结果项ID diff --git a/src/api/contractReview/ContractualTasks/model.ts b/src/api/contractReview/ContractualTasks/model.ts index a253126..2b8515d 100644 --- a/src/api/contractReview/ContractualTasks/model.ts +++ b/src/api/contractReview/ContractualTasks/model.ts @@ -6,16 +6,6 @@ export interface ContractualTasksVO { */ id: string | number; - /** - * 模型所属行业 - */ - taskIndustry: string; - - /** - * 模型所属区域 - */ - taskRegion: string; - /** * 合同任务名称 */ @@ -36,6 +26,11 @@ export interface ContractualTasksVO { */ progressStatus: string; + /** + * 审查类型(实质性审查,合规性审查,一致性审查) + */ + reviewTypes: string; + } export interface ContractualTasksForm extends BaseEntity { @@ -44,16 +39,6 @@ export interface ContractualTasksForm extends BaseEntity { */ id?: string | number; - /** - * 模型所属行业 - */ - taskIndustry?: string; - - /** - * 模型所属区域 - */ - taskRegion?: string; - /** * 合同任务名称 */ @@ -74,19 +59,14 @@ export interface ContractualTasksForm extends BaseEntity { */ progressStatus?: string; -} - -export interface ContractualTasksQuery extends PageQuery { - /** - * 模型所属行业 + * 审查类型(实质性审查,合规性审查,一致性审查) */ - taskIndustry?: string; + reviewTypes?: string; - /** - * 模型所属区域 - */ - taskRegion?: string; +} + +export interface ContractualTasksQuery extends PageQuery { /** * 合同任务名称 @@ -108,6 +88,11 @@ export interface ContractualTasksQuery extends PageQuery { */ progressStatus?: string; + /** + * 审查类型(实质性审查,合规性审查,一致性审查) + */ + reviewTypes?: string; + /** * 日期范围参数 */ @@ -175,24 +160,19 @@ export interface SubstantiveData { */ export interface ComplianceData { /** - * 关注要点 - */ - focusPoints?: string[]; - - /** - * 行业类型 + * 法规检查方式(ai: AI自动选择, manual: 人工选择法规) */ - industry?: string; + regulationMethod?: string; /** - * 合规级别 + * 选择的法规名称ID列表(当regulationMethod为manual时使用) */ - level?: string; + regulationIds?: string[]; /** - * 适用法规列表 + * 特别说明 */ - regulations?: string[]; + specialNote?: string; /** * 审查类型 diff --git a/src/components/Preview/index.ts b/src/components/Preview/index.ts index c0b4685..bc7e0c5 100644 --- a/src/components/Preview/index.ts +++ b/src/components/Preview/index.ts @@ -1,2 +1,3 @@ export { default as ImagePreview } from './src/Preview.vue'; export { createImgPreview } from './src/functional'; +export { PdfPreviewComponent, PageSelectModal } from './src/PdfPreview'; diff --git a/src/views/documentReview/DocumentTasks/PageSelectModal.vue b/src/components/Preview/src/PdfPreview/PageSelectModal.vue similarity index 59% rename from src/views/documentReview/DocumentTasks/PageSelectModal.vue rename to src/components/Preview/src/PdfPreview/PageSelectModal.vue index 05df9f8..2aebb5f 100644 --- a/src/views/documentReview/DocumentTasks/PageSelectModal.vue +++ b/src/components/Preview/src/PdfPreview/PageSelectModal.vue @@ -2,11 +2,11 @@

该文本在以下页面出现:

@@ -27,19 +27,31 @@ \ No newline at end of file diff --git a/src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue b/src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue new file mode 100644 index 0000000..7fc5c99 --- /dev/null +++ b/src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue @@ -0,0 +1,499 @@ + + + + + \ No newline at end of file diff --git a/src/components/Preview/src/PdfPreview/ReviewPdfContainer.vue b/src/components/Preview/src/PdfPreview/ReviewPdfContainer.vue new file mode 100644 index 0000000..58dafce --- /dev/null +++ b/src/components/Preview/src/PdfPreview/ReviewPdfContainer.vue @@ -0,0 +1,247 @@ + + + + + \ No newline at end of file diff --git a/src/components/Preview/src/PdfPreview/index.ts b/src/components/Preview/src/PdfPreview/index.ts new file mode 100644 index 0000000..60b2cfd --- /dev/null +++ b/src/components/Preview/src/PdfPreview/index.ts @@ -0,0 +1,2 @@ +export { default as PdfPreviewComponent } from './PdfPreviewComponent.vue'; +export { default as PageSelectModal } from './PageSelectModal.vue'; \ No newline at end of file diff --git a/src/components/UniversalResultDrawer.vue b/src/components/UniversalResultDrawer.vue new file mode 100644 index 0000000..da4be56 --- /dev/null +++ b/src/components/UniversalResultDrawer.vue @@ -0,0 +1,1344 @@ + + + + + \ No newline at end of file diff --git a/src/configs/contractTaskConfigs.ts b/src/configs/contractTaskConfigs.ts new file mode 100644 index 0000000..e522012 --- /dev/null +++ b/src/configs/contractTaskConfigs.ts @@ -0,0 +1,166 @@ +// 合同审核任务配置文件 + +import type { TaskConfig } from './taskConfigTypes'; + +// 合同审核任务配置 +export const CONTRACT_TASK_CONFIGS: Record = { + // 合同审核(多标签模式) + "contractReview": { + taskType: "contractReview", + name: "合同审核", + mode: "tabs", + pdfConfig: { + layout: "split", + sources: [ + { id: "contract", title: "合同文件", apiField: "id" }, + { id: "bid", title: "招标文件", apiField: "id" } + ] + }, + tabs: [ + { + key: "substantive", + label: "实质性审查", + pdfConfig: { + layout: "single", + sources: [ + { id: "contract", title: "合同文件", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true, + comparisonConfig: { + comparisonField: 'modificationDisplay', + comparisonTitle: '修改情况展示', + showButton: true + } + }, + { + field: 'reviewBasis', + title: '审查依据', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['review_points','review_content'], + separator: ':' + } + } + ] + }, + { + key: "compliance", + label: "合规性审查", + pdfConfig: { + layout: "single", + sources: [ + { id: "contract", title: "合同文件", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + // { + // field: 'existingIssues', + // title: '合规性问题', + // dataType: 'string', + // displayType: 'markdown' + // }, + // { + // field: 'modifiedContent', + // title: '修改建议', + // dataType: 'string', + // displayType: 'markdown', + // showComparison: true, + // comparisonConfig: { + // comparisonField: 'modificationDisplay', + // comparisonTitle: '修改情况展示', + // showButton: true + // } + // }, + { + field: 'reviewBasis', + title: '法规依据', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['review_points'], + separator: ':', + fieldProcessors: { + 'review_points': (value) => Array.isArray(value) ? value.join('\n') : value + } + } + } + ] + }, + { + key: "consistency", + label: "一致性审查", + pdfConfig: { + layout: "split", + sources: [ + { id: "contract", title: "合同文件", apiField: "id" }, + { id: "bid", title: "招标文件", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '合同原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + { + field: 'comparedText', + title: '招标文件对应内容', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'bid', + required: true + }, + // { + // field: 'modifiedContent', + // title: '修改建议', + // dataType: 'string', + // displayType: 'markdown', + // showComparison: true, + // comparisonConfig: { + // comparisonField: 'modificationDisplay', + // comparisonTitle: '修改情况展示', + // showButton: true + // } + // } + ] + } + ] + } +}; + +// 获取合同任务配置 +export function getContractTaskConfig(taskType: string): TaskConfig | null { + return CONTRACT_TASK_CONFIGS[taskType] || null; +} + +// 获取所有合同任务配置 +export function getAllContractTaskConfigs(): TaskConfig[] { + return Object.values(CONTRACT_TASK_CONFIGS); +} \ No newline at end of file diff --git a/src/configs/documentTaskConfigs.ts b/src/configs/documentTaskConfigs.ts new file mode 100644 index 0000000..0cf749f --- /dev/null +++ b/src/configs/documentTaskConfigs.ts @@ -0,0 +1,229 @@ +// 文档审核任务配置文件 + +import type { TaskConfig } from './taskConfigTypes'; + +// 文档审核任务配置 +export const DOCUMENT_TASK_CONFIGS: Record = { + // 文档错误检查 + "checkDocumentError": { + taskType: "checkDocumentError", + name: "文档错误检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document', + required: true + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true, + comparisonConfig: { + comparisonField: 'modificationDisplay', + comparisonTitle: '修改情况展示', + showButton: true + } + }, + // { + // field: 'modificationDisplay', + // title: '修改情况', + // dataType: 'string', + // displayType: 'markdown' + // } + ] + }, + + // 重复文本检查 + "checkRepeatText": { + taskType: "checkRepeatText", + name: "重复文本检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '第一段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'comparedText', + title: '第二段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'modificationDisplay', + title: '相似情况', + dataType: 'string', + displayType: 'markdown' + } + ] + }, + + // 全文重复检查 + "allCheckRepeatText": { + taskType: "allCheckRepeatText", + name: "全文重复检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '第一段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'comparedText', + title: '第二段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'modificationDisplay', + title: '相似情况', + dataType: 'string', + displayType: 'markdown' + } + ] + }, + + // 公司名称检查 + "checkCompanyName": { + taskType: "checkCompanyName", + name: "公司名称检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 标题名称检查 + "checkTitleName": { + taskType: "checkTitleName", + name: "标题名称检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 地名检查 + "checkPlaceName": { + taskType: "checkPlaceName", + name: "地名检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 政策依据检查 + "policyBases": { + taskType: "policyBases", + name: "政策依据检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '系统名称', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document', + + }, + { + field: 'reviewBasis', + title: '系统描述', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['review_points', 'review_content'], + separator: ':', + fieldProcessors: { + 'review_points': (value) => Array.isArray(value) ? value[0] : value + } + } + } + ] + } +}; + +// 获取文档任务配置 +export function getDocumentTaskConfig(taskType: string): TaskConfig | null { + return DOCUMENT_TASK_CONFIGS[taskType] || null; +} + +// 获取所有文档任务配置 +export function getAllDocumentTaskConfigs(): TaskConfig[] { + return Object.values(DOCUMENT_TASK_CONFIGS); +} \ No newline at end of file diff --git a/src/configs/taskConfigTypes.ts b/src/configs/taskConfigTypes.ts new file mode 100644 index 0000000..17d3eff --- /dev/null +++ b/src/configs/taskConfigTypes.ts @@ -0,0 +1,65 @@ +// 任务配置类型定义 + +// 基础接口定义 +export interface FieldConfig { + field: string; // 数据字段名 + title: string; // 显示标题 + dataType: 'string' | 'json' | 'number' | 'array'; // 数据类型 + displayType: 'markdown' | 'text' | 'html'; // 前端展示类型 + required?: boolean; + pdfSource?: 'contract' | 'bid' | 'document' | 'auto'; // PDF源 + displayCondition?: (item: any) => boolean; + showComparison?: boolean; // 显示对比按钮 + + // 对比配置 + comparisonConfig?: { + comparisonField: string; // 对比数据字段名,默认为 modificationDisplay + comparisonTitle?: string; // 对比内容的标题,默认为 '修改情况展示' + showButton?: boolean; // 是否显示对比按钮,默认为 true + }; + + // JSON数据类型的配置 + jsonConfig?: { + extractFields: string[]; + separator?: string; + fieldLabels?: Record; + fieldProcessors?: Record string>; + }; +} + +export interface PdfSourceConfig { + id: string; + title: string; + apiField: string; +} + +export interface PdfConfig { + layout: 'single' | 'split'; + sources: PdfSourceConfig[]; +} + +export interface TabConfig { + key: string; + label: string; + fields: FieldConfig[]; + displayCondition?: (data: any) => boolean; + pdfConfig?: PdfConfig; // 每个tab可以有自己的PDF配置 +} + +export interface TaskConfig { + taskType: string; // 任务类型标识 + name: string; // 任务显示名称 + mode: 'single' | 'tabs'; // 展示模式:单一内容或多标签 + + // PDF配置 + pdfConfig?: PdfConfig; + + // 单一模式配置 + fields?: FieldConfig[]; + + // 多标签模式配置 + tabs?: TabConfig[]; + + // 全局显示条件 + displayCondition?: (taskInfo: any, data: any) => boolean; +} \ No newline at end of file diff --git a/src/configs/taskConfigs.ts b/src/configs/taskConfigs.ts new file mode 100644 index 0000000..2aba4ef --- /dev/null +++ b/src/configs/taskConfigs.ts @@ -0,0 +1,68 @@ +// 统一任务配置入口文件 + +import type { TaskConfig, FieldConfig } from './taskConfigTypes'; +import { DOCUMENT_TASK_CONFIGS, getDocumentTaskConfig } from './documentTaskConfigs'; +import { CONTRACT_TASK_CONFIGS, getContractTaskConfig } from './contractTaskConfigs'; + +// 合并所有任务配置 +const ALL_TASK_CONFIGS: Record = { + ...DOCUMENT_TASK_CONFIGS, + ...CONTRACT_TASK_CONFIGS +}; + +// 统一的获取任务配置函数 +export function getTaskConfig(taskType: string): TaskConfig | null { + // 首先尝试从文档任务配置中获取 + let config = getDocumentTaskConfig(taskType); + if (config) return config; + + // 然后尝试从合同任务配置中获取 + config = getContractTaskConfig(taskType); + if (config) return config; + + return null; +} + +// 获取所有可用配置 +export function getAvailableConfigs(): TaskConfig[] { + return Object.values(ALL_TASK_CONFIGS); +} + +// 检查字段是否应该显示对比按钮 +export function shouldShowComparison(fieldConfig: FieldConfig, item: any): boolean { + if (!fieldConfig.showComparison) return false; + + // 获取对比字段名,默认为 modificationDisplay + const comparisonField = fieldConfig.comparisonConfig?.comparisonField || 'modificationDisplay'; + + // 检查对比字段是否有内容 + return !!(item[comparisonField] && item[comparisonField].trim()); +} + +// 获取对比字段名 +export function getComparisonField(fieldConfig: FieldConfig): string { + return fieldConfig.comparisonConfig?.comparisonField || 'modificationDisplay'; +} + +// 获取对比标题 +export function getComparisonTitle(fieldConfig: FieldConfig): string { + return fieldConfig.comparisonConfig?.comparisonTitle || '修改情况展示'; +} + +// 检查是否应该显示对比按钮 +export function shouldShowComparisonButton(fieldConfig: FieldConfig): boolean { + return fieldConfig.comparisonConfig?.showButton !== false; // 默认为true +} + +// 获取字段的PDF源 +export function getFieldPdfSource(fieldConfig: FieldConfig): string | null { + return fieldConfig.pdfSource || null; +} + +// 检查字段是否支持PDF定位 +export function supportsPdfLocation(fieldConfig: FieldConfig): boolean { + return !!(fieldConfig.pdfSource && fieldConfig.pdfSource !== 'auto'); +} + +// 重新导出类型 +export type { TaskConfig, FieldConfig, TabConfig, PdfSourceConfig } from './taskConfigTypes'; \ No newline at end of file diff --git a/src/configs/universalTaskConfigs.ts b/src/configs/universalTaskConfigs.ts new file mode 100644 index 0000000..6764f54 --- /dev/null +++ b/src/configs/universalTaskConfigs.ts @@ -0,0 +1,405 @@ +// 通用任务配置文件 + +// 基础接口定义 +export interface FieldConfig { + field: string; // 数据字段名 + title: string; // 显示标题 + dataType: 'string' | 'json' | 'number' | 'array'; // 数据类型 + displayType: 'markdown' | 'text' | 'html'; // 前端展示类型 + required?: boolean; + pdfSource?: 'contract' | 'bid' | 'document' | 'auto'; // PDF源 + displayCondition?: (item: any) => boolean; + showComparison?: boolean; // 显示对比按钮 + + // JSON数据类型的配置 + jsonConfig?: { + extractFields: string[]; + separator?: string; + fieldLabels?: Record; + fieldProcessors?: Record string>; + }; +} + +export interface PdfSourceConfig { + id: string; + title: string; + apiField: string; +} + +export interface TabConfig { + key: string; + label: string; + fields: FieldConfig[]; + displayCondition?: (data: any) => boolean; +} + +export interface TaskConfig { + taskType: string; // 任务类型标识 + name: string; // 任务显示名称 + mode: 'single' | 'tabs'; // 展示模式:单一内容或多标签 + + // PDF配置 + pdfConfig?: { + layout: 'single' | 'split'; + sources: PdfSourceConfig[]; + }; + + // 单一模式配置 + fields?: FieldConfig[]; + + // 多标签模式配置 + tabs?: TabConfig[]; + + // 全局显示条件 + displayCondition?: (taskInfo: any, data: any) => boolean; +} + +// 配置定义 +export const UNIVERSAL_TASK_CONFIGS: Record = { + // ==================== 文档审核任务配置 ==================== + + // 文档错误检查 + "checkDocumentError": { + taskType: "checkDocumentError", + name: "文档错误检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document', + required: true + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true + }, + { + field: 'modificationDisplay', + title: '修改情况', + dataType: 'string', + displayType: 'markdown' + } + ] + }, + + // 重复文本检查 + "checkRepeatText": { + taskType: "checkRepeatText", + name: "重复文本检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '第一段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'comparedText', + title: '第二段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'modificationDisplay', + title: '相似情况', + dataType: 'string', + displayType: 'markdown' + } + ] + }, + + // 全文重复检查 + "allCheckRepeatText": { + taskType: "allCheckRepeatText", + name: "全文重复检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '第一段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'comparedText', + title: '第二段原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + }, + { + field: 'modificationDisplay', + title: '相似情况', + dataType: 'string', + displayType: 'markdown' + } + ] + }, + + // 公司名称检查 + "checkCompanyName": { + taskType: "checkCompanyName", + name: "公司名称检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 标题名称检查 + "checkTitleName": { + taskType: "checkTitleName", + name: "标题名称检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 地名检查 + "checkPlaceName": { + taskType: "checkPlaceName", + name: "地名检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'modificationDisplay', + title: '相关原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'document' + } + ] + }, + + // 政策依据检查 + "policyBases": { + taskType: "policyBases", + name: "政策依据检查", + mode: "single", + pdfConfig: { + layout: "single", + sources: [ + { id: "document", title: "文档", apiField: "id" } + ] + }, + fields: [ + { + field: 'originalText', + title: '系统名称', + dataType: 'string', + displayType: 'markdown' + }, + { + field: 'reviewBasis', + title: '系统描述', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['reviewPoints', 'review_content'], + separator: ':', + fieldProcessors: { + 'reviewPoints': (value) => Array.isArray(value) ? value[0] : value + } + } + } + ] + }, + + // ==================== 合同审核任务配置 ==================== + + // 合同审核(多标签模式) + "contractReview": { + taskType: "contractReview", + name: "合同审核", + mode: "tabs", + pdfConfig: { + layout: "split", + sources: [ + { id: "contract", title: "合同文件", apiField: "id" }, + { id: "bid", title: "招标文件", apiField: "id" } + ] + }, + tabs: [ + { + key: "substantive", + label: "实质性审查", + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true + }, + { + field: 'reviewBasis', + title: '审查依据', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['reviewContent', 'reviewPoints'], + separator: ':' + } + } + ] + }, + { + key: "compliance", + label: "合规性审查", + fields: [ + { + field: 'originalText', + title: '原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + { + field: 'existingIssues', + title: '合规性问题', + dataType: 'string', + displayType: 'markdown' + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true + }, + { + field: 'reviewBasis', + title: '法规依据', + dataType: 'json', + displayType: 'markdown', + jsonConfig: { + extractFields: ['reviewContent', 'reviewPoints'], + separator: ':' + } + } + ] + }, + { + key: "consistency", + label: "一致性审查", + fields: [ + { + field: 'originalText', + title: '合同原文', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'contract', + required: true + }, + { + field: 'comparedText', + title: '招标文件对应内容', + dataType: 'string', + displayType: 'markdown', + pdfSource: 'bid', + required: true + }, + { + field: 'modifiedContent', + title: '修改建议', + dataType: 'string', + displayType: 'markdown', + showComparison: true + } + ] + } + ] + } +}; + +// 工具函数 +export function getTaskConfig(taskType: string): TaskConfig | null { + return UNIVERSAL_TASK_CONFIGS[taskType] || null; +} + +export function getAvailableConfigs(): TaskConfig[] { + return Object.values(UNIVERSAL_TASK_CONFIGS); +} + +// 检查字段是否应该显示对比按钮 +export function shouldShowComparison(fieldConfig: FieldConfig, item: any): boolean { + return !!(fieldConfig.showComparison && item.modificationDisplay && item.modificationDisplay.trim()); +} + +// 获取字段的PDF源 +export function getFieldPdfSource(fieldConfig: FieldConfig): string | null { + return fieldConfig.pdfSource || null; +} + +// 检查字段是否支持PDF定位 +export function supportsPdfLocation(fieldConfig: FieldConfig): boolean { + return !!(fieldConfig.pdfSource && fieldConfig.pdfSource !== 'auto'); +} \ No newline at end of file diff --git a/src/views/contractReview/ContractualTasks/ContractualResultDetailDrawer.vue b/src/views/contractReview/ContractualTasks/ContractualResultDetailDrawer.vue index d73dbce..7710b88 100644 --- a/src/views/contractReview/ContractualTasks/ContractualResultDetailDrawer.vue +++ b/src/views/contractReview/ContractualTasks/ContractualResultDetailDrawer.vue @@ -1,170 +1,23 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/src/views/contractReview/ContractualTasks/ContractualTasks.data.ts b/src/views/contractReview/ContractualTasks/ContractualTasks.data.ts index f40b82c..521d7c0 100644 --- a/src/views/contractReview/ContractualTasks/ContractualTasks.data.ts +++ b/src/views/contractReview/ContractualTasks/ContractualTasks.data.ts @@ -38,6 +38,11 @@ export const formSchemas: FormSchema[] = [ field: 'documentName', component: 'Input', }, + { + label: '审查类型', + field: 'reviewTypes', + component: 'Input', + }, { label: '状态', field: 'progressStatus', @@ -61,14 +66,25 @@ export const columns: BasicColumn[] = [ dataIndex: 'documentName', }, { - title: '模型所属区域', - dataIndex: 'taskRegion', - customRender: ({ value }) => renderDict(value, 'model_region'), - }, - { - title: '模型所属行业', - dataIndex: 'taskIndustry', - customRender: ({ value }) => renderDict(value, 'model_industry'), + title: '审查类型', + dataIndex: 'reviewTypes', + customRender: ({ value }) => { + if (!value) return '-'; + // 将逗号分隔的字符串转换为更友好的显示格式 + const types = value.split(',').map((type: string) => { + switch (type.trim()) { + case 'substantive': + return '实质性审查'; + case 'compliance': + return '合规性审查'; + case 'consistency': + return '一致性审查'; + default: + return type.trim(); + } + }); + return types.join('、'); + }, }, { title: '审查立场', @@ -95,38 +111,6 @@ export const columns: BasicColumn[] = [ ]; export const modalSchemas: FormSchema[] = [ - { - label: '模型所属区域', - field: 'taskRegion', - required: true, - component: 'Select', - // componentProps: { - // options: taskRegionPermission(), - // defaultValue:"normal", - // }, - componentProps: () => { - const isSuperAdmin = roleList.includes(RoleEnum.SUPER_ADMIN); - let options = getDictOptions('model_region'); - if (!isSuperAdmin) { - // 如果不是超级管理员,移除 label 带有 '#' 的项 - options = options.filter((option) => !option.label.includes('#')); - } - return { - options: options, - defaultValue: 'normal', - }; - }, - }, - { - label: '模型所属行业', - field: 'taskIndustry', - required: true, - component: 'Select', - componentProps: { - options: getDictOptions('model_industry'), - defaultValue: 'normal', - }, - }, { label: '审查立场', field: 'contractPartyRole', diff --git a/src/views/contractReview/ContractualTasks/components/ComplianceContent.vue b/src/views/contractReview/ContractualTasks/components/ComplianceContent.vue index 2ebc5d5..94b3156 100644 --- a/src/views/contractReview/ContractualTasks/components/ComplianceContent.vue +++ b/src/views/contractReview/ContractualTasks/components/ComplianceContent.vue @@ -1,175 +1,191 @@ \ No newline at end of file + \ No newline at end of file