From c9827aa3058128f0c58305ff4f0c1e60a262c756 Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 30 May 2023 18:11:07 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=92=8C=E6=B5=81=E7=A8=8B=E5=9B=BE?= =?UTF-8?q?=E7=9A=84=E4=BD=BF=E7=94=A8=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Minder/minder.vue | 1 + src/components/MonacoEditorVue/index.js | 13 + src/components/ShowFile/ShowFile.vue | 5 +- src/components/message/MessageDialog.vue | 3 - src/components/office/Drawio.vue | 78 ++- src/components/preview/SimTextPreview.vue | 660 +++++++++++----------- src/utils/file-type.js | 2 +- 7 files changed, 414 insertions(+), 348 deletions(-) diff --git a/src/components/Minder/minder.vue b/src/components/Minder/minder.vue index 577b8bc..8c4b06c 100644 --- a/src/components/Minder/minder.vue +++ b/src/components/Minder/minder.vue @@ -417,6 +417,7 @@ export default { this.saved = true this.title = this.file.name this.$emit('onEdit', this.saved) + this.bakValue = value this.$refs.historyPopover.loadHistoryList(this.file.id) }).catch(() => { this.saveBtnUpdating = false diff --git a/src/components/MonacoEditorVue/index.js b/src/components/MonacoEditorVue/index.js index e85518b..3149eeb 100644 --- a/src/components/MonacoEditorVue/index.js +++ b/src/components/MonacoEditorVue/index.js @@ -119,6 +119,19 @@ export default { theme: theme, ...options }); + this.editor.addAction({ + id: 'my-unique-id', + label: 'Hello World', + keybindings: [ + monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_M, + ], + contextMenuGroupId: 'navigation', + contextMenuOrder: 1.5, + run: function(ed) { + alert('Hello World!'); + } + }); + this.diffEditor && this._setModel(this.value, this.original); this._editorMounted(this.editor); //编辑器初始化后 }, diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 958f25a..f8a5fd8 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -449,9 +449,10 @@ title="提示" content="此文件不支持预览, 是否下载该文件?" :show.sync="notPreviewDialogVisible" - operatButtonText="强行使用文本编辑器打开" + button-size="mini" + operatButtonText="取消" confirmButtonText="下载" - @operating="forciblyOpen(openingFile)" + @operating="notPreviewDialogVisible = false" @confirm="determineDownload(openingFile)" > diff --git a/src/components/message/MessageDialog.vue b/src/components/message/MessageDialog.vue index 7ff430d..e0ad583 100644 --- a/src/components/message/MessageDialog.vue +++ b/src/components/message/MessageDialog.vue @@ -1,7 +1,5 @@