Feature: 纸管重量长度计算

This commit is contained in:
2025-07-09 15:48:30 +08:00
parent 87e663469f
commit 610a2e89a7
5 changed files with 182 additions and 32 deletions

View File

@ -1,11 +1,159 @@
<template>
<div
class="calculator-container"
>
<v-row justify="center">
<!-- 参数输入区域 -->
<v-col
cols="12"
lg="5"
md="6"
>
<v-card
class="pa-6 parameters-card"
elevation="8"
rounded="xl"
>
<v-card-title class="text-h5 mb-6 d-flex align-center">
<VIcon
class="mr-3"
color="primary"
icon="mdi-tune"
size="large"
/>
{{ $t('parameters') }}
</v-card-title>
<v-row>
<v-col cols="12">
<ParamInputField
v-model="paperCoreDiameter"
:label="`${$t('paperCoreDiameter')} (${paperCoreDiameter.unit})`"
/>
</v-col>
<v-col cols="12">
<ParamInputField
v-model="paperRollExternalDiameter"
:label="`${$t('paperRollExternalDiameter')} (${paperRollExternalDiameter.unit})`"
/>
</v-col>
<v-col cols="12">
<ParamInputField
v-model="paperRollWidth"
:label="`${$t('paperRollWidth')} (${paperRollWidth.unit})`"
/>
</v-col>
<v-col cols="12">
<ParamInputField
v-model="paperDensity"
:label="`${$t('paperDensity')} (${paperDensity.unit})`"
/>
</v-col>
<v-col cols="12">
<ParamInputField
v-model="paperGrammage"
:label="`${$t('paperGrammage')} (${paperGrammage.unit})`"
/>
</v-col>
</v-row>
<v-divider class="my-6" />
<v-row>
<v-btn
block
color="warning"
prepend-icon="mdi-refresh"
size="large"
variant="outlined"
>
{{ $t('reset') }}
</v-btn>
</v-row>
</v-card>
</v-col>
<!-- 结果显示区域 -->
<v-col
cols="12"
lg="5"
md="6"
>
<VCard
class="pa-6 result-card"
elevation="8"
rounded="xl"
>
<VCardTitle class="text-h5 mb-6 d-flex align-center">
<VIcon
class="mr-3"
color="primary"
icon="mdi-calculator"
size="large"
/>
{{ $t('results') }}
</VCardTitle>
<VRow>
<VCol cols="12">
<ResultCard
:label="$t('paperRollWeight')"
:value="paperRollWeight"
/>
</VCol>
<VCol cols="12">
<ResultCard
:label="$t('paperRollLength')"
:value="paperRollLength"
/>
</VCol>
<VCol cols="12">
<ResultCard
:label="$t('paperThickness')"
:value="paperThickness"
/>
</VCol>
</VRow>
</VCard>
</v-col>
</v-row>
</div>
</template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref } from 'vue'
import { createParam, type Param } from '@/types/param'
const paperCoreDiameter = ref<Param>(createParam(76.2, 'mm'))
const paperRollExternalDiameter = ref<Param>(createParam(200, 'mm'))
const paperRollWidth = ref<Param>(createParam(100, 'mm'))
const paperDensity = ref<Param>(createParam(0.76, 'g/cm³'))
const paperGrammage = ref<Param>(createParam(420, 'g/m²'))
const paperThickness = computed(() => {
// 计算纸张厚度
return createParam(paperGrammage.value.value / paperDensity.value.value / 1000, 'mm')
})
const paperRollWeight = 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 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')
})
</script> </script>
<template>
</template>
<style scoped lang="sass"> <style scoped lang="sass">
</style> </style>

View File

@ -5,7 +5,7 @@
<v-col <v-col
cols="12" cols="12"
lg="5" lg="5"
md="5" md="6"
> >
<v-card <v-card
class="pa-6 parameter-card" class="pa-6 parameter-card"
@ -35,21 +35,18 @@
:label="`${$t('paperDensity')}(${paperDensity.unit})`" :label="`${$t('paperDensity')}(${paperDensity.unit})`"
/> />
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<ParamInputField <ParamInputField
v-model="productionAmount" v-model="productionAmount"
:label="`${$t('productionAmount')}(${productionAmount.unit})`" :label="`${$t('productionAmount')}(${productionAmount.unit})`"
/> />
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<ParamInputField <ParamInputField
v-model="paperCoreDiameter" v-model="paperCoreDiameter"
:label="`${$t('paperCoreDiameter')}(${paperCoreDiameter.unit})`" :label="`${$t('paperCoreDiameter')}(${paperCoreDiameter.unit})`"
/> />
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<ParamInputField <ParamInputField
v-model="paperRollWallThickness" v-model="paperRollWallThickness"
@ -77,7 +74,7 @@
<!-- 计算结果区域 --> <!-- 计算结果区域 -->
<v-col <v-col
cols="12" cols="12"
lg="6" lg="5"
md="6" md="6"
> >
<v-card <v-card
@ -89,7 +86,7 @@
<v-icon <v-icon
class="mr-3" class="mr-3"
color="primary" color="primary"
icon="mdi-tune" icon="mdi-calculator"
size="large" size="large"
/> />
{{ $t('results') }} {{ $t('results') }}

