added translation of Child Space Total Proportion for SpaceCost in Web UI

pull/56/MERGE
13621160019@163.com 2021-07-28 12:35:17 +08:00
parent 4e866dbc58
commit 852bb68ed8
2 changed files with 23 additions and 22 deletions

View File

@ -84,7 +84,7 @@ const SpaceCost = ({ setRedirect, setRedirectUrl, t }) => {
const [spaceLineChartData, setSpaceLineChartData] = useState({});
const [spaceLineChartOptions, setSpaceLineChartOptions] = useState([]);
const [childSpaceProportionList, setChildSpaceProportionList] = useState([]);
const [childSpacetotalProportion, setChildSpacetotalProportion] = useState([]);
const [childSpaceSubtotalShareData, setChildSpaceSubtotalShareData] = useState([]);
const [parameterLineChartLabels, setParameterLineChartLabels] = useState([]);
const [parameterLineChartData, setParameterLineChartData] = useState({});
@ -342,23 +342,22 @@ const SpaceCost = ({ setRedirect, setRedirectUrl, t }) => {
});
setChildSpaceProportionList(childSpaceProportionArray);
let childSpacesProportionArray = [];
let childSpaceSubtotalShareDataArray = [];
if (json['child_space']['child_space_names_array'].length > 0) {
json['child_space']['child_space_names_array'][0].forEach((currentSpaceName, spaceIndex) => {
let total = 0.0;
let subtotal = 0.0;
json['child_space']['energy_category_names'].forEach((currentValue, energyCategoryIndex) => {
total += json['child_space']['subtotals_array'][energyCategoryIndex][spaceIndex]
total = total.toFixed()
subtotal += json['child_space']['subtotals_array'][energyCategoryIndex][spaceIndex];
});
let childSpacesProportionItemDataItem = {};
childSpacesProportionItemDataItem['id'] = spaceIndex;
childSpacesProportionItemDataItem['name'] = currentSpaceName;
childSpacesProportionItemDataItem['value'] = total;
childSpacesProportionItemDataItem['color'] = "#"+((1<<24)*Math.random()|0).toString(16);
childSpacesProportionArray.push(childSpacesProportionItemDataItem);
let childSpaceSubtotalDataItem = {};
childSpaceSubtotalDataItem['id'] = spaceIndex;
childSpaceSubtotalDataItem['name'] = currentSpaceName;
childSpaceSubtotalDataItem['value'] = subtotal;
childSpaceSubtotalDataItem['color'] = "#"+((1<<24)*Math.random()|0).toString(16);
childSpaceSubtotalShareDataArray.push(childSpaceSubtotalDataItem);
});
};
setChildSpacetotalProportion(childSpacesProportionArray);
setChildSpaceSubtotalShareData(childSpaceSubtotalShareDataArray);
let timestamps = {}
json['reporting_period']['timestamps'].forEach((currentValue, index) => {
@ -689,12 +688,12 @@ const SpaceCost = ({ setRedirect, setRedirectUrl, t }) => {
/>
</Col>
))}
<Col className="mb-3 pr-lg-2 mb-3">
<SharePie
data={childSpacetotalProportion}
title={t('Child Space total Proportion CATEGORY UNIT')}
/>
</Col>
<Col className="mb-3 pr-lg-2 mb-3">
<SharePie
data={childSpaceSubtotalShareData}
title={t('Child Space Total Proportion')}
/>
</Col>
</Row>
<LineChart reportingTitle={t('Reporting Period Costs CATEGORY VALUE UNIT', { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}

View File

@ -154,7 +154,8 @@ const resources = {
"Reporting Period Consumption ITEM CATEGORY UNIT": "Reporting Period Consumption {{ITEM}} {{CATEGORY}} {{UNIT}}",
"Reporting Period Consumption ITEM CATEGORY VALUE UNIT": "Reporting Period Consumption {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Consumption ITEM CATEGORY VALUE UNIT": "Base Period Consumption {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "Child Space Proportion {{CATEGORY}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "Child Space Proportion by Energy Category {{CATEGORY}} {{UNIT}}",
"Child Space Total Proportion": "Child Space Total Proportion",
"Reporting Period Costs CATEGORY UNIT": "Reporting Period Costs {{CATEGORY}} {{UNIT}}",
"Reporting Period Costs CATEGORY VALUE UNIT": "Reporting Period Costs {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Costs CATEGORY VALUE UNIT": "Base Period Costs {{CATEGORY}} {{VALUE}} {{UNIT}}",
@ -500,7 +501,8 @@ const resources = {
"Reporting Period Consumption ITEM CATEGORY UNIT": "Verbrauch des Berichtszeitraums {{ITEM}} {{CATEGORY}} {{UNIT}}",
"Reporting Period Consumption ITEM CATEGORY VALUE UNIT": "Verbrauch des Berichtszeitraums {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Consumption ITEM CATEGORY VALUE UNIT": "Verbrauch des Basiszeitraums {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "Anteil des Teil Platz {{CATEGORY}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "Anteil des Teil Platz nach Energiekategorie {{CATEGORY}} {{UNIT}}",
"Child Space Total Proportion": "Anteil des Teil Platz Gesamtanteil",
"Reporting Period Costs CATEGORY UNIT": "Berichtszeitraumkosten {{CATEGORY}} {{UNIT}}",
"Reporting Period Costs CATEGORY VALUE UNIT": "Berichtszeitraumkosten {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Costs CATEGORY VALUE UNIT": "Kosten des Basiszeitraums {{CATEGORY}} {{VALUE}} {{UNIT}}",
@ -838,7 +840,6 @@ const resources = {
"Incomes by Energy Category": "收入占比",
"Electricity Consumption by Time-Of-Use": "分时消耗电量",
"Electricity Cost by Time-Of-Use": "分时用电成本",
"Child Space total Proportion CATEGORY UNIT": "子空间总成本占比",
"CATEGORY UNIT Consumption by Energy Items": "{{CATEGORY}} {{UNIT}} 分项消耗占比",
"Ton of Standard Coal by Energy Category": "吨标准煤(TCE)占比",
"Ton of Carbon Dioxide Emissions by Energy Category": "吨二氧化碳排放(TCO2E)占比",
@ -850,7 +851,8 @@ const resources = {
"Reporting Period Consumption ITEM CATEGORY UNIT": "报告期消耗 {{ITEM}} {{CATEGORY}} {{UNIT}}",
"Reporting Period Consumption ITEM CATEGORY VALUE UNIT": "报告期消耗 {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Consumption ITEM CATEGORY VALUE UNIT": "基准期消耗 {{ITEM}} {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "子空间占比 {{CATEGORY}} {{UNIT}}",
"Child Space Proportion CATEGORY UNIT": "子空间分类占比 {{CATEGORY}} {{UNIT}}",
"Child Space Total Proportion": "子空间总计占比",
"Reporting Period Costs CATEGORY UNIT": "报告期成本 {{CATEGORY}} {{UNIT}}",
"Reporting Period Costs CATEGORY VALUE UNIT": "报告期成本 {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Base Period Costs CATEGORY VALUE UNIT": "基准期成本 {{CATEGORY}} {{VALUE}} {{UNIT}}",