Browse Source

Merge branch 'dev_zlt' into dev

zhou 1 week ago
parent
commit
f1a91699aa

+ 62 - 2
src/layout/components/Navbar.vue

@@ -4,6 +4,16 @@
     <breadcrumb v-if="!settingsStore.topNav" id="breadcrumb-container" class="breadcrumb-container" />
     <top-nav v-if="settingsStore.topNav" id="topmenu-container" class="topmenu-container" />
 
+    <!-- 当前赛事信息显示 -->
+    <div class="current-event-info">
+      <el-icon class="event-icon"><Trophy /></el-icon>
+      <span class="event-label">当前默认赛事:</span>
+      <span class="event-name">{{ defaultEventInfo?.eventName || '暂无指定默认赛事' }}</span>
+      <el-tag v-if="defaultEventInfo?.eventCode" type="success" size="small" class="event-code">
+        {{ defaultEventInfo.eventCode }}
+      </el-tag>
+    </div>
+
     <div class="right-menu flex align-center">
       <template v-if="appStore.device !== 'mobile'">
         <el-select
@@ -99,6 +109,9 @@ import { TenantVO } from '@/api/types';
 import notice from './notice/index.vue';
 import router from '@/router';
 import { ElMessageBoxOptions } from 'element-plus/es/components/message-box/src/message-box.type';
+import { Trophy } from '@element-plus/icons-vue';
+import { useGameEventStore } from '@/store/modules/gameEvent';
+import { storeToRefs } from 'pinia';
 
 const appStore = useAppStore();
 const userStore = useUserStore();
@@ -118,6 +131,10 @@ const tenantEnabled = ref(true);
 // 搜索菜单
 const searchMenuRef = ref<InstanceType<typeof SearchMenu>>();
 
+// 使用gameEvent store
+const gameEventStore = useGameEventStore();
+const { defaultEventInfo } = storeToRefs(gameEventStore);
+
 const openSearchMenu = () => {
   searchMenuRef.value?.openSearch();
 };
