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)