Skip to content

Commit

Permalink
feat: 日历模块内嵌
Browse files Browse the repository at this point in the history
  • Loading branch information
mikumifa committed Aug 28, 2024
1 parent ac34450 commit 7b07cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tab/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from urllib.parse import urlparse, parse_qs

import gradio as gr
from gradio_calendar import Calendar
from loguru import logger

from config import main_request, get_application_tmp_path
from gradio_calendar import Calendar

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

0 comments on commit 7b07cfe

Please sign in to comment.