style(图表): 当配色方案为渐变,然后切换图表类型到不支持渐变颜色方案的图表时,颜色方案配置为默认

This commit is contained in:
jianneng-fit2cloud 2024-06-24 15:29:31 +08:00
parent 680a5ef321
commit 65cdb6cb97

View File

@ -1,10 +1,11 @@
<script setup lang="ts">
import { ElColorPicker, ElPopover } from 'element-plus-secondary'
import { computed, ref } from 'vue'
import { computed, onMounted, ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { COLOR_CASES, COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
import GradientColorSelector from '@/views/chart/components/editor/editor-style/components/GradientColorSelector.vue'
import { getMapColorCases, stepsColor } from '@/views/chart/components/js/util'
import { useEmitt } from '@/hooks/web/useEmitt'
const { t } = useI18n()
@ -24,7 +25,15 @@ const props = withDefaults(
)
const emits = defineEmits(['update:modelValue', 'changeBasicStyle'])
const changeChartType = () => {
if (isColorGradient.value) {
state.value.basicStyleForm.colorScheme = 'default'
changeColorOption({ value: 'default' })
}
}
onMounted(() => {
useEmitt({ name: 'chart-type-change', callback: changeChartType })
})
const state = computed({
get() {
return props.modelValue