This commit is contained in:
2025-03-21 09:06:56 +08:00
parent aa69846e09
commit 46f3923a06
21 changed files with 880 additions and 268 deletions

View File

@@ -162,25 +162,30 @@
<span slot="footer" class="dialog-footer">
<el-button @click="pictVisible = false"> Cancel </el-button>
<el-button type="primary" @click="savePic">
<i class="el-icon-finished" style="margin-right: 5px"></i>
<el-button type="primary" @click="savePic" >
<i class="el-icon-finished" style="margin-right: 5px;"></i>
Save Figure
</el-button>
</span>
</el-dialog>
<!-- 添加表格 -->
<el-dialog
class="editTableDialog"
<el-drawer
title="我嵌套了表格!"
class="editTableDialog"
destroy-on-close
v-if="threeVisible"
:title="lineStyle.visiTitle"
:visible.sync="threeVisible"
width="1200px"
:wrapperClosable ="false"
:close-on-click-modal="false"
>
<el-form ref="editMes" :model="lineStyle" label-width="115px">
<el-form-item label="Table Title :">
direction="rtl"
size="70%">
<el-form ref="editMes" :model="lineStyle" label-width="80px">
<!-- <common-late-x></common-late-x> -->
<el-form-item label="Title:">
<common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`"
:isAutomaticUpdate="true"
@@ -196,7 +201,62 @@
<el-form-item label="Word">
<span slot="label">
<font style="color: #f56c6c; margin-right: 5px">*</font>
Table :
Table:
</span>
<common-table
@getContent="getContent"
v-if="threeVisible"
ref="commonTable"
:lineStyle="lineStyle"
></common-table>
</el-form-item>
<el-form-item label="Note:">
<common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`"
:isAutomaticUpdate="true"
:value="lineStyle.note"
@getContent="getContent"
v-if="threeVisible"
@updateChange="(res) => updateChange(res, 'note')"
:height="120"
ref="tinymceChildNote"
></common-content>
</el-form-item>
</el-form>
<p style="margin-top: 20px; text-align: right">
<el-button @click="threeVisible = false"> Cancel </el-button>
<el-button type="primary" plain @click="handleSaveTable" style="background-color: #006699 !important;background: #006699 !important;margin-right: 20px;color: #fff !important;"> save Table </el-button>
</p>
</el-drawer>
<!-- <el-dialog
class="editTableDialog"
destroy-on-close
v-if="threeVisible"
:title="lineStyle.visiTitle"
:visible.sync="threeVisible"
width="1200px"
:close-on-click-modal="false"
>
<el-form ref="editMes" :model="lineStyle" label-width="80px">
<el-form-item label="Title:">
<common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-title`"
:isAutomaticUpdate="true"
:value="lineStyle.title"
@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">
<font style="color: #f56c6c; margin-right: 5px">*</font>
Table:
</span>
<common-table
@getContent="getContent"
@@ -206,7 +266,7 @@
:lineStyle="lineStyle"
></common-table>
</el-form-item>
<el-form-item label="Bottom Title :">
<el-form-item label="Note:">
<common-content
:id="`editor-${new Date().getTime()}-${lineStyle.am_id}-${lineStyle.amt_id}-note`"
:isAutomaticUpdate="true"
@@ -224,7 +284,7 @@
<el-button @click="threeVisible = false"> Cancel </el-button>
<el-button type="primary" plain @click="handleSaveTable"> save Table </el-button>
</p>
</el-dialog>
</el-dialog> -->
<el-dialog
destroy-on-close
v-if="commentVisible"
@@ -541,10 +601,8 @@ export default {
async getContent(type, content) {
console.log('content at line 539:', content);
if (type == 'content') {
content = content.replace(/<(?!\/?(img|b|i|sub|sup|span|strong|em |blue)\b)[^>]+>/g, '');
content = content.replace(/\s*style="[^"]*"/g, '');
content = this.$commonJS.transformHtmlString(content);
console.log('content at line 604:', content)
var div = document.createElement('div');
div.innerHTML = content; // 将 HTML 字符串加载到 div 中
// 替换所有 <strong> 为 <b>
@@ -581,6 +639,7 @@ export default {
this.saveContentList(list, this.currentId);
} else if (type == 'table') {
this.saveTable(content);
} else if (type == 'comment') {
this.addComment(content);
@@ -1093,7 +1152,8 @@ export default {
}
},
updateChange(content, type) {
console.log('content at line 976:', content);
console.log('content at line 1154:', content)
// console.log('content at line 976:', content);
var str = this.$commonJS.transformHtmlString(content);
if (type == 'imgNote') {
this.picStyle.note = str;
@@ -2063,4 +2123,5 @@ export default {
::-webkit-scrollbar-thumb:hover {
background: #555; /* 滑块悬停时的颜色 */
}
</style>