detectField 可以配置成 & 能用更多的属性判断
This commit is contained in:
parent
91b8fe8633
commit
a10a3e3b28
|
@ -234,7 +234,7 @@ export function renderChild(prefix:string, node:SchemaNode, props:renderChildPro
|
|||
|
||||
const typeofnode = typeof node;
|
||||
let schema:Schema = typeofnode === 'string' || typeofnode === 'number' ? {type: 'tpl', tpl: String(node)} : node as Schema;
|
||||
const detectData = props[schema.detectField || 'data'];
|
||||
const detectData = schema.detectField === '&' ? props : props[schema.detectField || 'data'];
|
||||
const exprProps = detectData ? getExprProperties(schema, detectData) : null;
|
||||
|
||||
if (
|
||||
|
@ -353,7 +353,7 @@ const defaultOmitList = [
|
|||
'type', 'name', '$ref', 'className', 'data', 'children',
|
||||
'ref', 'visible', 'visibleOn', 'hidden',
|
||||
'hiddenOn', 'disabled', 'disabledOn',
|
||||
'children'
|
||||
'children', 'detectField'
|
||||
];
|
||||
|
||||
class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||
|
|
|
@ -1519,7 +1519,7 @@ class TableRow extends React.Component<TableRowProps> {
|
|||
...rest,
|
||||
width: null,
|
||||
rowIndex: itemIndex,
|
||||
colIndex: column.index,
|
||||
colIndex: column.rawIndex,
|
||||
key: column.index,
|
||||
onAction: this.handleAction,
|
||||
onQuickChange: this.handleQuickChange,
|
||||
|
@ -1554,7 +1554,7 @@ class TableRow extends React.Component<TableRowProps> {
|
|||
renderCell(`${itemIndex}/${column.index}`, column, item, {
|
||||
...rest,
|
||||
rowIndex: itemIndex,
|
||||
colIndex: column.index,
|
||||
colIndex: column.rawIndex,
|
||||
key: column.index,
|
||||
onAction: this.handleAction,
|
||||
onQuickChange: this.handleQuickChange,
|
||||
|
|
|
@ -29,6 +29,7 @@ export const Column = types
|
|||
filterable: types.optional(types.frozen(), undefined),
|
||||
fixed: '',
|
||||
index: 0,
|
||||
rawIndex: 0,
|
||||
breakpoint: types.optional(types.frozen(), undefined),
|
||||
pristine: types.optional(types.frozen(), undefined),
|
||||
remark: types.optional(types.frozen(), undefined),
|
||||
|
@ -430,6 +431,7 @@ export const TableStore = iRendererStore
|
|||
columns = columns.map((item, index) => ({
|
||||
...item,
|
||||
index,
|
||||
rawIndex: index -3,
|
||||
type: item.type || 'plain',
|
||||
pristine: item,
|
||||
toggled: item.toggled !== false,
|
||||
|
|
Loading…
Reference in New Issue