|
|
@@ -10,6 +10,7 @@ import GroupSelector from '../datasource/groupSelector'
|
|
|
import Thumbnail from './thumbnail'
|
|
|
import DistributeBox from './distributeBox';
|
|
|
import TransferBox from './transferBox'
|
|
|
+import DeleteBox from '../common/deleteBox'
|
|
|
const { Content } = Layout
|
|
|
const { Search } = Input
|
|
|
const CardGrid = Card.Grid
|
|
|
@@ -25,6 +26,7 @@ class ChartList extends React.Component {
|
|
|
visibleDistributeBox: false,
|
|
|
visibleTransferBox: false,
|
|
|
visibleGroupMenu: false, // 显示分组菜单
|
|
|
+ visibleDeleteBox: false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -80,10 +82,13 @@ class ChartList extends React.Component {
|
|
|
>
|
|
|
<Icon type="swap" />移交
|
|
|
</Menu.Item>
|
|
|
- <Menu.Item onClick={() => {
|
|
|
- dispatch({ type: 'chart/remoteDelete', code: this.state.selectedRecord.code });
|
|
|
- }}>
|
|
|
- <Icon type='delete'/>删除
|
|
|
+ <Menu.Item
|
|
|
+ onClick={(e) => {
|
|
|
+ this.setState({ visibleDeleteBox: true})
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Icon type="delete" />删除
|
|
|
+
|
|
|
</Menu.Item>
|
|
|
</Menu>
|
|
|
)
|
|
|
@@ -335,7 +340,7 @@ class ChartList extends React.Component {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- const { visibleChooseDataSourceBox, visibleDistributeBox, visibleTransferBox } = this.state;
|
|
|
+ const { visibleChooseDataSourceBox, visibleDistributeBox, visibleTransferBox, visibleDeleteBox, selectedRecord } = this.state;
|
|
|
const { dispatch, chart } = this.props;
|
|
|
const TAG_COLOR = ['blue'];
|
|
|
return (
|
|
|
@@ -433,6 +438,19 @@ class ChartList extends React.Component {
|
|
|
visibleTransferBox: false
|
|
|
})
|
|
|
}} />
|
|
|
+ <DeleteBox
|
|
|
+ visibleDeleteBox={visibleDeleteBox}
|
|
|
+ type='chart'
|
|
|
+ onCancel={() => {
|
|
|
+ this.setState({
|
|
|
+ visibleDeleteBox: false
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ selectedRecord={selectedRecord}
|
|
|
+ onOk={() =>{
|
|
|
+ dispatch({ type: 'chart/remoteDelete', code: this.state.selectedRecord.code })
|
|
|
+ this.setState({visibleDeleteBox: false})
|
|
|
+ }} />
|
|
|
</Layout>
|
|
|
)
|
|
|
}
|