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(() => {