From 6edd08b8745197792c16ffbcfc7e0e362f213bf8 Mon Sep 17 00:00:00 2001
From: huanshuo-W <15258427350@163.com>
Date: Wed, 9 Jul 2025 16:56:10 +0800
Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E9=A3=8E=E6=A0=BC=20&=20=E4=BC=98=E5=8C=96=E8=84=9A=E6=9C=AC?=
=?UTF-8?q?=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PaperRollWeightLengthCalculate.vue | 79 ++++++++-----------
.../Modules/PaperTubeWeightCalculate.vue | 37 +++++----
2 files changed, 52 insertions(+), 64 deletions(-)
diff --git a/src/components/Modules/PaperRollWeightLengthCalculate.vue b/src/components/Modules/PaperRollWeightLengthCalculate.vue
index d1ee7b2..a6c27be 100644
--- a/src/components/Modules/PaperRollWeightLengthCalculate.vue
+++ b/src/components/Modules/PaperRollWeightLengthCalculate.vue
@@ -15,7 +15,7 @@
rounded="xl"
>
-
-
-
-
-
-
@@ -77,42 +77,42 @@
lg="5"
md="6"
>
-
-
-
+
{{ $t('results') }}
-
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
+
@@ -128,30 +128,19 @@
const paperDensity = ref(createParam(0.76, 'g/cm³'))
const paperGrammage = ref(createParam(420, 'g/m²'))
- const paperThickness = computed(() => {
- // 计算纸张厚度
- return createParam(paperGrammage.value.value / paperDensity.value.value / 1000, 'mm')
- })
-
- const paperRollWeight = computed(() => {
- // 计算纸卷总重量
+ const result = computed(() => {
const paperRollExternalRadius = paperRollExternalDiameter.value.value / 2
const paperCoreRadius = paperCoreDiameter.value.value / 2
const paperRollVolume = (Math.PI * Math.pow(paperRollExternalRadius, 2) - Math.PI * Math.pow(paperCoreRadius, 2)) * paperRollWidth.value.value
- const weight = paperRollVolume * paperDensity.value.value / 1_000_000 // 计算重量
- return createParam(weight, 'kg')
+ const paperThickness = paperGrammage.value.value / paperDensity.value.value / 1000 // 计算纸张厚度
+ const paperRollWeight = paperRollVolume * paperDensity.value.value / 1_000_000 // 计算重量
+ const paperRollLength = paperRollVolume / (paperThickness * paperRollWidth.value.value) / 1000 // 计算长度
+ return {
+ paperRollWeight: createParam(paperRollWeight, 'kg'),
+ paperRollLength: createParam(paperRollLength, 'm'),
+ paperThickness: createParam(paperThickness, 'mm'),
+ }
})
-
- const paperRollLength = computed(() => {
- // 计算纸卷长度
- const paperRollExternalRadius = paperRollExternalDiameter.value.value / 2
- const paperCoreRadius = paperCoreDiameter.value.value / 2
- const paperRollVolume = (Math.PI * Math.pow(paperRollExternalRadius,
- 2) - Math.PI * Math.pow(paperCoreRadius, 2)) * paperRollWidth.value.value
- const length = paperRollVolume / (paperThickness.value.value * paperRollWidth.value.value) / 1000
- return createParam(length, 'm')
- })
-