提交 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,6 +138,15 @@ export default class AffairPage extends React.Component { ...@@ -138,6 +138,15 @@ export default class AffairPage extends React.Component {
return false; return false;
} }
const { pathname } = this.state; const { pathname } = this.state;
const { dataBaseId, workId } = this.props;
if(dataBaseId || workId){
this.setState({
workId,
dataBaseId,
},()=>{
this.getColumns();
});
}else{
service.getId(pathname).then((x)=>{ service.getId(pathname).then((x)=>{
this.setState({ this.setState({
workId: x.workId, workId: x.workId,
...@@ -146,6 +155,8 @@ export default class AffairPage extends React.Component { ...@@ -146,6 +155,8 @@ export default class AffairPage extends React.Component {
this.getColumns(); 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,6 +95,10 @@ export default class Index extends React.Component { ...@@ -94,6 +95,10 @@ export default class Index extends React.Component {
componentDidMount() { componentDidMount() {
const { pathname } = this.state; const { pathname } = this.state;
const { workId } = this.state;
if(workId){
this.getColumn();
}else{
service.getId(pathname).then((x)=>{ service.getId(pathname).then((x)=>{
this.setState({ this.setState({
workId: x.workId, workId: x.workId,
...@@ -104,6 +109,8 @@ export default class Index extends React.Component { ...@@ -104,6 +109,8 @@ export default class Index extends React.Component {
}); });
} }
}
render() { render() {
const { workId, dataBaseId, columns, searchCondition, addFields, allConfigSetInfo, tableInfo } = this.state; const { workId, dataBaseId, columns, searchCondition, addFields, allConfigSetInfo, tableInfo } = this.state;
return ( return (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论