diff --git a/backend/common/core/config.py b/backend/common/core/config.py index ff198247..ba9287ee 100644 --- a/backend/common/core/config.py +++ b/backend/common/core/config.py @@ -81,6 +81,6 @@ class Settings(BaseSettings): MCP_IMAGE_PATH: str = '/opt/sqlbot/images' EXCEL_PATH: str = '/opt/sqlbot/data/excel' MCP_IMAGE_HOST: str = 'http://localhost:3000' - SERVER_IMAGE_HOST: str + SERVER_IMAGE_HOST: str = '' settings = Settings() # type: ignore diff --git a/frontend/src/assets/model/icon_hsyq_colorful.png b/frontend/src/assets/model/icon_hsyq_colorful.png new file mode 100644 index 00000000..c07ea910 Binary files /dev/null and b/frontend/src/assets/model/icon_hsyq_colorful.png differ diff --git a/frontend/src/assets/model/icon_txhy_colorful.png b/frontend/src/assets/model/icon_txhy_colorful.png new file mode 100644 index 00000000..19f58858 Binary files /dev/null and b/frontend/src/assets/model/icon_txhy_colorful.png differ diff --git a/frontend/src/entity/supplier.ts b/frontend/src/entity/supplier.ts index 5431be9a..9a60551c 100644 --- a/frontend/src/entity/supplier.ts +++ b/frontend/src/entity/supplier.ts @@ -6,6 +6,8 @@ import icon_xfhx_colorful from '@/assets/model/icon_xfhx_colorful.png' import icon_gemini_colorful from '@/assets/model/icon_gemini_colorful.png' import icon_openai_colorful from '@/assets/model/icon_openai_colorful.png' import icon_kimi_colorful from '@/assets/model/icon_kimi_colorful.png' +import icon_txhy_colorful from '@/assets/model/icon_txhy_colorful.png' +import icon_hsyq_colorful from '@/assets/model/icon_hsyq_colorful.png' type ModelArg = { key: string; val?: string | number; type: string; range?: string } type ModelOption = { name: string; api_domain?: string; args?: ModelArg[] } @@ -78,7 +80,7 @@ export const supplierList: Array<{ { id: 4, name: '腾讯混元', - icon: icon_txy_colorful, + icon: icon_txhy_colorful, model_config: { 0: { api_domain: 'https://api.hunyuan.cloud.tencent.com/v1/', @@ -215,6 +217,42 @@ export const supplierList: Array<{ }, }, }, + { + id: 9, + name: '腾讯云', + icon: icon_txy_colorful, + model_config: { + 0: { + api_domain: 'https://api.lkeap.cloud.tencent.com/v1', + common_args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }], + model_options: [ + { name: 'deepseek-r1' }, + { name: 'deepseek-r1-0528' }, + { name: 'deepseek-v3' }, + { name: 'deepseek-v3-0324' }, + ], + }, + }, + }, + { + id: 10, + name: '火山引擎', + icon: icon_hsyq_colorful, + model_config: { + 0: { + api_domain: 'https://ark.cn-beijing.volces.com/api/v3', + common_args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }], + model_options: [ + { name: 'doubao-seed-1-6-250615' }, + { name: 'doubao-seed-1-6-flash-250715' }, + { name: 'doubao-1-5-pro-32k-character-250715' }, + { name: 'kimi-k2-250711' }, + { name: 'deepseek-v3-250324' }, + { name: 'deepseek-r1' }, + ], + }, + }, + }, ] export const base_model_options = (supplier_id: number, model_type?: number) => { diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue index ab919dd1..3a21fb0f 100644 --- a/frontend/src/views/chat/chat-block/ChartBlock.vue +++ b/frontend/src/views/chat/chat-block/ChartBlock.vue @@ -39,6 +39,7 @@ const props = withDefaults( } ) +const loading = ref(false) const { t } = useI18n() const addViewRef = ref(null) const emits = defineEmits(['exitFullScreen']) @@ -231,20 +232,26 @@ function copy() { const exportRef = ref() function exportToExcel() { - chatApi - .export2Excel({ ...chartRef.value?.getExcelData(), name: chartObject.value.title }) - .then((res) => { - const blob = new Blob([res], { - type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + if (chartRef.value) { + loading.value = true + chatApi + .export2Excel({ ...chartRef.value?.getExcelData(), name: chartObject.value.title }) + .then((res) => { + const blob = new Blob([res], { + type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + }) + const link = document.createElement('a') + link.href = URL.createObjectURL(blob) + link.download = `${chartObject.value.title ?? 'Excel'}.xlsx` + document.body.appendChild(link) + link.click() + document.body.removeChild(link) }) - const link = document.createElement('a') - link.href = URL.createObjectURL(blob) - link.download = `${chartObject.value.title ?? 'Excel'}.xlsx` - document.body.appendChild(link) - link.click() - document.body.removeChild(link) - }) - exportRef.value?.hide() + .finally(() => { + loading.value = false + }) + exportRef.value?.hide() + } } function exportToImage() { @@ -284,6 +291,7 @@ watch( ((!isPredict && (message?.record?.sql || message?.record?.chart)) || (isPredict && message?.record?.chart && data.length > 0)) " + v-loading.fullscreen.lock="loading" class="chart-component-container" :class="{ 'full-screen': enlarge }" >