(.*?)<\/p>$/, '$1') ? content.replace(/^
(.*?)<\/p>$/, '$1') : ''; + if (str == '') { + this.$message({ + type: 'warning', + message: 'Please enter the content!' + }); + } + str= await that.$commonJS.decodeHtml(str) + await that.$api + .post(that.urlList.editContent, { + am_id: am_id, + content: str + }) + .then(async (res) => { + if (res.code == 0) { + this.editVisible = false; + this.getDate(); + this.getCommentList(); + } + }); }, deleteComment(comment, index) { console.log('comment at line 480:', comment); @@ -571,28 +582,7 @@ export default { .catch(() => {}); } }, - async saveContent(content, am_id) { - var that = this; - var str = content.replace(/^
(.*?)<\/p>$/, '$1') ? content.replace(/^
(.*?)<\/p>$/, '$1') : ''; - if (str == '') { - this.$message({ - type: 'warning', - message: 'Please enter the content!' - }); - } - await that.$api - .post(that.urlList.editContent, { - am_id: am_id, - content: str - }) - .then(async (res) => { - if (res.code == 0) { - this.editVisible = false; - this.getDate(); - this.getCommentList(); - } - }); - }, + async huifu(id) { var that = this; await this.$confirm(this.$t('commonTable.reContent'), 'Prompt', { @@ -972,6 +962,7 @@ export default { } }, updateChange(content, type) { + console.log('content at line 976:', content) var str = this.$commonJS.transformHtmlString(content); if (type == 'imgNote') { this.picStyle.note = str; @@ -1014,7 +1005,9 @@ export default { this.lineStyle.visiTitle = 'Edit Table'; this.threeVisible = true; } else { + data.content = data.content.replace(/]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签 this.currentContent = data; + this.editVisible = true; this.currentId = dataId; } @@ -1337,15 +1330,16 @@ export default { }, // 确定保存图片 - savePic() { + async savePic() { this.picStyle.picUrl; - + var str=this.picStyle.note + str= await this.$commonJS.decodeHtml(str) if (this.picStyle.visiTitle == 'Edit Figure') { this.$api .post(this.urlList.editImage, { ami_id: this.picStyle.ami_id, url: this.picStyle.picUrl, - note: this.picStyle.note + note:str }) .then((res) => { if (res.code == 0) { @@ -1397,9 +1391,16 @@ export default { this.$refs.tinymceChildComment.getContent('comment'); }); }, - saveTable(content) { + async saveTable(content) { console.log('content at line 998:', content); - + var strTitle=this.lineStyle.title + strTitle= await this.$commonJS.decodeHtml(strTitle) + + var strNote=this.lineStyle.note + if(strNote!=''){ + strNote= await this.$commonJS.decodeHtml(strNote) + } + if (content && content.table && content.table.length > 0) { if (this.lineStyle.visiTitle == 'Edit Table') { this.$api @@ -1407,8 +1408,8 @@ export default { amt_id: this.lineStyle.amt_id, table_data: JSON.stringify(content.table), html_data: content.html_data, - note: this.lineStyle.note, - title: this.lineStyle.title + note: strNote, + title: strTitle }) .then((res) => { if (res.code == 0) { diff --git a/src/components/page/articleListEditor_E.vue b/src/components/page/articleListEditor_E.vue index da658d1..63a599f 100644 --- a/src/components/page/articleListEditor_E.vue +++ b/src/components/page/articleListEditor_E.vue @@ -1149,6 +1149,7 @@ export default { }, // 文章html弹出层 async htmlContet(e) { + console.log('e at line 1151:', e) this.htmlContent='' this.articleId = e.article_id; this.tg_article_id = e.tg_article_id; diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue index b820fcf..9ef796e 100644 --- a/src/components/page/components/Tinymce/index.vue +++ b/src/components/page/components/Tinymce/index.vue @@ -421,7 +421,8 @@ export default { if (_this.isAutomaticUpdate) { - _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent)); + // _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent)); + _this.$emit('updateChange',currentContent); } }); @@ -510,13 +511,14 @@ export default { //获取内容 async getContent(type) { var content = window.tinymce.get(this.tinymceId).getContent(); - content= await this.$commonJS.decodeHtml(content) + content = content.replace(/]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签 + console.log('content at line 513:', content) content = content.replace(//g, '').replace(/<\/strong>/g, ''); content = content.replace(//g, '').replace(/<\/em>/g, ''); content = content.replace(/ /g, ' '); // 将所有 替换为空格 - this.$emit('getContent', type, content); - console.log('window.tinymce.get(this.tinymceId).getContent() at line 431:', content); + this.$emit('getContent', type, content); + }, async export(type, data) {