Ben Lin
2024-06-20 de7e6c408b6209158b08991d729c4bcc72055eec
src/api/tigerapi/system.ts
@@ -280,9 +280,9 @@
  return result;
}
export function convertToTree(data: [], parentId: string, id: string, pid?: string) {
  const result: any[] = [];
  let temp: any[] = [];
export function convertToTree<T>(data: T[], parentId: string, id: string, pid?: string) {
  const result: T[] = [];
  let temp: T[] = [];
  const _pid = isNullOrEmpty(pid) ? '' : pid;
  for (let i = 0; i < data.length; i++) {
    const currPid = data[i][parentId] == null ? '' : data[i][parentId];