Merge pull request #7387 from dataease/pr@dev@perf_filter_full_screen_switch
perf: 仪表板过滤器在切换全屏场景失效
This commit is contained in:
commit
00db46339f
@ -459,6 +459,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -472,6 +475,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.values && Array.isArray(this.values)) ? this.values.join(',') : this.values
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -501,7 +510,16 @@ export default {
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = (lastFilters.val === null || typeof lastFilters.val === 'undefined') ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
|
||||
@ -114,6 +114,11 @@ export default {
|
||||
search() {
|
||||
if (!this.inDraw) {
|
||||
this.element.options.value = this.value
|
||||
} else if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -127,6 +132,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -142,7 +150,16 @@ export default {
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
|
||||
return defaultV.split(',')[0]
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ export default {
|
||||
},
|
||||
'defaultvalues': function(value, old) {
|
||||
if (value === old) return
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
@ -145,7 +145,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.element.options.value && this.element.options.value.length > 0) {
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
@ -174,13 +174,12 @@ export default {
|
||||
this.form.min = null
|
||||
this.form.max = null
|
||||
} else {
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
}
|
||||
}
|
||||
|
||||
this.search()
|
||||
}
|
||||
},
|
||||
@ -251,7 +250,13 @@ export default {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.showRequiredTips) {
|
||||
const values = [this.form.min, this.form.max]
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (values && Array.isArray(values)) ? values.join(',') : values
|
||||
})
|
||||
}
|
||||
this.setCondition()
|
||||
})
|
||||
})
|
||||
@ -283,6 +288,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
|
||||
if (this.form.min && this.form.max) {
|
||||
@ -316,6 +324,20 @@ export default {
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,6 +381,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -394,6 +400,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -403,7 +412,16 @@ export default {
|
||||
return this.value.split(',')
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') {
|
||||
return []
|
||||
|
||||
@ -313,6 +313,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -331,6 +337,9 @@ export default {
|
||||
},
|
||||
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -370,7 +379,16 @@ export default {
|
||||
},
|
||||
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(',')
|
||||
|
||||
@ -67,9 +67,14 @@ class NumberRangeServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
if (element.options.value && element.options.value.length > 0) {
|
||||
const values = element.options.value
|
||||
getParam(element, val) {
|
||||
let values = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
values = element.options.value
|
||||
} else {
|
||||
values = val.split(',')
|
||||
}
|
||||
if (values && values.length > 0) {
|
||||
const min = values[0]
|
||||
let max = null
|
||||
if (values.length > 1) {
|
||||
|
||||
@ -82,8 +82,13 @@ class NumberSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -84,8 +84,13 @@ class NumberSelectServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -68,8 +68,13 @@ class TextInputServiceImpl extends WidgetService {
|
||||
return field['deType'] === 0
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : [value],
|
||||
|
||||
@ -83,8 +83,13 @@ class TextSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -86,8 +86,13 @@ class TextSelectTreeServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -310,9 +310,13 @@ class TimeDateRangeServiceImpl extends WidgetService {
|
||||
return false
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -167,9 +167,13 @@ class TimeDateServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -128,9 +128,13 @@ class TimeMonthServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -115,9 +115,13 @@ class TimeYearServiceImpl extends WidgetService {
|
||||
return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1).getTime()
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user