Bladeren bron

配置 AutoImport & Components, 实现按需导入

WanGxC 11 maanden geleden
bovenliggende
commit
c46f812cd2
11 gewijzigde bestanden met toevoegingen van 622 en 302 verwijderingen
  1. 2 2
      .env.development
  2. 10 0
      auto-imports.d.ts
  3. 73 0
      components.d.ts
  4. 333 2
      package-lock.json
  5. 4 2
      package.json
  6. 88 0
      src/auto-imports.d.ts
  7. 5 4
      src/main.ts
  8. 20 0
      src/views/demo/index.vue
  9. 1 1
      src/views/system/demo/index.vue
  10. 71 290
      src/views/system/home/index.vue
  11. 15 1
      vite.config.ts

+ 2 - 2
.env.development

@@ -2,8 +2,8 @@
 ENV = 'development'
 
 # 本地环境接口地址
-VITE_API_URL = 'http://127.0.0.1:8000'
-# VITE_API_URL = 'http://192.168.1.225/'
+# VITE_API_URL = 'http://127.0.0.1:8000'
+VITE_API_URL = 'http://192.168.1.225/'
 # VITE_API_URL = 'http://192.168.1.22:8080/'
 # VITE_API_URL = 'http://amzads.zositechc.cn'
 

+ 10 - 0
auto-imports.d.ts

@@ -0,0 +1,10 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+// biome-ignore lint: disable
+export {}
+declare global {
+
+}

+ 73 - 0
components.d.ts

@@ -0,0 +1,73 @@
+/* eslint-disable */
+// @ts-nocheck
+// Generated by unplugin-vue-components
+// Read more: https://github.com/vuejs/core/pull/3399
+export {}
+
+/* prettier-ignore */
+declare module 'vue' {
+  export interface GlobalComponents {
+    Auth: typeof import('./src/components/auth/auth.vue')['default']
+    AuthAll: typeof import('./src/components/auth/authAll.vue')['default']
+    Auths: typeof import('./src/components/auth/auths.vue')['default']
+    AvatarSelector: typeof import('./src/components/avatarSelector/index.vue')['default']
+    Cropper: typeof import('./src/components/cropper/index.vue')['default']
+    DeptFormat: typeof import('./src/components/dept-format/index.vue')['default']
+    DvaSelect: typeof import('./src/components/dvaSelect/index.vue')['default']
+    Editor: typeof import('./src/components/editor/index.vue')['default']
+    ElAlert: typeof import('element-plus/es')['ElAlert']
+    ElAside: typeof import('element-plus/es')['ElAside']
+    ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
+    ElBacktop: typeof import('element-plus/es')['ElBacktop']
+    ElBadge: typeof import('element-plus/es')['ElBadge']
+    ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
+    ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
+    ElButton: typeof import('element-plus/es')['ElButton']
+    ElCol: typeof import('element-plus/es')['ElCol']
+    ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
+    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElContainer: typeof import('element-plus/es')['ElContainer']
+    ElDialog: typeof import('element-plus/es')['ElDialog']
+    ElDivider: typeof import('element-plus/es')['ElDivider']
+    ElDrawer: typeof import('element-plus/es')['ElDrawer']
+    ElDropdown: typeof import('element-plus/es')['ElDropdown']
+    ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
+    ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
+    ElEmpty: typeof import('element-plus/es')['ElEmpty']
+    ElForm: typeof import('element-plus/es')['ElForm']
+    ElFormItem: typeof import('element-plus/es')['ElFormItem']
+    ElHeader: typeof import('element-plus/es')['ElHeader']
+    ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElImage: typeof import('element-plus/es')['ElImage']
+    ElInput: typeof import('element-plus/es')['ElInput']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
+    ElMain: typeof import('element-plus/es')['ElMain']
+    ElMenu: typeof import('element-plus/es')['ElMenu']
+    ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+    ElOption: typeof import('element-plus/es')['ElOption']
+    ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
+    ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRow: typeof import('element-plus/es')['ElRow']
+    ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSelectV2: typeof import('element-plus/es')['ElSelectV2']
+    ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
+    ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
+    ForeignKey: typeof import('./src/components/foreignKey/index.vue')['default']
+    IconSelector: typeof import('./src/components/iconSelector/index.vue')['default']
+    ImportExcel: typeof import('./src/components/importExcel/index.vue')['default']
+    List: typeof import('./src/components/iconSelector/list.vue')['default']
+    ManyToMany: typeof import('./src/components/manyToMany/index.vue')['default']
+    NoticeBar: typeof import('./src/components/noticeBar/index.vue')['default']
+    RouterLink: typeof import('vue-router')['RouterLink']
+    RouterView: typeof import('vue-router')['RouterView']
+    SvgIcon: typeof import('./src/components/svgIcon/index.vue')['default']
+    Table: typeof import('./src/components/table/index.vue')['default']
+    TableSelector: typeof import('./src/components/tableSelector/index.vue')['default']
+  }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
+}

