feat: 过滤器设置为必填选项

This commit is contained in:
fit2cloud-chenyw 2023-11-09 16:29:21 +08:00
parent d94189d153
commit e917c85204
8 changed files with 67 additions and 2 deletions

View File

@ -226,7 +226,11 @@ export default {
},
watch: {
'values': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -66,6 +66,11 @@ export default {
}
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -105,6 +105,16 @@ export default {
}
},
watch: {
'form.min': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'form.max': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -148,6 +148,11 @@ export default {
}
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -122,6 +122,11 @@ export default {
},
watch: {
'value': function(val, old) {
if (!this.inDraw) {
this.$emit('widget-value-changed', val)
}
},
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()

View File

@ -477,7 +477,11 @@ export default {
},
methods: {
widgetValChange(val) {
this.widgetValue = val
if (val === null) {
this.widgetValue = null
return
}
this.widgetValue = val.toString()
},
requiredChange(val) {
this.required = val

View File

@ -138,6 +138,7 @@
:style="element.style"
:element="element"
:in-draw="false"
@widget-value-changed="widgetValChanged"
/>
</el-form-item>
@ -195,11 +196,26 @@ export default {
return 2
}
},
watch: {
'dval': function(val, old) {
if (this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
}
},
created() {
this.setDval()
},
methods: {
widgetValChanged(val) {
if (!this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
},
dynamicChange(value) {
if (!value) {
this.$emit('widget-value-changed', this.element.options.value)
}
this.setDval()
},
dkeyChange(value) {

View File

@ -275,6 +275,7 @@
:element="element"
class="relative-time"
:in-draw="false"
@widget-value-changed="widgetValChanged"
/>
</el-form-item>
@ -334,12 +335,27 @@ export default {
return result
}
},
watch: {
'dval': function(val, old) {
if (this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
}
},
created() {
this.fillEmptySuffixTime()
this.setDval()
},
methods: {
widgetValChanged(val) {
if (!this.element.options.attrs.default.isDynamic) {
this.$emit('widget-value-changed', val)
}
},
dynamicChange(value) {
if (!value) {
this.$emit('widget-value-changed', this.element.options.value)
}
this.setDval()
},
dkeyChange(value) {