驾驶舱
This commit is contained in:
@@ -90,8 +90,10 @@ const actions = {
|
||||
/** 初始化首页数据 */
|
||||
async initHome({ commit }) {
|
||||
const dataArr = await getHomeInfo();
|
||||
const targetArr = await getHomeInfo();
|
||||
const payload = splitCurrentAndPrevious(dataArr.prodOutputResultDO, targetArr.prodTargetDO);
|
||||
console.log('dataArr',dataArr);
|
||||
// const targetArr = await getHomeInfo();
|
||||
const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO
|
||||
);
|
||||
commit("SET_HOME_INFO", payload);
|
||||
},
|
||||
/** 初始化驾驶舱数据 */
|
||||
@@ -121,9 +123,10 @@ const actions = {
|
||||
const payload = handler(factoryData)
|
||||
commit("SET_COPILOT_INFO", { type, payload });
|
||||
} else {
|
||||
let factoryData = factoryList.prodOutputResultDO ? factoryList.prodOutputResultDO : factoryList.prodOutputRateDO
|
||||
let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO
|
||||
let prodOutputFtoDO = factoryList.prodOutputFtoDO ? factoryList.prodOutputFtoDO : []
|
||||
let targetData = targetList.prodTargetDO ? targetList.prodTargetDO : targetList.prodTargetDO
|
||||
const payload = handler(factoryData, targetData)
|
||||
const payload = handler(factoryData, targetData,prodOutputFtoDO)
|
||||
commit("SET_COPILOT_INFO", { type, payload });
|
||||
|
||||
}
|
||||
@@ -372,14 +375,20 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) {
|
||||
}
|
||||
}
|
||||
|
||||
function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
|
||||
|
||||
|
||||
function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOutputFtoListRes) {
|
||||
console.log('prodOutputFtoListRes',prodOutputFtoListRes);
|
||||
// 初始数据
|
||||
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init();
|
||||
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init()
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
const fId = getFactoryId(factory);
|
||||
ftoInvest.current[fId] = factory.chipInput;
|
||||
ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
}
|
||||
}
|
||||
if (factoryListResponse) {
|
||||
for (const factory of factoryListResponse) {
|
||||
|
||||
const fId = getFactoryId(factory);
|
||||
// 获取目标值
|
||||
if (targetListResponse) {
|
||||
@@ -393,8 +402,11 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
|
||||
chipInvest.current[fId] = factory.inputNumber;
|
||||
chipInvest.previous[fId] = factory.previousYearInputNumber;
|
||||
// FTO投入
|
||||
ftoInvest.current[fId] = factory.chipInput;
|
||||
ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// if (factory.chipInput || factory.previousYearChipInput) {
|
||||
// ftoInvest.current[fId] = factory.chipInput;
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
|
||||
// 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出
|
||||
// 因为后端写的垃圾数据,所以这里要做一下判断
|
||||
if (![0, 1, 2].includes(factory.glassType)) continue;
|
||||
@@ -406,6 +418,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
|
||||
|
||||
return {
|
||||
chipInvest,
|
||||
// ftoInvest,
|
||||
ftoInvest,
|
||||
chipOutput,
|
||||
stdOutput,
|
||||
|
||||
Reference in New Issue
Block a user