From 5eaa291bb21d074c28fbde0350a0c6f99b4e78fe Mon Sep 17 00:00:00 2001 From: ulleo Date: Thu, 25 Jan 2024 18:34:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8C=87=E6=A0=87=E5=8D=A1):=20=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6:=20=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E6=8B=96=E6=95=B0=E5=80=BC=E7=B1=BB=E5=9E=8B=E6=8C=87?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/locales/zh-CN.ts | 1 + .../views/chart/components/editor/index.vue | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 5bff42219b..b1fe059a6d 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -1081,6 +1081,7 @@ export default { conform_below: '符合以下', addition: '条件', drill_field_error: '下钻起始字段需在维度中', + error_not_number: '不支持拖拽非数值类型指标', error_q_2_d: '不支持拖拽指标至维度', error_d_2_q: '不支持拖拽维度至指标', only_input_number: '请输入正确数值', diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index 798925d287..a61fd09645 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -442,6 +442,27 @@ const addAxis = (e, axis: AxisType) => { if (type) { typeValid = dragCheckType(view.value[axis], type) } + // 针对指标卡进行数值类型判断 + if (typeValid && type === 'q' && view.value.type === 'indicator') { + const list = view.value[axis] + if (list && list.length > 0) { + let valid = true + for (let i = 0; i < list.length; i++) { + if (list[i].deType !== 2 && list[i].deType !== 3) { + list.splice(i, 1) + valid = false + } + } + typeValid = valid + if (!typeValid) { + ElMessage({ + message: t('chart.error_not_number'), + type: 'warning' + }) + } + } + } + if (!duplicate) { dup = dragMoveDuplicate(view.value[axis], e, 'chart') }