mode
This commit is contained in:
parent
fcf8dea72f
commit
23b82eb8c8
|
@ -41,7 +41,7 @@ class Dashboard extends Component {
|
|||
api.get("/admin/board/get_dashboard_data").then(res => {
|
||||
this.setState({
|
||||
data: res.result
|
||||
},()=>{
|
||||
}, () => {
|
||||
this.initChart()
|
||||
this.initPie()
|
||||
})
|
||||
|
@ -60,7 +60,7 @@ class Dashboard extends Component {
|
|||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: this.state.data['服务次数']&&this.state.data['服务次数']['日期'],
|
||||
data: this.state.data['服务次数'] && this.state.data['服务次数']['日期'],
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
|
@ -82,7 +82,7 @@ class Dashboard extends Component {
|
|||
},
|
||||
series: [
|
||||
{
|
||||
data: this.state.data['服务次数']&&this.state.data['服务次数']['次数'],
|
||||
data: this.state.data['服务次数'] && this.state.data['服务次数']['次数'],
|
||||
type: 'line',
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
|
@ -108,9 +108,9 @@ class Dashboard extends Component {
|
|||
|
||||
initPie() {
|
||||
const data = []
|
||||
this.state.data['行业分布'].forEach(item=>{
|
||||
Object.keys(item).forEach(key=>{
|
||||
data.push({name:key,value:item[key]})
|
||||
this.state.data['行业分布'].forEach(item => {
|
||||
Object.keys(item).forEach(key => {
|
||||
data.push({ name: key, value: item[key] })
|
||||
})
|
||||
})
|
||||
const myChart = echarts.init(document.getElementById('pie'))
|
||||
|
@ -150,8 +150,15 @@ class Dashboard extends Component {
|
|||
callback(e, value) {
|
||||
if (e === "详 情") {
|
||||
const newPanes = [...this.props.panes]
|
||||
newPanes.push({ title: value["企业名称"] + '(' + value["企业ID"] + ')', content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key)))
|
||||
const state = newPanes.every(item => {
|
||||
return item.title === value["企业名称"] + '(' + value["企业ID"] + ')' ? false : true
|
||||
})
|
||||
if (state) {
|
||||
newPanes.push({ title: value["企业名称"] + '(' + value["企业ID"] + ')', content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key)))
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,8 +197,8 @@ class Dashboard extends Component {
|
|||
<Card title='行业分布'>
|
||||
<div id='pie' style={{ width: '100%', height: '300px' }}></div>
|
||||
{
|
||||
this.state.data['行业分布']&&this.state.data['行业分布'].map(item=>{
|
||||
return Object.keys(item).map(key=>{
|
||||
this.state.data['行业分布'] && this.state.data['行业分布'].map(item => {
|
||||
return Object.keys(item).map(key => {
|
||||
return <p className='space-word'><span>{key}</span><span>{item[key]}</span></p>
|
||||
})
|
||||
})
|
||||
|
@ -200,7 +207,7 @@ class Dashboard extends Component {
|
|||
</Col>
|
||||
<Col span={16}>
|
||||
<Card title="新增企业信息">
|
||||
<FeTable data={this.state.data['新增企业信息']} columns={this.state.columns} callback={this.callback.bind(this)}></FeTable>
|
||||
<FeTable data={this.state.data['新增企业信息']} columns={this.state.columns} callback={this.callback.bind(this)}></FeTable>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
@ -41,10 +41,15 @@ class ManageCompany extends Component {
|
|||
}
|
||||
|
||||
callback(e, value) {
|
||||
if (e === "详 情") {
|
||||
const newPanes = [...this.props.panes]
|
||||
const newPanes = [...this.props.panes]
|
||||
const state = newPanes.every(item => {
|
||||
return item.title === value["企业名称"] + '(' + value["企业ID"] + ')' ? false : true
|
||||
})
|
||||
if (state) {
|
||||
newPanes.push({ title: value["企业名称"] + '(' + value["企业ID"] + ')', content: "/manager/company/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key)))
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class ManageRate extends Component {
|
|||
data: [],
|
||||
columns: [],
|
||||
file: "",
|
||||
visible:false
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,16 +69,23 @@ class ManageRate extends Component {
|
|||
if (!this.isJump) {
|
||||
if (e === "详 情") {
|
||||
const newPanes = [...this.props.panes]
|
||||
newPanes.push({ title: value["评价项目"] + '(' + value["评价ID"] + ')', content: "/manage/rate/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, newPanes[newPanes.length - 1].key))
|
||||
const state = newPanes.every(item => {
|
||||
return item.title === value["评价项目"] + '(' + value["评价ID"] + ')' ? false : true
|
||||
})
|
||||
if (state) {
|
||||
newPanes.push({ title: value["评价项目"] + '(' + value["评价ID"] + ')', content: "/manage/rate/details", key: (Number(newPanes[newPanes.length - 1].key) + 1).toString() });
|
||||
store.dispatch(operationAction(newPanes, (newPanes[newPanes.length - 1].key)))
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isJump = false
|
||||
}
|
||||
|
||||
setVisible(value){
|
||||
setVisible(value) {
|
||||
this.setState({
|
||||
visible:value
|
||||
visible: value
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue