chore: 优化列表点选功能,点选可以不用刷新整行

This commit is contained in:
2betop 2023-12-08 11:07:34 +08:00
parent 118b89d80c
commit 28680c8f5f
3 changed files with 9 additions and 5 deletions

View File

@ -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
? {

View File

@ -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;

View File

@ -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 (