Merge pull request #1479 from dataease/pr@dev@fix_conrol_range_valid

fix: 自定义控制范围失效
This commit is contained in:
fit2cloud-chenyw 2021-12-20 18:21:30 +08:00 committed by GitHub
commit 184a2a9d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 4 deletions

View File

@ -51,9 +51,17 @@ export default {
defaultValueStr() { defaultValueStr() {
if (!this.element || !this.element.options || !this.element.options.value) return '' if (!this.element || !this.element.options || !this.element.options.value) return ''
return this.element.options.value.toString() 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: { watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()
},
'defaultValueStr': function(value, old) { 'defaultValueStr': function(value, old) {
if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) {
// //

View File

@ -5,10 +5,10 @@
v-model="value" v-model="value"
resize="vertical" resize="vertical"
:placeholder="$t(element.options.attrs.placeholder)" :placeholder="$t(element.options.attrs.placeholder)"
:size="size"
@input="valueChange" @input="valueChange"
@keypress.enter.native="search" @keypress.enter.native="search"
@dblclick="setEdit" @dblclick="setEdit"
:size="size"
> >
<el-button slot="append" icon="el-icon-search" @click="search" /> <el-button slot="append" icon="el-icon-search" @click="search" />
@ -37,7 +37,17 @@ export default {
canEdit: false canEdit: false
} }
}, },
computed: {
viewIds() {
if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return ''
return this.element.options.attrs.viewIds.toString()
}
},
watch: { watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()
},
'element.options.value': function(value, old) { 'element.options.value': function(value, old) {
if (value === old) return if (value === old) return
this.value = value this.value = value

View File

@ -3,11 +3,11 @@
<el-form v-if="element.options!== null && element.options.attrs!==null" ref="form" :model="form" :rules="rules"> <el-form v-if="element.options!== null && element.options.attrs!==null" ref="form" :model="form" :rules="rules">
<div class="de-number-range-container"> <div class="de-number-range-container">
<el-form-item prop="min"> <el-form-item prop="min">
<el-input v-model="form.min" :placeholder="$t(element.options.attrs.placeholder_min)" @input="inputChange" @change="handleMinChange" :size="size"/> <el-input v-model="form.min" :placeholder="$t(element.options.attrs.placeholder_min)" :size="size" @input="inputChange" @change="handleMinChange" />
</el-form-item> </el-form-item>
<span>{{ $t('denumberrange.split_placeholder') }}</span> <span>{{ $t('denumberrange.split_placeholder') }}</span>
<el-form-item prop="max"> <el-form-item prop="max">
<el-input v-model="form.max" :placeholder="$t(element.options.attrs.placeholder_max)" @input="inputChange" @change="handleMaxChange" :size="size"/> <el-input v-model="form.max" :placeholder="$t(element.options.attrs.placeholder_max)" :size="size" @input="inputChange" @change="handleMaxChange" />
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
@ -60,9 +60,17 @@ export default {
return JSON.stringify([]) return JSON.stringify([])
} }
return JSON.stringify(this.element.options.value) 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: { watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()
},
'defaultvalues': function(value, old) { 'defaultvalues': function(value, old) {
if (value === old) return if (value === old) return
const values = this.element.options.value const values = this.element.options.value

View File

@ -62,10 +62,18 @@ export default {
defaultValueStr() { defaultValueStr() {
if (!this.element || !this.element.options || !this.element.options.value) return '' if (!this.element || !this.element.options || !this.element.options.value) return ''
return this.element.options.value.toString() 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: { watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()
},
'defaultValueStr': function(value, old) { 'defaultValueStr': function(value, old) {
if (value === old) return if (value === old) return
this.value = this.fillValueDerfault() this.value = this.fillValueDerfault()

View File

@ -75,10 +75,17 @@ export default {
defaultValueStr() { defaultValueStr() {
if (!this.element || !this.element.options || !this.element.options.value) return '' if (!this.element || !this.element.options || !this.element.options.value) return ''
return this.element.options.value.toString() 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: { watch: {
'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return
this.setCondition()
},
'defaultValueStr': function(value, old) { 'defaultValueStr': function(value, old) {
if (value === old) return if (value === old) return
this.value = this.fillValueDerfault() this.value = this.fillValueDerfault()