3 Commity 87d5c1d836 ... fa111a4210

Autor SHA1 Wiadomość Data
  zhou fa111a4210 feat(system): 添加参赛序号/道次字段支持 2 tygodni temu
  zhou cc33f767f0 feat(ImageOrUrlInput): 添加普通文本输入功能 2 tygodni temu
  zhou 06080e0b0a feat(gameEventProject): 更新参赛组别字段映射 2 tygodni temu

+ 16 - 0
src/api/system/gameAthlete/types.ts

@@ -75,6 +75,11 @@ export interface GameAthleteVO {
   projectValue: string;
   projectList: number[];
 
+  /**
+   * 参赛序号/道次(app端录入成绩时需要存储的字段)
+   */
+  trackIndex?: string | number;
+
   /**
    * 状态(0正常 1停用)
    */
@@ -168,6 +173,11 @@ export interface GameAthleteForm extends BaseEntity {
   projectValue?: string;
   projectList: number[];
 
+  /**
+   * 参赛序号/道次(app端录入成绩时需要存储的字段)
+   */
+  trackIndex?: string | number;
+
   /**
    * 选中的项目列表(用于穿梭框)
    */
@@ -244,6 +254,12 @@ export interface GameAthleteQuery extends PageQuery {
    * 居住地址
    */
   location?: string;
+
+  /**
+   * 参赛序号/道次(app端录入成绩时需要存储的字段)
+   */
+  trackIndex?: string | number;
+
   /**
    * 项目id
    */

+ 13 - 3
src/api/system/gameEventProject/types.ts

@@ -123,7 +123,12 @@ export interface GameEventProjectVO {
   /**
    * 参赛组别
    */
-  groups: string;
+  rgName: string;
+
+  /**
+   * 排名分组ID
+   */
+  rgId: string | number;
 
   /**
    * 参赛人数
@@ -289,9 +294,14 @@ export interface GameEventProjectForm extends BaseEntity {
   gender?: string;
 
   /**
-   * 参赛组别(多选用数组,提交前转字符串)
+   * 参赛组别名称
+   */
+  rgName?: string;
+
+  /**
+   * 排名分组ID
    */
-  groups?: string | string[];
+  rgId?: string | number;
 
   /**
    * 计时格式

+ 23 - 1
src/components/ImageOrUrlInput/index.vue

@@ -48,6 +48,12 @@
           </div>
         </div>
       </el-tab-pane>
+
+      <el-tab-pane label="普通文本" name="text">
+        <div class="text-container">
+          <el-input v-model="textValue" type="textarea" :rows="3" placeholder="请输入文本内容" @input="handleTextInput" />
+        </div>
+      </el-tab-pane>
     </el-tabs>
 
     <el-dialog v-model="dialogVisible" title="预览" width="800px" append-to-body>
@@ -98,6 +104,7 @@ const dialogImageUrl = ref('');
 const dialogVisible = ref(false);
 const urlValue = ref('');
 const isValidUrl = ref(false);
+const textValue = ref('');
 
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
 const uploadImgUrl = ref(getUploadUrl('oss'));
@@ -138,7 +145,11 @@ const handleUrlBlur = () => {
   }
 };
 
-// 移除图片加载错误处理函数,因为不再需要预览图片
+// 处理文本输入
+const handleTextInput = (value: string) => {
+  textValue.value = value;
+  emit('update:modelValue', value);
+};
 
 // 处理标签页切换
 const handleTabClick = () => {
@@ -146,6 +157,8 @@ const handleTabClick = () => {
   if (activeTab.value === 'url') {
     urlValue.value = '';
     isValidUrl.value = false;
+  } else if (activeTab.value === 'text') {
+    textValue.value = '';
   }
 };
 
@@ -178,11 +191,16 @@ watch(
         if (/^\d+$/.test(val)) {
           activeTab.value = 'upload';
           loadOssData(val);
+        } else {
+          // 普通文本
+          activeTab.value = 'text';
+          textValue.value = val;
         }
       }
     } else {
       urlValue.value = '';
       isValidUrl.value = false;
+      textValue.value = '';
       fileList.value = [];
     }
   },
@@ -315,6 +333,10 @@ const listToString = (list: any[], separator?: string) => {
       margin-top: 10px;
     }
   }
+
+  .text-container {
+    margin-top: 5px;
+  }
 }
 
 // .el-upload--picture-card 控制加号部分

+ 16 - 5
src/views/system/gameEventProject/index.vue

@@ -74,7 +74,7 @@
             <dict-tag :options="sys_group_sex" :value="scope.row.gender || ''" />
           </template>
         </el-table-column>
-        <el-table-column label="参赛组别" align="center" width="120" prop="groups" v-if="columns[18]?.visible" />
+        <el-table-column label="参赛组别" align="center" width="120" prop="rgName" v-if="columns[18]?.visible" />
         <el-table-column label="比赛阶段" align="center" prop="gameStage" v-if="columns[13].visible">
           <template #default="scope">
             <dict-tag :options="game_stage" :value="scope.row.gameStage || ''" />
@@ -199,10 +199,10 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="参赛组别" prop="groups">
+            <el-form-item label="参赛组别" prop="rgId">
               <div style="display: flex; width: 100%; align-items: center">
-                <el-select v-model="form.groups" filterable placeholder="请选择参赛组别" style="flex: 1">
-                  <el-option v-for="item in rankGroupOptions" :key="item.rgId" :label="item.rgName" :value="item.rgName" />
+                <el-select v-model="form.rgId" filterable placeholder="请选择参赛组别" style="flex: 1" @change="handleRankGroupChange">
+                  <el-option v-for="item in rankGroupOptions" :key="item.rgId" :label="item.rgName" :value="item.rgId" />
                 </el-select>
                 <el-button link type="primary" icon="Plus" style="margin-left: 5px; font-size: 18px" @click="handleAddRankGroup" />
               </div>
@@ -553,7 +553,8 @@ const initFormData: GameEventProjectForm = {
   gameRound: undefined,
   gameStage: undefined,
   gender: undefined,
-  groups: undefined,
+  rgName: undefined,
+  rgId: undefined,
   status: '0',
   remark: undefined,
   timingFormat: '0',
@@ -736,6 +737,16 @@ watch(() => form.value.scoreRule, (newVal) => {
   }
 });
 
+/** 参赛组别切换 */
+const handleRankGroupChange = (val: string | number) => {
+  const group = rankGroupOptions.value.find(item => item.rgId === val);
+  if (group) {
+    form.value.rgName = group.rgName;
+  } else {
+    form.value.rgName = undefined;
+  }
+};
+
 /** 处理排名方式切换逻辑 */
 const handleOrderChange = (type: number) => {
   if (type === 3 && orderGroup.val3 === '4') {