mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 优化列表点选功能,点选可以不用刷新整行
This commit is contained in:
parent
118b89d80c
commit
28680c8f5f
@ -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
|
||||
? {
|
||||
|
@ -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;
|
||||
|
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user