Feature: 纸管产能计算

This commit is contained in:
2025-07-10 13:39:26 +08:00
parent 6edd08b874
commit b7dbb443a8
5 changed files with 239 additions and 8 deletions

View File

@ -1,11 +1,204 @@
<script setup lang="ts">
</script>
<template>
<div class="calculator-container">
<v-row justify="center">
<!-- 参数输入区域 -->
<v-col
cols="12"
lg="5"
md="6"
>
<v-card
class="pa-6 parameter-card"
elevation="8"
rounded="xl"
>
<v-card-title class="text-h5 mb-6 d-flex align-center">
<v-icon
class="mr-3"
color="primary"
icon="mdi-tune"
size="large"
/>
{{ $t('parameters') }}
</v-card-title>
<v-row>
<v-col cols="12">
<param-input-field
v-model="paperCoreDiameter"
:label="`${$t('paperCoreDiameter')}(${paperCoreDiameter.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="paperRollWallThickness"
:label="`${$t('paperRollWallThickness')}(${paperRollWallThickness.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="paperRollLength"
:label="`${$t('paperRollLength')}(${paperRollLength.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="paperDensity"
:label="`${$t('paperDensity')}(${paperDensity.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="innerPaperWidth"
:label="`${$t('innerPaperWidth')}(${innerPaperWidth.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="workFrequency"
:label="`${$t('workFrequency')}(${workFrequency.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="workTime"
:label="`${$t('workTime')}(${workTime.unit})`"
/>
</v-col>
<v-col cols="12">
<param-input-field
v-model="workEfficiency"
:label="`${$t('workEfficiency')}(${workEfficiency.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"
@click="resetParameters"
>
{{ $t('reset') }}
</v-btn>
</v-row>
</v-card>
</v-col>
<!-- 计算结果区域 -->
<v-col
cols="12"
lg="5"
md="6"
>
<v-card
class="pa-6 result-card"
elevation="8"
rounded="xl"
>
<v-card-title class="text-h5 mb-6 d-flex align-center">
<v-icon
class="mr-3"
color="primary"
icon="mdi-calculator"
size="large"
/>
{{ $t('results') }}
</v-card-title>
<v-row>
<v-col cols="12">
<result-card
:label="$t('feedPaperSpeed')"
:value="result.feedPaperSpeed"
/>
</v-col>
<v-col cols="12">
<result-card
:label="$t('outputSpeed')"
:value="result.outputSpeed"
/>
</v-col>
<v-col cols="12">
<result-card
:label="$t('productionAmountPerHour')"
:value="result.productionAmountPerHour"
/>
</v-col>
<v-col cols="12">
<result-card
:label="$t('productionWeightPerHour')"
:value="result.productionWeightPerHour"
/>
</v-col>
<v-col cols="12">
<result-card
:label="$t('productionAmountPerDay')"
:value="result.productionAmountPerDay"
/>
</v-col>
<v-col cols="12">
<result-card
:label="$t('productionWeightPerDay')"
:value="result.productionWeightPerDay"
/>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</div>
</template>
<style scoped lang="sass">
<script setup lang="ts">
import { computed, ref } from 'vue'
import { createParam, type Param } from '@/types/param'
</style>
const paperCoreDiameter = ref<Param>(createParam(76.2, 'mm'))
const paperRollWallThickness = ref<Param>(createParam(10, 'mm'))
const paperRollLength = ref<Param>(createParam(1000, 'mm'))
const paperDensity = ref<Param>(createParam(0.76, 'g/cm³'))
const innerPaperWidth = ref<Param>(createParam(105, 'mm'))
const workFrequency = ref<Param>(createParam(30, 'Hz'))
const workTime = ref<Param>(createParam(8, 'h'))
const workEfficiency = ref<Param>(createParam(85, '%'))
const result = computed(() => {
const paperRollExternalDiameter = paperCoreDiameter.value.value + 2 * paperRollWallThickness.value.value
const paperRollExternalRadius = paperRollExternalDiameter / 2
const paperCoreInnerRadius = paperCoreDiameter.value.value / 2
const feedPaperSpeed = 50 / 1400 * workFrequency.value.value / 30 * (215 * Math.PI)
const outputSpeed = feedPaperSpeed / (paperRollExternalDiameter * Math.PI) * innerPaperWidth.value.value
const productionAmountPerHour = outputSpeed / 100 * workEfficiency.value.value / (paperRollLength.value.value / 1000) * 60
const productionWeightPerHour = productionAmountPerHour * (Math.PI * (Math.pow(paperRollExternalRadius, 2) - Math.pow(paperCoreInnerRadius, 2)) * paperRollLength.value.value * paperDensity.value.value / 1_000_000)
const productionAmountPerDay = productionAmountPerHour * workTime.value.value
const productionWeightPerDay = productionWeightPerHour * workTime.value.value
return {
feedPaperSpeed: createParam(feedPaperSpeed, 'm/min'),
outputSpeed: createParam(outputSpeed, 'm/min'),
productionAmountPerHour: createParam(productionAmountPerHour, '支/h'),
productionWeightPerHour: createParam(productionWeightPerHour, 'kg/h'),
productionAmountPerDay: createParam(productionAmountPerDay, '支'),
productionWeightPerDay: createParam(productionWeightPerDay, 'kg'),
}
})
const resetParameters = () => {
paperCoreDiameter.value = createParam(76.2, 'mm')
paperRollWallThickness.value = createParam(10, 'mm')
paperRollLength.value = createParam(1000, 'mm')
paperDensity.value = createParam(0.76, 'g/cm³')
innerPaperWidth.value = createParam(105, 'mm')
workFrequency.value = createParam(30, 'Hz')
workTime.value = createParam(8, 'h')
workEfficiency.value = createParam(85, '%')
}
</script>