|
@@ -355,18 +355,25 @@ $(document).ready(function() {
|
|
|
});
|
|
|
}
|
|
|
getMultiUpdateData() {
|
|
|
- const data = [];
|
|
|
+ const data = [], self = this;
|
|
|
for (const [i, node] of this.checkTree.nodes.entries()) {
|
|
|
node.source_filing_type = i + 1;
|
|
|
- let filing_type = node.source_filing_type;
|
|
|
- if (!node.is_fixed) {
|
|
|
- const parents = this.checkTree.getAllParents(node);
|
|
|
- const fixedParent = _.findLast(parents, function(x) { return x.is_fixed; });
|
|
|
- if (!fixedParent) throw `【${node.name}】查询不到固定信息`;
|
|
|
- filing_type = fixedParent.source_filing_type;
|
|
|
- }
|
|
|
- data.push({ id: node.id, is_fixed: node.is_fixed, filing_type });
|
|
|
}
|
|
|
+ const getUpdateData = function(children) {
|
|
|
+ for (const [i, node] of children.entries()) {
|
|
|
+ let filing_type = node.source_filing_type;
|
|
|
+ if (!node.is_fixed) {
|
|
|
+ const parents = self.checkTree.getAllParents(node);
|
|
|
+ parents.sort((a, b) => { return b.tree_level - a.tree_level});
|
|
|
+ const fixedParent = parents.find(function(x) { return x.is_fixed; });
|
|
|
+ if (!fixedParent) throw `【${node.name}】查询不到固定信息`;
|
|
|
+ filing_type = fixedParent.source_filing_type;
|
|
|
+ }
|
|
|
+ data.push({ id: node.id, is_fixed: node.is_fixed, filing_type, tree_order: i + 1 });
|
|
|
+ if (node.children) getUpdateData(node.children);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ getUpdateData(this.checkTree.children);
|
|
|
return {updateType: 'multi', data};
|
|
|
}
|
|
|
_convertData(sourceTree) {
|