+ 333 - 2
package-lock.json

@@ -71,13 +71,15 @@
 				"prettier": "^2.8.1",
 				"sass": "^1.56.2",
 				"typescript": "^5.6.2",
+				"unplugin-auto-import": "^0.18.3",
+				"unplugin-vue-components": "^0.27.4",
 				"vite": "^4.5.3",
 				"vite-plugin-vue-setup-extend": "^0.4.0",
 				"vue-eslint-parser": "^9.1.0"
 			},
 			"engines": {
-				"node": ">=16.0.0",
-				"npm": ">= 7.0.0"
+				"node": ">=18.20.0",
+				"npm": ">= 10.0.0"
 			}
 		},
 		"node_modules/@alloc/quick-lru": {
@@ -105,6 +107,16 @@
 				"node": ">=6.0.0"
 			}
 		},
+		"node_modules/@antfu/utils": {
+			"version": "0.7.10",
+			"resolved": "https://registry.npmmirror.com/@antfu/utils/-/utils-0.7.10.tgz",
+			"integrity": "sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==",
+			"dev": true,
+			"license": "MIT",
+			"funding": {
+				"url": "https://github.com/sponsors/antfu"
+			}
+		},
 		"node_modules/@aws-crypto/crc32": {
 			"version": "5.2.0",
 			"resolved": "https://registry.npmmirror.com/@aws-crypto/crc32/-/crc32-5.2.0.tgz",
@@ -2488,6 +2500,29 @@
 				"url": "https://opencollective.com/popperjs"
 			}
 		},
+		"node_modules/@rollup/pluginutils": {
+			"version": "5.1.0",
+			"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.1.0.tgz",
+			"integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/estree": "^1.0.0",
+				"estree-walker": "^2.0.2",
+				"picomatch": "^2.3.1"
+			},
+			"engines": {
+				"node": ">=14.0.0"
+			},
+			"peerDependencies": {
+				"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
+			},
+			"peerDependenciesMeta": {
+				"rollup": {
+					"optional": true
+				}
+			}
+		},
 		"node_modules/@smithy/abort-controller": {
 			"version": "3.1.2",
 			"resolved": "https://registry.npmmirror.com/@smithy/abort-controller/-/abort-controller-3.1.2.tgz",
@@ -3199,6 +3234,13 @@
 			"integrity": "sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==",
 			"license": "MIT"
 		},
+		"node_modules/@types/estree": {
+			"version": "1.0.5",
+			"resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.5.tgz",
+			"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/@types/event-emitter": {
 			"version": "0.3.5",
 			"resolved": "https://registry.npmmirror.com/@types/event-emitter/-/event-emitter-0.3.5.tgz",
@@ -4671,6 +4713,13 @@
 				"node": ">= 6"
 			}
 		},
+		"node_modules/confbox": {
+			"version": "0.1.7",
+			"resolved": "https://registry.npmmirror.com/confbox/-/confbox-0.1.7.tgz",
+			"integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/content-type": {
 			"version": "1.0.5",
 			"resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
@@ -6813,6 +6862,23 @@
 			"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
 			"license": "MIT"
 		},
+		"node_modules/local-pkg": {
+			"version": "0.5.0",
+			"resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.5.0.tgz",
+			"integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"mlly": "^1.4.2",
+				"pkg-types": "^1.0.3"
+			},
+			"engines": {
+				"node": ">=14"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/antfu"
+			}
+		},
 		"node_modules/locate-path": {
 			"version": "6.0.0",
 			"resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-6.0.0.tgz",
@@ -7044,6 +7110,19 @@
 				"mkdirp": "bin/cmd.js"
 			}
 		},
