zjj
2025-04-21 e29a9f245ff4e57a40bbab1c0acc3cbc31d3ac2b
zy-asrs-flow/src/utils/tree-util.js
@@ -1,6 +1,8 @@
export function transformTreeData(originalData) {
  return originalData.map(item => {
    let newItem = {
      key: item.id,
      title: item.name,
      value: item.id,
      // 其它需要的属性...
@@ -12,3 +14,14 @@
    return newItem;
  });
}
export function getTreeAllKeys(data) {
  let keys = [];
  for (let item of data) {
      keys.push(item.key);
      if (item.children) {
          keys = keys.concat(getTreeAllKeys(item.children));
      }
  }
  return keys;
}