style: Assistant Embedded Appearance Configuration - Restore Default Function Style Error

This commit is contained in:
fit2cloud-chenyw
2025-09-02 12:48:50 +08:00
parent 67d189974f
commit c50815f62e
2 changed files with 11 additions and 7 deletions
+7 -1
View File
@@ -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
+4 -6
View File
@@ -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<SqlBotForm>({
welcome_desc: t('embedded.data_analysis_now'),
theme: '#1CBA90',
header_font_color: '#1F2329',
restoreDefaults: false,
// logo: '',
// float_icon: '',
logo: '',
float_icon: '',
})
const sqlBotForm = reactive<SqlBotForm>(cloneDeep(defaultSqlBotForm)) as { [key: string]: any }
let rawData = {} as { [key: string]: any }