mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: input-table未下发static、删除逻辑优化
This commit is contained in:
parent
9e724f467f
commit
0197c28f17
@ -350,6 +350,7 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
// Form会向FormItem下发disabled属性,disbaled 属性值也需要同步到
|
||||
if (
|
||||
prevProps.disabled !== props.disabled ||
|
||||
prevProps.static !== props.static ||
|
||||
props.$schema.disabled !== prevProps.$schema.disabled ||
|
||||
props.$schema.static !== prevProps.$schema.static
|
||||
) {
|
||||
@ -1028,18 +1029,25 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
newValue = spliceTree(newValue, indexes, 1);
|
||||
this.reUseRowId(newValue, originItems, indexes);
|
||||
|
||||
// change value
|
||||
const prevented = await this.emitValue(newValue);
|
||||
if (prevented) {
|
||||
return;
|
||||
}
|
||||
this.setState(
|
||||
{
|
||||
items: newValue
|
||||
},
|
||||
async () => {
|
||||
// change value
|
||||
const prevented = await this.emitValue(newValue);
|
||||
if (prevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.dispatchEvent('deleteSuccess', {
|
||||
value: newValue,
|
||||
index: indexes[indexes.length - 1],
|
||||
indexPath: indexes.join('.'),
|
||||
item
|
||||
});
|
||||
this.dispatchEvent('deleteSuccess', {
|
||||
value: newValue,
|
||||
index: indexes[indexes.length - 1],
|
||||
indexPath: indexes.join('.'),
|
||||
item
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
rowPathPlusOffset(path: string, offset = 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user