fix:优化配置存储

This commit is contained in:
2026-01-30 00:19:09 +08:00
parent 6a0c826a06
commit 02cbd256d8
18 changed files with 228 additions and 420 deletions

View File

@@ -1,28 +1,17 @@
import pandas as pd
from nicegui import ui
from config.config import load_config
import os
import pandas as pd
from nicegui import ui
def create_header():
with ui.header().classes("app-header items-center justify-between shadow-md"):
with ui.row().classes("items-center gap-2"):
ui.image("/assets/icon.ico").classes("w-8 h-8").props("fit=contain")
ui.label("尚城幼儿园成长报告助手").classes("text-xl font-bold")
with ui.row().classes("items-center gap-4"):
ui.label("By 寒寒 | 这里的每一份评语都充满爱意").classes(
"text-xs opacity-90"
)
ui.button(icon="home", on_click=lambda: ui.navigate.to("/")).props(
"flat round color=white"
).tooltip("回到首页")
from config.config import load_config
from ui.views.templates.back_home import backHome
def create_data_page():
ui.add_head_html('<link href="/assets/style.css" rel="stylesheet" />')
create_header()
with ui.header().classes("app-header items-center justify-between shadow-md"):
backHome()
with ui.column().classes("w-full max-w-6xl mx-auto p-4 gap-4 thin-scrollbar"):
with ui.card().classes("func-card"):
@@ -37,7 +26,7 @@ def create_data_page():
def load_data():
conf_data = load_config("config.toml")
conf_data = load_config()
excel_path = conf_data.get("excel_file")
with (
@@ -47,7 +36,7 @@ def load_data():
),
):
with ui.row().classes(
"w-full bg-gradient-to-r from-blue-50 to-indigo-50 items-center justify-between"
"w-full bg-gradient-to-r from-blue-50 to-indigo-50 items-center justify-between"
):
with ui.column().classes("gap-0"):
ui.label("幼儿成长档案").classes(
@@ -61,7 +50,7 @@ def load_data():
content_container = ui.column().classes("w-full")
with ui.row().classes(
"w-full p-5 bg-slate-50/80 backdrop-blur-md border-t justify-end gap-3"
"w-full p-5 bg-slate-50/80 backdrop-blur-md border-t justify-end gap-3"
):
ui.button("确认", on_click=detail_dialog.close).props(
"unelevated color=blue-6"
@@ -75,7 +64,7 @@ def load_data():
with content_container:
with ui.row().classes(
"w-full items-center p-4 bg-blue-600 rounded-2xl shadow-md shadow-blue-100"
"w-full items-center p-4 bg-blue-600 rounded-2xl shadow-md shadow-blue-100"
):
ui.avatar("person", color="white", text_color="blue-6").props(
"size=48px"
@@ -105,7 +94,7 @@ def load_data():
df = df.fillna("-")
with ui.row().classes(
"bg-blue-50 w-full p-3 px-6 items-center rounded-t-xl border-b border-blue-100"
"bg-blue-50 w-full p-3 px-6 items-center rounded-t-xl border-b border-blue-100"
):
ui.icon("fact_check", color="primary", size="20px")
ui.label(f"班级:{conf_data.get('class_name', '未设定')}").classes(