From ba117ad6181c508abbe76d085b15fc8d61b8574b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Thu, 16 Jan 2025 14:11:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=20html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page/articleListEditor_E.vue | 101 ++++++++++-------- src/components/page/components/html/index.vue | 44 ++++---- 2 files changed, 81 insertions(+), 64 deletions(-) diff --git a/src/components/page/articleListEditor_E.vue b/src/components/page/articleListEditor_E.vue index 67c7839..2fc608a 100644 --- a/src/components/page/articleListEditor_E.vue +++ b/src/components/page/articleListEditor_E.vue @@ -82,26 +82,36 @@ @@ -1017,7 +1027,6 @@ export default { var htmlContent = ``; htmlContent += this.mains .map((item) => { - //批注 let contentHtml = ''; var isRemark = ``; @@ -1026,15 +1035,15 @@ export default { if (item.type == 1) { contentHtml = `

+ item.ami_id + }" main-id="${item.am_id}"> ${isRemark} + item.width ? `${item.width}px` : '100%' + }" /> ${ - item.image.note ? item.image.note : '' - } + item.image.note ? item.image.note : '' + }

`; } else if (item.type == 2) { @@ -1069,7 +1078,7 @@ export default { `; } else { - console.log('item at line 1019:', 333333) + contentHtml = `

${isRemark}${item.content}

`; } @@ -1079,7 +1088,7 @@ export default { }) .join(''); this.htmlContent = htmlContent; - console.log('this.htmlContent at line 820:', this.htmlContent) + }, getMainsInfo2(e) { this.loadHtml = true; @@ -1139,35 +1148,38 @@ export default { async htmlContet(e) { this.articleId = e.article_id; this.tg_article_id = e.tg_article_id; - // this.articleId = '3444'; this.UpHtpFIle.article_id = e.article_id; - this.refersList = await this.getRefersList(); - // this.UpHtpFIle.refers = e.refers this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.title = e.title; this.UpHtpFIle.mains = e.mains; this.UpLoadFile.article_id = e.article_id; - this.html_type = e.html_type; - // this.html_type = 2; - - if (this.html_type == 2) { - if (e.has_html == 1) { - await this.getMainsInfo2(); - - this.HtmlVisible = true; - } else { - this.mains = ''; - this.HtmlVisible = true; - } - } else { - await this.getMainsInfo(e); - this.HtmlVisible = true; - } + await this.$api + .post('api/Publish/getPublishArticleDetail', { + article_id: e.article_id + }) + .then(async (res) => { + if (res.code == 0) { + console.log('res.code at line 1148:', res.code); + this.html_type = res.data.detail.html_type; + if (this.html_type == 2) { + if ( res.data.detail.has_html == 1) { + await this.getMainsInfo2(); + this.HtmlVisible = true; + } else { + this.mains = ''; + this.HtmlVisible = true; + } + } else { + await this.getMainsInfo(e); + this.HtmlVisible = true; + } + } + }); + }, - // 生成html // CreateHtml(){ // const loading = this.$loading({ @@ -1187,6 +1199,7 @@ export default { // this.htmlLayout() // } // }) + // }, // 修改文章html async htmlLayout2(type) { @@ -1198,7 +1211,7 @@ export default { background: 'rgba(0, 0, 0, 0.7)' }); await this.creatMains(); - this.html_type=2; + this.html_type = 2; await this.getMainsInfo2(); loading.close(); } else { diff --git a/src/components/page/components/html/index.vue b/src/components/page/components/html/index.vue index 722b0dc..32e0793 100644 --- a/src/components/page/components/html/index.vue +++ b/src/components/page/components/html/index.vue @@ -876,38 +876,42 @@ export default { }, // 文章html弹出层 async htmlContet(e) { - console.log('e at line 923:', e); this.articleId = e.article_id; this.tg_article_id = e.tg_article_id; - // this.articleId = '3444'; this.UpHtpFIle.article_id = e.article_id; - this.refersList = await this.getRefersList(); - // this.UpHtpFIle.refers = e.refers this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.title = e.title; this.UpHtpFIle.mains = e.mains; this.UpLoadFile.article_id = e.article_id; - this.html_type = e.html_type; - // this.html_type = 2; - - if (this.html_type == 2) { - if (e.has_html == 1) { - await this.getMainsInfo2(); - - this.HtmlVisible = true; - } else { - this.mains = ''; - this.HtmlVisible = true; - } - } else { - await this.getMainsInfo(e); - this.HtmlVisible = true; - } + await this.$api + .post('api/Publish/getPublishArticleDetail', { + article_id: e.article_id + }) + .then(async (res) => { + if (res.code == 0) { + console.log('res.code at line 1148:', res.code); + this.html_type = res.data.detail.html_type; + if (this.html_type == 2) { + if ( res.data.detail.has_html == 1) { + await this.getMainsInfo2(); + this.HtmlVisible = true; + } else { + this.mains = ''; + this.HtmlVisible = true; + } + } else { + await this.getMainsInfo(e); + this.HtmlVisible = true; + } + } + }); + }, + // 生成html // CreateHtml(){ // const loading = this.$loading({