From e388f660d101182e579b432b8381ad3fa00df3b8 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 24 Oct 2024 13:52:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=9B=BE=E8=A1=A8):=20=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E6=9F=B1=E7=8A=B6=E5=9B=BE=E3=80=81=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E6=9D=A1=E5=BD=A2=E5=9B=BE=E6=94=AF=E6=8C=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BE=85=E5=8A=A9=E7=BA=BF=E5=8A=9F=E8=83=BD=20#11865?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-senior/components/AssistLine.vue | 1 + .../components/dialog/AssistLineEdit.vue | 15 +++++++++++++-- .../chart/components/js/panel/charts/bar/bar.ts | 4 ++-- .../js/panel/charts/bar/horizontal-bar.ts | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue index a38848cb1d..4b56d35b37 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/AssistLine.vue @@ -212,6 +212,7 @@ onMounted(() => { class="dialog-css" > import icon_deleteTrash_outlined from '@/assets/svg/icon_delete-trash_outlined.svg' import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg' -import { computed, onMounted, reactive } from 'vue' +import { computed, onMounted, PropType, reactive } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { COLOR_PANEL } from '@/views/chart/components/editor/util/chart' import { fieldType } from '@/utils/attr' @@ -11,6 +11,10 @@ import { iconFieldMap } from '@/components/icon-group/field-list' const { t } = useI18n() const props = defineProps({ + chart: { + type: Object as PropType, + required: true + }, line: { type: Array, required: true @@ -167,6 +171,13 @@ const getQuotaExtField = id => { } } +const getFieldOptions = computed(() => { + if (['percentage-bar-stack', 'percentage-bar-stack-horizontal'].includes(props.chart.type)) { + return state.fieldOptions.filter(item => item.value === '0') + } + return state.fieldOptions +}) + onMounted(() => { init() }) @@ -199,7 +210,7 @@ onMounted(() => { item !== 'assist-line') this.axis = [...BAR_AXIS_TYPE, 'extStack'] } } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts index 5320ff300c..721d3d2180 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/horizontal-bar.ts @@ -475,7 +475,8 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar { this.configLegend, this.configXAxis, this.configYAxis, - this.configSlider + this.configSlider, + this.configAnalyseHorizontal )(chart, options, {}, this) } @@ -485,6 +486,5 @@ export class HorizontalPercentageStackBar extends HorizontalStackBar { ...this.baseOptions, isPercent: true } - this.properties = this.properties.filter(item => item !== 'assist-line') } }