zant-admin 1.0.4 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.en.md +414 -25
  2. package/README.md +460 -285
  3. package/bin/cli.js +3 -3
  4. package/bin/generator.js +502 -502
  5. package/bin/prompts.js +158 -158
  6. package/bin/utils.js +133 -133
  7. package/package.json +2 -2
  8. package/public/logo.png +0 -0
  9. package/src/App.vue +16 -16
  10. package/src/api/methods/department.js +36 -0
  11. package/src/api/methods/employee.js +22 -0
  12. package/src/api/methods/logError.js +8 -8
  13. package/src/api/methods/logOperation.js +8 -8
  14. package/src/api/methods/login.js +6 -6
  15. package/src/api/methods/position.js +26 -0
  16. package/src/api/methods/quartz.js +36 -36
  17. package/src/api/methods/region.js +16 -16
  18. package/src/api/methods/sysAccount.js +29 -29
  19. package/src/api/methods/sysDict.js +29 -29
  20. package/src/api/methods/sysDictItem.js +26 -26
  21. package/src/api/methods/sysMenu.js +42 -42
  22. package/src/api/methods/sysRole.js +35 -35
  23. package/src/api/methods/sysUser.js +25 -25
  24. package/src/api/methods/system.js +15 -15
  25. package/src/api/request.js +225 -225
  26. package/src/assets/css/style.css +2 -2
  27. package/src/assets/css/zcui.css +1023 -1023
  28. package/src/assets/imgs/logo.png +0 -0
  29. package/src/assets/imgs/md/console.png +0 -0
  30. package/src/assets/imgs/md/login.png +0 -0
  31. package/src/assets/imgs/md/menu.png +0 -0
  32. package/src/assets/imgs/md/serviceMonitoring.png +0 -0
  33. package/src/assets/imgs/md/statistics.png +0 -0
  34. package/src/components/FormTable.vue +5 -19
  35. package/src/components/IconPicker.vue +351 -351
  36. package/src/components/MainPage.vue +838 -838
  37. package/src/components/details/logErrorDetails.vue +58 -58
  38. package/src/components/details/logOperationDetails.vue +76 -76
  39. package/src/components/edit/QuartzEdit.vue +221 -221
  40. package/src/components/edit/SysAccountEdit.vue +185 -185
  41. package/src/components/edit/SysDictEdit.vue +116 -116
  42. package/src/components/edit/SysDictItemEdit.vue +136 -136
  43. package/src/components/edit/SysRoleEdit.vue +111 -111
  44. package/src/components/edit/organizationalStructure/DepartmentEdit.vue +162 -0
  45. package/src/components/edit/organizationalStructure/EmployeeEdit.vue +295 -0
  46. package/src/components/edit/organizationalStructure/PositionEdit.vue +166 -0
  47. package/src/components/edit/sysMenuEdit.vue +2 -1
  48. package/src/config/index.js +74 -74
  49. package/src/directives/permission.js +49 -49
  50. package/src/main.js +37 -37
  51. package/src/router/index.js +4 -6
  52. package/src/stores/config.js +43 -43
  53. package/src/stores/dict.js +33 -33
  54. package/src/stores/menu.js +81 -81
  55. package/src/stores/user.js +21 -21
  56. package/src/utils/baseEcharts.js +661 -661
  57. package/src/utils/dictTemplate.js +26 -26
  58. package/src/utils/regionUtils.js +173 -173
  59. package/src/utils/useFormCRUD.js +59 -59
  60. package/src/views/baiscstatis/center.vue +474 -474
  61. package/src/views/baiscstatis/iframePage.vue +29 -29
  62. package/src/views/baiscstatis/notFound.vue +192 -192
  63. package/src/views/console.vue +821 -821
  64. package/src/views/demo/button.vue +269 -269
  65. package/src/views/demo/importexport.vue +119 -119
  66. package/src/views/demo/region.vue +322 -322
  67. package/src/views/demo/statistics.vue +214 -214
  68. package/src/views/home.vue +6 -6
  69. package/src/views/login.vue +264 -149
  70. package/src/views/operations/log/logError.vue +78 -78
  71. package/src/views/operations/log/logLogin.vue +66 -66
  72. package/src/views/operations/log/logOperation.vue +103 -103
  73. package/src/views/operations/log/logQuartz.vue +56 -56
  74. package/src/views/operations/quartz.vue +179 -179
  75. package/src/views/operations/serviceMonitoring.vue +134 -134
  76. package/src/views/organizationalStructure/department.vue +194 -0
  77. package/src/views/organizationalStructure/employee.vue +234 -0
  78. package/src/views/organizationalStructure/position.vue +196 -0
  79. package/src/views/system/sysAccount.vue +128 -128
  80. package/src/views/system/sysDict.vue +159 -159
  81. package/src/views/system/sysDictItem.vue +118 -118
  82. package/src/views/system/sysMenu.vue +225 -225
  83. package/src/views/system/sysRole.vue +207 -207
  84. package/src/assets/imgs/md/1.png +0 -0
  85. package/src/assets/imgs/md/10.png +0 -0
  86. package/src/assets/imgs/md/11.png +0 -0
  87. package/src/assets/imgs/md/2.png +0 -0
  88. package/src/assets/imgs/md/3.png +0 -0
  89. package/src/assets/imgs/md/4.png +0 -0
  90. package/src/assets/imgs/md/5.png +0 -0
  91. package/src/assets/imgs/md/6.png +0 -0
  92. package/src/assets/imgs/md/7.png +0 -0
  93. package/src/assets/imgs/md/8.png +0 -0
  94. package/src/assets/imgs/md/9.png +0 -0
