提交 69d53f0b authored 作者: wangjiahao's avatar wangjiahao

fix: 过滤组件标题不同仪表板大小时显示位置不同问题

上级 a313f0e2
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
:id="'component' + config.id" :id="'component' + config.id"
class="component-custom" class="component-custom"
:style="getComponentStyleDefault(config.style)" :style="getComponentStyleDefault(config.style)"
style="overflow: hidden"
:out-style="config.style" :out-style="config.style"
:element="config" :element="config"
:in-screen="inScreen" :in-screen="inScreen"
......
...@@ -87,8 +87,7 @@ export default { ...@@ -87,8 +87,7 @@ export default {
computed: { computed: {
sizeInfo() { sizeInfo() {
let size let size
if (this.duHeight > this.inputMaxSize) { if (this.duHeight > this.inputLargeSize) {
} else if (this.duHeight > this.inputLargeSize) {
size = 'medium' size = 'medium'
} else if (this.duHeight > this.inputSmallSize) { } else if (this.duHeight > this.inputSmallSize) {
size = 'small' size = 'small'
...@@ -101,6 +100,14 @@ export default { ...@@ -101,6 +100,14 @@ export default {
'curCanvasScale' 'curCanvasScale'
]) ])
}, },
watch: {
element: {
handler() {
this.watchSize()
},
deep: true
}
},
mounted() { mounted() {
this.watchSize() this.watchSize()
}, },
...@@ -121,13 +128,15 @@ export default { ...@@ -121,13 +128,15 @@ export default {
return return
} }
const titleWidth = this.$refs.deTitle.offsetWidth const titleWidth = this.$refs.deTitle.offsetWidth
this.duHeight = height - titleWidth
this.$nextTick(() => { this.$nextTick(() => {
let min = this.element.style.fontSize * 2 + 50 let numRange = 0
let min = this.element.style.fontSize * 2 + 30
if (this.element.component === 'de-number-range') { if (this.element.component === 'de-number-range') {
min = this.element.style.fontSize * 2 + 80 min = this.element.style.fontSize * 2 + 55
numRange = 25
} }
if (height < min) { if (height < min) {
this.duHeight = height - numRange
this.mainClass = 'condition-main-line' this.mainClass = 'condition-main-line'
if (deContentContainer) { if (deContentContainer) {
...@@ -135,6 +144,7 @@ export default { ...@@ -135,6 +144,7 @@ export default {
deContentContainer.style.marginLeft = (titleWidth + 15) + 'px' deContentContainer.style.marginLeft = (titleWidth + 15) + 'px'
} }
} else { } else {
this.duHeight = height - titleWidth + numRange
this.mainClass = '' this.mainClass = ''
if (deContentContainer) { if (deContentContainer) {
deContentContainer.style.top = '2em' deContentContainer.style.top = '2em'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论