Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Feb 7, 2024
2 parents 063e4fe + c8c09c3 commit ee5528c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,16 @@ const DistributionSystem = ({ setRedirect, setRedirectUrl, t }) => {
}).then(json => {
if (isResponseOK) {
console.log(json);
json.forEach((currentPoint, circuitIndex) => {
let el=document.getElementById("PT"+currentPoint['point_id'])
if(el){
let val = parseFloat(currentPoint['value'])
el.textContent=val.toFixed(2)
json.forEach((currentPoint) => {
let textElement=document.getElementById("PT"+currentPoint['point_id'])
if(textElement){
let tspanList = textElement.getElementsByTagName('tspan')
if (tspanList && tspanList.length > 0) {
let tspanElement = tspanList[tspanList.length - 1]
tspanElement.textContent = parseFloat(currentPoint['value']).toFixed(2)
} else {
textElement.textContent=parseFloat(currentPoint['value']).toFixed(2)
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,16 @@ const EnergyStoragePowerStationDetails = ({ setRedirect, setRedirectUrl, t }) =>
}).then(json => {
if (isResponseOK) {
console.log(json);
json.forEach((currentPoint, circuitIndex) => {
let el=document.getElementById("PT"+currentPoint['point_id'])
if(el){
let val = parseFloat(currentPoint['value'])
el.textContent=val.toFixed(2)
json.forEach((currentPoint) => {
let textElement=document.getElementById("PT"+currentPoint['point_id'])
if(textElement){
let tspanList = textElement.getElementsByTagName('tspan')
if (tspanList && tspanList.length > 0) {
let tspanElement = tspanList[tspanList.length - 1]
tspanElement.textContent = parseFloat(currentPoint['value']).toFixed(2)
} else {
textElement.textContent=parseFloat(currentPoint['value']).toFixed(2)
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,16 @@ const EnergyStoragePowerStationReporting = ({ setRedirect, setRedirectUrl, t })
}).then(json => {
if (isResponseOK) {
console.log(json);
json.forEach((currentPoint, circuitIndex) => {
let el=document.getElementById("PT"+currentPoint['point_id'])
if(el){
let val = parseFloat(currentPoint['value'])
el.textContent=val.toFixed(2)
json.forEach((currentPoint) => {
let textElement=document.getElementById("PT"+currentPoint['point_id'])
if(textElement){
let tspanList = textElement.getElementsByTagName('tspan')
if (tspanList && tspanList.length > 0) {
let tspanElement = tspanList[tspanList.length - 1]
tspanElement.textContent = parseFloat(currentPoint['value']).toFixed(2)
} else {
textElement.textContent=parseFloat(currentPoint['value']).toFixed(2)
}
}
});
}
Expand Down
15 changes: 10 additions & 5 deletions myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,16 @@ const MicrogridDetails = ({ setRedirect, setRedirectUrl, t }) => {
}).then(json => {
if (isResponseOK) {
console.log(json);
json.forEach((currentPoint, circuitIndex) => {
let el=document.getElementById("PT"+currentPoint['point_id'])
if(el){
let val = parseFloat(currentPoint['value'])
el.textContent=val.toFixed(2)
json.forEach((currentPoint) => {
let textElement=document.getElementById("PT"+currentPoint['point_id'])
if(textElement){
let tspanList = textElement.getElementsByTagName('tspan')
if (tspanList && tspanList.length > 0) {
let tspanElement = tspanList[tspanList.length - 1]
tspanElement.textContent = parseFloat(currentPoint['value']).toFixed(2)
} else {
textElement.textContent=parseFloat(currentPoint['value']).toFixed(2)
}
}
});
}
Expand Down
15 changes: 10 additions & 5 deletions myems-web/src/components/MyEMS/Microgrid/MicrogridReporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,16 @@ const MicrogridReporting = ({ setRedirect, setRedirectUrl, t }) => {
}).then(json => {
if (isResponseOK) {
console.log(json);
json.forEach((currentPoint, circuitIndex) => {
let el=document.getElementById("PT"+currentPoint['point_id'])
if(el){
let val = parseFloat(currentPoint['value'])
el.textContent=val.toFixed(2)
json.forEach((currentPoint) => {
let textElement=document.getElementById("PT"+currentPoint['point_id'])
if(textElement){
let tspanList = textElement.getElementsByTagName('tspan')
if (tspanList && tspanList.length > 0) {
let tspanElement = tspanList[tspanList.length - 1]
tspanElement.textContent = parseFloat(currentPoint['value']).toFixed(2)
} else {
textElement.textContent=parseFloat(currentPoint['value']).toFixed(2)
}
}
});
}
Expand Down

0 comments on commit ee5528c

Please sign in to comment.