fix(图表): 脱敏字段不可用于视图制作

This commit is contained in:
wisonic-s 2024-07-01 22:39:08 +08:00
parent 270f812099
commit 0ea9d63f76

View File

@ -262,9 +262,6 @@ const chartStyleShow = computed(() => {
}) })
const chartViewInstance = computed(() => { const chartViewInstance = computed(() => {
if (view.value.render === 'highchart') {
return chartViewManager.getChartView('antv', view.value.type)
}
return chartViewManager.getChartView(view.value.render, view.value.type) return chartViewManager.getChartView(view.value.render, view.value.type)
}) })
const showAxis = (axis: AxisType) => chartViewInstance.value?.axis?.includes(axis) const showAxis = (axis: AxisType) => chartViewInstance.value?.axis?.includes(axis)
@ -559,6 +556,33 @@ const showAggregate = computed<boolean>(() => {
return false return false
}) })
const disableUpdate = computed(() => {
let flag = false
if (view.value.type === 'table-info') {
return flag
}
if (!chartViewInstance.value) {
return flag
}
const axisConfig = chartViewInstance.value.axisConfig
if (!axisConfig) {
return flag
}
for (const key in axisConfig) {
if (Object.prototype.hasOwnProperty.call(axisConfig, key)) {
const axis = view.value[key]
if (axis instanceof Array) {
axis.forEach(a => {
if (a.desensitized) {
flag = true
}
})
}
}
}
return flag
})
const addAxis = (e, axis: AxisType) => { const addAxis = (e, axis: AxisType) => {
recordSnapshotInfo('calcData') recordSnapshotInfo('calcData')
const axisSpec = chartViewInstance.value?.axisConfig[axis] const axisSpec = chartViewInstance.value?.axisConfig[axis]
@ -2482,6 +2506,7 @@ onMounted(() => {
</div> </div>
<el-button <el-button
:disabled="disableUpdate"
type="primary" type="primary"
class="result-style-button" class="result-style-button"
@click="updateChartData(view)" @click="updateChartData(view)"