完善宣教库
This commit is contained in:
parent
1200a83f93
commit
2c8efad8a0
@ -324,6 +324,9 @@ export default {
|
|||||||
this.Quill = null;
|
this.Quill = null;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getEditor() {
|
||||||
|
return this.Quill;
|
||||||
|
},
|
||||||
// 分页
|
// 分页
|
||||||
updateCPagefour(index, size) {
|
updateCPagefour(index, size) {
|
||||||
this.querymaterial.pageNum = index
|
this.querymaterial.pageNum = index
|
||||||
@ -571,6 +574,11 @@ button.ql-scmages {
|
|||||||
margin-left: -14px;
|
margin-left: -14px;
|
||||||
margin-top: -8px;
|
margin-top: -8px;
|
||||||
width: 24px !important;
|
width: 24px !important;
|
||||||
|
cursor: none;
|
||||||
|
-webkit-user-select: none; /* 针对WebKit浏览器的兼容性设置 */
|
||||||
|
-moz-user-select: none; /* 针对Firefox浏览器的兼容性设置 */
|
||||||
|
-ms-user-select: none; /* 针对IE浏览器的兼容性设置 */
|
||||||
|
user-select: none; /* 标准属性 */
|
||||||
}
|
}
|
||||||
.bodytopxjsc {
|
.bodytopxjsc {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -452,7 +452,7 @@
|
|||||||
<el-form-item label="正文内容" prop="propagandaContent" v-if="open">
|
<el-form-item label="正文内容" prop="propagandaContent" v-if="open">
|
||||||
<editor
|
<editor
|
||||||
id="id"
|
id="id"
|
||||||
ref="myTextarea"
|
ref="quillEditor"
|
||||||
v-model="form.propagandaContent"
|
v-model="form.propagandaContent"
|
||||||
:min-height="192"
|
:min-height="192"
|
||||||
style="width: 800px"
|
style="width: 800px"
|
||||||
@ -562,7 +562,7 @@
|
|||||||
append-to-body
|
append-to-body
|
||||||
:before-close="canceldiseases"
|
:before-close="canceldiseases"
|
||||||
>
|
>
|
||||||
<div style="padding-bottom: 23px;">
|
<div style="padding-bottom: 23px">
|
||||||
<el-form
|
<el-form
|
||||||
ref="queryForm"
|
ref="queryForm"
|
||||||
:model="querydisease"
|
:model="querydisease"
|
||||||
@ -570,7 +570,11 @@
|
|||||||
label-width="80px"
|
label-width="80px"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
>
|
>
|
||||||
<el-form-item label="病种名称" prop="diseaseTypeName" label-width="120">
|
<el-form-item
|
||||||
|
label="病种名称"
|
||||||
|
prop="diseaseTypeName"
|
||||||
|
label-width="120"
|
||||||
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="querydisease.diseaseTypeName"
|
v-model="querydisease.diseaseTypeName"
|
||||||
placeholder="请输入病种名称"
|
placeholder="请输入病种名称"
|
||||||
@ -661,8 +665,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<img :src="baseUrl + formview.propagandaCoverPath" alt="" />
|
<img :src="baseUrl + formview.propagandaCoverPath" alt="" />
|
||||||
<div class="know">知识卡片</div>
|
<div class="know">知识卡片</div>
|
||||||
<div class="knowlist" v-html="formview.propagandaContent">
|
<div class="knowlist" v-html="formview.propagandaContent"></div>
|
||||||
</div> <!-- <Editorxj v-model="formview.propagandaContent" :min-height="192" /> -->
|
<!-- <Editorxj v-model="formview.propagandaContent" :min-height="192" /> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -1108,7 +1112,7 @@ export default {
|
|||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
// 粘贴事件
|
// 粘贴事件
|
||||||
handlePaste(event) {
|
async handlePaste(event) {
|
||||||
console.log(event, 'event')
|
console.log(event, 'event')
|
||||||
const clipboardData = event.clipboardData || window.clipboardData;
|
const clipboardData = event.clipboardData || window.clipboardData;
|
||||||
const pastedText = clipboardData.getData('text');
|
const pastedText = clipboardData.getData('text');
|
||||||
@ -1124,15 +1128,30 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event.preventDefault();
|
const editor = this.$refs.quillEditor.getEditor();
|
||||||
// 将粘贴的文本插入到编辑器中
|
let length = editor.selection.savedRange.index;
|
||||||
event.target.outerText += pastedText;
|
const text = clipboardData.getData('text/plain');
|
||||||
// 光标聚焦到末尾
|
// 在光标位置插入文本,text为需要插入的文本
|
||||||
const dom = document.getElementById('id')
|
console.log(text, 'length + text.length')
|
||||||
dom && dom.focus()
|
editor.insertEmbed(length, text);
|
||||||
// document.execCommand('selectAll', false, null);
|
|
||||||
// document.getSelection().collapseToEnd();
|
await setTimeout(() => {
|
||||||
console.log(event, '222222222222222')
|
// 将光标移动到插入文本的末尾
|
||||||
|
editor.setSelection(length + text.length);
|
||||||
|
}, 10); // 使用 setTimeout 确保操作顺序
|
||||||
|
|
||||||
|
// editor.insertText(range.index, text);
|
||||||
|
// editor.setSelection(range.index + text.length);
|
||||||
|
// // 获取粘贴的文本内容
|
||||||
|
// event.preventDefault();
|
||||||
|
// // 将粘贴的文本插入到编辑器中
|
||||||
|
// event.target.outerText += pastedText;
|
||||||
|
// // 光标聚焦到末尾
|
||||||
|
// const dom = document.getElementById('id')
|
||||||
|
// dom && dom.focus()
|
||||||
|
// // document.execCommand('selectAll', false, null);
|
||||||
|
// // document.getSelection().collapseToEnd();
|
||||||
|
// console.log(event, '222222222222222')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// checkContentLength(event) {
|
// checkContentLength(event) {
|
||||||
@ -1622,12 +1641,9 @@ export default {
|
|||||||
::v-deep .ql-video {
|
::v-deep .ql-video {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
::v-deep .el-dialog__body
|
::v-deep .el-dialog__body {
|
||||||
{
|
|
||||||
padding-top: 10px !important;
|
padding-top: 10px !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.articleSummary {
|
.articleSummary {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user