Compare commits

..

No commits in common. "f426bffbc76e2a27034b37b05666d6d0bd4b4258" and "39d185b1328e83b6ff99bc7c60d82fdb3fa52080" have entirely different histories.

4 changed files with 36 additions and 1 deletions

1
.npmrc
View File

@ -2,3 +2,4 @@ registry=https://registry.npmmirror.com/
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
engine-strict = true

View File

@ -36,6 +36,9 @@
"naive-ui-admin",
"UnoCSS"
],
"engines": {
"node": ">= 20"
},
"scripts": {
"dev": "vite --mode dev --port 9980",
"dev:test": "vite --mode test",
@ -56,6 +59,7 @@
"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",

View File

@ -1,3 +1,33 @@
// 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()

View File

@ -28,7 +28,7 @@ export default defineConfig(({ mode }) => {
reportCompressedSize: false, // 启用/禁用 gzip 压缩大小报告
},
optimizeDeps: {
include: ['echarts', 'md-editor-v3', 'quill'],
include: ['echarts', 'md-editor-v3'],
},
}
})