提交 616c8b3c authored 作者: 钟是志's avatar 钟是志

贵阳一站式bug修改 token打通

上级 b1ee5caf
......@@ -88,7 +88,6 @@ export default class List extends Component {
list: [],
loading: true,
});
search.getPageService({ ...data, appId: workId }).then((response) => {
this.setState({
loading: false,
......
......@@ -24,12 +24,12 @@ export default class AffairPage extends React.Component {
constructor(props) {
super(props);
let pathname = this.props.location.pathname;
const { dataBaseId, workId } = this.props;
this.state = {
showIframe: false,
columns: [],
pathname,
workId: '',
workId: workId || '',
searchCondition: [],
dataBaseId: '',
addFields: [], // 新增时填写的字段。
......@@ -138,14 +138,25 @@ export default class AffairPage extends React.Component {
return false;
}
const { pathname } = this.state;
service.getId(pathname).then((x)=>{
this.setState({
workId: x.workId,
dataBaseId: x.dataBaseId,
},()=>{
this.getColumns();
})
});
const { dataBaseId, workId } = this.props;
if(dataBaseId || workId){
this.setState({
workId,
dataBaseId,
},()=>{
this.getColumns();
});
}else{
service.getId(pathname).then((x)=>{
this.setState({
workId: x.workId,
dataBaseId: x.dataBaseId,
},()=>{
this.getColumns();
})
});
}
window.addEventListener('message', (event) => {
if (event.data === 'returnList') {
......
......@@ -15,15 +15,16 @@ import { Link } from 'dva/router';
export default class Index extends React.Component {
constructor(props) {
super(props);
let pathname = this.props.location.pathname;
this.state = {
columns: [],
dataList: [],
headerInfo: [],
workId: '',
workId: this.props.workId || '',
searchCondition: [],
pathname,
dataBaseId: '',
dataBaseId: this.props.dataBaseId || '',
addCondition: [],
addFields: [], // 新增时填写的字段。
tableInfo: {}, // 表格配置属性
......@@ -94,14 +95,20 @@ export default class Index extends React.Component {
componentDidMount() {
const { pathname } = this.state;
service.getId(pathname).then((x)=>{
this.setState({
workId: x.workId,
dataBaseId: x.dataBaseId,
},()=>{
this.getColumn();
})
});
const { workId } = this.state;
if(workId){
this.getColumn();
}else{
service.getId(pathname).then((x)=>{
this.setState({
workId: x.workId,
dataBaseId: x.dataBaseId,
},()=>{
this.getColumn();
})
});
}
}
render() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论