Skip to content

Commit

Permalink
fix: 修复问题
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Sep 1, 2024
1 parent 0bd9a86 commit 4c8f395
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/editor/src/packages/Scene/MarsTable/MarsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { handleActionFlow } from '@/packages/utils/action';
import * as util from '@/packages/utils/util';
import { usePageStore } from '@/stores/pageStore';
import { ComponentType, IDragTargetItem } from '@/packages/types';
import { get } from 'lodash-es';
import styles from './index.module.less';

export interface IConfig {
Expand Down Expand Up @@ -86,7 +87,7 @@ const MarsTable = ({ id, type, config, elements, onCheckedChange }: ComponentTyp
}
// 解析总条数
if (config.props.field.total) {
setTotal(res.originData[config.props.field.total] || 0);
setTotal(get(res.originData, config.props.field.total) || 0);
}
}
})
Expand Down
3 changes: 2 additions & 1 deletion packages/materials/Scene/MarsTable/MarsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as util from '../../utils/util';
import { usePageStore } from '../../stores/pageStore';
import { ComponentType } from '../../types';
import AuthButton from '../../Functional/Button/AuthButton';
import { get } from 'lodash-es';
import styles from './index.module.less';

export interface IConfig {
Expand Down Expand Up @@ -79,7 +80,7 @@ const MarsTable = ({ config, elements, onCheckedChange }: ComponentType<IConfig>
setData(res.data);
}
if (config.props.field.total) {
setTotal(res.originData[config.props.field.total] || 0);
setTotal(get(res.originData, config.props.field.total) || 0);
}
}
})
Expand Down

0 comments on commit 4c8f395

Please sign in to comment.