From 43a6f59afe9161ca519d5f414299d4b07879d098 Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Tue, 19 Mar 2024 16:43:08 +0800 Subject: [PATCH] update chart --- src/components/Chart/RateChart.vue | 14 +++++++++++--- src/components/Chart/YieldChart.vue | 15 +++++++++++---- src/components/Chart/rateOption.js | 9 +++++---- src/components/HourChart.vue | 12 +++--------- src/components/datapage/LineToday.vue | 11 +++++++---- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/components/Chart/RateChart.vue b/src/components/Chart/RateChart.vue index 7607a3b..f49581b 100644 --- a/src/components/Chart/RateChart.vue +++ b/src/components/Chart/RateChart.vue @@ -19,6 +19,10 @@ const props = defineProps({ }; }, }, + displayPlaceholder: { + type: Boolean, + default: false, + }, }); watch( @@ -54,7 +58,10 @@ onMounted(() => {
-
+
{{ rate[0] }}. {{ rate[1] }}%
@@ -62,11 +69,11 @@ onMounted(() => {
- 当前成品率: {{ props.rawData.nowYield }}% + 当前成品率: {{ props.rawData?.nowYield ?? 0 }}%
- 目标成品率: {{ props.rawData.targetYield }}% + 目标成品率: {{ props.rawData?.targetYield ?? 0 }}%
@@ -79,6 +86,7 @@ onMounted(() => { position: relative; } +.chart-placeholder, .chart-container { margin: auto; width: 320px; diff --git a/src/components/Chart/YieldChart.vue b/src/components/Chart/YieldChart.vue index 3c945df..0e17b36 100644 --- a/src/components/Chart/YieldChart.vue +++ b/src/components/Chart/YieldChart.vue @@ -15,12 +15,17 @@ const props = defineProps({ }; }, }, + displayPlaceholder: { + type: Boolean, + default: false, + }, }); const chart = ref(null); const yieldChartRef = ref(null); function reInitChart() { + if (props.displayPlaceholder) return; if (chart.value) chart.value.dispose(); const _chart = echarts.init(yieldChartRef.value); _chart.setOption(getOptions(props.rawData)); @@ -34,14 +39,15 @@ onMounted(() => {