From 0f8137ec6dad58404aeae8c8aeb2815ffaad3c76 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Dec 2021 18:20:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E8=8C=83=E5=9B=B4=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeDate.vue | 8 ++++++++ .../src/components/widget/DeWidget/DeInputSearch.vue | 12 +++++++++++- .../src/components/widget/DeWidget/DeNumberRange.vue | 12 ++++++++++-- frontend/src/components/widget/DeWidget/DeSelect.vue | 8 ++++++++ .../src/components/widget/DeWidget/DeSelectGrid.vue | 9 ++++++++- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index da8e73aef7..7dc6a011ae 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -51,9 +51,17 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { // 如果设置了动态时间 不做任何操作 diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index f3c010c57e..d35478bd47 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -5,10 +5,10 @@ v-model="value" resize="vertical" :placeholder="$t(element.options.attrs.placeholder)" + :size="size" @input="valueChange" @keypress.enter.native="search" @dblclick="setEdit" - :size="size" > @@ -37,7 +37,17 @@ export default { canEdit: false } }, + computed: { + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() + } + }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'element.options.value': function(value, old) { if (value === old) return this.value = value diff --git a/frontend/src/components/widget/DeWidget/DeNumberRange.vue b/frontend/src/components/widget/DeWidget/DeNumberRange.vue index 53b9818f52..ba54471314 100644 --- a/frontend/src/components/widget/DeWidget/DeNumberRange.vue +++ b/frontend/src/components/widget/DeWidget/DeNumberRange.vue @@ -3,11 +3,11 @@
- + {{ $t('denumberrange.split_placeholder') }} - +
@@ -60,9 +60,17 @@ export default { return JSON.stringify([]) } return JSON.stringify(this.element.options.value) + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultvalues': function(value, old) { if (value === old) return const values = this.element.options.value diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 35e42a2a2b..d9bdab45e8 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -62,10 +62,18 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault() diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index e23c85d97e..43e51a023b 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -75,10 +75,17 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { - + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault()