targetdetail
This commit is contained in:
parent
5c28e542c7
commit
dc3941def7
|
@ -5,6 +5,8 @@ import {
|
||||||
DispatchProps as DispatchProps,
|
DispatchProps as DispatchProps,
|
||||||
} from './components/TargetDetail';
|
} from './components/TargetDetail';
|
||||||
|
|
||||||
|
import * as targetDetailActions from '../redux/action/read';
|
||||||
|
|
||||||
export function mapStateToProps(state: any): StateProps {
|
export function mapStateToProps(state: any): StateProps {
|
||||||
return {
|
return {
|
||||||
probe: state.probe,
|
probe: state.probe,
|
||||||
|
@ -13,6 +15,9 @@ export function mapStateToProps(state: any): StateProps {
|
||||||
|
|
||||||
export function mapDispatchToProps(dispatch: Dispatch<any>): DispatchProps {
|
export function mapDispatchToProps(dispatch: Dispatch<any>): DispatchProps {
|
||||||
return {
|
return {
|
||||||
|
onRead: (id: string) => {
|
||||||
|
dispatch(targetDetailActions.request(id));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ export interface StateProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DispatchProps {
|
export interface DispatchProps {
|
||||||
|
onRead(id: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Props = StateProps & DispatchProps;
|
export type Props = StateProps & DispatchProps;
|
||||||
|
|
|
@ -23,7 +23,7 @@ export interface State {
|
||||||
|
|
||||||
export class TargetList extends React.Component<Props, State> {
|
export class TargetList extends React.Component<Props, State> {
|
||||||
|
|
||||||
private data: any;
|
private data: any;
|
||||||
constructor(props: Props, context: State) {
|
constructor(props: Props, context: State) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -34,7 +34,6 @@ export class TargetList extends React.Component<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleAddTarget(event: React.MouseEvent<HTMLButtonElement>, data: ButtonProps): void {
|
public handleAddTarget(event: React.MouseEvent<HTMLButtonElement>, data: ButtonProps): void {
|
||||||
alert('test');
|
|
||||||
this.setState({
|
this.setState({
|
||||||
openAddTarget: true,
|
openAddTarget: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user