fix:修复一些BUG

This commit is contained in:
2025-12-22 11:34:16 +08:00
parent 3c60b3e7ca
commit d3c0121632
8 changed files with 95 additions and 44 deletions

View File

@@ -59,6 +59,10 @@ def create_config_page():
label='年龄段', value=conf_data.get('age_group', '中班上学期')
).props('outlined').classes('w-full')
teachers_text = ui.textarea('教师名单', value='\n'.join(conf_data.get('teachers', []))).props('outlined').classes('w-full h-40')
class_type = ui.select(
options={0: '便宜班', 1: '昂贵班'},
label='班级类型', value=conf_data.get('class_type', 0)
).props('outlined').classes('w-full')
# --- AI 配置 ---
with ui.tab_panel(tab_ai).classes('w-full p-0'):
@@ -78,6 +82,7 @@ def create_config_page():
"class_name": class_name.value,
"age_group": age_group.value,
"teachers": [t.strip() for t in teachers_text.value.split('\n') if t.strip()],
"class_type": class_type.value,
"ai": {
"api_key": ai_key.value,
"api_url": ai_url.value,
@@ -87,6 +92,6 @@ def create_config_page():
}
# 修改点 4直接调用导入的 save_config 函数名
success, message = save_config(new_data)
ui.notify(message, type='positive' if success else 'negative')
ui.notify("配置已保存重启生效", type='positive')
ui.button('保存配置', on_click=handle_save).classes('w-full py-4').props('outline color=primary')