From a0f504742e0bb9a09aaddc7678daba516c38bfe4 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 26 Mar 2024 19:05:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=8C=87=E6=A0=87=E5=8D=A1=E6=89=B9=E9=87=8F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-style/ChartStyleBatchSet.vue | 4 +- .../components/IndicatorNameSelector.vue | 9 +++- .../components/IndicatorValueSelector.vue | 47 +++++++++++-------- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyleBatchSet.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyleBatchSet.vue index aff9c85345..53705370db 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyleBatchSet.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyleBatchSet.vue @@ -80,11 +80,11 @@ const onChangeYAxisForm = (val, prop) => { } const onIndicatorChange = (val, prop) => { - batchOptChange('customAttr', 'indicator', val, prop) + batchOptChange('customAttr', 'indicator', val.indicatorValue, prop) } const onIndicatorNameChange = (val, prop) => { - batchOptChange('customAttr', 'indicatorName', val, prop) + batchOptChange('customAttr', 'indicatorName', val.indicatorName, prop) } const onChangeMiscStyleForm = (val, prop) => { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue index e1996c19ca..6ed34677a4 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorNameSelector.vue @@ -12,9 +12,12 @@ import { cloneDeep, defaultsDeep } from 'lodash-es' import { ElIcon } from 'element-plus-secondary' import Icon from '@/components/icon-custom/src/Icon.vue' import { hexColorToRGBA } from '@/views/chart/components/js/util' +import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +import { storeToRefs } from 'pinia' const { t } = useI18n() - +const dvMainStore = dvMainStoreWithOut() +const { batchOptStatus } = storeToRefs(dvMainStore) const props = defineProps({ chart: { type: Object, @@ -92,7 +95,9 @@ onMounted(() => { watch( () => props.chart?.customAttr?.indicatorName, () => { - init() + if (!batchOptStatus.value) { + init() + } }, { deep: true } ) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue index b5cccfde6c..bc5a6c5d1a 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/IndicatorValueSelector.vue @@ -12,6 +12,10 @@ import { cloneDeep, defaultsDeep } from 'lodash-es' import { ElIcon, ElInput } from 'element-plus-secondary' import Icon from '@/components/icon-custom/src/Icon.vue' import { hexColorToRGBA } from '@/views/chart/components/js/util' +import { storeToRefs } from 'pinia' +import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' +const dvMainStore = dvMainStoreWithOut() +const { batchOptStatus } = storeToRefs(dvMainStore) const { t } = useI18n() @@ -53,7 +57,8 @@ const fontSizeList = computed(() => { return arr }) -const changeTitleStyle = prop => { +const changeLabelTitleStyleStyle = prop => { + console.log('changeLabelTitleStyleStyle===' + prop) emit('onIndicatorChange', state.indicatorValueForm, prop) } @@ -95,7 +100,9 @@ onMounted(() => { watch( () => props.chart?.customAttr?.indicator, () => { - init() + if (!batchOptStatus.value) { + init() + } }, { deep: true } ) @@ -125,7 +132,7 @@ defineExpose({ getFormData }) :effect="themes" v-model="state.indicatorValueForm.fontFamily" :placeholder="t('chart.font_family')" - @change="changeTitleStyle('fontFamily')" + @change="changeLabelTitleStyleStyle('fontFamily')" > @@ -156,7 +163,7 @@ defineExpose({ getFormData }) v-model="state.indicatorValueForm.fontSize" :placeholder="t('chart.text_fontsize')" size="small" - @change="changeTitleStyle('fontSize')" + @change="changeLabelTitleStyleStyle('fontSize')" >