This commit is contained in:
timorls 2022-03-16 19:36:55 +08:00
parent 0d21a0fa70
commit db12e131b2
4 changed files with 22505 additions and 49 deletions

22435
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -57,7 +57,7 @@
"react-app-polyfill": "^2.0.0", "react-app-polyfill": "^2.0.0",
"react-dev-utils": "^11.0.3", "react-dev-utils": "^11.0.3",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-flow-renderer": "^10.0.0", "react-flow-renderer": "^10.0.1",
"react-pdf": "^5.6.0", "react-pdf": "^5.6.0",
"react-redux": "^7.2.6", "react-redux": "^7.2.6",
"react-refresh": "^0.8.3", "react-refresh": "^0.8.3",

View File

@ -205,11 +205,11 @@ span {
} }
.process { .process {
width: 200px; width: 100%;
height: auto; height: auto;
display: flex; display: flex;
justify-content: center; justify-content: space-around;
flex-wrap: wrap; flex-wrap: nowrap;
} }
.process-box { .process-box {
@ -223,16 +223,32 @@ span {
} }
.process-line { .process-line {
width: 150px; width: 100%;
height: 30px; height: 30px;
margin: 5px 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
.line { .line {
width: 2px; width: 1px;
height: 30px; height: 30px;
background: #1890ff; background: #1890ff;
} }
.connect{
width: 100%;
position: absolute;
}
.connect-line{
width: 100%;
height: 1px;
background: #1890ff;
}
.process-middle{
width: 100%;
display: flex;
justify-content: center;
}

View File

@ -1,38 +1,89 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import api from "@/api/request" import api from "@/api/request"
import { Row } from 'antd'
class RateProcess extends Component { class RateProcess extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
data: {} data: [
{ '综合评价流程': 1 },
{
"问卷填报": 1,
"财务数据填报": 1,
"清洗风险数据": 1
},
{
"模型打分": 1,
},
{ "报告生成": 1 },
{ "证书生成": 1 },
{
"综合信用评价主页": 1,
"财务要素评价主页": 1,
"公司风险分析主页": 1,
"分析指标明细主页": 1
}
]
} }
} }
componentDidMount() { componentDidMount() {
api.post("/admin/rating/get_company_process", { rid: this.props.rid, cid: this.props.cid, types: "综合评价流程" }) // api.post("/admin/rating/get_company_process", { rid: this.props.rid, cid: this.props.cid, types: "综合评价流程" })
.then(res => { // .then(res => {
this.setState({ // this.setState({
data: res.info[0] // data: res.info
}) // }, () => {
}) // console.log(this.state.data)
// })
// })
}
parseProcess = (item, index, key) => {
switch (index) {
case 0:
return <div className='process' style={{ flexWrap: 'wrap' }}>
<div className='process-box'>{key}</div>
<div className='process-line'>
<div className='line'></div>
</div></div>
case 5:
return <div className='process' style={{ flexWrap: 'wrap' }}>
<div className='process-line'>
<div className='line'></div>
</div><div className='process-box'>{key}</div></div>
default:
return <>
<div className='process' style={{ flexWrap: 'wrap' }}>
<div className='process-line'>
<div className='line'></div>
</div><div className='process-box'>{key}</div><div className='process-line'>
<div className='line'></div>
</div>
</div>
</>
}
} }
render() { render() {
return ( return (
<div> <div>
{this.state.data['评价流程'] && Object.keys(this.state.data['评价流程']).map(key => { {this.state.data.map((item, index) => {
return <div className='process'> return <><div className='connect' style={{ left: (100 - (Object.keys(item).length - 1) * 100 / Object.keys(item).length) / 2 + '%' }}><div className='connect-line' style={{ width: (Object.keys(item).length - 1) * 100 / Object.keys(item).length + '%', }}></div></div><Row justify="space-between" style={{ flexWrap: 'nowrap' }}>
<div className='process-box'>{key}</div> <Row justify="space-between" style={{ flexWrap: 'nowrap' }}></Row>
<div className='process-line'> {Object.keys(item).map(key => {
<div className='line'></div> return this.parseProcess(item, index, key)
</div> })}
</div> <div className='connect' style={{ left: (100 - (Object.keys(item).length - 1) * 100 / Object.keys(item).length) / 2 + '%' }}><div className='connect-line' style={{ width: (Object.keys(item).length - 1) * 100 / Object.keys(item).length + '%', }}></div></div>
</Row>
{index === this.state.data.length-1 ? null :<div className='connect' style={{ left: (100 - (Object.keys(item).length - 1) * 100 / Object.keys(item).length) / 2 + '%' }}><div className='connect-line' style={{ width: (Object.keys(item).length - 1) * 100 / Object.keys(item).length + '%', }}></div></div>}
</>
})} })}
</div> </div>
) )
} }
} }
export default RateProcess export default RateProcess