Merge pull request #4136 from dataease/pr@dev@fix_filter_time_range_param

fix(过滤器): 时间范围过滤器参数设置多个数据集时异常
This commit is contained in:
fit2cloud-chenyw 2022-12-20 17:12:26 +08:00 committed by GitHub
commit e0fddb7566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,9 +360,12 @@ export default {
changeDynamicParams(val, name) {
const start = this.attrs.startParameters ? JSON.parse(JSON.stringify(this.attrs.startParameters)) : []
const end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : []
let end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : []
if (end?.length) {
end[0] += '_START_END_SPLIT'
end = end.map(item => {
item = item + '_START_END_SPLIT'
return item
})
}
this.attrs.parameters = [...new Set([...start, ...end])]
},
@ -393,6 +396,12 @@ export default {
enableParametersChange(value) {
if (!value) {
this.attrs.parameters = []
if (this.attrs.startParameters?.length) {
this.attrs.startParameters = []
}
if (this.attrs.endParameters?.length) {
this.attrs.endParameters = []
}
}
this.fillAttrs2Filter()
},