优化组件无用字段,更新组件reame文件

This commit is contained in:
linxd
2025-07-15 14:48:53 +08:00
parent d256f55ff1
commit 5eaaf2db66
2 changed files with 17 additions and 13 deletions

View File

@ -28,17 +28,19 @@ const evaluationData = [
{
id: '1-1',
subIndicator: '质量管理体系认证',
score: '10',
subScore: '10',
isStar: '0',
actualScore: '8',
score: '8', // 实际评分
scoreNum: '8', // 用于提交的评分值
remark: '已获得ISO9001认证'
},
{
id: '1-2',
subIndicator: '质量控制流程',
score: '10',
subScore: '10',
isStar: '1',
actualScore: '9',
score: '9', // 实际评分
scoreNum: '9', // 用于提交的评分值
remark: '质量控制流程完善'
}
]
@ -81,9 +83,10 @@ interface IndicatorItem {
indicatorNdList: { // 二级指标列表
id?: string; // 二级指标ID
subIndicator: string; // 二级指标名称
score: string; // 二级指标分值
subScore: string; // 二级指标分值
isStar?: string; // 是否为星号项
actualScore?: string; // 实际评分
score: string; // 实际评分值(用于显示)
scoreNum: string; // 实际评分值(用于提交)
remark?: string; // 评分说明
}[];
}

View File

@ -66,7 +66,7 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
return {
baseIndicator: indicator.baseIndicator,
indicatorDesc: indicator.indicatorDesc,
score: indicator.score,
score: indicator.score, // 一级指标分值
// 为ScoreEvaluationTable组件添加额外字段
indicatorNdList:
indicator.subIndicator
@ -76,16 +76,17 @@ const SupplierEvaluateScoreDetail: React.FC = () => {
return null;
}
// 字段映射说明:
// 1. subScore: API返回的二级指标标准分值
// 2. score: API返回的实际评分值
// 3. scoreNum: 组件内部使用的实际评分值字段,用于提交数据
return {
id: subItem.id,
subIndicator: subItem.subIndicator,
// 注意组件内部使用subScore作为二级指标分值但在表格中显示为ndScore
subScore: subItem.subScore,
subScore: subItem.subScore, // 二级指标标准分值
isStar: subItem.starIndicator,
// 修正使用scoreNum作为实际评分值这是组件期望的字段
scoreNum: subItem.score || '',
// 保留score字段以兼容组件内部逻辑
score: subItem.score || '',
scoreNum: subItem.score || '', // 实际评分值使用API返回的score字段
score: subItem.score || '', // 组件内部显示用
remark: subItem.remark || '',
};
})