mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
parent
5f71cbba9e
commit
4dec008c86
@ -39,9 +39,14 @@ export const Item = types
|
||||
},
|
||||
|
||||
get locals(): any {
|
||||
const listStore = getParent(self, 2) as IListStore;
|
||||
return createObject(
|
||||
extendObject((getParent(self, 2) as IListStore).data, {
|
||||
index: self.index
|
||||
extendObject(listStore.data, {
|
||||
index: self.index,
|
||||
|
||||
// 只有table时,也可以获取选中行
|
||||
selectedItems: listStore.selectedItems.map(item => item.data),
|
||||
unSelectedItems: listStore.unSelectedItems.map(item => item.data)
|
||||
}),
|
||||
self.data
|
||||
);
|
||||
|
@ -174,12 +174,17 @@ export const Row = types
|
||||
children = self.children.map(item => item.locals);
|
||||
}
|
||||
|
||||
const table = getParent(self, self.depth * 2) as ITableStore;
|
||||
const parent = getParent(self, 2) as ITableStore;
|
||||
return createObject(
|
||||
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)
|
||||
}),
|
||||
children
|
||||
? {
|
||||
|
@ -2277,13 +2277,7 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
// 操作列不下发loading,否则会导致操作栏里面的所有按钮都出现loading
|
||||
loading: column.type === 'operation' ? false : props.loading,
|
||||
btnDisabled: store.dragging,
|
||||
data: this.props.selectable
|
||||
? extendObject(item.locals, {
|
||||
// 只有table时,也可以获取选中行
|
||||
selectedItems: store.selectedRows.map(item => item.data),
|
||||
unSelectedItems: store.unSelectedRows.map(item => item.data)
|
||||
})
|
||||
: item.locals,
|
||||
data: item.locals,
|
||||
value: column.name
|
||||
? resolveVariable(
|
||||
column.name,
|
||||
|
Loading…
Reference in New Issue
Block a user