CN-1442 fix: 修复Detections多个搜索条件时,去除其中一个,再点击左侧filter刚去除那项导致删除参数错误的问题
This commit is contained in:
@@ -555,14 +555,17 @@ export default {
|
||||
const column = this.columnList.find(c => {
|
||||
return c.label === param.column
|
||||
})
|
||||
const metaIndex = this.metaList.findIndex(m => m.column && m.column.label === param.column && m.operator.value === param.operator && m.value.value === this.handleValue(param.value, column, param.operator))
|
||||
// 不是在首位,则删除时顺带删除前一个index(and或or),否则顺带删除后一个index
|
||||
if (metaIndex > 0) {
|
||||
this.metaList.splice(metaIndex - 1, 2)
|
||||
} else if (this.metaList.length === 1) {
|
||||
this.metaList.splice(metaIndex, 1)
|
||||
} else {
|
||||
this.metaList.splice(metaIndex, 2)
|
||||
const obj = this.metaList.find(d => d.column && d.column.label === param.column && d.value && d.value.value === param.value[0])
|
||||
if (obj) {
|
||||
const metaIndex = this.metaList.findIndex(m => m.column && m.column.label === param.column && m.operator.value === param.operator && m.value.value === this.handleValue(param.value, column, param.operator))
|
||||
// 不是在首位,则删除时顺带删除前一个index(and或or),否则顺带删除后一个index
|
||||
if (metaIndex > 0) {
|
||||
this.metaList.splice(metaIndex - 1, 2)
|
||||
} else if (this.metaList.length === 1) {
|
||||
this.metaList.splice(metaIndex, 1)
|
||||
} else {
|
||||
this.metaList.splice(metaIndex, 2)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user