32 lines
1.7 KiB
Python
32 lines
1.7 KiB
Python
"""本地工具箱入口:streamlit run app.py。"""
|
|
import streamlit as st
|
|
from ui import home_page, market_page, building_page, tasks_page, results_page
|
|
from ui.layout import apply_compact_layout
|
|
|
|
st.set_page_config(page_title="MarketGrid 工具箱", page_icon="🗺️", layout="wide")
|
|
apply_compact_layout()
|
|
pages = {
|
|
"home": st.Page(home_page.render, title="工具箱首页", icon="🏠", default=True),
|
|
"market": st.Page(market_page.render, title="市场网格出图", icon="🗺️", url_path="market"),
|
|
"buildings": st.Page(building_page.render, title="楼宇数据查询", icon="🏢", url_path="buildings"),
|
|
"tasks": st.Page(tasks_page.render, title="任务中心", icon="⏳", url_path="tasks"),
|
|
"results": st.Page(results_page.render, title="成果浏览", icon="📦", url_path="results"),
|
|
}
|
|
st.session_state["pages"] = pages
|
|
nav = st.navigation(
|
|
{"工具": [pages["home"], pages["market"], pages["buildings"]],
|
|
"工作记录": [pages["tasks"], pages["results"]]},
|
|
position="hidden",
|
|
)
|
|
with st.sidebar:
|
|
st.markdown("## MarketGrid")
|
|
st.caption("空间数据工具箱")
|
|
st.markdown("**工具**")
|
|
st.page_link(pages["home"], label="工具箱首页", icon="🏠", use_container_width=True)
|
|
st.page_link(pages["market"], label="市场网格出图", icon="🗺️", use_container_width=True)
|
|
st.page_link(pages["buildings"], label="楼宇数据查询", icon="🏢", use_container_width=True)
|
|
st.markdown("**工作记录**")
|
|
st.page_link(pages["tasks"], label="任务中心", icon="⏳", use_container_width=True)
|
|
st.page_link(pages["results"], label="成果浏览", icon="📦", use_container_width=True)
|
|
nav.run()
|