From fdaa83f2bd1c7f41f2b9939669a681b102417e63 Mon Sep 17 00:00:00 2001 From: hbk01 <3243430237@qq.com> Date: Thu, 10 Nov 2022 00:56:33 +0800 Subject: [PATCH] =?UTF-8?q?+=20L414-5KR=20=E7=9B=B8=E5=85=B3=E7=89=A9?= =?UTF-8?q?=E8=B4=A8=E8=AE=A1=E7=AE=97=E7=BB=93=E6=9E=9C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=96=B9=E5=BC=8F=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L414-5KR-impurities.html | 111 ++++++++++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 26 deletions(-) diff --git a/L414-5KR-impurities.html b/L414-5KR-impurities.html index 9b9b5cc..5261d0e 100644 --- a/L414-5KR-impurities.html +++ b/L414-5KR-impurities.html @@ -5,7 +5,7 @@ - L414-5KR 相关物质计算 + L414-5KR 相关物质 @@ -69,6 +69,7 @@ two_414_5.val("") $("#msgbox").empty() $("#msgbox").html(tips) + $("#table").hide() }) $("#ok").click(() => { let one_414_3_cf = correctionFactor(one_414_3.val(), one_all.val(), F_L414_3) @@ -89,39 +90,64 @@ two_414_5_im.val(), two_414_5_im_cf ) + let one_purity = decimal.sub(100, one_total_impurities).toFixed(PRECISION) + let two_purity = decimal.sub(100, two_total_impurities).toFixed(PRECISION) + + let data = { + "one": { + "L414_3": format(one_414_3_cf, MAX_L414_3), + "L414_5_IM": format(one_414_5_im_cf, MAX_L414_5_IM), + "impurities": format(one_total_impurities, MAX_TOTAL_IMPURITIES), + "purity": format(one_purity, MIN_PURITY, true) + }, + "two": { + "L414_3": format(two_414_3_cf, MAX_L414_3), + "L414_5_IM": format(two_414_5_im_cf, MAX_L414_5_IM), + "impurities": format(two_total_impurities, MAX_TOTAL_IMPURITIES), + "purity": format(two_purity, MIN_PURITY, true) + }, + "average": { + "L414_3": format(average(one_414_3_cf, two_414_3_cf), MAX_L414_3), + "L414_5_IM": format(average(one_414_5_im_cf, two_414_5_im_cf), MAX_L414_5_IM), + "impurities": format(average(one_total_impurities, two_total_impurities), MAX_TOTAL_IMPURITIES), + "purity": format(average(one_purity, two_purity, 1), MIN_PURITY, true) + } + } + + $("#table").show() + generateTable(data) + let msg = ` - 第一组结果:
- L414-3: ${format(one_414_3_cf, MAX_L414_3)}
- L414-5-IM: ${format(one_414_5_im_cf, MAX_L414_5_IM)}
- 总杂: ${format(one_total_impurities, MAX_TOTAL_IMPURITIES)}
- 纯度: ${format(decimal.sub(100, one_total_impurities), MIN_PURITY, true)}
- -
- 第二组结果:
- L414-3: ${format(two_414_3_cf, MAX_L414_3)}
- L414-5-IM: ${format(two_414_5_im_cf, MAX_L414_5_IM)}
- 总杂: ${format(two_total_impurities, MAX_TOTAL_IMPURITIES)}
- 纯度: ${format(decimal.sub(100, two_total_impurities), MIN_PURITY, true)}
- -
- 平均值:
- L414-3: ${format(average(one_414_3_cf, two_414_3_cf), MAX_L414_3)}
- L414-5-IM: ${format(average(one_414_5_im_cf, two_414_5_im_cf), MAX_L414_5_IM)}
- 总杂: ${format(average(one_total_impurities, two_total_impurities), MAX_TOTAL_IMPURITIES)}
- 纯度: ${format(average(decimal.sub(100, one_total_impurities), decimal.sub(100, two_total_impurities), 1), MIN_PURITY, true)}
- -
操规允许:
L414-3 ≤ ${MAX_L414_3}%
L414-5-IM ≤ ${MAX_L414_5_IM.toPrecision(2)}%
总杂 ≤ ${MAX_TOTAL_IMPURITIES.toPrecision(2)}%
纯度 ≥ ${MIN_PURITY}%
` - $("#msgbox").html(msg) }) }) + /** + * 将结果输出到表格中 + */ + function generateTable(data) { + $("#L414-3>#one").html(data.one.L414_3) + $("#L414-5-IM>#one").html(data.one.L414_5_IM) + $("#impurities>#one").html(data.one.impurities) + $("#purity>#one").html(data.one.purity) + + $("#L414-3>#two").html(data.two.L414_3) + $("#L414-5-IM>#two").html(data.two.L414_5_IM) + $("#impurities>#two").html(data.two.impurities) + $("#purity>#two").html(data.two.purity) + + $("#L414-3>#average").html(data.average.L414_3) + $("#L414-5-IM>#average").html(data.average.L414_5_IM) + $("#impurities>#average").html(data.average.impurities) + $("#purity>#average").html(data.average.purity) + } + function setCheckInputEvent() { let checkInput = (event) => { event.target.value = event.target.value.replace(/[\D]/g, '') @@ -160,12 +186,12 @@ } function format(value, max, morethen = false) { - let red_value = `${value}%` + let red_value = `${value}` if (value == 0) return "ND" if (value < 0) return red_value if (!morethen && value >= max) return red_value if (morethen && value <= max) return red_value - return `${value}%` + return `${value}` } /** @@ -178,7 +204,7 @@ -

L414-5KR 相关物质计算

+

L414-5KR 相关物质

第一组
@@ -204,6 +230,39 @@

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +