debug - report

This commit is contained in:
Zylan
2025-03-27 18:24:51 +08:00
parent 36562a1219
commit 37770b0802

View File

@@ -491,7 +491,7 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
backgroundColor: '#FFFFFF',
useCORS: true,
allowTaint: true,
logging: false,
logging: false
});
// 转换为图片并下载
@@ -596,11 +596,11 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
{/* 简化版报告,仅用于下载,在页面中隐藏 */}
<div className="fixed top-0 left-0 opacity-0 pointer-events-none">
<div ref={simpleReportRef} className="w-[800px] bg-white p-8" style={{ fontFamily: 'system-ui, -apple-system, sans-serif' }}>
<div ref={simpleReportRef} className="w-[800px] bg-white p-8 text-gray-900" style={{ fontFamily: 'system-ui, -apple-system, sans-serif' }}>
<div className="border border-gray-200 rounded-lg p-6">
{/* 报告标题 */}
<div className="text-center mb-6">
<h1 className="text-2xl font-bold"></h1>
<h1 className="text-2xl font-bold text-black"></h1>
<div className="mt-2 text-lg">
<span className="font-semibold px-2 py-1 rounded" style={{ backgroundColor: `${getColorFromClassName(props.assessmentColor)}20`, color: getColorFromClassName(props.assessmentColor) }}>
{props.value} - {props.assessment}
@@ -617,19 +617,19 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
<div className="grid grid-cols-2 gap-2 col-span-2">
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getCityName(props.cityFactor)}</div>
<div className="font-medium text-gray-800">{getCityName(props.cityFactor)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.homeTown === 'yes' ? '是' : '否'}</div>
<div className="font-medium text-gray-800">{props.homeTown === 'yes' ? '是' : '否'}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.isYuan ? '¥' : '$'}{props.dailySalary}/</div>
<div className="font-medium text-gray-800">{props.isYuan ? '¥' : '$'}{props.dailySalary}/</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.workDaysPerYear} </div>
<div className="font-medium text-gray-800">{props.workDaysPerYear} </div>
</div>
</div>
@@ -640,35 +640,35 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
<div className="grid grid-cols-2 gap-2 col-span-2">
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.workHours} </div>
<div className="font-medium text-gray-800">{props.workHours} </div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.commuteHours} </div>
<div className="font-medium text-gray-800">{props.commuteHours} </div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.restTime} </div>
<div className="font-medium text-gray-800">{props.restTime} </div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.workDaysPerWeek} </div>
<div className="font-medium text-gray-800">{props.workDaysPerWeek} </div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.wfhDaysPerWeek}/{props.workDaysPerWeek} /</div>
<div className="font-medium text-gray-800">{props.wfhDaysPerWeek}/{props.workDaysPerWeek} /</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getShuttleDesc(props.shuttle)}</div>
<div className="font-medium text-gray-800">{getShuttleDesc(props.shuttle)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.annualLeave} /</div>
<div className="font-medium text-gray-800">{props.annualLeave} /</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{props.paidSickLeave} /</div>
<div className="font-medium text-gray-800">{props.paidSickLeave} /</div>
</div>
</div>
@@ -679,19 +679,19 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
<div className="grid grid-cols-2 gap-2 col-span-2">
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getWorkEnvironmentDesc(props.workEnvironment)}</div>
<div className="font-medium text-gray-800">{getWorkEnvironmentDesc(props.workEnvironment)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getLeadershipDesc(props.leadership)}</div>
<div className="font-medium text-gray-800">{getLeadershipDesc(props.leadership)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getTeamworkDesc(props.teamwork)}</div>
<div className="font-medium text-gray-800">{getTeamworkDesc(props.teamwork)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getCanteenDesc(props.canteen)}</div>
<div className="font-medium text-gray-800">{getCanteenDesc(props.canteen)}</div>
</div>
</div>
@@ -702,19 +702,19 @@ const ShareCard: React.FC<ShareCardProps> = (props) => {
<div className="grid grid-cols-2 gap-2 col-span-2">
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getDegreeDesc(props.degreeType)}</div>
<div className="font-medium text-gray-800">{getDegreeDesc(props.degreeType)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getSchoolTypeDesc(props.schoolType, props.degreeType)}</div>
<div className="font-medium text-gray-800">{getSchoolTypeDesc(props.schoolType, props.degreeType)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getWorkYearsDesc(props.workYears)}</div>
<div className="font-medium text-gray-800">{getWorkYearsDesc(props.workYears)}</div>
</div>
<div>
<div className="text-sm text-gray-600"></div>
<div className="font-medium">{getJobStabilityDesc(props.jobStability)}</div>
<div className="font-medium text-gray-800">{getJobStabilityDesc(props.jobStability)}</div>
</div>
</div>