problem description
related codes
/ / Please paste the code text below (do not replace the code with pictures)
/ / Edit
handleEdit =(record,index)=>{
console.log(this.state.ids,"ids")
console.log(record,"record")
console.log(record.key,"key")
if(this.state.ids.indexOf(record.key)>-1){
console.log(1)
let ids = this.state.ids
this.setState({
ids:ids.filter(item => item !== record.key),
isEditVisible:false
})
console.log(ids,11)
}
this.props.form.resetFields();//
let userInfo = record;
this.setState({
isEditVisible:true,
userInfo,
index,
type:"edit",
})
}
/ / Button
{
title:"",
key:"action",
render:(text,record,index)=>{
let flag =0;
if(this.state.ids.indexOf(index)>-1){
flag = 1
}
return (
<div>
<Button onClick={()=>this.handleDelete(record,index)} style={{marginRight:4}}></Button>
{/* <Button onClick={()=>this.handleEdit(record,index)} disabled={flag==0?false:true}>{flag==0?"":""}</Button> */}
<Button onClick={()=>this.handleEdit(record,index)}>{flag==0?"":""}</Button>
</div>
)
}
}