This commit is contained in:
xuyucheng 2022-01-10 16:43:57 +08:00
parent 7006426be4
commit 37e1ca568e
13 changed files with 423 additions and 22236 deletions

22198
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#root,
html,
body,
.App{
.App {
height: 100%;
margin: 0;
padding: 0;
@ -9,39 +9,39 @@ body,
font-family: 'SR';
}
@font-face{
@font-face {
font-family: 'SR';
src: url('./SourceHanSansK-Normal.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.ant-layout{
.ant-layout {
height: 100%;
}
.ant-layout-header{
.ant-layout-header {
background-color: #fff;
}
.ant-layout-content{
.ant-layout-content {
margin: 0px 50px 40px 50px;
/* overflow: auto; */
height: calc(100% - 254px);
}
.ant-menu{
.ant-menu {
/* padding: 20px 0px; */
background-color: #1F2E3E;
}
.flex-center{
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.flex-end{
.flex-end {
display: flex;
justify-content: flex-end;
align-items: center;
@ -55,56 +55,56 @@ body,
background: transparent;
}
.ant-layout-sider-light{
.ant-layout-sider-light {
background-color: transparent;
}
::-webkit-scrollbar {
width: 5px;
height: 10px;
}
}
::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 3px;
}
.w-e-text-container{
.w-e-text-container {
height: 90% !important;
}
.ant-input:focus{
.ant-input:focus {
/* border: none !important; */
}
p{
p {
font-size: 16px;
}
span{
span {
font-size: 12px;
}
.ant-popover-arrow{
.ant-popover-arrow {
display: none;
}
.ant-popover-title{
min-width:80px;
color:#fff;
.ant-popover-title {
min-width: 80px;
color: #fff;
background-color: rgba(0, 0, 0, 0.85);
border: none;
}
.ant-popover-inner-content{
padding:0;
.ant-popover-inner-content {
padding: 0;
color: #fff
}
.badge{
.badge {
position: relative;
top: 20px;
left:0;
left: 0;
width: 20px;
height: 20px;
font-size: 14px;
@ -115,69 +115,78 @@ span{
z-index: 999;
}
.gutter-row{
.gutter-row {
display: flex;
justify-content: center;
}
.ant-popover-inner-content{
.ant-popover-inner-content {
padding: 10px 20px;
}
.ant-menu-item{
.ant-menu-item {
border-left: 2px solid transparent;
}
.ant-menu-item-selected{
.ant-menu-item-selected {
background-color: transparent !important;
border-left: 2px solid #317DE8;
}
.ant-page-header-heading-title{
.ant-page-header-heading-title {
color: #fff;
}
/* 输入框样式 */
.ant-input-affix-wrapper{
.ant-input-affix-wrapper {
background-color: #FAF7FA;
}
.ant-input{
.ant-input {
/* background-color: #FAF7FA; */
}
/* 卡片样式 */
.card{
.card {
height: 100%;
padding-bottom: 10px;
cursor: pointer;
}
.ant-card-body{
.ant-card-body {
overflow: auto;
}
.content-p{
.content-p {
font-size: 20px;
}
.increase{
color:#80B065;
.increase {
color: #80B065;
}
.reduce{
color:#FF5E40;
.reduce {
color: #FF5E40;
}
/* 日历样式 */
.ant-picker-calendar{
.ant-picker-calendar {
padding: 20px;
}
/* 两端对齐文字 */
.space-word{
.space-word {
padding: 10px;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #f0f0f0;
}
.ant-descriptions {
margin-bottom: 20px;
}
.block{
display: block;
margin: 5px 0;
}

View File

@ -1,34 +1,37 @@
import React, { Component } from 'react'
import { Table} from 'antd'
import { Table } from 'antd'
class FeTable extends Component {
constructor(props) {
super(props)
this.state={
data:[],
columns:[]
this.state = {
data: [],
columns: []
}
}
componentWillReceiveProps(props) {
this.setState({
data: props.data,
columns: props.columns
})
static getDerivedStateFromProps(props, state) {
if (props.data !== state.data) {
return {
data: props.data,
columns: props.columns
}
}
return null
}
jumpRow = (value) =>{
jumpRow = (value) => {
return this.props.callback(value)
}
render() {
return (
<React.Fragment>
<Table bordered dataSource={this.state.data} columns={this.state.columns} onRow={record=>{
return{
onClick: event=>this.jumpRow(record)
}
<Table bordered style={{marginBottom:20}} dataSource={this.state.data} columns={this.state.columns} onRow={record => {
return {
onClick: event => this.jumpRow(record)
}
}
} pagination={
{
total: this.state.total,

View File

@ -0,0 +1,23 @@
import React, { Component } from 'react'
class EditReport extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<React.Fragment>
</React.Fragment>
)
}
}
export default EditReport

View File

@ -0,0 +1,67 @@
import React, { Component } from 'react'
import api from "@/api/request"
import { Descriptions } from 'antd'
import FeTable from '@/components/table'
class FillDetails extends Component {
constructor(props) {
super(props)
this.state = {
data: [],
financialFill: {}
}
}
componentDidMount() {
api.post("/admin/rating/details", { rid: this.props.id })
.then(res => {
this.setState({
data: res.result.length !== 0 ? res.result[0] : [],
financialFill: res.result.length !== 0 ? res.result[0]['财务填报'] : []
})
}).catch(err => {
console.log(err)
})
}
analysisQuestion(val) {
if ("经营问卷" in this.state.data) {
return val.map((key, i) => {
return <Descriptions.Item label={i + 1 + "题"} key={i}>{key}</Descriptions.Item>
})
} else {
return null
}
}
analysisObject(val) {
if (Object.keys(val).length !== 0) {
return Object.keys(val).map(key => {
const columns = Object.keys(val[key][0]).map((item, i) => {
return {
title: item, dataIndex: item, align: 'center', key: i
}
})
return <FeTable data={val[key]} columns={columns}></FeTable>
})
} else {
return null
}
}
render() {
return (
<React.Fragment>
<Descriptions title={this.state.data["企业名称"]} bordered extra={<span>企业ID{this.state.data["企业ID"]}</span>}>
</Descriptions>
<p><span>评价年度{this.state.data["评价年度"]}</span> <span style={{ float: 'right' }}>{(() => { if ("行业选择" in this.state.data&&this.state.data["行业选择"]!==null) { return this.state.data["行业选择"].join("/") } else { return null } })()}</span></p>
<Descriptions title="经营问卷" bordered>
{this.analysisQuestion(this.state.data["经营问卷"])}
</Descriptions>
{this.analysisObject(this.state.financialFill)}
</React.Fragment>
)
}
}
export default FillDetails

View File

@ -0,0 +1,39 @@
import React, { Component } from 'react'
import { Card, Tabs } from 'antd'
import RateResult from './rateResult';
import FillDetails from './fillDetails';
import RiskData from './riskData';
import EditReport from './editReport';
const { TabPane } = Tabs;
class RateTabs extends Component {
constructor(props) {
super(props)
this.state = {
}
}
render() {
return (
<Card>
<Tabs defaultActiveKey="1">
<TabPane tab="评价结果" key="1">
<RateResult id={this.props.id} />
</TabPane>
<TabPane tab="填报详情" key="2">
<FillDetails id={this.props.id} />
</TabPane>
<TabPane tab="风险数据" key="3">
<RiskData id={this.props.id} />
</TabPane>
<TabPane tab="编辑报告" key="4">
<EditReport id={this.props.id} />
</TabPane>
</Tabs>
</Card>
)
}
}
export default RateTabs

View File

@ -0,0 +1,90 @@
import React, { Component } from 'react'
import { Descriptions,Card } from 'antd'
import api from "@/api/request"
class RateResult extends Component {
constructor(props) {
super(props)
this.state = {
data: {},
managementScore: {},
financialScore: {},
riskScore: {}
}
}
componentDidMount() {
api.post("/admin/rating/rating_result", { rid: this.props.id })
.then(res => {
this.setState({
data: res.result[0],
managementScore: res.result[0]["经营评分"],
financialScore: res.result[0]["财务评分"],
riskScore: res.result[0]["风险评分"]
})
}).catch(err => {
console.log(err)
})
}
analysisObject(val) {
if (Object.keys(val).length !== 0) {
return Object.keys(val).map((key) => {
if (typeof val[key] !== 'object') {
return <p>{key}:{val[key]}</p>
} else {
return <Descriptions bordered title={key} >{Object.keys(val[key]).map((child,n) => {
if (typeof val[key][child] !== 'object') {
return <Descriptions.Item label={child} key={n}>{val[key][child]}</Descriptions.Item >
} else {
return <p>{child}
{Object.keys(val[key][child]).map((ele, j) => {
return <span className="block">{ele}:{val[key][child][ele]}</span>
// return <Descriptions.Item label={ele} key={j}>{val[key][child][ele]}</Descriptions.Item>
})}
</p>
}
})}</Descriptions>
}
})
} else {
return null
}
}
render() {
return (
<React.Fragment>
{(() => {
if (this.state.data === {}) {
return null;
} else {
return <React.Fragment><Descriptions title={this.state.data["企业名称"]} bordered extra={<span>企业ID{this.state.data["企业ID"]}</span>}>
{Object.keys(this.state.data).map((key, i) => {
if (!['经营评分', '财务评分', '风险评分'].includes(key)) {
return <Descriptions.Item label={key} key={i}>{this.state.data[key]}</Descriptions.Item>
} else {
return null
}
})}
</Descriptions>
<Descriptions title="经营评分" bordered>
{Object.keys(this.state.managementScore).map((key, i) => {
return <Descriptions.Item label={key} key={i}>{this.state.managementScore[key]}</Descriptions.Item>
})}
</Descriptions>
<Card title="财务评分" type="inner" style={{marginBottom:20}}>
{this.analysisObject(this.state.financialScore)}
</Card>
<Card title="风险评分" type="inner">
{this.analysisObject(this.state.riskScore)}
</Card>
</React.Fragment>
}
})()}
</React.Fragment>
)
}
}
export default RateResult

View File

@ -0,0 +1,62 @@
import React, { Component } from 'react'
import api from "@/api/request"
import { Descriptions } from 'antd'
class RiskData extends Component {
constructor(props) {
super(props)
this.state = {
data: {}
}
}
componentDidMount() {
api.post("/admin/rating/risk", { rid: this.props.id })
.then(res => {
this.setState({
data: res.result.length!==0?res.result[0]:[]
})
}).catch(err => {
console.log(err)
})
}
analysisObject(val) {
console.log(val)
if (Object.keys(val).length !== 0) {
return Object.keys(val).map(key => {
if (typeof val[key] === "object") {
if (['合规风险', '经营风险'].includes(key)) {
return <Descriptions title={key} bordered>
{Object.keys(val[key]).map((item, i) => {
return <Descriptions.Item label={item} key={i}>{val[key][item]}</Descriptions.Item>
})}
</Descriptions>
} else {
return Object.keys(val[key]).map((item, i) => {
return <Descriptions title={item} bordered>
{Object.keys(val[key][item]).map((ele, j) => {
return <Descriptions.Item label={ele} key={j}>{val[key][item][ele]}</Descriptions.Item>
})}
</Descriptions>
})
}
}else{
return null
}
})
} else {
return null
}
}
render() {
return (
<React.Fragment>
{this.analysisObject(this.state.data)}
</React.Fragment>
)
}
}
export default RiskData

View File

@ -0,0 +1,56 @@
import React, { Component } from 'react'
import { Input } from 'antd'
import FeTable from '@/components/table'
import api from "@/api/request"
import { connect } from 'react-redux';
import store from "@/store/index"
import { operationAction } from "@/action/index"
import RateTabs from './branch/index';
const { Search } = Input
class ManagerRate extends Component {
constructor(props) {
super(props)
this.state = {
data: [],
columns: []
}
}
onSearch = (value) => {
api.post("/admin/rating/search", { query: value }).then(res => {
this.setState({
data: res.result,
columns: Object.keys(res.result[0]).map((key, i) => {
return {
title: key, dataIndex: key, align: 'center', key: i
}
})
})
}).catch(err => {
console.log(err)
})
}
callback(value) {
const newPanes = [...this.props.panes]
newPanes.push({ title: value["评价项目"]+'('+value["评价ID"]+')', content: <RateTabs id={value["评价ID"]} />, key: (Number(newPanes[newPanes.length - 1].key)+1).toString() });
store.dispatch(operationAction(newPanes,(Number(newPanes[newPanes.length - 1].key)).toString()))
}
render() {
return (
<React.Fragment>
<Search placeholder="检索评价" onSearch={this.onSearch} enterButton style={{ width: 300, marginBottom: 20 }} />
<FeTable data={this.state.data} columns={this.state.columns} callback={this.callback.bind(this)}></FeTable>
</React.Fragment>
)
}
}
const mapStateToProps = (state) => {
return state;
};
export default connect(mapStateToProps)(ManagerRate);

View File

@ -6,7 +6,8 @@ import ServiceList from './branch/service'
import UserList from './branch/user'
import FinancialList from './branch/financial'
import TestCompany from "./branch/test/company"
import ManagerCompany from './branch/manager/company'
import ManagerCompany from './branch/manager/company/company'
import ManagerRate from './branch/manager/rate/rate'
import { connect } from 'react-redux';
import { Tabs } from 'antd';
@ -89,6 +90,8 @@ class Main extends Component {
return <FinancialList />
case "/manager/company":
return <ManagerCompany />
case "/manager/rate":
return <ManagerRate />
case "/test/company":
return <TestCompany />
default:
@ -129,7 +132,6 @@ class Main extends Component {
}
const mapStateToProps = (state) => {
console.log(state)
return state;
};

View File

@ -9,7 +9,7 @@ class Side extends Component {
data: [
{ title: '面板', path: '/dashboard', icon: <AreaChartOutlined />, category: 'Board' },
{ title: '企业', path: '/manager/company', icon: <FundProjectionScreenOutlined />, category: 'Manager' },
{ title: '服务', path: '/service', icon: <GlobalOutlined />, category: 'Manager' },
{ title: '服务', path: '/manager/rate', icon: <GlobalOutlined />, category: 'Manager' },
{ title: '行业宏观', path: '/financial', icon: <BookOutlined />, category: 'Manager' },
{ title: '阈值', path: '/service', icon: <BranchesOutlined />, category: 'Model' },
{ title: '行业分类', path: '/service', icon: <ApartmentOutlined />, category: 'Model' },