|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="toolbar">
|
|
|
+ <div class="filter-bar">
|
|
|
<el-select v-model="statusFilter" placeholder="审核状态" @change="loadData">
|
|
|
<el-option label="全部" value="" />
|
|
|
<el-option label="待审核" value="pending" />
|
|
|
@@ -10,7 +10,8 @@
|
|
|
<el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" style="width:200px" />
|
|
|
<el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
|
|
|
</div>
|
|
|
- <el-table :data="list" v-loading="loading" border stripe>
|
|
|
+ <div class="table-scroll-wrap"><div style="overflow:auto;max-height:calc(100vh - 300px);">
|
|
|
+ <el-table :data="list" v-loading="loading" border stripe style="min-width:900px;">
|
|
|
<el-table-column prop="id" label="ID" width="60" />
|
|
|
<el-table-column prop="nickname" label="昵称" width="120" />
|
|
|
<el-table-column prop="realName" label="真实姓名" width="120" />
|
|
|
@@ -29,7 +30,8 @@
|
|
|
<span v-else class="no-op">—</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
+ </el-table></div></div>
|
|
|
+
|
|
|
<el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
|
|
|
<el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />
|
|
|
<span slot="footer">
|
|
|
@@ -44,6 +46,7 @@
|
|
|
import { getGuideApplications, approveGuide, rejectGuide } from '@/api/admin'
|
|
|
|
|
|
export default {
|
|
|
+ name: 'GuideAudit',
|
|
|
data() {
|
|
|
return {
|
|
|
list: [], loading: false, keyword: '', statusFilter: 'pending',
|
|
|
@@ -55,14 +58,13 @@ export default {
|
|
|
statusType(s) { return { pending: 'warning', approved: 'success', rejected: 'danger' }[s] || 'info' },
|
|
|
statusLabel(s) { return { pending: '待审核', approved: '已通过', rejected: '已拒绝' }[s] || s },
|
|
|
handleSearch() { this.loadData() },
|
|
|
-async loadData() {
|
|
|
+ async loadData() {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
const res = await getGuideApplications({
|
|
|
status: this.statusFilter || undefined,
|
|
|
keyword: this.keyword || undefined, page: 1, size: 50
|
|
|
})
|
|
|
- // 后端返回 Page<User> 结构:{ records, total, page, size }
|
|
|
if (res.data && res.data.records) {
|
|
|
this.list = res.data.records
|
|
|
} else if (res.data && Array.isArray(res.data)) {
|
|
|
@@ -97,7 +99,8 @@ async loadData() {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
<style scoped>
|
|
|
-.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
|
|
|
+.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding: 12px; background: #fff; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
|
|
|
.no-op { color: #ccc; }
|
|
|
-</style>
|
|
|
+</style>
|