From 6f0c8503c69cb079ff46a90c81d9252d35ce210e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Tue, 14 May 2024 08:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../copilot/components/LineChartBase.vue | 9 ++--- .../copilot/components/LineChartWater.vue | 26 +++++++++------ .../copilot/components/gasBarChartBase.vue | 33 +++++++++++-------- .../components/sub/bar/BarChartChipOEE.vue | 3 +- .../copilot/energy/components/ElecCost.vue | 9 +++-- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/src/views/copilot/components/LineChartBase.vue b/src/views/copilot/components/LineChartBase.vue index a1ef9dc..3694c0a 100644 --- a/src/views/copilot/components/LineChartBase.vue +++ b/src/views/copilot/components/LineChartBase.vue @@ -11,7 +11,7 @@ {{ item.label }} -
+
@@ -51,7 +51,7 @@ export default { }, data() { return { - width:'100%', + width: '100%', isFullscreen: false, actualOptions: null, options: { @@ -367,8 +367,9 @@ export default { watch: { isOpen(val) { if (val === true) { - this.width = '100%-128px' + this.width = '99%' this.canvasReset() + console.log(this.width) } else { this.watch = 100 + '%' this.canvasReset() @@ -427,7 +428,7 @@ export default { if (this.chart) { this.chart.dispose(); } - this.chart = echarts.init(this.$refs.chart); + this.chart = echarts.init(this.$refs.elsChart); this.chart.setOption(this.actualOptions); }, }, diff --git a/src/views/copilot/components/LineChartWater.vue b/src/views/copilot/components/LineChartWater.vue index 4b435a7..dc081b7 100644 --- a/src/views/copilot/components/LineChartWater.vue +++ b/src/views/copilot/components/LineChartWater.vue @@ -11,7 +11,7 @@ {{ item.label }} -
+
@@ -51,12 +51,12 @@ export default { }, data() { return { - width: '100%', + width:'', isFullscreen: false, actualOptions: null, options: { grid: { - left: "5%", + left: "1%", right: "4%", bottom: "3%", top: "15%", @@ -361,9 +361,12 @@ export default { }, watch: { isOpen(val) { + // console.log(val) if (val === true) { - this.width = '100%-128px' + console.log('ztl') + this.width = '99%' this.canvasReset() + console.log(this.width) } else { this.watch = 100 + '%' this.canvasReset() @@ -371,6 +374,9 @@ export default { }, /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ isFullscreen(val) { + if (val === true && this.isOpen === true) { + this.width = '99%' + } this.actualOptions.series.map((item) => { item.barWidth = val ? 18 : 12; }); @@ -399,11 +405,11 @@ export default { }, }, mounted() { - // if (screenfull.isEnabled) { - // screenfull.on("change", () => { - // this.isFullscreen = screenfull.isFullscreen; - // }); - // } + if (screenfull.isEnabled) { + screenfull.on("change", () => { + this.isFullscreen = screenfull.isFullscreen; + }); + } this.actualOptions = this.options this.canvasReset(); window.addEventListener("resize", this.canvasReset); @@ -426,7 +432,7 @@ export default { if (this.chart) { this.chart.dispose(); } - this.chart = echarts.init(this.$refs.chart); + this.chart = echarts.init(this.$refs.waterChart); this.chart.setOption(this.actualOptions); }, }, diff --git a/src/views/copilot/components/gasBarChartBase.vue b/src/views/copilot/components/gasBarChartBase.vue index d7af583..33bc474 100644 --- a/src/views/copilot/components/gasBarChartBase.vue +++ b/src/views/copilot/components/gasBarChartBase.vue @@ -1,7 +1,7 @@ @@ -9,10 +9,10 @@ @@ -52,12 +52,13 @@ export default { }, data() { return { + width: '100%', isFullscreen: false, actualOptions: null, options: { grid: { - left: "5%", - right: "1%", + left: "1%", + right: "4%", bottom: "3%", top: "15%", containLabel: true, @@ -182,9 +183,12 @@ export default { }, watch: { isOpen(val) { + // console.log(val) if (val === true) { - this.width = '100%-128px' + console.log('ryf') + this.width = '99%' this.canvasReset() + console.log(this.width) } else { this.watch = 100 + '%' this.canvasReset() @@ -192,6 +196,9 @@ export default { }, /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ isFullscreen(val) { + if (val === true && this.isOpen === true) { + this.width = '99%' + } this.actualOptions.series.map((item) => { item.barWidth = val ? 18 : 12; }); @@ -216,11 +223,11 @@ export default { }, }, mounted() { - // if (screenfull.isEnabled) { - // screenfull.on("change", () => { - // this.isFullscreen = screenfull.isFullscreen; - // }); - // } + if (screenfull.isEnabled) { + screenfull.on("change", () => { + this.isFullscreen = screenfull.isFullscreen; + }); + } this.actualOptions = this.options this.canvasReset(); window.addEventListener("resize", this.canvasReset); @@ -243,7 +250,7 @@ export default { if (this.chart) { this.chart.dispose(); } - this.chart = echarts.init(this.$refs.chart); + this.chart = echarts.init(this.$refs.gasChart); this.chart.setOption(this.actualOptions); }, }, diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue index cd9a263..dfc1be2 100644 --- a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue @@ -1,7 +1,7 @@ @@ -51,6 +51,7 @@ export default { }, data() { return { + width: '100%', isFullscreen: false, actualOptions: null, options: { diff --git a/src/views/copilot/energy/components/ElecCost.vue b/src/views/copilot/energy/components/ElecCost.vue index 2a3e3aa..7a12fa6 100644 --- a/src/views/copilot/energy/components/ElecCost.vue +++ b/src/views/copilot/energy/components/ElecCost.vue @@ -7,31 +7,30 @@