diff --git a/.env.dev b/.env.dev index 2cd7221..44e6fcd 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-13 13:30:20 # @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..3694c0a 100644 --- a/src/views/copilot/components/LineChartBase.vue +++ b/src/views/copilot/components/LineChartBase.vue @@ -1,44 +1,36 @@ - @@ -233,7 +448,7 @@ export default { .legend-item { position: relative; // font-size: 12px; - margin-right: 0.67vw; + margin-right: 2vw; &::before { content: ""; @@ -260,37 +475,37 @@ export default { .legend-item:nth-child(1):after, .legend-item:nth-child(1):before { - background-color: #fad162; + background-color: #8167F6; } .legend-item:nth-child(2):after, .legend-item:nth-child(2):before { - background-color: #2160f3; + background-color: #2760FF; } .legend-item:nth-child(3):after, .legend-item:nth-child(3):before { - background-color: #13dbf3; + background-color: #5996F7; } .legend-item:nth-child(4):after, .legend-item:nth-child(4):before { - background-color: #88ca67; + background-color: #8BC566; } .legend-item:nth-child(5):after, .legend-item:nth-child(5):before { - background-color: #5c97fc; + background-color: #11FAF0; } .legend-item:nth-child(6):after, .legend-item:nth-child(6):before { - background-color: #f48900; + background-color: #F3C000; } .legend-item:nth-child(7):after, .legend-item:nth-child(7):before { - background-color: #776bf0; + background-color: #F38600; } } diff --git a/src/views/copilot/components/LineChartWater.vue b/src/views/copilot/components/LineChartWater.vue new file mode 100644 index 0000000..dc081b7 --- /dev/null +++ b/src/views/copilot/components/LineChartWater.vue @@ -0,0 +1,515 @@ + + + + + + + diff --git a/src/views/copilot/components/gasBarChartBase.vue b/src/views/copilot/components/gasBarChartBase.vue new file mode 100644 index 0000000..33bc474 --- /dev/null +++ b/src/views/copilot/components/gasBarChartBase.vue @@ -0,0 +1,304 @@ + + + + + + + diff --git a/src/views/copilot/efficiency/components/StdRate.vue b/src/views/copilot/efficiency/components/StdRate.vue index 15fca00..f18af7d 100644 --- a/src/views/copilot/efficiency/components/StdRate.vue +++ b/src/views/copilot/efficiency/components/StdRate.vue @@ -1,7 +1,7 @@ @@ -28,21 +28,68 @@ export default { default: "日", }, }, + computed: { + cities() { + console.log('ztl', this.$store.getters.copilot.efficiency.stdRate) + // let getterName = ""; + // switch (this.dataSource) { + // case "标准组件产出": + // getterName = "stdOutput"; + // break; + // case "芯片产出": + // getterName = "chipOutput"; + // break; + // case "BIPV产出": + // getterName = "bipvOutput"; + // break; + // } + const _cities = [ + { name: "瑞昌", target: 0, total: 0, current: 0, componentYield: 0, goodNumber:0,}, + { name: "邯郸", target: 0, total: 0, current: 0, componentYield: 0, goodNumber: 0, }, + { name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, + { name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, + { name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, + { name: "凯盛光伏", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, + { name: "蚌埠", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, + ] + if (this.$store.getters.copilot?.efficiency.stdRate?.previous) { + this.$store.getters.copilot?.efficiency.stdRate?.previous.forEach( + (v, idx) => { + _cities[idx].previous = v ?? 0; + } + ); + } + if (this.$store.getters.copilot?.efficiency.stdRate?.target) { + this.$store.getters.copilot?.efficiency.stdRate?.target.forEach( + (v, idx) => { + _cities[idx].target = v ?? 0; + } + ) + } + if (this.$store.getters.copilot?.efficiency.stdRate?.current) { + this.$store.getters.copilot?.efficiency.stdRate?.current.forEach( + (v, idx) => { + _cities[idx].current = v ?? 0; + } + ); + } + // 删掉凯盛光伏 + // _cities.splice(4, 1); + return _cities; + }, + }, data() { return { - cities: [ - { name: "瑞昌", target: 100, total: 200, thisYear: 20 }, - { name: "邯郸", target: 200, total: 300, thisYear: 20 }, - { name: "株洲", target: 300, total: 400, thisYear: 20 }, - { name: "佳木斯", target: 400, total: 500, thisYear: 20 }, - { name: "成都", target: 500, total: 600, thisYear: 20 }, - { name: "凯盛光伏", target: 400, total: 500, thisYear: 20 }, - { name: "蚌埠", target: 500, total: 600, thisYear: 20 }, - ], + // cities: [ + // { name: "瑞昌", target: 100, total: 200, current: 20 }, + // { name: "邯郸", target: 200, total: 300, current: 20 }, + // { name: "株洲", target: 300, total: 400, current: 20 }, + // { name: "佳木斯", target: 400, total: 500, current: 20 }, + // { name: "成都", target: 500, total: 600, current: 20 }, + // { name: "凯盛光伏", target: 400, total: 500, current: 20 }, + // { name: "蚌埠", target: 500, total: 600, current: 20 }, + // ], }; - }, - computed: { - }, methods: {}, }; diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue index 6ab1cc7..dfc1be2 100644 --- a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue @@ -1,40 +1,32 @@ diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index e9d2133..c9d1216 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -59,7 +59,7 @@ export default { }, valueTuple() { const getter = this.chipRate; - console.log(getter) + // console.log(getter) if (this.period === "日" || this.period === "周") { return [ getter.previous[this.factoryId], @@ -111,11 +111,11 @@ export default { this.period == "月" ? `${year - 1}年${month}月良率` : `${year - 1}年良率`, - value: (this.valueTuple[0] * 100).toFixed(0) + "%", + value: isNaN((this.valueTuple[0] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[0] * 100).toFixed(0) + "%" }, { label: this.period == "月" ? `${month}月良率` : `${year}年良率`, - value: (this.valueTuple[1] * 100).toFixed(0) + "%", + value: isNaN((this.valueTuple[1] * 100).toFixed(0)) ? 0 + "%" : (this.valueTuple[1] * 100).toFixed(0) + "%" }, ]; }, @@ -159,6 +159,7 @@ export default { } .chart { + width: 390px; align-self: stretch; height: 280px; } diff --git a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue index f7df2a0..6586f16 100644 --- a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue +++ b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue @@ -6,11 +6,8 @@ --> @@ -23,23 +20,52 @@ export default { type: Number, default: 0, }, - total: { + target: { type: Number, default: 0, }, + goodNumber: { + type: Number, + default:0 + }, + componentYield: { + type: Number, + default:0 + }, + period: { + type: String, + default:'日', + }, title: { type: String, default: "", }, + city: { + type: String, + default:"" + } }, data() { - return {}; + return { + number: 0, + titleYear:'', + }; }, computed: { dataRate() { - return this.total == 0 + if ((this.period === '年' || this.period === '月') && this.target != 0) { + // console.log(this.componentYield) + this.titleYear = this.title + ' ' + `${(this.target * 100).toFixed(0)}%` + } else { + this.titleYear = this.title + } + this.number = this.value == 0 ? "-" - : `${(parseFloat(this.value / this.total) * 100).toFixed(0)}%`; + : `${(this.value * 100).toFixed(0)}%` + // console.log(this.period) + return this.value == 0 + ? "-" + : this.value >1 ? 100 + '%' :`${(this.value * 100).toFixed(0)}%` }, }, methods: {}, @@ -69,7 +95,7 @@ export default { color: #fff; position: absolute; bottom: -200%; - right: 0; + right: 10px; font-size: 12px; } diff --git a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue index ae1dbba..1ea1543 100644 --- a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue @@ -1,7 +1,7 @@ @@ -10,29 +10,29 @@
- +
- +
- - + +
- - + +
diff --git a/src/views/copilot/energy/components/ElecCost.vue b/src/views/copilot/energy/components/ElecCost.vue index b6c7a17..7a12fa6 100644 --- a/src/views/copilot/energy/components/ElecCost.vue +++ b/src/views/copilot/energy/components/ElecCost.vue @@ -1,4 +1,4 @@ -