LANIF-UI / dva-boot-admin

:cake: react admin dashboard ui LANIF-ADMIN --- react 16 + react-router 4 + dva 2 + antd 4 后台管理 脚手架
https://lanif-ui.github.io/dva-boot-admin
MIT License
1.67k stars 460 forks source link

不能换页,能指导一下吗 #87

Closed yigerendehaotianqi closed 4 years ago

yigerendehaotianqi commented 4 years ago
` /**
         * 弹出 订单详情 的属性
         */
        const OrderDetails = {
            loading,
            rowKey: 'id',
            title:'',
            visible:visibleModel,
            columns:OrderDetailsColumns,
            dataItems:OrderDetailsPageData,
            showNum:false,
            isScroll: true,
            selectedRowKeys: rows.map(item => item.rowKey),
            modalOpts: {
                width: 1200
            },
            onCancel:()=>{
                this.setState({
                    visibleModel: false
                });
            },
            onSubmit:() => {
                let str='';
                console.log(OrderDetailsPageData)
                let OrderDetailsPageDataList= OrderDetailsPageData.list.filter
                (data => data.ApplyAfterSaleAcount!=null).filter(data=>data.ApplyAfterSaleAcount!=0).filter(data=>data.ApplyAfterSaleAcount!='').filter(data=>data.ApplyAfterSaleAcount!='undefined')

                OrderDetailsPageDataList .forEach(
                    data=>{
                        str=str+data.partId+' '+data.ApplyAfterSaleAcount+';'
                    }
                )
                if (str =='' || str ==null || str =='undefined'){
                    message.error('请选择您要申请退货的零件');
                    return false;

                }
                let orderId=OrderDetailsPageDataList[0].orderId
                dispatch({
                    type: 'Order/applyReturn',
                    payload: {
                        orderId,
                        str,
                        success: () => {
                            this.setState({
                                record: null,
                                visibleModel: false
                            });
                        }
                    }
                });
            },
            onChange: ({ pageNum, pageSize }) => {
                console.log(pageNum)
                console.log(pageSize)
                dispatch({
                    type: 'Order/getOrderDetails',
                    payload: {
                        pageData: pageData.jumpPage(pageNum, pageSize),
                        record
                    }
                });
            },
        };

我在此处引用 <ModalTable {...OrderDetails} />

这个onChange换页函数为什么不能触发呢

yigerendehaotianqi commented 4 years ago

这是一个弹出框的换页

handouer commented 4 years ago

我也遇到了,怎么回事?有人指导一下嘛?

weiq commented 4 years ago

ModalTable没有提供onChange,而是通过loadData方式加载数据的,许多小伙伴反应不好用,这个组件我最近正在重写