|
@@ -48,8 +48,15 @@
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
plain
|
|
|
- @click="toDetail(scope.row)"
|
|
|
- >详情</el-button
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="toSubmit(scope.row)"
|
|
|
+ >提交</el-button
|
|
|
>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -68,14 +75,23 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- QuestionEditDialog -->
|
|
|
+ <question-edit-dialog
|
|
|
+ ref="QuestionEditDialog"
|
|
|
+ :question="curQuestion"
|
|
|
+ @modified="getList"
|
|
|
+ ></question-edit-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { auditQuestionsUnsubmitPageListApi } from "../api";
|
|
|
+import { auditQuestionsUnsubmitPageListApi, submitQuestionApi } from "../api";
|
|
|
+import QuestionEditDialog from "../components/QuestionEditDialog.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "AuditQuestionUnsubmit",
|
|
|
+ components: { QuestionEditDialog },
|
|
|
data() {
|
|
|
return {
|
|
|
filter: { creatorName: "", name: "" },
|
|
@@ -84,6 +100,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
total: 0,
|
|
|
loading: false,
|
|
|
+ curQuestion: {},
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -110,8 +127,33 @@ export default {
|
|
|
this.pageSize = val;
|
|
|
this.toPage(1);
|
|
|
},
|
|
|
- toDetail(row) {
|
|
|
- console.log(row);
|
|
|
+ toEdit(row) {
|
|
|
+ const courseInfo = {
|
|
|
+ courseId: row.course.id,
|
|
|
+ courseCode: row.course.code,
|
|
|
+ courseName: row.course.name,
|
|
|
+ };
|
|
|
+ let curQuestion = {
|
|
|
+ ...row,
|
|
|
+ ...courseInfo,
|
|
|
+ };
|
|
|
+ if (curQuestion.subQuestions && curQuestion.subQuestions.length) {
|
|
|
+ curQuestion.subQuestions = curQuestion.subQuestions.map((q) => {
|
|
|
+ return { ...q, ...courseInfo };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.curQuestion = curQuestion;
|
|
|
+
|
|
|
+ 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("操作成功!");
|
|
|
},
|
|
|
},
|
|
|
};
|