+		"node_modules/mlly": {
+			"version": "1.7.1",
+			"resolved": "https://registry.npmmirror.com/mlly/-/mlly-1.7.1.tgz",
+			"integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"acorn": "^8.11.3",
+				"pathe": "^1.1.2",
+				"pkg-types": "^1.1.1",
+				"ufo": "^1.5.3"
+			}
+		},
 		"node_modules/mobius1-selectr": {
 			"version": "2.4.13",
 			"resolved": "https://registry.npmmirror.com/mobius1-selectr/-/mobius1-selectr-2.4.13.tgz",
@@ -7478,6 +7557,13 @@
 				"node": ">=8"
 			}
 		},
+		"node_modules/pathe": {
+			"version": "1.1.2",
+			"resolved": "https://registry.npmmirror.com/pathe/-/pathe-1.1.2.tgz",
+			"integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/pause-stream": {
 			"version": "0.0.11",
 			"resolved": "https://registry.npmmirror.com/pause-stream/-/pause-stream-0.0.11.tgz",
@@ -7629,6 +7715,18 @@
 				"node": ">= 6"
 			}
 		},
+		"node_modules/pkg-types": {
+			"version": "1.2.0",
+			"resolved": "https://registry.npmmirror.com/pkg-types/-/pkg-types-1.2.0.tgz",
+			"integrity": "sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"confbox": "^0.1.7",
+				"mlly": "^1.7.1",
+				"pathe": "^1.1.2"
+			}
+		},
 		"node_modules/platform": {
 			"version": "1.3.6",
 			"resolved": "https://registry.npmmirror.com/platform/-/platform-1.3.6.tgz",
@@ -8235,6 +8333,13 @@
 				"compute-scroll-into-view": "^1.0.20"
 			}
 		},
+		"node_modules/scule": {
+			"version": "1.3.0",
+			"resolved": "https://registry.npmmirror.com/scule/-/scule-1.3.0.tgz",
+			"integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/sdk-base": {
 			"version": "2.0.1",
 			"resolved": "https://registry.npmmirror.com/sdk-base/-/sdk-base-2.0.1.tgz",
@@ -8608,6 +8713,26 @@
 				"url": "https://github.com/sponsors/sindresorhus"
 			}
 		},
+		"node_modules/strip-literal": {
+			"version": "2.1.0",
+			"resolved": "https://registry.npmmirror.com/strip-literal/-/strip-literal-2.1.0.tgz",
+			"integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"js-tokens": "^9.0.0"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/antfu"
+			}
+		},
+		"node_modules/strip-literal/node_modules/js-tokens": {
+			"version": "9.0.0",
+			"resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-9.0.0.tgz",
+			"integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/strnum": {
 			"version": "1.0.5",
 			"resolved": "https://registry.npmmirror.com/strnum/-/strnum-1.0.5.tgz",
@@ -8871,6 +8996,13 @@
 				"node": ">=14.17"
 			}
 		},
+		"node_modules/ufo": {
+			"version": "1.5.4",
+			"resolved": "https://registry.npmmirror.com/ufo/-/ufo-1.5.4.tgz",
+			"integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/undici-types": {
 			"version": "5.26.5",
 			"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
@@ -8889,6 +9021,51 @@
 				"node": ">=0.10.0"
 			}
 		},
+		"node_modules/unimport": {
+			"version": "3.12.0",
+			"resolved": "https://registry.npmmirror.com/unimport/-/unimport-3.12.0.tgz",
+			"integrity": "sha512-5y8dSvNvyevsnw4TBQkIQR1Rjdbb+XjVSwQwxltpnVZrStBvvPkMPcZrh1kg5kY77kpx6+D4Ztd3W6FOBH/y2Q==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@rollup/pluginutils": "^5.1.0",
+				"acorn": "^8.12.1",
+				"escape-string-regexp": "^5.0.0",
+				"estree-walker": "^3.0.3",
+				"fast-glob": "^3.3.2",
+				"local-pkg": "^0.5.0",
+				"magic-string": "^0.30.11",
+				"mlly": "^1.7.1",
+				"pathe": "^1.1.2",
+				"pkg-types": "^1.2.0",
+				"scule": "^1.3.0",
+				"strip-literal": "^2.1.0",
+				"unplugin": "^1.14.1"
+			}
+		},
+		"node_modules/unimport/node_modules/escape-string-regexp": {
+			"version": "5.0.0",
+			"resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
+			"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=12"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
+		"node_modules/unimport/node_modules/estree-walker": {
+			"version": "3.0.3",
+			"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz",
+			"integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/estree": "^1.0.0"
+			}
+		},
 		"node_modules/universalify": {
 			"version": "2.0.1",
 			"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz",
@@ -8898,6 +9075,153 @@
 				"node": ">= 10.0.0"
 			}
 		},
