Commit 96662896 by Chaiwith Santaweesuk

update site table

parent e626689e
......@@ -267,7 +267,7 @@ class Home extends Component {
keycardMax: Math.round(this.getMax(response.data.queries[0].results[3].values) * 100) / 100,
keycardMin: Math.round(this.getMin(response.data.queries[0].results[3].values) * 100) / 100,
keycardAvg: Math.round(this.getAvg(response.data.queries[0].results[3].values) * 100) / 100,
table: this.getTable(response.data.queries[0].results),
table: this.getTable(this.state.allDeviceInfo[this.state.allDevicesId.indexOf(deviceId || this.state.allDevicesId[0])].name,response.data.queries[0].results),
});
} catch (error) {
console.error(error);
......@@ -315,11 +315,11 @@ class Home extends Component {
return total;
};
getTable = data => {
getTable = (site,data) => {
let table = [];
for (let i = 0, len = data[1].values.length; i < len; i++) {
let v = {
site: 'Pichaiyat Building',
site:site,
people: data[1].values[i][1],
revenue: data[4].values[i][1],
remote: data[2].values[i][1],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment