- Update screen 14 29 - Remove mock data dashboard
This commit is contained in:
@ -195,68 +195,51 @@ export default {
|
||||
});
|
||||
},
|
||||
async getEqpmKind() {
|
||||
// let res = await this.postApiReturn({
|
||||
// apiKey: "selectEqpmKindCodeList",
|
||||
// resKey: "eqpmKindCodeLists",
|
||||
// sendParam: {},
|
||||
// });
|
||||
let res = await this.postApiReturn({
|
||||
apiKey: 'selectEqpmKindCodeList',
|
||||
resKey: 'eqpmKindCodeLists',
|
||||
sendParam: {},
|
||||
});
|
||||
|
||||
let res = [
|
||||
{
|
||||
eqpmKindId: "냉동기저온",
|
||||
eqpmKindNm: "냉동기저온",
|
||||
},
|
||||
{
|
||||
eqpmKindId: "냉동기고온",
|
||||
eqpmKindNm: "냉동기고온",
|
||||
},
|
||||
];
|
||||
|
||||
if (res.length > 0) {
|
||||
this.selectValueList01 = await res.map((item) => {
|
||||
return {
|
||||
// text: item.eqpmKindNm,
|
||||
label: item.eqpmKindNm,
|
||||
value: item.eqpmKindId,
|
||||
};
|
||||
});
|
||||
this.selectValue01 = this.selectValueList01[0].value;
|
||||
} else {
|
||||
this.selectValueList01 = [];
|
||||
this.selectValue01 = null;
|
||||
}
|
||||
this.setPageData({
|
||||
eqpmKindList: this.selectValueList01,
|
||||
eqpmKindId: this.selectValue01,
|
||||
});
|
||||
},
|
||||
if (res.length > 0) {
|
||||
this.selectValueList01 = await res.map(item => {
|
||||
return {
|
||||
text: item.eqpmKindNm,
|
||||
value: item.eqpmKindId,
|
||||
};
|
||||
});
|
||||
this.selectValue01 = this.selectValueList01[0].value;
|
||||
} else {
|
||||
this.selectValueList01 = [];
|
||||
this.selectValue01 = null;
|
||||
}
|
||||
this.setPageData({
|
||||
eqpmKindList: this.selectValueList01,
|
||||
eqpmKindId: this.selectValue01,
|
||||
});
|
||||
},
|
||||
gridInit() {},
|
||||
getRowGridData() {},
|
||||
async getData() {
|
||||
// let res = await this.postApiReturn({
|
||||
// apiKey: "selectEnrgEffcTotSumm",
|
||||
// resKey: "totSummData",
|
||||
// sendParam: {
|
||||
// fromDt: this.pageData.fromDt,
|
||||
// eqpmKindId: this.selectValue01,
|
||||
// },
|
||||
// });
|
||||
let res = ["aaa", "bbb"];
|
||||
await this.getChartData(res);
|
||||
let res = await this.postApiReturn({
|
||||
apiKey: 'selectEnrgEffcTotSumm',
|
||||
resKey: 'totSummData',
|
||||
sendParam: {
|
||||
fromDt: this.pageData.fromDt,
|
||||
eqpmKindId: this.selectValue01,
|
||||
},
|
||||
});
|
||||
|
||||
// this.selectData = res.filter((item, i) => {
|
||||
// return (
|
||||
// res.findIndex((item2, j) => {
|
||||
// return item.eqpmGrpId === item2.eqpmGrpId;
|
||||
// }) === i
|
||||
// );
|
||||
// });
|
||||
await this.getChartData(res);
|
||||
|
||||
this.selectData = [
|
||||
{ eqpmGrpId: "G001", eqpmGrpNm: "Group A", otherProp: "..." },
|
||||
{ eqpmGrpId: "G002", eqpmGrpNm: "Group B", otherProp: "..." },
|
||||
];
|
||||
},
|
||||
this.selectData = res.filter((item, i) => {
|
||||
return (
|
||||
res.findIndex((item2, j) => {
|
||||
return item.eqpmGrpId === item2.eqpmGrpId;
|
||||
}) === i
|
||||
);
|
||||
});
|
||||
},
|
||||
barClick(event, chartName) {
|
||||
var data = {};
|
||||
if (chartName == "card") {
|
||||
@ -291,52 +274,40 @@ export default {
|
||||
});
|
||||
},
|
||||
async getChartData(data) {
|
||||
var chartDataObj = {};
|
||||
this.objList = {};
|
||||
// let res = await this.postApiReturn({
|
||||
// apiKey : 'selectEnrgEffcTotSumm',
|
||||
// resKey : 'totSummData',
|
||||
// sendParam:{
|
||||
// fromDt : this.pageData.fromDt,
|
||||
// eqpmKindId : this.pageData.eqpmKindId,
|
||||
// }
|
||||
// });
|
||||
var chartDataObj = {};
|
||||
this.objList = {};
|
||||
// let res = await this.postApiReturn({
|
||||
// apiKey : 'selectEnrgEffcTotSumm',
|
||||
// resKey : 'totSummData',
|
||||
// sendParam:{
|
||||
// fromDt : this.pageData.fromDt,
|
||||
// eqpmKindId : this.pageData.eqpmKindId,
|
||||
// }
|
||||
// });
|
||||
|
||||
// data.map((item) => {
|
||||
// if (chartDataObj[item.eqpmGrpId] != null) {
|
||||
// chartDataObj[item.eqpmGrpId].push(item);
|
||||
// } else {
|
||||
// chartDataObj[item.eqpmGrpId] = [item];
|
||||
// }
|
||||
// });
|
||||
data.map(item => {
|
||||
if (chartDataObj[item.eqpmGrpId] != null) {
|
||||
chartDataObj[item.eqpmGrpId].push(item);
|
||||
} else {
|
||||
chartDataObj[item.eqpmGrpId] = [item];
|
||||
}
|
||||
});
|
||||
|
||||
chartDataObj = {
|
||||
group1: [
|
||||
{ fabNm: "Fab A", okCnt: 120, ngCnt: 30 },
|
||||
{ fabNm: "Fab B", okCnt: 150, ngCnt: 20 },
|
||||
{ fabNm: "Fab C", okCnt: 100, ngCnt: 50 },
|
||||
],
|
||||
group2: [
|
||||
{ fabNm: "Fab D", okCnt: 180, ngCnt: 10 },
|
||||
{ fabNm: "Fab E", okCnt: 160, ngCnt: 25 },
|
||||
{ fabNm: "Fab F", okCnt: 140, ngCnt: 35 },
|
||||
],
|
||||
};
|
||||
// chartDataObj.keys()[0]
|
||||
var i = 0;
|
||||
for (var x of Object.keys(chartDataObj)) {
|
||||
this.loadChartList.push(false);
|
||||
i++;
|
||||
this.objList['chart_0' + i] = chartDataObj[x];
|
||||
this.chartNameList.push('chart_0' + i);
|
||||
this.setPageData({
|
||||
[this.chartNameList[i - 1]]: Utility.defaultChartOption(true),
|
||||
});
|
||||
|
||||
// chartDataObj.keys()[0]
|
||||
var i = 0;
|
||||
for (var x of Object.keys(chartDataObj)) {
|
||||
this.loadChartList.push(false);
|
||||
i++;
|
||||
this.objList["chart_0" + i] = chartDataObj[x];
|
||||
this.chartNameList.push("chart_0" + i);
|
||||
this.setPageData({
|
||||
[this.chartNameList[i - 1]]: Utility.defaultChartOption(true),
|
||||
});
|
||||
this.setChartData(chartDataObj[x], i);
|
||||
}
|
||||
// this.setChartData(chartDataObj[Object.keys(chartDataObj)[0]]);
|
||||
},
|
||||
this.setChartData(chartDataObj[x], i);
|
||||
}
|
||||
// this.setChartData(chartDataObj[Object.keys(chartDataObj)[0]]);
|
||||
},
|
||||
async setChartData(data, number) {
|
||||
this.loadChartList[number - 1] = false;
|
||||
let xAxisData = [];
|
||||
|
Reference in New Issue
Block a user