From c4466b2b8409472cf6c34eded350361742fcfd11 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Wed, 30 Oct 2024 12:55:55 +0800 Subject: [PATCH] =?UTF-8?q?style(=E5=9B=BE=E8=A1=A8):=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E3=80=81=E6=B0=B4=E6=B3=A2=E5=9B=BE=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E4=BC=98=E5=8C=96=EF=BC=8C=E7=A9=BA=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=88=96=E8=80=85=E8=AE=B0=E5=BD=95=E6=95=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9C=80=E5=A4=A7=E5=80=BC=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E7=B1=BB=E5=9E=8B=E4=B8=BA=E5=9B=BA=E5=AE=9A=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-style/components/MiscSelector.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue index 2002ed3146..96856d226d 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue @@ -88,6 +88,12 @@ const changeMisc = (prop = '', refresh = false) => { const init = () => { const misc = cloneDeep(props.chart.customAttr.misc) state.miscForm = defaultsDeep(misc, cloneDeep(DEFAULT_MISC)) as ChartMiscAttr + const maxTypeKey = props.chart.type === 'liquid' ? 'liquidMaxType' : 'gaugeMaxType' + const maxValueKey = props.chart.type === 'liquid' ? 'liquidMax' : 'gaugeMax' + if (!props.chart.yAxis.length) { + state.miscForm[maxTypeKey] = 'fix' + state.miscForm[maxValueKey] = undefined + } } const initField = () => { @@ -319,9 +325,21 @@ const changeMaxValidate = prop => { } changeMisc(prop) } +const addAxis = (form: AxisEditForm) => { + const maxTypeKey = props.chart.type === 'liquid' ? 'liquidMaxType' : 'gaugeMaxType' + const maxValueKey = props.chart.type === 'liquid' ? 'liquidMax' : 'gaugeMax' + if (form.axis[0]?.id === '-1') { + state.miscForm[maxTypeKey] = 'fix' + state.miscForm[maxValueKey] = cloneDeep(defaultMaxValue[maxValueKey]) + changeMisc(maxValueKey + 'Field') + } else { + state.miscForm[maxTypeKey] = 'dynamic' + } +} onMounted(() => { initField() init() + useEmitt({ name: 'addAxis', callback: addAxis }) })