0

如果把dispatch注释掉,每次点击都会打印一次,如果dispatch正常请求,会无限请求接口,不知哪里出问题了,页面其它dispatch请求都是正常的

图片描述

//model.js

effects: {
    *fetchOverviewDetails({ payload,callback }, { call, put }) {
      const response = yield call(queryOverviewDetails,payload);
      callback(response);
    },
  },

//index.js
expandedRowRender = (record, index, indent, expanded) => {
    console.log(record,expanded)
    if (expanded) {
      const { dispatch } = this.props;
      dispatch({
        type: 'submissionCentre/fetchOverviewDetails',
        payload: {
          trusteeid:record.Trusteeid,
        },
        callback: (res) => {
          console.log(res,'===')//res&&res.Info&&res.Info.length?res.Info:[]

        }
      });
    }
    return <Table rowKey={(record, index) => index} columns={columns} dataSource={[]} pagination={false} />;
  };
render() {
    return (
        <Table
            className="components-table-demo-nested"
            columns={columns}
            expandedRowRender={this.expandedRowRender}
            dataSource={treeNodeList}
            expandRowByClick={true}
        />
    )
}
http_404 200
2019-08-01 提问
1 个回答
0

已采纳

已经用别的方法实现了

撰写答案

推广链接