From 9c9dba5452afb16dee3c35c64cfdaa47b6ca7bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Wed, 8 May 2024 16:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- src/assets/images/homeindex/flash-icon.png | Bin 0 -> 662 bytes src/assets/images/homeindex/gas-icon.png | Bin 0 -> 796 bytes src/assets/images/homeindex/ware-icon.png | Bin 0 -> 269 bytes src/assets/images/homeindex/water-icon.png | Bin 0 -> 592 bytes src/layout/components/AppMain.vue | 2 +- src/store/modules/home.js | 199 ++++++++++++++++- src/views/copilot/components/BarChartBase.vue | 7 +- src/views/copilot/components/Container.vue | 4 +- .../copilot/components/ContainerIcon.vue | 20 +- .../copilot/components/CopilotHeader.vue | 6 +- src/views/copilot/container.vue | 16 +- .../copilot/efficiency/components/ChipOee.vue | 15 +- .../copilot/efficiency/components/StdRate.vue | 33 +-- .../efficiency/components/TransformRate.vue | 12 +- .../components/sub/bar/BarChartChipOEE.vue | 7 +- .../components/sub/chip/ChipRateItem.vue | 2 +- .../components/sub/std/CityName.vue | 4 +- .../components/sub/std/ProgressBar.vue | 4 +- .../components/sub/std/StdRateItem.vue | 90 ++++++-- src/views/copilot/efficiency/index.vue | 4 +- .../energy/components/StockMonitor.vue | 25 ++- .../components/sub/monitor/MonitorItem.vue | 58 +++-- src/views/copilot/energy/index.vue | 21 +- .../copilot/energy/options/monitorOptions.js | 210 ++++++------------ .../copilot/yield/components/ChipInvest.vue | 6 +- .../copilot/yield/components/FtoInvest.vue | 6 +- .../components/sub/ring/DoubleRingChart.vue | 5 +- src/views/copilot/yield/index.vue | 2 +- src/views/index.vue | 12 +- src/views/playground.vue | 2 +- 31 files changed, 483 insertions(+), 291 deletions(-) create mode 100644 src/assets/images/homeindex/flash-icon.png create mode 100644 src/assets/images/homeindex/gas-icon.png create mode 100644 src/assets/images/homeindex/ware-icon.png create mode 100644 src/assets/images/homeindex/water-icon.png diff --git a/.env.dev b/.env.dev index cabceec..4e87f52 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-04-28 13:43:03 + # @LastEditTime: 2024-05-08 08:57:33 # @LastEditors: zhp # @Description: ### diff --git a/src/assets/images/homeindex/flash-icon.png b/src/assets/images/homeindex/flash-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..14e31ae3edb777dc774812ae245cc960722e7c96 GIT binary patch literal 662 zcmV;H0%`q;P)Px%P)S5VR9HvtmQARRQ51!rB`I!9#J~V06XhEDDPh1(Ap_}BCe$tY=_Y1Gp=5$| z#Xv?TL`o6Lhyj`SD@yrEQ6dzQpDgF-ySLMu?>p!1ySfHec3_6Xn!FfD`HE2*!Txsg~RU^Q?q z0~~AKDe33G5O5oqn*m-S>2h82Y!BF80Nf}5eha(-)<}9(kUx;pvIMp-0xN3(9+0%F zMt<`-V0$X?6o^e&5+8y2gXVzkPT*eQu=)xtm2|U2X_}KOK^&>GlNaJ1m{B2#({Gie zOYynwallz%LXsDIq+8Obs=(}L*#Cm;R})DbW* z*nF#Uf^CwHCgfefwMyA~B%NwjnmPgw0oxOx{gU=1)2q z6oyUg{DH6?FDV;=Q9vxqXy7xjI9yKdv{iz{{#QVkq%X|?8%{g`z5#JRTyI4l|I7A3 z!~XbbEtK@36<}E1@z%5xSS#s#j=WUB*05?Xlw2}x$3=8RQWRViB@T47vc1xX%OxEw wVs0d51(br>o>bye6>rc4lnNad@ZUM`8;&==A!w~m+5i9m07*qoM6N<$g5P8<761SM literal 0 HcmV?d00001 diff --git a/src/assets/images/homeindex/gas-icon.png b/src/assets/images/homeindex/gas-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fdcac2e9ec6cfbec09eb5f8491e43469c80ef64a GIT binary patch literal 796 zcmV+%1LOROP)Px%)=5M`R9HvtmRpEUVHAd+*C9oeTu9LnH%d`L4u#~9Lr5Z$+@K*Yrj%oe8{8qs zTOx_1q#QztLXuNLrYJ;-xYdzmu@As}P+Bnq4^=SvF zsspyq0GEJ0lKeMgtQMdS*a=(&=1TffEkv~di-4m*oc5QPD3&jd~ZopTAJ?Jpz^YWm%F7O&3~@0PwZOVYDc6T2m?sRrOWFs4HB@4#nZ zyrf6j|7{-vo=V!477xK5khHuMfb9jT;`8r)NN+*7-<@3Xb-++bi!&XWoqELXvH+p@ zxw)4@*&)QKlCI{8F9BAhwj3P_Kj;KR7iUO%Ul!m#FeLNRx5R+L1(!*RJ@6-NPXMCz zV4k#3@0;DGkGg+OE;c*TiKFz{-4kx!EEPI-yxG{yI5I{?rZ1+ft z-UMoab&^8;h2yUQ(hh}IV*me;G`Mi}Fo`k`x6+ANSTXy}lH!xCQ2aB1Le(lf)DF<* a9rz74dKfSpc=SyG0000zoboFyt=akR{0I&~WX#fBK literal 0 HcmV?d00001 diff --git a/src/assets/images/homeindex/water-icon.png b/src/assets/images/homeindex/water-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d89f9558943be274da996fc818747eb2aa15c2d2 GIT binary patch literal 592 zcmV-W0Px%3Q0skR9HvtmdmS-Q54314-*qcQc6;e5=t&Zid>Vy=@cf)fa5YUa{dSgO35t) z86lT}IygizWT243L`umB0}~$as`snY>Ac^*P+#io;rs5j)^9)i*?TWB;GqH6X9nQ^ zR>1aHcu3O8S}#>AVEZ6&sVzJz>2eK36@cyCz#U+ATl5z&Ea`43L@|Kv)xc9=?v!HR zfsK-0mOvB%*q#r(02X%?`3S6&^febE8^HD~U>w+F4Am1%9?$@g_AtO99&xz}8f3l7~9^g9gLDEoj4aZ7`3nBJOx={tHC3A}vC`q0( ecLreK3j6`IG?F1-FIPDL0000 diff --git a/src/store/modules/home.js b/src/store/modules/home.js index 5046842..56b3e64 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -1,3 +1,4 @@ + import axios from "@/utils/request"; import { deepClone } from "../../utils"; @@ -15,7 +16,25 @@ const state = { /* 能源驾驶舱 */ energy: {}, /* 效率驾驶舱 */ - efficiency: {}, + efficiency: { + chipOee: { + current: [], + previous: [], + }, + transformRate: { + current: [], + previous: [], + }, + chipRate: { + target: [], + current: [], + previous: [], + }, + stdRate: { + target: [], + current: [], + }, + }, }, home: { /** 主页状态 */ @@ -48,7 +67,11 @@ const mutations = { state.copilot.energy = payload.data; break; case "efficiency": - state.copilot.efficiency = payload.data; + console.log('222222', payload.chipOee) + state.copilot.efficiency.chipOee = payload.chipOee; + state.copilot.efficiency.transformRate = payload.transformRate; + state.copilot.efficiency.chipRate = payload.chipRate; + state.copilot.efficiency.stdRate = payload.stdRate; break; } }, @@ -64,20 +87,29 @@ const actions = { }, /** 初始化驾驶舱数据 */ async initCopilot({ commit }, { period, source }) { + if (source == "comprehensive") return; + const fetcher = { yield: getCopilotYield, - energy: getCopilotEnergy, + comprehensive: getCopilotEnergy, efficiency: getCopilotEfficiency, }[source]; + const handler = { + yield: splitCurrentAndPrevious, + comprehensive: () => null, + efficiency: splitCurrentAndPreviousA, + }[source]; // 获取产量数据 + // console.log('qqqqqq',handler) let { data: factoryList, type } = await fetcher(period); let targetList = null; if (source === "yield" || source === "efficiency") { // 获取目标数据 - let { data } = await fetcher(period, true); + let { data } = await fetcher(period, true) + console.log('11111',data) targetList = data; } - const payload = splitCurrentAndPrevious(factoryList, targetList); + const payload = handler(factoryList, targetList); commit("SET_COPILOT_INFO", { type, payload }); }, }; @@ -89,7 +121,103 @@ export default { actions, }; +function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { + console.log('工厂',factoryListResponse); + // console.log('工厂',factoryListResponse); + + // 初始数据 + 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, + }, + ]; + if (factoryListResponse) { + for (const factory of factoryListResponse) { + const fId = getFactoryId(factory); + // 获取目标值 + if (targetListResponse) { + const { + chipYieldRate, + componentYieldRate, + chipOee, + componentConversionEfficiency, + } = getFactoryTargetValueA(targetListResponse, fId); + stdRate.target[fId] = chipYieldRate; + chipRate.target[fId] = componentYieldRate; + } + // 芯片OEE + chipOee.current[fId] = factory.oee * 100 || random_default(); + chipOee.previous[fId] = factory.previousYearOee * 100 || random_default(); + // 转化效率 + transformRate.current[fId] = + factory.componentConversionEfficiency * 100 || random_default(); + transformRate.previous[fId] = + factory.previousYearComponentConversionEfficiency * 100 || random_default(); + // 芯片良率 与 标准组件良率 + if (![0, 1].includes(factory.glassType)) continue; + const _t = [chipRate, stdRate][factory.glassType]; + _t.current[fId] = factory.yieldRate || random_default(); + _t.previous[fId] = factory.previousYearYieldRate || random_default(); + } + + return { + chipOee, + transformRate, + chipRate, + stdRate, + }; + } +} + function splitCurrentAndPrevious(factoryListResponse, targetListResponse) { + console.log('工厂',factoryListResponse); + // 初始数据 const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init(); if (factoryListResponse) { @@ -149,9 +277,58 @@ function getFactoryTargetValue(targetList, factoryId) { }; } +/** + * 获取 芯片良率目标值 和 标准组件良率目标值 + * @param {*} targetList 目标值列表 + * @param {*} factoryId 工厂ID + * @returns + */ +function getFactoryTargetValueA(targetList, factoryId) { + const target = targetList.find((item) => item.factory === factoryId); + if (target) { + return { + chipYieldRate: target.chipYieldRate ?? random_default(), + componentYieldRate: target.componentYieldRate ?? random_default(), + }; + } + return { + chipYieldRate: random_default(), + componentYieldRate: random_default(), + }; +} + +/** + * + * @returns 初始化 效率模块里 初始状态值 + */ +function initA() { + const t_ = { + current: Array(7).fill(0), + previous: Array(7).fill(0), + }; + // 芯片OEE + const chipOee = deepClone(t_); + // 转化效率 + const transformRate = deepClone(t_); + // 标准组件良率 + const stdRate = { + ...deepClone(t_), + target: Array(7).fill(0), + }; + // 芯片良率 + const chipRate = deepClone(stdRate); + + return { + chipOee, + transformRate, + chipRate, + stdRate, + }; +} + /** * - * @returns 初始化状态值 + * @returns 初始化 产量模块里 初始状态值 */ function init() { const t_ = { @@ -181,11 +358,11 @@ function init() { }; } -function random_default() { - return 0; - let a = Math.floor(Math.random() * 1000); - while (a < 600) { - a = Math.floor(Math.random() * 1000); +function random_default(min = 0, max = 1) { + // return 0; + let a = Math.floor(Math.random() * max); + while (a < min) { + a = Math.floor(Math.random() * max); } return a; } diff --git a/src/views/copilot/components/BarChartBase.vue b/src/views/copilot/components/BarChartBase.vue index ea5cfdf..528cfd5 100644 --- a/src/views/copilot/components/BarChartBase.vue +++ b/src/views/copilot/components/BarChartBase.vue @@ -1,8 +1,8 @@ -