123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <div class="audit-question-unsubmit">
- <!-- <el-form class="part-filter-form" inline>
- <el-form-item label="提交人">
- <el-input
- v-model="filter.creatorName"
- placeholder="请输入提交人姓名"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="toPage(1)">查询</el-button>
- </el-form-item>
- </el-form> -->
- <div>
- <el-table
- v-loading="loading"
- element-loading-text="拼命加载中"
- :data="dataList"
- >
- <el-table-column label="试题">
- <div slot-scope="scope" @click="toViewQuestion(scope.row)">
- <rich-text
- class="row-question-body"
- title="点击查看试题"
- :text-json="scope.row.quesBody"
- ></rich-text>
- </div>
- </el-table-column>
- <el-table-column label="课程">
- <template slot-scope="scope">
- <span
- >{{ scope.row.course.name }}({{ scope.row.course.code }})</span
- >
- </template>
- </el-table-column>
- <el-table-column label="提交人" prop="creator" width="150">
- </el-table-column>
- <el-table-column label="修改时间" prop="updateTime" width="153">
- </el-table-column>
- <el-table-column label="操作" width="170" fixed="right">
- <template slot-scope="scope">
- <div class="operate_left">
- <el-button
- size="medium"
- type="text"
- class="normal"
- @click="toEdit(scope.row)"
- >编辑</el-button
- >
- <el-button
- size="medium"
- type="text"
- class="normal"
- @click="toSubmit(scope.row)"
- >提交</el-button
- >
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- :current-page="currentPage"
- :page-size="pageSize"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- @current-change="toPage"
- @size-change="handleSizeChange"
- >
- </el-pagination>
- </div>
- </div>
- <!-- QuestionEditDialog -->
- <question-edit-dialog
- ref="QuestionEditDialog"
- :question="curQuestion"
- @modified="getList"
- ></question-edit-dialog>
- <!-- QuestionPreviewDialog -->
- <question-preview-dialog
- ref="QuestionPreviewDialog"
- :question="curQuestion"
- ></question-preview-dialog>
- </div>
- </template>
- <script>
- import { auditQuestionsUnsubmitPageListApi, submitQuestionApi } from "../api";
- import QuestionEditDialog from "./QuestionEditDialog.vue";
- import QuestionPreviewDialog from "./QuestionPreviewDialog.vue";
- export default {
- name: "AuditQuestionUnsubmit",
- components: { QuestionEditDialog, QuestionPreviewDialog },
- data() {
- return {
- filter: { creatorName: "" },
- dataList: [],
- currentPage: 1,
- pageSize: 10,
- total: 0,
- loading: false,
- curQuestion: {},
- };
- },
- mounted() {
- this.toPage(1);
- },
- methods: {
- toPage(page) {
- this.currentPage = page;
- this.getList();
- },
- async getList() {
- this.loading = true;
- const res = await auditQuestionsUnsubmitPageListApi({
- ...this.filter,
- curPage: this.currentPage,
- pageSize: this.pageSize,
- }).catch(() => {});
- this.loading = false;
- if (!res) return;
- this.dataList = res.data.content;
- this.total = res.data.totalElements;
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.toPage(1);
- },
- toViewQuestion(row) {
- this.curQuestion = row;
- this.$refs.QuestionPreviewDialog.open();
- },
- toEdit(row) {
- this.curQuestion = row;
- this.$refs.QuestionEditDialog.open();
- },
- async toSubmit(row) {
- const confirm = await this.$confirm(`确定要提交该试题吗?`, "提示", {
- type: "warning",
- }).catch(() => {});
- if (confirm !== "confirm") return;
- await submitQuestionApi([row.id]);
- this.$message.success("操作成功!");
- this.getList();
- },
- },
- };
- </script>
|