提交 html

This commit is contained in:
2025-01-16 14:11:51 +08:00
parent 0f24749c84
commit ba117ad618
2 changed files with 81 additions and 64 deletions

View File

@@ -82,26 +82,36 @@
</el-table-column> </el-table-column>
<el-table-column label="" width="220px" align="center"> <el-table-column label="" width="220px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" type="primary" @click="EditDetail(scope.row)" style="padding: 4px 6px !important;border-right-color: hsla(0, 0%, 100%, .5);"> <p style="display: flex; align-items: center; justify-content: space-around">
Edit</el-button
>
<el-button-group style="margin-left: 10px;">
<el-button size="small" type="primary" plain @click="htmlContet(scope.row)" style="padding: 4px 6px !important"
>Html</el-button
>
<el-button size="small" type="primary" plain @click="goCite(scope.row)" style="padding: 4px 6px !important"
>Cite</el-button
>
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
plain plain
@click="ChoseRelated(scope.row)" @click="EditDetail(scope.row)"
style="background: #fff !important; color: #4165d7 !important; padding: 4px 6px !important" style="padding: 4px 10px !important; float: left"
> >
Relevant</el-button <i class="el-icon-edit"></i> Edit</el-button
> >
</el-button-group>  <el-dropdown :hide-on-click="false" style="">
 
<span class="el-dropdown-link">     More operations<i class="el-icon-arrow-down el-icon--right"></i>   </span>  
<el-dropdown-menu slot="dropdown">
   
<el-dropdown-item
><p @click="htmlContet(scope.row)"><i class="el-icon-notebook-2"></i>Html</p></el-dropdown-item
>
       
<el-dropdown-item divided
><p @click="goCite(scope.row)"><i class="el-icon-edit"></i>Cite</p>
</el-dropdown-item>
   
<el-dropdown-item divided>
<p @click="ChoseRelated(scope.row)"><i class="el-icon-tickets"></i>Relevant</p>
</el-dropdown-item>
 
