AuditQuestionApply.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="audit-paper-audited">
  3. <el-form class="part-filter-form" :model="filter" inline>
  4. <el-form-item label="审核状态">
  5. <el-select v-model="filter.auditStatus" clearable placeholder="请选择">
  6. <el-option label="待审核" value="WITHDRAW"> </el-option>
  7. <el-option label="审核中" value="IN_REVIEW"> </el-option>
  8. <el-option label="已入库" value="PASS"> </el-option>
  9. <el-option label="已驳回" value="NOT_PASS"> </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" @click="toPage(1)">查询</el-button>
  14. </el-form-item>
  15. </el-form>
  16. <div>
  17. <el-table
  18. v-loading="loading"
  19. element-loading-text="拼命加载中"
  20. :data="dataList"
  21. >
  22. <el-table-column label="试题">
  23. <div slot-scope="scope" @click="toDetail(scope.row)">
  24. <rich-text
  25. class="row-question-body"
  26. title="点击查看试题"
  27. :text-json="scope.row.quesBody"
  28. ></rich-text>
  29. </div>
  30. </el-table-column>
  31. <el-table-column label="课程">
  32. <template slot-scope="scope">
  33. <span
  34. >{{ scope.row.course.name }}({{ scope.row.course.code }})</span
  35. >
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="提交时间" prop="updateTime" width="170">
  39. </el-table-column>
  40. <el-table-column label="当前审核状态" prop="inReviewStatus" width="140">
  41. </el-table-column>
  42. <el-table-column label="状态" prop="auditStatusName" width="100">
  43. </el-table-column>
  44. <el-table-column label="操作" width="170" fixed="right">
  45. <template slot-scope="scope">
  46. <div class="operate_left">
  47. <el-button
  48. size="medium"
  49. type="text"
  50. class="normal"
  51. @click="toDetail(scope.row)"
  52. >详情</el-button
  53. >
  54. <el-button
  55. size="medium"
  56. type="text"
  57. class="normal"
  58. @click="toWithdraw(scope.row)"
  59. >撤回</el-button
  60. >
  61. </div>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <div class="part-page">
  66. <el-pagination
  67. :current-page="currentPage"
  68. :page-size="pageSize"
  69. :page-sizes="[10, 20, 50, 100, 200, 300]"
  70. layout="total, sizes, prev, pager, next, jumper"
  71. :total="total"
  72. @current-change="toPage"
  73. @size-change="handleSizeChange"
  74. >
  75. </el-pagination>
  76. </div>
  77. </div>
  78. <!-- QuestionPreviewDialog -->
  79. <question-preview-dialog
  80. ref="QuestionPreviewDialog"
  81. :question="curQuestion"
  82. ></question-preview-dialog>
  83. </div>
  84. </template>
  85. <script>
  86. import { auditQuestionApplyPageListApi, withdrawQuestionApi } from "../api";
  87. import QuestionPreviewDialog from "./QuestionPreviewDialog.vue";
  88. export default {
  89. name: "AuditQuestionApply",
  90. components: { QuestionPreviewDialog },
  91. data() {
  92. return {
  93. filter: { auditStatus: "" },
  94. dataList: [],
  95. currentPage: 1,
  96. pageSize: 10,
  97. total: 0,
  98. loading: false,
  99. curQuestion: {},
  100. };
  101. },
  102. mounted() {
  103. this.toPage(1);
  104. },
  105. methods: {
  106. toPage(page) {
  107. this.currentPage = page;
  108. this.getList();
  109. },
  110. async getList() {
  111. this.loading = true;
  112. const res = await auditQuestionApplyPageListApi({
  113. ...this.filter,
  114. curPage: this.currentPage,
  115. pageSize: this.pageSize,
  116. }).catch(() => {});
  117. this.loading = false;
  118. if (!res) return;
  119. this.dataList = res.data.content;
  120. this.total = res.data.totalElements;
  121. },
  122. handleSizeChange(val) {
  123. this.pageSize = val;
  124. this.toPage(1);
  125. },
  126. toDetail(row) {
  127. this.curQuestion = row;
  128. this.$refs.QuestionPreviewDialog.open();
  129. },
  130. async toWithdraw(row) {
  131. const confirm = await this.$confirm(
  132. `确定要撤销该试题的提交吗?`,
  133. "系统通知",
  134. {
  135. type: "warning",
  136. }
  137. ).catch(() => {});
  138. if (confirm !== "confirm") return;
  139. await withdrawQuestionApi([row.id]);
  140. this.$message.success("操作成功!");
  141. this.getList();
  142. },
  143. },
  144. };
  145. </script>