mode
This commit is contained in:
parent
b6f1359b7b
commit
0b53be6c52
|
@ -2,7 +2,7 @@ import axios from 'axios'
|
|||
import { message } from 'antd'
|
||||
|
||||
axios.defaults.timeout = 50000;
|
||||
axios.defaults.baseURL = 'http://139.9.249.34:51013'
|
||||
axios.defaults.baseURL = 'https://api.fecribd.com'
|
||||
|
||||
axios.interceptors.request.use(config => {
|
||||
const secret = "EZgo9ykxrYuBMYnYmmKIh"
|
||||
|
|
|
@ -1,20 +1,47 @@
|
|||
import React, { Component } from 'react';
|
||||
import api from "@/api/request"
|
||||
import text_model from '@/utils/model'
|
||||
import { Input, Button, Row, Col } from 'antd'
|
||||
import { Input, Button, Row, Col, Tree } from 'antd'
|
||||
import "@/assets/style/editReport.css"
|
||||
|
||||
class EditReport extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
text_model: text_model
|
||||
data: [],
|
||||
tree: []
|
||||
}
|
||||
}
|
||||
|
||||
// componentDidMount() {
|
||||
componentDidMount() {
|
||||
api.post("/admin/rating/get_report_text_model", { rid: this.props.id })
|
||||
.then(res => {
|
||||
this.setState({
|
||||
data: res.result['text_model'],
|
||||
tree: this.createTree(res.result['text_model'])
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// }
|
||||
createTree = (val) => {
|
||||
const data = val.map((item, index) => {
|
||||
return {
|
||||
title: item['章节'], key: index.toString(), children: item["章节内容"].map((item_1, index_1) => {
|
||||
return {
|
||||
title: item_1['小节'], key: index.toString() + index_1.toString(), children: item_1["小节内容"].map((item_2, index_2) => {
|
||||
console.log(item_2)
|
||||
return { title: Object.keys(item_2)[0], key: index.toString() + index_1.toString() + index_2.toString() }
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
onSelect = (value) =>{
|
||||
console.log(value)
|
||||
}
|
||||
|
||||
simulate = (value, i, j, m, n) => {
|
||||
return value.map((item, index_first) => {
|
||||
|
@ -31,7 +58,7 @@ class EditReport extends Component {
|
|||
}
|
||||
|
||||
onSimulate = (a, b, c, d, e, f, g) => {
|
||||
const data = this.state.text_model.filter((item, i) => {
|
||||
const data = this.state.data.filter((item, i) => {
|
||||
if (a === i) {
|
||||
return item["章节内容"].filter((ele, j) => {
|
||||
if (b === j) {
|
||||
|
@ -58,19 +85,19 @@ class EditReport extends Component {
|
|||
})
|
||||
|
||||
this.setState({
|
||||
text_model: data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
onFinish = () => {
|
||||
api.post("/admin/rating/report_edit_save_delete", { rid: this.props.id, text_model: this.state.text_model })
|
||||
api.post("/admin/rating/report_edit_save_delete", { rid: this.props.id, text_model: this.state.data })
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
onOutput = (a, b, c, d, e) => {
|
||||
const data = this.state.text_model.filter((item, i) => {
|
||||
const data = this.state.data.filter((item, i) => {
|
||||
if (a === i) {
|
||||
return item["章节内容"].filter((ele, j) => {
|
||||
if (b === j) {
|
||||
|
@ -97,7 +124,7 @@ class EditReport extends Component {
|
|||
})
|
||||
|
||||
this.setState({
|
||||
text_model: data
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -106,33 +133,44 @@ class EditReport extends Component {
|
|||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Button onClick={this.onFinish}>输出</Button>
|
||||
{this.state.text_model.map((item, i) => {
|
||||
return <React.Fragment><span className="paragraph_name">
|
||||
{item["章节"]}
|
||||
</span>
|
||||
{item["章节内容"].map((item_child, j) => {
|
||||
return <React.Fragment><span className="paragraph_name" style={{ marginLeft: 20 }}>{item_child["小节"]}</span>
|
||||
{
|
||||
item_child["小节内容"].map((item_child_child, m) => {
|
||||
return Object.keys(item_child_child).map((key, n) => {
|
||||
return key === "表格" ? <React.Fragment>
|
||||
<span className="paragraph_name" style={{ marginLeft: 40 }}>{key}:</span>
|
||||
{this.simulate(item_child_child[key], i, j, m, n)}
|
||||
</React.Fragment>
|
||||
: <React.Fragment>
|
||||
<span className="paragraph_name" style={{ marginLeft: 40 }}>{key}:</span>
|
||||
<Input.TextArea
|
||||
style={{ marginLeft: 60, width: "calc(100% - 80px)", }}
|
||||
defaultValue={item_child_child[key]}
|
||||
onChange={this.onOutput.bind(this, i, j, m, n)} />
|
||||
</React.Fragment>
|
||||
})
|
||||
})
|
||||
} </React.Fragment>
|
||||
})}
|
||||
</React.Fragment>
|
||||
})}
|
||||
<Row>
|
||||
<Col span={4}> <Tree
|
||||
defaultExpandedKeys={['0-0-0', '0-0-1']}
|
||||
defaultSelectedKeys={['0-0-0', '0-0-1']}
|
||||
defaultCheckedKeys={['0-0-0', '0-0-1']}
|
||||
treeData={this.state.tree}
|
||||
onSelect={this.onSelect}
|
||||
/></Col>
|
||||
<Col span={20}><Button onClick={this.onFinish}>输出</Button>
|
||||
{this.state.data.map((item, i) => {
|
||||
return <React.Fragment><span className="paragraph_name">
|
||||
{item["章节"]}
|
||||
</span>
|
||||
{item["章节内容"].map((item_child, j) => {
|
||||
return <React.Fragment><span className="paragraph_name" style={{ marginLeft: 20 }}>{item_child["小节"]}</span>
|
||||
{
|
||||
item_child["小节内容"].map((item_child_child, m) => {
|
||||
return Object.keys(item_child_child).map((key, n) => {
|
||||
return key === "表格" ? <React.Fragment>
|
||||
<span className="paragraph_name" style={{ marginLeft: 40 }}>{key}:</span>
|
||||
{this.simulate(item_child_child[key], i, j, m, n)}
|
||||
</React.Fragment>
|
||||
: <React.Fragment>
|
||||
<span className="paragraph_name" style={{ marginLeft: 40 }}>{key}:</span>
|
||||
<Input.TextArea
|
||||
style={{ marginLeft: 60, width: "calc(100% - 80px)", }}
|
||||
defaultValue={item_child_child[key]}
|
||||
onChange={this.onOutput.bind(this, i, j, m, n)} />
|
||||
</React.Fragment>
|
||||
})
|
||||
})
|
||||
} </React.Fragment>
|
||||
})}
|
||||
</React.Fragment>
|
||||
})}</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react'
|
||||
import { Descriptions,Card,Tag } from 'antd'
|
||||
import { Descriptions, Tag, Divider } from 'antd'
|
||||
import api from "@/api/request"
|
||||
|
||||
class RateResult extends Component {
|
||||
|
@ -7,9 +7,6 @@ class RateResult extends Component {
|
|||
super(props)
|
||||
this.state = {
|
||||
data: {},
|
||||
managementScore: {},
|
||||
financialScore: {},
|
||||
riskScore: {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,73 +15,81 @@ class RateResult extends Component {
|
|||
.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 <React.Fragment><Tag color="#2db7f5">{key}</Tag><Descriptions bordered >{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 <Tag>{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>
|
||||
})}
|
||||
</Tag>
|
||||
}
|
||||
})}</Descriptions></React.Fragment>
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{(() => {
|
||||
if (this.state.data === {}) {
|
||||
return null;
|
||||
} else {
|
||||
return <React.Fragment><Descriptions title={this.state.data["企业名称"]} bordered extra={<Tag color="#108ee9">企业ID:{this.state.data["企业ID"]}</Tag>}>
|
||||
{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>
|
||||
<Tag color="#108ee9">经营评分</Tag>
|
||||
<Descriptions bordered>
|
||||
{Object.keys(this.state.managementScore).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.managementScore[key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Tag color="#108ee9">财务评分</Tag>
|
||||
<Card type="inner" style={{marginBottom:20}}>
|
||||
{this.analysisObject(this.state.financialScore)}
|
||||
</Card>
|
||||
<Tag color="#108ee9">风险评分</Tag>
|
||||
<Card type="inner">
|
||||
{this.analysisObject(this.state.riskScore)}
|
||||
</Card>
|
||||
</React.Fragment>
|
||||
}
|
||||
})()}
|
||||
<Descriptions title={this.state.data["企业名称"]} column={4} extra={<Tag color="#108ee9">企业ID:{this.state.data["企业ID"]}</Tag>} style={{ marginTop: 20 }}>
|
||||
{Object.keys(this.state.data).map((key, i) => {
|
||||
if (!['经营评分', '财务评分', '风险评分', "企业ID", "企业名称"].includes(key)) {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data[key]}</Descriptions.Item>
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})}
|
||||
</Descriptions>
|
||||
<Divider />
|
||||
<Tag color="#108ee9" style={{ marginBottom: 20 }}>经营评分</Tag>
|
||||
<Descriptions column={4}>
|
||||
{this.state.data["经营评分"] && Object.keys(this.state.data["经营评分"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["经营评分"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Divider />
|
||||
<Tag color="#108ee9" style={{ marginBottom: 20 }}>财务评分</Tag>
|
||||
<Descriptions column={4} title="盈利能力">
|
||||
{this.state.data["财务评分"] && Object.keys(this.state.data["财务评分"]["盈利能力"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["财务评分"]["盈利能力"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Descriptions column={4} title="债务风险">
|
||||
{this.state.data["财务评分"] && Object.keys(this.state.data["财务评分"]["债务风险"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["财务评分"]["债务风险"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Descriptions column={4} title="经营增长">
|
||||
{this.state.data["财务评分"] && Object.keys(this.state.data["财务评分"]["经营增长"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["财务评分"]["经营增长"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Descriptions column={4} title="资产质量">
|
||||
{this.state.data["财务评分"] && Object.keys(this.state.data["财务评分"]["资产质量"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["财务评分"]["资产质量"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Descriptions column={4} title="财务合计">
|
||||
<Descriptions.Item label="合计">{this.state.data["财务评分"] && this.state.data["财务评分"]["合计"]}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Divider />
|
||||
<Tag color="#108ee9" style={{ marginBottom: 20 }}>风险评分</Tag>
|
||||
<Descriptions column={4} title="合规风险">
|
||||
<Descriptions.Item label="合规风险">{this.state.data["风险评分"] && this.state.data["风险评分"]["合规风险"]}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Descriptions column={4} title="经营风险">
|
||||
{this.state.data["风险评分"] && Object.keys(this.state.data["风险评分"]["经营风险"]).map((key, i) => {
|
||||
return <Descriptions.Item label={key} key={i}>{this.state.data["风险评分"]["经营风险"][key]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
<Divider />
|
||||
{this.state.data["风险评分"] && this.state.data["风险评分"]["关联风险"] && this.state.data["风险评分"]["关联风险"]["变更记录"] && Object.keys(this.state.data["风险评分"]["关联风险"]["变更记录"]).map((key, i) => {
|
||||
return <Descriptions column={4} title="关联风险 - 变更记录"><Descriptions.Item label={key} key={i}>{this.state.data["风险评分"]["关联风险"]["变更记录"][key]}</Descriptions.Item></Descriptions>
|
||||
})}
|
||||
{this.state.data["风险评分"] && this.state.data["风险评分"]["关联风险"] && this.state.data["风险评分"]["关联风险"]["周边风险"] && Object.keys(this.state.data["风险评分"]["关联风险"]["周边风险"]).map((key, i) => {
|
||||
return <Descriptions column={4} title="关联风险 - 周边风险"><Descriptions.Item label={key} key={i}>{this.state.data["风险评分"]["关联风险"]["周边风险"][key]}</Descriptions.Item></Descriptions>
|
||||
})}
|
||||
<Descriptions column={4} title="关联风险 - 合计">
|
||||
<Descriptions.Item label="合计">{this.state.data["风险评分"] && this.state.data["风险评分"]["关联风险"]["合计"]}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Divider />
|
||||
<Descriptions column={4} title="风险合计">
|
||||
<Descriptions.Item label="合计">{this.state.data["风险评分"] && this.state.data["风险评分"]["合计"]}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { Component } from 'react'
|
||||
import api from "@/api/request"
|
||||
import { Descriptions,Tag } from 'antd'
|
||||
import { Descriptions, Tag } from 'antd'
|
||||
|
||||
class RiskData extends Component {
|
||||
constructor(props) {
|
||||
|
@ -14,7 +14,7 @@ class RiskData extends Component {
|
|||
api.post("/admin/rating/risk", { rid: this.props.id })
|
||||
.then(res => {
|
||||
this.setState({
|
||||
data: res.result.length!==0?res.result[0]:[]
|
||||
data: res.result.length !== 0 ? res.result[0] : []
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
|
@ -22,33 +22,28 @@ class RiskData extends Component {
|
|||
}
|
||||
|
||||
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 <React.Fragment><Tag color="#108ee9">{key}</Tag><Descriptions bordered>
|
||||
{Object.keys(val[key]).map((item, i) => {
|
||||
return <Descriptions.Item label={item} key={i} >{val[key][item]}</Descriptions.Item>
|
||||
return Object.keys(val).map(key => {
|
||||
if (typeof val[key] === "object") {
|
||||
if (['合规风险', '经营风险'].includes(key)) {
|
||||
return <React.Fragment><Tag color="#108ee9" style={{ marginBottom: 20 }}>{key}</Tag><Descriptions column={4}>
|
||||
{Object.keys(val[key]).map((item, i) => {
|
||||
return <Descriptions.Item label={item} key={i} >{val[key][item]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
</React.Fragment>
|
||||
} else {
|
||||
return Object.keys(val[key]).map((item, i) => {
|
||||
return <React.Fragment><Tag color="#108ee9" style={{ marginBottom: 20 }}>{item}</Tag><Descriptions column={4}>
|
||||
{Object.keys(val[key][item]).map((ele, j) => {
|
||||
return <Descriptions.Item label={ele} key={j}>{val[key][item][ele]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions>
|
||||
</React.Fragment>
|
||||
} else {
|
||||
return Object.keys(val[key]).map((item, i) => {
|
||||
return <React.Fragment><Tag color="#108ee9">{item}</Tag><Descriptions bordered>
|
||||
{Object.keys(val[key][item]).map((ele, j) => {
|
||||
return <Descriptions.Item label={ele} key={j}>{val[key][item][ele]}</Descriptions.Item>
|
||||
})}
|
||||
</Descriptions></React.Fragment>
|
||||
})
|
||||
}
|
||||
}else{
|
||||
return null
|
||||
</Descriptions></React.Fragment>
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
@ -43,7 +43,6 @@ class Main extends Component {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onChange = activeKey => {
|
||||
|
@ -111,13 +110,13 @@ class Main extends Component {
|
|||
case "/manage/industry":
|
||||
return <ManageIndustry />
|
||||
case "/manage/industry/analysis":
|
||||
return <AnalysisDetails value={name}/>
|
||||
return <AnalysisDetails value={name} />
|
||||
case "/test/company":
|
||||
return <TestCompany />
|
||||
case "/setting/user":
|
||||
return <UserSet />
|
||||
default:
|
||||
return <EmptyContent/>
|
||||
return <EmptyContent />
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,10 +18,22 @@ class Side extends Component {
|
|||
{ title: '服务管理', path: '/service', icon: <GlobalOutlined />, category: 'Test' },
|
||||
{ title: '用户', path: '/setting/user', icon: <UserOutlined />, category: 'Setting' },
|
||||
{ title: '设置', path: '/service', icon: <SettingOutlined />, category: 'Setting' },
|
||||
]
|
||||
],
|
||||
currentKey: '0'
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate(preProps, preState) {
|
||||
console.log(preProps, preState)
|
||||
if (preProps.activeKey !== preState.currentKey) {
|
||||
// const title = preProps.panes.filter(item => {
|
||||
// return item.key === preProps.activeKey ? item.title : null
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
handleClick = e => {
|
||||
this.props.parent.getMenuItem({
|
||||
title: this.state.data[e.key].title,
|
||||
|
@ -30,7 +42,7 @@ class Side extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const menus = localStorage.getItem("menus").split(',') || ['Board', 'Manage','Model','Test','Setting']
|
||||
const menus = localStorage.getItem("menus").split(',') || ['Board', 'Manage', 'Model', 'Test', 'Setting']
|
||||
const menuItem = menus.map((item, i) => {
|
||||
return <Menu.ItemGroup title={item} key={i}>
|
||||
{this.state.data.map((ele, index) => {
|
||||
|
@ -43,6 +55,7 @@ class Side extends Component {
|
|||
<Menu
|
||||
mode="inline"
|
||||
defaultSelectedKeys={['0']}
|
||||
selectedKeys={this.state.currentKey}
|
||||
style={{ height: '100%', borderRight: 0, position: 'fixed', width: '220px' }}
|
||||
theme="dark"
|
||||
className='menu'
|
||||
|
|
Loading…
Reference in New Issue