驾驶舱
This commit is contained in:
@@ -67,7 +67,7 @@ const mutations = {
|
||||
state.copilot.energy = payload.data;
|
||||
break;
|
||||
case "efficiency":
|
||||
console.log('222222', payload.chipOee)
|
||||
console.log('222222', payload)
|
||||
state.copilot.efficiency.chipOee = payload.chipOee;
|
||||
state.copilot.efficiency.transformRate = payload.transformRate;
|
||||
state.copilot.efficiency.chipRate = payload.chipRate;
|
||||
@@ -81,8 +81,8 @@ const actions = {
|
||||
/** 初始化首页数据 */
|
||||
async initHome({ commit }) {
|
||||
const dataArr = await getHomeInfo();
|
||||
const targetArr = await getHomeTarget();
|
||||
const payload = splitCurrentAndPrevious(dataArr, targetArr);
|
||||
const targetArr = await getHomeInfo();
|
||||
const payload = splitCurrentAndPrevious(dataArr.prodOutputResultDO, targetArr.prodTargetDO);
|
||||
commit("SET_HOME_INFO", payload);
|
||||
},
|
||||
/** 初始化驾驶舱数据 */
|
||||
@@ -98,18 +98,25 @@ const actions = {
|
||||
yield: splitCurrentAndPrevious,
|
||||
comprehensive: () => null,
|
||||
efficiency: splitCurrentAndPreviousA,
|
||||
}[source];
|
||||
}[source]
|
||||
console.log(handler)
|
||||
// 获取产量数据
|
||||
// console.log('qqqqqq',handler)
|
||||
let { data: factoryList, type } = await fetcher(period);
|
||||
let { data: factoryList, type } = await fetcher(period)
|
||||
console.log(factoryList,type);
|
||||
let targetList = null;
|
||||
if (source === "yield" || source === "efficiency") {
|
||||
// 获取目标数据
|
||||
let { data } = await fetcher(period, true)
|
||||
console.log('11111',data)
|
||||
targetList = data;
|
||||
// console.log('11111',data)
|
||||
targetList = data
|
||||
}
|
||||
const payload = handler(factoryList, targetList);
|
||||
let factoryData = factoryList.prodOutputResultDO ? factoryList.prodOutputResultDO : factoryList.prodOutputRateDO
|
||||
let targetData = targetList.ProdTargetDO ? targetList.ProdTargetDO : targetList.ProdTargetDO
|
||||
console.log(factoryList.ProdOutputDO)
|
||||
console.log('ryf',factoryList)
|
||||
const payload = handler(factoryData, targetData)
|
||||
console.log(payload)
|
||||
commit("SET_COPILOT_INFO", { type, payload });
|
||||
},
|
||||
};
|
||||
@@ -127,58 +134,61 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) {
|
||||
|
||||
// 初始数据
|
||||
const { chipOee, transformRate, chipRate, stdRate } = initA();
|
||||
factoryListResponse = [
|
||||
{
|
||||
factory: 0,
|
||||
oee: 0.8,
|
||||
previousYearOee: 0.7,
|
||||
componentConversionEfficiency: 0.8,
|
||||
previousYearComponentConversionEfficiency: 0.7,
|
||||
glassType: 0,
|
||||
yieldRate: 0.8,
|
||||
previousYearYieldRate: 0.7,
|
||||
chipYieldRate: 0.38,
|
||||
componentYieldRate: 0.73,
|
||||
},
|
||||
{
|
||||
factory: 1,
|
||||
oee: 0.8,
|
||||
previousYearOee: 0.7,
|
||||
componentConversionEfficiency: 0.8,
|
||||
previousYearComponentConversionEfficiency: 0.7,
|
||||
glassType: 1,
|
||||
yieldRate: 0.8,
|
||||
previousYearYieldRate: 0.7,
|
||||
chipYieldRate: 0.38,
|
||||
componentYieldRate: 0.73,
|
||||
},
|
||||
{
|
||||
factory: 2,
|
||||
oee: 0.8,
|
||||
previousYearOee: 0.7,
|
||||
componentConversionEfficiency: 0.8,
|
||||
previousYearComponentConversionEfficiency: 0.7,
|
||||
glassType: 1,
|
||||
yieldRate: 0.8,
|
||||
previousYearYieldRate: 0.7,
|
||||
chipYieldRate: 0.38,
|
||||
componentYieldRate: 0.73,
|
||||
},
|
||||
{
|
||||
factory: 3,
|
||||
oee: 0.8,
|
||||
previousYearOee: 0.7,
|
||||
componentConversionEfficiency: 0.8,
|
||||
previousYearComponentConversionEfficiency: 0.7,
|
||||
glassType: 0,
|
||||
yieldRate: 0.8,
|
||||
previousYearYieldRate: 0.7,
|
||||
chipYieldRate: 0.38,
|
||||
componentYieldRate: 0.73,
|
||||
},
|
||||
];
|
||||
// factoryListResponse = [
|
||||
// {
|
||||
// factory: 0,
|
||||
// oee: 0.8,
|
||||
// previousYearOee: 0.7,
|
||||
// componentConversionEfficiency: 0.8,
|
||||
// previousYearComponentConversionEfficiency: 0.7,
|
||||
// glassType: 0,
|
||||
// yieldRate: 0.8,
|
||||
// previousYearYieldRate: 0.7,
|
||||
// chipYieldRate: 0.38,
|
||||
// componentYieldRate: 0.73,
|
||||
// },
|
||||
// {
|
||||
// factory: 1,
|
||||
// oee: 0.8,
|
||||
// previousYearOee: 0.7,
|
||||
// componentConversionEfficiency: 0.8,
|
||||
// previousYearComponentConversionEfficiency: 0.7,
|
||||
// glassType: 1,
|
||||
// yieldRate: 0.8,
|
||||
// previousYearYieldRate: 0.7,
|
||||
// chipYieldRate: 0.38,
|
||||
// componentYieldRate: 0.73,
|
||||
// },
|
||||
// {
|
||||
// factory: 2,
|
||||
// oee: 0.8,
|
||||
// previousYearOee: 0.7,
|
||||
// componentConversionEfficiency: 0.8,
|
||||
// previousYearComponentConversionEfficiency: 0.7,
|
||||
// glassType: 1,
|
||||
// yieldRate: 0.8,
|
||||
// previousYearYieldRate: 0.7,
|
||||
// chipYieldRate: 0.38,
|
||||
// componentYieldRate: 0.73,
|
||||
// },
|
||||
// {
|
||||
// factory: 3,
|
||||
// oee: 0.8,
|
||||
// previousYearOee: 0.7,
|
||||
// componentConversionEfficiency: 0.8,
|
||||
// previousYearComponentConversionEfficiency: 0.7,
|
||||
// glassType: 0,
|
||||
// yieldRate: 0.8,
|
||||
// previousYearYieldRate: 0.7,
|
||||
// chipYieldRate: 0.38,
|
||||
// componentYieldRate: 0.73,
|
||||
// },
|
||||
// ];
|
||||
if (factoryListResponse) {
|
||||
for (const factory of factoryListResponse) {
|
||||
if (factory.glassType === 1) {
|
||||
console.log(factory.yieldRate)
|
||||
}
|
||||
const fId = getFactoryId(factory);
|
||||
// 获取目标值
|
||||
if (targetListResponse) {
|
||||
@@ -222,6 +232,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
|
||||
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init();
|
||||
if (factoryListResponse) {
|
||||
for (const factory of factoryListResponse) {
|
||||
|
||||
const fId = getFactoryId(factory);
|
||||
// 获取目标值
|
||||
if (targetListResponse) {
|
||||
@@ -317,7 +328,6 @@ function initA() {
|
||||
};
|
||||
// 芯片良率
|
||||
const chipRate = deepClone(stdRate);
|
||||
|
||||
return {
|
||||
chipOee,
|
||||
transformRate,
|
||||
@@ -369,7 +379,7 @@ function random_default(min = 0, max = 1) {
|
||||
|
||||
/* 接口 */
|
||||
async function getHomeInfo() {
|
||||
const { code, data } = await axios.post("/ip/prod-output/query-by-date", {
|
||||
const { code, data } = await axios.post("ip/prod-output/cockpitData", {
|
||||
factorys: [],
|
||||
date: 4,
|
||||
});
|
||||
@@ -401,14 +411,14 @@ function getUrl(copilot_module) {
|
||||
};
|
||||
switch (copilot_module) {
|
||||
case "yield":
|
||||
url.comparison = "/ip/prod-output/query-by-date";
|
||||
url.target = "/ip/prod-target/query-by-date";
|
||||
url.comparison = "ip/prod-output/cockpitData";
|
||||
// url.target = "/ip/prod-target/query-by-date";
|
||||
break;
|
||||
case "energy":
|
||||
break;
|
||||
case "efficiency":
|
||||
url.comparison = "/ip/prod-output/query-Rate-List";
|
||||
url.target = "/ip/prod-target/query-rate-target";
|
||||
url.comparison = "ip/prod-output/cockpitDataRate";
|
||||
// url.target = "/ip/prod-target/query-rate-target";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -418,7 +428,7 @@ function getUrl(copilot_module) {
|
||||
async function doFetch(copilot_module = "yield", fetch_target, params) {
|
||||
const url = getUrl(copilot_module);
|
||||
const { code, data } = await axios.post(
|
||||
fetch_target ? url.target : url.comparison,
|
||||
url.comparison,
|
||||
{
|
||||
...params,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user