Skip to content

Commit 7b07cfe

Browse files
committed
feat: 日历模块内嵌
1 parent ac34450 commit 7b07cfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tab/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from urllib.parse import urlparse, parse_qs
66

77
import gradio as gr
8+
from gradio_calendar import Calendar
89
from loguru import logger
910

1011
from config import main_request, get_application_tmp_path
11-
from gradio_calendar import Calendar
1212

1313
buyer_value = []
1414
addr_value = []
@@ -136,7 +136,7 @@ def on_submit_ticket_id(num):
136136
value=f"{extracted_id_message}\n获取票信息成功:\n展会名称:{project_name}\n"
137137
f"开展时间:{project_start_time} - {project_end_time}\n场馆地址:{venue_name} {venue_address}",
138138
visible=True,
139-
), gr.update(visible=True, value=sales_dates[0] if sales_dates_show else gr.update())
139+
), gr.update(visible=True, value=sales_dates[0]) if sales_dates_show else gr.update(visible=False)
140140
]
141141
except Exception as e:
142142
return [
@@ -316,7 +316,7 @@ def on_submit_date(_date):
316316
f" - 【起售时间:{sale_start}】")
317317
ticket_str_list.append(ticket_str)
318318
ticket_value.append({"project_id": project_id, "ticket": ticket})
319-
return [gr.update(_date), gr.update(choices=ticket_str_list),
319+
return [gr.update(value=_date, visible=True), gr.update(choices=ticket_str_list),
320320
gr.update(value=f"当前票日期更新为: {_date}")]
321321
except Exception as e:
322322
return [gr.update(), gr.update(), gr.update(value=e, visible=True)]

0 commit comments

Comments
 (0)