|
@@ -627,9 +627,9 @@
|
|
<div
|
|
<div
|
|
v-if="
|
|
v-if="
|
|
quesModel.questionType != 'NESTED_ANSWER_QUESTION' &&
|
|
quesModel.questionType != 'NESTED_ANSWER_QUESTION' &&
|
|
- quesModel.questionType != 'SINGLE_ANSWER_QUESTION' &&
|
|
|
|
- quesModel.questionType != 'MULTIPLE_ANSWER_QUESTION' &&
|
|
|
|
- quesModel.questionType != 'BOOL_ANSWER_QUESTION'
|
|
|
|
|
|
+ quesModel.questionType != 'SINGLE_ANSWER_QUESTION' &&
|
|
|
|
+ quesModel.questionType != 'MULTIPLE_ANSWER_QUESTION' &&
|
|
|
|
+ quesModel.questionType != 'BOOL_ANSWER_QUESTION'
|
|
"
|
|
"
|
|
>
|
|
>
|
|
<el-form-item label="答案">
|
|
<el-form-item label="答案">
|
|
@@ -640,7 +640,7 @@
|
|
<div
|
|
<div
|
|
v-if="
|
|
v-if="
|
|
quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
- quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
|
|
|
|
|
|
+ quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION'
|
|
"
|
|
"
|
|
>
|
|
>
|
|
<el-form-item label="答案">
|
|
<el-form-item label="答案">
|
|
@@ -678,7 +678,7 @@
|
|
paper.paperType == 'IMPORT' &&
|
|
paper.paperType == 'IMPORT' &&
|
|
(quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
(quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION')
|
|
quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION')
|
|
- )
|
|
|
|
|
|
+ ),
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -686,8 +686,8 @@
|
|
@click="addQuesOption"
|
|
@click="addQuesOption"
|
|
v-if="
|
|
v-if="
|
|
paper.paperType == 'IMPORT' &&
|
|
paper.paperType == 'IMPORT' &&
|
|
- (quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
|
|
- quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION')
|
|
|
|
|
|
+ (quesModel.questionType == 'SINGLE_ANSWER_QUESTION' ||
|
|
|
|
+ quesModel.questionType == 'MULTIPLE_ANSWER_QUESTION')
|
|
"
|
|
"
|
|
><i class="el-icon-plus"></i> 新增选项
|
|
><i class="el-icon-plus"></i> 新增选项
|
|
</el-button>
|
|
</el-button>
|
|
@@ -777,6 +777,9 @@
|
|
value="上传答案文件"
|
|
value="上传答案文件"
|
|
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
/>
|
|
/>
|
|
|
|
+ <el-button @click="downAnswerTemplate" type="info">
|
|
|
|
+ <span>下载模板</span>
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
@click="uploadAnswerFile"
|
|
@click="uploadAnswerFile"
|
|
type="info"
|
|
type="info"
|
|
@@ -809,7 +812,7 @@ export default {
|
|
name: "editPaperApp",
|
|
name: "editPaperApp",
|
|
components: {
|
|
components: {
|
|
reduplicate_mark,
|
|
reduplicate_mark,
|
|
- ckeditor
|
|
|
|
|
|
+ ckeditor,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -829,9 +832,9 @@ export default {
|
|
paper: {
|
|
paper: {
|
|
course: {
|
|
course: {
|
|
code: "",
|
|
code: "",
|
|
- name: ""
|
|
|
|
|
|
+ name: "",
|
|
},
|
|
},
|
|
- examRemark: ""
|
|
|
|
|
|
+ examRemark: "",
|
|
},
|
|
},
|
|
loading: false,
|
|
loading: false,
|
|
dialogLoading: false,
|
|
dialogLoading: false,
|
|
@@ -878,7 +881,7 @@ export default {
|
|
"SlateBlue",
|
|
"SlateBlue",
|
|
"SlateGray",
|
|
"SlateGray",
|
|
"Tomato",
|
|
"Tomato",
|
|
- "VioletRed"
|
|
|
|
|
|
+ "VioletRed",
|
|
],
|
|
],
|
|
difficultyDegreeList: [
|
|
difficultyDegreeList: [
|
|
{ label: 0.1, value: 0.1 },
|
|
{ label: 0.1, value: 0.1 },
|
|
@@ -890,15 +893,15 @@ export default {
|
|
{ label: 0.7, value: 0.7 },
|
|
{ label: 0.7, value: 0.7 },
|
|
{ label: 0.8, value: 0.8 },
|
|
{ label: 0.8, value: 0.8 },
|
|
{ label: 0.9, value: 0.9 },
|
|
{ label: 0.9, value: 0.9 },
|
|
- { label: 1.0, value: 1.0 }
|
|
|
|
|
|
+ { label: 1.0, value: 1.0 },
|
|
],
|
|
],
|
|
publicityList: [
|
|
publicityList: [
|
|
{ label: "公开", value: true },
|
|
{ label: "公开", value: true },
|
|
- { label: "非公开", value: false }
|
|
|
|
|
|
+ { label: "非公开", value: false },
|
|
],
|
|
],
|
|
answerTypes: [
|
|
answerTypes: [
|
|
{ label: "文本", value: "DIVERSIFIED_TEXT" },
|
|
{ label: "文本", value: "DIVERSIFIED_TEXT" },
|
|
- { label: "音频", value: "SINGLE_AUDIO" }
|
|
|
|
|
|
+ { label: "音频", value: "SINGLE_AUDIO" },
|
|
],
|
|
],
|
|
coursePropertyList: [],
|
|
coursePropertyList: [],
|
|
coursePropertyName: "", //课程属性名
|
|
coursePropertyName: "", //课程属性名
|
|
@@ -908,10 +911,17 @@ export default {
|
|
secondPropertyId: "", //二级属性id
|
|
secondPropertyId: "", //二级属性id
|
|
examRemark: "",
|
|
examRemark: "",
|
|
showQuestions: [],
|
|
showQuestions: [],
|
|
- showButtons: []
|
|
|
|
|
|
+ showButtons: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ downAnswerTemplate() {
|
|
|
|
+ var key = this.user.key;
|
|
|
|
+ var token = this.user.token;
|
|
|
|
+ window.open(
|
|
|
|
+ QUESTION_API + "/paper/answer/template?$key=" + key + "&$token=" + token
|
|
|
|
+ );
|
|
|
|
+ },
|
|
openAnswerDialog() {
|
|
openAnswerDialog() {
|
|
this.checkResultAnswer = false;
|
|
this.checkResultAnswer = false;
|
|
this.isUploadAnswer = true;
|
|
this.isUploadAnswer = true;
|
|
@@ -940,7 +950,7 @@ export default {
|
|
param.append("dataFile", file, file.name);
|
|
param.append("dataFile", file, file.name);
|
|
}
|
|
}
|
|
let config = {
|
|
let config = {
|
|
- headers: { "Content-Type": "multipart/form-data" }
|
|
|
|
|
|
+ headers: { "Content-Type": "multipart/form-data" },
|
|
};
|
|
};
|
|
this.uploadAnswerLoading = true;
|
|
this.uploadAnswerLoading = true;
|
|
this.$http
|
|
this.$http
|
|
@@ -957,7 +967,7 @@ export default {
|
|
document.getElementById("answerFile").value = "";
|
|
document.getElementById("answerFile").value = "";
|
|
this.initPaper();
|
|
this.initPaper();
|
|
})
|
|
})
|
|
- .catch(error => {
|
|
|
|
|
|
+ .catch((error) => {
|
|
this.answerMessage = error.response.data.desc;
|
|
this.answerMessage = error.response.data.desc;
|
|
document.getElementById("answerFile").value = "";
|
|
document.getElementById("answerFile").value = "";
|
|
this.uploadAnswerLoading = false;
|
|
this.uploadAnswerLoading = false;
|
|
@@ -996,7 +1006,7 @@ export default {
|
|
"/" +
|
|
"/" +
|
|
this.paperDetailId +
|
|
this.paperDetailId +
|
|
"/" +
|
|
"/" +
|
|
- this.parentView
|
|
|
|
|
|
+ this.parentView,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//打开编辑大题题目弹窗
|
|
//打开编辑大题题目弹窗
|
|
@@ -1018,7 +1028,7 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "保存成功",
|
|
message: "保存成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.detailLoading = false;
|
|
this.detailLoading = false;
|
|
this.closePaperDatailDialog();
|
|
this.closePaperDatailDialog();
|
|
@@ -1033,60 +1043,63 @@ export default {
|
|
this.paper = {
|
|
this.paper = {
|
|
course: {
|
|
course: {
|
|
code: "",
|
|
code: "",
|
|
- name: ""
|
|
|
|
- }
|
|
|
|
|
|
+ name: "",
|
|
|
|
+ },
|
|
};
|
|
};
|
|
- this.$http.get(QUESTION_API + "/paper/" + this.paperId).then(response => {
|
|
|
|
- this.paper = response.data;
|
|
|
|
- //查询所有课程属性名
|
|
|
|
- this.initCourseProperty(this.paper.course.code);
|
|
|
|
- //将所有小题分为公开和非公开
|
|
|
|
- if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
|
|
|
|
- for (let paperDetil of this.paper.paperDetails) {
|
|
|
|
- this.showQuestions.push({ is_show: true });
|
|
|
|
- this.showButtons.push({ up: true });
|
|
|
|
- paperDetil.pubCount = 0;
|
|
|
|
- paperDetil.noPubCount = 0;
|
|
|
|
- if (
|
|
|
|
- paperDetil.paperDetailUnits &&
|
|
|
|
- paperDetil.paperDetailUnits.length > 0
|
|
|
|
- ) {
|
|
|
|
- for (let paperDetilUt of paperDetil.paperDetailUnits) {
|
|
|
|
- if (
|
|
|
|
- paperDetilUt.question.questionType != "NESTED_ANSWER_QUESTION"
|
|
|
|
- ) {
|
|
|
|
- //非套题
|
|
|
|
- if (paperDetilUt.question.publicity) {
|
|
|
|
- paperDetil.pubCount = paperDetil.pubCount + 1;
|
|
|
|
- } else {
|
|
|
|
- paperDetil.noPubCount = paperDetil.noPubCount + 1;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- //循环所有子题
|
|
|
|
- for (let ques of paperDetilUt.question.subQuestions) {
|
|
|
|
- if (ques.publicity) {
|
|
|
|
|
|
+ this.$http
|
|
|
|
+ .get(QUESTION_API + "/paper/" + this.paperId)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.paper = response.data;
|
|
|
|
+ //查询所有课程属性名
|
|
|
|
+ this.initCourseProperty(this.paper.course.code);
|
|
|
|
+ //将所有小题分为公开和非公开
|
|
|
|
+ if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
|
|
|
|
+ for (let paperDetil of this.paper.paperDetails) {
|
|
|
|
+ this.showQuestions.push({ is_show: true });
|
|
|
|
+ this.showButtons.push({ up: true });
|
|
|
|
+ paperDetil.pubCount = 0;
|
|
|
|
+ paperDetil.noPubCount = 0;
|
|
|
|
+ if (
|
|
|
|
+ paperDetil.paperDetailUnits &&
|
|
|
|
+ paperDetil.paperDetailUnits.length > 0
|
|
|
|
+ ) {
|
|
|
|
+ for (let paperDetilUt of paperDetil.paperDetailUnits) {
|
|
|
|
+ if (
|
|
|
|
+ paperDetilUt.question.questionType !=
|
|
|
|
+ "NESTED_ANSWER_QUESTION"
|
|
|
|
+ ) {
|
|
|
|
+ //非套题
|
|
|
|
+ if (paperDetilUt.question.publicity) {
|
|
paperDetil.pubCount = paperDetil.pubCount + 1;
|
|
paperDetil.pubCount = paperDetil.pubCount + 1;
|
|
} else {
|
|
} else {
|
|
paperDetil.noPubCount = paperDetil.noPubCount + 1;
|
|
paperDetil.noPubCount = paperDetil.noPubCount + 1;
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ //循环所有子题
|
|
|
|
+ for (let ques of paperDetilUt.question.subQuestions) {
|
|
|
|
+ if (ques.publicity) {
|
|
|
|
+ paperDetil.pubCount = paperDetil.pubCount + 1;
|
|
|
|
+ } else {
|
|
|
|
+ paperDetil.noPubCount = paperDetil.noPubCount + 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- setTimeout(() => {
|
|
|
|
- document.documentElement.scrollTop = document.body.scrollTop = scrollPosition;
|
|
|
|
- console.log(scrollPosition);
|
|
|
|
- }, 1000);
|
|
|
|
- this.loading = false;
|
|
|
|
- });
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ document.documentElement.scrollTop = document.body.scrollTop = scrollPosition;
|
|
|
|
+ console.log(scrollPosition);
|
|
|
|
+ }, 1000);
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
//查询所有课程属性名
|
|
//查询所有课程属性名
|
|
initCourseProperty(courseCode) {
|
|
initCourseProperty(courseCode) {
|
|
this.$http
|
|
this.$http
|
|
.get(QUESTION_API + "/courseProperty/enable/" + courseCode)
|
|
.get(QUESTION_API + "/courseProperty/enable/" + courseCode)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
this.coursePropertyList = response.data;
|
|
this.coursePropertyList = response.data;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -1105,7 +1118,7 @@ export default {
|
|
if (count == 0) {
|
|
if (count == 0) {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
- callback: action => {
|
|
|
|
|
|
+ callback: (action) => {
|
|
if (action == "confirm") {
|
|
if (action == "confirm") {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$http
|
|
this.$http
|
|
@@ -1115,17 +1128,17 @@ export default {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$alert("大题下还有小题,不可删除!", "提示", {
|
|
this.$alert("大题下还有小题,不可删除!", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
- callback: () => {}
|
|
|
|
|
|
+ callback: () => {},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1298,7 +1311,7 @@ export default {
|
|
if (courseProperty.name == this.coursePropertyName) {
|
|
if (courseProperty.name == this.coursePropertyName) {
|
|
this.$http
|
|
this.$http
|
|
.get(QUESTION_API + "/property/first/" + courseProperty.id)
|
|
.get(QUESTION_API + "/property/first/" + courseProperty.id)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
this.firstPropertyList = response.data;
|
|
this.firstPropertyList = response.data;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1311,7 +1324,7 @@ export default {
|
|
if (this.firstPropertyId) {
|
|
if (this.firstPropertyId) {
|
|
this.$http
|
|
this.$http
|
|
.get(QUESTION_API + "/property/second/" + this.firstPropertyId)
|
|
.get(QUESTION_API + "/property/second/" + this.firstPropertyId)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
this.secondPropertyList = response.data;
|
|
this.secondPropertyList = response.data;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1325,7 +1338,7 @@ export default {
|
|
id: "",
|
|
id: "",
|
|
coursePropertyName: "",
|
|
coursePropertyName: "",
|
|
firstProperty: {},
|
|
firstProperty: {},
|
|
- secondProperty: {}
|
|
|
|
|
|
+ secondProperty: {},
|
|
};
|
|
};
|
|
if (
|
|
if (
|
|
this.quesModel.quesProperties == null ||
|
|
this.quesModel.quesProperties == null ||
|
|
@@ -1347,7 +1360,7 @@ export default {
|
|
if (quesPro.id == quesProperty.id) {
|
|
if (quesPro.id == quesProperty.id) {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "该属性已存在,请重新选择",
|
|
message: "该属性已存在,请重新选择",
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1367,7 +1380,7 @@ export default {
|
|
if (!this.secondPropertyId) {
|
|
if (!this.secondPropertyId) {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "请选择二级属性",
|
|
message: "请选择二级属性",
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1392,14 +1405,14 @@ export default {
|
|
if (!this.coursePropertyName) {
|
|
if (!this.coursePropertyName) {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "请选择属性",
|
|
message: "请选择属性",
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
if (!this.firstPropertyId) {
|
|
if (!this.firstPropertyId) {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "请选择一级属性",
|
|
message: "请选择一级属性",
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1434,7 +1447,7 @@ export default {
|
|
this.quesModel.quesOptions.push({
|
|
this.quesModel.quesOptions.push({
|
|
number: "",
|
|
number: "",
|
|
optionBody: "",
|
|
optionBody: "",
|
|
- isCorrect: ""
|
|
|
|
|
|
+ isCorrect: "",
|
|
});
|
|
});
|
|
for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
|
|
for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
|
|
this.quesModel.quesOptions[i]["number"] = i + 1;
|
|
this.quesModel.quesOptions[i]["number"] = i + 1;
|
|
@@ -1458,14 +1471,14 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "分数只能为正数",
|
|
message: "分数只能为正数",
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let paperDetailUnitExp = {
|
|
let paperDetailUnitExp = {
|
|
id: this.editPaperDetailUnit.id,
|
|
id: this.editPaperDetailUnit.id,
|
|
question: this.quesModel,
|
|
question: this.quesModel,
|
|
- score: this.quesModel.score
|
|
|
|
|
|
+ score: this.quesModel.score,
|
|
};
|
|
};
|
|
if (
|
|
if (
|
|
this.quesModel.quesOptions &&
|
|
this.quesModel.quesOptions &&
|
|
@@ -1474,12 +1487,12 @@ export default {
|
|
this.$confirm("无选项将删除该试题, 是否继续?", "提示", {
|
|
this.$confirm("无选项将删除该试题, 是否继续?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
- type: "warning"
|
|
|
|
|
|
+ type: "warning",
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.dialogLoading = true;
|
|
this.dialogLoading = true;
|
|
this.$http
|
|
this.$http
|
|
.delete(QUESTION_API + "/paper/deleteQuestion/" + this.quesModel.id)
|
|
.delete(QUESTION_API + "/paper/deleteQuestion/" + this.quesModel.id)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
if (response.data.length > 0) {
|
|
if (response.data.length > 0) {
|
|
var deleteInfo =
|
|
var deleteInfo =
|
|
"该试题被试卷:" +
|
|
"该试题被试卷:" +
|
|
@@ -1487,12 +1500,12 @@ export default {
|
|
"使用,不能删除";
|
|
"使用,不能删除";
|
|
this.$notify({
|
|
this.$notify({
|
|
message: deleteInfo,
|
|
message: deleteInfo,
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "保存成功",
|
|
message: "保存成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.dialogLoading = false;
|
|
this.dialogLoading = false;
|
|
@@ -1505,17 +1518,17 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "保存成功",
|
|
message: "保存成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.dialogLoading = false;
|
|
this.dialogLoading = false;
|
|
this.closeQuesDialog();
|
|
this.closeQuesDialog();
|
|
this.initPaper();
|
|
this.initPaper();
|
|
})
|
|
})
|
|
- .catch(err => {
|
|
|
|
|
|
+ .catch((err) => {
|
|
this.dialogLoading = false;
|
|
this.dialogLoading = false;
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "error",
|
|
type: "error",
|
|
- message: err.response.data.desc
|
|
|
|
|
|
+ message: err.response.data.desc,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -1554,7 +1567,7 @@ export default {
|
|
deleteQues01(paperDetailUnitId) {
|
|
deleteQues01(paperDetailUnitId) {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
- callback: action => {
|
|
|
|
|
|
+ callback: (action) => {
|
|
if (action == "confirm") {
|
|
if (action == "confirm") {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$http
|
|
this.$http
|
|
@@ -1566,23 +1579,23 @@ export default {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
deleteQues02(questionId) {
|
|
deleteQues02(questionId) {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
this.$alert("您确定删除吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
- callback: action => {
|
|
|
|
|
|
+ callback: (action) => {
|
|
if (action == "confirm") {
|
|
if (action == "confirm") {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$http
|
|
this.$http
|
|
.delete(QUESTION_API + "/paper/deleteQuestion/" + questionId)
|
|
.delete(QUESTION_API + "/paper/deleteQuestion/" + questionId)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
if (response.data.length > 0) {
|
|
if (response.data.length > 0) {
|
|
var deleteInfo =
|
|
var deleteInfo =
|
|
"该试题被试卷:" +
|
|
"该试题被试卷:" +
|
|
@@ -1590,7 +1603,7 @@ export default {
|
|
"使用,不能删除";
|
|
"使用,不能删除";
|
|
this.$notify({
|
|
this.$notify({
|
|
message: deleteInfo,
|
|
message: deleteInfo,
|
|
- type: "error"
|
|
|
|
|
|
+ type: "error",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.initPaper();
|
|
this.initPaper();
|
|
@@ -1599,13 +1612,13 @@ export default {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "保存成功",
|
|
message: "保存成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//获取重复试题
|
|
//获取重复试题
|
|
@@ -1613,7 +1626,7 @@ export default {
|
|
this.duplicateLoading = true;
|
|
this.duplicateLoading = true;
|
|
this.$http
|
|
this.$http
|
|
.get(QUESTION_API + "/paper/" + this.paperId + "/reduplicate-questions")
|
|
.get(QUESTION_API + "/paper/" + this.paperId + "/reduplicate-questions")
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
this.reduplicateQuestions = response.data;
|
|
this.reduplicateQuestions = response.data;
|
|
this.duplicateLoading = false;
|
|
this.duplicateLoading = false;
|
|
this.initReduplicateQuesColor();
|
|
this.initReduplicateQuesColor();
|
|
@@ -1639,7 +1652,7 @@ export default {
|
|
if (colorCount > 20) {
|
|
if (colorCount > 20) {
|
|
this.reduplicateQuesColor = randomColor({
|
|
this.reduplicateQuesColor = randomColor({
|
|
luminosity: "bright",
|
|
luminosity: "bright",
|
|
- count: colorCount
|
|
|
|
|
|
+ count: colorCount,
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.reduplicateQuesColor = this.defaultColor;
|
|
this.reduplicateQuesColor = this.defaultColor;
|
|
@@ -1676,38 +1689,38 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "保存成功",
|
|
message: "保存成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.initPaper();
|
|
this.initPaper();
|
|
})
|
|
})
|
|
- .catch(error => {
|
|
|
|
|
|
+ .catch((error) => {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "error",
|
|
type: "error",
|
|
- message: error.response.data.desc
|
|
|
|
|
|
+ message: error.response.data.desc,
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//删除试卷
|
|
//删除试卷
|
|
deletePaper(id) {
|
|
deletePaper(id) {
|
|
this.$confirm("确认删除试卷吗?", "提示", {
|
|
this.$confirm("确认删除试卷吗?", "提示", {
|
|
- type: "warning"
|
|
|
|
|
|
+ type: "warning",
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.$http.delete(QUESTION_API + "/paper/" + id).then(
|
|
this.$http.delete(QUESTION_API + "/paper/" + id).then(
|
|
() => {
|
|
() => {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: "删除成功",
|
|
message: "删除成功",
|
|
- type: "success"
|
|
|
|
|
|
+ type: "success",
|
|
});
|
|
});
|
|
this.back();
|
|
this.back();
|
|
},
|
|
},
|
|
- error => {
|
|
|
|
|
|
+ (error) => {
|
|
this.$notify({
|
|
this.$notify({
|
|
message: error.response.data.desc,
|
|
message: error.response.data.desc,
|
|
type: "error",
|
|
type: "error",
|
|
- title: "错误"
|
|
|
|
|
|
+ title: "错误",
|
|
});
|
|
});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
}
|
|
}
|
|
@@ -1732,11 +1745,11 @@ export default {
|
|
back() {
|
|
back() {
|
|
if (sessionStorage.getItem("question_back") == "true") {
|
|
if (sessionStorage.getItem("question_back") == "true") {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: "/questions/" + this.parentView + "/0"
|
|
|
|
|
|
+ path: "/questions/" + this.parentView + "/0",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: "/questions/" + this.parentView + "/1"
|
|
|
|
|
|
+ path: "/questions/" + this.parentView + "/1",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1789,7 +1802,7 @@ export default {
|
|
QUESTION_API + "/checkRadioFile/" + this.paperId,
|
|
QUESTION_API + "/checkRadioFile/" + this.paperId,
|
|
this.fileNameList
|
|
this.fileNameList
|
|
)
|
|
)
|
|
- .then(response => {
|
|
|
|
|
|
+ .then((response) => {
|
|
console.log("response:", response);
|
|
console.log("response:", response);
|
|
this.message = response.data.errorMsg;
|
|
this.message = response.data.errorMsg;
|
|
if (this.message == "OK") {
|
|
if (this.message == "OK") {
|
|
@@ -1799,7 +1812,7 @@ export default {
|
|
this.isUpload = true;
|
|
this.isUpload = true;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- .catch(error => {
|
|
|
|
|
|
+ .catch((error) => {
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -1813,7 +1826,7 @@ export default {
|
|
param.append("files", file, file.name);
|
|
param.append("files", file, file.name);
|
|
}
|
|
}
|
|
let config = {
|
|
let config = {
|
|
- headers: { "Content-Type": "multipart/form-data" }
|
|
|
|
|
|
+ headers: { "Content-Type": "multipart/form-data" },
|
|
};
|
|
};
|
|
this.$http
|
|
this.$http
|
|
.post(QUESTION_API + "/uploadRadio/" + this.paperId, param, config)
|
|
.post(QUESTION_API + "/uploadRadio/" + this.paperId, param, config)
|
|
@@ -1825,15 +1838,15 @@ export default {
|
|
document.getElementById("radioFile").value = "";
|
|
document.getElementById("radioFile").value = "";
|
|
this.initPaper();
|
|
this.initPaper();
|
|
})
|
|
})
|
|
- .catch(error => {
|
|
|
|
|
|
+ .catch((error) => {
|
|
this.message = error.response.data.desc;
|
|
this.message = error.response.data.desc;
|
|
this.uploadAudioLoading = false;
|
|
this.uploadAudioLoading = false;
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
- user: state => state.user
|
|
|
|
|
|
+ user: (state) => state.user,
|
|
}),
|
|
}),
|
|
updatePorperty() {
|
|
updatePorperty() {
|
|
if (this.parentView === "gen_paper") {
|
|
if (this.parentView === "gen_paper") {
|
|
@@ -1849,7 +1862,7 @@ export default {
|
|
return obj.sort().toString();
|
|
return obj.sort().toString();
|
|
}
|
|
}
|
|
return this.quesModel.quesAnswer;
|
|
return this.quesModel.quesAnswer;
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
created() {
|
|
created() {
|
|
@@ -1862,10 +1875,10 @@ export default {
|
|
this.uploadAction = QUESTION_API + "/uploadRadio/" + this.paperId;
|
|
this.uploadAction = QUESTION_API + "/uploadRadio/" + this.paperId;
|
|
this.uploadHeaders = {
|
|
this.uploadHeaders = {
|
|
key: this.user.key,
|
|
key: this.user.key,
|
|
- token: this.user.token
|
|
|
|
|
|
+ token: this.user.token,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {}
|
|
|
|
|
|
+ mounted() {},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style scoped src="../styles/EditPaper.css">
|
|
<style scoped src="../styles/EditPaper.css">
|