|
@@ -313,7 +313,6 @@
|
|
|
}
|
|
|
|
|
|
// 如果自定义插入的是作文题 则进行对应题型渲染
|
|
|
- console.log('插入的主观题',subjectiveItem)
|
|
|
if(subjectiveItem.maxWords > 0){
|
|
|
this.myEditor.txt.clear()
|
|
|
addStr = '<p>' + itemOrder + "、 作文(" + (subjectiveItem.score + "分)") + '</p>';
|
|
@@ -349,18 +348,22 @@
|
|
|
let isNewPage = this.$store.state.answerSheet.isNewPage;
|
|
|
let lastBottomGap = 20;
|
|
|
let rectTop = editorDom.getBoundingClientRect().top
|
|
|
- let Y = rectTop + scrollDis - 90;
|
|
|
+ let Y = scrollDis > 90 ? scrollDis - Math.abs(rectTop) - 90 : rectTop + scrollDis - 90;
|
|
|
let paperH = PAPER_H;
|
|
|
let curEditorY = Y > paperH ? +((Y % paperH).toFixed(4)) : Y;
|
|
|
let curEditorH = editorDom.clientHeight; // 默认200px
|
|
|
- console.log(itemOrder, 'rectTop', rectTop);
|
|
|
- console.log(itemOrder, 'scrollDis', scrollDis);
|
|
|
- console.log(itemOrder, '当前Y', Y);
|
|
|
let leftHeight = paperH - curEditorY - lastBottomGap - SVG_BORDER_MB;
|
|
|
- console.log(itemOrder, '高度', curEditorH)
|
|
|
- console.log(itemOrder, 'LEFT高度', leftHeight)
|
|
|
let fixHeight = curEditorH - leftHeight + 20
|
|
|
- console.log(itemOrder, '需要fix的高度', fixHeight)
|
|
|
+ if(itemOrder === 6){
|
|
|
+ console.log(itemOrder, 'rectTop', rectTop);
|
|
|
+ console.log(itemOrder, 'scrollDis', scrollDis);
|
|
|
+ console.log(itemOrder, '距离第一页顶点的Y', Y);
|
|
|
+ console.log(itemOrder, '距离当前页面顶点的Y', curEditorY);
|
|
|
+ console.log(itemOrder, '高度', curEditorH)
|
|
|
+ console.log(itemOrder, 'LEFT高度', leftHeight)
|
|
|
+ console.log(itemOrder, '需要fix的高度', fixHeight)
|
|
|
+ }
|
|
|
+
|
|
|
// 如果 渲染当前富文本的时候 需要渲染的高度超过当前页的剩余高度 则需要进行加页处理
|
|
|
if (curEditorY + curEditorH + lastBottomGap + SVG_BORDER_MB > PAPER_H) {
|
|
|
// console.log(itemOrder, Y , curEditorY , curEditorH , '超出了')
|
|
@@ -373,8 +376,8 @@
|
|
|
heightArr.push(leftHeight)
|
|
|
// 如果渲染的客观题高度在这个区间 才需要在下一页添加补充作答区域 其余全部按照正常 跨页处理不需要补充作答区域
|
|
|
let fixCount = Math.ceil(fixHeight / SVG_BORDER_PROP.height)
|
|
|
- console.log(itemOrder + "需要处理跨页,数量为" + fixCount);
|
|
|
- console.log(itemOrder + "剩余渲染高度" + fixHeight);
|
|
|
+ // console.log(itemOrder + "需要处理跨页,数量为" + fixCount);
|
|
|
+ // console.log(itemOrder + "剩余渲染高度" + fixHeight);
|
|
|
for(let i = 0;i < fixCount;i++){
|
|
|
this.fixArr.push(0)
|
|
|
let curFixHeight = fixHeight > SVG_BORDER_PROP.height ? SVG_BORDER_PROP.height - 30 : fixHeight
|
|
@@ -388,8 +391,8 @@
|
|
|
this.$nextTick(() => {
|
|
|
let splitHtmlArr = this.getSplitHtml(this.pArr,heightArr)
|
|
|
splitHtmlArr.forEach((curEditorContent,editorIndex) => {
|
|
|
- console.log('富文本的分割高度',heightArr)
|
|
|
- console.log('富文本的分割',splitHtmlArr)
|
|
|
+ // console.log('富文本的分割高度',heightArr)
|
|
|
+ // console.log('富文本的分割',splitHtmlArr)
|
|
|
|
|
|
let editorHeight = curEditorContent.html === '' ? heightArr[editorIndex] : heightArr[editorIndex]
|
|
|
// let curEditorContent = this.getSplitHtml(this.pArr,curEditorHeight)
|
|
@@ -902,7 +905,7 @@
|
|
|
top: 10px;
|
|
|
font-size: 12px;
|
|
|
background-color: orangered;
|
|
|
- display: inline-flex;
|
|
|
+ display: none;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
color: #fff;
|