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