修改评查详情

This commit is contained in:
2025-04-16 18:47:22 +08:00
parent 9a9ce5fa55
commit 947d61f5bc
18 changed files with 381 additions and 305 deletions
+49 -18
View File
@@ -44,6 +44,7 @@ interface FileDetailsProps {
export function FileDetails({ fileInfo, contractInfo, reviewInfo }: FileDetailsProps) {
// 情况状态对应的标签
const controlContractShow = false
const renderResultBadge = (result: string) => {
switch (result) {
case 'success':
@@ -75,11 +76,39 @@ export function FileDetails({ fileInfo, contractInfo, reviewInfo }: FileDetailsP
// 渲染信息区块
const renderInfoSection = (title: string, icon: string, color: string, children: ReactNode) => {
// 根据color参数返回对应的具体类名
const getBgClass = (colorName: string) => {
switch(colorName) {
case 'blue': return 'bg-blue-50';
case 'green': return 'bg-green-50';
case 'purple': return 'bg-purple-50';
default: return 'bg-gray-50';
}
};
const getTextClass = (colorName: string) => {
switch(colorName) {
case 'blue': return 'text-blue-500';
case 'green': return 'text-green-500';
case 'purple': return 'text-purple-500';
default: return 'text-gray-500';
}
};
const getTextTitleClass = (colorName: string) => {
switch(colorName) {
case 'blue': return 'text-blue-700';
case 'green': return 'text-green-700';
case 'purple': return 'text-purple-700';
default: return 'text-gray-700';
}
};
return (
<div className="info-section">
<div className={`info-header bg-${color}-50`}>
<i className={`${icon} text-${color}-500 text-lg mr-2`}></i>
<h3 className={`font-medium text-${color}-700`}>{title}</h3>
<div className={`info-header ${getBgClass(color)}`}>
<i className={`${icon} ${getTextClass(color)} text-lg mr-2`}></i>
<h3 className={`font-medium ${getTextTitleClass(color)}`}>{title}</h3>
</div>
<div className="info-content">
{children}
@@ -114,20 +143,22 @@ export function FileDetails({ fileInfo, contractInfo, reviewInfo }: FileDetailsP
))}
{/* 合同信息 */}
{renderInfoSection('合同信息', 'ri-file-paper-2-line', 'green', (
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{renderInfoRow('合同类型', contractInfo.contractType)}
{renderInfoRow('签约日期', contractInfo.signDate)}
{renderInfoRow('合同当事人', (
<div>
<div>{contractInfo.parties.partyA}</div>
<div>{contractInfo.parties.partyB}</div>
</div>
))}
{renderInfoRow('合同金额', contractInfo.amount)}
{renderInfoRow('履行期限', contractInfo.period)}
</div>
))}
{ controlContractShow && (
renderInfoSection('合同信息', 'ri-file-paper-2-line', 'green', (
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{renderInfoRow('合同类型', contractInfo.contractType)}
{renderInfoRow('签约日期', contractInfo.signDate)}
{renderInfoRow('合同当事人', (
<div>
<div>{contractInfo.parties.partyA}</div>
<div>{contractInfo.parties.partyB}</div>
</div>
))}
{renderInfoRow('合同金额', contractInfo.amount)}
{renderInfoRow('履行期限', contractInfo.period)}
</div>
))
)}
{/* 评查信息 */}
{renderInfoSection('评查信息', 'ri-search-eye-line', 'purple', (
@@ -139,7 +170,7 @@ export function FileDetails({ fileInfo, contractInfo, reviewInfo }: FileDetailsP
{renderInfoRow('评查结果', (
<div className="flex items-center">
{renderResultBadge(reviewInfo.result)}
<span className="text-sm ml-2">{reviewInfo.issueCount}</span>
{reviewInfo.issueCount > 0 && <span className="text-sm ml-2">{reviewInfo.issueCount}</span>}
</div>
))}
</div>