- updateChange(res, 'title')"
:value="lineStyle.title"
- class="paste-area text-container"
- toolbar="bold italic subscript superscript clearButton"
- height="120"
- >
+ @getContent="getContent"
+ v-if="threeVisible"
+ @updateChange="(res) => updateChange(res, 'title')"
+ :height="120"
+ ref="tinymceChildTitle"
+ style="margin-left: -115px"
+ >
@@ -198,16 +204,16 @@
>
- updateChange(res, 'note')"
:value="lineStyle.note"
- class="paste-area text-container"
- toolbar="bold italic subscript superscript clearButton"
- height="150"
- >
+ @getContent="getContent"
+ v-if="threeVisible"
+ @updateChange="(res) => updateChange(res, 'note')"
+ :height="120"
+ ref="tinymceChildNote"
+ style="margin-left: -115px"
+ >
@@ -224,9 +230,9 @@
:close-on-click-modal="false"
>
-
+
- {{ commentForm.commentLabel }}
+ {{ commentForm.content }}
@@ -234,6 +240,7 @@
*
Comment :
+
*
Content :
-
+ @getContent="getContent"
+ v-if="editVisible"
+ ref="commonContent"
+ style="margin-left: -115px"
+ >
@@ -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. 如果需要,还可以去除 标签内部的空格
// content = content.replace(/]*>\s*([^<]+)\s*<\/span>/g, '$1'); // 清理 标签内部的空格
- 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);
}
diff --git a/src/components/page/PreIngestedEditor.vue b/src/components/page/PreIngestedEditor.vue
index f67bc12..7e17c7e 100644
--- a/src/components/page/PreIngestedEditor.vue
+++ b/src/components/page/PreIngestedEditor.vue
@@ -1671,12 +1671,11 @@ export default {
// 6----校对文章
htmlContet() {
- this.$router.push({
- path: '/GenerateCharts',
+ window.open(this.$router.resolve({ path: '/GenerateCharts',
query: {
id: this.$route.query.id
- }
- });
+ } }).href, '_blank');
+
},
// 6----修改时间为年月日
diff --git a/src/components/page/articleListEditor_E.vue b/src/components/page/articleListEditor_E.vue
index 3584907..de920a1 100644
--- a/src/components/page/articleListEditor_E.vue
+++ b/src/components/page/articleListEditor_E.vue
@@ -1217,12 +1217,16 @@ export default {
loading.close();
} else {
this.HtmlVisible = false;
- this.$router.push({
- path: '/GenerateCharts',
- query: {
- id: this.tg_article_id
- }
- });
+ window.open(this.$router.resolve({ path: '/GenerateCharts',
+ query: {
+ id: this.tg_article_id
+ } }).href, '_blank');
+ // this.$router.push({
+ // path: '/GenerateCharts',
+ // query: {
+ // id: this.tg_article_id
+ // }
+ // });
}
},
htmlLayout() {
diff --git a/src/components/page/comArtHtmlCreatNew copy.vue b/src/components/page/comArtHtmlCreatNew copy.vue
new file mode 100644
index 0000000..0743941
--- /dev/null
+++ b/src/components/page/comArtHtmlCreatNew copy.vue
@@ -0,0 +1,299 @@
+
+
+
+
+ Artcile Html
+ Edit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/page/comArtHtmlCreatNew.vue b/src/components/page/comArtHtmlCreatNew.vue
index 0743941..576e917 100644
--- a/src/components/page/comArtHtmlCreatNew.vue
+++ b/src/components/page/comArtHtmlCreatNew.vue
@@ -1,46 +1,98 @@
-
-
-
- Artcile Html
- Edit
-
-
-
-
-
+
+
+
+ Text Proofread
+
-
-
+
+
+
+
+
diff --git a/src/components/page/components/Tinymce/index.vue b/src/components/page/components/Tinymce/index.vue
index 91df3ee..a5b877b 100644
--- a/src/components/page/components/Tinymce/index.vue
+++ b/src/components/page/components/Tinymce/index.vue
@@ -1,5 +1,6 @@
+
@@ -110,7 +111,11 @@ const tableStyle = ` b span{
table tr:last-of-type {
border-bottom:1.0000pt solid #000 !important;mso-border-bottom-alt:0.5000pt solid #000 !important;;
}
-
+ table span blue {
+ color: rgb(0, 130, 170) !important;
+ }blue {
+ color: rgb(0, 130, 170) !important;
+ }
`;
export default {
@@ -133,11 +138,9 @@ export default {
},
isEdit: {},
toolbar: {
- type: Array,
+
required: false,
- default() {
- return [];
- }
+
},
menubar: {
default: 'file edit insert view format table '
@@ -154,6 +157,10 @@ export default {
},
isShowArtWorkButton: {
default: false
+ },
+ wordStyle: {
+ type: String,
+ default: ''
}
},
data() {
@@ -263,8 +270,9 @@ export default {
this.$forceUpdate();
},
initTinymce() {
- const _this = this;
+ var _this = this;
window.tinymce.init({
+ inline: false, // 使用 iframe 模式
selector: `#${this.tinymceId}`,
content_css: false, // 禁用默认样式
table_resize_bars: true, // 启用拖动调整功能
@@ -329,24 +337,14 @@ export default {
}
},
- content_style: `${tableStyle}
- .tox-editor-header{
- background-color: #f8f9fa!important;
- }
- .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- color: #007bff; /* 设置字体颜色 */
- }
- .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(2){
- font-weight:bold !important;
- color: #007bff; /* 设置字体颜色 */
- text-decoration: line-through;
- }
- table span blue {
- color: rgb(0, 130, 170) !important;
- }blue {
- color: rgb(0, 130, 170) !important;
- }`,
+ content_style: `
+ ${tableStyle}
+ ${_this.wordStyle}
+
+
+
+
+ `,
formats: {
bold: { inline: 'b' },
@@ -359,9 +357,14 @@ export default {
statusbar: false, // 关闭底部状态栏
custom_colors: false,
color_map: ['0082AA', 'TMR Blue'],
- plugins: 'forecolor code paste table image', // 启用 forecolor 和 code 插件
+ plugins: 'forecolor code paste table image mathType', // 启用 forecolor 和 code 插件
end_container_on_empty_block: true,
content_css: 'default', // 加载 TinyMCE 默认样式表
+ mathjax: {
+ // 配置 MathJax 用于渲染数学公式
+ path: 'https://cdn.mathjax.org/mathjax/latest/MathJax.js',
+ config: 'TeX-AMS-MML_HTMLorMML'
+ },
//设置自定义按钮 myCustomToolbarButton
setup(ed) {
_this.$commonJS.initEditorButton(_this, ed);
@@ -408,30 +411,33 @@ export default {
// callback(menuItems);
// }
// });
-
+
ed.on('init', function () {
+ _this.$commonJS.inTinymceButtonClass();
const editorBody = ed.getBody();
// 创建 MutationObserver 监听内容变化
const observer = new MutationObserver(() => {
const currentContent = ed.getContent();
+
if (_this.isAutomaticUpdate) {
_this.$emit('updateChange', ed.getContent());
+
}
});
// 监听子节点和内容的变化
observer.observe(editorBody, { childList: true, subtree: true, characterData: true });
});
- // 定义自定义按钮
- ed.ui.registry.addButton('clearButton', {
- text: 'Empty',
+ // // 定义自定义按钮
+ // ed.ui.registry.addButton('clearButton', {
+ // text: 'Empty',
- onAction: () => {
- // 插入自定义表格到编辑器中
- ed.setContent('');
- }
- });
+ // onAction: () => {
+ // // 插入自定义表格到编辑器中
+ // ed.setContent('');
+ // }
+ // });
// 定义自定义按钮
ed.ui.registry.addButton('customButtonExportWord', {
diff --git a/src/components/page/components/html/index.vue b/src/components/page/components/html/index.vue
index 39b4f33..1c4d7fe 100644
--- a/src/components/page/components/html/index.vue
+++ b/src/components/page/components/html/index.vue
@@ -948,12 +948,16 @@ export default {
loading.close();
} else {
this.HtmlVisible = false;
- this.$router.push({
- path: '/GenerateCharts',
- query: {
- id: this.tg_article_id
- }
- });
+ window.open(this.$router.resolve({ path: '/GenerateCharts',
+ query: {
+ id: this.tg_article_id
+ } }).href, '_blank');
+ // this.$router.push({
+ // path: '/GenerateCharts',
+ // query: {
+ // id: this.tg_article_id
+ // }
+ // });
}
},
htmlLayout() {
diff --git a/src/components/page/components/table/content.vue b/src/components/page/components/table/content.vue
index 4395049..340d230 100644
--- a/src/components/page/components/table/content.vue
+++ b/src/components/page/components/table/content.vue
@@ -1,42 +1,50 @@
@@ -111,7 +129,7 @@ td input ::placeholder {
::v-deep .paste-area {
height: auto; /* A4纸高度 */
background: white; /* 纸张背景 */
-
+
/* padding: 25.4mm 19.1mm; //内边距 */
box-sizing: border-box; /* 确保内边距不会影响整体尺寸 */
transform-origin: top left;
@@ -141,8 +159,5 @@ td input ::placeholder {
overflow-wrap: break-word !important;
}
.text-container {
-
}
-
-
diff --git a/src/components/page/components/table/table.vue b/src/components/page/components/table/table.vue
index f195d67..a72148e 100644
--- a/src/components/page/components/table/table.vue
+++ b/src/components/page/components/table/table.vue
@@ -6,11 +6,12 @@
-
-
-
-
-
-
-
-
-
-
- Comment
-
- Edit
-
-
- Delete
-
-
-
-
-
-
-
![]()
-
{{
- item.image.note ? item.image.note : ''
- }}
-
-
-
{{
- item.table.title ? item.table.title : ''
- }}
-
-
-
-
{{
- item.table.note ? item.table.note : ''
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/page/components/table/word copy.vue b/src/components/page/components/table/word copy.vue
deleted file mode 100644
index e8a70e3..0000000
--- a/src/components/page/components/table/word copy.vue
+++ /dev/null
@@ -1,875 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/page/components/table/word.vue b/src/components/page/components/table/word.vue
index 2bf4ad7..190c497 100644
--- a/src/components/page/components/table/word.vue
+++ b/src/components/page/components/table/word.vue
@@ -1,16 +1,16 @@
-
+
-
-
-
-
![]()
-
+
-
+
@@ -146,22 +94,209 @@
-
+
+
+
@@ -300,6 +435,12 @@ export default {
id: {
type: String
},
+ isPreview: {
+ type: Boolean,
+ default() {
+ return false;
+ }
+ },
readonly: {
type: Boolean,
default() {
@@ -312,11 +453,7 @@ export default {
},
isEdit: {},
toolbar: {
- type: Array,
- required: false,
- default() {
- return [];
- }
+ required: false
},
contentList: {
type: Array,
@@ -326,10 +463,10 @@ export default {
}
},
comments: {
- type: Array,
+ type: Object,
default() {
- return [];
+ return {};
}
},
menubar: {
@@ -355,12 +492,16 @@ export default {
},
data() {
return {
+ scrollPosition: 0,
wordList: [],
+ commentList: [],
+ visibleDivs: [], // 存储当前可见的 div id
editors: {}, // 用于存储每个编辑器的实例
editorsInitialized: {}, // 用于存储每个编辑器实例
mediaUrl: mediaUrl, //
lastTag: null,
isEditComment: false,
+ isUserEditComment: false,
typesettingType: 1,
typesettingTypeOptions: [
{
@@ -416,40 +557,55 @@ export default {
},
// this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(newVal));
watch: {
- contentList(val) {
- if (val) {
- this.wordList = [...this.contentList];
- }
+ contentList: {
+ handler(val) {
+ console.log('val at line 550:', val);
+ if (val) {
+ this.wordList = [...this.contentList];
+ this.$nextTick(() => {
+ this.getCommentsData();
+ });
+ }
+ },
+ deep: true // 启用深度监听
}
},
+ updated() {
+ // 恢复子组件的滚动位置
+ // this.$refs.scrollDiv.scrollTop = this.scrollPosition;
+ },
mounted() {
- this.wordList = [...this.contentList];
- for (const key in this.editors) {
- if (this.editors[key]) {
- // 确保销毁所有编辑器实例
- tinymce.remove(this.editors[key]);
- this.editors[key] = null; // 清除引用
+ this.$nextTick(() => {
+ this.getCommentsData();
+ if (!this.isPreview && localStorage.getItem('scrollPosition')) {
+ this.$refs.scrollDiv.scrollTop = localStorage.getItem('scrollPosition'); // 滚动到 500px 位置
}
- }
- this.$refs.scrollDiv.addEventListener('scroll', this.divOnScroll, { passive: true });
-
+ });
this.isShowEditComment();
this.typesettingType = 1;
+ this.editors = {};
+ this.wordList = [...this.contentList];
+ this.$nextTick(() => {
+ this.getCommentsData();
+ });
+
+ this.$refs.scrollDiv.addEventListener('scroll', this.divOnScroll, { passive: true });
},
activated() {
- this.wordList = [...this.contentList];
- for (const key in this.editors) {
- if (this.editors[key]) {
- // 确保销毁所有编辑器实例
- tinymce.remove(this.editors[key]);
- this.editors[key] = null; // 清除引用
- }
- }
this.isShowEditComment();
this.typesettingType = 1;
+ this.editors = {};
+ this.wordList = [...this.contentList];
+
+ this.$refs.scrollDiv.addEventListener('scroll', this.divOnScroll, { passive: true });
},
deactivated() {
this.destroyTinymce();
+ this.editors = {};
+ },
+ beforeDestroy() {
+ console.log('at line 523:', '是否走了销毁');
+
for (const key in this.editors) {
if (this.editors[key]) {
// 确保销毁所有编辑器实例
@@ -457,94 +613,131 @@ export default {
this.editors[key] = null; // 清除引用
}
}
+ // 页面销毁前清理定时器和事件监听器
+ },
+ destroy() {
+ this.destroyTinymce();
+ this.editors = {};
},
methods: {
- clearEditor(editorId){
- console.log('editorId at line 462:', editorId)
- for (const key in this.editors) {
- if (this.editors[key]) {
- // 确保销毁所有编辑器实例
- tinymce.remove(this.editors[key]);
- this.editors[key] = null; // 清除引用
+ // 右侧批注列点击时,触发高亮左侧对应的批注
+ // 右侧批注列点击时,触发高亮左侧对应的批注
+ highlightLeftComment(commentId) {
+ // 清除之前的高亮
+ this.clearHighlight();
+
+ // 获取左侧所有对应的批注元素并添加高亮
+ const remarkElements = document.querySelectorAll(`[comment-id="${commentId}"]`);
+ if (remarkElements.length > 0) {
+ remarkElements.forEach((remarkElement) => {
+ // 随机生成颜色或使用自定义颜色
+ // const randomColor = this.getRandomLightColor();
+ remarkElement.style.backgroundColor = '#f77b7b'; // 设置背景色
+ remarkElement.classList.add('highlighted'); // 添加高亮样式类
+ });
}
- }
},
+
+ // 清除所有批注的高亮
+ clearHighlight() {
+ const allRemarks = document.querySelectorAll('.remarkbg');
+ allRemarks.forEach((element) => {
+ element.style.backgroundColor = '#f3d5d5c2'; // 重置背景色
+ element.classList.remove('highlighted'); // 移除高亮类
+ });
+ },
+ solveComment(data) {
+ this.$emit('solveComment', data);
+ },
+ cancelSolveComment(data) {
+ this.$emit('cancelSolveComment', data);
+ },
+ replyComment(data) {
+ this.$emit('replyComment', data);
+ },
+ handleDragOver(e) {
+ e.preventDefault(); // 阻止默认行为,允许放置内容
+ e.stopPropagation(); // 防止事件冒泡
+ },
+ handleDragEnter(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ // 确保选择到最外层 div
+ const outerDiv = e.target.closest('.drop-target') || e.target;
+ console.log('Drag Enter:', outerDiv); // 输出目标 div
+
+ if (outerDiv) {
+ }
+ },
+ handleDragLeave(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ // 恢复边框样式
+ const outerDiv = e.target.closest('.drop-target') || e.target;
+ if (outerDiv) {
+ }
+ },
+ handleDrop(e) {
+ e.preventDefault(); // 阻止默认行为
+ e.stopPropagation(); // 防止事件冒泡
+ // const imageData = e.dataTransfer.getData('image');
+ // const tableData = e.dataTransfer.getData('image');
+
+ // 获取最外层 div 的 id 属性
+ const outerDiv = e.target.closest('.drop-target');
+ const targetId = outerDiv ? outerDiv.id : null;
+
+ this.$emit('onDrop', e, targetId.slice(6)); // 阻止默认的行为
+ },
+ clearEditor(editorId) {
+ console.log('editorId at line 462:', editorId);
+ for (const key in this.editors) {
+ if (this.editors[key]) {
+ // 确保销毁所有编辑器实例
+ tinymce.remove(this.editors[key]);
+ this.editors[key] = null; // 清除引用
+ }
+ }
+ },
+
initTinymceContent(editorId) {
var _this = this;
tinymce.init({
+ readonly: true,
selector: `#${editorId}`,
inline: true,
license_key: 'gpl', // 使用开源 GPL 许可证
content_css: false,
table_resize_bars: true,
image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小)
- valid_elements: 'img[src|alt|width|height],strong,em,sub,sup,blue,table,b,i', // 允许的标签和属性
+ valid_elements: '*[*]',
- plugins: 'forecolor code paste table image resize searchreplace',
- content_style: `${tableStyle + this.wordStyle}
- /* 添加批注 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c;
- fill:rgb(19, 188, 32);
- }
- /* 成功 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: rgb(19, 188, 32);
- color: #fff;
- fill:rgb(19, 188, 32);
- }
- /* 删除 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: red;
- color: #fff;
+ plugins: 'forecolor code paste table image resize searchreplace dragdrop',
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c; /* 设置字体颜色 */
-
- fill:#f56c6c !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: rgb(19, 188, 32);
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: red;
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(2) .tox-toolbar__group:nth-child(4) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- color: #007bff; /* 设置字体颜色 */
- }
-
- .tox-toolbar-overlord .tox-toolbar:nth-child(2) .tox-toolbar__group:nth-child(4) button.tox-tbtn:nth-child(2){
- font-weight:bold !important;
- color: #007bff; /* 设置字体颜色 */
- text-decoration: line-through;
- }
-
- `,
menubar: false,
- toolbar: [
- 'commentAdd |delete| Save',
- 'customDropdown |bold italic | subscript superscript | customBlue removeBlue | searchreplace '
- ],
+ toolbar: _this.isEditComment ? ['commentAdd |delete| level1 level2 level3|addRow|Edit'] : ['delete|addRow| Edit'],
end_container_on_empty_block: true,
content_css: 'default ',
+ content_style: `${tableStyle + this.wordStyle}
+
+
+`,
setup(ed) {
+ ed.on('init', function () {
+ _this.$commonJS.inTinymceButtonClass();
+ });
+ ed.on('dragover', function (e) {
+ e.preventDefault(); // 阻止默认行为
+ e.stopPropagation();
+ });
+
+ ed.on('dragenter', function (e) {
+ e.preventDefault(); // 阻止默认行为
+ e.stopPropagation();
+ });
+
ed.on('keydown', function (e) {
// 检查是否按下回车键
if (e.keyCode === 13) {
@@ -559,7 +752,13 @@ export default {
});
_this.$commonJS.initEditorButton(_this, ed);
},
- init_instance_callback: (editor) => {}
+ init_instance_callback: (editor) => {
+ const disabledButtons = document.querySelectorAll('.tox-tbtn--disabled');
+ disabledButtons.forEach((button) => {
+ button.classList.remove('tox-tbtn--disabled');
+ button.removeAttribute('aria-disabled');
+ });
+ }
});
},
initTinymceImg(editorId) {
@@ -577,56 +776,18 @@ export default {
plugins: 'forecolor code paste table image resize searchreplace',
content_style: `${tableStyle + this.wordStyle}
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c;
- fill:rgb(19, 188, 32);
- }
- /* 成功 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: rgb(43, 129, 239) !important;
- color: #fff;
- fill:rgb(19, 188, 32);
- }
- /* 删除 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: red;
- color: #fff;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c; /* 设置字体颜色 */
-
- fill:#f56c6c !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: rgb(43, 129, 239) !important;
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: red;
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
`,
menubar: false,
- toolbar: ['commentAdd |delete| Edit'],
+ toolbar: _this.isEditComment ? ['commentAdd |delete| addRow|Edit'] : ['delete|addRow| Edit'],
end_container_on_empty_block: true,
content_css: 'default ',
setup(ed) {
+ ed.on('init', function () {
+ _this.$commonJS.inTinymceButtonClass();
+ });
// 禁止输入内容,但工具栏按钮仍然有效
ed.on('keydown', function (e) {
if (ed.mode.get() === 'readonly') {
@@ -700,56 +861,15 @@ export default {
plugins: 'forecolor code paste table image resize searchreplace',
content_style: `${tableStyle + this.wordStyle}
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c;
- fill:rgb(19, 188, 32);
- }
- /* 成功 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: rgb(43, 129, 239) !important;
- color: #fff;
- fill:rgb(19, 188, 32);
- }
- /* 删除 */
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1){
- font-weight:bold !important;
- background-color: red;
- color: #fff;
-
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(1) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color:#fef0f0;
- color: #f56c6c; /* 设置字体颜色 */
-
- fill:#f56c6c !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(3) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: rgb(43, 129, 239) !important;
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
- .tox-toolbar-overlord .tox-toolbar:nth-child(1) .tox-toolbar__group:nth-child(2) button.tox-tbtn:nth-child(1) svg{
- font-weight:bold !important;
- background-color: red;
- color: #fff; /* 设置字体颜色 */
- fill:#fff !important;
- font-size:16px!important;
- }
-
-
- `,
+ `,
menubar: false,
- toolbar: ['commentAdd |delete| Edit'],
+ toolbar: _this.isEditComment ? ['commentAdd |delete| addRow|Edit'] : ['delete| addRow|Edit'],
end_container_on_empty_block: true,
content_css: 'default ',
setup(ed) {
+ ed.on('init', function () {
+ _this.$commonJS.inTinymceButtonClass();
+ });
// 禁止输入内容,但工具栏按钮仍然有效
ed.on('keydown', function (e) {
if (ed.mode.get() === 'readonly') {
@@ -810,38 +930,44 @@ export default {
});
},
initializeEditor(index, type, data) {
- const editorId = `editor${index}`;
- // 检查当前编辑器是否已经初始化
- if (this.editors[editorId]) return;
- // 销毁所有已初始化的编辑器实例
- for (const key in this.editors) {
- if (this.editors[key]) {
- // 确保销毁所有编辑器实例
- tinymce.remove(this.editors[key]);
- this.editors[key] = null; // 清除引用
+ if (!this.isPreview) {
+ const editorId = `editor${index}`;
+ // 检查当前编辑器是否已经初始化
+ if (this.editors[editorId]) return;
+ // 销毁所有已初始化的编辑器实例
+ for (const key in this.editors) {
+ if (this.editors[key]) {
+ // 确保销毁所有编辑器实例
+ tinymce.remove(this.editors[key]);
+ this.editors[key] = null; // 清除引用
+ }
}
- }
- if (type == 'img') {
- this.initTinymceImg(editorId);
- } else if (type == 'table') {
- this.initTinymceTable(editorId);
- } else {
- this.initTinymceContent(editorId);
+ if (type == 'img') {
+ this.initTinymceImg(editorId);
+ } else if (type == 'table') {
+ this.initTinymceTable(editorId);
+ } else {
+ this.initTinymceContent(editorId);
+ }
+ this.$set(this.editors, editorId, tinymce.get(`editor${index}`));
}
- this.$set(this.editors, editorId, tinymce.get(`editor${index}`));
},
deleteComment(data) {
this.$emit('deleteComment', data);
},
- editComment(data) {
- this.$emit('editComment', data);
+ editComment(data, index, type) {
+ this.$emit('editComment', data, type);
},
getCommentRemark(data) {
console.log('data at line 426:', data);
- var info = this.comments.find((e) => e.am_id == data.am_id);
- if (info && info.remark) {
- return info.remark;
+ const items = this.comments[data.am_id];
+
+ // 如果找到了对应的数据项
+ if (items) {
+ console.log(items);
+ return items;
+ } else {
}
},
getTime(timestamp) {
@@ -861,29 +987,149 @@ export default {
// 格式化为 年-月-日 时:分:秒
const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`;
- console.log(formattedDate); // 输出: 2025-10-20 15:30:03
-
return formattedDate;
},
divOnScroll() {
- // 检查每个编辑器是否在可视区域内
- for (const key in this.editors) {
- const editorElement = document.getElementById(key);
- const editor = this.editors[key];
+ if (!this.isPreview) {
+ // const scrollTop = scrollDiv.scrollTop; // 获取垂直滚动距离
+ this.scrollPosition = this.$refs.scrollDiv.scrollTop;
+ localStorage.setItem('scrollPosition', this.scrollPosition);
+ console.log('this.scrollPosition at line 980:', this.scrollPosition);
+ // 检查每个编辑器是否在可视区域内
+ for (const key in this.editors) {
+ const editorElement = document.getElementById(key);
+ const editor = this.editors[key];
- if (editorElement) {
- const rect = editorElement.getBoundingClientRect();
- const isVisible =
- rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth;
+ if (editorElement) {
+ const rect = editorElement.getBoundingClientRect();
+ const isVisible =
+ rect.top >= 0 && rect.left >= 0 && rect.bottom <= window.innerHeight && rect.right <= window.innerWidth;
- if (!isVisible) {
- // 如果编辑器不可见,销毁该编辑器实例
- if (editor) {
- tinymce.remove(editor);
- this.$set(this.editors, key, null); // 清除该编辑器的引用
+ if (!isVisible) {
+ // 如果编辑器不可见,销毁该编辑器实例
+ if (editor) {
+ tinymce.remove(editor);
+ this.$set(this.editors, key, null); // 清除该编辑器的引用
+ }
}
}
}
+ this.getCommentsData();
+ }
+ },
+ // 随机生成颜色的函数
+ // 随机生成浅色透明颜色的函数
+ getRandomLightColor() {
+ // 随机生成 RGB 颜色的值,使其偏向浅色
+ const r = Math.floor(Math.random() * 128) + 127; // 使红色值偏浅
+ const g = Math.floor(Math.random() * 128) + 127; // 使绿色值偏浅
+ const b = Math.floor(Math.random() * 128) + 127; // 使蓝色值偏浅
+ const a = (Math.random() * 0.4 + 0.4).toFixed(2); // 设置透明度范围为 0.4 到 0.7 之间
+
+ return `#f3d5d5c2`; // 返回 RGBA 颜色
+ },
+
+ highlightImg(imgId, annotations) {
+ if (annotations.some((annotation) => annotation.content === '') && !this.isPreview) {
+ return 'remarkbg';
+ } else {
+ return '';
+ }
+ },
+ highlightImgCommentId(imgId, annotations) {
+ const emptyContentIndexes = annotations
+ .map((annotation, index) => (annotation.content === '' ? annotation.amc_id : -1)) // 找到内容为空的批注项的索引,其他项返回 -1
+ .filter((index) => index !== -1) // 过滤掉值为 -1 的项
+ .join(','); // 以逗号连接索引
+
+ return emptyContentIndexes;
+ },
+ highlightText(text, annotations) {
+ if (!this.isPreview) {
+ let tempText = text;
+
+ // 1. 使用占位符替代批注内容
+ const placeholders = [];
+ annotations.forEach((annotation, index) => {
+ if (annotation.content == '') {
+ return tempText;
+ }
+ const placeholder = `{{remark_placeholder_${index}}}`; // 占位符
+ const regExp = new RegExp(`(${annotation.content})`, 'gi'); // 全局匹配批注内容
+
+ // 如果批注内容存在,替换成占位符
+ if (tempText.includes(annotation.content)) {
+ tempText = tempText.replace(regExp, placeholder);
+ placeholders.push({ placeholder, annotation, index });
+ }
+ });
+
+ // 2. 为占位符添加高亮
+ placeholders.forEach(({ placeholder, annotation, index }) => {
+ const regExp = new RegExp(placeholder, 'gi');
+
+ tempText = tempText.replace(regExp, (match) => {
+ // 随机生成浅色透明背景颜色
+ const randomColor = this.getRandomLightColor();
+
+ let highlightedText = `
+
+ `;
+
+ return highlightedText;
+ });
+ });
+
+ // 3. 返回处理后的文本
+ return tempText;
+ } else {
+ return text;
+ }
+ },
+
+ getCommentsData() {
+ if (!this.isPreview) {
+ this.clearHighlight();
+ const divs = document.querySelectorAll('.pMain');
+ const visibleDivs = [];
+ divs.forEach((div) => {
+ const rect = div.getBoundingClientRect();
+ // 检查 div 是否部分可见(只要它的任何一部分在视口内)
+ if (rect.top < window.innerHeight && rect.bottom > 0) {
+ // 判断 div 是否有 remark 属性
+ if (div.hasAttribute('remark')) {
+ // 获取 remark 属性的值(如果需要)
+ const remarkValue = div.getAttribute('remark');
+
+ if (remarkValue == 1) {
+ visibleDivs.push(div.id.slice(6)); // 假设 id 以 "div-" 开头
+ }
+ // 如果有 remark 属性,将该 div 的 id 加入 visibleDivs
+ }
+ }
+ });
+ this.commentList = [];
+ this.visibleDivs = [...visibleDivs];
+ this.visibleDivs.forEach((e) => {
+ this.commentList.push({
+ am_id: e,
+ comment: this.comments[e]
+ });
+ });
}
},
isShowEditComment() {
@@ -895,6 +1141,11 @@ export default {
} else {
this.isEditComment = false;
}
+ if (identity.includes('author')) {
+ this.isUserEditComment = true;
+ } else {
+ this.isUserEditComment = false;
+ }
}
},
// 查看评论详情
@@ -1560,8 +1811,8 @@ export default {
z-index: 9999 !important;
}
.remarkbg {
- background-color: #f3d5d5c2;
- border-right: 2px solid #cd5454;
+ background-color: #f3d5d5c2 !important;
+ border-right: 2px solid #cd5454 !important;
}
.isRemark {
display: flex;
@@ -1594,21 +1845,18 @@ export default {
.comment-item {
z-index: 10;
list-style: none;
- width: 320px;
- position: absolute;
- right: -340px;
}
.comment-item::before {
- content: '';
+ /* content: '';
position: absolute;
- top: 24px; /* 调整线段开始的超出位置 */
- left: -32px; /* 调整线段开始的超出位置 */
- width: 34px; /* 设置斜线的长度 */
- height: 0; /* 设置高度为 0,使用 border 来创建线条 */
- border-top: 2px dashed #cd5454; /* 设置斜线为虚线,设置颜色和宽度 */
+ top: 24px;
+ left: -32px;
+ width: 34px;
+ height: 0;
+ border-top: 2px dashed #cd5454;
- background-color: #cd5454; /* 设置斜线的颜色 */
- transform: rotate(-15deg); /* 设置斜线的角度 */
+ background-color: #cd5454;
+ transform: rotate(-15deg); */
}
.commentOperateItem {
display: flex;
@@ -1623,17 +1871,42 @@ export default {
}
.Resolved {
- background-color: #dedede;
- margin-left: 10px;
- border-color: #dedede;
- color: #8888a6;
+ /* background-color: #dedede; */
+ background-color: rgb(19, 188, 32);
+ /* border-color: #dedede; */
+ border-color: rgb(19, 188, 32);
+ margin-left: 6px;
+ /* color: #000; */
+ color: #fff;
+ box-sizing: border-box;
padding: 2px 4px;
border-radius: 2px;
- font-size: 14px;
- font-weight: 500;
+ font-size: 12px;
+ font-weight: 400;
}
.MaxPicture img {
width: 580px !important;
}
+::-webkit-scrollbar {
+ width: 6px; /* 垂直滚动条的宽度 */
+ height: 6px; /* 水平滚动条的高度 */
+}
+
+/* 滚动条轨道样式 */
+::-webkit-scrollbar-track {
+ background: #f1f1f1; /* 滚动条轨道颜色 */
+ border-radius: 6px; /* 轨道圆角 */
+}
+
+/* 滚动条滑块样式 */
+
+/* 滑块在悬停时的样式 */
+::-webkit-scrollbar-thumb:hover {
+ background: #555; /* 滑块悬停时的颜色 */
+}
+.highlighted {
+ border: 2px solid #cd5454; /* 高亮边框 */
+ box-shadow: 0 0 10px #f77b7b; /* 高亮阴影 */
+}
diff --git a/src/components/page/components/table/wordHtmlTypesetting.vue b/src/components/page/components/table/wordHtmlTypesetting.vue
index a9f153b..8372d73 100644
--- a/src/components/page/components/table/wordHtmlTypesetting.vue
+++ b/src/components/page/components/table/wordHtmlTypesetting.vue
@@ -310,21 +310,12 @@
-
-
+
- Add Table
-
+ Add Table
-
-
+ >
+
@@ -661,11 +652,11 @@ export default {
handleSelectMenu(v) {
this.currentMenu = v;
this.currentSelectType = '0';
- if (v == 1) {
- this.getCommentList();
- } else {
- this.filterData();
- }
+ // if (v == 1) {
+ // this.getCommentList();
+ // } else {
+ this.filterData();
+ // }
},
selectType(v) {
this.currentSelectType = v.type;
@@ -756,7 +747,6 @@ export default {
});
},
onDragStart($event, item, index, type) {
-
this.$emit('onDragStart', $event, item, index, type);
},
changeActiveNames(e) {
@@ -854,10 +844,12 @@ export default {
text-align: center;
table-layout: auto;"
>`;
- table.table.forEach((row) => {
- modalContent += `
`;
- row.forEach((cell) => {
- modalContent += `
+
+ if (table.table&&table.table.length > 0) {
+ table.table.forEach((row) => {
+ modalContent += `
`;
+ row.forEach((cell) => {
+ modalContent += `
|
${cell.text}
| `;
+ });
+ modalContent += `
`;
});
- modalContent += ``;
- });
+ }
+
modalContent += `
`;
this.$commonJS.createImageModal(index, modalContent, 'table', '');
});
+
+ {{ $t('commonTable.reply') }}
+
++
+ {{ $t('commonTable.solve') }}
+
++
+ {{ $t('commonTable.cancelsolve') }}
+
++
+ {{ $t('commonTable.delete') }}
+
+