Browse Source

优化用户界面体验

wenkai 2 weeks ago
parent
commit
c8277d0b2c

+ 6 - 6
src/api/system/gameEventProject/types.ts

@@ -102,7 +102,6 @@ export interface GameEventProjectVO {
    * 备注
    */
   remark: string;
-
 }
 
 export interface GameEventProjectForm extends BaseEntity {
@@ -210,15 +209,19 @@ export interface GameEventProjectForm extends BaseEntity {
    * 备注
    */
   remark?: string;
-
 }
 
 export interface GameEventProjectQuery extends PageQuery {
-
   /**
    * 赛事ID
    */
   eventId?: string | number;
+
+  /**
+   * 赛事名称
+   */
+  eventName?: string;
+
   /**
    * 项目ID
    */
@@ -259,6 +262,3 @@ export interface GameEventProjectQuery extends PageQuery {
    */
   params?: any;
 }
-
-
-

+ 12 - 8
src/api/system/gameTeam/types.ts

@@ -1,13 +1,18 @@
 export interface GameTeamVO {
   /**
- * 队伍ID
- */
+   * 队伍ID
+   */
   teamId: string | number;
   /**
    * 赛事ID
    */
   eventId: string | number;
 
+  /**
+   * 赛事名称
+   */
+  eventName: string;
+
   /**
    * 队伍名称
    */
@@ -57,7 +62,6 @@ export interface GameTeamVO {
    * 备注
    */
   remark: string;
-
 }
 
 export interface GameTeamForm extends BaseEntity {
@@ -119,16 +123,19 @@ export interface GameTeamForm extends BaseEntity {
    * 备注
    */
   remark?: string;
-
 }
 
 export interface GameTeamQuery extends PageQuery {
-
   /**
    * 赛事ID
    */
   eventId?: string | number;
 
+  /**
+   * 赛事名称
+   */
+  eventName?: string;
+
   /**
    * 队伍名称
    */
@@ -179,6 +186,3 @@ export interface GameTeamQuery extends PageQuery {
    */
   params?: any;
 }
-
-
-

+ 20 - 16
src/components/ImageOrUrlInput/index.vue

@@ -19,6 +19,7 @@
             :file-list="fileList"
             :on-preview="handlePictureCardPreview"
             :class="{ hide: fileList.length >= 1 }"
+            style="width: 300px"
           >
             <el-icon class="avatar-uploader-icon">
               <plus />
@@ -36,22 +37,16 @@
           </div>
         </div>
       </el-tab-pane>
-      
+
       <el-tab-pane label="输入链接" name="url">
-         <div class="url-container">
-           <el-input
-             v-model="urlValue"
-             placeholder="请输入链接地址"
-             clearable
-             @input="handleUrlInput"
-             @blur="handleUrlBlur"
-           >
-             <template #prepend>URL</template>
-           </el-input>
-           <div class="url-error" v-if="urlValue && !isValidUrl">
-             <el-alert title="请输入有效的链接地址" type="warning" :closable="false" />
-           </div>
-         </div>
+        <div class="url-container">
+          <el-input v-model="urlValue" placeholder="请输入链接地址" clearable @input="handleUrlInput" @blur="handleUrlBlur">
+            <template #prepend>URL</template>
+          </el-input>
+          <div class="url-error" v-if="urlValue && !isValidUrl">
+            <el-alert title="请输入有效的链接地址" type="warning" :closable="false" />
+          </div>
+        </div>
       </el-tab-pane>
     </el-tabs>
 
@@ -67,6 +62,7 @@ import { OssVO } from '@/api/system/oss/types';
 import { propTypes } from '@/utils/propTypes';
 import { globalHeaders } from '@/utils/request';
 import { compressAccurately } from 'image-conversion';
+import { Plus } from '@element-plus/icons-vue';
 
 const props = defineProps({
   modelValue: {
@@ -324,4 +320,12 @@ const listToString = (list: any[], separator?: string) => {
 :deep(.hide .el-upload--picture-card) {
   display: none;
 }
-</style> 
+
+.el-upload-list--picture-card {
+  --el-upload-list-picture-card-size: 148px;
+  display: inline-flex;
+  flex-wrap: wrap;
+  margin: auto 0;
+  width: 150px;
+}
+</style>

+ 1 - 1
src/views/system/gameAthlete/index.vue

@@ -3,7 +3,7 @@
     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
-          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
             <el-form-item label="赛事ID" prop="eventId">
               <el-input v-model="queryParams.eventId" placeholder="请输入赛事ID" clearable @keyup.enter="handleQuery" />
             </el-form-item>

+ 11 - 11
src/views/system/gameEvent/detail.vue

@@ -15,7 +15,7 @@
             <h3>赛事信息</h3>
           </div>
         </template>
-        
+
         <el-row :gutter="20">
           <el-col :span="12">
             <el-descriptions :column="1" border>
@@ -29,8 +29,8 @@
           </el-col>
           <el-col :span="12">
             <el-descriptions :column="1" border>
-              <el-descriptions-item label="开始时间">{{ parseTime(eventData.startTime, '{y}-{m}-{d}') }}</el-descriptions-item>
-              <el-descriptions-item label="结束时间">{{ parseTime(eventData.endTime, '{y}-{m}-{d}') }}</el-descriptions-item>
+              <el-descriptions-item label="开始时间">{{ parseTime(eventData.startTime, '{y}-{m}-{d}') }} </el-descriptions-item>
+              <el-descriptions-item label="结束时间">{{ parseTime(eventData.endTime, '{y}-{m}-{d}') }} </el-descriptions-item>
               <el-descriptions-item label="举办单位">{{ eventData.unit }}</el-descriptions-item>
               <el-descriptions-item label="状态">
                 <dict-tag :options="game_event_status" :value="eventData.status" />
@@ -38,7 +38,7 @@
             </el-descriptions>
           </el-col>
         </el-row>
-        
+
         <el-row :gutter="20" class="mt-4">
           <el-col :span="24">
             <el-descriptions :column="1" border>
@@ -55,7 +55,7 @@
             <h3>赛事项目</h3>
           </div>
         </template>
-        
+
         <el-table :data="projectData" border>
           <el-table-column label="项目名称" prop="projectName" align="center" />
           <el-table-column label="项目类型" prop="projectType" align="center">
@@ -149,7 +149,7 @@ const loadEventData = async (eventId: string) => {
 // 加载赛事项目
 const loadProjectData = async (eventId: string) => {
   try {
-    const res = await listGameEventProject({ 
+    const res = await listGameEventProject({
       eventId: eventId,
       pageNum: 1,
       pageSize: 1000
@@ -174,27 +174,27 @@ onMounted(async () => {
   .page-header {
     display: flex;
     align-items: center;
-    
+
     .page-title {
       margin-left: 10px;
       font-size: 16px;
       font-weight: bold;
     }
   }
-  
+
   .event-header h3,
   .project-header h3 {
     margin: 0;
     font-size: 16px;
     font-weight: bold;
   }
-  
+
   .mb-4 {
     margin-bottom: 1rem;
   }
-  
+
   .mt-4 {
     margin-top: 1rem;
   }
 }
-</style>
+</style>

+ 81 - 127
src/views/system/gameEvent/edit.vue

@@ -29,24 +29,14 @@
               <el-col :span="12">
                 <el-form-item label="赛事类型" prop="eventType">
                   <el-select v-model="basicForm.eventType" placeholder="请选择赛事类型" style="width: 100%">
-                    <el-option
-                      v-for="dict in game_event_type"
-                      :key="dict.value"
-                      :label="dict.label"
-                      :value="dict.value"
-                    />
+                    <el-option v-for="dict in game_event_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="用途" prop="purpose">
                   <el-select v-model="basicForm.purpose" placeholder="请选择用途" style="width: 100%">
-                    <el-option
-                      v-for="dict in game_event_purpose"
-                      :key="dict.value"
-                      :label="dict.label"
-                      :value="dict.value"
-                    />
+                    <el-option v-for="dict in game_event_purpose" :key="dict.value" :label="dict.label" :value="dict.value" />
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -94,22 +84,14 @@
               <el-col :span="12">
                 <el-form-item label="是否默认赛事" prop="isDefault">
                   <el-radio-group v-model="basicForm.isDefault">
-                    <el-radio
-                      v-for="dict in sys_yes_no"
-                      :key="dict.value"
-                      :value="dict.value"
-                    >{{ dict.label }}</el-radio>
+                    <el-radio v-for="dict in sys_yes_no" :key="dict.value" :value="dict.value">{{ dict.label }} </el-radio>
                   </el-radio-group>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="状态" prop="status">
                   <el-radio-group v-model="basicForm.status">
-                    <el-radio
-                      v-for="dict in game_event_status"
-                      :key="dict.value"
-                      :value="dict.value"
-                    >{{ dict.label }}</el-radio>
+                    <el-radio v-for="dict in game_event_status" :key="dict.value" :value="dict.value">{{ dict.label }} </el-radio>
                   </el-radio-group>
                 </el-form-item>
               </el-col>
@@ -139,7 +121,6 @@
             <el-form-item label="备注" prop="remark">
               <el-input v-model="basicForm.remark" type="textarea" placeholder="请输入备注" :rows="3" />
             </el-form-item>
-          
           </el-form>
         </el-tab-pane>
 
@@ -150,14 +131,14 @@
               <h3>赛事菜单</h3>
               <el-button type="primary" @click="addMenuItem" icon="Plus">添加菜单项</el-button>
             </div>
-            
+
             <el-table :data="menuItems" border style="width: 100%">
-              <el-table-column label="菜单名称" prop="menuName" width="200">
+              <el-table-column label="菜单名称" prop="menuName">
                 <template #default="scope">
                   <el-input v-model="scope.row.menuName" placeholder="请输入菜单名称" />
                 </template>
               </el-table-column>
-              <el-table-column label="活动类型" prop="activityStatus" width="200">
+              <el-table-column label="活动类型" prop="activityStatus">
                 <template #default="scope">
                   <el-radio-group v-model="scope.row.activityStatus">
                     <el-radio :value="0">赛前</el-radio>
@@ -166,17 +147,17 @@
                   </el-radio-group>
                 </template>
               </el-table-column>
-              <el-table-column label="图标" prop="icon" width="200">
+              <el-table-column label="图标" prop="icon">
                 <template #default="scope">
                   <el-input v-model="scope.row.icon" placeholder="请输入图标" />
                 </template>
               </el-table-column>
-              <el-table-column label="颜色" prop="color" width="200">
+              <el-table-column label="颜色" prop="color">
                 <template #default="scope">
                   <el-input v-model="scope.row.color" placeholder="请输入颜色" />
                 </template>
               </el-table-column>
-              <el-table-column label="是否站外" prop="isFrame" width="200">
+              <el-table-column label="是否站外" prop="isFrame">
                 <template #default="scope">
                   <el-radio-group v-model="scope.row.isFrame">
                     <el-radio :value="1">站内</el-radio>
@@ -184,19 +165,19 @@
                   </el-radio-group>
                 </template>
               </el-table-column>
-              <el-table-column label="链接" prop="siteLink" width="200">
+              <el-table-column label="链接" prop="siteLink">
                 <template #default="scope">
                   <el-input v-model="scope.row.siteLink" placeholder="请输入链接" />
                 </template>
               </el-table-column>
-              <el-table-column label="排序" prop="orderNum" width="180">
+              <el-table-column label="排序" prop="orderNum">
                 <template #default="scope">
                   <el-input-number v-model="scope.row.orderNum" :min="1" :max="999" />
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="120">
+              <el-table-column label="操作">
                 <template #default="scope">
-                  <el-button type="danger" size="small" @click="removeMenuItem(scope.$index)" icon="Delete">删除</el-button>
+                  <el-button type="danger" size="small" @click="removeMenuItem(scope.$index)" icon="Delete">删除 </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -212,36 +193,26 @@
             </div>
 
             <el-table :data="projectItems" border style="width: 100%">
-              <el-table-column label="項目类型" prop="projectType" width="180">
+              <el-table-column label="項目类型" prop="projectType">
                 <template #default="scope">
                   <el-select v-model="scope.row.projectType" placeholder="请选择項目类型" style="width: 100%">
-                    <el-option
-                      v-for="dict in game_project_type"
-                      :key="dict.value"
-                      :label="dict.label"
-                      :value="dict.value"
-                    />
+                    <el-option v-for="dict in game_project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column label="项目名称" prop="projectName" width="200">
+              <el-table-column label="项目名称" prop="projectName">
                 <template #default="scope">
                   <el-input v-model="scope.row.projectName" placeholder="请输入项目名称" />
                 </template>
               </el-table-column>
-              <el-table-column label="项目组别" prop="groupType" width="200">
+              <el-table-column label="项目组别" prop="groupType">
                 <template #default="scope">
                   <el-select v-model="scope.row.groupType" placeholder="请选择项目组别" style="width: 100%">
-                    <el-option
-                      v-for="group in groupItems"
-                      :key="group.groupId"
-                      :label="group.groupName"
-                      :value="group.groupName"
-                    />
+                    <el-option v-for="group in groupItems" :key="group.groupId" :label="group.groupName" :value="group.groupName" />
                   </el-select>
                 </template>
               </el-table-column>
-              <el-table-column label="排序" prop="orderType" width="100">
+              <el-table-column label="排序" prop="orderType">
                 <template #default="scope">
                   <el-radio-group v-model="scope.row.orderType">
                     <el-radio value="0">降序</el-radio>
@@ -249,24 +220,24 @@
                   </el-radio-group>
                 </template>
               </el-table-column>
-              <el-table-column label="比赛地点" prop="location" width="100">
+              <el-table-column label="比赛地点" prop="location">
                 <template #default="scope">
                   <el-input v-model="scope.row.location" placeholder="请输入比赛地点" />
                 </template>
               </el-table-column>
-              <el-table-column label="录取名次" prop="roundType" width="100">
+              <el-table-column label="录取名次" prop="roundType">
                 <template #default="scope">
                   <el-input v-model="scope.row.roundType" placeholder="请输入录取名次" />
                 </template>
               </el-table-column>
-              <el-table-column label="分数" prop="scoreValue" width="100">
+              <el-table-column label="分数" prop="scoreValue">
                 <template #default="scope">
                   <el-input v-model="scope.row.scoreValue" placeholder="请输入分数" />
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="120">
+              <el-table-column label="操作">
                 <template #default="scope">
-                  <el-button type="danger" size="small" @click="removeProjectItem(scope.$index)" icon="Delete">移除</el-button>
+                  <el-button type="danger" size="small" @click="removeProjectItem(scope.$index)" icon="Delete">移除 </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -280,31 +251,31 @@
               <h3>赛事配置信息</h3>
               <el-button type="primary" @click="addConfigItem" icon="Plus">添加配置</el-button>
             </div>
-            
+
             <el-table :data="configItems" border style="width: 100%">
-              <el-table-column label="配置键" prop="configKey" width="200">
+              <el-table-column label="配置键" prop="configKey">
                 <template #default="scope">
                   <el-input v-model="scope.row.configKey" placeholder="请输入配置键" />
                 </template>
               </el-table-column>
-              <el-table-column label="配置值" prop="configValue" width="300">
+              <el-table-column label="配置值" prop="configValue">
                 <template #default="scope">
                   <image-or-url-input v-model="scope.row.configValue" />
                 </template>
               </el-table-column>
-              <el-table-column label="配置描述" prop="configDesc" width="200">
+              <el-table-column label="配置描述" prop="configDesc">
                 <template #default="scope">
                   <el-input v-model="scope.row.configDesc" placeholder="请输入配置描述" />
                 </template>
               </el-table-column>
-              <!-- <el-table-column label="是否启用" prop="isEnabled" width="120">
+              <!-- <el-table-column label="是否启用" prop="isEnabled">
                 <template #default="scope">
                   <el-switch v-model="scope.row.isEnabled" />
                 </template>
               </el-table-column> -->
-              <el-table-column label="操作" width="120">
+              <el-table-column label="操作">
                 <template #default="scope">
-                  <el-button type="danger" size="small" @click="removeConfigItem(scope.$index)" icon="Delete">删除</el-button>
+                  <el-button type="danger" size="small" @click="removeConfigItem(scope.$index)" icon="Delete">删除 </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -320,24 +291,24 @@
             </div>
 
             <el-table :data="teamItems" border style="width: 100%">
-              <el-table-column label="单位名称" prop="teamName" width="200">
+              <el-table-column label="单位名称" prop="teamName">
                 <template #default="scope">
                   <el-input v-model="scope.row.teamName" placeholder="请输入单位名称" />
                 </template>
               </el-table-column>
-              <el-table-column label="编号" prop="teamCode" width="100">
+              <el-table-column label="编号" prop="teamCode">
                 <template #default="scope">
                   <el-input v-model="scope.row.teamCode" placeholder="请输入编号" />
                 </template>
               </el-table-column>
-              <el-table-column label="团队描述" prop="teamDescribe" width="200">
+              <el-table-column label="团队描述" prop="teamDescribe">
                 <template #default="scope">
                   <el-input v-model="scope.row.teamDescribe" placeholder="请描述一下你的团队吧~" />
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="120">
+              <el-table-column label="操作">
                 <template #default="scope">
-                  <el-button type="danger" size="small" @click="removeTeamItem(scope.$index)" icon="Delete">删除</el-button>
+                  <el-button type="danger" size="small" @click="removeTeamItem(scope.$index)" icon="Delete">删除 </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -353,12 +324,12 @@
             </div>
 
             <el-table :data="groupItems" border style="width: 100%">
-              <el-table-column label="分组名称" prop="groupName" width="200">
+              <el-table-column label="分组名称" prop="groupName">
                 <template #default="scope">
                   <el-input v-model="scope.row.groupName" placeholder="请输入分组名称" />
                 </template>
               </el-table-column>
-              <el-table-column label="成员性别" prop="memberGender" width="200">
+              <el-table-column label="成员性别" prop="memberGender">
                 <template #default="scope">
                   <el-radio-group v-model="scope.row.memberGender">
                     <el-radio value="0">不分男女</el-radio>
@@ -367,9 +338,9 @@
                   </el-radio-group>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="120">
+              <el-table-column label="操作">
                 <template #default="scope">
-                  <el-button type="danger" size="small" @click="removeGroupItem(scope.$index)" icon="Delete">删除</el-button>
+                  <el-button type="danger" size="small" @click="removeGroupItem(scope.$index)" icon="Delete">删除 </el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -394,18 +365,18 @@ import { GameEventConfigVO, GameEventConfigForm } from '@/api/system/gameEventCo
 import { useRoute, useRouter } from 'vue-router';
 import { listGameEventMenu, addGameEventMenu, updateGameEventMenu, delGameEventMenu } from '@/api/system/gameEventMenu';
 import { GameEventMenuVO, GameEventMenuForm } from '@/api/system/gameEventMenu/types';
-import { listGameTeam, addGameTeam, updateGameTeam,delGameTeam } from '@/api/system/gameTeam';
+import { listGameTeam, addGameTeam, updateGameTeam, delGameTeam } from '@/api/system/gameTeam';
 import { GameTeamVO, GameTeamForm } from '@/api/system/gameTeam/types';
 import { listGameEventGroup, addGameEventGroup, updateGameEventGroup, delGameEventGroup } from '@/api/system/gameEventGroup';
-import { GameEventGroupForm,GameEventGroupVO } from '@/api/system/gameEventGroup/types';
-import { addGameEventProject, listGameEventProject, updateGameEventProject,delGameEventProject } from '@/api/system/gameEventProject';
+import { GameEventGroupForm, GameEventGroupVO } from '@/api/system/gameEventGroup/types';
+import { addGameEventProject, listGameEventProject, updateGameEventProject, delGameEventProject } from '@/api/system/gameEventProject';
 import { GameEventProjectForm, GameEventProjectVO } from '@/api/system/gameEventProject/types';
 
 const route = useRoute();
 const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { game_event_type, game_event_purpose, game_event_status, sys_yes_no,game_project_type } = toRefs<any>(
-  proxy?.useDict('game_event_type', 'game_event_purpose', 'game_event_status', 'sys_yes_no','game_project_type')
+const { game_event_type, game_event_purpose, game_event_status, sys_yes_no, game_project_type } = toRefs<any>(
+  proxy?.useDict('game_event_type', 'game_event_purpose', 'game_event_status', 'sys_yes_no', 'game_project_type')
 );
 
 // 页面状态
@@ -434,27 +405,15 @@ const basicForm = ref<GameEventForm>({
   remark: ''
 });
 
-
 // 表单验证规则
 const basicRules = {
-  eventCode: [
-    { required: true, message: '请输入赛事编号', trigger: 'blur' }
-  ],
-  eventName: [
-    { required: true, message: '请输入赛事名称', trigger: 'blur' }
-  ],
-  eventType: [
-    { required: true, message: '请选择赛事类型', trigger: 'change' }
-  ],
-  startTime: [
-    { required: true, message: '请选择开始时间', trigger: 'change' }
-  ],
-  endTime: [
-    { required: true, message: '请选择结束时间', trigger: 'change' }
-  ]
+  eventCode: [{ required: true, message: '请输入赛事编号', trigger: 'blur' }],
+  eventName: [{ required: true, message: '请输入赛事名称', trigger: 'blur' }],
+  eventType: [{ required: true, message: '请选择赛事类型', trigger: 'change' }],
+  startTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
+  endTime: [{ required: true, message: '请选择结束时间', trigger: 'change' }]
 };
 
-
 // 初始化页面
 onMounted(async () => {
   const eventId = route.params.id as string;
@@ -473,10 +432,10 @@ const loadEventData = async (eventId: string) => {
   try {
     const res = await getGameEvent(eventId);
     const data = res.data;
-    
+
     // 填充基本信息
     Object.assign(basicForm.value, data);
-    
+
     // 加载图片配置数据
     try {
       await loadImageConfigData(eventId);
@@ -484,7 +443,7 @@ const loadEventData = async (eventId: string) => {
       console.warn('加载图片配置数据失败,继续加载其他数据:', error);
       // 不中断其他数据的加载
     }
-    
+
     await loadMenuData(eventId); // 加载菜单数据
     await loadGroupData(eventId); // 加载分组数据
     await loadProjectData(eventId); // 加载项目数据
@@ -492,13 +451,11 @@ const loadEventData = async (eventId: string) => {
     await loadConfigData(eventId); // 加载配置数据
     // TODO: 加载菜单、项目、配置数据
     // 这里需要调用相应的API来加载数据
-    
   } catch (error) {
     proxy?.$modal.msgError('加载赛事数据失败');
   }
 };
 
-
 // 赛事分组数据
 const groupItems = ref<GameEventGroupForm[]>([]);
 // 加载项目分组数据
@@ -520,7 +477,7 @@ const addGroupItem = () => {
     groupId: '',
     eventId: '',
     groupName: '',
-    memberGender: '',
+    memberGender: ''
   });
 };
 // 删除赛事分组项
@@ -583,7 +540,7 @@ const addMenuItem = () => {
     isFrame: 1,
     siteLink: '',
     orderNum: menuItems.value.length + 1,
-    eventId: isEdit.value ? route.params.id as string : '' // 关联赛事ID
+    eventId: isEdit.value ? (route.params.id as string) : '' // 关联赛事ID
   });
 };
 // 删除菜单项
@@ -607,7 +564,7 @@ const saveMenuData = async (eventId: string) => {
       // if (!menuData.eventId) {
       //   menuData.eventId = eventId;
       // }
-      
+
       // console.log('Menu data:', item);
       if (item.menuId) {
         // 更新现有菜单
@@ -634,13 +591,13 @@ const loadImageConfigData = async (eventId: string) => {
       pageNum: 1,
       pageSize: 100
     });
-    
+
     // console.log('Template response:', templateRes);
-    
+
     // 获取所有图片配置模板
     const allImageConfigs = Array.isArray(templateRes.rows) ? templateRes.rows : [];
     // console.log('All image configs:', allImageConfigs);
-    
+
     // 查询当前赛事的图片配置数据
     const eventRes = await listGameEventConfig({
       eventId: eventId,
@@ -648,14 +605,14 @@ const loadImageConfigData = async (eventId: string) => {
       pageNum: 1,
       pageSize: 100
     });
-    
+
     const eventImageConfigs = Array.isArray(eventRes.rows) ? eventRes.rows : [];
     // console.log('Event image configs:', eventImageConfigs);
     //console.log('Event image configs:', eventRes);
-    
+
     // 合并配置:以模板为基础,用当前赛事的数据覆盖
-    imageConfigItems.value = allImageConfigs.map(template => {
-      const existingConfig = eventImageConfigs.find(item => item.configKey === template.configKey);
+    imageConfigItems.value = allImageConfigs.map((template) => {
+      const existingConfig = eventImageConfigs.find((item) => item.configKey === template.configKey);
       return {
         ...template,
         eventId: eventId,
@@ -665,7 +622,7 @@ const loadImageConfigData = async (eventId: string) => {
         configId: existingConfig?.configId
       };
     });
-    
+
     // console.log('Final image config items:', imageConfigItems.value);
   } catch (error) {
     console.error('加载图片配置数据失败:', error);
@@ -697,7 +654,7 @@ const loadImageConfigTemplates = async () => {
     const imageData = Array.isArray(res.rows) ? res.rows : []; // 修改此处,确保正确访问数组数据
     // console.log('Image data (new mode):', imageData);
 
-    imageConfigItems.value = imageData.map(item => ({
+    imageConfigItems.value = imageData.map((item) => ({
       ...item,
       configValue: item.configValue || '', // 确保 configValue 初始化正确
       isEnabled: item.isEnabled || '0', // 确保 isEnabled 初始化正确
@@ -714,7 +671,7 @@ const loadImageConfigTemplates = async () => {
 // 保存图片配置数据
 const saveImageConfigData = async (eventId?: string) => {
   try {
-    const targetEventId = eventId || route.params.id as string;
+    const targetEventId = eventId || (route.params.id as string);
     const updates: GameEventConfigForm[] = [];
     const adds: GameEventConfigForm[] = [];
 
@@ -727,7 +684,7 @@ const saveImageConfigData = async (eventId?: string) => {
           configType: 'IMAGE'
         };
 
-        if (item.configId && item.configValue) { 
+        if (item.configId && item.configValue) {
           updates.push(configData);
         } else if (!item.configId && item.configValue) {
           adds.push(configData);
@@ -780,7 +737,7 @@ const addProjectItem = () => {
     remark: '',
     location: '',
     scoreValue: '',
-    groupType: '',
+    groupType: ''
   });
 };
 // 删除项目项
@@ -815,7 +772,6 @@ const saveProjectData = async (eventId: string) => {
   }
 };
 
-
 // 配置信息数据
 const configItems = ref<GameEventConfigForm[]>([]);
 // 加载赛事配置数据
@@ -836,7 +792,7 @@ const addConfigItem = () => {
   configItems.value.push({
     configKey: '',
     configValue: '',
-    configDesc: '',
+    configDesc: ''
   });
 };
 // 删除配置项
@@ -871,7 +827,6 @@ const saveconfigData = async (eventId: string) => {
   }
 };
 
-
 // 参赛队伍数据
 const teamItems = ref<GameTeamForm[]>([]);
 // 加载队伍数据
@@ -894,7 +849,7 @@ const addTeamItem = () => {
     teamCode: '',
     eventId: '',
     teamDescribe: '',
-    remark: '',
+    remark: ''
   });
 };
 // 删除参赛队伍项
@@ -939,7 +894,7 @@ const saveEvent = async () => {
 
     // 合并表单数据
     const formData: GameEventForm = {
-      ...basicForm.value,
+      ...basicForm.value
     };
 
     let savedEventId: string;
@@ -951,7 +906,7 @@ const saveEvent = async () => {
     } else {
       const addRes = await addGameEvent(formData);
       // 假设返回的数据中包含新创建的赛事ID
-      savedEventId = addRes.data?.eventId || route.params.id as string;
+      savedEventId = addRes.data?.eventId || (route.params.id as string);
     }
 
     // 保存图片配置数据
@@ -966,13 +921,12 @@ const saveEvent = async () => {
     await saveGroupData(savedEventId);
     // 保存赛事项目数据
     await saveProjectData(savedEventId);
-    
+
     proxy?.$modal.msgSuccess('保存成功');
-    
+
     // 保存成功后,设置一个标识,表示需要刷新列表数据
     sessionStorage.setItem('needRefreshGameEventList', 'true');
     goBack();
-
   } catch (error) {
     console.error('保存失败:', error);
     proxy?.$modal.msgError('保存失败');
@@ -993,13 +947,13 @@ const goBack = () => {
     display: flex;
     align-items: center;
     gap: 16px;
-    
+
     .page-title {
       font-size: 18px;
       font-weight: 600;
     }
   }
-  
+
   .menu-config,
   .project-config,
   .config-info,
@@ -1012,7 +966,7 @@ const goBack = () => {
       justify-content: space-between;
       align-items: center;
       margin-bottom: 16px;
-      
+
       h3 {
         margin: 0;
         font-size: 16px;
@@ -1020,7 +974,7 @@ const goBack = () => {
       }
     }
   }
-  
+
   .image-config {
     .config-info {
       margin-top: 8px;
@@ -1029,7 +983,7 @@ const goBack = () => {
       justify-content: space-between;
     }
   }
-  
+
   .team-config {
     .team-header {
       display: flex;
@@ -1077,4 +1031,4 @@ const goBack = () => {
 :deep(.el-form-item) {
   margin-bottom: 20px;
 }
-</style> 
+</style>

+ 1 - 1
src/views/system/gameEvent/index.vue

@@ -3,7 +3,7 @@
     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
-          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
             <el-form-item label="赛事编号" prop="eventCode">
               <el-input v-model="queryParams.eventCode" placeholder="请输入赛事编号" clearable @keyup.enter="handleQuery" />
             </el-form-item>

+ 72 - 80
src/views/system/gameEventProject/index.vue

@@ -7,17 +7,15 @@
             <el-form-item label="赛事ID" prop="eventId">
               <el-input v-model="queryParams.eventId" placeholder="请输入赛事ID" clearable @keyup.enter="handleQuery" />
             </el-form-item>
+            <el-form-item label="赛事名称" prop="eventName">
+              <el-input v-model="queryParams.eventName" placeholder="请输入赛事名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
             <el-form-item label="项目名称" prop="projectName">
               <el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
             </el-form-item>
             <el-form-item label="项目组别" prop="groupType">
               <el-select v-model="queryParams.groupType" placeholder="请选择项目组别" clearable @change="handleQuery">
-                <el-option
-                  v-for="group in gameEventGroupList"
-                  :key="group.groupName"
-                  :label="group.groupName"
-                  :value="group.groupName"
-                />
+                <el-option v-for="group in gameEventGroupList" :key="group.groupName" :label="group.groupName" :value="group.groupName" />
               </el-select>
             </el-form-item>
             <el-form-item>
@@ -33,16 +31,20 @@
       <template #header>
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
-            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:gameEventProject:add']">新增</el-button>
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:gameEventProject:add']"> 新增 </el-button>
           </el-col>
           <el-col :span="1.5">
-            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:gameEventProject:edit']">修改</el-button>
+            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:gameEventProject:edit']"
+              >修改
+            </el-button>
           </el-col>
           <el-col :span="1.5">
-            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:gameEventProject:remove']">删除</el-button>
+            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:gameEventProject:remove']"
+              >删除
+            </el-button>
           </el-col>
           <el-col :span="1.5">
-            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:gameEventProject:export']">导出</el-button>
+            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:gameEventProject:export']">导出 </el-button>
           </el-col>
           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
@@ -52,6 +54,7 @@
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="主键" align="center" prop="projectId" v-if="false" />
         <el-table-column label="赛事ID" align="center" prop="eventId" />
+        <el-table-column label="赛事名称" align="center" prop="eventName" />
         <el-table-column label="项目名称" align="center" prop="projectName" />
         <el-table-column label="项目类型" align="center" prop="projectType">
           <template #default="scope">
@@ -96,7 +99,13 @@
               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:gameEventProject:edit']"></el-button>
             </el-tooltip>
             <el-tooltip content="删除" placement="top">
-              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:gameEventProject:remove']"></el-button>
+              <el-button
+                link
+                type="primary"
+                icon="Delete"
+                @click="handleDelete(scope.row)"
+                v-hasPermi="['system:gameEventProject:remove']"
+              ></el-button>
             </el-tooltip>
           </template>
         </el-table-column>
@@ -115,22 +124,17 @@
         </el-form-item>
         <el-form-item label="项目类型" prop="projectType">
           <el-select v-model="form.projectType" placeholder="请选择项目类型">
-            <el-option
-              v-for="dict in game_project_type"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
+            <el-option v-for="dict in game_project_type" :key="dict.value" :label="dict.label" :value="dict.value" />
           </el-select>
         </el-form-item>
-        
+
         <!-- <el-form-item label="裁判员ID" prop="refereeId">
           <el-input v-model="form.refereeId" placeholder="请输入裁判员ID" />
         </el-form-item> -->
         <el-form-item label="比赛场地" prop="location">
           <el-input v-model="form.location" placeholder="请输入比赛场地" />
         </el-form-item>
-        
+
         <!-- <el-form-item label="参赛组数" prop="groupNum">
           <el-input v-model="form.groupNum" placeholder="请输入参赛组数" />
         </el-form-item>
@@ -139,12 +143,7 @@
         </el-form-item> -->
         <el-form-item label="计算规则" prop="scoreRule">
           <el-select v-model="form.scoreRule" placeholder="请选择计算规则" style="width: 100%">
-            <el-option
-              v-for="dict in game_score_type"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
+            <el-option v-for="dict in game_score_type" :key="dict.value" :label="dict.label" :value="dict.value" />
           </el-select>
         </el-form-item>
         <el-form-item label="排序方式" prop="orderType">
@@ -160,19 +159,11 @@
           <el-input v-model="form.roundType" placeholder="请输入轮次" />
         </el-form-item>
         <el-form-item label="开始时间" prop="startTime">
-          <el-date-picker clearable
-            v-model="form.startTime"
-            type="datetime"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            placeholder="请选择开始时间">
+          <el-date-picker clearable v-model="form.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="结束时间" prop="endTime">
-          <el-date-picker clearable
-            v-model="form.endTime"
-            type="datetime"
-            value-format="YYYY-MM-DD HH:mm:ss"
-            placeholder="请选择结束时间">
+          <el-date-picker clearable v-model="form.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间">
           </el-date-picker>
         </el-form-item>
         <!-- <el-form-item label="奖项" prop="award">
@@ -199,7 +190,13 @@
 </template>
 
 <script setup name="GameEventProject" lang="ts">
-import { listGameEventProject, getGameEventProject, delGameEventProject, addGameEventProject, updateGameEventProject } from '@/api/system/gameEventProject';
+import {
+  listGameEventProject,
+  getGameEventProject,
+  delGameEventProject,
+  addGameEventProject,
+  updateGameEventProject
+} from '@/api/system/gameEventProject';
 import { listGameEventGroup } from '@/api/system/gameEventGroup';
 import { GameEventProjectVO, GameEventProjectQuery, GameEventProjectForm } from '@/api/system/gameEventProject/types';
 
@@ -246,15 +243,16 @@ const initFormData: GameEventProjectForm = {
   boxCode: undefined,
   status: undefined,
   remark: undefined
-}
+};
 const data = reactive<PageData<GameEventProjectForm, GameEventProjectQuery>>({
-  form: {...initFormData},
+  form: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
     eventId: undefined,
-    // projectName: undefined,
-    // projectType: undefined,
+    eventName: undefined,
+    projectName: undefined,
+    projectType: undefined
     // groupType: undefined,
     // startTime: undefined,
     // orderType: undefined,
@@ -263,24 +261,14 @@ const data = reactive<PageData<GameEventProjectForm, GameEventProjectQuery>>({
     // }
   },
   rules: {
-    eventId: [
-      { required: true, message: "赛事ID不能为空", trigger: "blur" }
-    ],
-    projectName: [
-      { required: true, message: "项目名称不能为空", trigger: "blur" }
-    ],
-    projectType: [
-      { required: true, message: "项目类型不能为空", trigger: "change" }
-    ],
-    groupType: [
-      { required: true, message: "项目组别不能为空", trigger: "change" }
-    ],
+    eventId: [{ required: true, message: '赛事ID不能为空', trigger: 'blur' }],
+    projectName: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
+    projectType: [{ required: true, message: '项目类型不能为空', trigger: 'change' }],
+    groupType: [{ required: true, message: '项目组别不能为空', trigger: 'change' }],
     // refereeId: [
     //   { required: true, message: "裁判员ID不能为空", trigger: "blur" }
     // ],
-    location: [
-      { required: true, message: "比赛场地不能为空", trigger: "blur" }
-    ],
+    location: [{ required: true, message: '比赛场地不能为空', trigger: 'blur' }]
     // startTime: [
     //   { required: true, message: "开始时间不能为空", trigger: "blur" }
     // ],
@@ -305,7 +293,7 @@ const getList = async () => {
   gameEventProjectList.value = res.rows;
   total.value = res.total;
   loading.value = false;
-}
+};
 
 // 获取赛事分组列表
 const getGroupList = async () => {
@@ -314,55 +302,55 @@ const getGroupList = async () => {
     pageSize: 1000
   });
   gameEventGroupList.value = res.rows || [];
-}
+};
 
 /** 取消按钮 */
 const cancel = () => {
   reset();
   dialog.visible = false;
-}
+};
 
 /** 表单重置 */
 const reset = () => {
-  form.value = {...initFormData};
+  form.value = { ...initFormData };
   gameEventProjectFormRef.value?.resetFields();
-}
+};
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
   getList();
-}
+};
 
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields();
   handleQuery();
-}
+};
 
 /** 多选框选中数据 */
 const handleSelectionChange = (selection: GameEventProjectVO[]) => {
-  ids.value = selection.map(item => item.projectId);
+  ids.value = selection.map((item) => item.projectId);
   single.value = selection.length != 1;
   multiple.value = !selection.length;
-}
+};
 
 /** 新增按钮操作 */
 const handleAdd = () => {
   reset();
   dialog.visible = true;
-  dialog.title = "添加赛事项目";
-}
+  dialog.title = '添加赛事项目';
+};
 
 /** 修改按钮操作 */
 const handleUpdate = async (row?: GameEventProjectVO) => {
   reset();
-  const _projectId = row?.projectId || ids.value[0]
+  const _projectId = row?.projectId || ids.value[0];
   const res = await getGameEventProject(_projectId);
   Object.assign(form.value, res.data);
   dialog.visible = true;
-  dialog.title = "修改赛事项目";
-}
+  dialog.title = '修改赛事项目';
+};
 
 /** 提交按钮 */
 const submitForm = () => {
@@ -370,32 +358,36 @@ const submitForm = () => {
     if (valid) {
       buttonLoading.value = true;
       if (form.value.projectId) {
-        await updateGameEventProject(form.value).finally(() =>  buttonLoading.value = false);
+        await updateGameEventProject(form.value).finally(() => (buttonLoading.value = false));
       } else {
-        await addGameEventProject(form.value).finally(() =>  buttonLoading.value = false);
+        await addGameEventProject(form.value).finally(() => (buttonLoading.value = false));
       }
-      proxy?.$modal.msgSuccess("操作成功");
+      proxy?.$modal.msgSuccess('操作成功');
       dialog.visible = false;
       await getList();
     }
   });
-}
+};
 
 /** 删除按钮操作 */
 const handleDelete = async (row?: GameEventProjectVO) => {
   const _projectIds = row?.projectId || ids.value;
-  await proxy?.$modal.confirm('是否确认删除赛事项目编号为"' + _projectIds + '"的数据项?').finally(() => loading.value = false);
+  await proxy?.$modal.confirm('是否确认删除赛事项目编号为"' + _projectIds + '"的数据项?').finally(() => (loading.value = false));
   await delGameEventProject(_projectIds);
-  proxy?.$modal.msgSuccess("删除成功");
+  proxy?.$modal.msgSuccess('删除成功');
   await getList();
-}
+};
 
 /** 导出按钮操作 */
 const handleExport = () => {
-  proxy?.download('system/gameEventProject/export', {
-    ...queryParams.value
-  }, `gameEventProject_${new Date().getTime()}.xlsx`)
-}
+  proxy?.download(
+    'system/gameEventProject/export',
+    {
+      ...queryParams.value
+    },
+    `gameEventProject_${new Date().getTime()}.xlsx`
+  );
+};
 
 onMounted(() => {
   getList();

+ 26 - 3
src/views/system/gameTeam/index.vue

@@ -7,6 +7,9 @@
             <el-form-item label="赛事ID" prop="eventId">
               <el-input v-model="queryParams.eventId" placeholder="请输入赛事ID" clearable @keyup.enter="handleQuery" />
             </el-form-item>
+            <el-form-item label="赛事名称" prop="eventName">
+              <el-input v-model="queryParams.eventName" placeholder="请输入赛事名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
             <el-form-item label="队伍名称" prop="teamName">
               <el-input v-model="queryParams.teamName" placeholder="请输入队伍名称" clearable @keyup.enter="handleQuery" />
             </el-form-item>
@@ -52,7 +55,8 @@
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="主键" align="center" prop="teamId" v-if="false" />
         <el-table-column label="队伍编号" align="center" prop="teamCode" />
-        <el-table-column label="赛事ID" align="center" prop="eventId" />
+        <!--        <el-table-column label="赛事ID" align="center" prop="eventId" />-->
+        <el-table-column label="赛事名称" align="center" prop="eventName" />
         <el-table-column label="队伍名称" align="center" prop="teamName" />
         <el-table-column label="领队" align="center" prop="leader" />
         <el-table-column label="队员列表" align="center" prop="athleteValue" />
@@ -79,8 +83,10 @@
     <!-- 添加或修改参赛队伍对话框 -->
     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
       <el-form ref="gameTeamFormRef" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="赛事ID" prop="eventId">
-          <el-input v-model="form.eventId" placeholder="请输入赛事ID" />
+        <el-form-item label="赛事" prop="eventId">
+          <el-select v-model="form.eventId" placeholder="请选择赛事" clearable filterable style="width: 100%">
+            <el-option v-for="option in eventOptions" :key="option.value" :label="option.label" :value="option.value" />
+          </el-select>
         </el-form-item>
         <el-form-item label="队伍名称" prop="teamName">
           <el-input v-model="form.teamName" placeholder="请输入队伍名称" />
@@ -160,6 +166,7 @@
 <script setup name="GameTeam" lang="ts">
 import { listGameTeam, getGameTeam, delGameTeam, addGameTeam, updateGameTeam } from '@/api/system/gameTeam';
 import { GameTeamVO, GameTeamQuery, GameTeamForm } from '@/api/system/gameTeam/types';
+import { getEventIdNameMap } from '@/api/system/gameEvent';
 import { globalHeaders } from '@/utils/request';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -172,6 +179,7 @@ const ids = ref<Array<string | number>>([]);
 const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
+const eventOptions = ref<Array<{ label: string; value: string | number }>>([]);
 
 const queryFormRef = ref<ElFormInstance>();
 const gameTeamFormRef = ref<ElFormInstance>();
@@ -216,6 +224,7 @@ const data = reactive<PageData<GameTeamForm, GameTeamQuery>>({
     pageNum: 1,
     pageSize: 10,
     eventId: undefined,
+    eventName: undefined,
     teamName: undefined,
     teamCode: undefined,
     leader: undefined,
@@ -262,6 +271,19 @@ const getList = async () => {
   loading.value = false;
 };
 
+/** 获取赛事选项列表 */
+const getEventOptions = async () => {
+  try {
+    const res = await getEventIdNameMap();
+    eventOptions.value = Object.entries(res.data).map(([key, value]) => ({
+      label: key as string,
+      value: value
+    }));
+  } catch (error) {
+    console.error('获取赛事列表失败:', error);
+  }
+};
+
 /** 取消按钮 */
 const cancel = () => {
   reset();
@@ -381,5 +403,6 @@ const importTemplate = () => {
 
 onMounted(() => {
   getList();
+  getEventOptions();
 });
 </script>