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 ccc6d7dba5..ab9d0cdceb 100644 --- a/core/core-frontend/src/models/chart/chart-senior.d.ts +++ b/core/core-frontend/src/models/chart/chart-senior.d.ts @@ -108,7 +108,7 @@ declare interface AssistLine { */ summary: string - axisType: 'left' | 'right' + yAxisType: 'left' | 'right' } /** 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 b496b3dae5..ca434bda5c 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 @@ -54,11 +54,6 @@ 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, () => { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/AssistLineEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/AssistLineEdit.vue index 775b821b22..55e2f6df10 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/AssistLineEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/AssistLineEdit.vue @@ -26,7 +26,7 @@ const props = defineProps({ } }) -const axisTypes = [ +const yAxisTypes = [ { type: 'left', name: t('chart.drag_block_value_axis_left') }, { type: 'right', name: t('chart.drag_block_value_axis_right') } ] @@ -39,7 +39,7 @@ const state = reactive({ fieldId: '', summary: 'avg', axis: 'y', // 主轴 - axisType: 'left', + yAxisType: 'left', value: '0', lineType: 'solid', color: '#ff0000', @@ -98,8 +98,8 @@ const removeLine = index => { changeAssistLine() } -const changeAxisType = item => { - if (props.useQuotaExt && item.axisType === 'right') { +const changeYAxisType = item => { + if (props.useQuotaExt && item.yAxisType === 'right') { item.fieldId = props.quotaExtFields ? props.quotaExtFields[0]?.id : null item.curField = getQuotaExtField(item.fieldId) } else { @@ -113,7 +113,7 @@ const changeAssistLine = () => { emit('onAssistLineChange', state.lineArr) } const changeAssistLineField = item => { - if (props.useQuotaExt && item.axisType === 'right') { + if (props.useQuotaExt && item.yAxisType === 'right') { item.curField = getQuotaExtField(item.fieldId) } else { item.curField = getQuotaField(item.fieldId) @@ -169,9 +169,9 @@ onMounted(() => { /> - + { @change="changeAssistLineField(item)" > { protected configAnalyse(chart: Chart, options: DualAxesOptions): DualAxesOptions { const list = getAnalyse(chart) const annotations = { - value: filter(list, l => l.axisType === 'left'), - valueExt: filter(list, l => l.axisType === 'right') + value: filter(list, l => l.yAxisType === 'left'), + valueExt: filter(list, l => l.yAxisType === 'right') } return { ...options, annotations } } diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index db58956d67..5b8fe40894 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -681,10 +681,10 @@ export function getAnalyse(chart: Chart) { const content = ele.name + ' : ' + - valueFormatter(value, ele.axisType === 'left' ? axisFormatterCfg : axisExtFormatterCfg) + valueFormatter(value, ele.yAxisType === 'left' ? axisFormatterCfg : axisExtFormatterCfg) assistLine.push({ type: 'line', - axisType: ele.axisType, + yAxisType: ele.yAxisType, start: ['start', value], end: ['end', value], style: { @@ -694,15 +694,17 @@ export function getAnalyse(chart: Chart) { }) assistLine.push({ type: 'text', - axisType: ele.axisType, + yAxisType: ele.yAxisType, position: [ - (ele.axisType === 'left' ? yAxisPosition : yAxisExtPosition) === 'left' ? 'start' : 'end', + (ele.yAxisType === 'left' ? yAxisPosition : yAxisExtPosition) === 'left' + ? 'start' + : 'end', value ], content: content, offsetY: -2, offsetX: - (ele.axisType === 'left' ? yAxisPosition : yAxisExtPosition) === 'left' + (ele.yAxisType === 'left' ? yAxisPosition : yAxisExtPosition) === 'left' ? 2 : -10 * (content.length - 2), style: { diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/chart/dto/ChartSeniorAssistDTO.java b/sdk/api/api-base/src/main/java/io/dataease/api/chart/dto/ChartSeniorAssistDTO.java index 29c905a54b..be366da8df 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/chart/dto/ChartSeniorAssistDTO.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/chart/dto/ChartSeniorAssistDTO.java @@ -15,7 +15,7 @@ public class ChartSeniorAssistDTO { private Long fieldId; private String summary; private String axis; - private String axisType; + private String yAxisType; private String value; private String lineType; private String color;