Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -200,19 +200,19 @@ st.title("LED 屏幕时间表打印")
|
|
200 |
uploaded_file = st.file_uploader("选择打开【放映时间核对表.xls】文件", accept_multiple_files=False, type=["xls"])
|
201 |
|
202 |
if uploaded_file:
|
203 |
-
with st.spinner("
|
204 |
schedule, date_str = process_schedule(uploaded_file)
|
205 |
if schedule is not None:
|
206 |
output = create_print_layout(schedule, date_str)
|
207 |
|
208 |
# 创建选项卡以切换PNG和PDF视图
|
209 |
-
tab1, tab2 = st.tabs(["
|
210 |
|
211 |
with tab1:
|
212 |
-
st.
|
213 |
|
214 |
with tab2:
|
215 |
-
st.
|
216 |
else:
|
217 |
st.error("无法处理文件,请检查文件格式或内容是否正确。")
|
218 |
|
|
|
200 |
uploaded_file = st.file_uploader("选择打开【放映时间核对表.xls】文件", accept_multiple_files=False, type=["xls"])
|
201 |
|
202 |
if uploaded_file:
|
203 |
+
with st.spinner("文件正在处理中,请稍候..."):
|
204 |
schedule, date_str = process_schedule(uploaded_file)
|
205 |
if schedule is not None:
|
206 |
output = create_print_layout(schedule, date_str)
|
207 |
|
208 |
# 创建选项卡以切换PNG和PDF视图
|
209 |
+
tab1, tab2 = st.tabs(["PDF 预览", "PNG 预览"])
|
210 |
|
211 |
with tab1:
|
212 |
+
st.markdown(display_pdf(output['pdf']), unsafe_allow_html=True)
|
213 |
|
214 |
with tab2:
|
215 |
+
st.image(output['png'], use_container_width=True)
|
216 |
else:
|
217 |
st.error("无法处理文件,请检查文件格式或内容是否正确。")
|
218 |
|