| | |
| | | <div className="cases-list"> |
| | | {displayedCases.length > 0 ? ( |
| | | displayedCases.map((item) => { |
| | | const isExpanded = expandedId === (item.cpwsCaseTextId || item.id || item.caseId); |
| | | // 支持判决类和调解类案件的字段 |
| | | const caseId = item.cpwsCaseTextId || item.id || item.caseId; |
| | | const isExpanded = expandedId === caseId; |
| | | const similarity = item.similarity || item.score; |
| | | const similarityLevel = similarity ? getSimilarityLevel(similarity) : null; |
| | | |
| | | // 根据similarityCaseType判断案件类型('1'=判决类,'2'=调解类) |
| | | const isMediation = item.similarityCaseType === '2'; |
| | | |
| | | return ( |
| | | <div className="case-card" key={item.cpwsCaseTextId || item.id || item.caseId}> |
| | | <div className="case-card" key={caseId}> |
| | | <div |
| | | className={isExpanded ? 'case-header active' : 'case-header'} |
| | | onClick={() => handleToggleCase(item.cpwsCaseTextId || item.id || item.caseId)} |
| | | onClick={() => handleToggleCase(caseId)} |
| | | > |
| | | <div className="case-title-container"> |
| | | <h3 className="case-title"> |
| | | {item.caseName || item.title || item.caseTitle || '未命名案例'} |
| | | {item.caseName || item.caseTitle || item.title || '未命名案例'} |
| | | {similarityLevel && ( |
| | | <span className={`similarity-tag ${similarityLevel.className}`}> |
| | | <i className="fas fa-chart-line"></i> |
| | |
| | | <span>案号:{item.caseNumber}</span> |
| | | </div> |
| | | )} |
| | | {(item.date || item.occurTime || item.judgmentDate) && ( |
| | | {(item.judgmentDate || item.date || item.occurTime) && ( |
| | | <div className="case-meta-item"> |
| | | <i className="far fa-calendar-alt"></i> |
| | | <span>日期:{item.judgmentDate || item.date || item.occurTime}</span> |
| | |
| | | </div> |
| | | <div |
| | | className={ |
| | | (item.caseType || item.type) === 'mediation' |
| | | isMediation |
| | | ? 'case-type-badge mediation' |
| | | : 'case-type-badge judgment' |
| | | } |
| | | > |
| | | <i className={(item.caseType || item.type) === 'mediation' ? 'fas fa-handshake' : 'fas fa-gavel'}></i> |
| | | {(item.caseType || item.type) === 'mediation' ? '调解案例' : '判决文书'} |
| | | <i className={isMediation ? 'fas fa-handshake' : 'fas fa-gavel'}></i> |
| | | {isMediation ? '调解案例' : '判决文书'} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <button className="toggle-btn" onClick={() => handleToggleCase(item.cpwsCaseTextId || item.id || item.caseId)}> |
| | | <button className="toggle-btn" onClick={() => handleToggleCase(caseId)}> |
| | | <i className={isExpanded ? 'fas fa-chevron-up' : 'fas fa-chevron-down'}></i> |
| | | </button> |
| | | </div> |
| | | |
| | | <div className={isExpanded ? 'case-content expanded' : 'case-content'}> |
| | | <div className="case-detail"> |
| | | {/* 判决类案件字段 */} |
| | | {(item.basicCaseInfo || item.overview || item.caseOverview) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">案例概述</h4> |
| | |
| | | </div> |
| | | )} |
| | | |
| | | {/* 调解类案件字段 */} |
| | | {(item.caseDes || item.caseOverview) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">事项概况</h4> |
| | | <div className="detail-content"> |
| | | <p>{item.caseDes || item.caseOverview}</p> |
| | | </div> |
| | | </div> |
| | | )} |
| | | |
| | | {(item.caseClaim || item.caseRequest) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">事项申请</h4> |
| | | <div className="detail-content"> |
| | | <p>{item.caseClaim || item.caseRequest}</p> |
| | | </div> |
| | | </div> |
| | | )} |
| | | |
| | | {(item.agreeContent || item.agreementContent) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">协议内容</h4> |
| | | <div className="detail-content"> |
| | | <p>{item.agreeContent || item.agreementContent}</p> |
| | | </div> |
| | | </div> |
| | | )} |
| | | |
| | | {(item.windupContent || item.closingContent) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">结案内容</h4> |
| | | <div className="detail-content"> |
| | | <p>{item.windupContent || item.closingContent}</p> |
| | | </div> |
| | | </div> |
| | | )} |
| | | |
| | | {(item.background || item.caseBackground) && ( |
| | | <div className="detail-section"> |
| | | <h4 className="detail-title">调解/审理背景</h4> |