Ver código fonte

feat(gameEventProject): 优化项目管理表格和表单功能

- 为表格添加固定列以提升用户体验,包括序号、项目id和项目名称左侧固定,
  操作列右侧固定
- 在表单底部添加"保存并继续"按钮,支持连续创建多个项目
- 修改提交表单逻辑,支持保存后继续编辑新项目
- 优化删除提示信息,将"编号"改为"ID"更准确
- 移除StatsDetailDialog组件中的冗余代码和未使用的导入
zhou 3 semanas atrás
pai
commit
2ce2ca920e

+ 0 - 6
src/views/system/gameEventProject/StatsDetailDialog.vue

@@ -49,18 +49,12 @@
       </div>
     </div>
 
-    <template #footer>
-      <div class="dialog-footer">
-        <el-button @click="dialog.visible = false">关闭</el-button>
-      </div>
-    </template>
   </el-dialog>
 </template>
 
 <script setup name="StatsDetailDialog" lang="ts">
 import { reactive, ref, toRefs, getCurrentInstance } from 'vue';
 import { listGameAthlete, listTeamByProject } from '@/api/system/gameAthlete';
-import { listGameTeam } from '@/api/system/gameTeam';
 import { listGameEventGroup } from '@/api/system/gameEventGroup';
 
 const { proxy } = getCurrentInstance() as any;

+ 14 - 8
src/views/system/gameEventProject/index.vue

@@ -49,9 +49,9 @@
 
       <el-table v-loading="loading" border :data="gameEventProjectList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="序号" align="center" type="index" />
-        <el-table-column label="项目id" align="center" prop="projectId" v-if="columns[0].visible" />
-        <el-table-column label="项目名称" align="center" prop="projectName" v-if="columns[1].visible" />
+        <el-table-column label="序号" align="center" fixed="left" type="index" />
+        <el-table-column label="项目id" align="center" fixed="left" prop="projectId" v-if="columns[0].visible" />
+        <el-table-column label="项目名称" align="center" fixed="left" prop="projectName" v-if="columns[1].visible" />
         <el-table-column label="项目类型" align="center" prop="projectType" v-if="columns[2].visible">
           <template #default="scope">
             <dict-tag :options="game_project_type" :value="scope.row.projectType || ''" />
@@ -130,7 +130,7 @@
             <dict-tag :options="game_stage" :value="scope.row.gameStage || ''" />
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
           <template #default="scope">
             <el-tooltip content="修改" placement="top">
               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:gameEventProject:edit']"></el-button>
@@ -228,7 +228,8 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm()">确 定</el-button>
+          <el-button v-if="!form.projectId" :loading="buttonLoading" type="success" @click="submitForm(true)">保存并继续</el-button>
           <el-button @click="cancel">取 消</el-button>
         </div>
       </template>
@@ -429,7 +430,7 @@ const handleUpdate = (row?: GameEventProjectVO) => {
 };
 
 /** 提交按钮 */
-const submitForm = () => {
+const submitForm = (isContinue = false) => {
   gameEventProjectFormRef.value?.validate(valid => {
     if (valid) {
       buttonLoading.value = true;
@@ -444,7 +445,12 @@ const submitForm = () => {
       } else {
         addGameEventProject(form.value).then(response => {
           proxy?.$modal.msgSuccess('新增成功');
-          dialog.visible = false;
+          if (isContinue) {
+            // 保存并继续:不关闭弹窗,并确保 projectId 为空
+            form.value.projectId = undefined;
+          } else {
+            dialog.visible = false;
+          }
           getList();
         }).finally(() => {
           buttonLoading.value = false;
@@ -457,7 +463,7 @@ const submitForm = () => {
 /** 删除按钮操作 */
 const handleDelete = (row?: GameEventProjectVO) => {
   const projectIds = row?.projectId || ids.value;
-  proxy?.$modal.confirm('是否确认删除赛事项目编号为"' + projectIds + '"的数据项?').then(function () {
+  proxy?.$modal.confirm('是否确认删除赛事项目ID为"' + projectIds + '"的数据项?').then(function () {
     return delGameEventProject(projectIds);
   }).then(() => {
     getList();