Browse Source

feat(tournaments): 设置查询面板默认开始时间为今天

- 在组件挂载时,自动将查询面板的开始时间设置为当前日期
- 优化了用户使用体验,减少了用户手动选择日期的操作
fugui001 4 months ago
parent
commit
7364540e68
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/views/system/business/tournaments/index.vue

+ 7 - 0
src/views/system/business/tournaments/index.vue

@@ -886,6 +886,13 @@ const handleExport = () => {
 };
 
 onMounted(() => {
+  // 设置默认开始时间为今天
+  const today = new Date();
+  const yyyy = today.getFullYear();
+  const mm = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以+1
+  const dd = String(today.getDate()).padStart(2, '0');
+  queryParams.value.startTime = `${yyyy}-${mm}-${dd}`;
+
   console.log('tournaments_type:', tournaments_type.value);
   console.log('tournaments_time:', tournaments_time.value);
   getList();