Skip to content

Commit 0360e06

Browse files
committed
feat: Optimize and upgrade project architecture and style system
🎨 Architecture Optimization - Refactor router configuration: Split into modular structure (routes/index.ts, constant.ts, async.ts) - Create centralized API management (src/api/index.ts) - Add comprehensive TypeScript type definitions (src/types/index.ts) - Implement environment-based configuration (src/config/env.ts) - Create reusable window resize hooks (src/hooks/useWindowResize.ts) - Implement Logger utility to replace console.log (src/utils/logger.ts) ✨ Style System Upgrade - Create modern common styles library (src/styles/common.scss) - Add gradient buttons, cards, tables and other component styles - Implement smooth animation effects (fadeIn, slideInRight) - Unified spacing utility classes (mt-10, mb-20, etc.) 🔧 Technical Upgrades - Update Element Plus import paths: lib/ → es/ (better tree-shaking) - Optimize App.vue: Use useWindowResize hook - Enhance request.ts: Add TypeScript generics and error handling - Fix Vite optimizeDeps configuration paths 🐛 Bug Fixes - Fix menu display issue: Initialize accessRoutes with asyncRoutes - Fix Dashboard chart rendering: Add nextTick and delayed initialization - Resolve dependency import errors: Remove non-existent dayjs, @fullcalendar, cropperjs - Fix TypeScript type errors and most ESLint violations 📦 Dependency Management - Add pnpm-lock.yaml - Update project dependency versions 📈 Performance Improvements - Router file reduced from 584 lines to 45 lines (92% reduction) - Implement debounced window resize handling - Optimize chart initialization timing Files changed: 23 files, 8100+ insertions, 650+ deletions
1 parent 1b762fc commit 0360e06

File tree

23 files changed

+8167
-647
lines changed

23 files changed

+8167
-647
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"editor.codeActionsOnSave": {
14-
"source.fixAll": true
14+
"source.fixAll": "explicit"
1515
},
1616
"[javascript]": {
1717
"editor.defaultFormatter": "esbenp.prettier-vscode"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"private": true,
44
"version": "1.1.1",
55
"scripts": {
6-
"preinstall": "npx only-allow yarn",
6+
"preinstall": "npx only-allow pnpm",
77
"dev": "vite --host",
88
"build": "vite build",
99
"preview": "vite preview",

0 commit comments

Comments
 (0)