From dfba3f7f5a61f545167816794512d97a0397b07e Mon Sep 17 00:00:00 2001 From: Zylan Date: Thu, 13 Mar 2025 22:15:48 +0800 Subject: [PATCH] add city --- components/calculator.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/components/calculator.tsx b/components/calculator.tsx index 4c5ad2b..7052f41 100644 --- a/components/calculator.tsx +++ b/components/calculator.tsx @@ -25,7 +25,8 @@ const SalaryCalculator = () => { workEnvironment: '1.0', // 工作环境系数 heterogeneity: '1.0', // 异性环境系数 teamwork: '1.0', // 同事环境系数 - education: '1.6' // 学历系数 + education: '1.6', // 学历系数 + cityFactor: '1.0' // 城市系数,默认为三线城市 }); const calculateWorkingDays = useCallback(() => { @@ -71,7 +72,8 @@ const SalaryCalculator = () => { const environmentFactor = Number(formData.workEnvironment) * Number(formData.heterogeneity) * - Number(formData.teamwork); + Number(formData.teamwork) * + Number(formData.cityFactor); return (dailySalary * environmentFactor) / (35 * (workHours + commuteHours - 0.5 * breakHours) * Number(formData.education)); @@ -250,7 +252,23 @@ const SalaryCalculator = () => { /> + +