更新了gui界面
This commit is contained in:
49
gui.py
49
gui.py
@@ -844,13 +844,12 @@ def index():
|
||||
ui.label("中能建西北院海上能源业务开发部").classes("text-xl font-bold")
|
||||
|
||||
with ui.row().classes("w-full p-4 gap-4"):
|
||||
with ui.card().classes("w-1/4 p-4 shadow-md"):
|
||||
with ui.card().classes("w-3/4 p-4 shadow-md"):
|
||||
ui.label("配置面板").classes("text-xl font-semibold mb-4 border-b pb-2")
|
||||
|
||||
with ui.row(align_items='center').classes('w-full'):
|
||||
async def export_template():
|
||||
from generate_template import create_template
|
||||
import shutil
|
||||
|
||||
async def save_template(path):
|
||||
# 生成模板到当前目录
|
||||
create_template()
|
||||
@@ -867,22 +866,22 @@ def index():
|
||||
)
|
||||
|
||||
ui.button("导出 Excel 模板", on_click=export_template).classes(
|
||||
"w-full mb-4"
|
||||
" w-1/4"
|
||||
).props("icon=file_download outline color=primary")
|
||||
|
||||
async def test_save_dialog():
|
||||
async def dummy_callback(path):
|
||||
# 仅作为测试,实际不写入文件,只弹出通知
|
||||
ui.notify(f"测试成功!选定路径: {path}", type="info")
|
||||
# async def test_save_dialog():
|
||||
# async def dummy_callback(path):
|
||||
# # 仅作为测试,实际不写入文件,只弹出通知
|
||||
# ui.notify(f"测试成功!选定路径: {path}", type="info")
|
||||
|
||||
await save_file_with_dialog(
|
||||
"test_save_dialog.txt", dummy_callback, "Text Files (*.txt)"
|
||||
)
|
||||
|
||||
ui.button("测试对话框", on_click=test_save_dialog).classes(
|
||||
"w-full mb-4"
|
||||
).props("icon=bug_report outline color=orange")
|
||||
# await save_file_with_dialog(
|
||||
# "test_save_dialog.txt", dummy_callback, "Text Files (*.txt)"
|
||||
# )
|
||||
|
||||
# ui.button("测试对话框", on_click=test_save_dialog).classes(
|
||||
# "w-full mb-4"
|
||||
# ).props("icon=bug_report outline color=orange")
|
||||
with ui.column().classes('w-1/4'):
|
||||
ui.label("1. 上传坐标文件 (.xlsx)").classes("font-medium")
|
||||
|
||||
# 使用 .no-list CSS 隐藏 Quasar 默认列表,完全自定义文件显示
|
||||
@@ -900,7 +899,7 @@ def index():
|
||||
"运行方案对比",
|
||||
on_click=run_analysis,
|
||||
)
|
||||
.classes("w-full mt-4 py-4")
|
||||
.classes("w-1/4 py-4")
|
||||
.props("icon=play_arrow color=secondary")
|
||||
)
|
||||
|
||||
@@ -1021,12 +1020,12 @@ if getattr(sys, "frozen", False):
|
||||
)
|
||||
else:
|
||||
# 普通使用环境保留日志功能
|
||||
# ui.run(title="海上风电场集电线路优化", host='127.0.0.1', reload=True, port=target_port, native=False)
|
||||
ui.run(
|
||||
title="海上风电场集电线路优化",
|
||||
host="127.0.0.1",
|
||||
port=target_port,
|
||||
reload=False,
|
||||
window_size=(1280, 800),
|
||||
native=True,
|
||||
)
|
||||
ui.run(title="海上风电场集电线路优化", host='127.0.0.1', reload=True, port=target_port, native=False)
|
||||
# ui.run(
|
||||
# title="海上风电场集电线路优化",
|
||||
# host="127.0.0.1",
|
||||
# port=target_port,
|
||||
# reload=True,
|
||||
# window_size=(1280, 800),
|
||||
# native=True,
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user