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/rating/index.vue | 223 +++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 165 insertions(+), 58 deletions(-) diff --git a/web/src/views/rating/index.vue b/web/src/views/rating/index.vue index 512423d..be6dc55 100644 --- a/web/src/views/rating/index.vue +++ b/web/src/views/rating/index.vue @@ -1,48 +1,71 @@ <template> <div class="rating-page"> - <div class="page-card"> - <h3 class="card-title">璇勫垎妯℃澘绠$悊</h3> - - <!-- 鎿嶄綔鏍� --> - <div class="toolbar"> - <el-button type="success" @click="handleAdd"> + <!-- 椤甸潰鏍囬鍖哄煙 --> + <div class="page-header"> + <div class="title-section"> + <h1 class="page-title">璇勫垎妯℃澘</h1> + <p class="page-subtitle">绠$悊姣旇禌璇勫垎妯℃澘锛岃缃瘎鍒嗘爣鍑嗗拰鏉冮噸鍒嗛厤</p> + </div> + </div> + + <!-- 鎼滅储宸ュ叿鏍� --> + <div class="search-toolbar"> + <div class="search-form"> + <el-input + v-model="searchQuery" + placeholder="鎼滅储璇勫垎妯℃澘..." + style="width: 300px" + clearable + @clear="handleClear" + /> + <el-button type="primary" @click="handleSearch"> + <el-icon><Search /></el-icon> + 鏌ヨ + </el-button> + <el-button type="primary" @click="handleAdd"> <el-icon><Plus /></el-icon> 鏂板妯℃澘 </el-button> </div> + </div> - <!-- 妯℃澘鍒楄〃 --> - <el-table :data="tableData" style="width: 100%" v-loading="loading"> - <el-table-column prop="name" label="妯℃澘鍚嶇О" min-width="200" /> - <el-table-column prop="totalScore" label="妯℃澘鎬诲垎" width="120" align="center" /> - <el-table-column prop="itemCount" label="璇勫垎鏉$洰鏁�" width="120" align="center" /> - <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="180" /> - <el-table-column label="鎿嶄綔" width="150" fixed="right"> - <template #default="{ row }"> - <div class="table-actions"> - <el-button type="warning" size="small" @click="handleEdit(row)"> - 缂栬緫 - </el-button> - <el-button type="danger" size="small" @click="handleDelete(row)"> - 鍒犻櫎 - </el-button> - </div> - </template> - </el-table-column> - </el-table> + <!-- 妯℃澘鍒楄〃 --> + <el-table :data="tableData" style="width: 100%" v-loading="loading"> + <el-table-column prop="name" label="妯℃澘鍚嶇О" min-width="200" /> + <el-table-column prop="totalScore" label="妯℃澘鎬诲垎" width="120" align="center" /> + <el-table-column prop="itemCount" label="璇勫垎鏉$洰鏁�" width="120" align="center" /> + <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="180" /> + <el-table-column label="鎿嶄綔" width="120" align="center"> + <template #default="{ row }"> + <el-button + text + :icon="Edit" + @click="handleEdit(row)" + class="action-btn edit-btn" + title="缂栬緫" + /> + <el-button + text + :icon="Delete" + @click="handleDelete(row)" + class="action-btn delete-btn" + title="鍒犻櫎" + /> + </template> + </el-table-column> + </el-table> - <!-- 鍒嗛〉 --> - <div class="pagination"> - <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> + <!-- 鍒嗛〉 --> + <div class="pagination"> + <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> </div> </template> @@ -51,9 +74,11 @@ import { reactive, ref, onMounted } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { useRouter } from 'vue-router' +import { Plus, Search, Edit, Delete } from '@element-plus/icons-vue' import { getRatingSchemes, deleteRatingScheme } from '@/api/rating.js' const loading = ref(false) +const searchQuery = ref('') // 鍒嗛〉淇℃伅 const pagination = reactive({ @@ -96,6 +121,18 @@ } } +// 鎼滅储澶勭悊 +const handleSearch = () => { + pagination.page = 1 + loadData() +} + +const handleClear = () => { + searchQuery.value = '' + pagination.page = 1 + loadData() +} + // 鍒嗛〉澶у皬鏀瑰彉 const handleSizeChange = (size: number) => { pagination.size = size @@ -129,30 +166,100 @@ <style lang="scss" scoped> .rating-page { - .card-title { - margin-bottom: 20px; - color: #303133; - font-size: 16px; - font-weight: 500; - } - - .toolbar { - display: flex; + padding: 20px; +} + +/* 椤甸潰鏍囬鍖哄煙 */ +.page-header { + margin-bottom: 24px; +} + +.title-section { + text-align: left; +} + +.page-title { + font-size: 24px; + font-weight: 600; + color: #1f2937; + margin: 0 0 8px 0; +} + +.page-subtitle { + font-size: 14px; + color: #6b7280; + margin: 0; + line-height: 1.5; +} + +/* 鎼滅储宸ュ叿鏍� */ +.search-toolbar { + display: flex; + justify-content: flex-end; + margin-bottom: 20px; + padding: 16px; + background-color: #f9fafb; + border-radius: 8px; + border: 1px solid #e5e7eb; +} + +.search-form { + display: flex; + align-items: center; + gap: 12px; +} + +/* 鎼滅储鎸夐挳 */ +.search-btn { + width: 24px !important; + height: 24px !important; + min-height: 24px !important; + padding: 0 !important; + margin-right: 8px; +} + +/* 鎿嶄綔鎸夐挳鏍峰紡 */ +.action-btn { + padding: 8px !important; + margin: 0 6px; + border-radius: 6px; + transition: all 0.2s ease; +} + +.edit-btn { + color: #3b82f6 !important; +} + +.edit-btn:hover { + background-color: rgba(59, 130, 246, 0.1) !important; + transform: scale(1.2); +} + +.delete-btn { + color: #ef4444 !important; +} + +.delete-btn:hover { + background-color: rgba(239, 68, 68, 0.1) !important; + transform: scale(1.2); +} + +.pagination { + margin-top: 20px; + display: flex; + justify-content: center; +} + +/* 鍝嶅簲寮忛�傞厤 */ +@media (max-width: 768px) { + .search-toolbar { + flex-direction: column; gap: 12px; - margin-bottom: 20px; - align-items: center; + align-items: stretch; } - .table-actions { - display: flex; - gap: 8px; - flex-wrap: wrap; - } - - .pagination { - margin-top: 20px; - display: flex; - justify-content: flex-end; + .search-area { + justify-content: center; } } </style> \ No newline at end of file -- Gitblit v1.8.0