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

贵阳一站式bug修改 token打通

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