From 2511aa62fa7a5b52e91f312fb37e767b99d521e3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 23 Aug 2022 13:30:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E8=A7=86=E5=9B=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=95=B4=E4=BD=93=E8=AE=BE=E7=BD=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=95=B4=E4=BD=93=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/DeRichTextView.vue | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/DeRichTextView.vue b/frontend/src/components/canvas/custom-component/DeRichTextView.vue index a9694dcc87..074c115d4c 100644 --- a/frontend/src/components/canvas/custom-component/DeRichTextView.vue +++ b/frontend/src/components/canvas/custom-component/DeRichTextView.vue @@ -164,14 +164,28 @@ export default { onClick(e) { const edInner = tinymce.get(this.tinymceId); const node = tinymce.activeEditor.selection.getNode() - const pNode = node.parentElement - if(pNode && pNode.id&& pNode.id.indexOf('changeText')>-1){ - const innerId = '#'+pNode.id - edInner.selection.select(edInner.dom.select(innerId)[0]) + this.resetSelect(node) + }, + resetSelect(node){ + const edInner = tinymce.get(this.tinymceId); + const nodeArray = edInner.dom.select(".base-selected") + if(nodeArray){ + nodeArray.forEach(nodeInner=>{ + nodeInner.removeAttribute('class') + }) + } + if(node){ + const pNode = node.parentElement + if(pNode && pNode.id&& pNode.id.indexOf('changeText')>-1){ + const innerId = '#'+pNode.id + const domTest = edInner.dom.select(innerId)[0] + domTest.setAttribute("class",'base-selected') + edInner.selection.select(domTest) + } } }, setEdit() { - if (this.editStatus) { + if (this.editStatus&&this.canEdit===false) { this.canEdit = true this.element['editing'] = true this.reShow() @@ -223,5 +237,9 @@ export default { display: list-item!important; text-align: -webkit-match-parent!important; } + + ::v-deep .base-selected{ + background-color: #b4d7ff + }