mirror of
https://gitee.com/dromara/go-view.git
synced 2025-05-10 01:38:57 +08:00
!265 fix: 修复已保存的饼图数据radius被watch修改为默认值bug
Merge pull request !265 from xihai777/master-fetch-dev
This commit is contained in:
commit
415b3d6f7d
@ -12,7 +12,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, PropType, onMounted, watch } from 'vue'
|
||||
import { computed, PropType, onMounted, watch, ref } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use } from 'echarts/core'
|
||||
@ -26,6 +26,8 @@ import { isPreview } from '@/utils'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import dataJson from './data.json'
|
||||
|
||||
const isInit = ref<boolean>(false)
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
type: Object,
|
||||
@ -103,6 +105,10 @@ watch(
|
||||
() => props.chartConfig.option.type,
|
||||
newData => {
|
||||
try {
|
||||
// 防止初始化时触发修改,导致部分参数丢失
|
||||
if (!isInit.value) {
|
||||
isInit.value = true
|
||||
} else {
|
||||
if (newData === 'nomal') {
|
||||
props.chartConfig.option.series[0].radius = '70%'
|
||||
props.chartConfig.option.series[0].roseType = false
|
||||
@ -113,6 +119,7 @@ watch(
|
||||
props.chartConfig.option.series[0].radius = '70%'
|
||||
props.chartConfig.option.series[0].roseType = true
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user