View File

@ -19,7 +19,7 @@
size="large" size="large"
variant="outlined" variant="outlined"
> >
{{ value.value.toFixed(4) }} {{ value.unit }} {{ value.value.toFixed(2) }} {{ value.unit }}
</v-chip> </v-chip>
</v-card-text> </v-card-text>
</v-card> </v-card>

View File

@ -1,23 +1,25 @@
{ {
"appTitle": "Paper Tube Production Calculator", "appTitle": "Paper Tube Production Calculator",
"beltSpecificationCalculate": "Belt Specification Calculate", "beltSpecificationCalculate": "Belt Specification Calculate",
"multiLayerPaperTapeWidthAngleCalculate": "MultiLayer Paper Tape Width Angle Calculate", "multiLayerPaperTapeWidthAngleCalculate": "MultiLayer Paper Tape Width Angle Calculate",
"paperCoreDiameter": "Paper Core Diameter",
"paperDensity": "Paper Density",
"paperGrammage": "Grammage",
"paperRollExternalDiameter": "Paper Roll External Diameter",
"paperRollLength": "Paper Roll Length",
"paperRollWallThickness": "Paper Roll Wall Thickness",
"paperRollWeightLengthCalculate": "Paper Roll Weight Length Calculate", "paperRollWeightLengthCalculate": "Paper Roll Weight Length Calculate",
"paperTapeWidthAngleCalculate": "Paper Tape Width Angle Calculate", "paperTapeWidthAngleCalculate": "Paper Tape Width Angle Calculate",
"paperTubeProductionCalculate": "Paper Tube Production Calculate", "paperTubeProductionCalculate": "Paper Tube Production Calculate",
"paperTubeWeightCalculate": "Paper Tube Weight Calculate", "paperTubeWeightCalculate": "Paper Tube Weight Calculate",
"parameters": "Parameters", "parameters": "Parameters",
"results": "Results",
"paperRollLength": "Paper Roll Length",
"paperDensity": "Paper Density",
"productionAmount": "Production Amount", "productionAmount": "Production Amount",
"paperCoreDiameter": "Paper Core Diameter", "reset": "Reset",
"paperRollWallThickness": "Paper Roll Wall Thickness", "results": "Results",
"singlePaperTubeWeight": "Single Paper Tube Weight", "singlePaperTubeWeight": "Single Paper Tube Weight",
"totalPaperTubeWeight": "Total Paper Tube Weight", "totalPaperTubeWeight": "Total Paper Tube Weight",
"paperRollWidth": "Paper Roll Width",
"reset": "Reset" "paperThickness": "Paper Thickness",
"paperRollWeight": "Paper Roll Weight",
"paperLength": "Paper Roll Length"
} }

View File

@ -2,21 +2,24 @@
"appTitle": "纸管制作辅助生产工具", "appTitle": "纸管制作辅助生产工具",
"beltSpecificationCalculate": "皮带规格计算", "beltSpecificationCalculate": "皮带规格计算",
"multiLayerPaperTapeWidthAngleCalculate": "多层纸带宽度角度计算", "multiLayerPaperTapeWidthAngleCalculate": "多层纸带宽度角度计算",
"paperCoreDiameter": "纸芯内径",
"paperDensity": "纸张密度",
"paperGrammage": "纸张克重",
"paperRollExternalDiameter": "纸卷外径",
"paperRollLength": "纸卷长度",
"paperRollWallThickness": "纸卷壁厚",
"paperRollWeightLengthCalculate": "纸卷重量长度计算", "paperRollWeightLengthCalculate": "纸卷重量长度计算",
"paperTapeWidthAngleCalculate": "纸带宽度角度计算", "paperTapeWidthAngleCalculate": "纸带宽度角度计算",
"paperTubeProductionCalculate": "纸管产能计算", "paperTubeProductionCalculate": "纸管产能计算",
"paperTubeWeightCalculate": "纸管重量计算", "paperTubeWeightCalculate": "纸管重量计算",
"parameters": "参数", "parameters": "参数",
"results": "结果",
"paperRollLength": "纸卷长度",
"paperDensity": "纸张密度",
"productionAmount": "生产数量", "productionAmount": "生产数量",
"paperCoreDiameter": "纸芯内径", "reset": "重置",
"paperRollWallThickness": "纸卷壁厚", "results": "结果",
"singlePaperTubeWeight": "单个纸管重量", "singlePaperTubeWeight": "单个纸管重量",
"totalPaperTubeWeight": "总纸管重量", "totalPaperTubeWeight": "总纸管重量",
"paperRollWidth": "纸卷宽度",
"reset": "重置" "paperThickness": "纸张厚度",
"paperLength": "纸卷长度",
"paperRollWeight": "纸卷重量"
} }