From 6507d3b348752c063816826d2eb5a5f3a38ca12c Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 21 Jun 2024 10:22:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20v2=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=84=B1=E6=95=8F=E5=90=8E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C=E4=B8=8D=E8=A7=84=E8=8C=83?= =?UTF-8?q?=20#9736?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/drag-item/DimensionItem.vue | 9 ++++++++- .../chart/components/editor/drag-item/DrillItem.vue | 12 +++++++++++- .../chart/components/editor/drag-item/QuotaItem.vue | 9 ++++++++- .../src/views/chart/components/editor/index.vue | 12 ++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue index a748ecf58a..bca9411f0a 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/DimensionItem.vue @@ -159,6 +159,10 @@ const removeItem = () => { } const getItemTagType = () => { + if (props.chart.type !== 'table-info' && props.item.desensitized) { + tagType.value = '#F54A45' + return + } tagType.value = getItemType(props.dimensionData, props.quotaData, props.item) } @@ -204,7 +208,10 @@ onMounted(() => { :content="item.chartShowName ? item.chartShowName : item.name" > - {{ item.chartShowName ? item.chartShowName : item.name }} + {{ item.chartShowName ? item.chartShowName : item.name + }}{{ item.desensitized && '(已脱敏)' }} diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/DrillItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/DrillItem.vue index 0097636f48..729c61b565 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/DrillItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/DrillItem.vue @@ -18,6 +18,10 @@ const props = defineProps({ type: Object, required: true }, + chart: { + type: Object, + required: true + }, index: { type: Number, required: true @@ -70,6 +74,10 @@ const removeItem = () => { emit('onDimensionItemRemove', item.value) } const getItemTagType = () => { + if (props.chart.type !== 'table-info' && props.item.desensitized) { + tagType.value = '#F54A45' + return + } tagType.value = getItemType(props.dimensionData, props.quotaData, props.item) } onMounted(() => { @@ -93,7 +101,9 @@ onMounted(() => { > - {{ item.name }} + {{ item.name }}{{ item.desensitized && '(已脱敏)' }} diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index 4669542aa9..5bca98c389 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -214,6 +214,10 @@ const removeItem = () => { } const getItemTagType = () => { + if (props.chart.type !== 'table-info' && props.item.desensitized) { + tagType.value = '#F54A45' + return + } tagType.value = getItemType(props.dimensionData, props.quotaData, props.item) } @@ -304,7 +308,10 @@ onMounted(() => { :content="item.chartShowName ? item.chartShowName : item.name" > - {{ item.chartShowName ? item.chartShowName : item.name }} + {{ item.chartShowName ? item.chartShowName : item.name + }}{{ item.desensitized && '(已脱敏)' }} ({{ t('chart.' + item.summary) }}) 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 39d68123c4..2668478576 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -1519,19 +1519,30 @@ const dragOver = (ev: MouseEvent) => { } const drop = (ev: MouseEvent, type = 'xAxis') => { + let hasSesensitized = false ev.preventDefault() const arr = activeDimension.value.length ? activeDimension.value : activeQuota.value for (let i = 0; i < arr.length; i++) { const obj = cloneDeep(arr[i]) + if (obj.desensitized && view.value.type !== 'table-info') { + hasSesensitized = true + continue + } + state.moveId = obj.id as unknown as number view.value[type].push(obj) const e = { newDraggableIndex: view.value[type].length - 1 } + if ('drillFields' === type) { addDrill(e) } else { addAxis(e, type as AxisType) } } + + if (hasSesensitized) { + ElMessage.error('脱敏字段不能用于制作该图表!') + } } const fieldLoading = ref(false) @@ -2277,6 +2288,7 @@ const deleteChartFieldItem = id => {