diff --git a/frontend/src/views/chat/chat-block/ChartPopover.vue b/frontend/src/views/chat/chat-block/ChartPopover.vue index 532f5437..52602e8d 100644 --- a/frontend/src/views/chat/chat-block/ChartPopover.vue +++ b/frontend/src/views/chat/chat-block/ChartPopover.vue @@ -17,9 +17,22 @@ const props = defineProps({ }, }) const currentIcon = computed(() => { - return props.chartTypeList.find((ele) => ele.value === props.chartType || ele.value === 'table') - .icon + if (props.chartType === 'table') { + const [ele] = props.chartTypeList || [] + if (ele.icon) { + return ele.icon + } + return null + } + return props.chartTypeList.find((ele) => ele.value === props.chartType).icon }) + +const firstItem = () => { + if (props.chartType === 'table') { + const [ele] = props.chartTypeList || [] + handleDefaultChatChange(ele || {}) + } +} const emits = defineEmits(['typeChange']) const handleDefaultChatChange = (val: any) => { emits('typeChange', val.value) @@ -29,7 +42,11 @@ const handleDefaultChatChange = (val: any) => {