| | |
| | | // 筛选函数 |
| | | const filterChanged = ({ option, row, column }) => { |
| | | if (option.data) { |
| | | return row[column.field].toString().indexOf(option.data) > -1 |
| | | |
| | | if(column.field.indexOf('.')>-1){ |
| | | let array = column.field.split('.') |
| | | console.log(row[array[0]][array[1]]) |
| | | 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 |
| | | } |