diff --git a/resources/assets/js/components/TEditor.vue b/resources/assets/js/components/TEditor.vue index 9cc88a955..30726c06e 100755 --- a/resources/assets/js/components/TEditor.vue +++ b/resources/assets/js/components/TEditor.vue @@ -148,32 +148,24 @@ uploadIng: 0, uploadFormat: ['jpg', 'jpeg', 'webp', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'], actionUrl: $A.apiUrl('system/fileupload'), - maxSize: 10240 + maxSize: 10240, + + timer: null, }; }, mounted() { this.content = this.value; this.init(); }, - beforeDestroy() { - if (this.editor !== null) { - this.editor.destroy() - this.editor = null - } - this.spinShow = true; - $A(this.$refs.myTextarea).show(); - }, activated() { this.content = this.value; this.init(); }, deactivated() { - if (this.editor !== null) { - this.editor.destroy() - this.editor = null - } - this.spinShow = true; - $A(this.$refs.myTextarea).show(); + this.destroy(); + }, + destroyed() { + this.destroy(); }, computed: { ...mapState(['themeIsDark']), @@ -206,6 +198,7 @@ }, methods: { init() { + this.timer && clearTimeout(this.timer); this.$nextTick(() => { tinymce.init(this.concatAssciativeArrays(this.option(false), this.options)); }); @@ -217,6 +210,22 @@ }); }, + destroy() { + this.timer && clearTimeout(this.timer); + this.timer = setTimeout(_ => { + if (this.editor !== null) { + this.editor.destroy() + this.editor = null + } + if (this.editorT !== null) { + this.editorT.destroy(); + this.editorT = null; + } + this.spinShow = true; + $A(this.$refs.myTextarea).show(); + }, 500); + }, + plugin(isFull) { if (isFull) { return this.plugins.filter((val) => val != 'autoresize'); diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index 7d33b3c9d..88dff946e 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -93,14 +93,14 @@ {{$L('上传文件')}} -