From 6b44d2ce739ce53fcbe008393e096ef12dda8bc2 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 28 Feb 2023 16:16:14 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2614=20fix=EF=BC=9A=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/nezhaColor.vue | 10 ++++++++++ .../components/common/project/meta2d/js/meta2dMain.js | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/common/nezhaColor.vue b/nezha-fronted/src/components/common/nezhaColor.vue index 721c5ff02..515435a62 100644 --- a/nezha-fronted/src/components/common/nezhaColor.vue +++ b/nezha-fronted/src/components/common/nezhaColor.vue @@ -116,6 +116,16 @@ export default { this.$emit('colorChange', color.hex, this.keyName) } }, + update () { + if (!this.isTopo) { + this.keyName = this.valueArr[0].name + this.colors = this.valueArr[0].value || randomcolor() + 'FF' + this.$emit('colorChange', this.colors, this.keyName) + } else { + this.keyName = this.valueArr[0].name + this.colors = this.valueArr[0].value + } + }, changeColor () { this.showColorPicker = !this.showColorPicker if (this.showColorPicker) { diff --git a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js index 9ba18184c..f292694e9 100644 --- a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js +++ b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js @@ -178,7 +178,7 @@ export default { } } pen.disableInput = pen.disableInput || true - pen.lineAnimateType = pen.lineAnimateType || 0 + pen.lineAnimateType = pen.lineAnimateType || undefined pen.animateSpan = pen.animateSpan || 1 pen.animateReverse = pen.animateReverse || false pen.fromArrow = pen.fromArrow || '' @@ -295,7 +295,14 @@ export default { if (key === 'lineName') { getTopology(this.meta2dId).updateLineType(pen, pen[key]) } - getTopology(this.meta2dId).setValue(obj) + if (key === 'lineAnimateType') { + if (!pen[key]) { + obj.autoPlay = false + } else { + obj.autoPlay = true + } + } + getTopology(this.meta2dId).setValue(obj) // 更新pen if (key === 'lineAnimateType') { if (!pen[key]) { getTopology(this.meta2dId).stopAnimate(pen.id)