Преглед изворни кода

feat(game-event-project): 添加项目归类排序功能并优化成绩数量配置

添加了项目归类列的宽度设置和排序功能,同时优化了成绩数量的
配置逻辑,支持多种评分规则类型,并为不同类型的项目添加了
相应的提示信息和验证限制。

feat(game-score): 完善成绩显示单位展示

在成绩表格中增加了单位显示功能,根据不同评分规则自动显示
对应单位(秒/米/自定义单位),提升用户对成绩数据的理解
和识别准确性。
zhou пре 3 недеља
родитељ
комит
85a5dc32bf

+ 12 - 3
src/views/system/gameEventProject/index.vue

@@ -57,7 +57,7 @@
             <dict-tag :options="game_project_type" :value="scope.row.projectType || ''" />
           </template>
         </el-table-column>
-        <el-table-column label="项目归类" align="center" prop="classification" v-if="columns[3].visible" >
+        <el-table-column label="项目归类" align="center" width="105" sortable prop="classification" v-if="columns[3].visible" >
           <template #default="scope">
             <dict-tag :options="game_project_classification" :value="scope.row.classification || '未知'" />
           </template>
@@ -280,9 +280,17 @@
                     </el-radio-group>
                   </el-form-item>
                 </el-col>
-                <el-col :span="12" v-if="form.scoreRule === '4'">
+                <el-col :span="12" v-if="['2', '4', '6', '7'].includes(form.scoreRule)">
                   <el-form-item label="成绩数量" prop="scoreCount">
-                    <el-input-number v-model="form.scoreCount" :min="1" size="small" />
+                    <template #label>
+                      <span>
+                        <el-tooltip :content="form.scoreRule === '4' ? '多次计数的总轮次' : '距离类建议根据模式选择,单轮选1,双轮选2'" placement="top">
+                          <el-icon style="cursor: pointer; color: #409eff; margin-right: 2px;"><QuestionFilled /></el-icon>
+                        </el-tooltip>
+                        成绩数量
+                      </span>
+                    </template>
+                    <el-input-number v-model="form.scoreCount" :min="1" :max="20" size="small" />
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -668,6 +676,7 @@ watch(() => form.value.scoreRule, (newVal) => {
     orderGroup.val1 = '0'; // 计时通常升序
   } else if (['2', '6', '7'].includes(newVal)) { // 距离相关类
     form.value.distanceMode = '0';
+    form.value.scoreCount = 1; // 距离类默认1轮
     orderGroup.val1 = '1'; // 距离通常降序
   } else if (newVal === '3') { // 单次计数
     form.value.countUnit = '个';

+ 34 - 4
src/views/system/gameScore/gameScoreEdit.vue

@@ -79,12 +79,32 @@
               <dict-tag :options="sys_user_sex" :value="scope.row.gender" />
             </template>
           </el-table-column>
-          <el-table-column label="个人成绩" align="center" prop="individualPerformance" />
+          <el-table-column label="个人成绩" align="center" prop="individualPerformance">
+            <template #default="scope">
+              <span>{{ scope.row.individualPerformance }}</span>
+              <span v-if="scope.row.individualPerformance !== '--'" style="margin-left: 4px; font-size: 12px; color: #999;">
+                {{ 
+                  projectInfo.scoreRule === '1' ? '秒' : 
+                  (['2', '6', '7'].includes(projectInfo.scoreRule) ? '米' : projectInfo.countUnit) 
+                }}
+              </span>
+            </template>
+          </el-table-column>
         </template>
         
         <!-- 团体项目显示队伍信息 -->
         <template v-else>
-          <el-table-column label="团队成绩" align="center" prop="teamPerformance" />
+          <el-table-column label="团队成绩" align="center" prop="teamPerformance">
+            <template #default="scope">
+              <span>{{ scope.row.teamPerformance }}</span>
+              <span v-if="scope.row.teamPerformance !== '--'" style="margin-left: 4px; font-size: 12px; color: #999;">
+                {{ 
+                  projectInfo.scoreRule === '1' ? '秒' : 
+                  (['2', '6', '7'].includes(projectInfo.scoreRule) ? '米' : projectInfo.countUnit) 
+                }}
+              </span>
+            </template>
+          </el-table-column>
         </template>
         
         <el-table-column label="积分" align="center" sortable prop="scorePoint" />
@@ -115,7 +135,12 @@
             <div v-for="(item, index) in scoreDetails" :key="index" style="margin-bottom: 10px; display: flex; align-items: center;">
               <span style="width: 80px;">第 {{ index + 1 }} 轮:</span>
               <el-input-number v-model="item.performanceValue" :precision="3" :step="0.1" style="flex: 1" />
-              <span style="margin-left: 8px; color: #666; width: 30px;">{{ projectInfo.countUnit || (projectInfo.scoreRule === '1' ? '秒' : '') }}</span>
+              <span style="margin-left: 8px; color: #666; width: 30px;">
+                {{ 
+                  projectInfo.scoreRule === '1' ? '秒' : 
+                  (['2', '6', '7'].includes(projectInfo.scoreRule) ? '米' : projectInfo.countUnit) 
+                }}
+              </span>
             </div>
           </div>
 
@@ -139,6 +164,7 @@
               :placeholder="projectInfo.scoreRule === '1' ? '支持输入秒数或 00:00.00 格式' : '输入成绩'"
             >
               <template #append v-if="projectInfo.scoreRule === '1'">秒</template>
+              <template #append v-else-if="['2', '6', '7'].includes(projectInfo.scoreRule)">米</template>
               <template #append v-else-if="projectInfo.countUnit">{{ projectInfo.countUnit }}</template>
             </el-input>
           </el-form-item>
@@ -169,7 +195,11 @@
             </el-input>
             <div v-else style="display: flex; align-items: center;">
               <el-input-number v-model="form.teamPerformance" :precision="3" style="flex: 1" />
-              <span style="margin-left: 8px; color: #666;">{{ projectInfo.countUnit }}</span>
+              <span style="margin-left: 8px; color: #666;">
+                {{ 
+                  ['2', '6', '7'].includes(projectInfo.scoreRule) ? '米' : projectInfo.countUnit 
+                }}
+              </span>
             </div>
           </el-form-item>
         </template>