refactor(仪表板): 调整悬浮组件位置调整最大位置范围,优化悬浮组件复制逻辑防止复制位置差距太大问题

This commit is contained in:
wangjiahao 2023-01-05 15:05:13 +08:00
parent 8da6939f25
commit faa1976d38
2 changed files with 17 additions and 9 deletions

View File

@ -115,8 +115,8 @@ export default {
// 仪表板复制的组件默认不在移动端部署中mobileSelected = false
data.mobileSelected = false
if (!state.curComponent.auxiliaryMatrix) {
data.style.top += 20
data.style.left += 20
data.style.top = Number(data.style.top) + 20
data.style.left = Number(data.style.left) + 20
}
data.id = generateID()
// 如果是用户视图 测先进行底层复制

View File

@ -16,7 +16,6 @@
:min="0"
:max="maxTop"
class="hide-icon-number"
@change="topOnChange"
>
<template slot="append">px</template>
</el-input>
@ -33,7 +32,6 @@
:min="0"
:max="maxLeft"
class="hide-icon-number"
@change="leftOnChange"
>
<template slot="append">px</template>
</el-input>
@ -50,7 +48,6 @@
:max="maxWidth"
type="number"
class="hide-icon-number"
@change="widthOnChange"
>
<template slot="append">px</template>
</el-input>
@ -59,7 +56,6 @@
:label="$t('panel.space_height')"
:min="0"
class="form-item"
prop="marginTop"
>
<el-input
v-model="styleInfo.height"
@ -67,7 +63,6 @@
:min="0"
:max="maxHeight"
class="hide-icon-number"
@change="heightOnChange"
>
<template slot="append">px</template>
</el-input>
@ -87,7 +82,7 @@ export default {
data() {
return {
maxHeight: 2000,
maxTop: 40000
maxTop: 20000
}
},
computed: {
@ -104,7 +99,20 @@ export default {
'componentGap'
])
},
watch: {},
watch: {
'styleInfo.top': function() {
this.topOnChange()
},
'styleInfo.left': function() {
this.leftOnChange()
},
'styleInfo.width': function() {
this.widthOnChange()
},
'styleInfo.height': function() {
this.heightOnChange()
}
},
mounted() {
},
methods: {