table的权限自定义按钮怎么判断
表格刷新

table的权限自定义按钮怎么判断

1个回答默认排序 投票数排序
涂小色
涂小色
这家伙很懒,什么也没写~
2月前
小小开发
小小开发回复涂小色
这家伙很懒,什么也没写~
2月前

权限判断 不是这个

涂小色
涂小色回复小小开发
这家伙很懒,什么也没写~
2月前

display 和 disabled 不就是了?

const optButtons: OptButton[] = defaultOptButtons(['edit', 'delete'])
const examine: OptButton = {
    render: 'basicButton',
    name: 'examine',
    title: '审核',
    text: '审核',
    type: 'primary',
    icon: '',
    display: (row: TableRow, field: TableColumn) => {
        let result = false
        if (row.status == '0' && baTable.auth('examine')) {
            result = true
        }
        return result
    },
    click: (row: TableRow, field: TableColumn) => {
        baTable.table.loading = true
        if (baTable.form.operate) {
            baTable.form.submitLoading
        }
        examinePost({ ids: [row.id] })
            .then((res) => {
                onAllRefresh('examine')
            })
            .finally(() => {
                baTable.table.loading = false
                baTable.form.submitLoading = false
            })
    },
}
请先登录
0
1
0
3