From b39a0502e7941ce966fda53664cf1b04ba52d65f Mon Sep 17 00:00:00 2001 From: lrj <owen.stl@gmail.com> Date: 星期三, 01 十月 2025 17:30:24 +0800 Subject: [PATCH] 清理测试文件:删除所有test、debug、fix、check_开头的文件,为重构做准备 --- web/src/views/competition-promotion/index.vue | 356 +++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 213 insertions(+), 143 deletions(-) diff --git a/web/src/views/competition-promotion/index.vue b/web/src/views/competition-promotion/index.vue index d2cebc3..6d65381 100644 --- a/web/src/views/competition-promotion/index.vue +++ b/web/src/views/competition-promotion/index.vue @@ -1,117 +1,122 @@ <template> <div class="promotion-container"> - <el-card> - <template #header> - <div class="card-header"> - <h3 class="card-title">姣旇禌鏅嬬骇绠$悊</h3> - </div> - </template> - - <!-- 鎼滅储鏍� --> - <el-form :inline="true" class="search-form"> - <el-form-item label="姣旇禌鍚嶇О"> - <el-input - v-model="searchForm.name" - placeholder="璇疯緭鍏ユ瘮璧涘悕绉�" - @keyup.enter="loadData" - style="width: 200px" - clearable - /> - </el-form-item> - - <el-form-item> - <el-button type="primary" @click="loadData" :loading="loading"> - 鎼滅储 - </el-button> - <el-button @click="resetSearch">閲嶇疆</el-button> - </el-form-item> - </el-form> - - <!-- 鏁版嵁琛ㄦ牸 --> - <el-table - :data="competitions" - style="width: 100%" - v-loading="loading" - empty-text="鏆傛棤姣旇禌鏁版嵁" - > - <el-table-column prop="competitionName" label="姣旇禌鍚嶇О" min-width="150"> - <template #default="scope"> - <div class="competition-info"> - <div class="main-name">{{ scope.row.competitionName }}</div> - <div class="stage-name">{{ scope.row.stageName }}</div> - </div> - </template> - </el-table-column> - - <el-table-column prop="maxParticipants" label="鏈�澶т汉鏁�" width="100" align="center"> - <template #default="scope"> - <el-tag type="info">{{ scope.row.maxParticipants || '涓嶉檺' }}</el-tag> - </template> - </el-table-column> - - <el-table-column prop="currentCount" label="褰撳墠鏁伴噺" width="100" align="center"> - <template #default="scope"> - <el-button - type="text" - @click="viewParticipants(scope.row)" - class="count-link" - > - {{ scope.row.currentCount }} - </el-button> - </template> - </el-table-column> - - <el-table-column prop="status" label="鐘舵��" width="100" align="center"> - <template #default="scope"> - <el-tag :type="getStatusType(scope.row.status)"> - {{ getStatusText(scope.row.status) }} - </el-tag> - </template> - </el-table-column> - - <el-table-column prop="startTime" label="寮�濮嬫椂闂�" width="180"> - <template #default="scope"> - {{ formatDate(scope.row.startTime) }} - </template> - </el-table-column> - - <el-table-column prop="endTime" label="缁撴潫鏃堕棿" width="180"> - <template #default="scope"> - {{ formatDate(scope.row.endTime) }} - </template> - </el-table-column> - - <el-table-column label="鎿嶄綔" width="150" fixed="right"> - <template #default="scope"> - <!-- 鍙湁闈炵涓�闃舵鎵嶆樉绀烘檵绾ф寜閽� --> - <el-button - v-if="scope.row.sortOrder > 1" - type="primary" - size="small" - @click="selectPromotionCandidates(scope.row)" - :disabled="scope.row.state !== 1" - > - 閫夋嫨鏅嬬骇浜哄憳 - </el-button> - <!-- 绗竴闃舵鏄剧ず鎻愮ず鏂囨湰 --> - <span v-else class="no-promotion-text">棣栬疆姣旇禌</span> - </template> - </el-table-column> - </el-table> - - <!-- 鍒嗛〉 --> - <div class="pagination-container"> - <el-pagination - v-model:current-page="pagination.page" - v-model:page-size="pagination.size" - :page-sizes="[10, 20, 50, 100]" - :total="pagination.total" - layout="total, sizes, prev, pager, next, jumper" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - /> + <!-- 椤甸潰鏍囬鍖哄煙 --> + <div class="page-header"> + <div class="title-section"> + <h1 class="page-title">姣旇禌鏅嬬骇</h1> + <p class="page-subtitle">绠$悊姣旇禌鍚勯樁娈电殑鏅嬬骇娴佺▼锛岄�夋嫨浼樼鍙傝禌鑰呰繘鍏ヤ笅涓�杞�</p> </div> - </el-card> + </div> + + <!-- 鎼滅储宸ュ叿鏍� --> + <div class="search-toolbar"> + <div class="search-area"> + <el-input + v-model="searchForm.name" + placeholder="璇疯緭鍏ユ瘮璧涘悕绉�" + @keyup.enter="loadData" + @clear="handleClear" + style="width: 200px" + clearable + > + <template #prefix> + <el-icon><Search /></el-icon> + </template> + </el-input> + <el-button type="primary" @click="loadData" :loading="loading"> + <el-icon><Search /></el-icon> + 鎼滅储 + </el-button> + <el-button @click="resetSearch">閲嶇疆</el-button> + </div> + </div> + + <!-- 鏁版嵁琛ㄦ牸 --> + <el-table + :data="competitions" + style="width: 100%" + v-loading="loading" + empty-text="鏆傛棤姣旇禌鏁版嵁" + > + <el-table-column prop="competitionName" label="姣旇禌鍚嶇О" min-width="150"> + <template #default="scope"> + <div class="competition-info"> + <div class="main-name">{{ scope.row.competitionName }}</div> + <div class="stage-name">{{ scope.row.stageName }}</div> + </div> + </template> + </el-table-column> + + <el-table-column prop="maxParticipants" label="鏈�澶т汉鏁�" width="100" align="center"> + <template #default="scope"> + <el-tag type="info">{{ scope.row.maxParticipants || '涓嶉檺' }}</el-tag> + </template> + </el-table-column> + + <el-table-column prop="currentCount" label="褰撳墠鏁伴噺" width="100" align="center"> + <template #default="scope"> + <el-button + type="text" + @click="viewParticipants(scope.row)" + class="count-link" + > + {{ scope.row.currentCount }} + </el-button> + </template> + </el-table-column> + + <el-table-column prop="status" label="鐘舵��" width="100" align="center"> + <template #default="scope"> + <el-tag :type="getStatusType(scope.row.status)"> + {{ getStatusText(scope.row.status) }} + </el-tag> + </template> + </el-table-column> + + <el-table-column prop="startTime" label="寮�濮嬫椂闂�" width="180"> + <template #default="scope"> + {{ formatDate(scope.row.startTime) }} + </template> + </el-table-column> + + <el-table-column prop="endTime" label="缁撴潫鏃堕棿" width="180"> + <template #default="scope"> + {{ formatDate(scope.row.endTime) }} + </template> + </el-table-column> + + <el-table-column label="鎿嶄綔" width="80" align="center"> + <template #default="scope"> + <!-- 鍙湁闈炵涓�闃舵鎵嶆樉绀烘檵绾ф寜閽� --> + <el-button + v-if="scope.row.sortOrder > 1" + text + :icon="TrophyBase" + @click="selectPromotionCandidates(scope.row)" + :disabled="scope.row.state !== 1" + class="action-btn promotion-btn" + title="閫夋嫨鏅嬬骇浜哄憳" + /> + <!-- 绗竴闃舵鏄剧ず鎻愮ず鍥炬爣 --> + <el-icon v-else class="no-promotion-icon" title="棣栬疆姣旇禌"> + <InfoFilled /> + </el-icon> + </template> + </el-table-column> + </el-table> + + <!-- 鍒嗛〉 --> + <div class="pagination-container"> + <el-pagination + v-model:current-page="pagination.page" + v-model:page-size="pagination.size" + :page-sizes="[10, 20, 50, 100]" + :total="pagination.total" + layout="total, sizes, prev, pager, next, jumper" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + /> + </div> <!-- 鏅嬬骇浜哄憳閫夋嫨瀵硅瘽妗� --> <el-dialog @@ -194,15 +199,17 @@ <template #footer> <div class="dialog-footer"> <span class="selected-info">宸查�夋嫨 {{ selectedParticipants.length }} 浜�</span> - <el-button @click="handlePromotionDialogClose">鍙栨秷</el-button> - <el-button - type="primary" - @click="confirmPromotion" - :disabled="selectedParticipants.length === 0" - :loading="promotionLoading" - > - 纭鏅嬬骇 - </el-button> + <div class="footer-buttons"> + <el-button @click="handlePromotionDialogClose">鍙栨秷</el-button> + <el-button + type="primary" + @click="confirmPromotion" + :disabled="selectedParticipants.length === 0" + :loading="promotionLoading" + > + 纭鏅嬬骇 + </el-button> + </div> </div> </template> </el-dialog> @@ -213,7 +220,7 @@ import { ref, reactive, onMounted } from 'vue' import { useRouter } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' -import { Search } from '@element-plus/icons-vue' +import { Search, TrophyBase, InfoFilled } from '@element-plus/icons-vue' import PromotionApi from '@/api/promotion' const router = useRouter() @@ -280,7 +287,7 @@ { id: 1, competitionName: '2027鍒涙柊鍒涗笟澶ц禌', - stageName: '娴烽��', + stageName: '绗竴闃舵', maxParticipants: null, currentCount: 15, status: 1, @@ -290,7 +297,7 @@ { id: 2, competitionName: '2027鍒涙柊鍒涗笟澶ц禌', - stageName: '鍒濊禌', + stageName: '绗簩闃舵', maxParticipants: 50, currentCount: 8, status: 1, @@ -300,7 +307,7 @@ { id: 3, competitionName: '2027鍒涙柊鍒涗笟澶ц禌', - stageName: '鍐宠禌', + stageName: '绗笁闃舵', maxParticipants: 10, currentCount: 0, status: 0, @@ -322,6 +329,13 @@ } finally { loading.value = false } +} + +// 娓呯┖鎼滅储 +const handleClear = () => { + searchForm.name = '' + pagination.page = 1 + loadData() } // 閲嶇疆鎼滅储 @@ -412,8 +426,8 @@ ], selectableCount: 10, totalCount: 15, - previousStageName: '娴烽��', - currentStageName: '鍒濊禌' + previousStageName: '绗竴闃舵', + currentStageName: '绗簩闃舵' } promotableData.value = mockData @@ -611,24 +625,45 @@ padding: 20px; } -.card-header { - display: flex; - justify-content: space-between; - align-items: center; +/* 椤甸潰鏍囬鍖哄煙 */ +.page-header { + margin-bottom: 24px; } -.card-title { - margin: 0; - font-size: 18px; +.title-section { + text-align: left; +} + +.page-title { + font-size: 24px; font-weight: 600; - color: #303133; + color: #1f2937; + margin: 0 0 8px 0; } -.search-form { +.page-subtitle { + font-size: 14px; + color: #6b7280; + margin: 0; + line-height: 1.5; +} + +/* 鎼滅储宸ュ叿鏍� */ +.search-toolbar { + display: flex; + align-items: center; + justify-content: space-between; margin-bottom: 20px; - padding: 20px; - background: #f8f9fa; + padding: 16px; + background-color: #f9fafb; border-radius: 8px; + border: 1px solid #e5e7eb; +} + +.search-area { + display: flex; + align-items: center; + gap: 12px; } .competition-info { @@ -657,6 +692,28 @@ } } +/* 鎿嶄綔鎸夐挳鏍峰紡 */ +.action-btn { + padding: 8px !important; + margin: 0 6px; + border-radius: 6px; + transition: all 0.2s ease; +} + +.promotion-btn { + color: #f59e0b !important; +} + +.promotion-btn:hover { + background-color: rgba(245, 158, 11, 0.1) !important; + transform: scale(1.2); +} + +.no-promotion-icon { + color: #9ca3af; + font-size: 16px; +} + .score { font-weight: 600; color: #67c23a; @@ -665,12 +722,6 @@ .no-score { color: #909399; font-size: 12px; -} - -.no-promotion-text { - color: #909399; - font-size: 12px; - font-style: italic; } .pagination-container { @@ -723,5 +774,24 @@ color: #606266; font-size: 14px; } + + .footer-buttons { + display: flex; + gap: 12px; + } +} + +/* 鍝嶅簲寮忛�傞厤 */ +@media (max-width: 768px) { + .search-toolbar { + flex-direction: column; + gap: 12px; + align-items: stretch; + } + + .search-area { + justify-content: center; + flex-wrap: wrap; + } } </style> \ No newline at end of file -- Gitblit v1.8.0