|
|
@@ -1767,6 +1767,32 @@ Vue.component('spaceEditor', {
|
|
|
this.deferSyncEditorPlayableVideos();
|
|
|
space.message.success("正文已完成排版整理");
|
|
|
},
|
|
|
+ openWordImporter: function () {
|
|
|
+ if (!this.editor || !this.editor.ui || !this.editor.ui.view || !this.editor.ui.view.element) {
|
|
|
+ space.message.warning("编辑器尚未加载完成");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var editorEl = this.editor.ui.view.element;
|
|
|
+ var wordButton = editorEl.querySelector('button[aria-label="导入word文件"]')
|
|
|
+ || editorEl.querySelector('button[title="导入word文件"]');
|
|
|
+ if (!wordButton) {
|
|
|
+ var labels = editorEl.querySelectorAll(".ck-button__label");
|
|
|
+ for (var i = 0; i < labels.length; i++) {
|
|
|
+ if ((labels[i].textContent || "").trim() == "导入word文件") {
|
|
|
+ wordButton = labels[i].closest("button");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!wordButton) {
|
|
|
+ space.message.warning("Word 导入功能尚未加载完成");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ wordButton.click();
|
|
|
+ },
|
|
|
insertHtml: function (html) {
|
|
|
if (!this.editor || space.utils.isNull(html)) {
|
|
|
return;
|
|
|
@@ -2520,7 +2546,7 @@ Vue.component('spaceEditor', {
|
|
|
template: `
|
|
|
<div class="space-editor-wrap">
|
|
|
<div class="space-editor-toolstrip" v-if="showEditorTools()">
|
|
|
- <el-button class="space-editor-tool-btn" size="small" plain icon="el-icon-magic-stick" @click="formatContent">一键排版</el-button>
|
|
|
+ <el-button class="space-editor-tool-btn" size="small" plain icon="el-icon-document" @click="openWordImporter">导入word文件</el-button>
|
|
|
<el-button class="space-editor-tool-btn" size="small" plain icon="el-icon-video-camera" @click="openVideoPicker">上传视频</el-button>
|
|
|
<el-button class="space-editor-tool-btn" size="small" plain icon="el-icon-document" @click="openPdfPicker">上传PDF</el-button>
|
|
|
<span class="space-editor-tool-divider"></span>
|