forked from github/dataease
style(图表): 当配色方案为渐变,然后切换图表类型到不支持渐变颜色方案的图表时,颜色方案配置为默认
This commit is contained in:
parent
680a5ef321
commit
65cdb6cb97
@ -1,10 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElColorPicker, ElPopover } from 'element-plus-secondary'
|
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 { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { COLOR_CASES, COLOR_PANEL } from '@/views/chart/components/editor/util/chart'
|
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 GradientColorSelector from '@/views/chart/components/editor/editor-style/components/GradientColorSelector.vue'
|
||||||
import { getMapColorCases, stepsColor } from '@/views/chart/components/js/util'
|
import { getMapColorCases, stepsColor } from '@/views/chart/components/js/util'
|
||||||
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
@ -24,7 +25,15 @@ const props = withDefaults(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const emits = defineEmits(['update:modelValue', 'changeBasicStyle'])
|
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({
|
const state = computed({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue
|
return props.modelValue
|
||||||
|
Loading…
Reference in New Issue
Block a user