| | |
| | | } else if (type === 'cols') { |
| | | config.cols = config.cols.filter(col => !col.origin) |
| | | |
| | | let keys = config.cols.map(col => (col.field || '$empty')) |
| | | |
| | | let cols = [] |
| | | res.cols.forEach(col => { |
| | | if (!col.field || !keys.includes(col.field)) { |
| | | cols.push(col) |
| | | } |
| | | }) |
| | | |
| | | if (cols.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '显示列已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | if (config.subtype === 'normaltable' && res.cols.length === 1) { |
| | | config.cols.push(...res.cols) |
| | | } else { |
| | | config.cols.push(...cols) |
| | | let keys = config.cols.map(col => (col.field || '$empty')) |
| | | |
| | | let cols = [] |
| | | res.cols.forEach(col => { |
| | | if (!col.field || !keys.includes(col.field)) { |
| | | cols.push(col) |
| | | } |
| | | }) |
| | | |
| | | if (cols.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '显示列已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else { |
| | | config.cols.push(...cols) |
| | | } |
| | | } |
| | | } |
| | | |