提交 c8d57ec7 authored 作者: 龙菲's avatar 龙菲

新增引入笔记和引入原文

上级 e13b5c01
......@@ -41,15 +41,26 @@
</div>
<div class="origin oneRow">
<i class="el-icon-document"></i>
原文:{{item.noteContent}}
原文:{{ item.bookmarkContent }}
</div>
<div class="note twoRow">
<i class="el-icon-edit"></i>
笔记:{{ item.bookmarkContent }}
笔记:{{ item.noteContent }}
</div>
<div class="buttons">
<el-button type="primary" size="mini">引入笔记</el-button>
<el-button type="primary" size="mini" plain>引入原文</el-button>
<el-button
type="primary"
size="mini"
@click="handleInsertNote(item.noteContent)"
>引入笔记</el-button
>
<el-button
type="primary"
size="mini"
plain
@click="handleInsertOrigin(item.bookmarkContent)"
>引入原文</el-button
>
</div>
</el-card>
</div>
......@@ -73,7 +84,7 @@ export default {
// tagList: [],
};
},
mounted(){
mounted() {
// this.loadData()
},
methods: {
......@@ -85,6 +96,20 @@ export default {
this.noteList = res.data;
}
},
// 插入笔记
handleInsertNote(value) {
this.$emit("insertText", value);
// console.log("handleInsertNote");
// await this.wps
// .WordApplication()
// .ActiveDocument.ActiveWindow.Selection.InsertAfter(txt);
},
// 插入原文
handleInsertOrigin(value) {
// console.log("handleInsertOrigin");
this.$emit("insertText", value);
},
},
};
</script>
......
......@@ -3,7 +3,7 @@
<div class="left">
<div class="title">{{ currentTab }}</div>
<div class="left-content">
<InsertNote ref="InsertNote" />
<InsertNote ref="InsertNote" @insertText="handleInsertText"/>
<!-- <AutoCheck v-if="currentTab == '自动检查'" />
<AutoClose v-if="currentTab == '自动补全'" /> -->
</div>
......@@ -54,6 +54,10 @@ export default {
console.log("获取笔记loadData");
this.$refs.InsertNote.loadData();
},
//插入文字
handleInsertText(value){
this.$emit('handleInsertText',value)
}
},
};
</script>
......
<template>
<div class="wps-reader">
<div ref="myIframe" id="wps-container" class="wps-container"></div>
<RightPanel class="right-panel"/>
<RightPanel class="right-panel" @handleInsertText="handleInsertText" />
<AddOrUpdateNoteDialog
:formData="form"
ref="AddOrUpdateNoteDialog"
......@@ -120,6 +120,17 @@ export default {
handleUpdateRightPanel() {
this.$refs.RightPanel.loadNoteData();
},
// 插入文字
async handleInsertText(value) {
await this.wpsInstance
.WordApplication()
.ActiveDocument.ActiveWindow.Selection.InsertAfter(value);
this.$notify.success({
title: '提示',
message: '引入成功'
});
},
},
};
</script>
......@@ -131,7 +142,7 @@ export default {
height: 100vh;
overflow: hidden;
}
.right-panel{
.right-panel {
width: 20vw;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论