From 56e011c179194d5d300722f0b425a7741bf987c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Sat, 11 May 2024 16:40:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- src/mixins/chart.js | 21 +- src/store/modules/home.js | 40 +- .../copilot/components/LineChartBase.vue | 416 ++++++++++----- .../copilot/components/LineChartWater.vue | 481 ++++++++++++++++++ .../copilot/efficiency/components/StdRate.vue | 73 ++- .../components/sub/chip/ChipRateItem.vue | 6 +- .../components/sub/std/ProgressBar.vue | 46 +- .../components/sub/std/StdRateItem.vue | 14 +- .../copilot/energy/components/ElecCost.vue | 67 +-- .../copilot/energy/components/NatGas.vue | 59 ++- .../copilot/energy/components/WaterCost.vue | 78 +-- .../copilot/energy/options/monitorOptions.js | 4 +- .../yield/components/sub/city/CityData.vue | 5 +- src/views/dashboard/components/Header.vue | 71 ++- 15 files changed, 1100 insertions(+), 283 deletions(-) create mode 100644 src/views/copilot/components/LineChartWater.vue diff --git a/.env.dev b/.env.dev index a3c6d41..99b810f 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-05-10 08:42:44 + # @LastEditTime: 2024-05-11 08:52:30 # @LastEditors: zhp # @Description: ### diff --git a/src/mixins/chart.js b/src/mixins/chart.js index 504b169..cd961b8 100644 --- a/src/mixins/chart.js +++ b/src/mixins/chart.js @@ -1,20 +1,19 @@ import * as echarts from "echarts"; function __resizeHandler(entries) { - console.log(entries); for (const entry of entries) { if (entry.contentBoxSize) { // manipulate contentBoxSize - const contentBoxSize = Array.isArray(entry.contentBoxSize) - ? entry.contentBoxSize[0] - : entry.contentBoxSize; - this.chart_mixin_chartInstance.resize({ - width: - contentBoxSize.inlineSize < this.MIN_WIDTH - ? this.MIN_WIDTH - : contentBoxSize.inlineSize, - height: contentBoxSize.blockSize, - }); + // const contentBoxSize = Array.isArray(entry.contentBoxSize) + // ? entry.contentBoxSize[0] + // : entry.contentBoxSize; + // this.chart_mixin_chartInstance.resize({ + // width: + // contentBoxSize.inlineSize < this.MIN_WIDTH + // ? this.MIN_WIDTH + // : contentBoxSize.inlineSize, + // height: contentBoxSize.blockSize, + // }); } else { // manipulate contentRect this.chart_mixin_chartInstance.resize({ diff --git a/src/store/modules/home.js b/src/store/modules/home.js index 5fe2265..0ed88e0 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -29,10 +29,12 @@ const state = { target: [], current: [], previous: [], + outputNumber:[], }, stdRate: { target: [], current: [], + outputNumber:[] }, }, }, @@ -112,11 +114,8 @@ const actions = { targetList = data } let factoryData = factoryList.prodOutputResultDO ? factoryList.prodOutputResultDO : factoryList.prodOutputRateDO - let targetData = targetList.ProdTargetDO ? targetList.ProdTargetDO : targetList.ProdTargetDO - console.log(factoryList.ProdOutputDO) - console.log('ryf',factoryList) + let targetData = targetList.prodTargetDO ? targetList.prodTargetDO : targetList.prodTargetDO const payload = handler(factoryData, targetData) - console.log(payload) commit("SET_COPILOT_INFO", { type, payload }); }, }; @@ -129,7 +128,7 @@ export default { }; function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { - console.log('工厂',factoryListResponse); + console.log('工厂',targetListResponse); // console.log('工厂',factoryListResponse); // 初始数据 @@ -186,9 +185,6 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { // ]; if (factoryListResponse) { for (const factory of factoryListResponse) { - if (factory.glassType === 1) { - console.log(factory.yieldRate) - } const fId = getFactoryId(factory); // 获取目标值 if (targetListResponse) { @@ -197,23 +193,25 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { componentYieldRate, chipOee, componentConversionEfficiency, + componentYield } = getFactoryTargetValueA(targetListResponse, fId); - stdRate.target[fId] = chipYieldRate; - chipRate.target[fId] = componentYieldRate; + stdRate.target[fId] = componentYieldRate + chipRate.target[fId] = chipYieldRate } // 芯片OEE - chipOee.current[fId] = factory.oee * 100 || random_default(); - chipOee.previous[fId] = factory.previousYearOee * 100 || random_default(); + chipOee.current[fId] = factory.oee * 100 ; + chipOee.previous[fId] = factory.previousYearOee * 100 ; // 转化效率 transformRate.current[fId] = - factory.componentConversionEfficiency * 100 || random_default(); + factory.componentConversionEfficiency * 100 ; transformRate.previous[fId] = - factory.previousYearComponentConversionEfficiency * 100 || random_default(); + factory.previousYearComponentConversionEfficiency * 100 ; // 芯片良率 与 标准组件良率 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(); + const _t = [chipRate, stdRate][factory.glassType] + console.log('_t',_t); + _t.current[fId] = factory.yieldRate ; + _t.previous[fId] = factory.previousYearYieldRate ; } return { @@ -295,16 +293,18 @@ function getFactoryTargetValue(targetList, factoryId) { * @returns */ function getFactoryTargetValueA(targetList, factoryId) { - const target = targetList.find((item) => item.factory === factoryId); + const target = targetList.find((item) => item.factory === factoryId) if (target) { return { chipYieldRate: target.chipYieldRate ?? random_default(), componentYieldRate: target.componentYieldRate ?? random_default(), + componentYield: target.componentYield ?? random_default(), }; } return { - chipYieldRate: random_default(), - componentYieldRate: random_default(), + chipYieldRate:0, + componentYieldRate:0, + componentYield:0 , }; } diff --git a/src/views/copilot/components/LineChartBase.vue b/src/views/copilot/components/LineChartBase.vue index c4eca81..5ba6fff 100644 --- a/src/views/copilot/components/LineChartBase.vue +++ b/src/views/copilot/components/LineChartBase.vue @@ -1,8 +1,8 @@ - diff --git a/src/views/copilot/energy/components/ElecCost.vue b/src/views/copilot/energy/components/ElecCost.vue index b6c7a17..2a3e3aa 100644 --- a/src/views/copilot/energy/components/ElecCost.vue +++ b/src/views/copilot/energy/components/ElecCost.vue @@ -1,4 +1,4 @@ -