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);
}

View File

@ -98,6 +98,7 @@ export default {
_cities[idx].value = v ?? 0;
}
);
//
_cities.splice(4, 1);
return _cities;
},

View File

@ -8,7 +8,7 @@
<template>
<div class="double-ring-chart">
<div ref="chart" class="double-ring-chart__container"></div>
<!-- :style="{ height: vHeight + 'vh' }" -->
<!-- style="{ height: vHeight + 'vh' }" -->
<div class="double-ring-chart__legend">
<div v-for="item in legendItems" :key="item.label" class="legend-item">
<span class="legend-item__label">{{ item.label }}</span>
@ -75,6 +75,7 @@ export default {
getter.current[this.factoryId],
];
}
// [100, 200, 200]
return [
getter.previous[this.factoryId],
getter.current[this.factoryId],

View File

@ -12,7 +12,7 @@
<h2>{{ info.companyName }}</h2>
<ul>
<li v-for="item in info.items" :key="item.label">
{{ item.label }} {{ item.value | currency }}
{{ item.label }} {{ item.value | numberFilter }}
</li>
</ul>
</div>
@ -35,8 +35,12 @@ export default {
},
},
filters: {
currency(value) {
return value.toLocaleString();
numberFilter(value) {
if (value != null && !isNaN(parseInt(value))) {
return parseInt(value).toLocaleString();
} else {
return '-';
}
},
},
data() {