refactor(仪表板): 富文本视图增加字段整体设置样式整体删除

This commit is contained in:
wangjiahao 2022-08-23 13:30:44 +08:00
parent a0ffb35636
commit 2511aa62fa

View File

@ -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
}
</style>