This commit is contained in:
2025-01-23 11:13:12 +08:00
parent 49ee596932
commit d652ab2354
5 changed files with 67 additions and 60 deletions

View File

@@ -232,8 +232,8 @@
> >
<el-form ref="editMes" :model="commentForm" label-width="115px"> <el-form ref="editMes" :model="commentForm" label-width="115px">
<el-form-item label="Select Content:" v-if="commentForm.content"> <el-form-item label="Select Content:" v-if="commentForm.content">
<p style="background: #eef0f4; line-height: 20px; padding: 10px; box-sizing: border-box"> <p style="background: #eef0f4; line-height: 20px; padding: 10px; box-sizing: border-box" v-html="commentForm.content">
{{ commentForm.content }}
</p> </p>
</el-form-item> </el-form-item>
<el-form-item label="Word"> <el-form-item label="Word">

View File

@@ -357,7 +357,7 @@ export default {
statusbar: false, // 关闭底部状态栏 statusbar: false, // 关闭底部状态栏
custom_colors: false, custom_colors: false,
color_map: ['0082AA', 'TMR Blue'], color_map: ['0082AA', 'TMR Blue'],
plugins: 'forecolor code paste table image mathType', // 启用 forecolor 和 code 插件 plugins: 'forecolor code paste table image mathType searchreplace', // 启用 forecolor 和 code 插件
end_container_on_empty_block: true, end_container_on_empty_block: true,
content_css: 'default', // 加载 TinyMCE 默认样式表 content_css: 'default', // 加载 TinyMCE 默认样式表
mathjax: { mathjax: {

View File

@@ -15,7 +15,7 @@
:value="value" :value="value"
:typesettingType="typesettingType" :typesettingType="typesettingType"
class="paste-area text-container" class="paste-area text-container"
:toolbar="['bold italic|customBlue removeBlue|subscript superscript|clearButton']" :toolbar="['bold italic|customBlue removeBlue|subscript superscript|searchreplace|clearButton']"
style=" style="
/* white-space: pre-line; */ /* white-space: pre-line; */
line-height: 12px; line-height: 12px;

View File

@@ -11,7 +11,7 @@
:value="updatedHtml" :value="updatedHtml"
:typesettingType="typesettingType" :typesettingType="typesettingType"
class="paste-area text-container" class="paste-area text-container"
:toolbar="['bold italic|customBlue removeBlue|subscript superscript|table tabledelete| mathType |clearButton']" :toolbar="['bold italic|customBlue removeBlue|subscript superscript|table tabledelete| searchreplace |clearButton']"
style=" style="
/* white-space: pre-line; */ /* white-space: pre-line; */
line-height: 12px; line-height: 12px;

View File

@@ -76,23 +76,31 @@
:id="'editor' + item.am_id" :id="'editor' + item.am_id"
:main-id="item.am_id" :main-id="item.am_id"
> >
<!-- 标题部分 -->
<font class="font" :style="`width: ${item.width ? `${item.width}px` : '100%'}`"> <font class="font" :style="`width: ${item.width ? `${item.width}px` : '100%'}`">
<span v-html="item.table.title ? item.table.title : ''"></span> <span v-html="highlightText(item.table.title || '', item.checks)"></span>
</font> </font>
<!-- 表格部分 -->
<table border="1" style="width: auto; border-collapse: collapse; text-align: center"> <table border="1" style="width: auto; border-collapse: collapse; text-align: center">
<tr v-for="(row, i) in JSON.parse(item.table.table_data)"> <tr v-for="(row, i) in JSON.parse(item.table.table_data)" :key="i">
<td :colspan="`${cell.colspan || 1}`" :rowspan="`${cell.rowspan || 1}`" v-for="(cell, i1) in row"> <td
<span v-html="cell.text"></span> v-for="(cell, i1) in row"
:key="i1"
:colspan="`${cell.colspan || 1}`"
:rowspan="`${cell.rowspan || 1}`">
<span v-html="highlightText(cell.text || '', item.checks)"></span>
</td> </td>
</tr> </tr>
</table> </table>
<!-- 备注部分 -->
<font class="font" :style="`width: ${item.width ? `${item.width}px` : '100%'}`"> <font class="font" :style="`width: ${item.width ? `${item.width}px` : '100%'}`">
<span v-html="item.table.note ? item.table.note : ''"></span <span v-html="highlightText(item.table.note || '', item.checks)"></span>
></font> </font>
</div> </div>
<div <div
id="drop-target" id="drop-target"
@dragover="handleDragOver" @dragover="handleDragOver"
@@ -716,7 +724,7 @@ export default {
image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小) image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小)
valid_elements: '*[*]', valid_elements: '*[*]',
plugins: 'forecolor code paste table image resize searchreplace dragdrop', plugins: 'forecolor code paste table image resize dragdrop',
menubar: false, menubar: false,
toolbar: _this.isEditComment ? ['commentAdd |delete| level1 level2 level3|addRow|Edit'] : ['delete|addRow| Edit'], toolbar: _this.isEditComment ? ['commentAdd |delete| level1 level2 level3|addRow|Edit'] : ['delete|addRow| Edit'],
@@ -775,7 +783,7 @@ export default {
image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小) image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小)
valid_elements: '*[*]', valid_elements: '*[*]',
plugins: 'forecolor code paste table image resize searchreplace', plugins: 'forecolor code paste table image resize ',
content_style: `${tableStyle + this.wordStyle} content_style: `${tableStyle + this.wordStyle}
@@ -860,7 +868,7 @@ export default {
table_resize_bars: true, table_resize_bars: true,
valid_elements: '*[*]', valid_elements: '*[*]',
image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小) image_advtab: false, // 禁用图片高级选项卡(防止自动调整大小)
plugins: 'forecolor code paste table image resize searchreplace', plugins: 'forecolor code paste table image resize ',
content_style: `${tableStyle + this.wordStyle} content_style: `${tableStyle + this.wordStyle}
`, `,
@@ -1076,18 +1084,18 @@ export default {
const regExp = new RegExp(placeholder, 'gi'); const regExp = new RegExp(placeholder, 'gi');
tempText = tempText.replace(regExp, (match) => { tempText = tempText.replace(regExp, (match) => {
// 随机生成浅色透明背景颜色
const randomColor = this.getRandomLightColor(); const randomColor = this.getRandomLightColor();
return `
let highlightedText = ` <span
<span class="remarkbg" class="remarkbg"
ref="remark_${annotation.amc_id}" style="background-color: ${randomColor};
style="background-color: ${randomColor} !important; position: relative;
position: relative !important; display: inline-block;
border-left: 2px solid #cd5454 !important; white-space: nowrap;
border-right: 2px solid #cd5454 !important;" overflow-wrap: anywhere;
border-left: 2px solid #cd5454;
border-right: 2px solid #cd5454;"
comment-Id="${annotation.amc_id}" comment-Id="${annotation.amc_id}"
> >
${annotation.content} ${annotation.content}
<span class="positionRemarkIndex" <span class="positionRemarkIndex"
@@ -1096,9 +1104,8 @@ export default {
</span> </span>
</span> </span>
`; `;
return highlightedText;
}); });
}); });
// 3. 返回处理后的文本 // 3. 返回处理后的文本