Skip to content

Commit

Permalink
chore: remove arrayToTree
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Jun 6, 2024
1 parent 39d185b commit 8ead404
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"colord": "^2.9.3",
"echarts": "^5.5.0",
"md-editor-v3": "^4.15.2",
"performant-array-to-tree": "^1.11.0",
"pinia": "^2.1.7",
"pinia-plugin-persist": "^1.0.0",
"quill": "^2.0.2",
Expand Down
30 changes: 0 additions & 30 deletions src/utils/array.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
// import { arrayToTree as _arrayToTree } from 'performant-array-to-tree'
// import { omit } from 'radash'

// export function arrayToTree(data: any) {
// const rowTree = _arrayToTree(data, {
// parentId: 'pid',
// dataField: null,
// })

// const transform = (node: any) => {
// if (node.children.length > 0) {
// return ({
// ...node,
// children: node.children.map(transform),
// })
// }
// return omit(node, ['children'])
// }
// return rowTree.map(transform)
// }

// interface ArrayItem extends Record<PropertyKey, any> {
// id: number
// pid: number | null
// }

// interface TreeItem extends ArrayItem {
// children?: TreeItem[]
// }

export function arrayToTree(arr: any[]) {
const res: any = []
const map = new Map()
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineConfig(({ mode }) => {
reportCompressedSize: false, // 启用/禁用 gzip 压缩大小报告
},
optimizeDeps: {
include: ['echarts', 'md-editor-v3'],
include: ['echarts', 'md-editor-v3', 'quill'],
},
}
})

0 comments on commit 8ead404

Please sign in to comment.