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('上传文件')}} -
- - {{$L('全屏输入')}} -
{{$L('匿名消息')}}
+
+ + {{$L('全屏输入')}} +
@@ -628,6 +628,10 @@ export default { wrapperHeight(newVal, oldVal) { this.$emit('on-height-change', {newVal, oldVal}) + }, + + fullInput(val) { + this.quill?.enable(!val) } }, methods: { @@ -1174,6 +1178,10 @@ export default { }, this.options)) this.fullQuill.enable(true) this.$refs.editorFull.firstChild.innerHTML = this.$refs.editor.firstChild.innerHTML + this.$nextTick(_ => { + this.fullQuill.setSelection(this.fullQuill.getLength()) + this.fullQuill.focus() + }) }) } }, diff --git a/resources/assets/js/pages/manage/components/ProjectPanel.vue b/resources/assets/js/pages/manage/components/ProjectPanel.vue index e75ba09c5..b49d7b217 100644 --- a/resources/assets/js/pages/manage/components/ProjectPanel.vue +++ b/resources/assets/js/pages/manage/components/ProjectPanel.vue @@ -74,7 +74,7 @@
- +
@@ -897,7 +897,7 @@ export default { $A.modalInfo({ language: false, title: this.$L('项目描述'), - content: this.projectData.desc + content: this.$refs.descPreview.$el.innerHTML }) },