This commit is contained in:
DESKTOP-FUDKNA8\znjsz
2024-04-28 16:55:21 +08:00
parent 253f182370
commit aa2ac270fc
4 changed files with 27 additions and 10 deletions

View File

@@ -18,6 +18,7 @@ const state = {
efficiency: {},
},
home: {
/** 主页状态 */
ftoInvest: null,
chipInvest: null,
chipOutput: null,
@@ -88,8 +89,8 @@ export default {
actions,
};
// utils function
function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
// 初始数据
const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init();
if (factoryListResponse) {
for (const factory of factoryListResponse) {
@@ -148,6 +149,10 @@ function getFactoryTargetValue(targetList, factoryId) {
};
}
/**
*
* @returns 初始化状态值
*/
function init() {
const t_ = {
current: Array(7).fill(0),
@@ -168,11 +173,11 @@ function init() {
const bipvOutput = deepClone(chipOutput);
return {
chipInvest,
ftoInvest,
chipOutput,
stdOutput,
bipvOutput,
chipInvest, // 芯片投入
ftoInvest, // FTO投入
chipOutput, // 芯片产出
stdOutput, // 标准组件产出
bipvOutput, // BIPV产出
};
}
@@ -248,6 +253,12 @@ async function doFetch(copilot_module = "yield", fetch_target, params) {
return null;
}
/**
*
* @param {*} period 日周月年1,2,3,4
* @param {*} target 是否获取目标数据
* @returns
*/
function getCopilotYield(period, target = false) {
return getCopilotData("yield", period, target);
}