feat : 按钮全新啊demo
This commit is contained in:
@@ -94,11 +94,17 @@ const tableConfig = reactive({
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
showOverflowTooltip: false,
|
showOverflowTooltip: false,
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
console.log('row',row.buttons)
|
let btn = []
|
||||||
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
|
let buttons = new Set(Array.from(row.buttons))
|
||||||
if (row.state === '3' || row.state === '2') {
|
if (buttons.has("details")){
|
||||||
|
btn.push({label: '详情', func: () => handleDetail(row), type: 'primary'})
|
||||||
|
}
|
||||||
|
if (buttons.has("edit")) {
|
||||||
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
||||||
}
|
}
|
||||||
|
if (buttons.has("report")) {
|
||||||
|
btn.push({label: '需求上报', func: () => handleEdit(row), type: 'primary'})
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div style={{width: '100%'}}>
|
<div style={{width: '100%'}}>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user