added ChildSpaceProportion SharePies to Space Energy Category report of Web UI

pull/47/head
13621160019@163.com 2021-06-27 10:19:31 +08:00
parent fc40ba1ad1
commit cbc447b7e2
2 changed files with 61 additions and 23 deletions

View File

@ -86,6 +86,8 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
const [cardSummaryList, setCardSummaryList] = useState([]);
const [totalInTCE, setTotalInTCE] = useState({});
const [totalInTCO2E, setTotalInTCO2E] = useState({});
const [childSpaceProportionList, setChildSpaceProportionList] = useState([]);
const [spaceLineChartLabels, setSpaceLineChartLabels] = useState([]);
const [spaceLineChartData, setSpaceLineChartData] = useState({});
const [spaceLineChartOptions, setSpaceLineChartOptions] = useState([]);
@ -342,6 +344,28 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
});
setTCO2EShareData(TCO2EDataArray);
let childSpaceProportionArray = [];
json['child_space']['energy_category_names'].forEach((currentValue, energyCategoryIndex) => {
if (json['child_space']['child_space_names_array'][energyCategoryIndex].length > 0) {
let childSpaceProportionItem = {}
childSpaceProportionItem['data'] = []
json['child_space']['child_space_names_array'][energyCategoryIndex].forEach((currentSpaceName, spaceIndex) => {
let childSpaceProportionItemDataItem = {}
childSpaceProportionItemDataItem['id'] = spaceIndex;
childSpaceProportionItemDataItem['name'] = currentSpaceName;
childSpaceProportionItemDataItem['value'] = json['child_space']['subtotals_array'][energyCategoryIndex][spaceIndex];
childSpaceProportionItemDataItem['color'] = "#"+((1<<24)*Math.random()|0).toString(16);
childSpaceProportionItem['data'].push(childSpaceProportionItemDataItem);
});
childSpaceProportionItem['name'] = json['child_space']['energy_category_names'][energyCategoryIndex];
childSpaceProportionItem['unit'] = json['child_space']['units'][energyCategoryIndex];
childSpaceProportionArray.push(childSpaceProportionItem);
};
});
setChildSpaceProportionList(childSpaceProportionArray);
let timestamps = {}
json['reporting_period']['timestamps'].forEach((currentValue, index) => {
timestamps['a' + index] = currentValue;
@ -663,6 +687,17 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
<Col className="mb-3 pr-lg-2 mb-3">
<SharePie data={TCO2EShareData} title={t('Ton of Carbon Dioxide Emissions by Energy Category')} />
</Col>
{childSpaceProportionList.map(childSpaceProportionItem => (
<Col className="mb-3 pr-lg-2 mb-3">
<SharePie
data={childSpaceProportionItem['data']}
title={t('Child Space Proportion CATEGORY UNIT',
{'CATEGORY': childSpaceProportionItem['name'],
'UNIT': '(' + childSpaceProportionItem['unit'] + ')'
})}
/>
</Col>
))}
</Row>
<LineChart reportingTitle={t('Reporting Period Consumption CATEGORY VALUE UNIT', { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
baseTitle=''

View File

@ -59,13 +59,6 @@ const resources = {
// Dashboard
"Welcome to MyEMS": "Welcome to MyEMS",
"An Industry Leading Open Source Energy Management System": "An Industry Leading Open Source Energy Management System",
"Costs by Energy Category": "Costs by Energy Category",
"Incomes by Energy Category": "Incomes by Energy Category",
"Electricity Consumption by Time-Of-Use": "Electricity Consumption by Time-Of-Use",
"Electricity Cost by Time-Of-Use": "Electricity Cost by Time-Of-Use",
"CATEGORY UNIT Consumption by Energy Items": "{{CATEGORY}} {{UNIT}} Comsumption by Energy Items",
"Ton of Standard Coal by Energy Category": "Ton of Standard Coal(TCE) by Energy Category",
"Ton of Carbon Dioxide Emissions by Energy Category": "Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category",
"This Year's Consumption CATEGORY VALUE UNIT": "This Year's Consumption {{CATEGORY}} {{VALUE}} {{UNIT}}",
"This Year's Costs CATEGORY VALUE UNIT": "This Year's Costs {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Last Year's Consumption CATEGORY VALUE UNIT": "Last Year's Consumption {{CATEGORY}} {{VALUE}} {{UNIT}}",
@ -146,6 +139,13 @@ const resources = {
"Maximum Load": "Maximum Load",
"Load Factor": "Load Factor",
"Ratio of Average Load to Maximum Load": "Ratio of Average Load to Maximum Load",
"Costs by Energy Category": "Costs by Energy Category",
"Incomes by Energy Category": "Incomes by Energy Category",
"Electricity Consumption by Time-Of-Use": "Electricity Consumption by Time-Of-Use",
"Electricity Cost by Time-Of-Use": "Electricity Cost by Time-Of-Use",
"CATEGORY UNIT Consumption by Energy Items": "{{CATEGORY}} {{UNIT}} Comsumption by Energy Items",
"Ton of Standard Coal by Energy Category": "Ton of Standard Coal(TCE) by Energy Category",
"Ton of Carbon Dioxide Emissions by Energy Category": "Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category",
"Reporting Period Consumption CATEGORY UNIT": "Reporting Period Consumption {{CATEGORY}} {{UNIT}}",
"EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{EQUIPMENT}} Reporting Period Consumption {{CATEGORY}} {{UNIT}}",
"COMBINED_EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{COMBINED_EQUIPMENT}} Reporting Period Consumption {{CATEGORY}} {{UNIT}}",
@ -154,6 +154,7 @@ 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}}",
"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}}",
@ -402,13 +403,6 @@ const resources = {
// Dashboard
"Welcome to MyEMS": 'Willkommen bei MyEMS',
"An Industry Leading Open Source Energy Management System": "Ein branchenführendes Open Source Energie Management System",
"Costs by Energy Category": "Kosten nach Energiekategorie",
"Incomes by Energy Category": "Einkommen nach Energiekategorie",
"Electricity Consumption by Time-Of-Use": "Stromverbrauch nach Nutzungsdauer",
"Electricity Cost by Time-Of-Use": "Stromkosten je nach Nutzungsdauer",
"CATEGORY UNIT Consumption by Energy Items": "{{CATEGORY}} {{UNIT}} nach Unterpunkt Energieverbrauch",
"Ton of Standard Coal by Energy Category": "Tonne Standardkohle(TCE) nach Energiekategorie",
"Ton of Carbon Dioxide Emissions by Energy Category": "Tonne Kohlendioxidemissionen(TCO2E) nach Energiekategorie",
"This Year's Consumption CATEGORY VALUE UNIT": "Der Verbrauch Dieses Jahr {{CATEGORY}} {{VALUE}} {{UNIT}}",
"This Year's Costs CATEGORY VALUE UNIT": "Der Kosten Dieses Jahr {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Last Year's Consumption CATEGORY VALUE UNIT": "Der Verbrauch Letztes Jahr {{CATEGORY}} {{VALUE}} {{UNIT}}",
@ -427,7 +421,7 @@ const resources = {
"Name": "Name",
"Description": "Beschreibung",
"Energy Category": "Energiekategorie",
"Child Spaces": "Teilplatz",
"Child Spaces": "Teil Platz",
"Associated Equipment": "Dazugehörige Geräte",
//Energy Categories
"Electricity": "Elektrizität",
@ -489,6 +483,13 @@ const resources = {
"Maximum Load": "Maximale Last",
"Load Factor": "Ladefaktor",
"Ratio of Average Load to Maximum Load": "Verhältnis von durchschnittlicher Last zu maximaler Last",
"Costs by Energy Category": "Kosten nach Energiekategorie",
"Incomes by Energy Category": "Einkommen nach Energiekategorie",
"Electricity Consumption by Time-Of-Use": "Stromverbrauch nach Nutzungsdauer",
"Electricity Cost by Time-Of-Use": "Stromkosten je nach Nutzungsdauer",
"CATEGORY UNIT Consumption by Energy Items": "{{CATEGORY}} {{UNIT}} nach Unterpunkt Energieverbrauch",
"Ton of Standard Coal by Energy Category": "Tonne Standardkohle(TCE) nach Energiekategorie",
"Ton of Carbon Dioxide Emissions by Energy Category": "Tonne Kohlendioxidemissionen(TCO2E) nach Energiekategorie",
"Reporting Period Consumption CATEGORY UNIT": "Verbrauch des Berichtszeitraums {{CATEGORY}} {{UNIT}}",
"EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{EQUIPMENT}} Verbrauch des Berichtszeitraums {{CATEGORY}} {{UNIT}}",
"COMBINED_EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{COMBINED_EQUIPMENT}} Verbrauch des Berichtszeitraums {{CATEGORY}} {{UNIT}}",
@ -497,6 +498,7 @@ 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}}",
"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}}",
@ -565,7 +567,7 @@ const resources = {
"Related Parameters": "Verwandte Parameter",
"Tariff": "Tarif",
"Detailed Data": "Detaillierte Daten",
"Child Spaces Data": "Teilplatz Daten",
"Child Spaces Data": "Teil Platz Daten",
"Associated Equipment Data": "Dazugehörige Geräte Daten",
"This Year": "Dieses Jahr",
"This Month": "Diesen Monat",
@ -748,13 +750,6 @@ const resources = {
// Dashboard
"Welcome to MyEMS": '欢迎使用MyEMS',
"An Industry Leading Open Source Energy Management System": "行业领先的开源能源管理系统",
"Costs by Energy Category": "成本占比",
"Incomes by Energy Category": "收入占比",
"Electricity Consumption by Time-Of-Use": "分时消耗电量",
"Electricity Cost by Time-Of-Use": "分时用电成本",
"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)占比",
"This Year's Consumption CATEGORY VALUE UNIT": "本年消耗 {{CATEGORY}} {{VALUE}} {{UNIT}}",
"This Year's Costs CATEGORY VALUE UNIT": "本年成本 {{CATEGORY}} {{VALUE}} {{UNIT}}",
"Last Year's Consumption CATEGORY VALUE UNIT": "去年消耗 {{CATEGORY}} {{VALUE}} {{UNIT}}",
@ -835,6 +830,13 @@ const resources = {
"Maximum Load": "最大负荷",
"Load Factor": "负荷系数",
"Ratio of Average Load to Maximum Load": "平均负荷与最大负荷的比值",
"Costs by Energy Category": "成本占比",
"Incomes by Energy Category": "收入占比",
"Electricity Consumption by Time-Of-Use": "分时消耗电量",
"Electricity Cost by Time-Of-Use": "分时用电成本",
"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)占比",
"Reporting Period Consumption CATEGORY UNIT": "报告期消耗 {{CATEGORY}} {{UNIT}}",
"EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{EQUIPMENT}} 报告期消耗 {{CATEGORY}} {{UNIT}}",
"COMBINED_EQUIPMENT Reporting Period Consumption CATEGORY UNIT": "{{COMBINED_EQUIPMENT}} 报告期消耗 {{CATEGORY}} {{UNIT}}",
@ -843,6 +845,7 @@ 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}}",
"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}}",