</el-dropdown-menu>
</el-dropdown>
</p>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -1017,7 +1027,6 @@ export default {
var htmlContent = ``; var htmlContent = ``;
htmlContent += this.mains htmlContent += this.mains
.map((item) => { .map((item) => {
//批注 //批注
let contentHtml = ''; let contentHtml = '';
var isRemark = ``; var isRemark = ``;
@@ -1026,15 +1035,15 @@ export default {
if (item.type == 1) { if (item.type == 1) {
contentHtml = ` contentHtml = `
<p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${ <p contenteditable="false" main-state="${item.state}" class="MaxPicture pMain" data-id="${
item.ami_id item.ami_id
}" main-id="${item.am_id}"> }" main-id="${item.am_id}">
${isRemark} ${isRemark}
<img src="${this.mediaUrl + item.image.url}" style="width: ${ <img src="${this.mediaUrl + item.image.url}" style="width: ${
item.width ? `${item.width}px` : '100%' item.width ? `${item.width}px` : '100%'
}" /> }" />
<font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${ <font class="font" style="width: ${item.width ? `${item.width}px` : '100%'}" >${
item.image.note ? item.image.note : '' item.image.note ? item.image.note : ''
}</font> }</font>
</p> </p>
`; `;
} else if (item.type == 2) { } else if (item.type == 2) {
@@ -1069,7 +1078,7 @@ export default {
</div> </div>
`; `;
} else { } else {
console.log('item at line 1019:', 333333)
contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`; contentHtml = `<p class="pMain" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${isRemark}${item.content}</p>`;
} }
@@ -1079,7 +1088,7 @@ export default {
}) })
.join(''); .join('');
this.htmlContent = htmlContent; this.htmlContent = htmlContent;
console.log('this.htmlContent at line 820:', this.htmlContent)
}, },
getMainsInfo2(e) { getMainsInfo2(e) {
this.loadHtml = true; this.loadHtml = true;
@@ -1139,35 +1148,38 @@ export default {
async htmlContet(e) { async htmlContet(e) {
this.articleId = e.article_id; this.articleId = e.article_id;
this.tg_article_id = e.tg_article_id; this.tg_article_id = e.tg_article_id;
// this.articleId = '3444';
this.UpHtpFIle.article_id = e.article_id; this.UpHtpFIle.article_id = e.article_id;
this.refersList = await this.getRefersList(); this.refersList = await this.getRefersList();
// this.UpHtpFIle.refers = e.refers
this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.p_article_id = e.p_article_id;
this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.doi = e.doi;
this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.htmlfile = e.file_html;
this.UpHtpFIle.title = e.title; this.UpHtpFIle.title = e.title;
this.UpHtpFIle.mains = e.mains; this.UpHtpFIle.mains = e.mains;
this.UpLoadFile.article_id = e.article_id; this.UpLoadFile.article_id = e.article_id;
this.html_type = e.html_type; await this.$api
// this.html_type = 2; .post('api/Publish/getPublishArticleDetail', {
article_id: e.article_id
if (this.html_type == 2) { })
if (e.has_html == 1) { .then(async (res) => {
await this.getMainsInfo2(); if (res.code == 0) {
console.log('res.code at line 1148:', res.code);
this.HtmlVisible = true; this.html_type = res.data.detail.html_type;
} else { if (this.html_type == 2) {
this.mains = ''; if ( res.data.detail.has_html == 1) {
this.HtmlVisible = true; await this.getMainsInfo2();
} this.HtmlVisible = true;
} else { } else {
await this.getMainsInfo(e); this.mains = '';
this.HtmlVisible = true; this.HtmlVisible = true;
} }
} else {
await this.getMainsInfo(e);
this.HtmlVisible = true;
}
}
});
}, },
// 生成html // 生成html
// CreateHtml(){ // CreateHtml(){
// const loading = this.$loading({ // const loading = this.$loading({
@@ -1187,6 +1199,7 @@ export default {
// this.htmlLayout() // this.htmlLayout()
// } // }
// }) // })
// }, // },
// 修改文章html // 修改文章html
async htmlLayout2(type) { async htmlLayout2(type) {
@@ -1198,7 +1211,7 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
await this.creatMains(); await this.creatMains();
this.html_type=2; this.html_type = 2;
await this.getMainsInfo2(); await this.getMainsInfo2();
loading.close(); loading.close();
} else { } else {

View File

@@ -876,38 +876,42 @@ export default {
}, },
// 文章html弹出层 // 文章html弹出层
async htmlContet(e) { async htmlContet(e) {
console.log('e at line 923:', e);
this.articleId = e.article_id; this.articleId = e.article_id;
this.tg_article_id = e.tg_article_id; this.tg_article_id = e.tg_article_id;
// this.articleId = '3444';
this.UpHtpFIle.article_id = e.article_id; this.UpHtpFIle.article_id = e.article_id;
this.refersList = await this.getRefersList(); this.refersList = await this.getRefersList();
// this.UpHtpFIle.refers = e.refers
this.UpHtpFIle.p_article_id = e.p_article_id; this.UpHtpFIle.p_article_id = e.p_article_id;
this.UpHtpFIle.doi = e.doi; this.UpHtpFIle.doi = e.doi;
this.UpHtpFIle.htmlfile = e.file_html; this.UpHtpFIle.htmlfile = e.file_html;
this.UpHtpFIle.title = e.title; this.UpHtpFIle.title = e.title;
this.UpHtpFIle.mains = e.mains; this.UpHtpFIle.mains = e.mains;
this.UpLoadFile.article_id = e.article_id; this.UpLoadFile.article_id = e.article_id;
this.html_type = e.html_type; await this.$api
// this.html_type = 2; .post('api/Publish/getPublishArticleDetail', {
article_id: e.article_id
if (this.html_type == 2) { })
if (e.has_html == 1) { .then(async (res) => {
await this.getMainsInfo2(); if (res.code == 0) {
console.log('res.code at line 1148:', res.code);
this.HtmlVisible = true; this.html_type = res.data.detail.html_type;
} else { if (this.html_type == 2) {
this.mains = ''; if ( res.data.detail.has_html == 1) {
this.HtmlVisible = true; await this.getMainsInfo2();
} this.HtmlVisible = true;
} else { } else {
await this.getMainsInfo(e); this.mains = '';
this.HtmlVisible = true; this.HtmlVisible = true;
} }
} else {
await this.getMainsInfo(e);
this.HtmlVisible = true;
}
}
});
}, },
// 生成html // 生成html
// CreateHtml(){ // CreateHtml(){
// const loading = this.$loading({ // const loading = this.$loading({