From 5217a52c5b8d39d1d4048d336f3074f40795a732 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 17 Dec 2021 11:05:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=80=81=E7=89=88=E6=9C=AC=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=BB=84=E4=BB=B6=E5=AF=BC=E8=87=B4=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeDate.vue | 6 +++++- frontend/src/components/widget/DeWidget/DeSelect.vue | 6 +++++- frontend/src/components/widget/DeWidget/DeSelectGrid.vue | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index a234224ecd..da8e73aef7 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -47,10 +47,14 @@ export default { defaultoptions() { if (!this.element || !this.element.options || !this.element.options.attrs.default) return '' return JSON.stringify(this.element.options.attrs.default) + }, + defaultValueStr() { + if (!this.element || !this.element.options || !this.element.options.value) return '' + return this.element.options.value.toString() } }, watch: { - 'element.options.value': function(value, old) { + 'defaultValueStr': function(value, old) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { // 如果设置了动态时间 不做任何操作 return diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 53b9c16249..35e42a2a2b 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -58,11 +58,15 @@ export default { computed: { operator() { return this.element.options.attrs.multiple ? 'in' : 'eq' + }, + defaultValueStr() { + if (!this.element || !this.element.options || !this.element.options.value) return '' + return this.element.options.value.toString() } }, watch: { - 'element.options.value': function(value, old) { + 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault() this.changeValue(value) diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index c2f2d0cdd7..e23c85d97e 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -71,11 +71,15 @@ export default { computed: { operator() { return this.element.options.attrs.multiple ? 'in' : 'eq' + }, + defaultValueStr() { + if (!this.element || !this.element.options || !this.element.options.value) return '' + return this.element.options.value.toString() } }, watch: { - 'element.options.value': function(value, old) { + 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault() this.changeValue(value)