mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
fix: crud编辑器提示导致报错问题修复 (#8806)
Co-authored-by: wanglinfang <wanglinfang@baidu.com>
This commit is contained in:
parent
81060bfda7
commit
4fd601a34e
File diff suppressed because it is too large
Load Diff
@ -704,10 +704,13 @@ export const CRUDStore = ServiceStore.named('CRUDStore')
|
||||
|
||||
const data = {
|
||||
...self.pristine,
|
||||
items: items.slice(
|
||||
(self.page - 1) * self.perPage,
|
||||
self.page * self.perPage
|
||||
),
|
||||
items:
|
||||
items.length > self.perPage
|
||||
? items.slice(
|
||||
(self.page - 1) * self.perPage,
|
||||
self.page * self.perPage
|
||||
)
|
||||
: items,
|
||||
count: items.length,
|
||||
total: items.length
|
||||
};
|
||||
|
@ -686,7 +686,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
} else if (!props.api && isPureVariable(props.source)) {
|
||||
const next = resolveVariableAndFilter(props.source, props.data, '| raw');
|
||||
|
||||
if (!this.lastData || !isEqual(this.lastData, next)) {
|
||||
if (!this.lastData || this.lastData !== next) {
|
||||
store.initFromScope(props.data, props.source, {
|
||||
columns: store.columns ?? props.columns
|
||||
});
|
||||
|
@ -21,7 +21,6 @@ import {findDOMNode} from 'react-dom';
|
||||
import {evalExpression, filter} from 'amis-core';
|
||||
import {isEffectiveApi, isApiOutdated} from 'amis-core';
|
||||
import findIndex from 'lodash/findIndex';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import {Html, SpinnerExtraProps} from 'amis-ui';
|
||||
import {
|
||||
BaseSchema,
|
||||
@ -395,7 +394,7 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
|
||||
} else if (!props.api && isPureVariable(props.source)) {
|
||||
const next = resolveVariableAndFilter(props.source, props.data, '| raw');
|
||||
|
||||
if (!this.lastData || !isEqual(this.lastData, next)) {
|
||||
if (!this.lastData || this.lastData !== next) {
|
||||
store.initFromScope(props.data, props.source, {
|
||||
columns: store.columns ?? props.columns
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user