replaced == with === in Web UI

pull/62/head
13621160019@163.com 2021-08-19 22:44:29 +08:00
parent ea5577c2df
commit e71bc4d671
17 changed files with 17 additions and 17 deletions

View File

@ -103,7 +103,7 @@ const DistributionSystem = ({ setRedirect, setRedirectUrl, t }) => {
setSelectedDistributionSystemID(event.target.value); setSelectedDistributionSystemID(event.target.value);
distributionSystemList.forEach((currentItem, index) => { distributionSystemList.forEach((currentItem, index) => {
if (currentItem['value'] == event.target.value) { if (currentItem['value'] === event.target.value) {
setSelectedDistributionSystemName(currentItem['label']); setSelectedDistributionSystemName(currentItem['label']);
} }
}); });

View File

@ -123,7 +123,7 @@ const EnergyFlowDiagram = ({ setRedirect, setRedirectUrl, t }) => {
} }
energyFlowDiagramData.links.forEach(function (item) { energyFlowDiagramData.links.forEach(function (item) {
if(item.value == null) { if(typeof item.value === 'null') {
item.value = 0; item.value = 0;
} }
let sourceColor = null; let sourceColor = null;

View File

@ -72,7 +72,7 @@ class RealtimeChart extends Component {
//fetch realtime data at regular intervals //fetch realtime data at regular intervals
this.refreshInterval = setInterval(() => { this.refreshInterval = setInterval(() => {
let isResponseOK = false; let isResponseOK = false;
if (this.props.distributionSystemID != undefined) { if (typeof this.props.distributionSystemID !== 'undefined') {
fetch(APIBaseURL + '/reports/distributionsystem?distributionsystemid=' + this.props.distributionSystemID, { fetch(APIBaseURL + '/reports/distributionsystem?distributionsystemid=' + this.props.distributionSystemID, {
method: 'GET', method: 'GET',
headers: { headers: {

View File

@ -346,7 +346,7 @@ const CombinedEquipmentCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -343,7 +343,7 @@ const CombinedEquipmentEnergyCategory = ({ setRedirect, setRedirectUrl, t }) =>
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -341,7 +341,7 @@ const EquipmentCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -340,7 +340,7 @@ const EquipmentEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -6,7 +6,7 @@ import { rgbaColor } from '../../../helpers/utils';
import { withTranslation } from 'react-i18next'; import { withTranslation } from 'react-i18next';
import uuid from 'uuid/v1'; import uuid from 'uuid/v1';
import { APIBaseURL } from '../../../config'; import { APIBaseURL } from '../../../config';
import { getCookieValue, createCookie } from '../../../helpers/utils'; import { getCookieValue } from '../../../helpers/utils';
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';

View File

@ -342,7 +342,7 @@ const ShopfloorCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -339,7 +339,7 @@ const ShopfloorEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -277,7 +277,7 @@ const SpaceCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -276,7 +276,7 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -343,7 +343,7 @@ const StoreCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -339,7 +339,7 @@ const StoreEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -343,7 +343,7 @@ const TenantCost = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -338,7 +338,7 @@ const TenantEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;

View File

@ -151,7 +151,7 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
let timeOfUseArray = []; let timeOfUseArray = [];
json['reporting_period_input']['energy_category_ids'].forEach((currentValue, index) => { json['reporting_period_input']['energy_category_ids'].forEach((currentValue, index) => {
if(currentValue == 1) { if(currentValue === 1) {
// energy_category_id 1 electricity // energy_category_id 1 electricity
let timeOfUseItem = {} let timeOfUseItem = {}
timeOfUseItem['id'] = 1; timeOfUseItem['id'] = 1;