diff --git a/.env.dev b/.env.dev index f43c12b..0cdd24e 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-05-16 09:00:26 + # @LastEditTime: 2024-05-20 08:31:10 # @LastEditors: zhp # @Description: ### @@ -12,8 +12,8 @@ ENV = 'development' VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 -# VUE_APP_BASE_API = 'http://192.168.1.54:48080' -VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' +VUE_APP_BASE_API = 'http://192.168.1.61:48080' +# VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' # # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/mixins/chart.js b/src/mixins/chart.js index cd961b8..b356201 100644 --- a/src/mixins/chart.js +++ b/src/mixins/chart.js @@ -1,19 +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 a15419f..4c278cd 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -90,8 +90,10 @@ const actions = { /** 初始化首页数据 */ async initHome({ commit }) { const dataArr = await getHomeInfo(); - const targetArr = await getHomeInfo(); - const payload = splitCurrentAndPrevious(dataArr.prodOutputResultDO, targetArr.prodTargetDO); + console.log('dataArr',dataArr); + // const targetArr = await getHomeInfo(); + const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO +); commit("SET_HOME_INFO", payload); }, /** 初始化驾驶舱数据 */ @@ -121,9 +123,10 @@ const actions = { const payload = handler(factoryData) commit("SET_COPILOT_INFO", { type, payload }); } else { - let factoryData = factoryList.prodOutputResultDO ? factoryList.prodOutputResultDO : factoryList.prodOutputRateDO + let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO + let prodOutputFtoDO = factoryList.prodOutputFtoDO ? factoryList.prodOutputFtoDO : [] let targetData = targetList.prodTargetDO ? targetList.prodTargetDO : targetList.prodTargetDO - const payload = handler(factoryData, targetData) + const payload = handler(factoryData, targetData,prodOutputFtoDO) commit("SET_COPILOT_INFO", { type, payload }); } @@ -372,14 +375,20 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse) { } } -function splitCurrentAndPrevious(factoryListResponse, targetListResponse) { - - +function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOutputFtoListRes) { + console.log('prodOutputFtoListRes',prodOutputFtoListRes); // 初始数据 - const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init(); + const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init() + if (prodOutputFtoListRes) { + for (const factory of prodOutputFtoListRes) { + console.log(factory); + const fId = getFactoryId(factory); + ftoInvest.current[fId] = factory.chipInput; + ftoInvest.previous[fId] = factory.previousYearChipInput; + } + } if (factoryListResponse) { for (const factory of factoryListResponse) { - const fId = getFactoryId(factory); // 获取目标值 if (targetListResponse) { @@ -393,8 +402,11 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) { chipInvest.current[fId] = factory.inputNumber; chipInvest.previous[fId] = factory.previousYearInputNumber; // FTO投入 - ftoInvest.current[fId] = factory.chipInput; - ftoInvest.previous[fId] = factory.previousYearChipInput; + // if (factory.chipInput || factory.previousYearChipInput) { + // ftoInvest.current[fId] = factory.chipInput; + // ftoInvest.previous[fId] = factory.previousYearChipInput; + // } + // 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出 // 因为后端写的垃圾数据,所以这里要做一下判断 if (![0, 1, 2].includes(factory.glassType)) continue; @@ -406,6 +418,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) { return { chipInvest, + // ftoInvest, ftoInvest, chipOutput, stdOutput, diff --git a/src/views/copilot/components/CopilotHeader.vue b/src/views/copilot/components/CopilotHeader.vue index 49e00f5..659a686 100644 --- a/src/views/copilot/components/CopilotHeader.vue +++ b/src/views/copilot/components/CopilotHeader.vue @@ -62,7 +62,6 @@ export default { methods: { toggleFullScreen() { this.isFullscreen = !this.isFullscreen; - screenfull.toggle(document.querySelector(".copilot-layout")) // 矫正宽度 // const el = document.querySelector(".copilot-layout"); diff --git a/src/views/copilot/container.vue b/src/views/copilot/container.vue index f52d0a8..3a17b4a 100644 --- a/src/views/copilot/container.vue +++ b/src/views/copilot/container.vue @@ -85,7 +85,7 @@ export default { height: calc(100% + 38px); } .other { - height: 100vh + 50px; + height: calc(100% + 240px); } .copilot-footer { /** position: absolute; diff --git a/src/views/copilot/efficiency/components/StdRate.vue b/src/views/copilot/efficiency/components/StdRate.vue index 71ded8c..233c7b5 100644 --- a/src/views/copilot/efficiency/components/StdRate.vue +++ b/src/views/copilot/efficiency/components/StdRate.vue @@ -1,7 +1,7 @@ @@ -98,17 +98,21 @@ export default { diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index 56fb3be..f4b1592 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -11,7 +11,7 @@ -
+
@@ -145,25 +145,29 @@ export default { -l diff --git a/src/views/copilot/energy/index.vue b/src/views/copilot/energy/index.vue index 364bf68..eeb3b64 100644 --- a/src/views/copilot/energy/index.vue +++ b/src/views/copilot/energy/index.vue @@ -33,7 +33,6 @@ import StockMonitorVue from "./components/StockMonitor.vue"; import ElecCostVue from "./components/ElecCost.vue"; import NatGasVue from "./components/NatGas.vue"; import WaterCostVue from "./components/WaterCost.vue"; -import { getEnergySumPage } from '@/api/energy' export default { name: "EnergyCopilot", components: { @@ -78,111 +77,6 @@ export default { // source: "comprehensive", // }); }, - dedupe(array){ - return Array.from(new Set(array)); - }, - async getData(period) { - let date = null - switch (period) { - case "日": - date = 1; - break; - case "周": - date = 2; - break; - case "月": - date = 3; - break; - case "年": - date = 4; - break; - default: - date = 1; - break; - } - const res = await getEnergySumPage({ - // factorys:[], - date - }) - let factoryArr = [ - { - id: 0, - name: '瑞昌中建材光电材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 1, - name: '邯郸中建材光电材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 2, - name: '中建材株洲光电材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 3, - name: '佳木斯中建材光电材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 4, - name: '成都中建材光电材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 5, - name: '凯盛光伏材料有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - { - id: 6, - name: '蚌埠兴科玻璃有限公司', - stockData: [], - waterData: [], - elsData: [], - gasData: [], - }, - ] - for (let i in res.data.stockDO) { - const index = factoryArr.findIndex(item => item.id == res.data.stockDO[i].factory) - if (index != -1) { - res.data.stockDO[i].stockInfo.forEach(ele => { - factoryArr[index].stockData.push(ele) - }); - } - } - let stockDOData = [] - factoryArr.forEach((ele, index) => [ - stockDOData[index]= [], - ele.stockData.forEach((item) => { - let obj = {} - obj.name = item.glassType == 0 ? '玻璃芯片' : item.glassType == 1 ? '标准组件' : item.glassType == 2 ? 'BIPV' : '定制组件' - obj.value = item.stockNumber - stockDOData[index].push(obj) - }), - ]) - this.stockDOData = stockDOData - this.$store.commit('home/updateEnergyData', stockDOData) - } }, }; diff --git a/src/views/copilot/yield/components/FtoInvest.vue b/src/views/copilot/yield/components/FtoInvest.vue index 8463fa5..bcda714 100644 --- a/src/views/copilot/yield/components/FtoInvest.vue +++ b/src/views/copilot/yield/components/FtoInvest.vue @@ -65,6 +65,7 @@ export default { }, series() { const { ftoInvest } = this.$store.getters.copilot.yield; + console.log('ftoInvest', this.$store.getters.copilot.yield); let dataList = null; switch (this.period) { diff --git a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue index 90bcdc7..d54e268 100644 --- a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue +++ b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue @@ -7,9 +7,9 @@