|
|
@@ -13,6 +13,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
|
|
|
@@ -28,6 +29,7 @@ class ChartList extends React.Component {
|
|
|
visibleDistributeBox: false,
|
|
|
visibleTransferBox: false,
|
|
|
visibleGroupMenu: false, // 显示分组菜单
|
|
|
+ visibleDeleteBox: false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -88,10 +90,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>
|
|
|
)
|
|
|
@@ -346,7 +351,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 (
|
|
|
@@ -446,8 +451,20 @@ class ChartList extends React.Component {
|
|
|
this.setState({
|
|
|
visibleTransferBox: false
|
|
|
})
|
|
|
+ }} />
|
|
|
+ <DeleteBox
|
|
|
+ visibleDeleteBox={visibleDeleteBox}
|
|
|
+ type='chart'
|
|
|
+ hideBox={() => {
|
|
|
+ this.setState({
|
|
|
+ visibleDeleteBox: false
|
|
|
+ })
|
|
|
}}
|
|
|
- />
|
|
|
+ selectedRecord={selectedRecord}
|
|
|
+ onOk={() => {
|
|
|
+ dispatch({ type: 'chart/remoteDelete', code: this.state.selectedRecord.code })
|
|
|
+ this.setState({ visibleDeleteBox: false })
|
|
|
+ }} />
|
|
|
</Layout>
|
|
|
)
|
|
|
}
|