From b6f1359b7bd04a52b651ddb7688fb609e277fbdb Mon Sep 17 00:00:00 2001 From: xuyucheng Date: Tue, 22 Feb 2022 17:16:40 +0800 Subject: [PATCH] mode --- src/assets/style/general.css | 4 + src/pages/home/branch/dashboard/dashboard.js | 14 ++-- .../branch/manage/company/companyDetails.js | 78 +++++++++++++++++-- 3 files changed, 83 insertions(+), 13 deletions(-) diff --git a/src/assets/style/general.css b/src/assets/style/general.css index 0e46aaa..596db0a 100644 --- a/src/assets/style/general.css +++ b/src/assets/style/general.css @@ -157,6 +157,10 @@ span { cursor: pointer; } +.ant-card { + margin-bottom: 20px; +} + .ant-card-body { overflow: auto; } diff --git a/src/pages/home/branch/dashboard/dashboard.js b/src/pages/home/branch/dashboard/dashboard.js index e2b0da0..e34d526 100644 --- a/src/pages/home/branch/dashboard/dashboard.js +++ b/src/pages/home/branch/dashboard/dashboard.js @@ -124,7 +124,7 @@ class Dashboard extends Component { height: '100%' }, color: ['#377AE4', '#F4C100', '#FF3525'], - series: [ + series: [ { name: 'Data', type: 'pie', @@ -167,22 +167,22 @@ class Dashboard extends Component { - -

{this.state.data['监测数据'] && this.state.data['监测数据']['异常日志']}

+ +

{this.state.data['监测数据'] && this.state.data['监测数据']['异常日志']}/条

{/* -3.65% Since last week */}
-

{this.state.data['监测数据'] && this.state.data['监测数据']['服务次数']}

+

{this.state.data['监测数据'] && this.state.data['监测数据']['服务次数']}/次

{/* 5.25% Since last week */}
- -

{this.state.data['监测数据'] && this.state.data['监测数据']['留言反馈']}

+ +

{this.state.data['监测数据'] && this.state.data['监测数据']['留言反馈']}/条

{/* 6.65% Since last week */}
-

{this.state.data['监测数据'] && this.state.data['监测数据']['认证企业']}

+

{this.state.data['监测数据'] && this.state.data['监测数据']['认证企业']}/家

{/* -2.25% Since last week */}
diff --git a/src/pages/home/branch/manage/company/companyDetails.js b/src/pages/home/branch/manage/company/companyDetails.js index cbdba66..c40cb7b 100644 --- a/src/pages/home/branch/manage/company/companyDetails.js +++ b/src/pages/home/branch/manage/company/companyDetails.js @@ -1,7 +1,12 @@ import React, { Component } from 'react' -import { Descriptions, Card,Tag } from 'antd' +import { Descriptions, Card,Tag,Button } from 'antd' import api from "@/api/request" import FeTable from '@/components/table' +import Pdf from "@/components/pdf" +import { connect } from 'react-redux'; +import store from "@/store/index" +import { operationAction } from "@/action/index" + class CompanyDetails extends Component { constructor(props) { @@ -11,10 +16,14 @@ class CompanyDetails extends Component { businessInformation: [], shareholdersInformation: [], companyMember: [], - evaluationRecords: [] + evaluationRecords: [], + file: "", + visible: false } } + isJump = false + componentDidMount() { api.post("/admin/company/index", { cid: this.props.id }) .then(res => { @@ -35,19 +44,72 @@ class CompanyDetails extends Component { analysisColumns(val) { if (val !== [] && val) { if(val[0]){ - return Object.keys(val[0]).map((key, i) => { - return { + const col = Object.keys(val[0]).map((key, i) => { + return key === "证书" || key === "报告" ? { + title: key, + dataIndex: key, + key: i, + align: 'center', + render: (record) => , + } : { title: key, dataIndex: key, align: 'center', key: i } }) + col.push({ + title: '详 情', + dataIndex: '详 情', + key: col.length, + align: 'center', + render: () => , + }) + + return col } } } + handleClick(value) { + this.isJump = true + this.setState({ + visible: true, + }, () => { + api.BlobGet("/admin" + value).then(res => { + this.setState({ + file: res + }) + }) + }) + } + + setVisible(value) { + this.setState({ + visible: value + }) + } + + callback(e, value) { + if (!this.isJump) { + if (e === "详 情") { + const newPanes = [...this.props.panes] + const state = newPanes.every(item => { + return item.title === value["评价项目"] + '(' + value["评价ID"] + ')' ? false : true + }) + if (state) { + newPanes.push({ title: value["评价项目"] + '(' + value["评价ID"] + ')', content: "/manage/rate/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() }); + store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key))) + } else { + return null + } + } + } + this.isJump = false + } + render() { return ( + 已认证:{this.state.data["已认证"]}}> {this.state.businessInformation} @@ -56,11 +118,15 @@ class CompanyDetails extends Component {

主要成员

评价记录

- +
) } } -export default CompanyDetails \ No newline at end of file +const mapStateToProps = (state) => { + return state; +}; + +export default connect(mapStateToProps)(CompanyDetails); \ No newline at end of file