Browse Source

优化功能

hetong_dev
zhouhaibin 3 weeks ago
parent
commit
74351ae487
  1. 163
      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

163
public/configs/tenderTaskConfigs.json

@ -22,7 +22,39 @@
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_content", "review_points"],
"extractFields": [
"review_content",
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
}
}
}
]
},
{
"key": "公司人员信息",
"label": "公司人员信息",
"fields": [
{
"field": "issueName",
"title": "文档名称",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "bid",
"required": true
},
{
"field": "reviewBasis",
"title": "公司人员信息详情",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
@ -35,14 +67,15 @@
"key": "重点关注相似内容",
"label": "重点关注相似内容",
"fields": [
{
"field": "reviewBasis",
"title": "各文档具体内容",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_points"],
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
@ -61,7 +94,9 @@
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["error_review_points"],
"extractFields": [
"error_review_points"
],
"separator": ":",
"fieldProcessors": {
"error_review_points": "arrayJoinNewLine"
@ -70,42 +105,6 @@
}
]
},
{
"key": "错别字",
"label": "错别字",
"fields": [
{
"field": "originalText",
"title": "文档1原文",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "bid",
"required": true
},
{
"field": "comparedText",
"title": "文档2原文",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "bid",
"required": true
},
{
"field": "reviewBasis",
"title": "错误详情",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_content", "review_points"],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoin"
}
}
}
]
},
{
"key": "一般相似内容",
"label": "一般相似内容",
@ -122,7 +121,10 @@
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_content", "review_points"],
"extractFields": [
"review_content",
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
@ -135,51 +137,100 @@
},
"tenderComplianceReview": {
"taskType": "tenderComplianceReview",
"name": "招投标合规性审查",
"name": "招投标文件合规性审核",
"mode": "single",
"pdfConfig": {
"layout": "single",
"sources": [
{
"id": "document",
"title": "投标文件",
"apiField": "id"
}
]
},
"fields": [
{
"field": "issueName",
"title": "合规性分类-具体问题(示例:资质审查-业绩要求)",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "document"
},
{
"field": "originalText",
"title": "原文",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "bid",
"required": true
"pdfSource": "document"
},
{
"field": "reviewBasis",
"title": "审查意见",
"title": "相关法律法规政策",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_content"],
"separator": ":"
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
}
}
},
{
"field": "modifiedContent",
"title": "修改建议",
"dataType": "string",
"displayType": "markdown",
"pdfSource": "document"
},
{
"field": "reviewBasis",
"title": "审查要点",
"title": "风险等级(红色预警:直接废标项,橙色风险:可能引发投诉项)",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": ["review_points"],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
"extractFields": [
"risk_level"
],
"separator": ":"
}
}
]
},
"bidImageAnalysis": {
"taskType": "bidImageAnalysis",
"name": "招标文件图片相似度分析",
"mode": "single",
"fields": [
{
"field": "modifiedContent",
"title": "修改建议",
"field": "originalText",
"title": "图片1路径",
"dataType": "string",
"displayType": "markdown"
},
{
"field": "modificationDisplay",
"title": "修改情况",
"field": "comparedText",
"title": "图片2路径",
"dataType": "string",
"displayType": "markdown"
},
{
"field": "reviewBasis",
"title": "页码",
"dataType": "json",
"displayType": "markdown",
"jsonConfig": {
"extractFields": [
"review_points"
],
"separator": ":",
"fieldProcessors": {
"review_points": "arrayJoinNewLine"
}
}
}
]
}

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

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

13
src/components/UniversalResultDrawer.vue

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

52
src/utils/encryption/crypto.ts

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

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

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

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

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

Loading…
Cancel
Save