|
@@ -46,35 +46,34 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapState, mapMutations } from "vuex";
|
|
|
+
|
|
|
import { endScoreSyncPaperList, endScoreSync } from "../../api";
|
|
|
+
|
|
|
const initFilter = { semesterId: "", examId: "", courseId: "" };
|
|
|
|
|
|
export default {
|
|
|
name: "SyncPaperDialog",
|
|
|
- props: {
|
|
|
- course: {
|
|
|
- type: Object,
|
|
|
- default() {
|
|
|
- return {};
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
loading: false,
|
|
|
- filter: { ...initFilter },
|
|
|
dataList: [],
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState("target", ["course"]),
|
|
|
+ filter() {
|
|
|
+ return this.$objAssign(initFilter, this.course);
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ ...mapMutations("target", ["setCourse"]),
|
|
|
async getList() {
|
|
|
const res = await endScoreSyncPaperList(this.filter);
|
|
|
this.dataList = res || [];
|
|
|
},
|
|
|
- visibleChange() {
|
|
|
- this.filter = this.$objAssign(initFilter, this.course);
|
|
|
- },
|
|
|
+ visibleChange() {},
|
|
|
cancel() {
|
|
|
this.modalIsShow = false;
|
|
|
},
|
|
@@ -96,6 +95,7 @@ export default {
|
|
|
|
|
|
if (!res) return;
|
|
|
|
|
|
+ this.setCourse({ examId: row.examId, paperNumber: row.paperNumber });
|
|
|
this.$message.success(`${res.success},错误:${res.error}`);
|
|
|
this.$emit("modified");
|
|
|
this.cancel();
|