|
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
|
<div class="flex items-center w-full md:w-1/2">
<span class="inline-block w-[110px] mr-6 text-right text-gray-700 py-2">米数</span>
<a-input-number v-model:value="aluminumFoilLength5">
<template #addonAfter>m</template>
</a-input-number>
</div>
<div class="flex items-center w-full md:w-1/2">
<span class="inline-block w-[110px] mr-6 text-right text-gray-700 py-2">重量</span>
{{ aluminumFoilWeight5 + ' kg' }}
</div>
</div>
</a-form>
</div>
<div class="p-2 mb-4 bg-gray-100 rounded-lg shadow-sm">
<h3 class="pl-2 font-bold my-3 text-[16px]">
根据重量算米数
</h3>
<a-form>
<div class="flex flex-wrap">
<div class="flex items-center w-full md:w-1/2">
<span class="inline-block w-[110px] mr-6 text-right text-gray-700 py-2">需求重量</span>
<a-input-number v-model:value="demandAluminumFoilWeight5">
<template #addonAfter>kg</template>
</a-input-number>
</div>
<div class="flex items-center w-full md:w-1/2">
<span class="inline-block w-[110px] mr-6 text-right text-gray-700 py-2">需求米数</span>
{{ demandAluminumFoilLength5 + ' m' }}
</div>
</div>
</a-form>
</div>
</a-tab-pane>
</a-tabs>
<div class="fixed left-0 flex justify-end w-full bottom-4">
<div class="w-[90%] sm:w-[800px] m-auto text-right">
<a-button type="primary" @click="handleSave" class="bg-[#1677ff] w-[85px]">
计算
</a-button>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { FloatAdd, FloatDiv, FloatMul, FloatSub, roundToDecimal } from '../utils/NumberUtils'
document.title = "理论数据计算器";
const activeKey = ref("1");
const PI = 3.1415926;
const lithiumWaferDensity = ref(0.534);
const diameter = ref(18);
const thickness = ref(1);
const numberOfPieces = ref(2000);
const weight = ref(272);
const requiredWeight = ref(100);
const numberOfRequiredPieces = ref(736);
const lithiumStripDensity2 = ref(0.534);
const thickness2 = ref(0.05);
const width2 = ref(100);
const length2 = ref(47);
const weight2 = ref(125);
const demandWeight2 = ref(50);
const demandLength2 = ref(18.7);
const lithiumStripDensity3 = ref(0.534);
const copperFoilDensity3 = ref(8.9);
const lithiumStripThickness3 = ref(50);
const copperFoilThickness3 = ref(8);
const lithiumStripWidth3 = ref(65);
const copperFoilWidth3 = ref(80);
const lithiumStripLayers3 = ref(1);
const length3 = ref(13.0);
const lithiumStripWeight3 = ref(23);
const copperFoilWeight3 = ref(74);
const totalWeight3 = ref(97);
const copperFoilDensity4 = ref(8.9);
const thickness4 = ref(8);
const width4 = ref(250);
const length4 = ref(100);
const weight4 = ref(1.780);
const demandWeight4 = ref(5);
const demandLength4 = ref(281);
const aluminumFoilDensity5 = ref(2.7);
const aluminumFoilThickness5 = ref(12);
const aluminumFoilWidth5 = ref(240);
const aluminumFoilLength5 = ref(300);
const aluminumFoilWeight5 = ref(2.333);
const demandAluminumFoilWeight5 = ref(3);
const demandAluminumFoilLength5 = ref(386);
const handleSave = async () => {
//重量计算
let weightTemp1 = FloatMul(lithiumWaferDensity.value, PI);
let weightTemp2 = FloatDiv(diameter.value, 10);
let weightTemp3 = FloatDiv(weightTemp2, 2);
weight.value = roundToDecimal(FloatMul(FloatDiv(FloatMul(FloatMul(FloatMul(weightTemp1, weightTemp3), weightTemp3), thickness.value), 10), numberOfPieces.value), 1);
//需求片数计算
let numberOfRequiredPiecesTemp1 = FloatDiv(requiredWeight.value, lithiumWaferDensity.value);
let numberOfRequiredPiecesTemp2 = FloatDiv(FloatDiv(diameter.value, 10), 2);
let numberOfRequiredPiecesTemp3 = FloatMul(FloatMul(numberOfRequiredPiecesTemp2, PI), numberOfRequiredPiecesTemp2);
let numberOfRequiredPiecesTemp4 = FloatMul(numberOfRequiredPiecesTemp3, thickness.value);
numberOfRequiredPieces.value = roundToDecimal(FloatDiv(numberOfRequiredPiecesTemp1, FloatDiv(numberOfRequiredPiecesTemp4, 10)), 1);
//根据米数算重量
let weight2Temp1 = FloatDiv(FloatMul(thickness2.value, lithiumStripDensity2.value), 10);
let weight2Temp2 = FloatMul(FloatMul(FloatDiv(width2.value, 10), length2.value), 100);
weight2.value = roundToDecimal(FloatMul(weight2Temp1, weight2Temp2), 2);
//根据重量算米数
let demandLength2Temp1 = FloatDiv(demandWeight2.value, lithiumStripDensity2.value);
let demandLength2Temp2 = FloatDiv(FloatMul(FloatDiv(thickness2.value, 10), width2.value), 10);
demandLength2.value = roundToDecimal(FloatDiv(FloatDiv(demandLength2Temp1, demandLength2Temp2), 100), 1);
//锂带重量计算
let lithiumStripWeight3Temp1 = FloatMul(FloatMul(lithiumStripDensity3.value, lithiumStripThickness3.value), lithiumStripLayers3.value);
let lithiumStripWeight3Temp2 = FloatDiv(FloatMul(FloatDiv(lithiumStripWeight3Temp1, 10000), lithiumStripWidth3.value), 10);
lithiumStripWeight3.value = roundToDecimal(FloatMul(FloatMul(lithiumStripWeight3Temp2, length3.value), 100), 1);
//铜箔重量计算
let copperFoilWeight3Temp1 = FloatDiv(FloatMul(copperFoilThickness3.value, copperFoilDensity3.value), 10000);
let copperFoilWeight3Temp2 = FloatDiv(FloatMul(copperFoilWeight3Temp1, copperFoilWidth3.value), 10);
copperFoilWeight3.value = roundToDecimal(FloatMul(FloatMul(copperFoilWeight3Temp2, length3.value), 100), 1);
//总重量计算
totalWeight3.value = roundToDecimal(FloatAdd(lithiumStripWeight3.value, copperFoilWeight3.value), 1);
//根据米数计算重量:铜箔重量
let weight4Temp1 = FloatMul(FloatDiv(FloatMul(copperFoilDensity4.value, thickness4.value), 10000), width4.value);
let weight4Temp2 = FloatMul(FloatDiv(weight4Temp1, 10), length4.value);
weight4.value = roundToDecimal(FloatDiv(FloatMul(weight4Temp2, 100), 1000), 1);
//根据重量计算米数:需求米数
let demandLength4Temp1 = FloatDiv(FloatMul(demandWeight4.value, 1000), copperFoilDensity4.value);
let demandLength4Temp2 = FloatDiv(FloatMul(FloatDiv(thickness4.value, 10000), width4.value), 10);
demandLength4.value = roundToDecimal(FloatDiv(FloatDiv(demandLength4Temp1, demandLength4Temp2), 100), 1);
//根据米数计算重量:铜箔重量
let weight5Temp1 = FloatMul(FloatDiv(FloatMul(aluminumFoilDensity5.value, aluminumFoilThickness5.value), 10000), aluminumFoilWidth5.value);
let weight5Temp2 = FloatMul(FloatDiv(weight5Temp1, 10), aluminumFoilLength5.value);
aluminumFoilWeight5.value = roundToDecimal(FloatDiv(FloatMul(weight5Temp2, 100), 1000), 1);
//根据重量计算米数:需求米数
let demandLength5Temp1 = FloatDiv(FloatMul(demandAluminumFoilWeight5.value, 1000), aluminumFoilDensity5.value);
let demandLength5Temp2 = FloatDiv(FloatMul(FloatDiv(aluminumFoilThickness5.value, 10000), aluminumFoilWidth5.value), 10);
demandAluminumFoilLength5.value = roundToDecimal(FloatDiv(FloatDiv(demandLength5Temp1, demandLength5Temp2), 100), 1);
};
</script>
|