|
@@ -1,8 +1,9 @@
|
|
|
<template >
|
|
|
- <div class="preview_container">
|
|
|
+ <div v-loading="loading" class="preview_container">
|
|
|
<el-card>
|
|
|
- <div class="paper_header">
|
|
|
+ <div class="paper_header fx-row fx-bet-cen">
|
|
|
<div class="paper_title">{{ title }}</div>
|
|
|
+ <el-button size="small" round @click="$router.back()">返回</el-button>
|
|
|
</div>
|
|
|
<!-- 题目组 -->
|
|
|
<div class="paper_questions" id="question_list">
|
|
@@ -69,6 +70,7 @@ import {
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
title: "",
|
|
|
knowledgeId: 0,
|
|
|
chapterId: 0,
|
|
@@ -80,26 +82,29 @@ export default {
|
|
|
second: 0,
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
- // 开启记时
|
|
|
- this.timing();
|
|
|
- this.knowledgeId = this.$route.query.knowledgeId;
|
|
|
- this.chapterId = this.$route.query.chapterId;
|
|
|
- this.subjectId = this.$route.query.subjectId;
|
|
|
- this.title = this.$route.query.title;
|
|
|
- if (this.chapterId) {
|
|
|
- getQuestionsByChapter({ chapterId: this.chapterId }).then((res) => {
|
|
|
- this.queList = this.formatQueList(res.data);
|
|
|
- this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
|
|
|
- });
|
|
|
- } else if (this.knowledgeId) {
|
|
|
- getQuestionsByKnowledge({ knowledgeId: this.knowledgeId }).then((res) => {
|
|
|
- this.queList = this.formatQueList(res.data);
|
|
|
- this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
|
|
|
- });
|
|
|
- }
|
|
|
+ mounted() {
|
|
|
+ this.initPaper()
|
|
|
},
|
|
|
methods: {
|
|
|
+ initPaper() {
|
|
|
+ // 开启记时
|
|
|
+ this.timing();
|
|
|
+ this.knowledgeId = this.$route.query.knowledgeId;
|
|
|
+ this.chapterId = this.$route.query.chapterId;
|
|
|
+ this.subjectId = this.$route.query.subjectId;
|
|
|
+ this.title = this.$route.query.title;
|
|
|
+ if (this.chapterId) {
|
|
|
+ getQuestionsByChapter({ chapterId: this.chapterId }).then((res) => {
|
|
|
+ this.queList = this.formatQueList(res.data);
|
|
|
+ this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
|
|
|
+ });
|
|
|
+ } else if (this.knowledgeId) {
|
|
|
+ getQuestionsByKnowledge({ knowledgeId: this.knowledgeId }).then((res) => {
|
|
|
+ this.queList = this.formatQueList(res.data);
|
|
|
+ this.$nextTick((_) => this.mxGlobal.MathQueue("question_list"));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 格式化数据 去除\
|
|
|
*/
|
|
@@ -118,6 +123,7 @@ export default {
|
|
|
savePractice() {
|
|
|
if (Object.keys(this.answerForm).length >= this.queList.length) {
|
|
|
if (this.knowledgeId) {
|
|
|
+ this.loading = true
|
|
|
savePractice({
|
|
|
answers: this.answerForm,
|
|
|
knowledgeId: this.knowledgeId,
|
|
@@ -133,8 +139,9 @@ export default {
|
|
|
knowledgeId: this.knowledgeId,
|
|
|
},
|
|
|
});
|
|
|
- });
|
|
|
+ }).finally(() => this.loading = false);
|
|
|
} else if (this.chapterId) {
|
|
|
+ this.loading = true
|
|
|
savePractice({
|
|
|
answers: this.answerForm,
|
|
|
chapterId: this.chapterId,
|
|
@@ -148,7 +155,7 @@ export default {
|
|
|
type: 1,
|
|
|
},
|
|
|
});
|
|
|
- });
|
|
|
+ }).finally(() => this.loading = false);
|
|
|
}
|
|
|
} else {
|
|
|
this.dialogVisible = true;
|
|
@@ -187,142 +194,5 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
-.preview_container {
|
|
|
- padding: 20px;
|
|
|
-}
|
|
|
-.paper_header {
|
|
|
- overflow: hidden;
|
|
|
- margin-bottom: 33px;
|
|
|
-}
|
|
|
-.paper_title {
|
|
|
- height: 25px;
|
|
|
- font-size: 18px;
|
|
|
- font-family: PingFangSC-Medium, PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #292929;
|
|
|
- line-height: 25px;
|
|
|
- float: left;
|
|
|
-}
|
|
|
-.operation {
|
|
|
- float: right;
|
|
|
-}
|
|
|
-.shoucan {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-right: 53px;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFangSC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
-}
|
|
|
-.shoucan img {
|
|
|
- margin-right: 6px;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-.shoucan .sc_text {
|
|
|
- color: #9f9f9f;
|
|
|
- line-height: 20px;
|
|
|
- cursor: pointer;
|
|
|
- margin-right: 28px;
|
|
|
-}
|
|
|
-.shoucan .btn {
|
|
|
- padding: 6px 20px;
|
|
|
- cursor: pointer;
|
|
|
- background: #47c6a2;
|
|
|
- color: white;
|
|
|
- border-radius: 4px;
|
|
|
-}
|
|
|
-.que_item {
|
|
|
- border-radius: 1px;
|
|
|
- border: 1px solid #dedede;
|
|
|
- margin-bottom: 8px;
|
|
|
-}
|
|
|
-.que_content {
|
|
|
- padding: 12px 24px 0 33px;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFangSC-Medium, PingFang SC;
|
|
|
- font-weight: 500;
|
|
|
- color: #4c4c4c;
|
|
|
- line-height: 27px;
|
|
|
- margin-bottom: 40px;
|
|
|
-}
|
|
|
-.options {
|
|
|
- padding-left: 36px;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFangSC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #4c4c4c;
|
|
|
- line-height: 27px;
|
|
|
-}
|
|
|
-.options .option {
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.operation {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 14px;
|
|
|
- font-family: PingFangSC-Regular, PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- color: #47c6a2;
|
|
|
- line-height: 20px;
|
|
|
-}
|
|
|
-.operation > div {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-.operation .shoucan {
|
|
|
- margin-right: 46px;
|
|
|
-}
|
|
|
-.operation .detail span {
|
|
|
- border-radius: 1px;
|
|
|
- border-bottom: 1px solid #47c6a2;
|
|
|
-}
|
|
|
-.operation .detail {
|
|
|
- margin-right: 32px;
|
|
|
-}
|
|
|
-.operation > div > img {
|
|
|
- margin-right: 10px;
|
|
|
-}
|
|
|
-.operation .addQue {
|
|
|
- padding: 7px;
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid #979797;
|
|
|
- margin-right: 24px;
|
|
|
-}
|
|
|
-.info {
|
|
|
- padding: 12px 40px;
|
|
|
-}
|
|
|
-.que_item p {
|
|
|
- margin: 0 !important;
|
|
|
-}
|
|
|
-.save {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
-}
|
|
|
-.save span {
|
|
|
- padding: 20px;
|
|
|
- background: #47c6a2;
|
|
|
- color: white;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-.exam_time {
|
|
|
- position: fixed;
|
|
|
- right: 0;
|
|
|
- color: white;
|
|
|
- background: #47c6a2;
|
|
|
- top: 50%;
|
|
|
- padding: 5px 10px;
|
|
|
-}
|
|
|
-</style>
|
|
|
-<style scoped>
|
|
|
-/deep/.paper_questions .options .el-radio {
|
|
|
- display: flex;
|
|
|
-}
|
|
|
-/deep/.paper_questions .options .el-radio:hover {
|
|
|
- color: #47c6a2;
|
|
|
-}
|
|
|
-/deep/.paper_questions .options .el-radio__label {
|
|
|
- display: flex;
|
|
|
-}
|
|
|
+@import "~@/views/questioncenter/practice-style.scss";
|
|
|
</style>
|