From 2978574df51b820eb498f6477f63e66804c10101 Mon Sep 17 00:00:00 2001 From: yaojn Date: Mon, 24 Mar 2025 11:42:09 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E5=8A=9F=E8=83=BD]=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8XSS?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E9=97=AE=E9=A2=98=20=20=20=20-=20[=E5=85=B3?= =?UTF-8?q?=E8=81=94]#[1383898536181760]=E4=BF=AE=E5=A4=8D=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8XSS=E6=BC=8F?= =?UTF-8?q?=E6=B4=9E=E9=97=AE=E9=A2=98=20http://192.168.0.96:8090/demo/rdm?= =?UTF-8?q?.html#/story-detail/939050947543040/939050947543042/13838985361?= =?UTF-8?q?81760?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resources/assets/css/common.less | 13 ------ .../plugins/TsCkeditor/TsCkeditor.vue | 1 + .../plugins/TsCkeditor/ckeditor.less | 41 +++++++++++++++++-- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/resources/assets/css/common.less b/src/resources/assets/css/common.less index deaed177f..402136c8f 100644 --- a/src/resources/assets/css/common.less +++ b/src/resources/assets/css/common.less @@ -1820,19 +1820,6 @@ span { .ivu-modal-content { border-radius: 10px; } - -.ck-content { - ul, - ol { - // text-indent: 1em; - } - ul li { - list-style: disc inside; - } - ol li { - list-style: decimal inside; - } -} .combinesearcher-drop { max-height: none; } diff --git a/src/resources/plugins/TsCkeditor/TsCkeditor.vue b/src/resources/plugins/TsCkeditor/TsCkeditor.vue index 251fa02f0..a247b4a8d 100644 --- a/src/resources/plugins/TsCkeditor/TsCkeditor.vue +++ b/src/resources/plugins/TsCkeditor/TsCkeditor.vue @@ -4,6 +4,7 @@ v-if="readonly" v-imgViewer :class="readonlyTextIsHighlight ? 'text-warning' : ''" + class="ckeditor-readonly-content-box" v-html="currentValue ? currentValue : '-'" >
diff --git a/src/resources/plugins/TsCkeditor/ckeditor.less b/src/resources/plugins/TsCkeditor/ckeditor.less index 037cb45b1..a1dfb05f6 100644 --- a/src/resources/plugins/TsCkeditor/ckeditor.less +++ b/src/resources/plugins/TsCkeditor/ckeditor.less @@ -9,11 +9,44 @@ } } } +.ckeditor-readonly-content-box { + // 处理只读模式下,有些样式丢失的问题,只读模式下没有ck-content类名 + code { + background-color: hsla(0, 0%, 78%, 0.3); + border-radius: 2px; + padding: 0.15em; + } + blockquote { + border-left: 5px solid #ccc; + font-style: italic; + margin-left: 0; + margin-right: 0; + overflow: hidden; + padding-left: 1.5em; + padding-right: 1.5em; + } +} .ck-content { min-height: 130px; - // >p{ - // margin-top: 0; - // } + ul, + ol { + padding-inline-start: 40px; + } + ul { + list-style: disc; + li { + list-style: disc; + } + } + ol { + list-style: decimal; + li { + list-style: decimal; + } + } + i { + font-style: italic; + } } .ck .ck-placeholder:before, .ck.ck-placeholder:before { @@ -137,7 +170,7 @@ } .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content { border: solid var(--border-color, @border-color-base); - border-radius: 10px 10px 0 0; + border-radius: 10px 10px 0 0 !important; border-width: 1px 1px 0; } -- Gitee