|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="edit-paper">
|
|
|
+ <div class="edit-paper" ref="editPaper">
|
|
|
<div class="edit-header">
|
|
|
<div class="edit-header-top box-justify">
|
|
|
<div class="header-info">
|
|
@@ -886,7 +886,7 @@ export default {
|
|
|
this.initPaper();
|
|
|
},
|
|
|
methods: {
|
|
|
- async initPaper() {
|
|
|
+ async initPaper(bool) {
|
|
|
const res = await paperDetailApi(this.paperId);
|
|
|
res.data.paperDetails.forEach((detail) => {
|
|
|
detail.showQuestions = true;
|
|
@@ -897,7 +897,15 @@ export default {
|
|
|
this.paper = res.data;
|
|
|
this.paper.title = this.paper.title || this.paper.name;
|
|
|
this.showCheckDuplicate();
|
|
|
-
|
|
|
+ if (bool) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.editPaper.scrollTo({
|
|
|
+ left: 0,
|
|
|
+ top: 100000,
|
|
|
+ behavior: "smooth",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
if (!this.checkPaperQuestionAllHasScore()) {
|
|
|
this.$notify.error("有小题未设置分值!");
|
|
|
}
|
|
@@ -1107,6 +1115,7 @@ export default {
|
|
|
}).catch(() => {});
|
|
|
if (!res) return;
|
|
|
this.$message.success("新增成功!");
|
|
|
+ this.initPaper(true);
|
|
|
} else {
|
|
|
detail.name = detail.detailName;
|
|
|
const res = await paperDetailUpdateApi(this.paperId, detail).catch(
|
|
@@ -1115,6 +1124,7 @@ export default {
|
|
|
|
|
|
if (!res) return;
|
|
|
this.$message.success("修改成功!");
|
|
|
+ this.initPaper();
|
|
|
}
|
|
|
|
|
|
// const paperDetail = this.paper.paperDetails.find(
|
|
@@ -1123,7 +1133,6 @@ export default {
|
|
|
// if (!paperDetail) return;
|
|
|
// paperDetail.name = detail.detailName;
|
|
|
// paperDetail.description = detail.description;
|
|
|
- this.initPaper();
|
|
|
},
|
|
|
// 移动大题
|
|
|
async toMovePaperDetail(detail, vector) {
|
|
@@ -1280,6 +1289,8 @@ export default {
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.edit-paper {
|
|
|
+ height: 100vh;
|
|
|
+ overflow: auto;
|
|
|
.edit-part {
|
|
|
&.level2 {
|
|
|
padding-bottom: 60px;
|