|
@@ -267,13 +267,56 @@
|
|
@click="editQues(paperDetailUnit, paperDetailUnit.question)"
|
|
@click="editQues(paperDetailUnit, paperDetailUnit.question)"
|
|
>编辑
|
|
>编辑
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitUp(paperDetail, paperDetailUnit.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnit(
|
|
|
|
+ paperDetail.id,
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ 'up'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >上移
|
|
|
|
+ </el-button>
|
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitDown(paperDetail, paperDetailUnit.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnit(
|
|
|
|
+ paperDetail.id,
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ 'down'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >下移
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
type="danger"
|
|
type="danger"
|
|
size="small"
|
|
size="small"
|
|
@click="deleteQues(paperDetailUnit)"
|
|
@click="deleteQues(paperDetailUnit)"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="
|
|
|
|
+ isNested(paperDetailUnit.questionType) &&
|
|
|
|
+ showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
+ "
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-arrow-up"
|
|
|
|
+ @click.stop="hideSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="
|
|
|
|
+ isNested(paperDetailUnit.questionType) &&
|
|
|
|
+ !showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
+ "
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-arrow-down"
|
|
|
|
+ @click.stop="showSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
+ ></el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="quesBody">
|
|
<div class="quesBody">
|
|
@@ -329,7 +372,10 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="flex-basis: 100%"></div>
|
|
<div style="flex-basis: 100%"></div>
|
|
- <div class="sub-ques-main-div">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-show="showSubQuestions[detailIndex + '-' + unitIndex]"
|
|
|
|
+ class="sub-ques-main-div"
|
|
|
|
+ >
|
|
<div
|
|
<div
|
|
v-for="(subQuestion, subIndex) in paperDetailUnit.question
|
|
v-for="(subQuestion, subIndex) in paperDetailUnit.question
|
|
.subQuestions"
|
|
.subQuestions"
|
|
@@ -361,6 +407,31 @@
|
|
@click="editQues(paperDetailUnit, subQuestion)"
|
|
@click="editQues(paperDetailUnit, subQuestion)"
|
|
>编辑
|
|
>编辑
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitSubUp(paperDetailUnit, subQuestion.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnitSub(
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ subQuestion.id,
|
|
|
|
+ 'up'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >上移
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="showUnitSubDown(paperDetailUnit, subQuestion.id)"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="
|
|
|
|
+ movePaperDetailUnitSub(
|
|
|
|
+ paperDetailUnit.id,
|
|
|
|
+ subQuestion.id,
|
|
|
|
+ 'down'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ >下移
|
|
|
|
+ </el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="quesBody">
|
|
<div class="quesBody">
|
|
@@ -1140,6 +1211,8 @@ export default {
|
|
examRemark: "",
|
|
examRemark: "",
|
|
showQuestions: [],
|
|
showQuestions: [],
|
|
showButtons: [],
|
|
showButtons: [],
|
|
|
|
+ showSubQuestions: {},
|
|
|
|
+ showSubButtons: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -1243,6 +1316,111 @@ export default {
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
},
|
|
},
|
|
|
|
+ movePaperDetailUnitSub(unitid, subid, vector) {
|
|
|
|
+ let vectorStr = vector == "up" ? "上移" : "下移";
|
|
|
|
+ this.$alert("您确定" + vectorStr + "吗?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ if (action == "confirm") {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.$http
|
|
|
|
+ .put(
|
|
|
|
+ QUESTION_API +
|
|
|
|
+ "/paperDetailUnit/sub/" +
|
|
|
|
+ unitid +
|
|
|
|
+ "/" +
|
|
|
|
+ subid +
|
|
|
|
+ "/" +
|
|
|
|
+ vector
|
|
|
|
+ )
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.initPaper();
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: vectorStr + "成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ showUnitSubDown(unit, subid) {
|
|
|
|
+ if (unit.question.subQuestions.length <= 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ subid !=
|
|
|
|
+ unit.question.subQuestions[unit.question.subQuestions.length - 1].id
|
|
|
|
+ ) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showUnitSubUp(unit, subid) {
|
|
|
|
+ if (unit.question.subQuestions.length <= 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (subid != unit.question.subQuestions[0].id) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ movePaperDetailUnit(detailId, unitid, vector) {
|
|
|
|
+ let vectorStr = vector == "up" ? "上移" : "下移";
|
|
|
|
+ this.$alert("您确定" + vectorStr + "吗?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ callback: (action) => {
|
|
|
|
+ if (action == "confirm") {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.$http
|
|
|
|
+ .put(
|
|
|
|
+ QUESTION_API +
|
|
|
|
+ "/paperDetailUnit/" +
|
|
|
|
+ detailId +
|
|
|
|
+ "/" +
|
|
|
|
+ unitid +
|
|
|
|
+ "/" +
|
|
|
|
+ vector
|
|
|
|
+ )
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.initPaper();
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.$notify({
|
|
|
|
+ message: vectorStr + "成功",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ showUnitDown(detail, unitid) {
|
|
|
|
+ if (detail.paperDetailUnits.length <= 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ unitid != detail.paperDetailUnits[detail.paperDetailUnits.length - 1].id
|
|
|
|
+ ) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ showUnitUp(detail, unitid) {
|
|
|
|
+ if (detail.paperDetailUnits.length <= 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (unitid != detail.paperDetailUnits[0].id) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
movePaperDetail(detail, vector) {
|
|
movePaperDetail(detail, vector) {
|
|
let vectorStr = vector == "up" ? "上移" : "下移";
|
|
let vectorStr = vector == "up" ? "上移" : "下移";
|
|
this.$alert("您确定" + vectorStr + "吗?", "提示", {
|
|
this.$alert("您确定" + vectorStr + "吗?", "提示", {
|
|
@@ -1356,16 +1534,26 @@ export default {
|
|
},
|
|
},
|
|
//隐藏大题下的所有小题
|
|
//隐藏大题下的所有小题
|
|
hideContent(index) {
|
|
hideContent(index) {
|
|
- console.log("up");
|
|
|
|
this.showQuestions[index].is_show = false;
|
|
this.showQuestions[index].is_show = false;
|
|
this.showButtons[index].up = false;
|
|
this.showButtons[index].up = false;
|
|
},
|
|
},
|
|
//展开大题下所有小题
|
|
//展开大题下所有小题
|
|
showContent(index) {
|
|
showContent(index) {
|
|
- console.log("down");
|
|
|
|
this.showQuestions[index].is_show = true;
|
|
this.showQuestions[index].is_show = true;
|
|
this.showButtons[index].up = true;
|
|
this.showButtons[index].up = true;
|
|
},
|
|
},
|
|
|
|
+ //隐藏大题下的所有小题
|
|
|
|
+ hideSubContent(index) {
|
|
|
|
+ this.showSubQuestions[index] = false;
|
|
|
|
+ this.showSubButtons[index] = false;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ //展开大题下所有小题
|
|
|
|
+ showSubContent(index) {
|
|
|
|
+ this.showSubQuestions[index] = true;
|
|
|
|
+ this.showSubButtons[index] = true;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
quesMouseOver(index) {
|
|
quesMouseOver(index) {
|
|
document.getElementById(index).style.visibility = "visible";
|
|
document.getElementById(index).style.visibility = "visible";
|
|
},
|
|
},
|
|
@@ -1435,6 +1623,7 @@ export default {
|
|
this.initCourseProperty(this.paper.course.code);
|
|
this.initCourseProperty(this.paper.course.code);
|
|
//将所有小题分为公开和非公开
|
|
//将所有小题分为公开和非公开
|
|
if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
|
|
if (this.paper.paperDetails && this.paper.paperDetails.length > 0) {
|
|
|
|
+ let dindx = 0;
|
|
for (let paperDetil of this.paper.paperDetails) {
|
|
for (let paperDetil of this.paper.paperDetails) {
|
|
this.showQuestions.push({ is_show: true });
|
|
this.showQuestions.push({ is_show: true });
|
|
this.showButtons.push({ up: true });
|
|
this.showButtons.push({ up: true });
|
|
@@ -1444,7 +1633,10 @@ export default {
|
|
paperDetil.paperDetailUnits &&
|
|
paperDetil.paperDetailUnits &&
|
|
paperDetil.paperDetailUnits.length > 0
|
|
paperDetil.paperDetailUnits.length > 0
|
|
) {
|
|
) {
|
|
|
|
+ let uindx = 0;
|
|
for (let paperDetilUt of paperDetil.paperDetailUnits) {
|
|
for (let paperDetilUt of paperDetil.paperDetailUnits) {
|
|
|
|
+ this.showSubQuestions[dindx + "-" + uindx] = true;
|
|
|
|
+ this.showSubButtons[dindx + "-" + uindx] = true;
|
|
if (!this.isNested(paperDetilUt.question.questionType)) {
|
|
if (!this.isNested(paperDetilUt.question.questionType)) {
|
|
//非套题
|
|
//非套题
|
|
if (paperDetilUt.question.publicity) {
|
|
if (paperDetilUt.question.publicity) {
|
|
@@ -1462,8 +1654,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ uindx++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ dindx++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|