This commit is contained in:
2025-01-23 10:32:14 +08:00
parent 1f169dc517
commit 85fbbd84f2
22 changed files with 3164 additions and 3263 deletions

View File

@@ -86,6 +86,7 @@
</div> -->
<common-word
:key="Main_List"
v-if="htmlContent"
ref="commonWord"
:value="htmlContent"
@@ -94,7 +95,6 @@
:wordStyle="wordStyle"
@onDrop="onDrop"
@saveContent="saveContent"
@deleteComment="deleteComment"
@editComment="editComment"
@loaded="loadedWord"
@onEdit="onEdit"
@@ -102,7 +102,12 @@
@refresh="onRefresh"
@onComment="onComment"
@onAddComment="onAddComment"
@solveComment="solveComment"
@cancelSolveComment="cancelSolveComment"
@replyComment="replyComment"
@deleteComment="deleteComment"
@onEditTitle="onEditTitle"
@onAddRow="onAddRow"
@changeComment="changeComment"
style="width: calc(100%); height: calc(100%)"
:style="`100%`"
@@ -139,16 +144,16 @@
</el-form-item>
<el-form-item label="Figure Describe :">
<tinymce
<common-content
:isAutomaticUpdate="true"
ref="tinymceChildImgNote"
@getContent="getContent"
@updateChange="(res) => updateChange(res, 'imgNote')"
:value="picStyle.note"
class="paste-area text-container"
toolbar="bold italic subscript superscript clearButton"
height="120"
></tinymce>
@getContent="getContent"
v-if="pictVisible"
@updateChange="(res) => updateChange(res, 'imgNote')"
:height="120"
ref="tinymceChildImgNote"
style="margin-left: -115px"
></common-content>
</el-form-item>
</el-form>
@@ -163,6 +168,7 @@
<!-- 添加表格 -->
<el-dialog
class="editTableDialog"
destroy-on-close
v-if="threeVisible"
:title="lineStyle.visiTitle"
@@ -172,16 +178,16 @@
>
<el-form ref="editMes" :model="lineStyle" label-width="115px">
<el-form-item label="Table Title :">
<tinymce
<common-content
:isAutomaticUpdate="true"
ref="tinymceChildTitle"
@getContent="getContent"
@updateChange="(res) => updateChange(res, 'title')"
:value="lineStyle.title"
class="paste-area text-container"
toolbar="bold italic subscript superscript clearButton"
height="120"
></tinymce>
@getContent="getContent"
v-if="threeVisible"
@updateChange="(res) => updateChange(res, 'title')"
:height="120"
ref="tinymceChildTitle"
style="margin-left: -115px"
></common-content>
</el-form-item>
<el-form-item label="Word">
<span slot="label">
@@ -198,16 +204,16 @@
></common-table>
</el-form-item>
<el-form-item label="Bottom Title :">
<bottom-tinymce
<common-content
:isAutomaticUpdate="true"
ref="tinymceChildNote"
@getContent="getContent"
@updateChange="(res) => updateChange(res, 'note')"
:value="lineStyle.note"
class="paste-area text-container"
toolbar="bold italic subscript superscript clearButton"
height="150"
></bottom-tinymce>
@getContent="getContent"
v-if="threeVisible"
@updateChange="(res) => updateChange(res, 'note')"
:height="120"
ref="tinymceChildNote"
style="margin-left: -115px"
></common-content>
</el-form-item>
</el-form>
<p style="margin: 20px 0; text-align: right">
@@ -224,9 +230,9 @@
:close-on-click-modal="false"
>
<el-form ref="editMes" :model="commentForm" label-width="115px">
<el-form-item label="Select Content:" v-if="commentForm.commentLabel">
<el-form-item label="Select Content:" v-if="commentForm.content">
<p style="background: #eef0f4; line-height: 20px; padding: 10px; box-sizing: border-box">
{{ commentForm.commentLabel }}
{{ commentForm.content }}
</p>
</el-form-item>
<el-form-item label="Word">
@@ -234,6 +240,7 @@
<font style="color: #f56c6c; margin-right: 5px">*</font>
Comment :
</span>
<tinymce
ref="tinymceChildComment"
@getContent="getContent"
@@ -267,14 +274,13 @@
<font style="color: #f56c6c; margin-right: 5px">*</font>
Content :
</span>
<tinymce
ref="tinymceChild"
@getContent="getContent"
<common-content
:value="currentContent.content"
class="paste-area text-container"
toolbar="bold italic customBlue removeBlue subscript superscript clearButton "
style=""
></tinymce>
@getContent="getContent"
v-if="editVisible"
ref="commonContent"
style="margin-left: -115px"
></common-content>
</el-form-item>
</el-form>
@@ -312,7 +318,13 @@ export default {
isShowComment: false,
urlList: {
delete: 'api/Preaccept/delArticleMains',
addComment: 'api/Preaccept/addMainsRemark',
addRow: 'api/Preaccept/addBlankRow',
addComment: 'api/Preaccept/createArticleMainCheckForEditor',
editComment: 'api/Preaccept/editArticleMainCheck',
solveComment: 'api/Preaccept/completeArticleMainCheckForAuthor',
cancelSolveComment: 'api/Preaccept/rejectArticleMainCheckForEditor',
deleteComment: 'api/Preaccept/delArticleMainCheckForEditor',
replyComment: 'api/Preaccept/rejectArticleMainCheckForAuthor',
content: 'api/Preaccept/getArticleMainsRecycle',
huifuContent: 'api/Preaccept/replyArticleRecycle',
editContent: 'api/Preaccept/editArticleMainsForAuthor',
@@ -432,12 +444,13 @@ export default {
}
},
created() {
localStorage.removeItem('scrollPosition');
this.isShowEditComment();
this.getDate();
this.getCommentList();
// this.loadDictionary().catch(console.error);
},
mounted() {},
activated() {
this.isShowEditComment();
this.getDate();
@@ -478,8 +491,9 @@ export default {
// }
// },
handleSaveContent() {
this.$refs.tinymceChild.getContent('content');
this.$refs.commonContent.getTinymceContent('content');
},
async getContent(type, content) {
if (type == 'content') {
// 使用正则表达式移除所有不允许的标签
@@ -523,7 +537,7 @@ export default {
// 6. 如果需要,还可以去除 <span> 标签内部的空格
// content = content.replace(/<span[^>]*>\s*([^<]+)\s*<\/span>/g, '<span>$1</span>'); // 清理 <span> 标签内部的空格
this.saveContent(content);
this.saveContent(content, this.currentContent.am_id);
} else if (type == 'table') {
this.saveTable(content);
} else if (type == 'comment') {
@@ -540,12 +554,16 @@ export default {
})
.then(() => {
this.$api
.post('api/Preaccept/clearMainsRemark', {
am_id: comment.am_id
.post(this.urlList.deleteComment, {
amc_id: comment.amc_id
})
.then((res) => {
this.getDate();
this.getCommentList();
if (res.code == 0) {
this.getDate();
this.getCommentList();
} else {
this.$message.error(res.msg);
}
});
// this.comments.splice(index, 1); // 删除评论
})
@@ -570,6 +588,7 @@ export default {
if (res.code == 0) {
this.editVisible = false;
this.getDate();
this.getCommentList();
}
});
},
@@ -605,7 +624,7 @@ export default {
.then(async (res) => {
if (res.code == 0) {
this.ManuscirptContent = res.data.list;
this.$refs.commonWordHtmlTypeSetting.getCommentList();
// this.$refs.commonWordHtmlTypeSetting.getCommentList();
}
});
},
@@ -733,26 +752,62 @@ export default {
type: 'warning',
message: 'Please enter the Comment!'
});
return;
}
if (this.commentForm.type == 'user') {
await this.$api
.post(this.urlList.replyComment, {
amc_id: this.commentForm.amc_id,
author_remark: str
})
.then(async (res) => {
if (res.code == 0) {
this.$forceUpdate();
this.commentVisible = false;
this.getDate();
this.getCommentList();
this.$nextTick(() => {});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err.msg);
});
} else {
var data = {};
if (this.commentForm.amc_id) {
data = {
amc_id: this.commentForm.amc_id,
remark: str
};
} else {
data = {
article_id: this.articleId,
am_id: this.commentForm.am_id,
content: this.commentForm.content,
remark: str
};
}
await this.$api
.post(this.commentForm.amc_id ? this.urlList.editComment : this.urlList.addComment, { ...data })
.then(async (res) => {
if (res.code == 0) {
this.$forceUpdate();
this.commentVisible = false;
this.getDate();
this.getCommentList();
this.$nextTick(() => {});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err.msg);
});
}
await this.$api
.post(this.urlList.addComment, {
am_id: this.commentForm.am_id,
remark: str
})
.then(async (res) => {
if (res.code == 0) {
this.$forceUpdate();
this.commentVisible = false;
this.getDate();
this.getCommentList();
this.$nextTick(() => {});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err.msg);
});
},
async onComment(dataId) {
var data = this.Main_List.find((item) => item.am_id == dataId);
@@ -772,18 +827,32 @@ export default {
this.getDate();
this.getCommentList();
},
editComment(comment) {
editComment(comment, type) {
console.log('comment at line 813:', comment);
this.commentForm = {
...comment
...comment,
type: type,
remark: type == 'user' ? comment.author_remark : comment.remark
};
console.log('this.commentForm at line 815:', this.commentForm);
this.commentVisible = true;
},
async onAddComment(data) {
console.log('data at line 858:', data);
var form = this.Main_List.find((item) => item.am_id == data.mainId);
this.commentForm = {
commentLabel: data.label ? data.label : '',
...form
...form,
content: data.label ? data.label : '',
remark: '',
type: 'add',
role: 'editor'
};
this.commentVisible = true;
},
async replyComment(data) {
this.commentForm = {
...data,
remark: data.author_remark,
type: 'user'
};
this.commentVisible = true;
},
@@ -814,6 +883,56 @@ export default {
this.$message.error(err.msg);
});
},
async onAddRow(mainId) {
console.log('data at line 886:', mainId)
await this.$api
.post(this.urlList.addRow, {
am_id: mainId,
article_id: this.articleId
})
.then(async (res) => {
this.getDate();
this.getCommentList();
})
.catch((err) => {
this.$message.error(err.msg);
});
},
async solveComment(data) {
await this.$api
.post(this.urlList.solveComment, {
amc_id: data.amc_id
})
.then(async (res) => {
if (res.code == 0) {
this.getDate();
this.getCommentList();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err.msg);
});
},
async cancelSolveComment(data) {
await this.$api
.post(this.urlList.cancelSolveComment, {
amc_id: data.amc_id
})
.then(async (res) => {
if (res.code == 0) {
this.getDate();
this.getCommentList();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err.msg);
});
},
clearButton() {
var deleteButtons = document.querySelectorAll('.wordButtonContainer');
deleteButtons.forEach(function (button) {
@@ -834,10 +953,12 @@ export default {
console.log('data at line 600:', data);
if (type == 'img') {
var extension = data.url.split('.').pop().toLowerCase();
this.picStyle = {};
this.picStyle = { ...data, extension: extension, picUrl: data.url };
this.picStyle.visiTitle = 'Edit Figure';
this.pictVisible = true;
} else if (type == 'table') {
this.lineStyle = {};
this.lineStyle = {
...data,
table: JSON.parse(data.table_data),
@@ -858,6 +979,9 @@ export default {
}
},
onEdit(dataId) {
this.currentContent = {};
this.picStyle = {};
this.lineStyle = {};
this.currentId = null;
this.clearButton();
var data = this.Main_List.find((item) => item.am_id == dataId);
@@ -958,7 +1082,7 @@ export default {
},
getCommentList() {
this.$api
.post('api/Preaccept/getNotes', {
.post('api/Preaccept/getArticleMainCheckList', {
article_id: this.articleId
})
.then((res) => {
@@ -1098,6 +1222,16 @@ export default {
.post(urlLInk, urlTask)
.then(async (res) => {
if (res.code == 0) {
// res.data.list.forEach((data) => {
// if (data.amt_id) {
// try {
// const parsedData = JSON.parse(data.table.table_data);
// } catch (e) {
// console.error(e.message);
// }
// }
// });
this.Main_List = res.data.list;
this.getManuscirptContent();
for (let i = 0; i < this.Main_List.length; i++) {
@@ -1216,7 +1350,12 @@ export default {
if (res.code == 0) {
this.$message.success('Successfully edit Figure!');
this.pictVisible = false;
this.getDate();
this.$nextTick(() => {
this.getDate();
this.getCommentList();
this.$forceUpdate();
});
this.$refs.commonWordHtmlTypeSetting.refresh('img');
} else {
this.$message.error(res.msg);
@@ -1274,8 +1413,11 @@ export default {
if (res.code == 0) {
this.$message.success('Successfully edit Table!');
this.threeVisible = false;
this.getDate();
this.$refs.commonWordHtmlTypeSetting.refresh('table');
setTimeout(() => {
this.getDate();
this.getCommentList();
this.$refs.commonWordHtmlTypeSetting.refresh('table');
});
} else {
this.$message.error(res.msg);
}