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