diff --git a/src/pages/home/branch/dashboard/dashboard.js b/src/pages/home/branch/dashboard/dashboard.js index 640ac45..8bbb7a6 100644 --- a/src/pages/home/branch/dashboard/dashboard.js +++ b/src/pages/home/branch/dashboard/dashboard.js @@ -15,17 +15,21 @@ class Dashboard extends Component { constructor(props) { super(props) this.state = { - data: [], + monitor: {}, //检测数据 + rating: {}, //评价记录 + industry: [], //行业分布 + company: [], //新增企业 columns: [ { title: '企业ID', dataIndex: '企业ID', key: 0 }, { title: '企业名称', dataIndex: '企业名称', key: 1 }, - { title: '注册时间', dataIndex: '注册时间', key: 2 }, + { title: '邮箱', dataIndex: '邮箱', key: 2 }, + { title: '注册时间', dataIndex: '注册时间', key: 3 }, { title: '详 情', dataIndex: '详 情', - key: 3, + key: 4, align: 'center', - render: () => 详 情 + render: () => 详 情 }, ] } @@ -38,14 +42,37 @@ class Dashboard extends Component { } init() { - api.get("/admin/board/get_dashboard_data").then(res => { + // 监测数据 + api.get("/admin/board/get_monitor_data").then(res => { this.setState({ - data: res.result - }, () => { + monitor: res.result + }) + }) + + // 评级记录 + api.get("/admin/board/get_rating_static").then(res => { + this.setState({ + rating: res.result + },()=>{ this.initChart() + }) + }) + + // 行业分布 + api.get("/admin/board/get_industry_distribute").then(res => { + this.setState({ + industry: res.result + },()=>{ this.initPie() }) }) + + // 新增企业 + api.get("/admin/board/get_new_companies",{page_no:1,page_size:10}).then(res => { + this.setState({ + company: res.result + }) + }) } initChart = () => { @@ -55,7 +82,7 @@ class Dashboard extends Component { show: true, trigger: "item", showContent: true, - borderColor:"#fff", + borderColor: "#fff", formatter: (params) => { return `${params.data}` } @@ -69,7 +96,7 @@ class Dashboard extends Component { xAxis: { type: 'category', boundaryGap: false, - data: this.state.data['服务次数'] && this.state.data['服务次数']['日期'], + data: this.state.rating && this.state.rating['日期'], axisLine: { show: false }, @@ -91,7 +118,7 @@ class Dashboard extends Component { }, series: [ { - data: this.state.data['服务次数'] && this.state.data['服务次数']['次数'], + data: this.state.rating && this.state.rating['次数'], type: 'line', areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ @@ -117,7 +144,7 @@ class Dashboard extends Component { initPie() { const data = [] - this.state.data['行业分布'].forEach(item => { + this.state.industry.forEach(item => { Object.keys(item).forEach(key => { data.push({ name: key, value: item[key] }) }) @@ -128,7 +155,7 @@ class Dashboard extends Component { show: true, trigger: "item", showContent: true, - borderColor:"#fff", + borderColor: "#fff", formatter: (params) => { return `${params.data.name}` } @@ -142,8 +169,8 @@ class Dashboard extends Component { height: '100%' }, color: ['#377AE4', '#F4C100', '#FF3525'], - label:{ - show:false + label: { + show: false }, series: [ { @@ -189,18 +216,18 @@ class Dashboard extends Component { -

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

+

{this.state.monitor['异常日志']}/条

-

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

+

{this.state.monitor['服务次数']}/次

-

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

+

{this.state.monitor['留言反馈']}/条

-

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

+

{this.state.monitor['认证企业']}/家

@@ -214,7 +241,7 @@ class Dashboard extends Component {
{ - this.state.data['行业分布'] && this.state.data['行业分布'].map(item => { + this.state.industry && this.state.industry.map(item => { return Object.keys(item).map((key, index) => { return

{key}{item[key]}

}) @@ -224,7 +251,7 @@ class Dashboard extends Component { - +
diff --git a/src/pages/home/branch/manage/rate/branch/fillDetails.js b/src/pages/home/branch/manage/rate/branch/fillDetails.js index 13bc896..885ed72 100644 --- a/src/pages/home/branch/manage/rate/branch/fillDetails.js +++ b/src/pages/home/branch/manage/rate/branch/fillDetails.js @@ -48,16 +48,6 @@ class FillDetails extends Component { }) } - analysisQuestion(val) { - if ("经营问卷" in this.state.data) { - return val.map((key, i) => { - return {key} - }) - } else { - return null - } - } - analysisObject(val) { if (Object.keys(val).length !== 0) { return Object.keys(val).map(key => { diff --git a/src/pages/home/branch/modal/threshold.js b/src/pages/home/branch/modal/threshold.js index dcf338f..3ae685f 100644 --- a/src/pages/home/branch/modal/threshold.js +++ b/src/pages/home/branch/modal/threshold.js @@ -1,10 +1,11 @@ import React, { Component } from 'react'; import { withRouter } from "react-router-dom"; -import { Row, Input, Button, Form, Tag, Modal, Select, Card, Col, message,Collapse } from 'antd'; +import { Row, Input, Button, Form, Tag, Modal, Select, Card, Col, message,Collapse,Space, Empty } from 'antd'; import { PlusOutlined,MinusOutlined } from '@ant-design/icons'; + import api from "@/api/request" -const { Search, TextArea } = Input +const { TextArea } = Input const { Option } = Select @@ -14,14 +15,20 @@ class Threshold extends Component { constructor(props) { super(props) this.state = { - visible: true, + visible: false, data: { 行业: "", 评价类型: "", 问卷内容: [ { label: "", children: [{ label: "", type: "", option: [{ index: "", label: "" }, { index: "", label: "" }] }] }, ] - } + }, + questionnaire: {}, + questionVisible: [ + { name: '环境', disabled: false }, + { name: '社会', disabled: true }, + { name: '治理', disabled: true } + ] } } @@ -35,8 +42,35 @@ class Threshold extends Component { }) } - onSearch = e => { + submit = e => { + const form = { + type: e['评价类型'] || '综合信用评价', + industry: e['一级行业'] + } + api.post("/admin/model/questionnaire/get_questionnaire", form) + .then(res => { + this.setState({ + questionnaire: res.data?res.data:{} + }) + }) + .catch((err)=>{ + message.warning("未检索到问卷") + this.setState({ + questionnaire:{} + }) + }) + } + onChangeDisabled = e => { + const data = [ + { name: '环境', disabled: true }, + { name: '社会', disabled: true }, + { name: '治理', disabled: true } + ] + data[e].disabled = false + this.setState({ + questionVisible: data + }) } setVisible = () => { @@ -60,6 +94,7 @@ class Threshold extends Component { } render() { + var sum = 0 return ( <> 行业 - + 评价类型 @@ -175,7 +210,21 @@ class Threshold extends Component { - +
+ + + + + + + +
+