This commit is contained in:
zhaofang
2022-07-26 13:52:42 +08:00
parent 554c9cb972
commit 1de5397e14

View File

@@ -15,7 +15,7 @@
</div> </div>
<div style="padding-left: 10px;"> <div style="padding-left: 10px;">
<el-button @click="findCWare()" type="primary">搜索</el-button> <el-button @click="findCWare()" type="primary">搜索</el-button>
<el-button @click="closeCWareFind()" type="primary">返回</el-button> <el-button @click="closeCWareFind()" type="primary">重置</el-button>
</div> </div>
</div> </div>
<div style="text-align: center;padding-top: 10px;"> <div style="text-align: center;padding-top: 10px;">
@@ -83,7 +83,7 @@ const toolbarOptions = [
[{ align: [] }], // 对齐方式 [{ align: [] }], // 对齐方式
[{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }], [{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }],
["clean"], // 清除文本格式 ["clean"], // 清除文本格式
// ["link", "image"], ["link", "image"],
["selectPicture"], ["selectPicture"],
] ]
Quill.register({ 'formats/lineHeight': lineHeightStyle }, true) Quill.register({ 'formats/lineHeight': lineHeightStyle }, true)
@@ -117,7 +117,7 @@ export default {
data() { data() {
return { return {
getType, getType,
fileBaseUrl:this.$Constants.fileBaseUrl, fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
hasCWare:{ hasCWare:{
list:[], list:[],
keyword:'', keyword:'',
@@ -200,12 +200,13 @@ export default {
}, },
methods: { methods: {
closeCWareFind(){ closeCWareFind(){
this.hasCWare.keyword = '';
this.hasCWare.pageIndex = 1;
this.getCoursewareList();
}, },
chooseHasCWare(row){// 选中图片 chooseHasCWare(row){// 选中图片
let length = this.QuillObj.getSelection().index//光标位置 let length = this.QuillObj.getSelection().index//光标位置
// 插入图片 图片地址 // 插入图片 图片地址
console.log(this.fileBaseUrl + row.filePath,'this.fileBaseUrl + row.filePath');
this.QuillObj.insertEmbed(length, 'image', this.fileBaseUrl + row.filePath) this.QuillObj.insertEmbed(length, 'image', this.fileBaseUrl + row.filePath)
// 调整光标到最后 // 调整光标到最后
this.QuillObj.setSelection(length + 1)//光标后移一位 this.QuillObj.setSelection(length + 1)//光标后移一位