From fcf8dea72f8c6c6ead88ebe8ddbd1c4550e31be7 Mon Sep 17 00:00:00 2001 From: xuyucheng Date: Tue, 22 Feb 2022 16:23:13 +0800 Subject: [PATCH] mode --- src/pages/home/branch/dashboard/dashboard.js | 27 +++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/pages/home/branch/dashboard/dashboard.js b/src/pages/home/branch/dashboard/dashboard.js index 655f534..185a50b 100644 --- a/src/pages/home/branch/dashboard/dashboard.js +++ b/src/pages/home/branch/dashboard/dashboard.js @@ -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: () => , }, @@ -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 ( @@ -189,7 +200,7 @@ class Dashboard extends Component { -
+
@@ -198,4 +209,8 @@ class Dashboard extends Component { } } -export default Dashboard \ No newline at end of file +const mapStateToProps = (state) => { + return state; +}; + +export default connect(mapStateToProps)(Dashboard); \ No newline at end of file