From ddd760ba6136c7ec88eb0f20edfcc1db8a97b7fd Mon Sep 17 00:00:00 2001 From: ulleo Date: Tue, 16 Apr 2024 10:29:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=8C=E8=BD=B4=E5=9B=BE=E8=AE=BE=E7=BD=AE=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E7=BA=BF=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/models/chart/chart-senior.d.ts | 2 + .../editor/editor-senior/Senior.vue | 5 ++ .../editor-senior/components/AssistLine.vue | 28 +++++++- .../components/dialog/AssistLineEdit.vue | 68 +++++++++++++++++-- .../views/chart/components/editor/index.vue | 1 + .../js/panel/charts/others/chart-mix.ts | 14 +++- .../components/js/panel/common/common_antv.ts | 39 ++++++++--- .../api/chart/dto/ChartSeniorAssistDTO.java | 1 + 8 files changed, 140 insertions(+), 18 deletions(-) diff --git a/core/core-frontend/src/models/chart/chart-senior.d.ts b/core/core-frontend/src/models/chart/chart-senior.d.ts index 610b5f2467..ccc6d7dba5 100644 --- a/core/core-frontend/src/models/chart/chart-senior.d.ts +++ b/core/core-frontend/src/models/chart/chart-senior.d.ts @@ -107,6 +107,8 @@ declare interface AssistLine { * 动态值聚合方式 */ summary: string + + axisType: 'left' | 'right' } /** diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue index 36870c6f88..bbe33bf9b8 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/Senior.vue @@ -49,6 +49,10 @@ const props = defineProps({ type: Array, required: true }, + quotaExtData: { + type: Array, + required: true + }, fieldsData: { type: Array, required: true @@ -230,6 +234,7 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi) :chart="props.chart" :themes="themes" :quota-data="props.quotaData" + :quota-ext-data="props.quotaExtData" :property-inner="propertyInnerAll['assist-line']" @onAssistLineChange="onAssistLineChange" /> 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 4a96182336..b496b3dae5 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 @@ -19,6 +19,10 @@ const props = defineProps({ type: Array, required: true }, + quotaExtData: { + type: Array, + required: true + }, themes: { type: String as PropType, default: 'dark' @@ -32,6 +36,14 @@ const quotaFields = computed>(() => { return props.quotaData.filter(ele => ele.summary !== '' && ele.id !== '-1') }) +const quotaExtFields = computed>(() => { + return props.quotaExtData.filter(ele => ele.summary !== '' && ele.id !== '-1') +}) + +const useQuotaExt = computed(() => { + return props.chart.type === 'chart-mix' +}) + const state = reactive({ assistLineCfg: { enable: false, @@ -42,6 +54,11 @@ const state = reactive({ quotaFields: [] }) +const axisType = [ + { type: 'left', name: t('chart.drag_block_value_axis_left') }, + { type: 'right', name: t('chart.drag_block_value_axis_right') } +] + watch( () => props.chart.senior.assistLineCfg, () => { @@ -100,7 +117,14 @@ const changeLine = () => { } function existField(line) { - return !!find(quotaFields.value, d => d.id === line.id) + if (useQuotaExt.value) { + return ( + !!find(quotaFields.value, d => d.id === line.id) || + !!find(quotaExtFields.value, d => d.id === line.id) + ) + } else { + return !!find(quotaFields.value, d => d.id === line.id) + } } const init = () => { @@ -194,6 +218,8 @@ onMounted(() => {