From f312be08bfc2454712e5a63167b166b63cb483d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Fri, 10 May 2024 11:10:42 +0800 Subject: [PATCH] =?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 | 3 +- src/store/modules/home.js | 140 ++++++++++-------- src/views/copilot/container.vue | 28 +++- .../copilot/efficiency/components/ChipOee.vue | 2 +- .../copilot/efficiency/components/StdRate.vue | 4 +- .../components/sub/bar/BarChartBase.vue | 4 +- .../components/sub/bar/BarChartChipOEE.vue | 4 +- .../components/sub/chip/ChipRateItem.vue | 5 +- .../components/sub/std/StdRateItem.vue | 2 +- src/views/copilot/efficiency/index.vue | 6 +- src/views/copilot/energy/index.vue | 4 +- .../components/sub/ring/DoubleRingChart.vue | 9 +- .../options/double-ring-chart-options.js | 10 +- 14 files changed, 131 insertions(+), 92 deletions(-) diff --git a/.env.dev b/.env.dev index 4e87f52..a3c6d41 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-05-08 08:57:33 + # @LastEditTime: 2024-05-10 08:42:44 # @LastEditors: zhp # @Description: ### diff --git a/src/mixins/chart.js b/src/mixins/chart.js index a6c0ef9..504b169 100644 --- a/src/mixins/chart.js +++ b/src/mixins/chart.js @@ -1,6 +1,7 @@ import * as echarts from "echarts"; function __resizeHandler(entries) { + console.log(entries); for (const entry of entries) { if (entry.contentBoxSize) { // manipulate contentBoxSize @@ -32,7 +33,7 @@ export default { const resizeObserver = new ResizeObserver(__resizeHandler.bind(this)); return { - MIN_WIDTH: 400, + MIN_WIDTH: 390, chart_mixin_chartInstance: null, chart_mixin_observer: resizeObserver, chart_mixin_options: { diff --git a/src/store/modules/home.js b/src/store/modules/home.js index 56b3e64..5fe2265 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -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, } diff --git a/src/views/copilot/container.vue b/src/views/copilot/container.vue index 45435d8..e04c530 100644 --- a/src/views/copilot/container.vue +++ b/src/views/copilot/container.vue @@ -7,13 +7,12 @@ --> @@ -36,8 +35,24 @@ export default { return { page: "产量", period: "日", + currentsStyles: '', }; }, + // watch: { + // page(val) { + // if (val === '产量') { + // console.log(val) + // this.currentsStyles = + // 'height: calc(100% + 38px)' + // console.log(this.currentsStyles) + // } else { + // console.log(val) + // this.currentsStyles = 'height:100%+38px' + // console.log(this.currentsStyles) + // } + // immediate: true + // } + // } // mounted() { // document.body.style.minHeight = "1024px"; // document.body.style.minWidth = "1550px"; @@ -54,9 +69,8 @@ export default { padding: 16px; background: url(../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat; position: absolute; - height: calc(100% + 38px); left: -16px; - top: -8px; + /* top: -8px; */ width: calc(100% + 30px); z-index: 1001; color: #fff; @@ -65,6 +79,12 @@ export default { gap: 8px; } +.produce{ + height: calc(100% + 38px); +} +.other { + height: 100vh + 50px; +} .copilot-footer { /** position: absolute; bottom: 10px; **/ diff --git a/src/views/copilot/efficiency/components/ChipOee.vue b/src/views/copilot/efficiency/components/ChipOee.vue index 6d5bc28..fd8e087 100644 --- a/src/views/copilot/efficiency/components/ChipOee.vue +++ b/src/views/copilot/efficiency/components/ChipOee.vue @@ -88,7 +88,7 @@ export default { function getTemplate(period, dataList) { const year = new Date().getFullYear(); const month = new Date().getMonth() + 1; - console.log('11111', dataList); + // console.log('11111', dataList); return period == "日" || period == "周" ? [ { diff --git a/src/views/copilot/efficiency/components/StdRate.vue b/src/views/copilot/efficiency/components/StdRate.vue index fe4cc09..15fca00 100644 --- a/src/views/copilot/efficiency/components/StdRate.vue +++ b/src/views/copilot/efficiency/components/StdRate.vue @@ -1,7 +1,7 @@ @@ -53,7 +53,7 @@ export default { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); - grid-template-rows: repeat(1, 1fr); + grid-template-rows: repeat(4, 1fr); } .span-2 { diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartBase.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartBase.vue index 5369183..2dd1df8 100644 --- a/src/views/copilot/efficiency/components/sub/bar/BarChartBase.vue +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartBase.vue @@ -1,8 +1,8 @@ -