Sfoglia il codice sorgente

feat(gameEventGroup): 添加分组详情导出功能

- 在分组详情页面添加导出按钮
- 新增handleExport方法处理导出逻辑
- 添加queryParams用于传递groupId参数
- 实现Excel文件导出功能,文件名为"分组详情_时间戳.xlsx"
zhou 1 mese fa
parent
commit
fdd08f18d7
1 ha cambiato i file con 17 aggiunte e 0 eliminazioni
  1. 17 0
      src/views/system/gameEventGroup/detail.vue

+ 17 - 0
src/views/system/gameEventGroup/detail.vue

@@ -16,6 +16,7 @@
         </div>
         <div class="text-right">
           <el-button type="primary" @click="regenerateGroups" :loading="generating">重新生成分组</el-button>
+          <el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
           <el-button @click="goBack">返回</el-button>
         </div>
       </div>
@@ -142,6 +143,11 @@ const roundType = ref(0);
 // 总运动员数
 const totalAthletes = ref(0);
 
+// 查询参数
+const queryParams = ref({
+  groupId: route.params.groupId
+});
+
 // 获取道次名称
 const getTrackName = (track: number) => {
   const trackNames = ['一', '二', '三', '四', '五', '六', '七', '八','九','十'];
@@ -301,6 +307,17 @@ const regenerateGroups = async () => {
 const goBack = () => {
   router.go(-1);
 };
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'system/gameEventGroup/exportDetail',
+    {
+      ...queryParams.value
+    },
+    `分组详情_${new Date().getTime()}.xlsx`
+  );
+};
 onUpdated(() => { 
   getGroupInfo();
 });