|
@@ -16,9 +16,11 @@
|
|
|
|
|
|
<div class="part-box part-box-pad group-body">
|
|
|
<el-table
|
|
|
+ ref="TableList"
|
|
|
:data="subjectiveTaskList"
|
|
|
border
|
|
|
:span-method="openMergeMarker ? objectSpanMethod : undefined"
|
|
|
+ :height="tableHeight"
|
|
|
>
|
|
|
<el-table-column label="大题名称" prop="mainTitle"> </el-table-column>
|
|
|
<el-table-column label="大题号" prop="mainNumber" width="80">
|
|
@@ -94,9 +96,15 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- subjective answer -->
|
|
|
- <el-form class="mt-2" label-width="150px">
|
|
|
+ <el-form
|
|
|
+ ref="subjectiveAnswerRef"
|
|
|
+ class="no-margin mt-2"
|
|
|
+ label-width="150px"
|
|
|
+ >
|
|
|
<el-form-item label="请上传标答PDF文档:">
|
|
|
- <mark-param-subjective-answer></mark-param-subjective-answer>
|
|
|
+ <mark-param-subjective-answer
|
|
|
+ @rendered="updateTableHeight"
|
|
|
+ ></mark-param-subjective-answer>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -164,6 +172,7 @@ export default {
|
|
|
paperList: [],
|
|
|
cardPages: [],
|
|
|
fillQuestionRanges: [],
|
|
|
+ tableHeight: 200,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -184,6 +193,7 @@ export default {
|
|
|
this.initFillQuestionRanges();
|
|
|
this.getPaperList();
|
|
|
this.getCardPages();
|
|
|
+ this.registResize();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations("markParam", [
|
|
@@ -468,6 +478,25 @@ export default {
|
|
|
if (!this.checkData()) return;
|
|
|
this.$emit("next", step);
|
|
|
},
|
|
|
+ // table height
|
|
|
+ updateTableHeight() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (!this.$refs.TableList) return;
|
|
|
+ const tableOffsetTop = this.$refs.TableList.$el.offsetTop;
|
|
|
+ const formHeight = this.$refs.subjectiveAnswerRef
|
|
|
+ ? this.$refs.subjectiveAnswerRef.$el.offsetHeight + 10
|
|
|
+ : 0;
|
|
|
+ this.tableHeight =
|
|
|
+ window.innerHeight - tableOffsetTop - formHeight - 50;
|
|
|
+ // console.log(this.tableHeight);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ registResize() {
|
|
|
+ window.addEventListener("resize", this.updateTableHeight);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ window.removeEventListener("resize", this.updateTableHeight);
|
|
|
},
|
|
|
};
|
|
|
</script>
|