Browse Source

优化功能

hetong_dev
zhouhaibin 3 weeks ago
parent
commit
74351ae487
  1. 391
      public/configs/tenderTaskConfigs.json
  2. 1
      src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue
  3. 13
      src/components/UniversalResultDrawer.vue
  4. 52
      src/utils/encryption/crypto.ts
  5. 13
      src/utils/http/axios/index.ts
  6. 4
      src/views/contractReview/ContractualTasks/ContractualTasks.data.ts

391
public/configs/tenderTaskConfigs.json

@ -1,186 +1,237 @@
{ {
"bidConsistencyReview": { "bidConsistencyReview": {
"taskType": "bidConsistencyReview", "taskType": "bidConsistencyReview",
"name": "投标文件综合分析", "name": "投标文件综合分析",
"mode": "tabs", "mode": "tabs",
"tabs": [ "tabs": [
{ {
"key": "文档元数据", "key": "文档元数据",
"label": "文档元数据", "label": "文档元数据",
"fields": [ "fields": [
{ {
"field": "originalText", "field": "originalText",
"title": "文档名称", "title": "文档名称",
"dataType": "string", "dataType": "string",
"displayType": "markdown", "displayType": "markdown",
"pdfSource": "bid", "pdfSource": "bid",
"required": true "required": true
}, },
{ {
"field": "reviewBasis", "field": "reviewBasis",
"title": "详细元数据信息", "title": "详细元数据信息",
"dataType": "json", "dataType": "json",
"displayType": "markdown", "displayType": "markdown",
"jsonConfig": { "jsonConfig": {
"extractFields": ["review_content", "review_points"], "extractFields": [
"separator": ":", "review_content",
"fieldProcessors": { "review_points"
"review_points": "arrayJoinNewLine" ],
} "separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
} }
} }
] }
}, ]
{ },
"key": "重点关注相似内容", {
"label": "重点关注相似内容", "key": "公司人员信息",
"fields": [ "label": "公司人员信息",
"fields": [
{ {
"field": "reviewBasis", "field": "issueName",
"title": "各文档具体内容", "title": "文档名称",
"dataType": "json", "dataType": "string",
"displayType": "markdown", "displayType": "markdown",
"jsonConfig": { "pdfSource": "bid",
"extractFields": ["review_points"], "required": true
"separator": ":", },
"fieldProcessors": { {
"review_points": "arrayJoinNewLine" "field": "reviewBasis",
} "title": "公司人员信息详情",
}, "dataType": "json",
"showComparison": true, "displayType": "markdown",
"comparisonConfig": { "jsonConfig": {
"comparisonField": "modificationDisplay", "extractFields": [
"comparisonTitle": "修改情况展示", "review_points"
"showButton": true ],
} "separator": ":",
}, "fieldProcessors": {
{ "review_points": "arrayJoinNewLine"
"field": "reviewBasis",
"title": "错别字",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["error_review_points"],
"separator": ":",
"fieldProcessors": {
"error_review_points": "arrayJoinNewLine"
}
} }
} }
] }
}, ]
{ },
"key": "错别字", {
"label": "错别字", "key": "重点关注相似内容",
"fields": [ "label": "重点关注相似内容",
{ "fields": [
"field": "originalText", {
"title": "文档1原文", "field": "reviewBasis",
"dataType": "string", "title": "各文档具体内容",
"displayType": "markdown", "dataType": "json",
"pdfSource": "bid", "displayType": "markdown",
"required": true "jsonConfig": {
}, "extractFields": [
{ "review_points"
"field": "comparedText", ],
"title": "文档2原文", "separator": ":",
"dataType": "string", "fieldProcessors": {
"displayType": "markdown", "review_points": "arrayJoinNewLine"
"pdfSource": "bid", }
"required": true
}, },
"showComparison": true,
{ "comparisonConfig": {
"field": "reviewBasis", "comparisonField": "modificationDisplay",
"title": "错误详情", "comparisonTitle": "修改情况展示",
"dataType": "json", "showButton": true
"displayType": "markdown", }
"jsonConfig": { },
"extractFields": ["review_content", "review_points"], {
"separator": ":", "field": "reviewBasis",
"fieldProcessors": { "title": "错别字",
"review_points": "arrayJoin" "dataType": "json",
} "displayType": "markdown",
"jsonConfig": {
"extractFields": [
"error_review_points"
],
"separator": ":",
"fieldProcessors": {
"error_review_points": "arrayJoinNewLine"
} }
} }
] }
}, ]
{ },
"key": "一般相似内容", {
"label": "一般相似内容", "key": "一般相似内容",
"fields": [ "label": "一般相似内容",
{ "fields": [
"field": "modificationDisplay", {
"title": "涉及文档", "field": "modificationDisplay",
"dataType": "string", "title": "涉及文档",
"displayType": "markdown" "dataType": "string",
}, "displayType": "markdown"
{ },
"field": "reviewBasis", {
"title": "各文档具体内容", "field": "reviewBasis",
"dataType": "json", "title": "各文档具体内容",
"displayType": "markdown", "dataType": "json",
"jsonConfig": { "displayType": "markdown",
"extractFields": ["review_content", "review_points"], "jsonConfig": {
"separator": ":", "extractFields": [
"fieldProcessors": { "review_content",
"review_points": "arrayJoinNewLine" "review_points"
} ],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
} }
} }
] }
]
}
]
},
"tenderComplianceReview": {
"taskType": "tenderComplianceReview",
"name": "招投标文件合规性审核",
"mode": "single",
"pdfConfig": {
"layout": "single",
"sources": [
{
"id": "document",
"title": "投标文件",
"apiField": "id"
} }
] ]
}, },
"tenderComplianceReview": { "fields": [
"taskType": "tenderComplianceReview", {
"name": "招投标合规性审查", "field": "issueName",
"mode": "single", "title": "合规性分类-具体问题(示例:资质审查-业绩要求)",
"fields": [ "dataType": "string",
{ "displayType": "markdown",
"field": "originalText", "pdfSource": "document"
"title": "原文", },
"dataType": "string", {
"displayType": "markdown", "field": "originalText",
"pdfSource": "bid", "title": "原文",
"required": true "dataType": "string",
}, "displayType": "markdown",
{ "pdfSource": "document"
"field": "reviewBasis", },
"title": "审查意见", {
"dataType": "json", "field": "reviewBasis",
"displayType": "markdown", "title": "相关法律法规政策",
"jsonConfig": { "dataType": "json",
"extractFields": ["review_content"], "displayType": "markdown",
"separator": ":" "jsonConfig": {
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
} }
}, }
{ },
"field": "reviewBasis", {
"title": "审查要点", "field": "modifiedContent",
"dataType": "json", "title": "修改建议",
"displayType": "markdown", "dataType": "string",
"jsonConfig": { "displayType": "markdown",
"extractFields": ["review_points"], "pdfSource": "document"
"separator": ":", },
"fieldProcessors": { {
"review_points": "arrayJoinNewLine" "field": "reviewBasis",
} "title": "风险等级(红色预警:直接废标项,橙色风险:可能引发投诉项)",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": [
"risk_level"
],
"separator": ":"
}
}
]
},
"bidImageAnalysis": {
"taskType": "bidImageAnalysis",
"name": "招标文件图片相似度分析",
"mode": "single",
"fields": [
{
"field": "originalText",
"title": "图片1路径",
"dataType": "string",
"displayType": "markdown"
},
{
"field": "comparedText",
"title": "图片2路径",
"dataType": "string",
"displayType": "markdown"
},
{
"field": "reviewBasis",
"title": "页码",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
} }
},
{
"field": "modifiedContent",
"title": "修改建议",
"dataType": "string",
"displayType": "markdown"
},
{
"field": "modificationDisplay",
"title": "修改情况",
"dataType": "string",
"displayType": "markdown"
} }
] }
} ]
} }
}

