updated Dashboard in web to display energy data of this year
Merge branch 'develop'pull/42/MERGE
commit
53202e6369
|
@ -18,10 +18,10 @@ const ChildSpacesTable = loadable(() => import('../common/ChildSpacesTable'));
|
|||
const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
||||
let current_moment = moment();
|
||||
const [fetchSuccess, setFetchSuccess] = useState(false);
|
||||
const [periodType, setPeriodType] = useState('daily');
|
||||
const [basePeriodBeginsDatetime, setBasePeriodBeginsDatetime] = useState(current_moment.clone().subtract(1, 'months').startOf('month'));
|
||||
const [basePeriodEndsDatetime, setBasePeriodEndsDatetime] = useState(current_moment.clone().subtract(1, 'months'));
|
||||
const [reportingPeriodBeginsDatetime, setReportingPeriodBeginsDatetime] = useState(current_moment.clone().startOf('month'));
|
||||
const [periodType, setPeriodType] = useState('monthly');
|
||||
const [basePeriodBeginsDatetime, setBasePeriodBeginsDatetime] = useState(current_moment.clone().subtract(1, 'years').startOf('year'));
|
||||
const [basePeriodEndsDatetime, setBasePeriodEndsDatetime] = useState(current_moment.clone().subtract(1, 'years'));
|
||||
const [reportingPeriodBeginsDatetime, setReportingPeriodBeginsDatetime] = useState(current_moment.clone().startOf('year'));
|
||||
const [reportingPeriodEndsDatetime, setReportingPeriodEndsDatetime] = useState(current_moment);
|
||||
//Results
|
||||
const [costShareData, setCostShareData] = useState([]);
|
||||
|
@ -358,7 +358,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
{inputCardSummaryList.map(cardSummaryItem => (
|
||||
<CardSummary key={uuid()}
|
||||
rate={cardSummaryItem['increment_rate']}
|
||||
title={t("This Month's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': cardSummaryItem['name'], 'VALUE': null, 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
|
||||
title={t("This Year's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': cardSummaryItem['name'], 'VALUE': null, 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
|
||||
color="success"
|
||||
footnote={t('Per Unit Area')}
|
||||
footvalue={cardSummaryItem['subtotal_per_unit_area']}
|
||||
|
@ -369,7 +369,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
{costCardSummaryList.map(cardSummaryItem => (
|
||||
<CardSummary key={uuid()}
|
||||
rate={cardSummaryItem['increment_rate']}
|
||||
title={t("This Month's Costs CATEGORY VALUE UNIT", { 'CATEGORY': cardSummaryItem['name'], 'VALUE': null, 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
|
||||
title={t("This Year's Costs CATEGORY VALUE UNIT", { 'CATEGORY': cardSummaryItem['name'], 'VALUE': null, 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
|
||||
color="success"
|
||||
footnote={t('Per Unit Area')}
|
||||
footvalue={cardSummaryItem['subtotal_per_unit_area']}
|
||||
|
@ -379,7 +379,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
))}
|
||||
<CardSummary
|
||||
rate={totalInTCE['increment_rate'] || ''}
|
||||
title={t("This Month's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': t('Ton of Standard Coal'), 'UNIT': '(TCE)' })}
|
||||
title={t("This Year's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': t('Ton of Standard Coal'), 'UNIT': '(TCE)' })}
|
||||
color="warning"
|
||||
footnote={t('Per Unit Area')}
|
||||
footvalue={totalInTCE['value_per_unit_area']}
|
||||
|
@ -388,7 +388,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
</CardSummary>
|
||||
<CardSummary
|
||||
rate={totalInTCO2E['increment_rate'] || ''}
|
||||
title={t("This Month's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': t('Ton of Carbon Dioxide Emissions'), 'UNIT': '(TCO2E)' })}
|
||||
title={t("This Year's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': t('Ton of Carbon Dioxide Emissions'), 'UNIT': '(TCO2E)' })}
|
||||
color="warning"
|
||||
footnote={t('Per Unit Area')}
|
||||
footvalue={totalInTCO2E['value_per_unit_area']}
|
||||
|
@ -410,13 +410,13 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
<SharePie data={TCO2EShareData} title={t('Ton of Carbon Dioxide Emissions by Energy Category')} />
|
||||
</Col>
|
||||
</Row>
|
||||
<LineChart reportingTitle={t("This Month's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
|
||||
<LineChart reportingTitle={t("This Year's Consumption CATEGORY VALUE UNIT", { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
|
||||
baseTitle=''
|
||||
labels={spaceInputLineChartLabels}
|
||||
data={spaceInputLineChartData}
|
||||
options={spaceInputLineChartOptions}>
|
||||
</LineChart>
|
||||
<LineChart reportingTitle={t("This Month's Costs CATEGORY VALUE UNIT", { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
|
||||
<LineChart reportingTitle={t("This Year's Costs CATEGORY VALUE UNIT", { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
|
||||
baseTitle=''
|
||||
labels={spaceCostLineChartLabels}
|
||||
data={spaceCostLineChartData}
|
||||
|
@ -431,7 +431,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
|
|||
</LineChart>
|
||||
|
||||
<ChildSpacesTable data={childSpacesTableData}
|
||||
title={t('Child Spaces Data of This Month')}
|
||||
title={t('Child Spaces Data')}
|
||||
columns={childSpacesTableColumns}>
|
||||
</ChildSpacesTable>
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ const resources = {
|
|||
"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 Month's Consumption CATEGORY VALUE UNIT": "This Month's Consumption {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"This Month's Costs CATEGORY VALUE UNIT": "This Month's Costs {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"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}}",
|
||||
// Entities
|
||||
"Space": "Space",
|
||||
"Equipment": "Equipment",
|
||||
|
@ -221,7 +221,6 @@ const resources = {
|
|||
"Tariff": "Tariff",
|
||||
"Detailed Data": "Detailed Data",
|
||||
"Child Spaces Data": "Child Spaces Data",
|
||||
"Child Spaces Data of This Month": "Child Spaces Data of This Month",
|
||||
"Associated Equipment Data": "Associated Equipment Data",
|
||||
"This Year": "This Year",
|
||||
"This Month": "This Month",
|
||||
|
@ -408,8 +407,8 @@ const resources = {
|
|||
"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 Month's Consumption CATEGORY VALUE UNIT": "Der Verbrauch dieses Monats {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"This Month's Costs CATEGORY VALUE UNIT": "Der Kosten dieses Monats {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"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}}",
|
||||
// Entities
|
||||
"Space": "Platz",
|
||||
"Equipment": "Ausrüstung",
|
||||
|
@ -563,7 +562,6 @@ const resources = {
|
|||
"Tariff": "Tarif",
|
||||
"Detailed Data": "Detaillierte Daten",
|
||||
"Child Spaces Data": "Teilplatz Daten",
|
||||
"Child Spaces Data of This Month": "Teilplatz Daten dieses Monats",
|
||||
"Associated Equipment Data": "Dazugehörige Geräte Daten",
|
||||
"This Year": "Dieses Jahr",
|
||||
"This Month": "Diesen Monat",
|
||||
|
@ -753,8 +751,8 @@ const resources = {
|
|||
"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 Month's Consumption CATEGORY VALUE UNIT": "本月消耗 {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"This Month's Costs CATEGORY VALUE UNIT": "本月成本 {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"This Year's Consumption CATEGORY VALUE UNIT": "本年消耗 {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
"This Year's Costs CATEGORY VALUE UNIT": "本年成本 {{CATEGORY}} {{VALUE}} {{UNIT}}",
|
||||
// Entities
|
||||
"Space": "空间",
|
||||
"Equipment": "设备",
|
||||
|
@ -908,7 +906,6 @@ const resources = {
|
|||
"Tariff": "费率",
|
||||
"Detailed Data": "详细数据",
|
||||
"Child Spaces Data": "子空间数据",
|
||||
"Child Spaces Data of This Month": "本月子空间数据",
|
||||
"Associated Equipment Data": "相关设备数据",
|
||||
"This Year": "本年",
|
||||
"This Month": "本月",
|
||||
|
|
Loading…
Reference in New Issue