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

新增引入笔记和引入原文

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