feat: 简化工具箱文案并精简成果下载页
This commit is contained in:
+14
-17
@@ -6,31 +6,28 @@ from .task_panel import show_started, task_panel
|
||||
|
||||
def render():
|
||||
st.markdown("## 楼宇数据查询")
|
||||
st.caption("根据坐标 CSV 查询楼宇 WFS,返回后即时写入,保留未命中和失败记录。")
|
||||
source = file_input("坐标清单", "source/NRBuildingsPoint.csv", "csv", "building_csv")
|
||||
st.caption("输入列名必须包含:序号、经度、维度。输出采用 UTF-8 BOM,方便 Excel 打开。")
|
||||
with st.form("building_run"):
|
||||
c1, c2, c3 = st.columns(3)
|
||||
start = c1.number_input("起始数据行(不含表头)", 1, value=1)
|
||||
limit = c2.number_input("查询数量(0 表示剩余全部)", 0, value=1000)
|
||||
concurrency = c3.number_input("并发请求数", 1, 32, 8)
|
||||
encoding = st.selectbox("输入编码", ["gb18030", "utf-8-sig"])
|
||||
with st.expander("请求参数"):
|
||||
timeout = st.number_input("单次请求超时(秒)", 1, 300, 30)
|
||||
retries = st.number_input("失败重试次数", 0, 10, 2)
|
||||
interval = st.number_input("每协程请求间隔(秒)", 0.0, 60.0, 0.2, 0.1)
|
||||
override = st.checkbox("本次使用新的连接配置", value=False)
|
||||
st.caption("默认使用现有脚本中的本地连接配置;下方临时配置不会写入任务历史。")
|
||||
url = st.text_input("完整 WFS URL", type="password")
|
||||
cookies = st.text_input("Cookies", type="password")
|
||||
referer = st.text_input("Referer(可留空)")
|
||||
start = c1.number_input("起始行", 1, value=1)
|
||||
limit = c2.number_input("查询数量(0 表示全部)", 0, value=1000)
|
||||
concurrency = c3.number_input("并发数", 1, 32, 8)
|
||||
encoding = st.selectbox("文件编码", ["gb18030", "utf-8-sig"])
|
||||
with st.expander("连接设置"):
|
||||
timeout = st.number_input("超时(秒)", 1, 300, 30)
|
||||
retries = st.number_input("失败重试", 0, 10, 2)
|
||||
interval = st.number_input("请求间隔(秒)", 0.0, 60.0, 0.2, 0.1)
|
||||
override = st.checkbox("使用临时连接信息", value=False)
|
||||
url = st.text_input("服务地址", type="password")
|
||||
cookies = st.text_input("登录信息", type="password")
|
||||
referer = st.text_input("来源页(可留空)")
|
||||
submitted = st.form_submit_button("开始查询", type="primary")
|
||||
if submitted:
|
||||
try:
|
||||
if not source:
|
||||
raise ValueError("请先导入坐标 CSV。")
|
||||
raise ValueError("请先导入坐标文件。")
|
||||
if override and (not url.startswith(("http://", "https://")) or not cookies.strip()):
|
||||
raise ValueError("请填写完整 WFS URL 和 Cookies。")
|
||||
raise ValueError("请填写完整服务地址和登录信息。")
|
||||
params = {"INPUT_CSV": source, "INPUT_ENCODING": encoding, "START_ROW": start,
|
||||
"LIMIT": limit or None, "CONCURRENCY": concurrency, "TIMEOUT": timeout,
|
||||
"MAX_RETRIES": retries, "REQUEST_INTERVAL": interval}
|
||||
|
||||
Reference in New Issue
Block a user