diff --git a/src/components/ModularFactoryDrawerContent.tsx b/src/components/ModularFactoryDrawerContent.tsx index 0f483da..fb39986 100644 --- a/src/components/ModularFactoryDrawerContent.tsx +++ b/src/components/ModularFactoryDrawerContent.tsx @@ -1,5 +1,5 @@ import { computed, defineComponent, type PropType } from 'vue' -import { useI18n } from 'vue-i18n' +import { I18nT, useI18n } from 'vue-i18n' import { NButton, NDataTable, @@ -31,6 +31,12 @@ const renderItemQuantityPerMinute = ({ const item = getItemById(itemId) + const quantityPerMinuteCeil2 = new Decimal(quantityPerMinute) + .mul(100) + .ceil() + .div(100) + .toNumber() + return (
{t(`items.${item.key}`)}
- {new Decimal(quantityPerMinute).mul(100).ceil().div(100).toNumber()} - {t(`perMinute`)} + + {quantityPerMinuteCeil2} + {t('itemUnitName', quantityPerMinuteCeil2)} +
@@ -104,11 +112,7 @@ function createColumns({ }} min={0} max={1000000} - > - {{ - suffix: () => t('perMinute'), - }} - + /> ) }, }, @@ -147,11 +151,10 @@ function createColumns({ {t(`buildings.${building.key}`)}
- {buildingQuantityCeil} + {buildingQuantityCeil} {buildingQuantityCeil !== buildingQuantityCeil2 && ( - <>({buildingQuantityCeil2}) + <> ({buildingQuantityCeil2}) )} - {t(`buildingUnits`)}
@@ -171,9 +174,11 @@ function createColumns({ return (
- {new Decimal(assemblyLineComputed.averageTotalPowerUsage) - .ceil() - .toNumber()} + + {new Decimal(assemblyLineComputed.averageTotalPowerUsage) + .ceil() + .toNumber()} + {' MW'}
{isArray(assemblyLineComputed.totalPowerUsage) && ( diff --git a/src/locales/en.yml b/src/locales/en.yml index b7235b6..5d2e9ab 100644 --- a/src/locales/en.yml +++ b/src/locales/en.yml @@ -33,5 +33,7 @@ targetItem: Target Item building: Building targetItemSpeed: Target Item Speed perMinute: /min +itemUnitName: unit | units +fluidUnitName: m³ +unitsPerMinute: '{0} {1}/min' seconds: s -buildingUnits: ' units' diff --git a/src/locales/zh-CN.yml b/src/locales/zh-CN.yml index 298950b..4a5b11c 100644 --- a/src/locales/zh-CN.yml +++ b/src/locales/zh-CN.yml @@ -33,5 +33,7 @@ targetItem: 目标物品 building: 建筑 targetItemSpeed: 目标物品速率 perMinute: /分钟 +itemUnitName: 个 +fluidUnitName: 立方米 +unitsPerMinute: '每分钟 {0} {1}' seconds: 秒 -buildingUnits: 台