TODO: continue
This commit is contained in:
parent
23171e6cbf
commit
4eb8a353a6
|
@ -30,9 +30,8 @@ class App extends React.Component {
|
|||
};
|
||||
|
||||
changePlatform = (p) => {
|
||||
this.setState({platform: p}, () => {
|
||||
this.refs.ctabs.changePlatform(this.state.platform);
|
||||
})
|
||||
this.setState({platform: p})
|
||||
this.refs.ctabs.changePlatform(p)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -100,17 +100,20 @@ class ChartsCount extends React.Component {
|
|||
|
||||
updateData = (params = {}) => {
|
||||
|
||||
const {platform, countkey, title} = params
|
||||
// const {platform, countkey, title} = params
|
||||
const platform = params.platform?params.platform:this.state.platform
|
||||
const countkey = params.countkey?params.countkey:this.state.countkey
|
||||
const title = params.title?params.title:this.state.title
|
||||
|
||||
fetch(`${apihost}/tag/count?platform=${platform?platform:this.state.platform}&countkey=${countkey?countkey:this.state.countkey}`, {
|
||||
fetch(`${apihost}/tag/count?platform=${platform}&countkey=${countkey}`, {
|
||||
"mode": "cors"
|
||||
}).then(
|
||||
response => {
|
||||
response.json().then(value => {
|
||||
this.setState({
|
||||
title: title?title:this.state.title,
|
||||
platform: platform?platform:this.state.platform,
|
||||
countkey: countkey?countkey:this.state.countkey,
|
||||
title: title ,
|
||||
platform: platform ,
|
||||
countkey: countkey ,
|
||||
data: parseData(value)
|
||||
}, () => {
|
||||
var ins = this.echarts_react.getEchartsInstance();
|
||||
|
|
|
@ -13,7 +13,6 @@ class ContentTabs extends React.Component {
|
|||
this.state = {
|
||||
platform: this.props.platform,
|
||||
tab: this.props.tab,
|
||||
count: 1,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,30 +23,33 @@ class ContentTabs extends React.Component {
|
|||
}
|
||||
|
||||
changeTab = (tab) => {
|
||||
this.setState({tab: tab}, ()=>{ this.updateDate() })
|
||||
this.updateDate({tab: tab})
|
||||
}
|
||||
|
||||
updateDate() {
|
||||
updateDate(params = {}) {
|
||||
|
||||
switch(this.state.tab) {
|
||||
const platform = params.platform?params.platform:this.state.platform
|
||||
const tab = params.tab?params.tab:this.state.tab
|
||||
this.setState({platform: platform, tab:tab});
|
||||
|
||||
switch(tab) {
|
||||
case "tabledata":
|
||||
if (this.refs.tabledata) {
|
||||
this.refs.tabledata.changePlatform(this.state.platform);
|
||||
this.refs.tabledata.changePlatform(platform);
|
||||
}
|
||||
break;
|
||||
|
||||
case "chartscount":
|
||||
if (this.refs.chartscount) {
|
||||
this.refs.chartscount.changePlatform(this.state.platform);
|
||||
this.refs.chartscount.changePlatform(platform);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
changePlatform = (platform) => {
|
||||
this.setState({platform: platform}, ()=>{ this.updateDate()})
|
||||
this.updateDate({platform: platform})
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user