From c50815f62ef684a51a8877d6522683667fe9c1ad Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 2 Sep 2025 12:47:22 +0800 Subject: [PATCH] style: Assistant Embedded Appearance Configuration - Restore Default Function Style Error --- backend/apps/system/api/assistant.py | 8 +++++++- frontend/src/views/system/embedded/SetUi.vue | 10 ++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/apps/system/api/assistant.py b/backend/apps/system/api/assistant.py index 6ebcc132..f50cfd9b 100644 --- a/backend/apps/system/api/assistant.py +++ b/backend/apps/system/api/assistant.py @@ -115,7 +115,13 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] = ui_schema_dict[flag_name] = file_id else: raise ValueError(f"Unsupported file flag: {flag_name}") - + + for flag_name in ['logo', 'float_icon']: + file_val = config_obj.get(flag_name) + if file_val and not ui_schema_dict.get(flag_name): + config_obj[flag_name] = None + SQLBotFileUtils.detete_file(file_val) + for attr, value in ui_schema_dict.items(): if attr != 'id' and not attr.startswith("__"): config_obj[attr] = value diff --git a/frontend/src/views/system/embedded/SetUi.vue b/frontend/src/views/system/embedded/SetUi.vue index c4a64f02..8e196540 100644 --- a/frontend/src/views/system/embedded/SetUi.vue +++ b/frontend/src/views/system/embedded/SetUi.vue @@ -14,16 +14,15 @@ const currentId = ref() interface SqlBotForm { theme: string header_font_color: string - // logo?: string + logo?: string x_type: string y_type: string welcome_desc: string - // float_icon?: string + float_icon?: string welcome: string float_icon_drag: boolean x_val: number y_val: number - restoreDefaults: boolean } const optionsY = [ @@ -74,9 +73,8 @@ const defaultSqlBotForm = reactive({ welcome_desc: t('embedded.data_analysis_now'), theme: '#1CBA90', header_font_color: '#1F2329', - restoreDefaults: false, - // logo: '', - // float_icon: '', + logo: '', + float_icon: '', }) const sqlBotForm = reactive(cloneDeep(defaultSqlBotForm)) as { [key: string]: any } let rawData = {} as { [key: string]: any }