|
@@ -37,7 +37,7 @@
|
|
<script>
|
|
<script>
|
|
import { mapState as globalMapState } from "vuex";
|
|
import { mapState as globalMapState } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
-const { mapState } = createNamespacedHelpers("examingHomeModule");
|
|
|
|
|
|
+const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
@@ -75,11 +75,23 @@ export default {
|
|
// .map(q => q.groupScore)
|
|
// .map(q => q.groupScore)
|
|
// .reduce((p, c) => p + c);
|
|
// .reduce((p, c) => p + c);
|
|
},
|
|
},
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ this.updateExamState({
|
|
|
|
+ exam: null,
|
|
|
|
+ paperStruct: null,
|
|
|
|
+ examQuestionList: null
|
|
|
|
+ });
|
|
|
|
+ this.updateExamResult({
|
|
|
|
+ examResult: null
|
|
|
|
+ });
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...globalMapState(["user"]),
|
|
...globalMapState(["user"]),
|
|
...mapState(["exam", "examResult", "paperStruct"])
|
|
...mapState(["exam", "examResult", "paperStruct"])
|
|
},
|
|
},
|
|
- methods: {}
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ ...mapMutations(["updateExamState", "updateExamResult"])
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|