diff --git a/backend/template.yaml b/backend/template.yaml index 0d414876..a15ddecf 100644 --- a/backend/template.yaml +++ b/backend/template.yaml @@ -66,6 +66,7 @@ template: 其中“y”和“series”必须从SQL查询列中提取。 - 如果答案未知或者与生成JSON无关,则生成的 JSON 格式应为: {{"type":"error", "reason": "抱歉,我无法回答您的问题。"}} + - JSON中生成的标题需要尽量精简 ### 示例: 如果 SQL 为: SELECT products_sales_data.category, AVG(products_sales_data.price) AS average_price FROM products_sales_data GROUP BY products_sales_data.category; diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index e3808633..3995ebc0 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -75,20 +75,28 @@ "qa": { "new_chat": "New Chat", "start_sqlbot": "Start SQLBot", - "title": "Smart Query", - "placeholder": "Enter your question", + "title": "Smart Data Query", + "placeholder": "Please enter your question", "ask": "Ask", "loading": "Loading...", - "no_data": "No Data", + "no_data": "No data available", "error": "An error occurred, please try again later", - "question_placeholder": "Press Enter to submit, or use Ctrl + Enter for new line", - "greeting": "Hi, I'm SQLBot, nice to serve you", - "hint_description": "I can help query data, generate charts, detect data anomalies, predict data, etc. Please select a data source to start smart querying~", + "question_placeholder": "Press Enter to submit, or use Ctrl + Enter for a new line", + "greeting": "Hello, I'm SQLBot. How can I assist you today?", + "hint_description": "I can query data, generate charts, detect anomalies, predict trends, and more. Please select a data source to begin!", "select_datasource": "Select Data Source", "view_more": "View More", "selected_datasource": "Selected Data Source", - "empty_datasource": "No data source available, please create one first!", - "datasource_not_exist": "Data source does not exist" + "empty_datasource": "No data sources available. Please create one before starting Smart Data Query!", + "datasource_not_exist": "Data source does not exist", + "guess_u_ask": "You might want to ask:", + "continue_to_ask": "Continue asking:", + "data_analysis": "Data Analysis", + "data_predict": "Data Prediction", + "chat_search": "Search", + "thinking": "Thinking", + "thinking_step": "Thought Process", + "ask_again": "Regenerate" }, "ds": { "title": "Data Source", @@ -353,19 +361,27 @@ "no_fields_yet": "No fields yet" }, "chat": { + "type": "Chart Type", "chart_type": { - "table": "Table", - "bar": "Bar", - "column": "Column", - "line": "Line", - "pie": "Pie" + "table": "Detail Table", + "bar": "Bar Chart", + "column": "Column Chart", + "line": "Line Chart", + "pie": "Pie Chart" }, - "sql_generation": "SQL Generation", - "chart_generation": "Chart Generation", - "inference_process": "Inference process", + "show_sql": "View SQL", + "export_to": "Export As", + "excel": "Excel", + "picture": "Image", + "add_to_dashboard": "Add to Dashboard", + "full_screen": "Full Screen", + "exit_full_screen": "Exit Full Screen", + "sql_generation": "Generate SQL", + "chart_generation": "Generate Chart", + "inference_process": "Thought Process", "thinking": "Thinking", "data_analysis": "Data Analysis", - "data_predict": "Data Predict" + "data_predict": "Data Prediction" }, "about": { "title": "About", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index b81b36b6..47f5ab40 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -98,8 +98,8 @@ "datasource_not_exist": "数据源不存在", "guess_u_ask": "猜你想问:", "continue_to_ask": "继续提问:", - "data_analysis": "数据预测", - "data_predict": "数据分析", + "data_analysis": "数据分析", + "data_predict": "数据预测", "chat_search": "搜索", "thinking": "思考中", "thinking_step": "思考过程", diff --git a/frontend/src/views/chat/ChatAnswer.vue b/frontend/src/views/chat/ChatAnswer.vue deleted file mode 100644 index eab61123..00000000 --- a/frontend/src/views/chat/ChatAnswer.vue +++ /dev/null @@ -1,357 +0,0 @@ - - - - - diff --git a/frontend/src/views/chat/answer/AnalysisAnswer.vue b/frontend/src/views/chat/answer/AnalysisAnswer.vue index 83dddba7..7118f320 100644 --- a/frontend/src/views/chat/answer/AnalysisAnswer.vue +++ b/frontend/src/views/chat/answer/AnalysisAnswer.vue @@ -193,7 +193,12 @@ defineExpose({ sendMessage, index: index.value, chatList: _chatList }) > - + + diff --git a/frontend/src/views/chat/answer/BaseAnswer.vue b/frontend/src/views/chat/answer/BaseAnswer.vue index e4b2df6b..f6065581 100644 --- a/frontend/src/views/chat/answer/BaseAnswer.vue +++ b/frontend/src/views/chat/answer/BaseAnswer.vue @@ -62,9 +62,9 @@ function clickShow() { } onMounted(() => { - if (props.loading) { - show.value = true - } + // if (props.loading) { + // show.value = true + // } }) @@ -91,6 +91,9 @@ onMounted(() => {
+ + +
diff --git a/frontend/src/views/chat/answer/ChartAnswer.vue b/frontend/src/views/chat/answer/ChartAnswer.vue index 72863475..8b81fd96 100644 --- a/frontend/src/views/chat/answer/ChartAnswer.vue +++ b/frontend/src/views/chat/answer/ChartAnswer.vue @@ -223,7 +223,12 @@ defineExpose({ sendMessage, index: index.value }) diff --git a/frontend/src/views/chat/answer/PredictAnswer.vue b/frontend/src/views/chat/answer/PredictAnswer.vue index 89aba684..64e73f76 100644 --- a/frontend/src/views/chat/answer/PredictAnswer.vue +++ b/frontend/src/views/chat/answer/PredictAnswer.vue @@ -194,7 +194,12 @@ defineExpose({ sendMessage, index: index.value, chatList: _chatList }) - + + diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue index 588dd037..c525880f 100644 --- a/frontend/src/views/chat/chat-block/ChartBlock.vue +++ b/frontend/src/views/chat/chat-block/ChartBlock.vue @@ -15,6 +15,7 @@ import icon_into_item_outlined from '@/assets/svg/icon_into-item_outlined.svg' import icon_window_max_outlined from '@/assets/svg/icon_window-max_outlined.svg' import icon_window_mini_outlined from '@/assets/svg/icon_window-mini_outlined.svg' import { useI18n } from 'vue-i18n' +import MdComponent from '@/views/chat/component/MdComponent.vue' const props = withDefaults( defineProps<{ @@ -178,9 +179,12 @@ function onExitFullScreen() { dialogVisible.value = false } +const sqlShow = ref(false) + function showSql() { - console.log('todo') + sqlShow.value = true } + function addToDashboard() { console.log('todo') } @@ -234,7 +238,7 @@ function addToDashboard() {
- + @@ -309,6 +313,21 @@ function addToDashboard() { @exit-full-screen="onExitFullScreen" /> + + +
+ +
+
@@ -322,6 +341,9 @@ function addToDashboard() { .chart-fullscreen-dialog-body { padding: 0; } +.chart-sql-drawer-body { + padding: 24px; +}