fix: input-table未下发static、删除逻辑优化

This commit is contained in:
hezhihang 2024-06-18 17:39:55 +08:00
parent 9e724f467f
commit 0197c28f17

View File

@ -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,6 +1029,11 @@ export default class FormTable extends React.Component<TableProps, TableState> {
newValue = spliceTree(newValue, indexes, 1);
this.reUseRowId(newValue, originItems, indexes);
this.setState(
{
items: newValue
},
async () => {
// change value
const prevented = await this.emitValue(newValue);
if (prevented) {
@ -1041,6 +1047,8 @@ export default class FormTable extends React.Component<TableProps, TableState> {
item
});
}
);
}
rowPathPlusOffset(path: string, offset = 0) {
const list = path.split('.').map((item: any) => parseInt(item, 10));