From aaed196e4c34033e77775dad41ad04965ff1a4c0 Mon Sep 17 00:00:00 2001
From: timorls <318739742@qq.com>
Date: Tue, 29 Mar 2022 16:23:19 +0800
Subject: [PATCH] mode
---
src/pages/home/branch/dashboard/dashboard.js | 67 +++++++++----
.../branch/manage/rate/branch/fillDetails.js | 10 --
src/pages/home/branch/modal/threshold.js | 98 +++++++++++++++++--
3 files changed, 137 insertions(+), 38 deletions(-)
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['认证企业']}/家 {key}{item[key]} {this.state.questionVisible.map((item, index) => {
+ return
+ {item.children.map((child, j) => {
+ return <>
+ {child.label}
+ {child.type === '单选题' ? child.option.map(e => {
+ return {e.index}.{e.label}
+ }) : child.type === '多选题' ? child.option.map((e) => {
+ return {e.index}.{e.label}
+ }) : 单位:{child.unit}
+ }
+