Feature: 纸管重量长度计算
This commit is contained in:
@ -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">
|
||||
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>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="sass">
|
||||
|
||||
</style>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<v-col
|
||||
cols="12"
|
||||
lg="5"
|
||||
md="5"
|
||||
md="6"
|
||||
>
|
||||
<v-card
|
||||
class="pa-6 parameter-card"
|
||||
@ -35,21 +35,18 @@
|
||||
:label="`${$t('paperDensity')}(${paperDensity.unit})`"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<ParamInputField
|
||||
v-model="productionAmount"
|
||||
:label="`${$t('productionAmount')}(${productionAmount.unit})`"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<ParamInputField
|
||||
v-model="paperCoreDiameter"
|
||||
:label="`${$t('paperCoreDiameter')}(${paperCoreDiameter.unit})`"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<ParamInputField
|
||||
v-model="paperRollWallThickness"
|
||||
@ -77,7 +74,7 @@
|
||||
<!-- 计算结果区域 -->
|
||||
<v-col
|
||||
cols="12"
|
||||
lg="6"
|
||||
lg="5"
|
||||
md="6"
|
||||
>
|
||||
<v-card
|
||||
@ -89,7 +86,7 @@
|
||||
<v-icon
|
||||
class="mr-3"
|
||||
color="primary"
|
||||
icon="mdi-tune"
|
||||
icon="mdi-calculator"
|
||||
size="large"
|
||||
/>
|
||||
{{ $t('results') }}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
size="large"
|
||||
variant="outlined"
|
||||
>
|
||||
{{ value.value.toFixed(4) }} {{ value.unit }}
|
||||
{{ value.value.toFixed(2) }} {{ value.unit }}
|
||||
</v-chip>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
@ -1,23 +1,25 @@
|
||||
{
|
||||
"appTitle": "Paper Tube Production Calculator",
|
||||
|
||||
"beltSpecificationCalculate": "Belt Specification 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",
|
||||
"paperTapeWidthAngleCalculate": "Paper Tape Width Angle Calculate",
|
||||
"paperTubeProductionCalculate": "Paper Tube Production Calculate",
|
||||
"paperTubeWeightCalculate": "Paper Tube Weight Calculate",
|
||||
|
||||
"parameters": "Parameters",
|
||||
"results": "Results",
|
||||
|
||||
"paperRollLength": "Paper Roll Length",
|
||||
"paperDensity": "Paper Density",
|
||||
"productionAmount": "Production Amount",
|
||||
"paperCoreDiameter": "Paper Core Diameter",
|
||||
"paperRollWallThickness": "Paper Roll Wall Thickness",
|
||||
"reset": "Reset",
|
||||
"results": "Results",
|
||||
"singlePaperTubeWeight": "Single Paper Tube Weight",
|
||||
"totalPaperTubeWeight": "Total Paper Tube Weight",
|
||||
|
||||
"reset": "Reset"
|
||||
}
|
||||
"paperRollWidth": "Paper Roll Width",
|
||||
"paperThickness": "Paper Thickness",
|
||||
"paperRollWeight": "Paper Roll Weight",
|
||||
"paperLength": "Paper Roll Length"
|
||||
}
|
||||
|
||||
@ -2,21 +2,24 @@
|
||||
"appTitle": "纸管制作辅助生产工具",
|
||||
"beltSpecificationCalculate": "皮带规格计算",
|
||||
"multiLayerPaperTapeWidthAngleCalculate": "多层纸带宽度角度计算",
|
||||
"paperCoreDiameter": "纸芯内径",
|
||||
"paperDensity": "纸张密度",
|
||||
"paperGrammage": "纸张克重",
|
||||
"paperRollExternalDiameter": "纸卷外径",
|
||||
"paperRollLength": "纸卷长度",
|
||||
"paperRollWallThickness": "纸卷壁厚",
|
||||
"paperRollWeightLengthCalculate": "纸卷重量长度计算",
|
||||
"paperTapeWidthAngleCalculate": "纸带宽度角度计算",
|
||||
"paperTubeProductionCalculate": "纸管产能计算",
|
||||
"paperTubeWeightCalculate": "纸管重量计算",
|
||||
|
||||
"parameters": "参数",
|
||||
"results": "结果",
|
||||
|
||||
"paperRollLength": "纸卷长度",
|
||||
"paperDensity": "纸张密度",
|
||||
"productionAmount": "生产数量",
|
||||
"paperCoreDiameter": "纸芯内径",
|
||||
"paperRollWallThickness": "纸卷壁厚",
|
||||
"reset": "重置",
|
||||
"results": "结果",
|
||||
"singlePaperTubeWeight": "单个纸管重量",
|
||||
"totalPaperTubeWeight": "总纸管重量",
|
||||
|
||||
"reset": "重置"
|
||||
}
|
||||
"paperRollWidth": "纸卷宽度",
|
||||
"paperThickness": "纸张厚度",
|
||||
"paperLength": "纸卷长度",
|
||||
"paperRollWeight": "纸卷重量"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user