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 @@
+
+ 计算结果
+
+ | / |
+ 第一组(%) |
+ 第二组(%) |
+ 平均值(%) |
+
+
+ | L414-3 |
+ |
+ |
+ |
+
+
+ | L414-5-IM |
+ |
+ |
+ |
+
+
+ | 总杂 |
+ |
+ |
+ |
+
+
+ | 纯度 |
+ |
+ |
+ |
+
+