|
@@ -12,7 +12,7 @@ class DiagnosticList extends Component {
|
|
super(props);
|
|
super(props);
|
|
this.state = {
|
|
this.state = {
|
|
visible: false,
|
|
visible: false,
|
|
- delId: '',
|
|
|
|
|
|
+ delItem: {},
|
|
treatTitle: ''
|
|
treatTitle: ''
|
|
}
|
|
}
|
|
this.deleteItem = this.deleteItem.bind(this);
|
|
this.deleteItem = this.deleteItem.bind(this);
|
|
@@ -38,9 +38,9 @@ class DiagnosticList extends Component {
|
|
downDiagnostic && downDiagnostic(index)
|
|
downDiagnostic && downDiagnostic(index)
|
|
}
|
|
}
|
|
deleteItem() {
|
|
deleteItem() {
|
|
- const { delId } = this.state;
|
|
|
|
|
|
+ const { delItem } = this.state;
|
|
const { delDiagnostic } = this.props;
|
|
const { delDiagnostic } = this.props;
|
|
- delDiagnostic && delDiagnostic(delId);
|
|
|
|
|
|
+ delDiagnostic && delDiagnostic(delItem);
|
|
this.setState({
|
|
this.setState({
|
|
visible: false,
|
|
visible: false,
|
|
})
|
|
})
|
|
@@ -56,10 +56,10 @@ class DiagnosticList extends Component {
|
|
visible: false
|
|
visible: false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- handleDeleteItem(id) {
|
|
|
|
|
|
+ handleDeleteItem(item) {
|
|
this.setState({
|
|
this.setState({
|
|
visible: true,
|
|
visible: true,
|
|
- delId: id,
|
|
|
|
|
|
+ delItem: item,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
showTreat(item) {
|
|
showTreat(item) {
|
|
@@ -95,7 +95,7 @@ class DiagnosticList extends Component {
|
|
onClick={() =>{hasTreat && this.showTreat(item)}}>
|
|
onClick={() =>{hasTreat && this.showTreat(item)}}>
|
|
治疗方案
|
|
治疗方案
|
|
</span>
|
|
</span>
|
|
- <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item.id)}}/>
|
|
|
|
|
|
+ <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
|
|
</div>)
|
|
</div>)
|
|
})}
|
|
})}
|
|
{treatment&&<Treat title={treatTitle}></Treat>}
|
|
{treatment&&<Treat title={treatTitle}></Treat>}
|