This commit is contained in:
2025-02-19 11:38:34 +08:00
parent 7e0b342758
commit 36fe09527a
14 changed files with 167 additions and 55 deletions

View File

@@ -496,7 +496,7 @@ export default {
},
async getContent(type, content) {
console.log('content at line 498:', content)
if (type == 'content') {
content = content.replace(/<(?!\/?(img|b|i|sub|sup|span|strong|em |blue)\b)[^>]+>/g, '');
@@ -522,7 +522,7 @@ export default {
// 获取最终修改后的 HTML
content = div.innerHTML;
console.log('content at line 486:', content);
this.saveContent(content, this.currentContent.am_id);

View File

@@ -359,6 +359,7 @@ export default {
custom_colors: false,
color_map: ['0082AA', 'TMR Blue'],
plugins: 'texttransform', // 启用 forecolor 和 code 插件
// plugins: 'forecolor code paste table image mathType searchreplace raw', // 启用 forecolor 和 code 插件
end_container_on_empty_block: true,
content_css: 'default', // 加载 TinyMCE 默认样式表
@@ -516,7 +517,7 @@ export default {
var content = window.tinymce.get(this.tinymceId).getContent();
content = content.replace(/<span[^>]*>/g, '').replace(/<\/span>/g, ''); // 去除span标签
console.log('content at line 513:', content)
content = content.replace(/<strong>/g, '<b>').replace(/<\/strong>/g, '</b>');
content = content.replace(/<em>/g, '<i>').replace(/<\/em>/g, '</i>');
content = content.replace(/&nbsp;/g, ' '); // 将所有 &nbsp; 替换为空格

View File

@@ -15,7 +15,7 @@
:value="value"
:typesettingType="typesettingType"
class="paste-area text-container"
:toolbar="['bold italic|customBlue removeBlue|subscript superscript|searchreplace|clearButton']"
:toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|searchreplace|clearButton']"
style="
/* white-space: pre-line; */
line-height: 12px;
@@ -80,7 +80,7 @@ export default {
this.$refs.tinymceChild1.getContent(type);
},
getContent(type, content) {
console.log('content at line 75:', content)
this.$emit('getContent', type, content);
}
}

View File

@@ -101,8 +101,8 @@ b span{
padding: 5px;
text-align:left !important;
white-space: pre-wrap; /* 保留换行符并换行 */
word-wrap: break-word; /* 长单词自动换行 */
word-break: break-word;
word-wrap: nomarl; /* 长单词自动换行 */
word-break: nomarl;
font-family:'Charis SIL' !important;
font-size: 7.5000pt !important;
mso-font-kerning: 1.0000pt !important;

View File

@@ -11,7 +11,7 @@
:value="updatedHtml"
:typesettingType="typesettingType"
class="paste-area text-container"
:toolbar="['bold italic|customBlue removeBlue|subscript superscript|table tabledelete| searchreplace |clearButton']"
:toolbar="['bold italic|customBlue removeBlue|myuppercase myuppercasea Line|subscript superscript|table tabledelete| searchreplace |clearButton']"
style="
/* white-space: pre-line; */
line-height: 12px;
@@ -102,10 +102,9 @@ export default {
methods: {
isHeaderRow(rowIndex,table) {
console.log('table at line 697:', table)
var head=table[0]
console.log('head at line 699:', head[0].rowspan)
return rowIndex < head[0].rowspan; // 假设前两行是表头
},

View File

@@ -1,9 +1,9 @@
<template>
<div class="tinymce-container editor-container word-container" :style="!isPreview ? 'padding:20px;' : 'padding:0px;'" ref="scrollDiv">
<div class="tinymce-container editor-container word-container" :style="!isPreview ? 'padding:10px 20px 10px 10px;' : 'padding:0px;'" ref="scrollDiv">
<div
style="
box-shadow: 0 2px 2px -2px rgba(34, 47, 62, 0.1), 0 8px 8px -4px rgba(34, 47, 62, 0.07);
margin: 10px 0;
margin: 0px 0;
box-sizing: border-box;
display: flex;
"
@@ -86,7 +86,7 @@
</font>
<!-- 表格部分 -->
<table border="1" style="width: auto; border-collapse: collapse; text-align: center">
<table border="1" style="width: 100%; border-collapse: collapse; text-align: center">
<tr v-for="(row, i) in JSON.parse(item.table.table_data)" :key="i" :class="{ 'table-header-row': isHeaderRow(i,item.table.table_data) }">
<td
v-for="(cell, i1) in row"
@@ -133,7 +133,7 @@
style="
width: 310px;
position: fixed;
top: 60px;
top: 70px;
box-sizing: border-box;
right: 10px;
bottom: 0;
@@ -146,7 +146,7 @@
v-for="(item, index) in commentList"
class="comment-item annotation"
:data-target="`main-${item.am_id}`"
style="width: 100%; margin: 10px 0; background: #fafafa; box-sizing: border-box"
style="width: 100%; margin:0 0 10px; background: #fafafa; box-sizing: border-box"
>
<div>
<div style="display: flex; align-items: center; justify-content: space-between; background-color: #f3d5d5c2">
@@ -163,8 +163,8 @@
</div>
<div
style="
margin-bottom: 10px;
padding: 10px 10px;
padding:6px 6px;
box-sizing: border-box;
border-bottom: 1px solid rgba(243, 213, 213);
"
@@ -173,10 +173,10 @@
@click="highlightLeftComment(commont.amc_id, item.am_id)"
>
<div style="width: 100%; display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center">
<div style="display: flex; align-items: center;line-height: 20px;">
<span
:style="commont.estate == 1 ? 'opacity:0.6;color:rgb(19, 188, 32);' : ''"
style="color: #e61a12; font-weight: bold"
style="color: #e61a12; font-weight: bold;font-size: 12px;"
>{{ commentIndex + 1 }}</span
>
<span
@@ -195,7 +195,7 @@
$t('commonTable.Resolved')
}}</span>
</div>
<div style="display: flex; align-items: center; justify-content: center">
<div style="display: flex; align-items: center; justify-content: center;line-height: 20px;">
<span style="color: #b8b7b7; font-size: 12px">{{ getTime(commont.ctime) }}</span
><span
style="color: #aaa; font-size: 13px; margin: 0 4px"
@@ -302,7 +302,7 @@
"
>
<i class="el-icon-user-solid" style="color: #333; padding: 0 4px"></i>
<div v-html="commont.author_remark" style="width: calc(100% - 20px); font-size: 14px"></div>
<div v-html="commont.author_remark" style="width: calc(100% - 20px); font-size: 13px;line-height: 14px;"></div>
</div>
<i
class="el-icon-edit"
@@ -382,8 +382,8 @@ b span{
padding: 5px;
text-align: !important;
white-space: pre-wrap; /* 保留换行符并换行 */
word-wrap: break-word; /* 长单词自动换行 */
word-break: break-word;
word-wrap: nomarl; /* 长单词自动换行 */
word-break: nomarl;
font-family:'Charis SIL' !important;
font-size: 7.5000pt !important;
mso-font-kerning: 1.0000pt !important;
@@ -623,7 +623,7 @@ export default {
this.editors = {};
},
beforeDestroy() {
console.log('at line 523:', '是否走了销毁');
for (const key in this.editors) {
if (this.editors[key]) {
@@ -693,9 +693,9 @@ export default {
isHeaderRow(rowIndex,table) {
var table=JSON.parse(table)
console.log('table at line 697:', table)
var head=table[0]
console.log('head at line 699:', head[0].rowspan)
return rowIndex < head[0].rowspan; // 假设前两行是表头
},
@@ -1134,7 +1134,7 @@ export default {
});
});
if (type == 0 && tempText == '') {
console.log('tempText at line 1122:', tempText);
tempText =
tempText +
`<img contenteditable="${false}" src="${this.imagePath}" alt="" style="width: 20px;height: 20px;opacity:0.6;">`;
@@ -1925,10 +1925,11 @@ export default {
/* color: #000; */
color: #fff;
box-sizing: border-box;
padding: 2px 4px;
padding: 1px 2px;
border-radius: 2px;
font-size: 12px;
font-size: 11px;
font-weight: 400;
line-height: 14px;
}
.MaxPicture img {
width: 580px !important;

View File

@@ -325,7 +325,7 @@ export default {
this.filterData();
},
filterData(type) {
console.log('type at line 374:', type);
if (type) {
if (type == 'img') {
this.imagesList = [...this.images];
@@ -542,7 +542,7 @@ export default {
this.$commonJS.createImageModal(index, modalContent, 'table', '');
});
}
console.log('this.tables at line 533:', this.tables);
});
}
},
@@ -582,6 +582,7 @@ export default {
::v-deep .wordTableHtml table {
cursor: pointer;
background-color: #fff !important;
border-bottom: 1px solid #000 !important;
}
.el-menu-vertical-demo {
width: 85px;

View File

@@ -631,7 +631,7 @@ export default {
})
.then((res) => {
this.comments = res.data.list;
console.log('this.comments at line 537:', this.comments);
});
},
addImage() {
@@ -663,7 +663,7 @@ export default {
this.filterData();
},
filterData(type) {
console.log('type at line 374:', type);
if (type) {
if (type == 'img') {
this.imagesList = [...this.images];
@@ -866,7 +866,7 @@ export default {
this.$commonJS.createImageModal(index, modalContent, 'table', '');
});
}
console.log('this.tables at line 533:', this.tables);
});
}
},
@@ -908,6 +908,7 @@ export default {
::v-deep .wordTableHtml table {
cursor: pointer;
background-color: #fff !important;
border-bottom: 1px solid #000 !important;
}
.el-menu-vertical-demo {
width: 85px;

View File

@@ -313,5 +313,6 @@ export default {
::v-deep .wordTableHtml table {
cursor: pointer;
background-color: #fff !important;
border-bottom: 1px solid #000 !important;
}
</style>