From faa1976d386a4db8e04f914e8a5149619eca751f Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Thu, 5 Jan 2023 15:05:13 +0800
Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E6=82=AC=E6=B5=AE=E7=BB=84=E4=BB=B6=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE=E8=B0=83=E6=95=B4=E6=9C=80=E5=A4=A7=E4=BD=8D=E7=BD=AE?=
=?UTF-8?q?=E8=8C=83=E5=9B=B4=EF=BC=8C=E4=BC=98=E5=8C=96=E6=82=AC=E6=B5=AE?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E5=88=B6=E9=80=BB=E8=BE=91=E9=98=B2?=
=?UTF-8?q?=E6=AD=A2=E5=A4=8D=E5=88=B6=E4=BD=8D=E7=BD=AE=E5=B7=AE=E8=B7=9D?=
=?UTF-8?q?=E5=A4=AA=E5=A4=A7=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/components/canvas/store/copy.js | 4 ++--
.../src/views/chart/view/PositionAdjust.vue | 22 +++++++++++++------
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js
index 4d740986e7..08c8bef204 100644
--- a/frontend/src/components/canvas/store/copy.js
+++ b/frontend/src/components/canvas/store/copy.js
@@ -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()
// 如果是用户视图 测先进行底层复制
diff --git a/frontend/src/views/chart/view/PositionAdjust.vue b/frontend/src/views/chart/view/PositionAdjust.vue
index b2377909ac..00f5618e8a 100644
--- a/frontend/src/views/chart/view/PositionAdjust.vue
+++ b/frontend/src/views/chart/view/PositionAdjust.vue
@@ -16,7 +16,6 @@
:min="0"
:max="maxTop"
class="hide-icon-number"
- @change="topOnChange"
>
px
@@ -33,7 +32,6 @@
:min="0"
:max="maxLeft"
class="hide-icon-number"
- @change="leftOnChange"
>
px
@@ -50,7 +48,6 @@
:max="maxWidth"
type="number"
class="hide-icon-number"
- @change="widthOnChange"
>
px
@@ -59,7 +56,6 @@
:label="$t('panel.space_height')"
:min="0"
class="form-item"
- prop="marginTop"
>
px
@@ -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: {