From b7d72640b6c65718ddc8a95e93ed2a1f75e8ce37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Tue, 11 Feb 2025 09:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/img/carriageReturn.png | Bin 0 -> 1294 bytes src/components/page/articleListEditor_E.vue | 125 +++---- src/components/page/components/html/index.vue | 128 +++---- src/components/page/components/table/word.vue | 327 ++++++++++-------- 4 files changed, 321 insertions(+), 259 deletions(-) create mode 100644 src/assets/img/carriageReturn.png diff --git a/src/assets/img/carriageReturn.png b/src/assets/img/carriageReturn.png new file mode 100644 index 0000000000000000000000000000000000000000..51c67a7aca27c181c601e86a13f5b58e0666ee10 GIT binary patch literal 1294 zcmbtU`BPH|5Z?EaXb4xJ1QCfzs8R|d5kZk7ga`x3B?<(mfdm1uqQoM#j7E5X=imUM zRb;RM)Q;j1jxt<=!9h$o1rNCZ=u@0469_&I~$$6~8^> z%Pc^96Z*I(VDU89J%7+58S({=Uy_V@5g@~Sa4bI zQ~ERcvKJ9H1UE`A%*^n`s{0d122D&)es?7n;GIG-X%EbOEiQH_<{}A^p*WHM*bjD} zE$E5@EOD;8m<-(uTbe0QxG8q+Hwbqv$BvIc(QU^BTd?m?OgaF!Exjn%!< zK1;FNvnXExb2!M>Z!NJV19t<^dxieDRJ&-`KfibjOkS64x_W2jEDB}c!lmhZbI=p} zuskSds^V(;sNIhX`Kkt!Jh#zi)o_MH`_$S!7lE?Q(?xyadrrjdH$vWr+wbUWA=Dcz z#aemmbq?B0{qpnX&X31)jpbH*TD~yAwT(6@AZNN>*I5_OgJrLfFwg{oe3rbZ>%E0Y zp=NUYkp~0AkHjg0c(>br>muyxKuYBE~#|@tT zMX*qXjjd?&K-8%_Bpu)XR$Ri-*A1_7_}Hc~Zer}Ol_9&_K;;r2|UCK7;In9X#=ed|LU##tFGr8#ihSNk>qpzFzX ztAIMNv(Otb%o3&HB@gm*pc?w7p47~4dgD~*0Jbb;nyD)FxH_xB16p|PA5Pu)`uZUw zVk4-jO8L=;;-pt*Lud^hEoS8A9D+)okFY~_eCmXT(JZXaH}h1~{)s3fB13l|5SnT> zNddCokOh8`X?aXOK5pgjg}}Z11F;zeG{Wr+5lY_JDrrDHU-|t87?`y5mEqe&hO!XM zu92KZ0%FA>iUGJb`xiO_lNz-*5X!ooas&uu-znjt|FK0D;?^H0{p}#@6#juA$Un?a I#uMfI0|&Sgt^fc4 literal 0 HcmV?d00001 diff --git a/src/components/page/articleListEditor_E.vue b/src/components/page/articleListEditor_E.vue index de920a1..da658d1 100644 --- a/src/components/page/articleListEditor_E.vue +++ b/src/components/page/articleListEditor_E.vue @@ -390,10 +390,12 @@
{ - //批注 - let contentHtml = ''; - var isRemark = ``; +// var htmlContent = ``; +// htmlContent += this.mains +// .map((item) => { +// //批注 +// let contentHtml = ''; +// var isRemark = ``; - // 判断是否是图片 - if (item.type == 1) { - contentHtml = ` -

- ${isRemark} - - ${ - item.image.note ? item.image.note : '' - } -

- `; - } else if (item.type == 2) { - var tableList = JSON.parse(item.table.table_data); +// // 判断是否是图片 +// if (item.type == 1) { +// contentHtml = ` +//

+// ${isRemark} +// +// ${ +// item.image.note ? item.image.note : '' +// } +//

+// `; +// } else if (item.type == 2) { +// var tableList = JSON.parse(item.table.table_data); - contentHtml = ` -
- ${isRemark} - ${item.table.title ? item.table.title : ''} - - ${tableList - .map((row) => { - return ` - - ${row - .map((cell) => { - return ` - - `; - }) - .join('')} - - `; - }) - .join('')} -
- ${cell.text || ''} -
- ${item.table.note ? item.table.note : ''} -
-`; - } else { +// contentHtml = ` +//
+// ${isRemark} +// ${item.table.title ? item.table.title : ''} +// +// ${tableList +// .map((row) => { +// return ` +// +// ${row +// .map((cell) => { +// return ` +// +// `; +// }) +// .join('')} +// +// `; +// }) +// .join('')} +//
+// ${cell.text || ''} +//
+// ${item.table.note ? item.table.note : ''} +//
+// `; +// } else { - contentHtml = `

${isRemark}${item.content}

`; - } +// contentHtml = `

${isRemark}${item.content}

`; +// } - // 判断是否是表格类型 +// // 判断是否是表格类型 - return contentHtml; - }) - .join(''); - this.htmlContent = htmlContent; +// return contentHtml; +// }) +// .join(''); + this.htmlContent = 'true'; }, getMainsInfo2(e) { @@ -1099,11 +1101,12 @@ export default { .then((res) => { this.loadHtml = false; if (res.code == 0) { - // console.log(res,'res') + console.log(res,'res') this.mains = ''; if (res.data.list.length > 0) { this.mains = res.data.list; + console.log('this.mains at line 1108:', this.mains) this.getWord(); } else { this.mains = ''; diff --git a/src/components/page/components/html/index.vue b/src/components/page/components/html/index.vue index 1c4d7fe..586ea84 100644 --- a/src/components/page/components/html/index.vue +++ b/src/components/page/components/html/index.vue @@ -131,10 +131,12 @@
{ - //批注 - let contentHtml = ''; - var isRemark = ``; +// var htmlContent = ``; +// htmlContent += this.mains +// .map((item) => { +// //批注 +// let contentHtml = ''; +// var isRemark = ``; - // 判断是否是图片 - if (item.type == 1) { - contentHtml = ` -

- ${isRemark} - - ${ - item.image.note ? item.image.note : '' - } -

- `; - } else if (item.type == 2) { - var tableList = JSON.parse(item.table.table_data); +// // 判断是否是图片 +// if (item.type == 1) { +// contentHtml = ` +//

+// ${isRemark} +// +// ${ +// item.image.note ? item.image.note : '' +// } +//

+// `; +// } else if (item.type == 2) { +// var tableList = JSON.parse(item.table.table_data); - contentHtml = ` -
- ${isRemark} - ${item.table.title ? item.table.title : ''} - - ${tableList - .map((row) => { - return ` - - ${row - .map((cell) => { - return ` - - `; - }) - .join('')} - - `; - }) - .join('')} -
- ${cell.text || ''} -
- ${item.table.note ? item.table.note : ''} -
-`; - } else { - contentHtml = `

${isRemark}${item.content}

`; - } +// contentHtml = ` +//
+// ${isRemark} +// ${item.table.title ? item.table.title : ''} +// +// ${tableList +// .map((row) => { +// return ` +// +// ${row +// .map((cell) => { +// return ` +// +// `; +// }) +// .join('')} +// +// `; +// }) +// .join('')} +//
+// ${cell.text || ''} +//
+// ${item.table.note ? item.table.note : ''} +//
+// `; +// } else { +// contentHtml = `

${isRemark}${item.content}

`; +// } - // 判断是否是表格类型 +// // 判断是否是表格类型 - return contentHtml; - }) - .join(''); - this.htmlContent = htmlContent; +// return contentHtml; +// }) +// .join(''); + this.htmlContent = 'true'; console.log('this.htmlContent at line 820:', this.htmlContent) }, getMainsInfo2(e) { diff --git a/src/components/page/components/table/word.vue b/src/components/page/components/table/word.vue index 9017334..bc45beb 100644 --- a/src/components/page/components/table/word.vue +++ b/src/components/page/components/table/word.vue @@ -10,9 +10,9 @@ >
@@ -138,7 +143,6 @@ class="commentList" >
  • - {{ commentIndex + 1 }}、 - Comment - {{ $t('commonTable.Resolved') }} + {{ + $t('commonTable.Resolved') + }}
    {{ getTime(commont.ctime) }} 等字符 + `, + entity_encoding: 'raw', // 不编码 > 等字符 menubar: false, toolbar: _this.isEditComment ? ['commentAdd |delete| addRow|Edit'] : ['delete| addRow|Edit'], end_container_on_empty_block: true, @@ -1000,9 +1012,8 @@ export default { return formattedDate; }, goToListComment(data) { - console.log('data at line 993:', data) - this.goToComment(data.am_id) - + console.log('data at line 993:', data); + this.goToComment(data.am_id); }, divOnScroll() { if (!this.isPreview) { @@ -1059,37 +1070,37 @@ export default { return emptyContentIndexes; }, - escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); -}, - highlightText(text, annotations) { - if (!this.isPreview) { - let tempText = text; + escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + }, + highlightText(text, annotations, type) { + if (!this.isPreview) { + let tempText = text; - // 1. 使用占位符替代批注内容 - const placeholders = []; - annotations.forEach((annotation, index) => { - if (annotation.content == '') { - return tempText; - } - const escapedContent = this.escapeRegExp(annotation.content); // 转义正则表达式中的特殊字符 - const placeholder = `{{remark_placeholder_${index}}}`; // 占位符 - const regExp = new RegExp(`(${escapedContent})`, 'gi'); // 全局匹配批注内容 + // 1. 使用占位符替代批注内容 + const placeholders = []; + annotations.forEach((annotation, index) => { + if (annotation.content == '') { + return tempText; + } + const escapedContent = this.escapeRegExp(annotation.content); // 转义正则表达式中的特殊字符 + const placeholder = `{{remark_placeholder_${index}}}`; // 占位符 + const regExp = new RegExp(`(${escapedContent})`, 'gi'); // 全局匹配批注内容 - // 如果批注内容存在,替换成占位符 - if (tempText.includes(annotation.content)) { - tempText = tempText.replace(regExp, placeholder); - placeholders.push({ placeholder, annotation, index }); - } - }); + // 如果批注内容存在,替换成占位符 + 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'); + // 2. 为占位符添加高亮 + placeholders.forEach(({ placeholder, annotation, index }) => { + const regExp = new RegExp(placeholder, 'gi'); - tempText = tempText.replace(regExp, (match) => { - const randomColor = this.getRandomLightColor(); - return ` + tempText = tempText.replace(regExp, (match) => { + const randomColor = this.getRandomLightColor(); + return ` `; + } + // 3. 返回处理后的文本 + return tempText; + } else { + return text; + } + }, getCommentsData() { if (!this.isPreview) { @@ -1927,4 +1942,46 @@ export default { border: 2px solid #cd5454; /* 高亮边框 */ box-shadow: 0 0 10px #f77b7b; /* 高亮阴影 */ } +.isTitleH1{ + position: relative; + /* border: 1px solid #94c2f7; */ + background-color: #dbebfc54; +} + + .Htitle{ + + color: #4d99f1; + background-color: #dbebfca6; + /* border: 1px solid #4d99f1; */ + border-radius: 50%; + font-weight: bold; + position: absolute; + + line-height: 24px; + padding: 2px; + font-size: 16px; + left: -30px; + top: 0px; + text-align: center; + +} +.Htitle1{ + width: 24px; + height: 24px; + /* font-size: 14px; */ +} +.Htitle2{ width: 24px; + height: 24px; + /* font-size: 16px; */ +} +.Htitle3{ width: 24px; + height: 24px; + /* font-size: 12px; */ +} +.isTitleH2{position: relative; + background-color: #dbebfc54; +} +.isTitleH3{position: relative; + background-color: #dbebfc54; +}