From c70473cce149307a7e72d8c19e79b33e2d2de2e1 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Thu, 13 Jul 2023 10:03:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BC=9A=E9=87=8D=E5=A4=8D=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BigScreenDesign/RightSetting/index.vue | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/data-room-ui/packages/BigScreenDesign/RightSetting/index.vue b/data-room-ui/packages/BigScreenDesign/RightSetting/index.vue index 3dd4881b..4a6b84ef 100644 --- a/data-room-ui/packages/BigScreenDesign/RightSetting/index.vue +++ b/data-room-ui/packages/BigScreenDesign/RightSetting/index.vue @@ -114,20 +114,14 @@ export default { // 只更新样式部分,不调用接口 configStyle: { handler (val, oldValue) { - if (!_.isEqual(val, oldValue)) { - this.$emit('updateSetting', { ...val, type: this.config.type, code: this.config.code }) - this.saveTimeLine(`更新${val?.title}组件属性`) - } + this.handleConfigChange(val, oldValue, 'configStyle') }, deep: true }, // 更新数据源部分,需要调用接口 configDataSource: { handler (val, oldValue) { - if (!_.isEqual(val, oldValue)) { - this.$emit('updateDataSetting', this.config) - this.saveTimeLine(`更新${val?.title}组件属性`) - } + this.handleConfigChange(val, oldValue, 'configDataSource') }, deep: true } @@ -137,6 +131,16 @@ export default { ...mapMutations('bigScreen', [ 'saveTimeLine' ]), + handleConfigChange (val, oldValue, type) { + if (!_.isEqual(val, oldValue)) { + if (type === 'configStyle') { + this.$emit('updateSetting', { ...val, type: this.config.type, code: this.config.code }) + } else { + this.$emit('updateDataSetting', this.config) + } + this.saveTimeLine(`更新${val?.title ?? this.config.title}组件属性`) + } + }, close () { this.$emit('closeRightPanel') },