|
@@ -5,10 +5,12 @@
|
|
<span class="select-model btn-delete" @click="onDeleteBlock" v-if="!isAutoCreate">删除</span>
|
|
<span class="select-model btn-delete" @click="onDeleteBlock" v-if="!isAutoCreate">删除</span>
|
|
</div>
|
|
</div>
|
|
<p class="margin-block"></p>
|
|
<p class="margin-block"></p>
|
|
- <!-- <div @mouseenter="isShowTools = true" @mouseleave="isShowTools = false"> -->
|
|
|
|
<div >
|
|
<div >
|
|
<div :id="ids" class="sheet-Editor" ></div>
|
|
<div :id="ids" class="sheet-Editor" ></div>
|
|
- <div v-for="(item,index) in fixArr" :id="ids + 'fix' + index" class="sheet-Editor"></div>
|
|
|
|
|
|
+ <div v-for="(item,index) in fixArr" :key="index" class="sheet-fix-Editor">
|
|
|
|
+ <div :id="ids + 'fix' + index" class="sheet-Editor"></div>
|
|
|
|
+ <span :id="ids + 'fix' + index + 'btn'" class="btn-delete-fix" @click="onDeleteFixBlock(ids + 'fix' + index)">删除</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<Modal v-model="isShowSelectModel" title="设置内容格式" width="600px" @on-ok="doSelectModel">
|
|
<Modal v-model="isShowSelectModel" title="设置内容格式" width="600px" @on-ok="doSelectModel">
|
|
@@ -112,6 +114,13 @@
|
|
this.$EventBus.$emit('doRefresh')
|
|
this.$EventBus.$emit('doRefresh')
|
|
this.$EventBus.$emit('deleteItem',this.type)
|
|
this.$EventBus.$emit('deleteItem',this.type)
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ /* 删除附加答题区域富文本块 */
|
|
|
|
+ onDeleteFixBlock(curId){
|
|
|
|
+ document.getElementById(curId).remove()
|
|
|
|
+ document.getElementById(curId + 'btn').remove()
|
|
|
|
+ this.$EventBus.$emit('doRefresh')
|
|
|
|
+ },
|
|
|
|
|
|
/* 切换富文本显示模式(简答题、语文作文、英语作文)*/
|
|
/* 切换富文本显示模式(简答题、语文作文、英语作文)*/
|
|
doSelectModel() {
|
|
doSelectModel() {
|
|
@@ -220,6 +229,7 @@
|
|
let lastBottomGap = 20;
|
|
let lastBottomGap = 20;
|
|
let curEditorY = Y > paperH ? +((Y % paperH).toFixed(4)) : Y;
|
|
let curEditorY = Y > paperH ? +((Y % paperH).toFixed(4)) : Y;
|
|
let curEditorH = editorDom.clientHeight;
|
|
let curEditorH = editorDom.clientHeight;
|
|
|
|
+
|
|
let leftHeight = paperH - curEditorY - lastBottomGap - SVG_BORDER_MB;
|
|
let leftHeight = paperH - curEditorY - lastBottomGap - SVG_BORDER_MB;
|
|
let fixHeight = curEditorH - leftHeight + 20
|
|
let fixHeight = curEditorH - leftHeight + 20
|
|
if ( curEditorY + curEditorH + lastBottomGap + SVG_BORDER_MB > PAPER_H) {
|
|
if ( curEditorY + curEditorH + lastBottomGap + SVG_BORDER_MB > PAPER_H) {
|
|
@@ -295,7 +305,8 @@
|
|
|
|
|
|
// 如果vuex有保存 之前的文本内容 则渲染 否则按照默认只显示题号
|
|
// 如果vuex有保存 之前的文本内容 则渲染 否则按照默认只显示题号
|
|
let curSetting = this.hasEditorSetting(this.ids)
|
|
let curSetting = this.hasEditorSetting(this.ids)
|
|
- if (curSetting && curSetting.content) {
|
|
|
|
|
|
+ let hasVuexContent = curSetting && curSetting.content
|
|
|
|
+ if (hasVuexContent) {
|
|
this.myEditor.txt.append(curSetting.content);
|
|
this.myEditor.txt.append(curSetting.content);
|
|
}else{
|
|
}else{
|
|
this.myEditor.txt.append(addStr + brHtml);
|
|
this.myEditor.txt.append(addStr + brHtml);
|
|
@@ -695,6 +706,7 @@
|
|
document
|
|
document
|
|
.getElementById(curId)
|
|
.getElementById(curId)
|
|
.getElementsByClassName("w-e-toolbar")[0].style.display = "flex";
|
|
.getElementsByClassName("w-e-toolbar")[0].style.display = "flex";
|
|
|
|
+ document.getElementById(curId + 'btn').style.display = "inline-flex";
|
|
};
|
|
};
|
|
editor.config.onblur = (html) => {
|
|
editor.config.onblur = (html) => {
|
|
let scrollHeight = editor.$textElem.elems[0].scrollHeight
|
|
let scrollHeight = editor.$textElem.elems[0].scrollHeight
|
|
@@ -705,7 +717,8 @@
|
|
// this.$EventBus.$emit('doRefresh')
|
|
// this.$EventBus.$emit('doRefresh')
|
|
}
|
|
}
|
|
document.getElementById(curId) && (document.getElementById(curId).getElementsByClassName(
|
|
document.getElementById(curId) && (document.getElementById(curId).getElementsByClassName(
|
|
- "w-e-toolbar")[0].style.display = "none");
|
|
|
|
|
|
+ "w-e-toolbar")[0].style.display = "none") && (document.getElementById(curId + 'btn').style.display = "none")
|
|
|
|
+
|
|
this.$store.commit('setEditorHeight', {
|
|
this.$store.commit('setEditorHeight', {
|
|
id: curId,
|
|
id: curId,
|
|
height: editor.config.height,
|
|
height: editor.config.height,
|
|
@@ -757,21 +770,6 @@
|
|
);
|
|
);
|
|
this.curPropItem = this.type === "0" ? this.completeItems : n;
|
|
this.curPropItem = this.type === "0" ? this.completeItems : n;
|
|
this.doRenderEditor(this.curPropItem);
|
|
this.doRenderEditor(this.curPropItem);
|
|
- if(this.type !== "0"){
|
|
|
|
- // setTimeout(() => {
|
|
|
|
- // if(n[0].maxWords > 0){
|
|
|
|
- // console.log('语文作文',n.maxWords)
|
|
|
|
- // this.wordCount = n[0].maxWords
|
|
|
|
- // this.curModel = '3'
|
|
|
|
- // this.doSelectModel()
|
|
|
|
- // }else if(n[0].maxLines > 0){
|
|
|
|
- // console.log('英语作文',n.maxLines)
|
|
|
|
- // this.lineCount = n[0].maxLines
|
|
|
|
- // this.curModel = '2'
|
|
|
|
- // this.doSelectModel()
|
|
|
|
- // }
|
|
|
|
- // },3000)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
immediate: true,
|
|
immediate: true,
|
|
@@ -892,4 +890,23 @@
|
|
margin: 0 4px;
|
|
margin: 0 4px;
|
|
display: inline-block;
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .sheet-fix-Editor{
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .sheet-fix-Editor .btn-delete-fix{
|
|
|
|
+ position: absolute;
|
|
|
|
+ padding: 3px 10px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ right: 100px;
|
|
|
|
+ top: 10px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ background-color: orangered;
|
|
|
|
+ display: inline-flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ color: #fff;
|
|
|
|
+ z-index: 99;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|