From: Hongyuan Ma Date: Sun, 24 Jun 2018 04:00:48 +0000 (+0800) Subject: add link to detail page X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpgdulink%28?a=commitdiff_plain;h=ac518b599727ec522b8d122ef3ea7af19495a3af;p=pgperffarm.git add link to detail page --- diff --git a/front-end/src/app.jsx b/front-end/src/app.jsx index 8788c32..7b5b0f9 100644 --- a/front-end/src/app.jsx +++ b/front-end/src/app.jsx @@ -1,6 +1,8 @@ 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' @@ -56,20 +58,21 @@ class App extends React.Component { render() { let LayoutRouter = ( - + - - - - + + + + + {/**/} {/**/} {/**/} {/**/} ); return ( - +
    -
  • Home +
  • Home
  • -
  • Status +
  • Status
  • + {/*
  • 分类展示 Status*/} + {/*
  • */}
  • Machine
  • diff --git a/front-end/src/page/detailInfo/index.jsx b/front-end/src/page/detailInfo/index.jsx index 7668449..93dd26f 100644 --- a/front-end/src/page/detailInfo/index.jsx +++ b/front-end/src/page/detailInfo/index.jsx @@ -1,7 +1,6 @@ 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(); @@ -10,9 +9,8 @@ class DetailInfo extends React.Component { constructor(props) { super(props); this.state = { - recordNo: 1, - detailInfo: {}, - + recordNo: this.props.match.params.uuid, + recordInfo: {}, } // this.onPageChange = this.onPageChange.bind(this); @@ -42,23 +40,35 @@ class DetailInfo extends React.Component { return (
    +

    {this.state.recordNo}

    Farmer Info - - Steve Sanders - Friends of Elliot + + Farmer: Cabbage + report num: 4 - Steve wants to add you to the group best friends + + + + mahongyuan1997@semantic-ui.com} + /> + + {/*
    */} + {/*
      */} + {/*
    • system os:ubuntu 16
    • */} + {/*
    • camp: x86 64
    • */} + {/*
    */} + {/*
    */}
    -
    diff --git a/front-end/src/service/record-service.jsx b/front-end/src/service/record-service.jsx index 3108aaa..33ba627 100644 --- a/front-end/src/service/record-service.jsx +++ b/front-end/src/service/record-service.jsx @@ -18,15 +18,13 @@ class Record{ } // 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'} }); } } diff --git a/front-end/src/util/basic-table/index.jsx b/front-end/src/util/basic-table/index.jsx index e63141d..bcd2678 100644 --- a/front-end/src/util/basic-table/index.jsx +++ b/front-end/src/util/basic-table/index.jsx @@ -1,4 +1,5 @@ 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'; @@ -28,7 +29,6 @@ class BasicTable extends React.Component { } - onPageNumChange(current) { this.setState({ currentPage: current @@ -81,11 +81,9 @@ class BasicTable extends React.Component { - - {/**/} - + {/*date*/} {record.add_time} diff --git a/front-end/webpack.config.js b/front-end/webpack.config.js index 63b164a..4eeec6b 100644 --- a/front-end/webpack.config.js +++ b/front-end/webpack.config.js @@ -14,26 +14,26 @@ module.exports = { }, 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({ @@ -83,7 +83,7 @@ module.exports = { }) ], devServer: { - contentBase: path.join(__dirname, "dist"), + contentBase: path.join(__dirname, "/dist/"), //compress: true, port: 8086, historyApiFallback: true,