forked from github/dataease
refactor(富文本): 富文本组件和富文本视图
This commit is contained in:
parent
b72c2681dc
commit
9cfb88fa40
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="rich-main-class" :style="autoStyle" @dblclick="setEdit">
|
<div
|
||||||
|
class="rich-main-class"
|
||||||
|
:style="autoStyle"
|
||||||
|
@dblclick="setEdit"
|
||||||
|
>
|
||||||
<Editor
|
<Editor
|
||||||
v-if="editShow"
|
v-if="editShow"
|
||||||
:id="tinymceId"
|
:id="tinymceId"
|
||||||
@ -97,7 +101,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
scale(){
|
scale() {
|
||||||
return Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient
|
return Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient
|
||||||
},
|
},
|
||||||
editStatus() {
|
editStatus() {
|
||||||
@ -107,7 +111,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
height: (100 / this.scale) + '%!important',
|
height: (100 / this.scale) + '%!important',
|
||||||
width: (100 / this.scale) + '%!important',
|
width: (100 / this.scale) + '%!important',
|
||||||
left: 50 * (1 - 1 / this.scale) + '%', //放大余量 除以 2
|
left: 50 * (1 - 1 / this.scale) + '%', // 放大余量 除以 2
|
||||||
top: 50 * (1 - 1 / this.scale) + '%',
|
top: 50 * (1 - 1 / this.scale) + '%',
|
||||||
transform: 'scale(' + this.scale + ')'
|
transform: 'scale(' + this.scale + ')'
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="rich-main-class" :style="autoStyle" @dblclick="setEdit">
|
<div
|
||||||
|
class="rich-main-class"
|
||||||
|
:style="autoStyle"
|
||||||
|
@dblclick="setEdit"
|
||||||
|
>
|
||||||
<Editor
|
<Editor
|
||||||
v-if="editShow"
|
v-if="editShow"
|
||||||
:id="tinymceId"
|
:id="tinymceId"
|
||||||
@ -111,7 +115,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
height: (100 / this.scale) + '%!important',
|
height: (100 / this.scale) + '%!important',
|
||||||
width: (100 / this.scale) + '%!important',
|
width: (100 / this.scale) + '%!important',
|
||||||
left: 50 * (1 - 1 / this.scale) + '%', //放大余量 除以 2
|
left: 50 * (1 - 1 / this.scale) + '%', // 放大余量 除以 2
|
||||||
top: 50 * (1 - 1 / this.scale) + '%',
|
top: 50 * (1 - 1 / this.scale) + '%',
|
||||||
transform: 'scale(' + this.scale + ')'
|
transform: 'scale(' + this.scale + ')'
|
||||||
}
|
}
|
||||||
@ -181,7 +185,6 @@ export default {
|
|||||||
ed.insertContent(attachValue)
|
ed.insertContent(attachValue)
|
||||||
},
|
},
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
const edInner = tinymce.get(this.tinymceId)
|
|
||||||
const node = tinymce.activeEditor.selection.getNode()
|
const node = tinymce.activeEditor.selection.getNode()
|
||||||
this.resetSelect(node)
|
this.resetSelect(node)
|
||||||
},
|
},
|
||||||
|
@ -127,8 +127,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="de-foot">
|
<div class="de-foot">
|
||||||
<deBtn
|
<deBtn
|
||||||
@click="reset"
|
|
||||||
secondary
|
secondary
|
||||||
|
@click="reset"
|
||||||
>{{
|
>{{
|
||||||
$t("commons.reset")
|
$t("commons.reset")
|
||||||
}}</deBtn>
|
}}</deBtn>
|
||||||
|
Loading…
Reference in New Issue
Block a user