+		"node_modules/unplugin": {
+			"version": "1.14.1",
+			"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.14.1.tgz",
+			"integrity": "sha512-lBlHbfSFPToDYp9pjXlUEFVxYLaue9f9T1HC+4OHlmj+HnMDdz9oZY+erXfoCe/5V/7gKUSY2jpXPb9S7f0f/w==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"acorn": "^8.12.1",
+				"webpack-virtual-modules": "^0.6.2"
+			},
+			"engines": {
+				"node": ">=14.0.0"
+			},
+			"peerDependencies": {
+				"webpack-sources": "^3"
+			},
+			"peerDependenciesMeta": {
+				"webpack-sources": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/unplugin-auto-import": {
+			"version": "0.18.3",
+			"resolved": "https://registry.npmmirror.com/unplugin-auto-import/-/unplugin-auto-import-0.18.3.tgz",
+			"integrity": "sha512-q3FUtGQjYA2e+kb1WumyiQMjHM27MrTQ05QfVwtLRVhyYe+KF6TblBYaEX9L6Z0EibsqaXAiW+RFfkcQpfaXzg==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@antfu/utils": "^0.7.10",
+				"@rollup/pluginutils": "^5.1.0",
+				"fast-glob": "^3.3.2",
+				"local-pkg": "^0.5.0",
+				"magic-string": "^0.30.11",
+				"minimatch": "^9.0.5",
+				"unimport": "^3.12.0",
+				"unplugin": "^1.14.1"
+			},
+			"engines": {
+				"node": ">=14"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/antfu"
+			},
+			"peerDependencies": {
+				"@nuxt/kit": "^3.2.2",
+				"@vueuse/core": "*"
+			},
+			"peerDependenciesMeta": {
+				"@nuxt/kit": {
+					"optional": true
+				},
+				"@vueuse/core": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/unplugin-auto-import/node_modules/brace-expansion": {
+			"version": "2.0.1",
+			"resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz",
+			"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"balanced-match": "^1.0.0"
+			}
+		},
+		"node_modules/unplugin-auto-import/node_modules/minimatch": {
+			"version": "9.0.5",
+			"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz",
+			"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+			"dev": true,
+			"license": "ISC",
+			"dependencies": {
+				"brace-expansion": "^2.0.1"
+			},
+			"engines": {
+				"node": ">=16 || 14 >=14.17"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/isaacs"
+			}
+		},
+		"node_modules/unplugin-vue-components": {
+			"version": "0.27.4",
+			"resolved": "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.27.4.tgz",
+			"integrity": "sha512-1XVl5iXG7P1UrOMnaj2ogYa5YTq8aoh5jwDPQhemwO/OrXW+lPQKDXd1hMz15qxQPxgb/XXlbgo3HQ2rLEbmXQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@antfu/utils": "^0.7.10",
+				"@rollup/pluginutils": "^5.1.0",
+				"chokidar": "^3.6.0",
+				"debug": "^4.3.6",
+				"fast-glob": "^3.3.2",
+				"local-pkg": "^0.5.0",
+				"magic-string": "^0.30.11",
+				"minimatch": "^9.0.5",
+				"mlly": "^1.7.1",
+				"unplugin": "^1.12.1"
+			},
+			"engines": {
+				"node": ">=14"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/antfu"
+			},
+			"peerDependencies": {
+				"@babel/parser": "^7.15.8",
+				"@nuxt/kit": "^3.2.2",
+				"vue": "2 || 3"
+			},
+			"peerDependenciesMeta": {
+				"@babel/parser": {
+					"optional": true
+				},
+				"@nuxt/kit": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/unplugin-vue-components/node_modules/brace-expansion": {
+			"version": "2.0.1",
+			"resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz",
+			"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"balanced-match": "^1.0.0"
+			}
+		},
+		"node_modules/unplugin-vue-components/node_modules/minimatch": {
+			"version": "9.0.5",
+			"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz",
+			"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+			"dev": true,
+			"license": "ISC",
+			"dependencies": {
+				"brace-expansion": "^2.0.1"
+			},
+			"engines": {
+				"node": ">=16 || 14 >=14.17"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/isaacs"
+			}
+		},
 		"node_modules/update-browserslist-db": {
 			"version": "1.1.0",
 			"resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz",
@@ -9368,6 +9692,13 @@
 				"vue": "^3.2.28"
 			}
 		},
