廖井涛
2025-03-25 768e16999a8ce4bb500490ee76c659aa61ea1783
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//前端筛选功能
 
//筛选手动触发
function changeFilterEvent (event, option, $panel)  {
    // 手动触发筛选
    $panel.changeOption(event, !!option.data, option)
}
 
// 筛选函数
const filterChanged = ({ option, row, column }) => {
    if (option.data) {
 
        if(column.field.indexOf('.')>-1){
            let  array = column.field.split('.')
            if (row[array[0]][array[1]]==null){
                return ''.indexOf(option.data) > -1
            }else {
                return row[array[0]][array[1]].toString().indexOf(option.data) > -1
            }
 
        }else {
            if (row[column.field]==null){
                return ''.indexOf(option.data) > -1
            }else {
                return row[column.field].toString().indexOf(option.data) > -1
            }
 
        }
    }
    return true
}
 
export {changeFilterEvent,filterChanged}