update 实现部分表单使用detail获取详细数据

This commit is contained in:
2021-06-28 20:45:33 +08:00
parent 54955e26e5
commit e8dd6f4eca
13 changed files with 328 additions and 233 deletions

View File

@@ -63,16 +63,16 @@ export default class index extends Component {
title: '操作',
width: 150,
dataIndex: 'actions',
render: (text, record) => (
render: (text, { id }) => (
<QueryTableActions>
<Auth auth={{ [authName]: 'edit' }}>
<a onClick={() => this.onOpen(this.editForm, record)}>编辑</a>
<a onClick={() => this.onOpen(this.editForm, id)}>编辑</a>
</Auth>
<Auth auth={{ [authName]: 'delete' }}>
<Popconfirm
placement="topRight"
title="是否确认删除"
onConfirm={() => this.onDelete(record)}
onConfirm={() => this.onDelete(id)}
>
<a>删除</a>
</Popconfirm>
@@ -145,12 +145,10 @@ export default class index extends Component {
/**
* 打开新增/编辑弹窗
* @param {*} modal
* @param {*} record
* @param {*} id
*/
onOpen(modal, record) {
modal.current.open({
record,
})
onOpen(modal, id) {
modal.current.open({ id })
}
/**
@@ -177,10 +175,10 @@ export default class index extends Component {
/**
* 删除
* @param {*} record
* @param {*} id
*/
onDelete(record) {
this.onAction(apiAction.delete(record), '删除成功')
onDelete(id) {
this.onAction(apiAction.delete({ id }), '删除成功')
}
//#region 自定义方法