Passed
Push — master ( 6677f6...de33b9 )
by Guangyu
04:41 queued 10s
created

src/components/MyEMS/CombinedEquipment/CombinedEquipmentOutput.js   A

Complexity

Total Complexity 24
Complexity/F 0

Size

Lines of Code 561
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 24
eloc 492
mnd 24
bc 24
fnc 0
dl 0
loc 561
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React, { Fragment, useEffect, useState } from 'react';
2
import {
3
  Breadcrumb,
4
  BreadcrumbItem,
5
  Row,
6
  Col,
7
  Card,
8
  CardBody,
9
  Button,
10
  ButtonGroup,
11
  Form,
12
  FormGroup,
13
  Input,
14
  Label,
15
  CustomInput
16
} from 'reactstrap';
17
import CountUp from 'react-countup';
18
import Datetime from 'react-datetime';
19
import moment from 'moment';
20
import loadable from '@loadable/component';
21
import Cascader from 'rc-cascader';
22
import CardSummary from '../common/CardSummary';
23
import LineChart from '../common/LineChart';
24
import { getCookieValue, createCookie } from '../../../helpers/utils';
25
import withRedirect from '../../../hoc/withRedirect';
26
import { withTranslation } from 'react-i18next';
27
import { toast } from 'react-toastify';
28
import { APIBaseURL } from '../../../config';
29
import { periodTypeOptions } from '../common/PeriodTypeOptions';
30
import { comparisonTypeOptions } from '../common/ComparisonTypeOptions';
31
32
33
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
34
35
const CombinedEquipmentOutput = ({ setRedirect, setRedirectUrl, t }) => {
36
  let current_moment = moment();
37
  useEffect(() => {
38
    let is_logged_in = getCookieValue('is_logged_in');
39
    let user_name = getCookieValue('user_name');
40
    let user_display_name = getCookieValue('user_display_name');
41
    let user_uuid = getCookieValue('user_uuid');
42
    let token = getCookieValue('token');
43
    if (is_logged_in === null || !is_logged_in) {
44
      setRedirectUrl(`/authentication/basic/login`);
45
      setRedirect(true);
46
    } else {
47
      //update expires time of cookies
48
      createCookie('is_logged_in', true, 1000 * 60 * 60 * 8);
49
      createCookie('user_name', user_name, 1000 * 60 * 60 * 8);
50
      createCookie('user_display_name', user_display_name, 1000 * 60 * 60 * 8);
51
      createCookie('user_uuid', user_uuid, 1000 * 60 * 60 * 8);
52
      createCookie('token', token, 1000 * 60 * 60 * 8);
53
    }
54
  });
55
  // State
56
  // Query Parameters
57
  const [selectedSpaceName, setSelectedSpaceName] = useState(undefined);
58
  const [selectedSpaceID, setSelectedSpaceID] = useState(undefined);
59
  const [combinedEquipmentList, setCombinedEquipmentList] = useState([]);
60
  const [selectedCombinedEquipment, setSelectedCombinedEquipment] = useState(undefined);
61
  const [comparisonType, setComparisonType] = useState('month-on-month');
62
  const [periodType, setPeriodType] = useState('daily');
63
  const [basePeriodBeginsDatetime, setBasePeriodBeginsDatetime] = useState(current_moment.clone().subtract(1, 'months').startOf('month'));
64
  const [basePeriodEndsDatetime, setBasePeriodEndsDatetime] = useState(current_moment.clone().subtract(1, 'months'));
65
  const [basePeriodBeginsDatetimeDisabled, setBasePeriodBeginsDatetimeDisabled] = useState(true);
66
  const [basePeriodEndsDatetimeDisabled, setBasePeriodEndsDatetimeDisabled] = useState(true);
67
  const [reportingPeriodBeginsDatetime, setReportingPeriodBeginsDatetime] = useState(current_moment.clone().startOf('month'));
68
  const [reportingPeriodEndsDatetime, setReportingPeriodEndsDatetime] = useState(current_moment);
69
  const [cascaderOptions, setCascaderOptions] = useState(undefined);
70
  const [isDisabled, setIsDisabled] = useState(true);
71
  //Results
72
  const [cardSummaryList, setCardSummaryList] = useState([]);
73
  const [combinedEquipmentLineChartLabels, setCombinedEquipmentLineChartLabels] = useState([]);
74
  const [combinedEquipmentLineChartData, setCombinedEquipmentLineChartData] = useState({});
75
  const [combinedEquipmentLineChartOptions, setCombinedEquipmentLineChartOptions] = useState([]);
76
77
  const [parameterLineChartLabels, setParameterLineChartLabels] = useState([]);
78
  const [parameterLineChartData, setParameterLineChartData] = useState({});
79
  const [parameterLineChartOptions, setParameterLineChartOptions] = useState([]);
80
81
  const [detailedDataTableData, setDetailedDataTableData] = useState([]);
82
  const [detailedDataTableColumns, setDetailedDataTableColumns] = useState([{dataField: 'startdatetime', text: t('Datetime'), sort: true}]);
83
84
  useEffect(() => {
85
    let isResponseOK = false;
86
    fetch(APIBaseURL + '/spaces/tree', {
87
      method: 'GET',
88
      headers: {
89
        "Content-type": "application/json",
90
        "User-UUID": getCookieValue('user_uuid'),
91
        "Token": getCookieValue('token')
92
      },
93
      body: null,
94
95
    }).then(response => {
96
      console.log(response)
97
      if (response.ok) {
98
        isResponseOK = true;
99
      }
100
      return response.json();
101
    }).then(json => {
102
      console.log(json)
103
      if (isResponseOK) {
104
        // rename keys 
105
        json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
106
        setCascaderOptions(json);
107
        setSelectedSpaceName([json[0]].map(o => o.label));
108
        setSelectedSpaceID([json[0]].map(o => o.value));
109
        // get Combined Equipments by root Space ID
110
        let isResponseOK = false;
111
        fetch(APIBaseURL + '/spaces/' + [json[0]].map(o => o.value) + '/combinedequipments', {
112
          method: 'GET',
113
          headers: {
114
            "Content-type": "application/json",
115
            "User-UUID": getCookieValue('user_uuid'),
116
            "Token": getCookieValue('token')
117
          },
118
          body: null,
119
120
        }).then(response => {
121
          if (response.ok) {
122
            isResponseOK = true;
123
          }
124
          return response.json();
125
        }).then(json => {
126
          if (isResponseOK) {
127
            json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
128
            console.log(json);
129
            setCombinedEquipmentList(json[0]);
130
            if (json[0].length > 0) {
131
              setSelectedCombinedEquipment(json[0][0].value);
132
              setIsDisabled(false);
133
            } else {
134
              setSelectedCombinedEquipment(undefined);
135
              setIsDisabled(true);
136
            }
137
          } else {
138
            toast.error(json.description)
139
          }
140
        }).catch(err => {
141
          console.log(err);
142
        });
143
        // end of get Combined Equipments by root Space ID
144
      } else {
145
        toast.error(json.description)
146
      }
147
    }).catch(err => {
148
      console.log(err);
149
    });
150
151
  }, []);
152
153
  const labelClasses = 'ls text-uppercase text-600 font-weight-semi-bold mb-0';
154
155
  let onSpaceCascaderChange = (value, selectedOptions) => {
156
    setSelectedSpaceName(selectedOptions.map(o => o.label).join('/'));
157
    setSelectedSpaceID(value[value.length - 1]);
158
159
    let isResponseOK = false;
160
    fetch(APIBaseURL + '/spaces/' + value[value.length - 1] + '/combinedequipments', {
161
      method: 'GET',
162
      headers: {
163
        "Content-type": "application/json",
164
        "User-UUID": getCookieValue('user_uuid'),
165
        "Token": getCookieValue('token')
166
      },
167
      body: null,
168
169
    }).then(response => {
170
      if (response.ok) {
171
        isResponseOK = true;
172
      }
173
      return response.json();
174
    }).then(json => {
175
      if (isResponseOK) {
176
        json = JSON.parse(JSON.stringify([json]).split('"id":').join('"value":').split('"name":').join('"label":'));
177
        console.log(json)
178
        setCombinedEquipmentList(json[0]);
179
        if (json[0].length > 0) {
180
          setSelectedCombinedEquipment(json[0][0].value);
181
          setIsDisabled(false);
182
        } else {
183
          setSelectedCombinedEquipment(undefined);
184
          setIsDisabled(true);
185
        }
186
      } else {
187
        toast.error(json.description)
188
      }
189
    }).catch(err => {
190
      console.log(err);
191
    });
192
  }
193
194
  let onComparisonTypeChange = ({ target }) => {
195
    console.log(target.value);
196
    setComparisonType(target.value);
197
    if (target.value === 'year-over-year') {
198
      setBasePeriodBeginsDatetimeDisabled(true);
199
      setBasePeriodEndsDatetimeDisabled(true);
200
      setBasePeriodBeginsDatetime(moment(reportingPeriodBeginsDatetime).subtract(1, 'years'));
201
      setBasePeriodEndsDatetime(moment(reportingPeriodEndsDatetime).subtract(1, 'years'));
202
    } else if (target.value === 'month-on-month') {
203
      setBasePeriodBeginsDatetimeDisabled(true);
204
      setBasePeriodEndsDatetimeDisabled(true);
205
      setBasePeriodBeginsDatetime(moment(reportingPeriodBeginsDatetime).subtract(1, 'months'));
206
      setBasePeriodEndsDatetime(moment(reportingPeriodEndsDatetime).subtract(1, 'months'));
207
    } else if (target.value === 'free-comparison') {
208
      setBasePeriodBeginsDatetimeDisabled(false);
209
      setBasePeriodEndsDatetimeDisabled(false);
210
    } else if (target.value === 'none-comparison') {
211
      setBasePeriodBeginsDatetime(undefined);
212
      setBasePeriodEndsDatetime(undefined);
213
      setBasePeriodBeginsDatetimeDisabled(true);
214
      setBasePeriodEndsDatetimeDisabled(true);
215
    }
216
  }
217
218
  let onBasePeriodBeginsDatetimeChange = (newDateTime) => {
219
    setBasePeriodBeginsDatetime(newDateTime);
220
  }
221
222
  let onBasePeriodEndsDatetimeChange = (newDateTime) => {
223
    setBasePeriodEndsDatetime(newDateTime);
224
  }
225
226
  let onReportingPeriodBeginsDatetimeChange = (newDateTime) => {
227
    setReportingPeriodBeginsDatetime(newDateTime);
228
    if (comparisonType === 'year-over-year') {
229
      setBasePeriodBeginsDatetime(newDateTime.clone().subtract(1, 'years'));
230
    } else if (comparisonType === 'month-on-month') {
231
      setBasePeriodBeginsDatetime(newDateTime.clone().subtract(1, 'months'));
232
    }
233
  }
234
235
  let onReportingPeriodEndsDatetimeChange = (newDateTime) => {
236
    setReportingPeriodEndsDatetime(newDateTime);
237
    if (comparisonType === 'year-over-year') {
238
      setBasePeriodEndsDatetime(newDateTime.clone().subtract(1, 'years'));
239
    } else if (comparisonType === 'month-on-month') {
240
      setBasePeriodEndsDatetime(newDateTime.clone().subtract(1, 'months'));
241
    }
242
  }
243
244
  var getValidBasePeriodBeginsDatetimes = function (currentDate) {
245
    return currentDate.isBefore(moment(basePeriodEndsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
246
  }
247
248
  var getValidBasePeriodEndsDatetimes = function (currentDate) {
249
    return currentDate.isAfter(moment(basePeriodBeginsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
250
  }
251
252
  var getValidReportingPeriodBeginsDatetimes = function (currentDate) {
253
    return currentDate.isBefore(moment(reportingPeriodEndsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
254
  }
255
256
  var getValidReportingPeriodEndsDatetimes = function (currentDate) {
257
    return currentDate.isAfter(moment(reportingPeriodBeginsDatetime, 'MM/DD/YYYY, hh:mm:ss a'));
258
  }
259
260
  // Handler
261
  const handleSubmit = e => {
262
    e.preventDefault();
263
    console.log('handleSubmit');
264
    console.log(selectedSpaceID);
265
    console.log(selectedCombinedEquipment);
266
    console.log(periodType);
267
    console.log(basePeriodBeginsDatetime != null ? basePeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') : undefined);
268
    console.log(basePeriodEndsDatetime != null ? basePeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss') : undefined);
269
    console.log(reportingPeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss'));
270
    console.log(reportingPeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss'));
271
272
    // Reinitialize tables
273
    setDetailedDataTableData([]);
274
    
275
    let isResponseOK = false;
276
    fetch(APIBaseURL + '/reports/combinedequipmentoutput?' +
277
      'combinedequipmentid=' + selectedCombinedEquipment +
278
      '&periodtype=' + periodType +
279
      '&baseperiodstartdatetime=' + (basePeriodBeginsDatetime != null ? basePeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') : '') +
280
      '&baseperiodenddatetime=' + (basePeriodEndsDatetime != null ? basePeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss') : '') +
281
      '&reportingperiodstartdatetime=' + reportingPeriodBeginsDatetime.format('YYYY-MM-DDTHH:mm:ss') +
282
      '&reportingperiodenddatetime=' + reportingPeriodEndsDatetime.format('YYYY-MM-DDTHH:mm:ss'), {
283
      method: 'GET',
284
      headers: {
285
        "Content-type": "application/json",
286
        "User-UUID": getCookieValue('user_uuid'),
287
        "Token": getCookieValue('token')
288
      },
289
      body: null,
290
291
    }).then(response => {
292
      if (response.ok) {
293
        isResponseOK = true;
294
      }
295
      return response.json();
296
    }).then(json => {
297
      if (isResponseOK) {
298
        console.log(json)
299
                    
300
        let cardSummaryArray = []
301
        json['reporting_period']['names'].forEach((currentValue, index) => {
302
          let cardSummaryItem = {}
303
          cardSummaryItem['name'] = json['reporting_period']['names'][index];
304
          cardSummaryItem['unit'] = json['reporting_period']['units'][index];
305
          cardSummaryItem['subtotal'] = json['reporting_period']['subtotals'][index];
306
          cardSummaryItem['increment_rate'] = parseFloat(json['reporting_period']['increment_rates'][index] * 100).toFixed(2) + "%";
307
          cardSummaryArray.push(cardSummaryItem);
308
        });
309
        setCardSummaryList(cardSummaryArray);
310
311
        let timestamps = {}
312
        json['reporting_period']['timestamps'].forEach((currentValue, index) => {
313
          timestamps['a' + index] = currentValue;
314
        });
315
        setCombinedEquipmentLineChartLabels(timestamps);
316
        
317
        let values = {}
318
        json['reporting_period']['values'].forEach((currentValue, index) => {
319
          values['a' + index] = currentValue;
320
        });
321
        setCombinedEquipmentLineChartData(values);
322
        
323
        let names = Array();
324
        json['reporting_period']['names'].forEach((currentValue, index) => {
325
          let unit = json['reporting_period']['units'][index];
326
          names.push({ 'value': 'a' + index, 'label': currentValue + ' (' + unit + ')'});
327
        });
328
        setCombinedEquipmentLineChartOptions(names);
329
       
330
        timestamps = {}
331
        json['parameters']['timestamps'].forEach((currentValue, index) => {
332
          timestamps['a' + index] = currentValue;
333
        });
334
        setParameterLineChartLabels(timestamps);
335
336
        values = {}
337
        json['parameters']['values'].forEach((currentValue, index) => {
338
          values['a' + index] = currentValue;
339
        });
340
        setParameterLineChartData(values);
341
      
342
        names = Array();
343
        json['parameters']['names'].forEach((currentValue, index) => {
344
          if (currentValue.startsWith('TARIFF-')) {
345
            currentValue = t('Tariff') + currentValue.replace('TARIFF-', '-');
346
          }
347
          
348
          names.push({ 'value': 'a' + index, 'label': currentValue });
349
        });
350
        setParameterLineChartOptions(names);
351
      
352
        let detailed_value_list = [];
353
        json['reporting_period']['timestamps'][0].forEach((currentTimestamp, timestampIndex) => {
354
          let detailed_value = {};
355
          detailed_value['id'] = timestampIndex;
356
          detailed_value['startdatetime'] = currentTimestamp;
357
          json['reporting_period']['values'].forEach((currentValue, energyCategoryIndex) => {
358
            detailed_value['a' + energyCategoryIndex] = json['reporting_period']['values'][energyCategoryIndex][timestampIndex].toFixed(2);
359
          });
360
          detailed_value_list.push(detailed_value);
361
        });
362
363
        let detailed_value = {};
364
        detailed_value['id'] = detailed_value_list.length;
365
        detailed_value['startdatetime'] = t('Subtotal');
366
        json['reporting_period']['subtotals'].forEach((currentValue, index) => {
367
            detailed_value['a' + index] = currentValue.toFixed(2);
368
          });
369
        detailed_value_list.push(detailed_value);
370
        setDetailedDataTableData(detailed_value_list);
371
        
372
        let detailed_column_list = [];
373
        detailed_column_list.push({
374
          dataField: 'startdatetime',
375
          text: t('Datetime'),
376
          sort: true
377
        })
378
        json['reporting_period']['names'].forEach((currentValue, index) => {
379
          let unit = json['reporting_period']['units'][index];
380
          detailed_column_list.push({
381
            dataField: 'a' + index,
382
            text: currentValue + ' (' + unit + ')',
383
            sort: true
384
          })
385
        });
386
        setDetailedDataTableColumns(detailed_column_list);
387
      } else {
388
        toast.error(json.description)
389
      }
390
    }).catch(err => {
391
      console.log(err);
392
    });
393
394
  };
395
396
  return (
397
    <Fragment>
398
      <div>
399
        <Breadcrumb>
400
          <BreadcrumbItem>{t('Combined Equipment Data')}</BreadcrumbItem><BreadcrumbItem active>{t('Output')}</BreadcrumbItem>
401
        </Breadcrumb>
402
      </div>
403
      <Card className="bg-light mb-3">
404
        <CardBody className="p-3">
405
          <Form onSubmit={handleSubmit}>
406
            <Row form>
407
              <Col xs="auto">
408
                <FormGroup className="form-group">
409
                  <Label className={labelClasses} for="space">
410
                    {t('Space')}
411
                  </Label>
412
                  <br />
413
                  <Cascader options={cascaderOptions}
414
                    onChange={onSpaceCascaderChange}
415
                    changeOnSelect
416
                    expandTrigger="hover">
417
                    <Input value={selectedSpaceName || ''} readOnly />
418
                  </Cascader>
419
                </FormGroup>
420
              </Col>
421
              <Col xs="auto">
422
                <FormGroup>
423
                  <Label className={labelClasses} for="combinedEquipmentSelect">
424
                    {t('Combined Equipment')}
425
                  </Label>
426
                  <CustomInput type="select" id="combinedEquipmentSelect" name="combinedEquipmentSelect" onChange={({ target }) => setSelectedCombinedEquipment(target.value)}
427
                  >
428
                    {combinedEquipmentList.map((combinedEquipment, index) => (
429
                      <option value={combinedEquipment.value} key={combinedEquipment.value}>
430
                        {combinedEquipment.label}
431
                      </option>
432
                    ))}
433
                  </CustomInput>
434
                </FormGroup>
435
              </Col>
436
              <Col xs="auto">
437
                <FormGroup>
438
                  <Label className={labelClasses} for="comparisonType">
439
                    {t('Comparison Types')}
440
                  </Label>
441
                  <CustomInput type="select" id="comparisonType" name="comparisonType"
442
                    defaultValue="month-on-month"
443
                    onChange={onComparisonTypeChange}
444
                  >
445
                    {comparisonTypeOptions.map((comparisonType, index) => (
446
                      <option value={comparisonType.value} key={comparisonType.value} >
447
                        {t(comparisonType.label)}
448
                      </option>
449
                    ))}
450
                  </CustomInput>
451
                </FormGroup>
452
              </Col>
453
              <Col xs="auto">
454
                <FormGroup>
455
                  <Label className={labelClasses} for="periodType">
456
                    {t('Period Types')}
457
                  </Label>
458
                  <CustomInput type="select" id="periodType" name="periodType" defaultValue="daily" onChange={({ target }) => setPeriodType(target.value)}
459
                  >
460
                    {periodTypeOptions.map((periodType, index) => (
461
                      <option value={periodType.value} key={periodType.value} >
462
                        {t(periodType.label)}
463
                      </option>
464
                    ))}
465
                  </CustomInput>
466
                </FormGroup>
467
              </Col>
468
              <Col xs="auto">
469
                <FormGroup className="form-group">
470
                  <Label className={labelClasses} for="basePeriodBeginsDatetime">
471
                    {t('Base Period Begins')}{t('(Optional)')}
472
                  </Label>
473
                  <Datetime id='basePeriodBeginsDatetime'
474
                    value={basePeriodBeginsDatetime}
475
                    inputProps={{ disabled: basePeriodBeginsDatetimeDisabled }}
476
                    onChange={onBasePeriodBeginsDatetimeChange}
477
                    isValidDate={getValidBasePeriodBeginsDatetimes}
478
                    closeOnSelect={true} />
479
                </FormGroup>
480
              </Col>
481
              <Col xs="auto">
482
                <FormGroup className="form-group">
483
                  <Label className={labelClasses} for="basePeriodEndsDatetime">
484
                    {t('Base Period Ends')}{t('(Optional)')}
485
                  </Label>
486
                  <Datetime id='basePeriodEndsDatetime'
487
                    value={basePeriodEndsDatetime}
488
                    inputProps={{ disabled: basePeriodEndsDatetimeDisabled }}
489
                    onChange={onBasePeriodEndsDatetimeChange}
490
                    isValidDate={getValidBasePeriodEndsDatetimes}
491
                    closeOnSelect={true} />
492
                </FormGroup>
493
              </Col>
494
              <Col xs="auto">
495
                <FormGroup className="form-group">
496
                  <Label className={labelClasses} for="reportingPeriodBeginsDatetime">
497
                    {t('Reporting Period Begins')}
498
                  </Label>
499
                  <Datetime id='reportingPeriodBeginsDatetime'
500
                    value={reportingPeriodBeginsDatetime}
501
                    onChange={onReportingPeriodBeginsDatetimeChange}
502
                    isValidDate={getValidReportingPeriodBeginsDatetimes}
503
                    closeOnSelect={true} />
504
                </FormGroup>
505
              </Col>
506
              <Col xs="auto">
507
                <FormGroup className="form-group">
508
                  <Label className={labelClasses} for="reportingPeriodEndsDatetime">
509
                    {t('Reporting Period Ends')}
510
                  </Label>
511
                  <Datetime id='reportingPeriodEndsDatetime'
512
                    value={reportingPeriodEndsDatetime}
513
                    onChange={onReportingPeriodEndsDatetimeChange}
514
                    isValidDate={getValidReportingPeriodEndsDatetimes}
515
                    closeOnSelect={true} />
516
                </FormGroup>
517
              </Col>
518
              <Col xs="auto">
519
                <FormGroup>
520
                  <br></br>
521
                  <ButtonGroup id="submit">
522
                    <Button color="success" disabled={isDisabled} >{t('Submit')}</Button>
523
                  </ButtonGroup>
524
                </FormGroup>
525
              </Col>
526
            </Row>
527
          </Form>
528
        </CardBody>
529
      </Card>
530
      <div className="card-deck">
531
      {cardSummaryList.map(cardSummaryItem => (
532
          <CardSummary key={cardSummaryItem['name']}
533
            rate={cardSummaryItem['increment_rate']}
534
            title={t('Reporting Period Output CATEGORY UNIT', { 'CATEGORY': cardSummaryItem['name'], 'UNIT': '(' + cardSummaryItem['unit'] + ')' })}
535
            color="success" >
536
            {cardSummaryItem['subtotal'] && <CountUp end={cardSummaryItem['subtotal']} duration={2} prefix="" separator="," decimal="." decimals={2} />}
537
          </CardSummary>
538
        ))}
539
      </div>
540
      <LineChart reportingTitle={t('Reporting Period Output CATEGORY VALUE UNIT', { 'CATEGORY': null, 'VALUE': null, 'UNIT': null })}
541
        baseTitle=''
542
        labels={combinedEquipmentLineChartLabels}
543
        data={combinedEquipmentLineChartData}
544
        options={combinedEquipmentLineChartOptions}>
545
      </LineChart>
546
      <LineChart reportingTitle={t('Related Parameters')}
547
        baseTitle=''
548
        labels={parameterLineChartLabels}
549
        data={parameterLineChartData}
550
        options={parameterLineChartOptions}>
551
      </LineChart>
552
      <br />
553
      <DetailedDataTable data={detailedDataTableData} title={t('Detailed Data')} columns={detailedDataTableColumns} pagesize={50} >
554
      </DetailedDataTable>
555
556
    </Fragment>
557
  );
558
};
559
560
export default withTranslation()(withRedirect(CombinedEquipmentOutput));
561