import React from 'react';
import ReactDom from 'react-dom';
import {BrowserRouter as Router, Route, Link, Redirect, Switch} from 'react-router-dom';
+import createHistory from 'history/createHashHistory'
+const history = createHistory()
import {spring, AnimatedRoute, AnimatedSwitch} from 'react-router-transition';
// layout
import Layout from 'component/layout/index.jsx'
render() {
let LayoutRouter = (
<Layout>
- <Route exact path="/login" component={Login}/>
+ <Route exact path="/login/" component={Login}/>
<Route exact path="/" component={Home}/>
- <Route exact path="/home" component={Home}/>
- <Route exact path="/status" component={Status}/>
- <Route exact path="/ppolicy" component={PPolicy}/>
- <Route exact path="/detail" component={DetailInfo}/>
+ <Route exact path="/home/" component={Home}/>
+ <Route exact path="/status/" component={Status}/>
+ <Route exact path="/ppolicy/" component={PPolicy}/>
+ <Route path="/detailInfo/:uuid" component={DetailInfo}/>
+ {/*<Route path="/detail/:uuid" component={DetailInfo}/>*/}
{/*<Redirect exact from="/order" to="/order/index"/>*/}
{/*<Redirect exact from="/user" to="/user/index"/>*/}
{/*<Route component={ErrorPage}/>*/}
</Layout>
);
return (
- <Router>
+ <Router history={history}>
<AnimatedSwitch
atEnter={bounceTransition.atEnter}
atLeave={bounceTransition.atLeave}
Farm</b></a>
</div>
<ul className="nav navbar-top-links navbar-left">
- <li><a href="/home"> <span className="glyphicon glyphicon-home" aria-hidden="true"></span> Home</a>
+ <li><Link to="/home"> <span className="glyphicon glyphicon-home" aria-hidden="true"></span> Home</Link>
</li>
- <li><a href="/status"> <span className="glyphicon glyphicon-tasks" aria-hidden="true"></span> Status</a>
+ <li><Link to="/status"><span className="glyphicon glyphicon-tasks" aria-hidden="true"></span>Status</Link>
</li>
+ {/*<li><Link to="/classifiedDisplay">分类展示</Link><a href="/status"> <span className="glyphicon glyphicon-tasks" aria-hidden="true"></span> Status</a>*/}
+ {/*</li>*/}
<li><a href="#"> <span className="glyphicon glyphicon-blackboard" aria-hidden="true"></span>Machine</a>
</li>
import React from 'react';
import './index.css';
-import {Table, Divider, Segment, Image, Label, Card, Button} from 'semantic-ui-react'
-import TestResultCard from 'component/test-result-card/index.jsx';
+import {Table, Divider, Segment, Image, Label, Card, Button, List, Icon} from 'semantic-ui-react'
import PGUtil from 'util/util.jsx'
import Record from 'service/record-service.jsx'
const _util = new PGUtil();
constructor(props) {
super(props);
this.state = {
- recordNo: 1,
- detailInfo: {},
-
+ recordNo: this.props.match.params.uuid,
+ recordInfo: {},
}
// this.onPageChange = this.onPageChange.bind(this);
return (
<div className="container-fluid detail-container">
<div className="col-md-3">
+ <h2>{this.state.recordNo}</h2>
<Segment vertical>Farmer Info</Segment>
<Card>
<Card.Content>
- <Image floated='right' size='mini' src='http://www.semantic-ui.cn/images/avatar2/small/lena.png' />
- <Card.Header>Steve Sanders</Card.Header>
- <Card.Meta>Friends of Elliot</Card.Meta>
+ <Image floated='right' size='mini'
+ src='http://www.semantic-ui.cn/images/avatar2/small/lena.png'/>
+ <Card.Header>Farmer: Cabbage</Card.Header>
+ <Card.Meta>report num: 4</Card.Meta>
<Card.Description>
- Steve wants to add you to the group <strong>best friends</strong>
+ <List>
+ <List.Item icon='computer' content='ubuntu 16' />
+ <List.Item icon='microchip' content='x86 64' />
+ <List.Item
+ icon='mail'
+ />
+ </List>
+ {/*<div>*/}
+ {/*<ul className="list-group" >*/}
+ {/*<li className="list-group-item">system os:ubuntu 16</li>*/}
+ {/*<li className="list-group-item">camp: x86 64</li>*/}
+ {/*</ul>*/}
+ {/*</div>*/}
</Card.Description>
</Card.Content>
<Card.Content extra>
<div className='ui two buttons'>
<Button basic color='green'>
- Approve
- </Button>
- <Button basic color='red'>
- Decline
+ Other records
</Button>
</div>
</Card.Content>
}
// get record detail info
- getRecordInfo(recordId){
- let url = PGConstant.base_url + '/detail';
-
+ getRecordInfo(listParam){
+ let url = PGConstant.base_url + '/detail/';
+ url = url + listParam.recordNo
return _util.request({
type : 'get',
- url : '/detail',
- data : {
- productId : recordId || 0
- }
+ url : url,
+ // data : {'Ldw7RrdP7jj4q89kgXCfeY'}
});
}
}
import React from 'react';
+import {Link} from 'react-router-dom';
import {Icon, Table, Label, Message, Button} from 'semantic-ui-react'
import Pagination from 'util/pagination/index.jsx'
import './index.css';
}
-
onPageNumChange(current) {
this.setState({
currentPage: current
<Bubble num={trend.regressive} name="regressive"/>
</Table.Cell>
<Table.Cell textAlign='center'>
- <a color='linkedin' href={'detailInfo/' + record.uuid}>
- {/*<Button size='mini' color='linkedin'>*/}
+ <Link color='linkedin' to={'detailInfo/' + record.uuid}>
<Icon name='linkify'/> Link
- {/*</Button>*/}
- </a>
+ </Link>
</Table.Cell>
{/*date*/}
<Table.Cell>{record.add_time}</Table.Cell>
},
resolve: {
// extensions: ['', '.js', '.jsx'],
- alias : {
- page : path.resolve(__dirname, 'src/page'),
- image : path.resolve(__dirname, 'src/image'),
- component : path.resolve(__dirname, 'src/component'),
- service : path.resolve(__dirname, 'src/service'),
- util : path.resolve(__dirname, 'src/util'),
+ alias: {
+ page: path.resolve(__dirname, 'src/page'),
+ image: path.resolve(__dirname, 'src/image'),
+ component: path.resolve(__dirname, 'src/component'),
+ service: path.resolve(__dirname, 'src/service'),
+ util: path.resolve(__dirname, 'src/util'),
}
},
module: {
rules: [{
- test: /\.jsx$/,
- exclude: /(node_modules)/,
- use: {
- loader: 'babel-loader',
- options: {
- presets: ['env', 'react']
- }
- },
+ test: /\.jsx$/,
+ exclude: /(node_modules)/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: ['env', 'react']
+ }
},
+ },
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
})
],
devServer: {
- contentBase: path.join(__dirname, "dist"),
+ contentBase: path.join(__dirname, "/dist/"),
//compress: true,
port: 8086,
historyApiFallback: true,