1
src/components/Preview/src/PdfPreview/PdfPreviewComponent.vue

@ -126,7 +126,6 @@
} }
} catch (error) { } catch (error) {
console.error('加载PDF失败:', error); console.error('加载PDF失败:', error);
message.error('加载PDF失败');
emit('pdfError', error); emit('pdfError', error);
} finally { } finally {
loading.value = false; loading.value = false;

13
src/components/UniversalResultDrawer.vue

@ -1276,7 +1276,7 @@
.item-card { .item-card {
width: 100%; width: 100%;
margin-bottom: 10px; margin-bottom: 1px;
cursor: pointer; cursor: pointer;
} }
@ -1314,8 +1314,8 @@
} }
.item-title { .item-title {
font-weight: 500; font-weight: 600;
font-size: 14px; font-size: 16px;
flex: 1; flex: 1;
overflow: visible; overflow: visible;
text-overflow: unset; text-overflow: unset;
@ -1341,7 +1341,8 @@
} }
.section-title { .section-title {
font-weight: 500; font-weight: 600;
font-size: 16px;
margin-bottom: 8px; margin-bottom: 8px;
color: #333; color: #333;
display: flex; display: flex;
@ -1387,9 +1388,11 @@
padding: 12px; padding: 12px;
background-color: #f9fbfd; background-color: #f9fbfd;
border-radius: 4px; border-radius: 4px;
white-space: pre-wrap; // white-space: pre-wrap;
max-height: 300px; max-height: 300px;
overflow: auto; overflow: auto;
font-size: 18px;
font-weight: 500;
} }
.comparison-section { .comparison-section {

52
src/utils/encryption/crypto.ts

@ -24,7 +24,8 @@ function randomUUID() {
// /** // /**
// * 随机生成aes 密钥 // * 随机生成aes 密钥 (已废弃,请使用generateSM4Key)
// * @deprecated
// * @returns // * @returns
// */ // */
// export function generateAesKey() { // export function generateAesKey() {
@ -95,18 +96,24 @@ export function encryptBase64(str) {
} }
/** /**
* 使 * 使SM4密钥加密数据
* @param message * @param message
* @param aesKey aesKey * @param sm4Key SM4密钥
* @returns * @returns
*/ */
export function encryptWithAes(message: string, aesKey) { export function encryptWithSM4(message: string, sm4Key: string) {
// const encrypted = CryptoJS.AES.encrypt(message, aesKey, { return sm4.encrypt(message, sm4Key)
// mode: CryptoJS.mode.ECB, }
// padding: CryptoJS.pad.Pkcs7,
// }); /**
// return encrypted.toString(); * 使 (使SM4)
return sm4.encrypt(message, aesKey) * @deprecated 使 encryptWithSM4
* @param message
* @param aesKey
* @returns
*/
export function encryptWithAes(message: string, aesKey: string) {
return encryptWithSM4(message, aesKey);
} }
/** /**
@ -117,13 +124,22 @@ export function decryptBase64(str: string) {
} }
/** /**
* 使 * 使SM4密钥解密数据
* @param message
* @param sm4Key SM4密钥
* @returns
*/
export function decryptWithSM4(message: string, sm4Key: string) {
return sm4.decrypt(message, sm4Key)
}
/**
* 使 (使SM4)
* @deprecated 使 decryptWithSM4
* @param message
* @param aesKey
* @returns
*/ */
export function decryptWithAes(message: string, aesKey) { export function decryptWithAes(message: string, aesKey: string) {
// const decrypted = CryptoJS.AES.decrypt(message, aesKey, { return decryptWithSM4(message, aesKey);
// mode: CryptoJS.mode.ECB,
// padding: CryptoJS.pad.Pkcs7,
// });
// return decrypted.toString(CryptoJS.enc.Utf8);
return sm4.decrypt(message, aesKey)
} }

13
src/utils/http/axios/index.ts

@ -22,8 +22,11 @@ import axios from 'axios';
import { import {
generateSM4Key, generateSM4Key,
encryptBase64, encryptBase64,
encryptWithAes, encryptWithSM4,
decryptBase64, decryptBase64,
decryptWithSM4,
// 兼容性导入
encryptWithAes,
decryptWithAes, decryptWithAes,
} from '@/utils/encryption/crypto'; } from '@/utils/encryption/crypto';
import * as encryptUtil from '@/utils/encryption/jsencrypt'; import * as encryptUtil from '@/utils/encryption/jsencrypt';
@ -53,8 +56,8 @@ const transform: AxiosTransform = {
const aesSecret = decryptBase64(base64Str.toString()); const aesSecret = decryptBase64(base64Str.toString());
// aesSecret此时为数组,需要变成字符串 // aesSecret此时为数组,需要变成字符串
const asciiStr=CryptoJS.enc.Utf8.stringify(aesSecret) const asciiStr=CryptoJS.enc.Utf8.stringify(aesSecret)
/** 使用aesKey解密 responseData */ /** 使用SM4密钥解密 responseData */
const decryptData = decryptWithAes(res.data as unknown as string, asciiStr); const decryptData = decryptWithSM4(res.data as unknown as string, asciiStr);
/** 赋值 需要转为对象 */ /** 赋值 需要转为对象 */
res.data = JSON.parse(decryptData); res.data = JSON.parse(decryptData);
} }
@ -216,9 +219,9 @@ const transform: AxiosTransform = {
config.headers['encrypt-key'] = encryptUtil.encrypt(encryptBase64(asciiStr)); config.headers['encrypt-key'] = encryptUtil.encrypt(encryptBase64(asciiStr));
if (typeof config.data === 'object') { if (typeof config.data === 'object') {
config.data = encryptWithAes(JSON.stringify(config.data), aesKey); config.data = encryptWithSM4(JSON.stringify(config.data), aesKey);
} else { } else {
config.data = encryptWithAes(config.data, aesKey); config.data = encryptWithSM4(config.data, aesKey);
} }
} }
return config; return config;

4
src/views/contractReview/ContractualTasks/ContractualTasks.data.ts

@ -78,6 +78,10 @@ export const childColumns: BasicColumn[] = [
dataIndex: 'taskName', dataIndex: 'taskName',
customRender: ({ value }) => renderDict(value, 'contract_review'), customRender: ({ value }) => renderDict(value, 'contract_review'),
}, },
{
title:"合同角色",
dataIndex: 'contractPartyRole',
},
{ {
title: '任务耗时', title: '任务耗时',
dataIndex: 'taskDuration', dataIndex: 'taskDuration',

Loading…
Cancel
Save