From edaeac0f0743169790e6567250711d43404c807a Mon Sep 17 00:00:00 2001 From: ulleo Date: Thu, 24 Jul 2025 19:03:34 +0800 Subject: [PATCH 1/6] fix: predict data display --- frontend/src/views/chat/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index 5f6571d2..514d4db6 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -569,7 +569,7 @@ function getChatPredictData(recordId?: number) { chatApi.get_chart_predict_data(recordId).then((response) => { currentChat.value.records.forEach((record) => { if (record.id === recordId) { - record.predict_data = response + record.predict_data = response.data ?? [] } }) }) From 53af5ada9d37d8ffef4bcdec786af146aa30fd87 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 24 Jul 2025 21:09:12 +0800 Subject: [PATCH 2/6] fix: fix style --- frontend/src/i18n/en.json | 1 + frontend/src/i18n/zh-CN.json | 1 + frontend/src/views/dashboard/editor/DashboardChatList.vue | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 383cddca..c3211618 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -32,6 +32,7 @@ "password_reset_successful": "Password reset successful" }, "dashboard": { + "no_data": "No Relevant Content Found", "new_tab": "New Tab", "length_limit64": "Field length must be between 1 and 64", "sort_column": "Sort field", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index ca01a0fb..374f9d18 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -34,6 +34,7 @@ "password_reset_successful": "重置密码成功" }, "dashboard": { + "no_data": "没找到相关内容", "new_tab": "新建Tab", "length_limit64": "字段长度需要在1-64之间", "sort_column": "排序字段", diff --git a/frontend/src/views/dashboard/editor/DashboardChatList.vue b/frontend/src/views/dashboard/editor/DashboardChatList.vue index b9cf325c..0641d0cc 100644 --- a/frontend/src/views/dashboard/editor/DashboardChatList.vue +++ b/frontend/src/views/dashboard/editor/DashboardChatList.vue @@ -130,7 +130,7 @@ const filteredAndGroupedData = computed(() => { " class="no-data" > - {{ t('dashboard.no_chat') }} + {{ t('dashboard.no_data') }} @@ -217,6 +217,7 @@ const filteredAndGroupedData = computed(() => { .no-data { text-align: center; padding: 16px; + margin-top: 140px; color: var(--ed-text-color-placeholder); font-size: 14px; } From c6b16e7ad38c19323906d993d72ff5c2a6f266c8 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 24 Jul 2025 21:39:44 +0800 Subject: [PATCH 3/6] refactor: update add component tips --- frontend/src/i18n/en.json | 3 ++- frontend/src/i18n/zh-CN.json | 3 ++- frontend/src/views/dashboard/editor/Toolbar.vue | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index a4af00b2..c61b1cce 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -32,6 +32,7 @@ "password_reset_successful": "Password reset successful" }, "dashboard": { + "add_success": "Add Success", "no_data": "No Relevant Content Found", "new_tab": "New Tab", "length_limit64": "Field length must be between 1 and 64", @@ -505,4 +506,4 @@ "back_community": "Restore to Community Edition", "confirm_tips": "Are you sure to restore to Community Edition?" } -} \ No newline at end of file +} diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 32c3b60b..aea50c1b 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -34,6 +34,7 @@ "password_reset_successful": "重置密码成功" }, "dashboard": { + "add_success": "添加成功", "no_data": "没找到相关内容", "new_tab": "新建Tab", "length_limit64": "字段长度需要在1-64之间", @@ -517,4 +518,4 @@ "back_community": "还原至社区版", "confirm_tips": "确定还原至社区版?" } -} \ No newline at end of file +} diff --git a/frontend/src/views/dashboard/editor/Toolbar.vue b/frontend/src/views/dashboard/editor/Toolbar.vue index 5a6e1906..7b59d3f9 100644 --- a/frontend/src/views/dashboard/editor/Toolbar.vue +++ b/frontend/src/views/dashboard/editor/Toolbar.vue @@ -138,6 +138,10 @@ const addChatChart = (views: any) => { views.forEach((view: any) => { emits('addComponent', 'SQView', cloneDeep(view)) }) + ElMessage({ + type: 'success', + message: t('dashboard.add_success'), + }) } const previewInner = () => { From ecd2735cf911413e8668c83e16d298f781de43fc Mon Sep 17 00:00:00 2001 From: junjun <752696511@qq.com> Date: Thu, 24 Jul 2025 22:25:28 +0800 Subject: [PATCH 4/6] fix: table permission --- backend/apps/datasource/crud/datasource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/datasource/crud/datasource.py b/backend/apps/datasource/crud/datasource.py index 75edb427..5214fe18 100644 --- a/backend/apps/datasource/crud/datasource.py +++ b/backend/apps/datasource/crud/datasource.py @@ -246,7 +246,7 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table if data.fields is None or len(data.fields) == 0: return {"fields": [], "data": [], "sql": ''} - where = None + where = '' f_list = [f for f in data.fields if f.checked] if is_normal_user(current_user): # column is checked, and, column permission for data.fields From d77d1534cf5821998488565133d41b764c76a9ed Mon Sep 17 00:00:00 2001 From: junjun <752696511@qq.com> Date: Thu, 24 Jul 2025 23:08:58 +0800 Subject: [PATCH 5/6] fix: table permission --- backend/apps/datasource/crud/datasource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/datasource/crud/datasource.py b/backend/apps/datasource/crud/datasource.py index 5214fe18..3d01880e 100644 --- a/backend/apps/datasource/crud/datasource.py +++ b/backend/apps/datasource/crud/datasource.py @@ -294,7 +294,7 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table elif ds.type == "sqlServer": sql = f"""SELECT [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{data.table.table_name}] {where} - ORDER BY [{data.fields[0].field_name}] + ORDER BY [{fields[0]}] OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY""" elif ds.type == "pg" or ds.type == "excel": sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}" @@ -303,7 +303,7 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table elif ds.type == "oracle": sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}" {where} - ORDER BY "{data.fields[0].field_name}" + ORDER BY "{fields[0]}" OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY""" return exec_sql(ds, sql) From 8356bba1a62fceb299f98351f1234954fe21607e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 25 Jul 2025 08:19:53 +0800 Subject: [PATCH 6/6] fix: fix dashboard view select repeat --- frontend/src/views/dashboard/editor/ChatChartSelection.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/dashboard/editor/ChatChartSelection.vue b/frontend/src/views/dashboard/editor/ChatChartSelection.vue index 9ed36a1a..26e84803 100644 --- a/frontend/src/views/dashboard/editor/ChatChartSelection.vue +++ b/frontend/src/views/dashboard/editor/ChatChartSelection.vue @@ -99,7 +99,12 @@ function adaptorChartInfoList(chatInfo: ChatInfo) { chartInfoList.value = [] if (chatInfo && chatInfo.records) { chatInfo.records.forEach((record: any) => { - if (record?.chart && record.data) { + if ( + (record?.analysis_record_id === undefined || record?.analysis_record_id === null) && + (record?.predict_record_id === undefined || record?.predict_record_id === null) && + record?.chart && + record.data + ) { const recordeInfo = { id: chatInfo.id + '_' + record.id, data: record.data, chart: {} } const chartBaseInfo = JSON.parse(record.chart) recordeInfo['chart'] = {