+		"node_modules/webpack-virtual-modules": {
+			"version": "0.6.2",
+			"resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",
+			"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/which": {
 			"version": "2.0.2",
 			"resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",

+ 4 - 2
package.json

@@ -72,6 +72,8 @@
 		"prettier": "^2.8.1",
 		"sass": "^1.56.2",
 		"typescript": "^5.6.2",
+		"unplugin-auto-import": "^0.18.3",
+		"unplugin-vue-components": "^0.27.4",
 		"vite": "^4.5.3",
 		"vite-plugin-vue-setup-extend": "^0.4.0",
 		"vue-eslint-parser": "^9.1.0"
@@ -82,8 +84,8 @@
 		"not dead"
 	],
 	"engines": {
-		"node": ">=16.0.0",
-		"npm": ">= 7.0.0"
+		"node": ">=18.20.0",
+		"npm": ">= 10.0.0"
 	},
 	"keywords": [
 		"vue",

+ 88 - 0
src/auto-imports.d.ts

@@ -0,0 +1,88 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+// biome-ignore lint: disable
+export {}
+declare global {
+  const EffectScope: typeof import('vue')['EffectScope']
+  const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
+  const computed: typeof import('vue')['computed']
+  const createApp: typeof import('vue')['createApp']
+  const createPinia: typeof import('pinia')['createPinia']
+  const customRef: typeof import('vue')['customRef']
+  const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
+  const defineComponent: typeof import('vue')['defineComponent']
+  const defineStore: typeof import('pinia')['defineStore']
+  const effectScope: typeof import('vue')['effectScope']
+  const getActivePinia: typeof import('pinia')['getActivePinia']
+  const getCurrentInstance: typeof import('vue')['getCurrentInstance']
+  const getCurrentScope: typeof import('vue')['getCurrentScope']
+  const h: typeof import('vue')['h']
+  const inject: typeof import('vue')['inject']
+  const isProxy: typeof import('vue')['isProxy']
+  const isReactive: typeof import('vue')['isReactive']
+  const isReadonly: typeof import('vue')['isReadonly']
+  const isRef: typeof import('vue')['isRef']
+  const mapActions: typeof import('pinia')['mapActions']
+  const mapGetters: typeof import('pinia')['mapGetters']
+  const mapState: typeof import('pinia')['mapState']
+  const mapStores: typeof import('pinia')['mapStores']
+  const mapWritableState: typeof import('pinia')['mapWritableState']
+  const markRaw: typeof import('vue')['markRaw']
+  const nextTick: typeof import('vue')['nextTick']
+  const onActivated: typeof import('vue')['onActivated']
+  const onBeforeMount: typeof import('vue')['onBeforeMount']
+  const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
+  const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
+  const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
+  const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
+  const onDeactivated: typeof import('vue')['onDeactivated']
+  const onErrorCaptured: typeof import('vue')['onErrorCaptured']
+  const onMounted: typeof import('vue')['onMounted']
+  const onRenderTracked: typeof import('vue')['onRenderTracked']
+  const onRenderTriggered: typeof import('vue')['onRenderTriggered']
+  const onScopeDispose: typeof import('vue')['onScopeDispose']
+  const onServerPrefetch: typeof import('vue')['onServerPrefetch']
+  const onUnmounted: typeof import('vue')['onUnmounted']
+  const onUpdated: typeof import('vue')['onUpdated']
+  const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
+  const provide: typeof import('vue')['provide']
+  const reactive: typeof import('vue')['reactive']
+  const readonly: typeof import('vue')['readonly']
+  const ref: typeof import('vue')['ref']
+  const resolveComponent: typeof import('vue')['resolveComponent']
+  const setActivePinia: typeof import('pinia')['setActivePinia']
+  const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
+  const shallowReactive: typeof import('vue')['shallowReactive']
+  const shallowReadonly: typeof import('vue')['shallowReadonly']
+  const shallowRef: typeof import('vue')['shallowRef']
+  const storeToRefs: typeof import('pinia')['storeToRefs']
+  const toRaw: typeof import('vue')['toRaw']
+  const toRef: typeof import('vue')['toRef']
+  const toRefs: typeof import('vue')['toRefs']
+  const toValue: typeof import('vue')['toValue']
+  const triggerRef: typeof import('vue')['triggerRef']
+  const unref: typeof import('vue')['unref']
+  const useAttrs: typeof import('vue')['useAttrs']
+  const useCssModule: typeof import('vue')['useCssModule']
+  const useCssVars: typeof import('vue')['useCssVars']
+  const useId: typeof import('vue')['useId']
+  const useLink: typeof import('vue-router')['useLink']
+  const useModel: typeof import('vue')['useModel']
+  const useRoute: typeof import('vue-router')['useRoute']
+  const useRouter: typeof import('vue-router')['useRouter']
+  const useSlots: typeof import('vue')['useSlots']
+  const useTemplateRef: typeof import('vue')['useTemplateRef']
+  const watch: typeof import('vue')['watch']
+  const watchEffect: typeof import('vue')['watchEffect']
+  const watchPostEffect: typeof import('vue')['watchPostEffect']
+  const watchSyncEffect: typeof import('vue')['watchSyncEffect']
+}
+// for type re-export
+declare global {
+  // @ts-ignore
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  import('vue')
+}

+ 5 - 4
src/main.ts

@@ -5,8 +5,9 @@ import { directive } from '/@/directive/index';
 import { i18n } from '/@/i18n';
 import other from '/@/utils/other';
 import '/@/assets/style/tailwind.css'; // 先引入tailwind css, 以免element-plus冲突
-import ElementPlus from 'element-plus';
-import 'element-plus/dist/index.css';
+// import ElementPlus from 'element-plus';
+// import 'element-plus/dist/index.css';
+import 'element-plus/es/components/menu/style/css'	// element-plus按需导入会导致菜单样式出现问题 单独导入
 import '/@/theme/index.scss';
 import mitt from 'mitt';
 import VueGridLayout from 'vue-grid-layout';
@@ -31,7 +32,7 @@ import VXETable from 'vxe-table'
 import 'vxe-table/lib/style.css'
 
 import '/@/assets/style/reset.scss';
-import 'element-tree-line/dist/style.css'
+// import 'element-tree-line/dist/style.css'
 
 let forIconfont = analyzingIconForIconfont(iconfont); //解析class
 iconList.addIcon(forIconfont.list); // 添加iconfont dvadmin3的icon
@@ -56,7 +57,7 @@ other.elSvg(app);
 app.use(VXETable)
 app.use(pinia)
 	.use(router)
-	.use(ElementPlus, { i18n: i18n.global.t })
+	// .use(ElementPlus, { i18n: i18n.global.t })
 	.use(i18n)
 	.use(VueGridLayout)
 	.use(fastCrud)

+ 20 - 0
src/views/demo/index.vue

@@ -0,0 +1,20 @@
+<script setup lang="ts">/**
+ * @Name: index.vue
+ * @Description: demo
+ * @Author: Cheney
+ */
+
+
+const btnRef = useTemplateRef('btnRef');
+onMounted(() => {
+  console.log('btnRef=> ', btnRef);
+});
+</script>
+
+<template>
+<el-button ref="btnRef">按钮</el-button>
+</template>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/system/demo/index.vue

@@ -69,7 +69,7 @@ function initChart() {
 }
 
 function handleResize(size) {
-  console.log(size)
+  // console.log(size)
 }
 
 // 页面打开后获取列表数据

File diff suppressed because it is too large
+ 71 - 290
src/views/system/home/index.vue


+ 15 - 1
vite.config.ts

@@ -3,7 +3,9 @@ import { resolve } from 'path';
 import { ConfigEnv, defineConfig, loadEnv } from 'vite';
 import vueJsx from '@vitejs/plugin-vue-jsx';
 import compression from 'vite-plugin-compression';
-
+import AutoImport from 'unplugin-auto-import/vite'
+import Components from 'unplugin-vue-components/vite'
+import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
 
 const pathResolve = (dir: string) => {
   return resolve(__dirname, '.', dir);
@@ -29,6 +31,18 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
         threshold: 10240, // 只有大小大于该值的资源会被压缩(默认 10KB)
         deleteOriginFile: false, // 是否删除原始未压缩的文件
       }),
+      AutoImport({
+        imports: [
+          'vue',
+          'vue-router',
+          'pinia'
+        ],
+        resolvers: [ElementPlusResolver()],
+        dts: 'src/auto-imports.d.ts', // 生成 TypeScript 声明文件
+      }),
+      Components({
+        resolvers: [ElementPlusResolver()],
+      }),
     ],
     root: process.cwd(),
     resolve: { alias },

Some files were not shown because too many files changed in this diff