提交公微

This commit is contained in:
2025-05-22 13:06:07 +08:00
parent b9ddba2488
commit 845785686d
17 changed files with 721 additions and 269 deletions

BIN
dist.zip

Binary file not shown.

View File

@@ -27,7 +27,7 @@ window.MathJax = window.MathJax || {
// **定义全局渲染方法** // **定义全局渲染方法**
window.renderMathJax = function (tinymceId) { window.renderMathJax = function (tinymceId) {
if (window.MathJax && typeof window.MathJax.typesetPromise === "function") { if (window.MathJax && typeof window.MathJax.typesetPromise === "function") {
console.log("正在渲染 MathJax 公式..."); // console.log("正在渲染 MathJax 公式...");
// 如果提供了 TinyMCE 编辑器 ID // 如果提供了 TinyMCE 编辑器 ID
if (tinymceId) { if (tinymceId) {

View File

@@ -451,9 +451,18 @@ const en = {
"icon_placeholder": "Please enter the author's avatar URL", "icon_placeholder": "Please enter the author's avatar URL",
"remove_author": "Remove Author", "remove_author": "Remove Author",
"add_author": "Add Author" "add_author": "Add Author"
} },
AIArticleStatusEn: {
1: 'WeChat AI content generated',
2: 'WeChat AI content not generated',
3: 'Draft not created',
4: 'Draft created but not published',
10: 'WeChat article published successfully',
11: 'WeChat article publishing in progress',
fail: 'WeChat article publishing failed',
unknown: 'Unknown status'
}
} }

View File

@@ -444,6 +444,16 @@ const zh = {
"icon_placeholder": "请输入作者头像地址", "icon_placeholder": "请输入作者头像地址",
"remove_author": "删除作者", "remove_author": "删除作者",
"add_author": "添加作者" "add_author": "添加作者"
},
AIArticleStatus: {
1: '公微 AI 内容已生成',
2: '公微 AI 内容未生成',
3: '尚未生成草稿',
4: '草稿已生成,尚未发布',
10: '公微文章已成功发布',
11: '公微文章正在发布中',
fail: '公微文章发布失败',
unknown: '状态未知'
} }
} }

View File

@@ -1137,7 +1137,7 @@ export default {
} }
}, },
updateChange(content, type) { updateChange(content, type) {
console.log('content at line 1154:', content); // console.log('content at line 1154:', content);
// console.log('content at line 976:', content); // console.log('content at line 976:', content);
var str = this.$commonJS.transformHtmlString(content); var str = this.$commonJS.transformHtmlString(content);
if (type == 'imgNote') { if (type == 'imgNote') {
@@ -1153,7 +1153,7 @@ export default {
this.currentId = null; this.currentId = null;
this.clearButton(); this.clearButton();
var data = this.Main_List.find((item) => item.am_id == dataId); var data = this.Main_List.find((item) => item.am_id == dataId);
console.log('data at line 667:', data); // console.log('data at line 667:', data);
if (data.type == 1) { if (data.type == 1) {
var extension = data.image.url.split('.').pop().toLowerCase(); var extension = data.image.url.split('.').pop().toLowerCase();
if (extension == 'tif') { if (extension == 'tif') {

View File

@@ -200,9 +200,10 @@
> >
<el-form ref="editMes" :model="lineStyle" label-width="80px"> <el-form ref="editMes" :model="lineStyle" label-width="80px">
<!-- <common-late-x></common-late-x> --> <!-- <common-late-x></common-late-x> -->
<!-- :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`" -->
<el-form-item label="Title:"> <el-form-item label="Title:">
<common-content <common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`" :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`"
:isAutomaticUpdate="true" :isAutomaticUpdate="true"
:value="lineStyle.title" :value="lineStyle.title"
@getContent="getContent" @getContent="getContent"
@@ -228,8 +229,9 @@
></common-table> ></common-table>
</el-form-item> </el-form-item>
<el-form-item label="Note:"> <el-form-item label="Note:">
<!-- :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`" -->
<common-content <common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`" :id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`"
:isAutomaticUpdate="true" :isAutomaticUpdate="true"
:value="lineStyle.note" :value="lineStyle.note"
@getContent="getContent" @getContent="getContent"
@@ -512,10 +514,12 @@ export default {
addContentVisible: false, addContentVisible: false,
addContent: {}, addContent: {},
lineStyle: {}, lineStyle: {},
lineStyle1: {},
contentStyle: {}, contentStyle: {},
lineTable: [], lineTable: [],
threeVisible: false, threeVisible: false,
picStyle: {}, picStyle: {},
picStyle1: {},
commentForm: {}, commentForm: {},
commentVisible: false, commentVisible: false,
pictVisible: false, pictVisible: false,
@@ -1261,14 +1265,8 @@ export default {
this.threeVisible = true; this.threeVisible = true;
}, },
addUploadWordTable(data) { addUploadWordTable(data) {
this.lineStyle = {}; this.lineStyle = { note: '', table: data.table_data, html_data: data.html_data };
this.lineStyle = {
...data,
table: data.table_data,
html_data: data.html_data,
note: '',
title: ''
};
this.lineStyle.visiTitle = 'Insert Table'; this.lineStyle.visiTitle = 'Insert Table';
this.threeVisible = true; this.threeVisible = true;
}, },
@@ -1294,16 +1292,19 @@ export default {
} }
}, },
updateChange(content, type) { updateChange(content, type) {
console.log('content at line 1154:', content); // console.log('content at line 1154:', content);
// console.log('content at line 976:', content); // console.log('content at line 976:', content);
var str = this.$commonJS.transformHtmlString(content); var str = this.$commonJS.transformHtmlString(content);
if (type == 'imgNote') { if (type == 'imgNote') {
this.picStyle.note = str; this.picStyle1.note = str;
} else if (type == 'imgTitle') { } else if (type == 'imgTitle') {
this.picStyle.title = str; this.picStyle1.title = str;
} else { } else {
this.lineStyle[type] = str; this.lineStyle1[type] = str;
} }
}, },
onEdit(dataId) { onEdit(dataId) {
this.currentContent = {}; this.currentContent = {};
@@ -1312,7 +1313,7 @@ export default {
this.currentId = null; this.currentId = null;
this.clearButton(); this.clearButton();
var data = this.Main_List.find((item) => item.am_id == dataId); var data = this.Main_List.find((item) => item.am_id == dataId);
console.log('data at line 667:', data); // console.log('data at line 667:', data);
if (data.type == 1) { if (data.type == 1) {
var extension = data.image.url.split('.').pop().toLowerCase(); var extension = data.image.url.split('.').pop().toLowerCase();
if (extension == 'tif') { if (extension == 'tif') {
@@ -1674,8 +1675,8 @@ export default {
async savePic() { async savePic() {
this.picStyle.picUrl; this.picStyle.picUrl;
var str = this.picStyle.note?await this.$commonJS.decodeHtml(this.picStyle.note):''; var str = this.picStyle1.note ? await this.$commonJS.decodeHtml(this.picStyle1.note) : '';
var titleStr = this.picStyle.title?await this.$commonJS.decodeHtml(this.picStyle.title):""; var titleStr = this.picStyle1.title ? await this.$commonJS.decodeHtml(this.picStyle1.title) : '';
if (this.picStyle.visiTitle == 'Edit Figure') { if (this.picStyle.visiTitle == 'Edit Figure') {
this.$api this.$api
.post(this.urlList.editImage, { .post(this.urlList.editImage, {
@@ -1760,25 +1761,26 @@ export default {
} }
}; };
var cleanedTableList = content.table ? content.table : []; var cleanedTableList = content.table ? content.table : [];
console.log('content at line 998:', content); console.log('content at line 998:', this.lineStyle);
cleanedTableList = cleanTableData(content.table); cleanedTableList = cleanTableData(content.table);
var strTitle = this.lineStyle.title; var strTitle = this.lineStyle1.title? this.lineStyle1.title : '';
strTitle = await this.$commonJS.decodeHtml(strTitle);
var strNote = this.lineStyle.note; var strNote = this.lineStyle1.note? this.lineStyle1.note : '';
if (strNote != '') { if (strNote != '') {
strNote = await this.$commonJS.decodeHtml(strNote); strNote = await this.$commonJS.decodeHtml(strNote);
} }
if (strTitle != '') {
strTitle = await this.$commonJS.decodeHtml(strTitle);
}
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
if (content && cleanedTableList && cleanedTableList.length > 0) { if (content && cleanedTableList && cleanedTableList.length > 0) {
if (this.lineStyle.visiTitle == 'Edit Table') { if (this.lineStyle.visiTitle == 'Edit Table') {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$api this.$api
.post(this.urlList.editTable, { .post(this.urlList.editTable, {
amt_id: this.lineStyle.amt_id, amt_id: this.lineStyle.amt_id,
@@ -1811,14 +1813,15 @@ export default {
article_id: this.articleId, article_id: this.articleId,
table_data: JSON.stringify(cleanedTableList), table_data: JSON.stringify(cleanedTableList),
html_data: content.html_data, html_data: content.html_data,
note: this.lineStyle.note, note: strNote,
title: this.lineStyle.title title: strTitle
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('Successfully Add Table!'); this.$message.success('Successfully Add Table!');
this.threeVisible = false; this.threeVisible = false;
this.getDate(); this.getDate();
loading.close();
this.$refs.commonWordHtmlTypeSetting.refresh('table'); this.$refs.commonWordHtmlTypeSetting.refresh('table');
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);

View File

@@ -56,8 +56,8 @@
<span>{{ item.npp }}.</span> <span>{{ item.npp }}.</span>
<font @click="lookView(item)">{{ item.title }}</font> <font @click="lookView(item)">{{ item.title }}</font>
<commonOnlineOperations ref="onlineOperations" :data="item" style="display: inline-block;"> <commonOnlineOperations ref="onlineOperations" :data="item" style="display: inline-block;" type="online">
<el-dropdown-item> <p @click="htmlContet(item)"><i class="el-icon-notebook-2"></i>Html</p> </el-dropdown-item> <span @click="htmlContet(item)" class="onlineOperationsButton"><i class="el-icon-notebook-2"></i>Html</span>
<!-- <el-button <!-- <el-button
style="margin-left: 20px; padding: 4px 10px !important" style="margin-left: 20px; padding: 4px 10px !important"
@@ -70,6 +70,9 @@
Html</el-button Html</el-button
> --> > -->
</commonOnlineOperations> </commonOnlineOperations>
<span style="font-size: 13px;" :style="{ color: getStatusColor(item.ai_wechat_status) }" v-if="item.ai_wechat_status&&['Article', 'Review', 'Mini Review'].includes(item.type)">
{{ getStatusText(item.ai_wechat_status) }}
</span>
<!-- <el-button <!-- <el-button
style="margin-left: 20px; padding: 4px 10px !important; background: #ccf7e46e !important;color: #00bc66 !important;border-color:#00bc66 !important;" style="margin-left: 20px; padding: 4px 10px !important; background: #ccf7e46e !important;color: #00bc66 !important;border-color:#00bc66 !important;"
@@ -224,7 +227,22 @@ export default {
this.getDate(); this.getDate();
}, },
methods: { methods: {
getStatusText(status) {
const key = status > 11 ? 'fail' : status;
return this.$t(`AIArticleStatus.${key}`);
},
getStatusColor(status) {
// 字段名 ai_wechat_status 1 Ai内容已生成 2ai内容未生成 3未生成草稿 4 已生成草稿未发布 10 发布成功 11 发布中 >11发布失败
if (status == 1) return '#67C23A';
if (status == 2) return '#C0C4CC';
if (status == 3) return '#C0C4CC';
if (status == 4) return '#ff9800';
if (status == 10) return '#67C23A';
if (status == 11) return '#409eff';
if (status > 11) return 'red';
return '';
},
htmlContet(data) { htmlContet(data) {
console.log('data at line 189:', data); console.log('data at line 189:', data);
this.$nextTick((e) => { this.$nextTick((e) => {

View File

@@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<div class="tab_post"> <div class="tab_post">
<div v-for="(item, index) in tabsList" @click="jumpTab(index,item)" <div v-for="(item, index) in tabsList" @click="jumpTab(index,item)"
:class="tabName==item.refName?'P_style':''"> :class="tabName==item.refName?'P_style':''">

View File

@@ -48,6 +48,9 @@
<el-table-column label="Title"> <el-table-column label="Title">
<template slot-scope="scope"> <template slot-scope="scope">
<p v-html="scope.row.title"></p> <p v-html="scope.row.title"></p>
<span style="font-size: 13px;" :style="{ color: getStatusColor(scope.row.ai_wechat_status) }" v-if="scope.row.ai_wechat_status&&['Article', 'Review', 'Mini Review'].includes(scope.row.type)">
{{ getStatusText(scope.row.ai_wechat_status) }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Cite" width="80px" align="center"> <el-table-column label="Cite" width="80px" align="center">
@@ -92,7 +95,7 @@
> >
<i class="el-icon-edit"></i> Edit</el-button <i class="el-icon-edit"></i> Edit</el-button
> >
<commonOnlineOperations ref="onlineOperations" :data="scope.row" style="display: inline-block"> <commonOnlineOperations ref="onlineOperations" :data="scope.row" style="display: inline-block" type="publish">
<el-dropdown-item <el-dropdown-item
><p @click="htmlContet(scope.row)"><i class="el-icon-notebook-2"></i>Html</p></el-dropdown-item ><p @click="htmlContet(scope.row)"><i class="el-icon-notebook-2"></i>Html</p></el-dropdown-item
> >
@@ -587,6 +590,23 @@ export default {
} }
}, },
methods: { methods: {
getStatusText(status) {
const key = status > 11 ? 'fail' : status;
return this.$t(`AIArticleStatus.${key}`);
},
getStatusColor(status) {
// 字段名 ai_wechat_status 1 Ai内容已生成 2ai内容未生成 3未生成草稿 4 已生成草稿未发布 10 发布成功 11 发布中 >11发布失败
if (status == 1) return '#67C23A';
if (status == 2) return '#C0C4CC';
if (status == 3) return '#C0C4CC';
if (status == 4) return '#ff9800';
if (status == 10) return '#67C23A';
if (status == 11) return '#409eff';
if (status > 11) return 'red';
return '';
},
//跳转婴用列表 //跳转婴用列表
goCite(row) { goCite(row) {
console.log('row at line 483:', row.article_id); console.log('row at line 483:', row.article_id);

View File

@@ -742,7 +742,7 @@ export default {
this.currentId = null; this.currentId = null;
this.clearButton(); this.clearButton();
var data = this.Main_List.find((item) => item.am_id == dataId); var data = this.Main_List.find((item) => item.am_id == dataId);
console.log('data at line 667:', data); // console.log('data at line 667:', data);
if (data.type == 1) { if (data.type == 1) {
var extension = data.image.url.split('.').pop().toLowerCase(); var extension = data.image.url.split('.').pop().toLowerCase();
if (extension == 'tif') { if (extension == 'tif') {

View File

@@ -424,7 +424,7 @@ export default {
// 去除所有 $ 符号 // 去除所有 $ 符号
const latexContent = latexContentRaw.replace(/\$/g, '').trim(); const latexContent = latexContentRaw.replace(/\$/g, '').trim();
console.log('at line 489: cleaned =', latexContent); // console.log('at line 489: cleaned =', latexContent);
// 编码后用于传递到弹窗 // 编码后用于传递到弹窗
const encoded = encodeURIComponent(latexContent); const encoded = encodeURIComponent(latexContent);
@@ -482,9 +482,11 @@ export default {
// 创建 MutationObserver 监听内容变化 // 创建 MutationObserver 监听内容变化
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
const currentContent = ed.getContent(); const currentContent = ed.getContent();
// console.log('currentContent at line 484:', currentContent)
// console.log('currentContent at line 447:', currentContent); // console.log('currentContent at line 447:', currentContent);
if (_this.isAutomaticUpdate) { if (_this.isAutomaticUpdate) {
_this.$emit('updateChange', currentContent);
// _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent)); // _this.$emit('updateChange', _this.$commonJS.decodeHtml(currentContent));
//暂时注释掉数字公式 //暂时注释掉数字公式
// _this.$commonJS.replaceWMathContent(currentContent, (res) => { // _this.$commonJS.replaceWMathContent(currentContent, (res) => {
@@ -553,7 +555,7 @@ export default {
if (_this.value) { if (_this.value) {
editor.setContent(_this.value); editor.setContent(_this.value);
console.log('at line 489:', ' 页面'); // console.log('at line 489:', ' 页面');
setTimeout(() => { setTimeout(() => {
window.renderMathJax(_this.tinymceId); // 初始化时渲染 MathJax window.renderMathJax(_this.tinymceId); // 初始化时渲染 MathJax
}, 10); }, 10);
@@ -563,7 +565,7 @@ export default {
this.hasChange = true; this.hasChange = true;
this.$emit('input', editor.getContent()); this.$emit('input', editor.getContent());
console.log('at line 518:', '改变'); // console.log('at line 518:', '改变');
// setTimeout(() => { // setTimeout(() => {
// window.renderMathJax(); // 初始化时渲染 MathJax // window.renderMathJax(); // 初始化时渲染 MathJax
// }, 50); // }, 50);
@@ -578,7 +580,7 @@ export default {
// 👂 message 监听器:处理编辑 + 新增两种情况 // 👂 message 监听器:处理编辑 + 新增两种情况
window.addEventListener('message', function (event) { window.addEventListener('message', function (event) {
const data = event.data; const data = event.data;
console.log('data at line 648:', data); // console.log('data at line 648:', data);
// ✅ 编辑现有公式:替换或删除 // ✅ 编辑现有公式:替换或删除
if (data && data.type === 'update-wmath') { if (data && data.type === 'update-wmath') {
const { editorId, wmathId, latex } = data; const { editorId, wmathId, latex } = data;

View File

@@ -1,11 +1,13 @@
<template> <template>
<div> <div>
 <el-dropdown :hide-on-click="false" style="">  <el-dropdown :hide-on-click="false" style="" v-if="type == 'publish'">
<span class="el-dropdown-link" style="margin-left: 10px">
<el-link type="primary">More operations<i class="el-icon-arrow-down el-icon--right"></i></el-link>     
</span>
   
<span class="el-dropdown-link" style="margin-left: 10px;"> <el-link type="primary">More operations<i class="el-icon-arrow-down el-icon--right"></i></el-link>      </span>  
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
           <slot ></slot>            <slot></slot>
<el-dropdown-item divided <el-dropdown-item divided
><p @click="EditDetail(data)"><i class="el-icon-edit"></i>Topics</p> ><p @click="EditDetail(data)"><i class="el-icon-edit"></i>Topics</p>
</el-dropdown-item> </el-dropdown-item>
@@ -13,12 +15,19 @@
<el-dropdown-item divided> <el-dropdown-item divided>
<p @click="ChoseRelated(data)"><i class="el-icon-tickets"></i>Relevant</p> <p @click="ChoseRelated(data)"><i class="el-icon-tickets"></i>Relevant</p>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided> <el-dropdown-item divided v-if="['Article', 'Review', 'Mini Review'].includes(data.type)">
<p @click="htmlWeChatPreview(data)"><i class="el-icon-tickets"></i>WeChat Preview</p> <p @click="htmlWeChatPreview(data)"><i class="el-icon-tickets"></i>Public Micro</p>
</el-dropdown-item> </el-dropdown-item>
   
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
 
<div v-if="type == 'online'">
<slot></slot>
<span @click="EditDetail(data)" class="onlineOperationsButton"><i class="el-icon-edit"></i>Topics</span>
<span @click="ChoseRelated(data)" class="onlineOperationsButton"><i class="el-icon-tickets"></i>Relevant</span>
<span @click="htmlWeChatPreview(data)" class="onlineOperationsButton" v-if="['Article', 'Review', 'Mini Review'].includes(data.type)"><i class="el-icon-tickets"></i>Public Micro</span>
</div>
<!-- 修改信息 --> <!-- 修改信息 -->
<el-dialog title="" :visible.sync="EditVisible" width="750px" :close-on-click-modal="false"> <el-dialog title="" :visible.sync="EditVisible" width="750px" :close-on-click-modal="false">
@@ -125,21 +134,20 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="RelatVisible = false" plain>Close</el-button> <el-button type="primary" @click="RelatVisible = false" plain>Close</el-button>
</span> </span>
</el-dialog> <commonHtmlWeChatPreview ref="htmlWeChatPreview"></commonHtmlWeChatPreview> </el-dialog>
<commonHtmlWeChatPreview ref="htmlWeChatPreview"></commonHtmlWeChatPreview>
</div> </div>
</template> </template>
<script>import commonHtmlWeChatPreview from '@/components/page/components/htmlWeChatPreview/index.vue'; <script>
import commonHtmlWeChatPreview from '@/components/page/components/htmlWeChatPreview/index.vue';
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
import { watch } from 'vue'; import { watch } from 'vue';
export default { export default {
props: ['data'], props: ['data', 'type'],
components: { components: {
commonHtmlWeChatPreview
commonHtmlWeChatPreview,
}, },
data() { data() {
return { return {
@@ -1225,7 +1233,16 @@ export default {
background: #e4e7ed !important; background: #e4e7ed !important;
color: #777 !important; color: #777 !important;
} }
/deep/.el-table .el-table__cell.is-center{ /deep/.el-table .el-table__cell.is-center {
text-align: left !important; text-align: left !important;
} }
.onlineOperationsButton {
padding: 4px 10px;
color: #409eff !important;
background: #ecf5ff !important;
border-color: #b3d8ff !important;
margin: 0 10px;
border-radius: 4px;
cursor: pointer;
}
</style> </style>

View File

@@ -42,196 +42,243 @@
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
line-height: 40px; line-height: 40px;
cursor: pointer;
" "
@click="handlePush" @click="handlePush"
type="primary" type="primary"
v-if="ArticleForm.ai_article_id && !disablePush" v-if="ArticleForm.ai_article_id && stepValue == 1"
> >
<img style="width: 30px; margin-right: 10px" src="@/assets/img/weixin.png" alt="" /> Push To Draft Box <img style="width: 30px; margin-right: 10px" src="@/assets/img/weixin.png" alt="" /> Push To Draft Box
</div> </div>
<div
style="
display: flex;
align-items: center;
justify-content: center;
background: #006699;
color: #fff;
width: 90%;
margin: 0 auto;
margin-top: 20px;
border-radius: 50px;
font-size: 16px;
font-weight: 500;
line-height: 40px;cursor: pointer;
"
@click="handleRelease"
type="primary"
v-if="ArticleForm.ai_article_id && draft_status == 1 && publish_status == -1"
>
<img style="width: 30px; margin-right: 10px" src="@/assets/img/weixin.png" alt="" /> Quick Release
</div>
</div> </div>
</div> </div>
<div class="right"> <div class="right" style="padding: 0">
<div> <div>
<el-form ref="form" :model="ArticleForm" label-width="160px" size="mini" v-if="ArticleForm.ai_article_id"> <el-steps :active="stepValue" :process-status="processStatus" :finish-status="finishStatus" align-center>
<el-form-item> <el-step
<template #label> class="custom-process-step"
<span @click="handleTitleClick('covered')" class="form_title"> :status="v.status"
{{ $t('AIhtmlWeChatPreview.covered') + ' :' }} :title="v.title"
</span> :description="v.description"
</template> v-for="(v, i) in stepList"
<p v-if="disablePush">{{ ArticleForm.covered }}</p> ></el-step>
<el-input v-else type="textarea" v-model="ArticleForm.covered" :autosize="{ minRows: 1, maxRows: 3 }" /> </el-steps>
</el-form-item>
<el-form-item> <div style="padding: 20px 20px 0">
<template #label> <el-form ref="form" :model="ArticleForm" label-width="160px" size="mini" v-if="ArticleForm.ai_article_id">
<span @click="handleTitleClick('digest')" class="form_title"> <el-form-item>
{{ $t('AIhtmlWeChatPreview.digest') + ' :' }} <template #label>
</span> <span @click="handleTitleClick('covered')" class="form_title">
</template> {{ $t('AIhtmlWeChatPreview.covered') + ' :' }}
<p v-if="disablePush">{{ ArticleForm.digest }}</p> </span>
<el-input v-else type="textarea" v-model="ArticleForm.digest" :autosize="{ minRows: 2, maxRows: 10 }" /> </template>
</el-form-item> <p v-if="disablePush">{{ ArticleForm.covered }}</p>
<el-input v-else type="textarea" v-model="ArticleForm.covered" :autosize="{ minRows: 1, maxRows: 3 }" />
</el-form-item>
<el-form-item> <el-form-item>
<template #label> <template #label>
<span @click="handleTitleClick('research_background')" class="form_title"> <span @click="handleTitleClick('digest')" class="form_title">
{{ $t('AIhtmlWeChatPreview.research_background') + ' :' }} {{ $t('AIhtmlWeChatPreview.digest') + ' :' }}
</span> </span>
</template> </template>
<p v-if="disablePush">{{ ArticleForm.research_background }}</p> <p v-if="disablePush">{{ ArticleForm.digest }}</p>
<el-input <el-input v-else type="textarea" v-model="ArticleForm.digest" :autosize="{ minRows: 2, maxRows: 10 }" />
v-else </el-form-item>
type="textarea"
v-model="ArticleForm.research_background"
:autosize="{ minRows: 2, maxRows: 5 }"
/>
</el-form-item>
<el-form-item> <el-form-item>
<template #label> <template #label>
<span @click="handleTitleClick('research_result')" class="form_title"> <span @click="handleTitleClick('research_background')" class="form_title">
{{ $t('AIhtmlWeChatPreview.research_result') + ' :' }} {{ $t('AIhtmlWeChatPreview.research_background') + ' :' }}
</span> </span>
</template> </template>
<p v-if="disablePush">{{ ArticleForm.research_result }}</p> <p v-if="disablePush">{{ ArticleForm.research_background }}</p>
<el-input <el-input
v-else v-else
type="textarea" type="textarea"
v-model="ArticleForm.research_result" v-model="ArticleForm.research_background"
:autosize="{ minRows: 2, maxRows: 5 }" :autosize="{ minRows: 2, maxRows: 5 }"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<template #label> <template #label>
<span @click="handleTitleClick('discussion')" class="form_title"> <span @click="handleTitleClick('research_result')" class="form_title">
{{ $t('AIhtmlWeChatPreview.discussion') + ' :' }} {{ $t('AIhtmlWeChatPreview.research_result') + ' :' }}
</span> </span>
</template> </template>
<p v-if="disablePush">{{ ArticleForm.discussion }}</p> <p v-if="disablePush">{{ ArticleForm.research_result }}</p>
<el-input v-else type="textarea" v-model="ArticleForm.discussion" :autosize="{ minRows: 2, maxRows: 5 }" /> <el-input
</el-form-item> v-else
type="textarea"
v-model="ArticleForm.research_result"
:autosize="{ minRows: 2, maxRows: 5 }"
/>
</el-form-item>
<el-form-item> <el-form-item>
<template #label> <template #label>
<span @click="handleTitleClick('prospect')" class="form_title"> <span @click="handleTitleClick('discussion')" class="form_title">
{{ $t('AIhtmlWeChatPreview.prospect') + ' :' }} {{ $t('AIhtmlWeChatPreview.discussion') + ' :' }}
</span> </span>
</template> </template>
<p v-if="disablePush">{{ ArticleForm.prospect }}</p> <p v-if="disablePush">{{ ArticleForm.discussion }}</p>
<el-input v-else type="textarea" v-model="ArticleForm.prospect" :autosize="{ minRows: 2, maxRows: 5 }" /> <el-input
</el-form-item> v-else
type="textarea"
v-model="ArticleForm.discussion"
:autosize="{ minRows: 2, maxRows: 5 }"
/>
</el-form-item>
<!-- 作者列表 --> <el-form-item>
<div style="margin-top: 10px"> <template #label>
<el-collapse v-model="activeNames" style="width: 100%"> <span @click="handleTitleClick('prospect')" class="form_title">
<el-collapse-item {{ $t('AIhtmlWeChatPreview.prospect') + ' :' }}
:title="$t('AIhtmlWeChatPreview.author') + ' (' + ArticleForm.authors.length + ')'" </span>
name="1" </template>
><div class="authorBox"> <p v-if="disablePush">{{ ArticleForm.prospect }}</p>
<div <el-input
v-for="(author, index) in ArticleForm.authors" v-else
:key="index" type="textarea"
class="authorItem" v-model="ArticleForm.prospect"
style=" :autosize="{ minRows: 2, maxRows: 5 }"
border: 1px solid #eee; />
margin-bottom: 10px; </el-form-item>
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
" <!-- 作者列表 -->
:style=" <div style="margin-top: 10px" v-if="ArticleForm.authors && ArticleForm.authors.length > 0">
ArticleForm.authors && ArticleForm.authors.length == 1 <el-collapse v-model="activeNames" style="width: 100%">
? 'width:100%;margin-right:0;' <el-collapse-item
: '' :title="$t('AIhtmlWeChatPreview.author') + ' (' + ArticleForm.authors.length + ')'"
" name="1"
> ><div class="authorBox">
<p <div
class="authorTitle" v-for="(author, index) in ArticleForm.authors"
@click="handleTitleClick('author_' + author.user_id)" :key="index"
class="authorItem"
style=" style="
cursor: pointer; border: 1px solid #eee;
padding: 0 10px; margin-bottom: 10px;
background-color: #b3d8ff80; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-bottom: 1px solid #b3d8ff; "
font-weight: 700; :style="
ArticleForm.authors && ArticleForm.authors.length == 1
? 'width:100%;margin-right:0;'
: ''
" "
> >
{{ index + 1 }} : {{ author.author_name }} <p
</p> class="authorTitle"
<div style="padding: 10px; box-sizing: border-box"> @click="handleTitleClick('author_' + author.user_id)"
<el-form-item :label="$t('AIhtmlWeChatPreview.icon') + ' :'" label-width="100px"> style="
<div class="portrait" @click="changeUser(author, index)"> cursor: pointer;
<p v-if="disablePush"> padding: 0 10px;
<img background-color: #b3d8ff80;
v-if="author.icon" border-bottom: 1px solid #b3d8ff;
:src="mediaUrl + 'usericon/' + author.icon" font-weight: 700;
class="avatar" "
accept=".png,.jpg"
/>
</p>
<el-upload
v-else
class="avatar-uploader"
ref="upIconIMg"
:action="baseUrl + 'api/Ucenter/up_userIcon_file'"
:show-file-list="false"
name="icon"
:on-success="handleAvatarSuccess2"
:on-error="handleAvatarError2"
:before-upload="beforeAvatarUpload2"
>
<img
v-if="author.icon"
:src="mediaUrl + 'usericon/' + author.icon"
class="avatar"
accept=".png,.jpg"
/>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
style="line-height: 70px"
></i>
</el-upload>
</div>
</el-form-item>
<el-form-item :label="$t('AIhtmlWeChatPreview.technical') + ' :'" label-width="100px">
<p v-if="disablePush">{{ author.technical }}</p>
<el-input
v-else
v-model="author.technical"
:placeholder="$t('AIhtmlWeChatPreview.technical')"
/>
</el-form-item>
<el-form-item :label="$t('AIhtmlWeChatPreview.company') + ' :'" label-width="100px">
<p v-if="disablePush">{{ author.company }}</p>
<el-input
v-else
v-model="author.company"
:placeholder="$t('AIhtmlWeChatPreview.company')"
/>
</el-form-item>
<el-form-item
:label="$t('AIhtmlWeChatPreview.introduction') + ' :'"
label-width="100px"
> >
<p v-if="disablePush">{{ author.introduction }}</p> {{ index + 1 }} : {{ author.author_name }}
<el-input </p>
v-else <div style="padding: 10px; box-sizing: border-box">
type="textarea" <el-form-item :label="$t('AIhtmlWeChatPreview.icon') + ' :'" label-width="100px">
rows="3" <div class="portrait" @click="changeUser(author, index)">
v-model="author.introduction" <p v-if="disablePush">
:placeholder="$t('AIhtmlWeChatPreview.introduction')" <img
/> v-if="author.icon"
</el-form-item> :src="mediaUrl + 'usericon/' + author.icon"
class="avatar"
accept=".png,.jpg"
/>
</p>
<el-upload
v-else
class="avatar-uploader"
ref="upIconIMg"
:action="baseUrl + 'api/Ucenter/up_userIcon_file'"
:show-file-list="false"
name="icon"
:on-success="handleAvatarSuccess2"
:on-error="handleAvatarError2"
:before-upload="beforeAvatarUpload2"
>
<img
v-if="author.icon"
:src="mediaUrl + 'usericon/' + author.icon"
class="avatar"
accept=".png,.jpg"
/>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
style="line-height: 70px"
></i>
</el-upload>
</div>
</el-form-item>
<el-form-item
:label="$t('AIhtmlWeChatPreview.technical') + ' :'"
label-width="100px"
>
<p v-if="disablePush">{{ author.technical }}</p>
<el-input
v-else
v-model="author.technical"
:placeholder="$t('AIhtmlWeChatPreview.technical')"
/>
</el-form-item>
<el-form-item :label="$t('AIhtmlWeChatPreview.company') + ' :'" label-width="100px">
<p v-if="disablePush">{{ author.company }}</p>
<el-input
v-else
v-model="author.company"
:placeholder="$t('AIhtmlWeChatPreview.company')"
/>
</el-form-item>
<el-form-item
:label="$t('AIhtmlWeChatPreview.introduction') + ' :'"
label-width="100px"
>
<p v-if="disablePush">{{ author.introduction }}</p>
<el-input
v-else
type="textarea"
rows="3"
v-model="author.introduction"
:placeholder="$t('AIhtmlWeChatPreview.introduction')"
/>
</el-form-item>
</div>
</div> </div>
</div> </div>
</div> </el-collapse-item>
</el-collapse-item> </el-collapse>
</el-collapse> </div>
</div> </el-form>
</el-form> </div>
</div> </div>
<!-- </el-collapse-item> <!-- </el-collapse-item>
</el-collapse> --> </el-collapse> -->
@@ -252,6 +299,29 @@ import { watch } from 'vue';
export default { export default {
data() { data() {
return { return {
publish_status: null,
draft_status: null,
stepValue: null,
processStatus: 'process',
finishStatus: 'success',
stepList: [
{
title: 'Step 1',
description: 'Article Generation',
status: 'wait'
},
{
title: 'Step 2',
description: 'Push draft box',
status: 'wait'
},
{
title: 'Step 3',
description: 'The article has been published',
status: 'wait'
}
],
uploadDrafts: [],
pushFormData: {}, pushFormData: {},
activeNames: ['1'], activeNames: ['1'],
innerVisible: false, innerVisible: false,
@@ -400,8 +470,9 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
this.$api this.$api
.post('api/Aiarticle/syncWechat', { .post('api/Aiarticle/uploadMaterial', {
article_id: this.articleId, article_id: this.articleId,
template_id: this.selectTemplate, template_id: this.selectTemplate,
article_type: 'news', article_type: 'news',
@@ -409,26 +480,74 @@ export default {
only_fans_can_comment: 1 //粉丝才可评论 only_fans_can_comment: 1 //粉丝才可评论
}) })
.then((res) => { .then((res) => {
// if (res.status == 1) { if (res.status == 1) {
// this.$message.success(res.msg); this.$api
// const loading = this.$loading({ .post('api/Aiarticle/syncWechat', {
// lock: true, article_id: this.articleId,
// text: 'Loading...', template_id: this.selectTemplate,
// spinner: 'el-icon-loading', article_type: 'news',
// background: 'rgba(0, 0, 0, 0.7)' need_open_comment: 1, //打开评论
// }); only_fans_can_comment: 1 //粉丝才可评论
// this.getDate(loading); })
// console.log(res); .then((res) => {
// } else { if (res.status == 1) {
// this.$message.error(res.msg); } else {
// } this.$message.error(res.msg);
loading.close();
return false;
}
this.intervalId = setInterval(() => {
this.getStatus();
}, 5000); // 5000 毫秒 = 5 秒
// 处理创建文章的响应
})
.catch((err) => {});
} else {
this.$message.error(res.msg);
loading.close();
return false;
}
// 处理创建文章的响应 // 处理创建文章的响应
}) })
.catch((err) => {}); .catch((err) => {
setTimeout(() => { loading.close();
this.$message.success('Push successful, please check later !'); });
loading.close(); });
},1000*6); },
handleRelease() {
this.$confirm('Are you sure you want to Release?', 'Tip', {
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// uploadDrafts
this.$api
.post('api/Aiarticle/publishDraft', {
article_id: this.articleId,
template_id: this.selectTemplate
// wechat_id: exists.wechat_id
})
.then((res) => {
if (res.status == 1) {
console.log(res);
} else {
this.$message.error(res.msg);
loading.close();
return false;
}
this.intervalId = setInterval(() => {
this.getReleaseStatus();
}, 5000); // 5000 毫秒 = 5 秒
// 处理创建文章的响应
})
.catch((err) => {
loading.close();
});
}); });
}, },
handleTitleClick(field) { handleTitleClick(field) {
@@ -505,11 +624,12 @@ export default {
removeAuthor(index) { removeAuthor(index) {
this.ArticleForm.authors.splice(index, 1); this.ArticleForm.authors.splice(index, 1);
}, },
init(data) { async init(data) {
this.articleId = data.article_id; this.articleId = data.article_id;
// this.articleId = 2673; // this.articleId = 2673;
// this.stepList = this.stepList.map((e) => (e.status = ''));
await this.getStatus();
this.getStatus();
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
this.getStatus(); this.getStatus();
}, 5000); // 5000 毫秒 = 5 秒 }, 5000); // 5000 毫秒 = 5 秒
@@ -552,7 +672,7 @@ export default {
}; };
// 触发 iframe 的加载 // 触发 iframe 的加载
iframe.src = 'about:blank'; iframe.src = 'about:blank?' + new Date().getTime();
if (field) { if (field) {
this.handleTitleClick(field); this.handleTitleClick(field);
} }
@@ -585,6 +705,85 @@ export default {
}, },
// 获取列表 // 获取列表
updateStepStatus() {
const gen = this.generate_status;
const draft = this.draft_status;
const pub = this.publish_status;
// 初始化 stepList 状态
this.stepList = [
{
title: 'Step 1',
description: 'Article Generation',
status: 'wait'
},
{
title: 'Step 2',
description: 'Push draft box',
status: 'wait'
},
{
title: 'Step 3',
description: 'The article has been published',
status: 'wait'
}
];
// Step 1: 生成状态
if (gen === 3) {
this.stepValue = 0;
this.stepList[0].status = 'wait';
this.stepList[0].description = 'Waiting to generate';
} else if (gen === 2) {
this.stepValue = 0;
this.stepList[0].status = 'process';
this.stepList[0].description = 'Generating...';
} else if (gen === 1) {
this.stepList[0].status = 'success';
this.stepList[0].description = 'Generated';
}
// Step 2: 草稿状态
if (gen === 1 && draft === 1) {
this.stepValue = 2;
this.stepList[1].status = 'success';
this.stepList[1].description = 'Draft box has been pushed';
} else if (gen === 1) {
this.stepList[1].status = 'wait';
this.stepList[1].description = 'Waiting to push';
}
// Step 3: 发布状态
if (draft === 1) {
switch (pub) {
case -1:
this.stepValue = 3;
this.stepList[2].status = 'wait';
this.stepList[2].description = 'Not published yet';
break;
case 1:
this.stepValue = 3;
this.stepList[2].status = 'process';
this.stepList[2].description = 'Publishing...';
break;
case 0:
this.stepValue = 3;
this.stepList[2].status = 'success';
this.stepList[2].description = 'Published successfully';
break;
case 2:
case 3:
case 4:
case 5:
case 6:
this.stepValue = 3;
this.stepList[2].status = 'error';
this.stepList[2].description = 'Publishing failed';
break;
}
}
},
async getStatus() { async getStatus() {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
@@ -593,7 +792,6 @@ export default {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
this.loading = true; this.loading = true;
this.$api this.$api
.post('api/Aiarticle/getAiArticleStatus', { .post('api/Aiarticle/getAiArticleStatus', {
article_id: this.articleId article_id: this.articleId
@@ -601,25 +799,104 @@ export default {
.then(async (res) => { .then(async (res) => {
console.log('res at line 264:', res); console.log('res at line 264:', res);
if (res.status == 1) { if (res.status == 1) {
switch (res.data.is_generate) { this.publish_status = res.data.publish_status;
this.draft_status = res.data.draft_status;
// generate_status 1AI内容已生成 2 AI内容生成中 3AI内容未生成
switch (res.data.generate_status) {
case 1: // 已生成 case 1: // 已生成
// this.stopInterval();
loading.text = 'Loading...'; loading.text = 'Loading...';
this.getDate(loading); this.getDate(loading);
this.stepValue = 1;
this.stepList[0].status = 'success';
this.stopInterval();
break; break;
case 2: // 生成中 case 2: // 生成中
// setTimeout(() => { this.stepValue = null;
// this.getStatus();
// }, 5000);
break; break;
case 3: // 未生成 case 3: // 未生成
this.stepValue = null;
loading.text = 'The public WeChat article is being created, please be patient and wait...'; loading.text = 'The public WeChat article is being created, please be patient and wait...';
this.createdAiArticle(); this.createdAiArticle();
break; break;
} }
if (res.data.generate_status == 1) {
if (res.data.draft_status == 1) {
this.stepValue = 2;
this.stepList[1].description = 'Draft box has been pushed';
this.stepList[1].status = 'success';
// this.processStatus = 'process'; // 当前是步骤2
// 发布状态判断
// 根据发布状态更新 stepValue 和 process-status
switch (res.data.publish_status) {
case 0:
// 发布成功
this.stepValue = 3;
this.stepList[2].description = 'Published successfully';
this.stepList[2].status = 'success';
this.stopInterval();
// this.processStatus = 'success'; // 发布成功时,状态为成功
break;
case 1:
// 发布中
this.stepValue = 3; // 步骤保持在“发布中”阶段
this.stepList[2].description = 'Publishing in progress';
this.stepList[2].status = 'process';
this.stopInterval();
// this.processStatus = 'process'; // 设置为“进行中”状态
break;
case 2:
case 3:
case 4:
// 发布失败,平台审核失败等错误
this.stepValue = 3;
this.stepList[2].description = 'Publishing failed';
this.stepList[2].status = 'error';
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case 5:
// 用户删除文章
this.stepValue = 3;
this.stepList[2].description = 'Deleted by user';
this.stepList[2].status = 'error';
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case 6:
// 系统封禁所有文章
this.stepValue = 3;
this.stepList[2].description = 'Blocked by system';
this.stepList[2].status = 'error';
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case -1:
// 草稿未发布
this.stepValue = 3;
this.stepList[2].description = 'Not published yet';
this.stepList[2].status = 'wait';
this.stopInterval();
// this.processStatus = 'wait'; // 草稿未发布,保持“等待”状态
break;
}
} else {
this.stepValue = 1;
this.stepList[1].description = 'Draft box has not been pushed';
this.stepList[1].status = 'wait';
this.stopInterval();
// this.processStatus = 'wait'; // 第一步没完成
}
if (this.stepValue > 1) {
this.disablePush = true;
}
}
// draft_status 1已推送到草稿箱 2 未推送到草稿箱
// publish_status -1 草稿箱内容未发布 0 草稿箱内容发布成功 1草稿箱内容发布中 2原创失败, 3: 常规失败, 4:平台审核不通过, 5:成功后用户删除所有文章, 6: 成功后系统封禁所有文章
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
loading.close(); loading.close();
@@ -630,9 +907,97 @@ export default {
loading.close(); loading.close();
}); });
}, },
async getReleaseStatus() {
const loading = this.$loading({
lock: true,
text: 'Loading...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// this.loading = true;
this.$api
.post('api/Aiarticle/getAiArticleStatus', {
article_id: this.articleId
})
.then(async (res) => {
console.log('res at line 264:', res);
if (res.status == 1) {
this.publish_status = res.data.publish_status;
this.draft_status = res.data.draft_status;
switch (res.data.publish_status) {
case 0:
// 发布成功
this.stepValue = 3;
this.stepList[2].description = 'Published successfully';
this.stepList[2].status = 'success';
loading.close();
this.stopInterval();
// this.processStatus = 'success'; // 发布成功时,状态为成功
break;
case 1:
// 发布中
this.stepValue = 3; // 步骤保持在“发布中”阶段
this.stepList[2].description = 'Publishing in progress...';
this.stepList[2].status = 'process';
loading.text = 'Publishing in progress...';
// this.processStatus = 'process'; // 设置为“进行中”状态
break;
case 2:
case 3:
case 4:
// 发布失败,平台审核失败等错误
this.stepValue = 3;
this.stepList[2].description = 'Publishing failed';
this.stepList[2].status = 'error';
loading.close();
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case 5:
// 用户删除文章
this.stepValue = 3;
this.stepList[2].description = 'Deleted by user';
this.stepList[2].status = 'error';
loading.close();
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case 6:
// 系统封禁所有文章
this.stepValue = 3;
this.stepList[2].description = 'Blocked by system';
this.stepList[2].status = 'error';
loading.close();
this.stopInterval();
// this.processStatus = 'error'; // 设置为“错误”状态
break;
case -1:
// 草稿未发布
this.stepValue = 3;
this.stepList[2].description = 'Not published yet';
this.stepList[2].status = 'wait';
loading.close();
this.stopInterval();
// this.processStatus = 'wait'; // 草稿未发布,保持“等待”状态
break;
}
// draft_status 1已推送到草稿箱 2 未推送到草稿箱
// publish_status -1 草稿箱内容未发布 0 草稿箱内容发布成功 1草稿箱内容发布中 2原创失败, 3: 常规失败, 4:平台审核不通过, 5:成功后用户删除所有文章, 6: 成功后系统封禁所有文章
} else {
this.$message.error(res.msg);
loading.close();
}
})
.catch((err) => {
console.log(err);
this.stopInterval();
loading.close();
});
},
// 获取列表 // 获取列表
async getDate(loading) { async getDate(loading) {
this.disablePush = false;
this.loading = true; this.loading = true;
this.$api this.$api
@@ -640,13 +1005,16 @@ export default {
article_id: this.articleId article_id: this.articleId
}) })
.then(async (res) => { .then(async (res) => {
this.disablePush = false;
if (res.status == 1) { if (res.status == 1) {
if (res.data.ai_article.upload_draft && res.data.ai_article.upload_draft.length > 0) { // const uploadDrafts = res.data.ai_article.upload_draft;
if (res.data.ai_article.upload_draft.includes(this.selectTemplate)) {
this.disablePush = true; // if (uploadDrafts && uploadDrafts.length > 0) {
} // this.uploadDrafts = uploadDrafts;
} // const exists = uploadDrafts.some((item) => item.template_id === this.selectTemplate);
// if (exists) {
// }
// }
this.HtmlVisible = true; this.HtmlVisible = true;
this.articleInfo = res.data; this.articleInfo = res.data;
this.ArticleForm = { ...res.data.ai_article, authors: res.data.ai_article_author }; this.ArticleForm = { ...res.data.ai_article, authors: res.data.ai_article_author };
@@ -1676,7 +2044,7 @@ export default {
.right { .right {
width: calc(100%) !important; width: calc(100%) !important;
height: 100%; height: 100%;
padding: 60px 20px 0; padding: 0px 20px 0;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -1773,4 +2141,8 @@ export default {
height: 70px; height: 70px;
border-radius: 110px !important; border-radius: 110px !important;
} }
::v-deep .custom-process-step .is-process {
color: #409eff !important;
border-color: #409eff !important;
}
</style> </style>

View File

@@ -67,7 +67,7 @@ export default {
mounted() { mounted() {
this.typesettingType = 1; this.typesettingType = 1;
if (this.lineStyle) { if (this.lineStyle) {
console.log('newVal at line 37:', this.lineStyle); // console.log('newVal at line 37:', this.lineStyle);
} else { } else {
this.updatedHtml = ''; this.updatedHtml = '';

View File

@@ -65,7 +65,7 @@ export default {
mounted() { mounted() {
this.typesettingType = 1; this.typesettingType = 1;
if (this.lineStyle) { if (this.lineStyle) {
console.log('newVal at line 37:', this.lineStyle); // console.log('newVal at line 37:', this.lineStyle);
if (this.lineStyle.table) { if (this.lineStyle.table) {
this.tableData = [...this.lineStyle.table]; this.tableData = [...this.lineStyle.table];
var modalContent = ` var modalContent = `
@@ -93,7 +93,7 @@ export default {
modalContent += `</tr>`; modalContent += `</tr>`;
}); });
modalContent += `</table></div>`; modalContent += `</table></div>`;
console.log('modalContent at line 91:', modalContent); // console.log('modalContent at line 91:', modalContent);
this.updatedHtml = modalContent; this.updatedHtml = modalContent;
} }
// this.updatedHtml = newVal.html_data; // this.updatedHtml = newVal.html_data;

View File

@@ -349,7 +349,7 @@ export default {
switch (this.currentSelectType) { switch (this.currentSelectType) {
case '0': case '0':
this.tablesList = [...this.tables]; this.tablesList = [...this.tables];
console.log('this.tablesList at line 393:', this.tablesList); // console.log('this.tablesList at line 393:', this.tablesList);
break; break;
case '1': case '1':
this.tablesList = [...this.tables].filter((e) => e.has_selected == 1); this.tablesList = [...this.tables].filter((e) => e.has_selected == 1);

View File

@@ -692,7 +692,7 @@ export default {
switch (this.currentSelectType) { switch (this.currentSelectType) {
case '0': case '0':
this.tablesList = [...this.tables]; this.tablesList = [...this.tables];
console.log('this.tablesList at line 393:', this.tablesList); // console.log('this.tablesList at line 393:', this.tablesList);
break; break;
case '1': case '1':
this.tablesList = [...this.tables].filter((e) => e.has_selected == 1); this.tablesList = [...this.tables].filter((e) => e.has_selected == 1);