diff --git a/packages/amis-core/src/store/table.ts b/packages/amis-core/src/store/table.ts index af99148db..626d1e634 100644 --- a/packages/amis-core/src/store/table.ts +++ b/packages/amis-core/src/store/table.ts @@ -206,11 +206,12 @@ export const Row = types extendObject((getParent(self, self.depth * 2) as ITableStore).data, { index: self.index, // todo 以后再支持多层,目前先一层 - parent: parent.storeType === Row.name ? parent.data : undefined, + parent: parent.storeType === Row.name ? parent.data : undefined // 只有table时,也可以获取选中行 - selectedItems: table.selectedRows.map(item => item.data), - unSelectedItems: table.unSelectedRows.map(item => item.data) + // 行数据中不应该包含选中行,因为选中行是跨行的,不应该影响到行数据 + // selectedItems: table.selectedRows.map(item => item.data), + // unSelectedItems: table.unSelectedRows.map(item => item.data) }), children ? { diff --git a/packages/amis/src/renderers/Table/Cell.tsx b/packages/amis/src/renderers/Table/Cell.tsx index 38ffc8321..bcae629e2 100644 --- a/packages/amis/src/renderers/Table/Cell.tsx +++ b/packages/amis/src/renderers/Table/Cell.tsx @@ -10,6 +10,7 @@ import { evalTrackExpression } from 'amis-core'; import {BadgeObject, Checkbox, Icon} from 'amis-ui'; +import {observer} from 'mobx-react'; import React from 'react'; export interface CellProps extends ThemeProps { @@ -34,7 +35,7 @@ export interface CellProps extends ThemeProps { onImageEnlarge?: any; } -export default function Cell({ +export function Cell({ region, column, item, @@ -234,3 +235,5 @@ export default function Cell({ subProps ); } + +export default Cell; diff --git a/packages/amis/src/renderers/Table/ColGroup.tsx b/packages/amis/src/renderers/Table/ColGroup.tsx index 86b480f8a..de98d6c8f 100644 --- a/packages/amis/src/renderers/Table/ColGroup.tsx +++ b/packages/amis/src/renderers/Table/ColGroup.tsx @@ -74,7 +74,7 @@ export function ColGroup({ th.style.cssText = style; }); } - }, columns.map(column => column.width).concat(store.columnWidthReady as any)); + }, [columns.map(column => column.width).join(','), store.columnWidthReady]); } return (