mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 19:17:54 +08:00
crud嵌套模式修复子数据修改后,子数据加入修改数据中
This commit is contained in:
parent
6627f2b016
commit
61fa4afbda
@ -105,6 +105,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
> a {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
> a:first-child,
|
||||
> a:first-child:hover,
|
||||
|
@ -3,7 +3,7 @@ import {iRendererStore} from './iRenderer';
|
||||
import {resolveVariable} from '../utils/tpl-builtin';
|
||||
import isEqual = require('lodash/isEqual');
|
||||
import find = require('lodash/find');
|
||||
import {isBreakpoint, createObject, isObject, isVisible, guid, findTree, flattenTree, eachTree} from '../utils/helper';
|
||||
import {isBreakpoint, createObject, isObject, isVisible, guid, findTree, flattenTree, eachTree, difference} from '../utils/helper';
|
||||
import {evalExpression} from '../utils/tpl';
|
||||
|
||||
export const Column = types
|
||||
@ -235,8 +235,19 @@ export const TableStore = iRendererStore
|
||||
return getToggableColumns().filter(item => item.toggled);
|
||||
}
|
||||
|
||||
function getModifiedRows() {
|
||||
return self.rows.filter(item => item.modified);
|
||||
function getModifiedRows(rows:IRow[] = [], modifiedRows:IRow[] = []) {
|
||||
rows = rows && rows.length ? rows : self.rows;
|
||||
rows.forEach((item:IRow) => {
|
||||
if (item.children && item.children.length) {
|
||||
getModifiedRows(item.children, modifiedRows);
|
||||
}
|
||||
let diff = difference(item.data, item.pristine);
|
||||
let hasDifference = Object.keys(diff).length;
|
||||
if (hasDifference) {
|
||||
modifiedRows.push(item);
|
||||
}
|
||||
});
|
||||
return modifiedRows;
|
||||
}
|
||||
|
||||
function getModified() {
|
||||
|
Loading…
Reference in New Issue
Block a user