From c75fb543aabf5928db9a92f29636fbfed8bad571 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 25 Jul 2025 18:12:13 +0800 Subject: [PATCH] fix: bug fix --- .../views/chat/chat-block/ChartPopover.vue | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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) => {