@@ -127,7 +144,7 @@ const dynamicTenantEvent = async (tenantId: string) => {
   if (companyName.value != null && companyName.value !== '') {
     await dynamicTenant(tenantId);
     dynamic.value = true;
-    await proxy?.$router.push('/');
+    await router.push('/');
     await proxy?.$tab.closeAllPage();
     await proxy?.$tab.refreshPage();
   }
@@ -136,7 +153,7 @@ const dynamicTenantEvent = async (tenantId: string) => {
 const dynamicClearEvent = async () => {
   await dynamicClear();
   dynamic.value = false;
-  await proxy?.$router.push('/');
+  await router.push('/');
   await proxy?.$tab.closeAllPage();
   await proxy?.$tab.refreshPage();
 };
@@ -148,6 +165,8 @@ const initTenantList = async () => {
   if (tenantEnabled.value) {
     tenantList.value = data.voList;
   }
+  // 获取默认赛事信息
+  await gameEventStore.fetchDefaultEvent();
 };
 
 defineExpose({
@@ -246,6 +265,47 @@ watch(
     left: 50px;
   }
 
+  .current-event-info {
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    padding: 0 16px;
+    height: 100%;
+    background: rgba(64, 158, 255, 0.1);
+    border-radius: 4px;
+    border: 1px solid rgba(64, 158, 255, 0.2);
+    
+    .event-icon {
+      font-size: 16px;
+      color: #409eff;
+    }
+    
+    .event-label {
+      font-size: 14px;
+      color: #606266;
+      font-weight: 500;
+    }
+    
+    .event-name {
+      font-size: 14px;
+      color: #409eff;
+      font-weight: 600;
+      max-width: 200px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+    }
+    
+    .event-code {
+      font-size: 12px;
+      height: 20px;
+      line-height: 18px;
+    }
+  }
+
   .errLog-container {
     display: inline-block;
     vertical-align: top;

+ 1 - 1
src/router/index.ts

@@ -138,7 +138,7 @@ export const constantRoutes: RouteRecordRaw[] = [
     hidden: true,
     children: [
       {
-        path: 'edit/:projectId/:projectName/:groupType/:eventId',
+        path: 'edit/:projectId/:projectName/:projectType/:eventId',
         component: () => import('@/views/system/gameScore/gameScoreEdit.vue'),
         name: 'GameScoreEdit',
         meta: { title: '修改成绩', icon: 'form' }

+ 34 - 0
src/store/modules/gameEvent.ts

@@ -0,0 +1,34 @@
+import { defineStore } from 'pinia';
+import { getDefaultEvent } from '@/api/system/gameEvent';
+import { GameEventVO } from '@/api/system/gameEvent/types';
+
+export const useGameEventStore = defineStore('gameEvent', {
+  state: () => ({
+    defaultEventInfo: null as GameEventVO | null,
+  }),
+  actions: {
+    /**
+     * 从API获取默认赛事信息并更新store
+     */
+    async fetchDefaultEvent() {
+      try {
+        const res = await getDefaultEvent();
+        if (res.code === 200 && res.data) {
+          this.defaultEventInfo = res.data;
+        } else {
+          this.defaultEventInfo = null;
+        }
+      } catch (error) {
+        console.error('获取默认赛事信息失败:', error);
+        this.defaultEventInfo = null;
+      }
+    },
+    /**
+     * 直接更新store中的默认赛事信息
+     * @param eventInfo 新的默认赛事信息
+     */
+    updateDefaultEvent(eventInfo: GameEventVO | null) {
+      this.defaultEventInfo = eventInfo;
+    },
+  },
+}); 

+ 154 - 37
src/views/system/common/nav/components/GameNavigator.vue

@@ -35,7 +35,7 @@
           />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="Search" @click="handleQuery">Q 搜索</el-button>
+          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
           <el-button icon="Refresh" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
@@ -63,6 +63,12 @@
 
     <!-- 菜单列表 -->
     <el-card class="list-card">
+      <template #header>
+        <div class="list-header">
+          <span>菜单列表</span>
+          <span class="result-count">共找到 {{ total }} 条记录</span>
+        </div>
+      </template>
       <el-table v-loading="loading" :data="navItems" @selection-change="handleSelectionChange" style="width: 100%">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="序号" align="center" width="80" v-if="columns[0].visible">
@@ -180,8 +186,19 @@
           <el-col :span="12">
             <el-form-item label="颜色" required>
               <div class="color-input-group">
-                <el-color-picker v-model="form.color" show-alpha size="large" class="color-picker" @change="handleColorChange" />
-                <el-input v-model="colorInput" placeholder="#RRGGBB" class="color-input" @input="handleColorInput" @blur="validateColorInput" />
+                <el-color-picker 
+                  v-model="form.color" 
+                  size="large"
+                  class="color-picker"
+                  @change="handleColorChange"
+                />
+                <el-input 
+                  v-model="colorInput" 
+                  placeholder="#RRGGBB"
+                  class="color-input"
+                  @input="handleColorInput"
+                  @blur="validateColorInput"
+                />
               </div>
             </el-form-item>
           </el-col>
@@ -381,6 +398,7 @@ interface NavItem extends GameNavigatorVo {
 // 表单数据
 const navItems = ref<NavItem[]>([]);
 const formRef = ref();
+const queryRef = ref()
 const form = reactive<
   GameNavigatorBo & {
     createTime?: string;
@@ -420,6 +438,11 @@ const queryParams = reactive({
   createTime: ''
 });
 
+// 监听查询参数变化,自动搜索(可选)
+// watch(queryParams, () => {
+//   // 如果需要实时搜索,可以在这里调用 loadNavData()
+// }, { deep: true })
+
 // 表单验证规则
 const rules = {
   name: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
@@ -464,7 +487,15 @@ function formatDateTime(date: string | Date | null | undefined): string {
     hour: '2-digit',
     minute: '2-digit',
     second: '2-digit'
-  });
+  })
+}
+
+// 格式化日期为查询格式 (YYYY-MM-DD)
+function formatDateForQuery(date: Date): string {
+  const year = date.getFullYear()
+  const month = String(date.getMonth() + 1).padStart(2, '0')
+  const day = String(date.getDate()).padStart(2, '0')
+  return `${year}-${month}-${day}`
 }
 
 // 获取跳转类型文本
@@ -496,15 +527,31 @@ function getMaxSortNum(): number {
 async function loadNavData() {
   loading.value = true;
   try {
-    const response = await getEnabledNavigator();
-    if (response.code === 200 && response.data) {
-      navItems.value = response.data as unknown as NavItem[];
+    // 构建查询参数
+    const query: any = {
+      pageNum: 1,
+      pageSize: 100, // 设置一个较大的值以获取所有数据
+      ...queryParams
+    }
+    
+    // 处理日期范围
+    if (dateRange.value && dateRange.value.length === 2) {
+      query.beginTime = formatDateForQuery(dateRange.value[0])
+      query.endTime = formatDateForQuery(dateRange.value[1])
+    }
+    
+    const response = await listNavigator(query)
+    if (response.code === 200 && (response as any).rows) {
+      navItems.value = (response as any).rows || []
+      total.value = (response as any).total || 0
     } else {
-      navItems.value = [];
+      navItems.value = []
+      total.value = 0
     }
   } catch (error) {
-    console.error('加载数据失败:', error);
-    navItems.value = [];
+    console.error('加载数据失败:', error)
+    navItems.value = []
+    total.value = 0
   } finally {
     loading.value = false;
     // 数据加载完成后,更新排序值
@@ -516,6 +563,7 @@ async function loadNavData() {
 
 /** 搜索按钮操作 */
 function handleQuery() {
+  // 重置到第一页
   loadNavData();
 }
 
@@ -528,6 +576,10 @@ function resetQuery() {
     status: undefined,
     createTime: ''
   });
+  // 重置查询引用
+  if (queryRef.value) {
+    queryRef.value.resetFields();
+  }
   loadNavData();
 }
 
@@ -590,12 +642,13 @@ function handleView(row: NavItem) {
 
 // 处理编辑
 function handleEdit(item: NavItem) {
-  reset();
+  reset()
+  const normalizedColor = normalizeColor(item.color || '#409EFF')
   const formData = {
     navId: item.navId,
     name: item.name,
     pic: item.pic,
-    color: item.color || '#409EFF',
+    color: normalizedColor,
     jumpType: item.jumpType || 1,
     jumpPath: item.jumpType === 2 ? item.jumpPath || '#' : item.jumpPath,
     activityType: item.activityType || 1,
@@ -605,20 +658,23 @@ function handleEdit(item: NavItem) {
     remark: item.remark || '',
     createTime: item.createTime,
     updateTime: item.updateTime
-  };
-  Object.assign(form, formData);
-  colorInput.value = item.color || '#409EFF';
-  dialogVisible.value = true;
-  dialogTitle.value = '修改菜单';
+  }
+  Object.assign(form, formData)
+  colorInput.value = normalizedColor
+  dialogVisible.value = true
+  dialogTitle.value = '修改菜单'
 }
 
 // 处理添加
 function handleAdd() {
   reset();
   // 设置排序值为当前最大值+1
-  form.sortNum = nextSortNum.value;
-  dialogVisible.value = true;
-  dialogTitle.value = '添加菜单';
+  form.sortNum = nextSortNum.value
+  // 确保颜色值为16进制格式
+  form.color = normalizeColor(form.color)
+  colorInput.value = form.color
+  dialogVisible.value = true
+  dialogTitle.value = '添加菜单'
 }
 
 // 处理删除
@@ -654,7 +710,7 @@ async function handleSubmit() {
       navId: form.navId,
       name: form.name,
       pic: form.pic,
-      color: form.color,
+      color: normalizeColor(form.color), // 确保颜色值统一为16进制格式
       jumpType: form.jumpType,
       jumpPath: form.jumpType === 2 ? form.jumpPath || '#' : form.jumpPath,
       activityType: form.activityType,
@@ -691,11 +747,12 @@ async function handleSubmit() {
 
 // 重置表单
 function reset() {
+  const defaultColor = '#409EFF'
   Object.assign(form, {
     navId: undefined,
     name: '',
     pic: '',
-    color: '#409EFF',
+    color: defaultColor,
     jumpType: 1,
     jumpPath: '',
     activityType: 1,
@@ -705,9 +762,9 @@ function reset() {
     remark: '',
     createTime: '',
     updateTime: ''
-  });
-  colorInput.value = '#409EFF';
-  formRef.value?.clearValidate();
+  })
+  colorInput.value = defaultColor
+  formRef.value?.clearValidate()
 }
 
 // 跳转类型变更处理
@@ -765,12 +822,34 @@ const rgbToHex = (rgb: string): string => {
   }
 
   // 如果无法解析,返回默认值
-  return '#409EFF';
-};
+  return '#409EFF'
+}
+
+// 将任意颜色格式统一转换为16进制
+const normalizeColor = (color: string): string => {
+  if (!color) return '#409EFF'
+  
+  // 如果已经是16进制格式,直接返回
+  if (color.startsWith('#')) {
+    return color
+  }
+  
+  // 如果是RGB格式,转换为16进制
+  const rgbMatch = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/)
+  if (rgbMatch) {
+    const r = parseInt(rgbMatch[1])
+    const g = parseInt(rgbMatch[2])
+    const b = parseInt(rgbMatch[3])
+    return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`
+  }
+  
+  // 尝试解析其他格式或返回默认值
+  return '#409EFF'
+}
 
 // 处理颜色输入框变化
 const handleColorInput = (value: string) => {
-  // 实时同步到颜色选择器
+  // 实时同步到颜色选择器和表单
   if (value.startsWith('#')) {
     form.color = value;
   }
@@ -778,10 +857,11 @@ const handleColorInput = (value: string) => {
 
 // 处理颜色选择器变化
 const handleColorChange = (value: string) => {
-  // 当颜色选择器改变时,将16进制值填充到输入框
+  // 当颜色选择器改变时,将颜色统一转换为16进制格式
   if (value) {
-    const hexValue = rgbToHex(value);
-    colorInput.value = hexValue;
+    const hexValue = normalizeColor(value)
+    form.color = hexValue
+    colorInput.value = hexValue
   }
 };
 
@@ -789,17 +869,24 @@ const handleColorChange = (value: string) => {
 const validateColorInput = () => {
   const hexRegex = /^#[0-9A-Fa-f]{6}$/;
   if (!hexRegex.test(colorInput.value)) {
-    ElMessage.warning('请输入正确的16进制颜色格式,如 #FF0000');
-    colorInput.value = form.color;
+    ElMessage.warning('请输入正确的16进制颜色格式,如 #FF0000')
+    colorInput.value = form.color
+  } else {
+    // 验证通过,确保表单中的颜色值也是16进制格式
+    form.color = colorInput.value
   }
 };
 
 // 初始化数据
 onMounted(() => {
-  loadNavData();
   // 初始化排序值
-  form.sortNum = nextSortNum.value;
-});
+  form.sortNum = nextSortNum.value
+  // 确保初始颜色值为16进制格式
+  form.color = normalizeColor(form.color)
+  colorInput.value = form.color
+  // 加载初始数据
+  loadNavData()
+})
 </script>
 
 <style scoped>
@@ -811,6 +898,21 @@ onMounted(() => {
   margin-bottom: 20px;
 }
 
+.search-card .el-form {
+  padding: 20px 0;
+}
+
+.list-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.result-count {
+  color: #909399;
+  font-size: 14px;
+}
+
 .action-card {
   margin-bottom: 20px;
 }
@@ -982,4 +1084,19 @@ onMounted(() => {
   color: #909399;
   margin-top: 8px;
 }
-</style>
+
+.color-input-group {
+  display: flex;
+  align-items: center;
+  gap: 12px;
+}
+
+.color-picker {
+  flex-shrink: 0;
+}
+
+.color-input {
+  flex: 1;
+  min-width: 120px;
+}
+</style> 

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

@@ -216,7 +216,7 @@ const total = ref(0);
 // 列显隐数据
 const columns = ref<FieldOption[]>([
   { key: 0, label: '主键', visible: false },
-  { key: 1, label: '赛事名称', visible: true },
+  { key: 1, label: '赛事名称', visible: false },
   { key: 2, label: '运动员编号', visible: true },
   { key: 3, label: '姓名', visible: true },
   { key: 4, label: '性别', visible: true },

+ 6 - 5
src/views/system/gameEvent/edit.vue

@@ -235,6 +235,11 @@
                   </el-select>
                 </template>
               </el-table-column>
+              <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="configKey" width="200">
                 <template #default="scope">
                   <el-input v-model="scope.row.configKey" placeholder="请输入配置键" />
@@ -245,11 +250,7 @@
                   <image-or-url-input v-model="scope.row.configValue" />
                 </template>
               </el-table-column>
-              <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">
                 <template #default="scope">
                   <el-switch v-model="scope.row.isEnabled" />

+ 146 - 85
src/views/system/gameEvent/index.vue

@@ -61,6 +61,90 @@
       </template>
 
       <el-table v-loading="loading" border :data="gameEventList" @selection-change="handleSelectionChange">
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280">
+          <template #default="scope">
+            <div class="operation-buttons">
+              <el-tooltip content="修改" placement="top">
+                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:gameEvent:edit']">
+                  <span class="button-text">修改</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 删除操作 -->
+              <el-tooltip :content="getDeleteTooltip(scope.row)" placement="top">
+                <el-button
+                  link
+                  type="danger"
+                  icon="Delete"
+                  :disabled="!canDelete(scope.row)"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['system:event:remove']"
+                >
+                  <span class="button-text">删除</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 下载模板 -->
+              <el-tooltip content="下载报名信息模板" placement="top">
+                <el-button link type="warning" icon="Download" @click="handleDownloadTemplate(scope.row)">
+                  <span class="button-text">下载</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 导入报名信息 -->
+              <el-tooltip content="导入报名信息" placement="top">
+                <el-button
+                  link
+                  type="info"
+                  icon="FolderOpened"
+                  @click="handleImportRegistration(scope.row)"
+                  v-hasPermi="['system:gameEvent:import']"
+                >
+                  <span class="button-text">导入</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 添加参赛者 -->
+              <el-tooltip content="添加参赛者" placement="top">
+                <el-button
+                  link
+                  type="success"
+                  icon="User"
+                  @click="handleAddParticipant(scope.row)"
+                  v-hasPermi="['system:gameEvent:addParticipant']"
+                >
+                  <span class="button-text">参赛者</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 添加裁判 -->
+              <el-tooltip content="添加裁判" placement="top">
+                <el-button
+                  link
+                  type="primary"
+                  icon="Avatar"
+                  @click="handleAddReferee(scope.row)"
+                  v-hasPermi="['system:gameEvent:addReferee']"
+                >
+                  <span class="button-text">裁判</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 预览按钮 -->
+              <el-tooltip content="预览" placement="top">
+                <el-button link type="info" icon="View" @click="handlePreview(scope.row)" v-hasPermi="['system:gameEvent:view']">
+                  <span class="button-text">预览</span>
+                </el-button>
+              </el-tooltip>
+              <!-- 比赛数据按钮 -->
+              <el-tooltip content="比赛排行榜" placement="top">
+                <el-button
+                  link
+                  type="warning"
+                  icon="DataAnalysis"
+                  @click="handleGameData(scope.row)"
+                  v-hasPermi="['system:gameEvent:gameData']"
+                >
+                  <span class="button-text">排行榜</span>
+                </el-button>
+              </el-tooltip>
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="主键" align="center" prop="eventId" v-if="columns[0].visible" />
         <el-table-column label="赛事编号" align="center" prop="eventCode" v-if="columns[1].visible" />
@@ -118,80 +202,6 @@
           </template>
         </el-table-column>
         <el-table-column label="备注" align="center" prop="remark" v-if="columns[15].visible" />
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
-          <template #default="scope">
-            <el-tooltip content="修改" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:gameEvent:edit']"></el-button>
-            </el-tooltip>
-            <!-- 删除操作 -->
-            <el-tooltip :content="getDeleteTooltip(scope.row)" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="Delete"
-                :disabled="!canDelete(scope.row)"
-                @click="handleDelete(scope.row)"
-                v-hasPermi="['system:event:remove']"
-              >
-              </el-button>
-            </el-tooltip>
-            <!-- 下载模板 -->
-            <el-tooltip content="下载报名信息模板" placement="top">
-              <el-button link type="primary" icon="Download" @click="handleDownloadTemplate(scope.row)"></el-button>
-            </el-tooltip>
-            <el-tooltip content="导入报名信息" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="FolderOpened"
-                @click="handleImportRegistration(scope.row)"
-                v-hasPermi="['system:gameEvent:import']"
-              ></el-button>
-            </el-tooltip>
-            <el-tooltip content="添加参赛者" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="User"
-                @click="handleAddParticipant(scope.row)"
-                v-hasPermi="['system:gameEvent:addParticipant']"
-              ></el-button>
-            </el-tooltip>
-            <el-tooltip content="添加裁判" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="Avatar"
-                @click="handleAddReferee(scope.row)"
-                v-hasPermi="['system:gameEvent:addReferee']"
-              ></el-button>
-            </el-tooltip>
-            <!-- 新增预览按钮 -->
-            <el-tooltip content="预览" placement="top">
-              <el-button link type="primary" icon="View" @click="handlePreview(scope.row)" v-hasPermi="['system:gameEvent:view']"></el-button>
-            </el-tooltip>
-            <!-- 新增比赛数据按钮 -->
-            <el-tooltip content="比赛数据" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="DataAnalysis"
-                @click="handleGameData(scope.row)"
-                v-hasPermi="['system:gameEvent:gameData']"
-              ></el-button>
-            </el-tooltip>
-            <!-- 编写文章按钮 -->
-            <el-tooltip content="编写文章" placement="top">
-              <el-button
-                link
-                type="primary"
-                icon="EditPen"
-                @click="handleWriteArticle(scope.row)"
-                v-hasPermi="['system:gameEvent:writeArticle']"
-              ></el-button>
-            </el-tooltip>
-          </template>
-        </el-table-column>
       </el-table>
 
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
@@ -368,6 +378,7 @@ import RankingBoard from './RankingBoard.vue';
 import Editor from '@/components/Editor/index.vue';
 import { useTagsViewStore } from '@/store/modules/tagsView';
 import { globalHeaders } from '@/utils/request';
+import { useGameEventStore } from '@/store/modules/gameEvent';
 
 const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -477,6 +488,9 @@ const data = reactive<PageData<GameEventForm, GameEventQuery>>({
 
 const { queryParams, form, rules } = toRefs(data);
 
+// 使用gameEvent store
+const gameEventStore = useGameEventStore();
+
 /** 查询赛事基本信息列表 */
 const getList = async () => {
   loading.value = true;
@@ -741,6 +755,8 @@ const handleStatusChange = async (row: GameEventVO) => {
     await proxy?.$modal.confirm('确认要"' + text + '""' + row.eventName + '"为默认赛事吗?');
     await changeEventDefault(row.eventId, row.isDefault);
     await getList();
+    // 更新全局默认赛事信息
+    await gameEventStore.fetchDefaultEvent();
     // localStorage.setItem('defaultEventId', row.eventId);
     proxy?.$modal.msgSuccess(text + '成功');
     // 刷新当前标签页
@@ -882,6 +898,8 @@ const handleSaveArticle = async () => {
 };
 
 onMounted(() => {
+  // 获取默认赛事信息
+  gameEventStore.fetchDefaultEvent();
   getList();
 });
 
@@ -899,24 +917,67 @@ onActivated(() => {
 </script>
 
 <style scoped>
-.article-form {
-  padding: 20px 0;
+.operation-buttons {
+  display: flex;
+  flex-wrap: wrap;
+  gap: 8px;
+  justify-content: center;
+  align-items: center;
+}
+
+.operation-buttons .el-button {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+  padding: 6px 12px;
+  border-radius: 6px;
+  transition: all 0.3s ease;
+}
+
+.operation-buttons .el-button:hover {
+  transform: translateY(-1px);
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
 }
 
-.article-form .el-form-item {
-  margin-bottom: 20px;
+.button-text {
+  font-size: 12px;
+  font-weight: 500;
+  white-space: nowrap;
 }
 
-.article-form .el-form-item__label {
-  font-weight: 600;
-  color: #303133;
+/* 为不同类型的按钮设置不同的颜色主题 */
+.operation-buttons .el-button--primary {
+  color: #409eff;
 }
 
-.article-form .el-input {
-  width: 100%;
+.operation-buttons .el-button--danger {
+  color: #f56c6c;
 }
 
-.dialog-footer {
-  text-align: right;
+.operation-buttons .el-button--warning {
+  color: #e6a23c;
+}
+
+.operation-buttons .el-button--info {
+  color: #909399;
+}
+
+.operation-buttons .el-button--success {
+  color: #67c23a;
+}
+
+/* 响应式设计 */
+@media (max-width: 1200px) {
+  .operation-buttons {
+    gap: 4px;
+  }
+  
+  .operation-buttons .el-button {
+    padding: 4px 8px;
+  }
+  
+  .button-text {
+    font-size: 11px;
+  }
 }
 </style>

+ 6 - 6
src/views/system/gameEventConfig/index.vue

@@ -53,9 +53,9 @@
         <el-table-column label="主键" align="center" prop="configId" v-if="columns[0].visible" />
         <!-- <el-table-column label="赛事ID" align="center" prop="eventId" /> -->
         <el-table-column label="配置类型" align="center" prop="configType" v-if="columns[1].visible" />
-        <el-table-column label="配置键" align="center" prop="configKey" v-if="columns[2].visible" />
-        <el-table-column label="配置值" align="center" prop="configValue" v-if="columns[3].visible" />
-        <el-table-column label="配置描述" align="center" prop="configDesc" v-if="columns[4].visible" />
+        <el-table-column label="配置描述" align="center" prop="configDesc" v-if="columns[2].visible" />
+        <el-table-column label="配置键" align="center" prop="configKey" v-if="columns[3].visible" />
+        <el-table-column label="配置值" align="center" prop="configValue" v-if="columns[4].visible" />
         <el-table-column label="是否启用" align="center" prop="isEnabled" v-if="columns[5].visible">
           <template #default="scope">
             <dict-tag :options="game_yes_no" :value="scope.row.isEnabled"/>
@@ -148,9 +148,9 @@ const total = ref(0);
 const columns = ref<FieldOption[]>([
   { key: 0, label: '主键', visible: true },
   { key: 1, label: '配置类型', visible: true },
-  { key: 2, label: '配置', visible: true },
-  { key: 3, label: '配置', visible: true },
-  { key: 4, label: '配置描述', visible: true },
+  { key: 2, label: '配置描述', visible: true },
+  { key: 3, label: '配置', visible: true },
+  { key: 4, label: '配置', visible: true },
   { key: 5, label: '是否启用', visible: true },
   { key: 6, label: '状态', visible: true },
   { key: 7, label: '备注', visible: true }

+ 11 - 5
src/views/system/gameScore/gameScoreEdit.vue

@@ -15,7 +15,12 @@
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="ID" align="center" prop="projectId" />
         <el-table-column label="项目" align="center" prop="projectName" />
-        <el-table-column label="分组" align="center" prop="groupType" />
+        <!-- <el-table-column label="分组" align="center" prop="groupType" /> -->
+        <el-table-column label="项目类型" align="center" prop="projectType" >
+          <template #default="scope">
+            <dict-tag :options="game_project_type" :value="scope.row.projectType" />
+          </template>
+        </el-table-column>
         <el-table-column label="单位" align="center" prop="unit" />
         <el-table-column label="姓名" align="center" prop="name" />
         <el-table-column label="号码" align="center" prop="athleteCode" />
@@ -67,6 +72,7 @@ import { GameScoreForm } from '@/api/system/gameScore/types';
 import Pagination from '@/components/Pagination/index.vue';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { game_project_type } = toRefs<any>(proxy?.useDict('game_project_type'));
 
 const route = useRoute();
 const buttonLoading = ref(false);
@@ -106,7 +112,7 @@ interface AthleteScore {
 const eventId = route.params.eventId as string;
 const projectId = route.params.projectId as string;
 const projectName = route.params.projectName as string;
-const groupType = route.params.groupType as string;
+const projectType = route.params.projectType as string;
 
 const queryParams = reactive({
   pageNum: 1,
@@ -114,7 +120,7 @@ const queryParams = reactive({
   eventId: eventId,
   projectId: projectId,
   projectName: projectName,
-  groupType: groupType,
+  projectType: projectType,
 });
 
 //刷新数据方法
@@ -249,7 +255,7 @@ const loadAthleteScores = async () => {
         eventId: eventId,
         projectId: projectId, // 直接使用路由传来的 projectId
         projectName: projectName,
-        groupType: groupType,
+        projectType: projectType,
       });
     } catch (error) {
       // 如果获取成绩失败,使用默认值
@@ -263,7 +269,7 @@ const loadAthleteScores = async () => {
         eventId: eventId,
         projectId: projectId, // 直接使用路由传来的 projectId
         projectName: projectName,
-        groupType: groupType,
+        projectType: projectType,
       });
     }
   }

+ 10 - 4
src/views/system/gameScore/index.vue

@@ -70,7 +70,12 @@
         <el-table-column type="selection" width="55" align="center" />
         <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" prop="groupType" v-if="columns[2].visible" />
+        <!-- <el-table-column label="分组" align="center" prop="groupType" v-if="columns[2].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" />
+          </template>
+        </el-table-column>
         <el-table-column label="状态" align="center" prop="status" v-if="columns[3].visible">
           <template #default="scope">
             <el-select v-model="scope.row.status" placeholder="请选择状态">
@@ -83,7 +88,7 @@
         <el-table-column label="更新时间" align="center" prop="updateTime" v-if="columns[5].visible" />
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
-            <el-tooltip content="修改成绩" placement="top">
+            <el-tooltip content="查看成绩详情" placement="top">
               <el-button link type="primary" icon="Edit" @click="navigateToEditPage(scope.row)"></el-button>
             </el-tooltip>
           </template>
@@ -104,6 +109,7 @@ import { GameEventVO, GameEventQuery } from '@/api/system/gameEvent/types';
 import { GameEventProjectVO, GameEventProjectQuery } from '@/api/system/gameEventProject/types';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { game_project_type } = toRefs<any>(proxy?.useDict('game_project_type'));
 const router = useRouter();
 
 // 默认赛事信息
@@ -306,11 +312,11 @@ const handleSelectionChange = (selection: GameScoreVO[]) => {
 const navigateToEditPage = (row: GameEventProjectVO) => {
   const projectId = row.projectId;
   const projectName = row.projectName;
-  const groupType = row.groupType;
+  const projectType = row.projectType;
   const eventId = row.eventId;
   router.push({
     name: 'GameScoreEdit',
-    params: { projectId,projectName,groupType,eventId}
+    params: { projectId,projectName,projectType,eventId}
   });
 };