Просмотр исходного кода

fix: approveGuide 中 username 字段为 null 时使用 teacher_{userId} 兜底; fix(web): ArticleAudit 接口名/参数修正 + GuideAudit 分页

Xiaogang Liao 2 месяцев назад
Родитель
Сommit
807ddd879d
1 измененных файлов с 19 добавлено и 2 удалено
  1. 19 2
      cfc-web/src/views/admin/review/GuideAudit.vue

+ 19 - 2
cfc-web/src/views/admin/review/GuideAudit.vue

@@ -32,6 +32,16 @@
       </el-table-column>
     </el-table></div></div>
 
+    <el-pagination
+      v-if="total > 0"
+      :current-page="page"
+      :page-size="size"
+      :total="total"
+      layout="total, prev, pager, next"
+      @current-change="onPageChange"
+      style="margin-top:12px;text-align:right;"
+    />
+
     <el-dialog title="拒绝原因" :visible.sync="rejectDialogVisible" width="400px">
       <el-input v-model="rejectReason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />
       <span slot="footer">
@@ -50,6 +60,7 @@ export default {
   data() {
     return {
       list: [], loading: false, keyword: '', statusFilter: 'pending',
+      page: 1, size: 20, total: 0,
       rejectDialogVisible: false, rejectTarget: null, rejectReason: ''
     }
   },
@@ -57,20 +68,26 @@ export default {
   methods: {
     statusType(s) { return { pending: 'warning', approved: 'success', rejected: 'danger' }[s] || 'info' },
     statusLabel(s) { return { pending: '待审核', approved: '已通过', rejected: '已拒绝' }[s] || s },
-    handleSearch() { this.loadData() },
+    handleSearch() { this.page = 1; this.loadData() },
+    onPageChange(p) { this.page = p; this.loadData() },
     async loadData() {
       this.loading = true
       try {
         const res = await getGuideApplications({
           status: this.statusFilter || undefined,
-          keyword: this.keyword || undefined, page: 1, size: 50
+          keyword: this.keyword || undefined,
+          page: this.page,
+          size: this.size
         })
         if (res.data && res.data.records) {
           this.list = res.data.records
+          this.total = res.data.total || 0
         } else if (res.data && Array.isArray(res.data)) {
           this.list = res.data
+          this.total = res.data.length
         } else {
           this.list = []
+          this.total = 0
         }
       } catch (e) {
         console.error(e)