mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
Merge pull request #256 from catchonme/master
修复crud同步地址栏数据格式不一致导致initFetch失效
This commit is contained in:
commit
db4b77f46a
@ -168,7 +168,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
|
||||
if (syncLocation && location && (location.query || location.search)) {
|
||||
store.updateQuery(
|
||||
location.query || qs.parse(location.search.substring(1)),
|
||||
qs.parse(location.search.substring(1)),
|
||||
undefined,
|
||||
pageField,
|
||||
perPageField
|
||||
@ -218,7 +218,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
if (props.syncLocation && props.location && props.location.search !== nextProps.location.search) {
|
||||
// 同步地址栏,那么直接检测 query 是否变了,变了就重新拉数据
|
||||
store.updateQuery(
|
||||
nextProps.location.query || qs.parse(nextProps.location.search.substring(1)),
|
||||
qs.parse(nextProps.location.search.substring(1)),
|
||||
undefined,
|
||||
nextProps.pageField,
|
||||
nextProps.perPageField
|
||||
@ -413,6 +413,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
search: boolean = true
|
||||
) {
|
||||
const {store, syncLocation, env, pageField, perPageField} = this.props;
|
||||
values = syncLocation ? qs.parse(qs.stringify(values)) : values;
|
||||
|
||||
store.updateQuery(
|
||||
{
|
||||
|
@ -1322,7 +1322,7 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
<div className={cx('Table-header', headerClassName)} key="header">
|
||||
{render('header', header, {
|
||||
...(editable === false ? otherProps : null),
|
||||
ata: store.getData(data)
|
||||
data: store.getData(data)
|
||||
})}
|
||||
</div>
|
||||
) : null;
|
||||
|
@ -91,7 +91,7 @@ export const CRUDStore = ServiceStore.named('CRUDStore')
|
||||
|
||||
updater &&
|
||||
isObjectShallowModified(originQuery, self.query, false) &&
|
||||
setTimeout(() => updater(`?${qs.stringify(self.query)}`), 4);
|
||||
setTimeout(() => updater(`?${qs.stringify(self.query, { encodeValuesOnly: true })}`), 4);
|
||||
}
|
||||
|
||||
const fetchInitData: (
|
||||
|
@ -263,7 +263,7 @@ export const TableStore = iRendererStore
|
||||
return createObject(superData, {
|
||||
items: self.rows.map(item => item.data),
|
||||
selectedItems: self.selectedRows.map(item => item.data),
|
||||
unSeelctedItems: getUnSelectedRows().map(item => item.data)
|
||||
unSelectedItems: getUnSelectedRows().map(item => item.data)
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user