feat: updateComboTree in first stage.

This commit is contained in:
Yanyan-Wang 2020-04-08 17:51:43 +08:00 committed by Yanyan Wang
parent a079ebaad3
commit f0f97d4c00

View File

@ -1241,6 +1241,19 @@ export default class Graph extends EventEmitter implements IGraph {
self.sortCombos(self.get('data'));
}
/**
*
* @param {String | Item} item Combo id
* @param {string | undefined} parentId combo idundefined combo
*/
public updateComboTree(item: String | INode | ICombo, parentId: String | undefined) {
const self = this;
if (isString(item)) {
item = self.findById(item) as INode | ICombo;
}
self.removeItem(item as INode | ICombo);
}
/**
*
* @param {GraphData} data
@ -1874,6 +1887,10 @@ export default class Graph extends EventEmitter implements IGraph {
}
}
/**
* comboTree Combo Combo
* @param {GraphData} data
*/
private sortCombos(data: GraphData) {
const depthMap = [];
const dataDepthMap = {};