+
任课班级分享
全年级分享
@@ -105,7 +105,7 @@
下一步
@@ -122,9 +122,7 @@
- 确 定
+ 确 定
取 消
@@ -218,7 +216,7 @@
{{ option }}
@@ -394,7 +392,7 @@
diff --git a/src/views/examinationPaper/edit.vue b/src/views/examinationPaper/edit.vue
index cf564d1..40a078b 100644
--- a/src/views/examinationPaper/edit.vue
+++ b/src/views/examinationPaper/edit.vue
@@ -104,6 +104,7 @@
export default {
data() {
return {
+ questionList:[],
form: {
//答题卡详情
title: "",
@@ -128,7 +129,7 @@ export default {
},
},
created() {
- this.form = this.$route.query.form && JSON.parse(this.$route.query.form);
+ this._QueryDetail()
},
methods: {
linkBack() {
@@ -199,17 +200,36 @@ export default {
sub.correctAnswer = arrs.sort().join("");
}
},
- save(){
- //删除答题卡
- // const { data, code, message } = await this.$request.updateAnswerSheet({...this.form});
- // if (code == 0) {
+ async save(){
+ let questionList = []
+ //更新答题卡
+ const { data, status, message } = await this.$request.modifyPaper({
+ paperId:this.form.id,
+ questionList:questionList
+ });
+ if (status == 0) {
this.$router.push({
path:"/examinationPaper"
})
- // } else {
- // this.$message.error(message);
- // }
- }
+ } else {
+ this.$message.error(message);
+ }
+ },
+ async _QueryDetail() {
+ //查询年级列表
+ const { data, status, message } = await this.$request.fetchPaperDetail({
+ paperId:this.$route.query.paperId
+ });
+ if (status == 0) {
+ this.form = deepClone(data)
+ this.questionList = deepClone(data.questionList)
+ this.form.questionList.map(item=>{
+ item.score = ""
+ })
+ } else {
+ this.$message.error(message);
+ }
+ },
},
};
diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue
index 17184ce..1715c7c 100644
--- a/src/views/examinationPaper/index.vue
+++ b/src/views/examinationPaper/index.vue
@@ -19,23 +19,23 @@
- 另有25份已经归档的答题卡,
+ 另有{{ archivedTotal }}份已经归档的答题卡,
点击查看>>
@@ -87,29 +87,29 @@
- {{ item.title }} {{ item.typeName }}
+ {{ item.title }} {{ item.tag }}
- 总题数:{{ item.answerNum }}
+ 总题数:{{ item.questionNum }}
|
- 预计时长:{{ item.time }}
+ 预计时长:{{ item.examsDuration }}
|
授课端同步:
{{
- `${clazzChild}班${
+ `${clazzChild.className}班${
indexs != item.aboutClazz.length - 1 ? "、" : ""
}`
}}
-
- {{ item.teacher }}|{{ item.date }}
+ {{ item.realName }}|{{ item.modifiedTime }}
@@ -134,7 +134,9 @@
icon="el-icon-more"
>
- 修改分享范围
+ 修改分享范围
复制
归档
@@ -144,11 +146,6 @@
-
-
-
-
-
任课班级分享
@@ -169,62 +166,23 @@ export default {
name: "examinationPaper",
data() {
return {
- props: { multiple: true, checkStrictly: true },
- options: [
- {
- value: 1,
- label: "一年级",
- children: [
- {
- value: 2,
- label: "二班",
- },
- {
- value: 3,
- label: "三班",
- },
- ],
- },
- {
- value: 4,
- label: "二年级",
- children: [
- {
- value: 5,
- label: "二班",
- },
- {
- value: 6,
- label: "三班",
- },
- ],
- },
- ],
+ userId: "",
dialogVisible: false,
query: {
- gradeClass: [],
- subjectId: "0",
- typeName: "周测",
+ classId: "",
+ subjectName: "",
+ tagId: "",
title: "",
},
- classList: [
- {
- label: "2003班",
- value: "2003",
- },
- ],
- subjectList: [
- {
- label: "语文",
- value: "0",
- },
- ],
- typeList: ["周测"],
+ classList: [],
+ subjectList: [],
+ typeList: [],
+ archivedTotal: 0, //已归档答题卡数量
tableData: [
{
title: "数学样例试卷202211-324654",
id: "1062837",
- typeName: "周测",
+ tag: "周测",
answerNum: 45,
time: 90,
aboutClazz: [203, 204],
@@ -246,7 +204,7 @@ export default {
score: 1,
partScore: 0,
selectNum: 4,
- answerOptions: ["A", "B", "C", "D"],
+ answerOptions: "A,B,C,D",
correctAnswer: "B",
},
],
@@ -256,7 +214,7 @@ export default {
{
title: "数学样例试卷202211-4180949",
id: "1062838",
- typeName: "周测",
+ tag: "周测",
answerNum: 45,
time: 90,
aboutClazz: [203, 204],
@@ -288,14 +246,22 @@ export default {
],
shareForm: {
id: "",
- grade: "",
share: 1,
},
shareRulesForm: {
share: [{ required: true, message: "选择分享范围", trigger: "blur" }],
},
+ page: 1,
+ size: 20,
};
},
+ async created() {
+ this.userId = this.$store.getters.info.uid || "";
+ await this._QueryClassList();
+ await this._QuerySubjectList();
+ this._QueryData();
+ this._QueryTypeList();
+ },
methods: {
toAdd(query) {
let routerItem = {
@@ -308,7 +274,7 @@ export default {
this.$router.push({
path: "/examinationPaperEdit",
query: {
- form: JSON.stringify(item),
+ paperId: item.id,
},
});
},
@@ -319,13 +285,12 @@ export default {
case 1:
//修改分享范围
that.shareForm.id = item.id;
- that.shareForm.grade = item.grade;
that.shareForm.share = item.share || 1;
that.dialogVisible = true;
break;
case 2:
//复制
- that.toAdd({ type: 2, form: JSON.stringify(item) });
+ that.toAdd({ type: 2, paperId: item.id });
break;
case 3:
//归档
@@ -335,51 +300,61 @@ export default {
},
async saveShare() {
//修改分享范围
- // const { data, code, message } = await this.$request.fetchAnswerList({
- // ...this.shareForm,
- // });
- // this.loading = false;
- // if (code === 0) {
- this.shareForm.id = "";
- this.shareForm.grade = "";
- this.shareForm.share = 1;
- dialogVisible = false;
- // } else {
- // this.$message.error(message);
- // }
+ const { data, status, message } = await this.$request.modifyPaper({
+ paperId: that.shareForm.id,
+ sharingType: that.shareForm.share,
+ });
+ this.loading = false;
+ if (status === 0) {
+ this.shareForm.id = "";
+ this.shareForm.share = 1;
+ dialogVisible = false;
+ } else {
+ this.$message.error(message);
+ }
},
async recovery(item) {
//归档
- // const { data, code, message } = await this.$request.fetchAnswerList({
- // ...this.shareForm,
- // });
- // if (code === 0) {
- this.tableData = this.tableData.filter((items) => {
- return items.id != item.id;
+ const { data, status, message } = await this.$request.modifyPaper({
+ paperId: item.id,
+ status: 2,
});
- // } else {
- // this.$message.error(message);
- // }
+ if (status === 0) {
+ let type = this.query.title ? 1 : 0;
+ this.page = 1;
+ this._QueryData(type);
+ } else {
+ this.$message.error(message);
+ }
},
- async changeGrade() {
- //切换班级
+ //切换班级
+ async changClazz() {
await this._QuerySubjectList();
- this._QueryData();
+ this._QueryData(false);
},
- async changClazz() {},
// 查找答题卡类型
async _QueryTypeList() {
- const { data, code, message } = await this.$request.fetchTypeNames();
- if (code === 0) {
- this.typeList = [...data.typeNames] || [];
+ const { data, status, message } = await this.$request.fetchTypeNames();
+ if (status === 0) {
+ this.typeList =
+ data.subjectNames.map((item) => {
+ return {
+ value: item.tagId,
+ label: item.tag,
+ };
+ }) || [];
+ this.subjectNames.unshift({
+ value: "",
+ label: "--",
+ });
} else {
this.$message.error(message);
}
},
// 查找班级
async _QueryClassList() {
- const { data, code, message } = await this.$request.fetchClassList();
- if (code === 0) {
+ const { data, status, message } = await this.$request.fetchClassList();
+ if (status === 0) {
if (!!data.list) {
this.classList = data.list.map((item) => {
return {
@@ -395,14 +370,14 @@ export default {
},
// 查找科目
async _QuerySubjectList() {
- const { data, code, message } = await this.$request.fetchSubjectList({
+ const { data, status, message } = await this.$request.fetchSubjectList({
clazzId: this.query.clazzId,
});
- if (code === 0) {
- this.subjectList = data.list.map((item) => {
+ if (status === 0) {
+ this.subjectList = data.subjectNames.map((item) => {
return {
- value: item.subjectId,
- label: item.subjectName,
+ value: item,
+ label: item,
};
});
this.query.clazzId = this.subjectList[0]?.value;
@@ -418,8 +393,8 @@ export default {
query = { ...this.query };
} else {
query = { title: this.query.title };
- this.query.typeName = "";
- this.query.subjectId = "";
+ this.query.tagId = "";
+ this.query.subjectName = "";
}
query.clazzId = this.query.clazzId;
for (let key in query) {
@@ -434,11 +409,14 @@ export default {
return;
}
this.loading = true;
- const { data, code, message } = await this.$request.fetchAnswerList({
+ const { data, status, message } = await this.$request.fetchPaperList({
...query,
+ status: 1,
+ page: this.page,
+ size: this.size,
});
this.loading = false;
- if (code === 0) {
+ if (status === 0) {
this.total = data.total;
this.tableData = (data.list && [...data.list]) || [];
} else {
diff --git a/src/views/examinationPaper/recycle.vue b/src/views/examinationPaper/recycle.vue
index 39a994a..07f0953 100644
--- a/src/views/examinationPaper/recycle.vue
+++ b/src/views/examinationPaper/recycle.vue
@@ -7,7 +7,7 @@