| | |
| | | ], |
| | | extraButtons: [ |
| | | { |
| | | text: (row) => (row.status === 'unpublished' || row.status === 'approved' ? '发布' : '下架'), |
| | | // text: (row) => (row.status === 'unpublished' || row.status === 'approved' ? '发布' : '下架'), |
| | | text: (row) => { |
| | | // 调整文本显示逻辑 |
| | | if (row.status === 'unpublished' || row.status === 'approved') { |
| | | return '发布' |
| | | } else if (row.status === 'published') { |
| | | return '下架' |
| | | } |
| | | return '' // 其他状态不会显示 |
| | | }, |
| | | show: (row) => ['unpublished', 'approved', 'published'].includes(row.status), |
| | | atClick: async (row) => { |
| | | const action = row.status === 'unpublished' || row.status === 'approved' ? '发布' : '下架' |
| | | try { |