mode
This commit is contained in:
parent
59334b5f4a
commit
fcf8dea72f
|
@ -3,8 +3,12 @@ import * as echarts from 'echarts/lib/echarts'
|
|||
import "echarts/lib/chart/line";
|
||||
import "echarts/lib/chart/pie";
|
||||
import 'echarts/lib/component/grid'
|
||||
import { Card, Row, Col, Table, Button } from 'antd';
|
||||
import { Card, Row, Col, Button } from 'antd';
|
||||
import api from "@/api/request"
|
||||
import { connect } from 'react-redux';
|
||||
import store from "@/store/index"
|
||||
import { operationAction } from "@/action/index"
|
||||
import FeTable from '@/components/table'
|
||||
|
||||
class Dashboard extends Component {
|
||||
constructor(props) {
|
||||
|
@ -14,12 +18,11 @@ class Dashboard extends Component {
|
|||
columns: [
|
||||
{ title: '企业ID', dataIndex: '企业ID', key: 0 },
|
||||
{ title: '企业名称', dataIndex: '企业名称', key: 1 },
|
||||
{ title: '所属行业', dataIndex: '所属行业', key: 2 },
|
||||
{ title: '认证时间', dataIndex: '认证时间', key: 3 },
|
||||
{ title: '注册时间', dataIndex: '注册时间', key: 2 },
|
||||
{
|
||||
title: '详 情',
|
||||
dataIndex: '详 情',
|
||||
key: 4,
|
||||
key: 3,
|
||||
align: 'center',
|
||||
render: () => <Button type="primary" size='small'>详 情</Button>,
|
||||
},
|
||||
|
@ -144,6 +147,14 @@ class Dashboard extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
callback(e, value) {
|
||||
if (e === "详 情") {
|
||||
const newPanes = [...this.props.panes]
|
||||
newPanes.push({ title: value["企业名称"] + '(' + value["企业ID"] + ')', content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key)))
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
@ -189,7 +200,7 @@ class Dashboard extends Component {
|
|||
</Col>
|
||||
<Col span={16}>
|
||||
<Card title="新增企业信息">
|
||||
<Table pagination={false} dataSource={this.state.data['新增企业信息']} columns={this.state.columns}></Table>
|
||||
<FeTable data={this.state.data['新增企业信息']} columns={this.state.columns} callback={this.callback.bind(this)}></FeTable>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -198,4 +209,8 @@ class Dashboard extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default Dashboard
|
||||
const mapStateToProps = (state) => {
|
||||
return state;
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(Dashboard);
|
Loading…
Reference in New Issue