package/README.en.md CHANGED
@@ -1,36 +1,425 @@
1
- # zc-ant-vue
1
+ <div align="center">
2
+ <h1>ZAntAdmin</h1>
3
+ <img src="./public/logo.png" alt="ZAntAdmin Logo" width="120">
4
+ </div>
2
5
 
3
- #### Description
4
- {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
6
+ <div align="center">
5
7
 
6
- #### Software Architecture
7
- Software architecture description
8
+ ![ZAntAdmin](https://img.shields.io/badge/ZAntAdmin-Admin%20Platform-blue.svg)
9
+ ![Vue](https://img.shields.io/badge/Vue-3.5-green.svg)
10
+ ![Ant Design Vue](https://img.shields.io/badge/Ant%20Design%20Vue-4.2.6-red.svg)
11
+ ![License](https://img.shields.io/badge/License-MIT-yellow.svg)
8
12
 
9
- #### Installation
13
+ [Live Demo](http://106.13.37.129:8123) | [Backend Project](https://gitee.com/zchty/zant-core)
10
14
 
11
- 1. xxxx
12
- 2. xxxx
13
- 3. xxxx
15
+ </div>
14
16
 
15
- #### Instructions
17
+ ## 📋 Table of Contents
16
18
 
17
- 1. xxxx
18
- 2. xxxx
19
- 3. xxxx
19
+ - [Introduction](#introduction)
20
+ - [Technical Architecture](#technical-architecture)
21
+ - [Project Structure](#project-structure)
22
+ - [Quick Start](#quick-start)
23
+ - [Core Features](#core-features)
24
+ - [Project Features](#project-features)
25
+ - [Contribution](#contribution)
26
+ - [License](#license)
20
27
 
21
- #### Contribution
28
+ ## Introduction
22
29
 
23
- 1. Fork the repository
24
- 2. Create Feat_xxx branch
25
- 3. Commit your code
26
- 4. Create Pull Request
30
+ ZAntAdmin is a modern frontend management system built with Vue 3.5 + Vite + Ant Design Vue 4.2.6. It adopts the latest frontend technology stack and provides complete user authentication, permission management, dynamic routing, data visualization, and other functions, suitable for the development of enterprise-level management systems.
27
31
 
32
+ ### Preview
28
33
 
29
- #### Gitee Feature
34
+ <div>
35
+ <img src="./src/assets/imgs/md/login.png" alt="Login Page" width="300" style="margin-right: 10px; margin-bottom: 10px; border: 1px solid #d9d9d9; border-radius: 4px;">
36
+ <img src="./src/assets/imgs/md/console.png" alt="Dashboard" width="300" style="margin-right: 10px; margin-bottom: 10px; border: 1px solid #d9d9d9; border-radius: 4px;">
37
+ <img src="./src/assets/imgs/md/serviceMonitoring.png" alt="Service Monitoring" width="300" style="margin-bottom: 10px; border: 1px solid #d9d9d9; border-radius: 4px;">
38
+ <img src="./src/assets/imgs/md/statistics.png" alt="Statistics" width="300" style="margin-right: 10px; margin-bottom: 10px; border: 1px solid #d9d9d9; border-radius: 4px;">
39
+ <img src="./src/assets/imgs/md/menu.png" alt="Menu Management" width="300" style="margin-right: 10px; margin-bottom: 10px; border: 1px solid #d9d9d9; border-radius: 4px;">
40
+ </div>
30
41
 
31
- 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
32
- 2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
33
- 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
34
- 4. The most valuable open source project [GVP](https://gitee.com/gvp)
35
- 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
36
- 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
42
+ ## Technical Architecture
43
+
44
+ ### Core Framework
45
+ - **Vue 3**: Adopting Composition API and `<script setup>` syntax sugar
46
+ - **Vite**: Modern frontend build tool, providing fast development experience
47
+ - **Vue Router 4**: Routing management, supporting dynamic routing and navigation guards
48
+ - **Pinia**: State management, replacing Vuex, providing a simpler API
49
+
50
+ ### UI Framework
51
+ - **Ant Design Vue 4**: Enterprise-level UI component library
52
+ - **@ant-design/icons-vue**: Ant Design icon library
53
+
54
+ ### Utility Libraries
55
+ - **alova**: Request library, providing powerful request management capabilities
56
+ - **dayjs**: Lightweight date processing library
57
+ - **echarts**: Data visualization chart library
58
+ - **file-saver**: File saving tool
59
+ - **pinia-plugin-persist**: Pinia persistence plugin
60
+
61
+ ### Development Tools
62
+ - **ESLint**: Code quality checking
63
+ - **Prettier**: Code formatting
64
+ - **vite-plugin-clean**: Clean old files during build
65
+
66
+ ## Project Structure
67
+
68
+ ```
69
+ ZAntAdmin/
70
+ ├── public/ # Static resources
71
+ ├── src/
72
+ │ ├── api/ # API interfaces
73
+ │ │ ├── methods/ # Module API methods
74
+ │ │ └── request.js # Request encapsulation
75
+ │ ├── assets/ # Static resources
76
+ │ │ ├── css/ # Style files
77
+ │ │ └── imgs/ # Image resources
78
+ │ ├── components/ # Common components
79
+ │ │ ├── details/ # Detail components
80
+ │ │ ├── edit/ # Edit components
81
+ │ │ └── pages/ # Page components
82
+ │ ├── config/ # Configuration files
83
+ │ ├── directives/ # Custom directives
84
+ │ ├── router/ # Router configuration
85
+ │ ├── stores/ # State management
86
+ │ ├── utils/ # Utility functions
87
+ │ ├── views/ # Page views
88
+ │ ├── App.vue # Root component
89
+ │ └── main.js # Entry file
90
+ ├── .env.development # Development environment variables
91
+ ├── .env.production # Production environment variables
92
+ ├── .env.test # Test environment variables
93
+ ├── eslint.config.js # ESLint configuration
94
+ ├── .prettierrc.json # Prettier configuration
95
+ ├── index.html # HTML template
96
+ ├── package.json # Project dependencies
97
+ └── vite.config.js # Vite configuration
98
+ ```
99
+
100
+ ## Core Features
101
+
102
+ ### 1. User Authentication & Permission Management
103
+ - Token-based user authentication
104
+ - Dynamic permission control
105
+ - Role management
106
+ - Permission directives (`v-permission`)
107
+
108
+ ### 2. Dynamic Routing System
109
+ - Dynamic route loading based on backend menu configuration
110
+ - Route guards for access control
111
+ - Multi-level menu support
112
+ - Route cache control
113
+
114
+ ### 3. Data Management
115
+ - Common CRUD operation encapsulation
116
+ - Form validation
117
+ - Data import/export
118
+ - File upload/download
119
+
120
+ ### 4. System Management
121
+ - User management
122
+ - Role management
123
+ - Menu management
124
+ - Dictionary management
125
+ - System monitoring
126
+ - Log management
127
+
128
+ ### 5. Data Visualization
129
+ - Chart display based on ECharts
130
+ - Statistical analysis pages
131
+ - Data dashboard
132
+
133
+ ## Quick Start
134
+
135
+ ### Requirements
136
+ - Node.js >= 16.0.0 (LTS recommended)
137
+ - npm >= 7.0.0
138
+
139
+ ### Method 1: Using Scaffold (Recommended)
140
+
141
+ ZAnt Admin Scaffold is a quick generation tool for frontend management systems based on Vue 3.5 + Vite + Ant Design Vue. With simple command-line operations, you can quickly create a fully functional management system project.
142
+
143
+ #### Install Scaffold
144
+
145
+ ```bash
146
+ # Install scaffold globally
147
+ npm install -g zant-admin
148
+
149
+ # Or run directly with npx
150
+ npx zant-admin create my-project
151
+ ```
152
+
153
+ #### Create New Project
154
+
155
+ ##### Interactive Creation (Recommended)
156
+ ```bash
157
+ zant-admin create my-project --interactive
158
+ ```
159
+
160
+ The system will guide you through the following configurations:
161
+ - Project description
162
+ - Author name
163
+ - Project template selection
164
+ - Feature selection
165
+ - Skip dependency installation
166
+
167
+ ##### Command Line Arguments
168
+ ```bash
169
+ # Basic creation
170
+ zant-admin create my-project
171
+
172
+ # Specify template and description
173
+ zant-admin create my-project --template basic --description "Basic Management System"
174
+
175
+ # Skip dependency installation
176
+ zant-admin create my-project --skip-install
177
+
178
+ # Disable interactive mode
179
+ zant-admin create my-project --no-interactive
180
+ ```
181
+
182
+ #### Scaffold Commands
183
+
184
+ ##### create Command
185
+ Create a new ZAnt Admin project.
186
+
187
+ **Arguments:**
188
+ - `<project-name>`: Project name (required)
189
+
190
+ **Options:**
191
+ - `-t, --template <template>`: Project template (default: "default")
192
+ - `-d, --description <description>`: Project description
193
+ - `-a, --author <author>`: Author name
194
+ - `--skip-install`: Skip dependency installation
195
+ - `--no-interactive`: Disable interactive mode
196
+
197
+ ##### list-templates Command
198
+ Show available project templates.
199
+
200
+ ```bash
201
+ zant-admin list-templates
202
+ ```
203
+
204
+ ##### View Help
205
+ ```bash
206
+ zant-admin --help
207
+ ```
208
+
209
+ ### Method 2: Manual Installation
210
+
211
+ #### Project Templates
212
+
213
+ ##### Default Template (default)
214
+ - Contains complete management system functions
215
+ - Presets common pages and components
216
+ - Recommended for most projects
217
+
218
+ ##### Basic Template (basic)
219
+ - Contains only core functions
220
+ - Suitable for projects requiring high customization
221
+ - Includes basic pages like login, dashboard, console
222
+
223
+ ##### Full Template (full)
224
+ - Contains all example pages and advanced functions
225
+ - Suitable for learning and reference
226
+ - Includes complete examples like user management, permission management
227
+
228
+ #### Features
229
+
230
+ In interactive mode, you can select the following features:
231
+
232
+ ##### User Management Module
233
+ - User list page
234
+ - User CRUD functions
235
+ - User status management
236
+
237
+ ##### Permission Management Module
238
+ - Role management
239
+ - Permission configuration
240
+ - Access control
241
+
242
+ ##### Data Visualization Charts
243
+ - ECharts integration
244
+ - Data statistics charts
245
+ - Dashboard display
246
+
247
+ ##### File Upload Function
248
+ - Image upload
249
+ - File management
250
+ - Upload progress display
251
+
252
+ ##### Internationalization Support
253
+ - Multi-language switching
254
+ - Chinese/English support
255
+ - Language package management
256
+
257
+ #### Project Structure
258
+
259
+ The generated project has the following structure:
260
+
261
+ ```
262
+ my-project/
263
+ ├── public/ # Static resources
264
+ ├── src/
265
+ │ ├── api/ # API requests
266
+ │ ├── assets/ # Static resources
267
+ │ ├── components/ # Common components
268
+ │ ├── config/ # Configuration files
269
+ │ ├── locales/ # Internationalization files (if selected)
270
+ │ ├── router/ # Router configuration
271
+ │ ├── stores/ # State management
272
+ │ ├── utils/ # Utility functions
273
+ │ ├── views/ # Page views
274
+ │ ├── App.vue # Root component
275
+ │ └── main.js # Entry file
276
+ ├── package.json # Project configuration
277
+ ├── vite.config.js # Vite configuration
278
+ └── README.md # Project documentation
279
+ ```
280
+
281
+ #### Install Dependencies
282
+ ```bash
283
+ npm install
284
+ ```
285
+
286
+ #### Start Development Server
287
+ ```bash
288
+ npm run dev
289
+ ```
290
+
291
+ #### Build for Production
292
+ ```bash
293
+ npm run build
294
+ ```
295
+
296
+ #### Preview Production Build
297
+ ```bash
298
+ npm run preview
299
+ ```
300
+
301
+ # Code Linting & Fixing
302
+ npm run lint
303
+
304
+ # Code Formatting
305
+ npm run format
306
+
307
+ ### Development Standards
308
+
309
+ #### Development Guide
310
+
311
+ ##### Start Development Server
312
+
313
+ ```bash
314
+ cd my-project
315
+ npm install # If dependency installation was skipped
316
+ npm run dev
317
+ ```
318
+
319
+ ##### Build for Production
320
+
321
+ ```bash
322
+ npm run build
323
+ ```
324
+
325
+ ##### Code Linting
326
+
327
+ ```bash
328
+ npm run lint
329
+ ```
330
+
331
+ ##### Code Formatting
332
+
333
+ ```bash
334
+ npm run format
335
+ ```
336
+
337
+ #### Tech Stack
338
+
339
+ - **Vue 3**: Progressive JavaScript Framework
340
+ - **Vite**: Next Generation Frontend Tooling
341
+ - **Ant Design Vue**: Enterprise-class UI Design Language
342
+ - **Pinia**: Vue State Management
343
+ - **Vue Router**: Official Vue Router
344
+ - **ESLint + Prettier**: Code Linting and Formatting
345
+
346
+ #### FAQ
347
+
348
+ ##### Q: Permission error when creating project?
349
+ A: Please ensure you have sufficient permissions to create files in the target directory.
350
+
351
+ ##### Q: Dependency installation failed?
352
+ A: Try using `--skip-install` to skip installation, then manually run `npm install`.
353
+
354
+ ##### Q: How to customize templates?
355
+ A: You can modify template files in the `templates/` directory to customize generated content.
356
+
357
+ ##### Q: Support TypeScript?
358
+ A: Current version mainly supports JavaScript, TypeScript support will be added in future versions.
359
+
360
+ #### Vue Component Standards
361
+ 1. Use Composition API (`<script setup>`) syntax sugar
362
+ 2. Use PascalCase for component naming
363
+ 3. Use `.vue` extension for component files
364
+ 4. Use `scoped` styles to avoid global pollution
365
+
366
+ #### JavaScript Standards
367
+ 1. Use ES6+ syntax
368
+ 2. Use `import/export` for modularization
369
+ 3. Prefer `const`, then `let`, avoid `var`
370
+ 4. Use arrow functions to simplify code
371
+
372
+ #### CSS Standards
373
+ 1. Use kebab-case for CSS class names
374
+ 2. Use `scoped` for component styles to avoid global pollution
375
+
376
+ #### Code Commit Standards
377
+ 1. Follow conventional commit specification
378
+ 2. Ensure ESLint check passes before commit
379
+
380
+ ## Project Features
381
+
382
+ ### 1. Modular Design
383
+ The project adopts a highly modular design, with functional modules independent of each other, facilitating maintenance and expansion.
384
+
385
+ ### 2. Common Component Encapsulation
386
+ Provides rich common components, such as form tables, icon selectors, etc., improving development efficiency.
387
+
388
+ ### 3. Utility Function Library
389
+ Encapsulates common utility functions, such as region tools, form CRUD operations, etc., simplifying business logic development.
390
+
391
+ ### 4. Responsive Design
392
+ Responsive design based on Ant Design Vue, adapting to devices of different screen sizes.
393
+
394
+ ### 5. Internationalization Support
395
+ Reserved internationalization interfaces for future multi-language expansion.
396
+
397
+ ## Deployment
398
+
399
+ ### Environment Configuration
400
+ The project supports multi-environment configuration, managing variables for different environments via `.env` files:
401
+ - `.env.development`: Development environment
402
+ - `.env.test`: Test environment
403
+ - `.env.production`: Production environment
404
+
405
+ ### Build & Deploy
406
+ 1. Run build command: `npm run build`
407
+ 2. Deploy files in `dist` directory to Web server
408
+ 3. Configure server to support SPA routing mode
409
+
410
+ ## Contribution
411
+
412
+ 1. Raise Issues or Suggestions
413
+ - Submit Issue describing the problem or suggestion
414
+ - Provide relevant code snippets or screenshots
415
+
416
+ 2. Participate in Development
417
+ - Fork this project
418
+ - Create feature branch (`git checkout -b feature/AmazingFeature`)
419
+ - Commit changes (`git commit -m 'Add some AmazingFeature'`)
420
+ - Push to branch (`git push origin feature/AmazingFeature`)
421
+ - Submit Pull Request
422
+
423
+ ## License
424
+
425
+ This project is licensed under the MIT License, see the LICENSE file for details.