vue3-admin-gpt 1.0.0
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.
- package/.env.development +14 -0
- package/.env.production +14 -0
- package/LICENSE +21 -0
- package/README.en.md +106 -0
- package/README.md +104 -0
- package/build-zip.cjs +53 -0
- package/cli.js +110 -0
- package/jsconfig.json +9 -0
- package/package.json +92 -0
- package/public/index.html +20 -0
- package/public/robots.txt +2 -0
- package/rspack.config.js +282 -0
- package/rspack.js +162 -0
- package/src/App.vue +9 -0
- package/src/api/icon.js +9 -0
- package/src/api/router.js +9 -0
- package/src/api/table.js +25 -0
- package/src/api/tree.js +9 -0
- package/src/api/user.js +34 -0
- package/src/assets/error_images/401.png +0 -0
- package/src/assets/error_images/404.png +0 -0
- package/src/assets/error_images/cloud.png +0 -0
- package/src/assets/login_images/background.jpg +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/qr_logo/lqr_logo.png +0 -0
- package/src/assets/vuejs-fill.svg +4 -0
- package/src/components/VabPageHeader/index.vue +133 -0
- package/src/config/index.js +7 -0
- package/src/config/net.config.js +20 -0
- package/src/config/permission.js +136 -0
- package/src/config/setting.config.js +62 -0
- package/src/config/settings.js +6 -0
- package/src/config/theme.config.js +14 -0
- package/src/layouts/EmptyLayout.vue +3 -0
- package/src/layouts/components/VabAppMain/index.vue +109 -0
- package/src/layouts/components/VabAvatar/index.vue +255 -0
- package/src/layouts/components/VabBreadcrumb/index.vue +61 -0
- package/src/layouts/components/VabFullScreen/index.vue +61 -0
- package/src/layouts/components/VabLogo/index.vue +94 -0
- package/src/layouts/components/VabNav/index.vue +176 -0
- package/src/layouts/components/VabSide/components/VabMenuItem.vue +80 -0
- package/src/layouts/components/VabSide/components/VabSideItem.vue +100 -0
- package/src/layouts/components/VabSide/components/VabSubmenu.vue +56 -0
- package/src/layouts/components/VabSide/index.vue +123 -0
- package/src/layouts/components/VabTabs/index.vue +500 -0
- package/src/layouts/components/VabTheme/index.vue +603 -0
- package/src/layouts/components/VabTop/index.vue +286 -0
- package/src/layouts/export.js +29 -0
- package/src/layouts/index.vue +339 -0
- package/src/main.js +40 -0
- package/src/plugins/echarts.js +4 -0
- package/src/plugins/index.js +44 -0
- package/src/plugins/support.js +16 -0
- package/src/router/index.js +400 -0
- package/src/store/index.js +26 -0
- package/src/store/modules/errorLog.js +27 -0
- package/src/store/modules/routes.js +60 -0
- package/src/store/modules/settings.js +73 -0
- package/src/store/modules/table.js +22 -0
- package/src/store/modules/tabsBar.js +109 -0
- package/src/store/modules/user.js +131 -0
- package/src/styles/element-variables.scss +13 -0
- package/src/styles/loading.scss +345 -0
- package/src/styles/nav-icons.scss +52 -0
- package/src/styles/normalize.scss +353 -0
- package/src/styles/spinner/dots.css +68 -0
- package/src/styles/spinner/gauge.css +104 -0
- package/src/styles/spinner/inner-circles.css +51 -0
- package/src/styles/spinner/plus.css +341 -0
- package/src/styles/themes/default.scss +1 -0
- package/src/styles/transition.scss +18 -0
- package/src/styles/vab.scss +476 -0
- package/src/styles/variables.scss +69 -0
- package/src/utils/accessToken.js +56 -0
- package/src/utils/eventBus.js +8 -0
- package/src/utils/handleRoutes.js +100 -0
- package/src/utils/index.js +231 -0
- package/src/utils/message.js +67 -0
- package/src/utils/pageTitle.js +11 -0
- package/src/utils/password.js +43 -0
- package/src/utils/permission.js +19 -0
- package/src/utils/request.js +187 -0
- package/src/utils/static.js +81 -0
- package/src/utils/vab.js +218 -0
- package/src/utils/validate.js +48 -0
- package/src/views/401.vue +302 -0
- package/src/views/404.vue +302 -0
- package/src/views/demo/index.vue +591 -0
- package/src/views/index/index.vue +1489 -0
- package/src/views/login/index.vue +456 -0
- package/src/views/register/index.vue +524 -0
- package/src/views/vab/calendar.vue +488 -0
- package/src/views/vab/campaign.vue +1006 -0
- package/src/views/vab/chart.vue +189 -0
- package/src/views/vab/customer.vue +666 -0
- package/src/views/vab/editor.vue +84 -0
- package/src/views/vab/form.vue +151 -0
- package/src/views/vab/help.vue +390 -0
- package/src/views/vab/icon.vue +113 -0
- package/src/views/vab/knowledge.vue +820 -0
- package/src/views/vab/nested/menu1/menu2/menu3.vue +29 -0
- package/src/views/vab/nested/menu1/menu2.vue +33 -0
- package/src/views/vab/nested/menu1.vue +33 -0
- package/src/views/vab/nested.vue +97 -0
- package/src/views/vab/notification.vue +416 -0
- package/src/views/vab/order.vue +507 -0
- package/src/views/vab/permissions.vue +214 -0
- package/src/views/vab/product.vue +724 -0
- package/src/views/vab/project.vue +559 -0
- package/src/views/vab/settings.vue +319 -0
- package/src/views/vab/statistics.vue +431 -0
- package/src/views/vab/table.vue +110 -0
- package/src/views/vab/task.vue +613 -0
- package/src/views/vab/team.vue +662 -0
- package/src/views/vab/tree.vue +44 -0
- package/src/views/vab/upload.vue +180 -0
- package/src/views/vab/vue3Demo/index.vue +103 -0
- package/src/views/vab/workflow.vue +863 -0
package/.env.development
ADDED
package/.env.production
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 good luck
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
[简体中文](./README.md) | English
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<h1>Vue3 Admin GPT</h1>
|
|
5
|
+
<p>A Vue 3 admin template with Element Plus and Rspack</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- Based on Vue 3 + Element Plus + Rspack
|
|
11
|
+
- Support for multiple themes and layout modes
|
|
12
|
+
- Responsive design for PC, tablet, and mobile
|
|
13
|
+
- Complete routing and state management
|
|
14
|
+
- Mock data support
|
|
15
|
+
- Clean code, easy to extend
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Using CLI Tool
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Using npm
|
|
23
|
+
npm create vue3-admin-gpt my-project
|
|
24
|
+
|
|
25
|
+
# Or using npx
|
|
26
|
+
npx create-vue3-admin-gpt my-project
|
|
27
|
+
|
|
28
|
+
# Or install globally
|
|
29
|
+
npm install -g vue3-admin-gpt
|
|
30
|
+
create-vue3-admin-gpt my-project
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Manual Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Clone project
|
|
37
|
+
git clone https://github.com/pxq555/vue3-admin-gpt.git my-project
|
|
38
|
+
cd my-project
|
|
39
|
+
|
|
40
|
+
# Install dependencies
|
|
41
|
+
npm install
|
|
42
|
+
|
|
43
|
+
# Start development server
|
|
44
|
+
npm run serve:rspack
|
|
45
|
+
|
|
46
|
+
# Build for production
|
|
47
|
+
npm run build
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Project Structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
vue3-admin-gpt/
|
|
54
|
+
├── src/
|
|
55
|
+
│ ├── api/ # API interfaces
|
|
56
|
+
│ ├── assets/ # Static assets
|
|
57
|
+
│ ├── components/ # Common components
|
|
58
|
+
│ ├── config/ # Configuration files
|
|
59
|
+
│ ├── layouts/ # Layout components
|
|
60
|
+
│ ├── plugins/ # Plugins
|
|
61
|
+
│ ├── router/ # Router configuration
|
|
62
|
+
│ ├── store/ # Vuex state management
|
|
63
|
+
│ ├── styles/ # Style files
|
|
64
|
+
│ ├── utils/ # Utility functions
|
|
65
|
+
│ └── views/ # Page components
|
|
66
|
+
├── public/ # Public assets
|
|
67
|
+
├── mock/ # Mock service
|
|
68
|
+
├── .env.development # Development environment config
|
|
69
|
+
├── .env.production # Production environment config
|
|
70
|
+
├── rspack.config.js # Rspack build config
|
|
71
|
+
└── package.json # Project configuration
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Configuration
|
|
75
|
+
|
|
76
|
+
Main configuration files are located in `src/config/`:
|
|
77
|
+
|
|
78
|
+
- `index.js` - Main configuration entry
|
|
79
|
+
- `setting.config.js` - General settings (title, port, router mode, etc.)
|
|
80
|
+
- `theme.config.js` - Theme configuration
|
|
81
|
+
- `net.config.js` - Network request configuration
|
|
82
|
+
|
|
83
|
+
## Development Commands
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Start development server
|
|
87
|
+
npm run serve:rspack
|
|
88
|
+
|
|
89
|
+
# Build for production
|
|
90
|
+
npm run build
|
|
91
|
+
|
|
92
|
+
# Build and create zip
|
|
93
|
+
npm run build:zip
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Browser Support
|
|
97
|
+
|
|
98
|
+
Modern browsers and IE 11+
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
|
103
|
+
|
|
104
|
+
## Contributing
|
|
105
|
+
|
|
106
|
+
Issues and Pull Requests are welcome!
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>Vue3 Admin GPT</h1>
|
|
3
|
+
<p>一个基于 Vue 3 + Element Plus + Rspack 的后台管理系统脚手架</p>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
## 特性
|
|
7
|
+
|
|
8
|
+
- 基于 Vue 3 + Element Plus + Rspack 构建
|
|
9
|
+
- 支持多主题切换、多布局模式
|
|
10
|
+
- 响应式设计,支持 PC、平板、手机
|
|
11
|
+
- 完善的路由和状态管理
|
|
12
|
+
- Mock 数据支持
|
|
13
|
+
- 代码简洁,易于扩展
|
|
14
|
+
|
|
15
|
+
## 快速开始
|
|
16
|
+
|
|
17
|
+
### 使用 CLI 工具创建项目
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# 使用 npm
|
|
21
|
+
npm create vue3-admin-gpt my-project
|
|
22
|
+
|
|
23
|
+
# 或使用 npx
|
|
24
|
+
npx create-vue3-admin-gpt my-project
|
|
25
|
+
|
|
26
|
+
# 或全局安装 CLI
|
|
27
|
+
npm install -g vue3-admin-gpt
|
|
28
|
+
create-vue3-admin-gpt my-project
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 手动安装
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 克隆项目
|
|
35
|
+
git clone https://github.com/pxq555/vue3-admin-gpt.git my-project
|
|
36
|
+
cd my-project
|
|
37
|
+
|
|
38
|
+
# 安装依赖
|
|
39
|
+
npm install
|
|
40
|
+
|
|
41
|
+
# 启动开发服务器
|
|
42
|
+
npm run serve:rspack
|
|
43
|
+
|
|
44
|
+
# 构建生产版本
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 项目结构
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
vue3-admin-gpt/
|
|
52
|
+
├── src/
|
|
53
|
+
│ ├── api/ # API 接口
|
|
54
|
+
│ ├── assets/ # 静态资源
|
|
55
|
+
│ ├── components/ # 通用组件
|
|
56
|
+
│ ├── config/ # 配置文件
|
|
57
|
+
│ ├── layouts/ # 布局组件
|
|
58
|
+
│ ├── plugins/ # 插件
|
|
59
|
+
│ ├── router/ # 路由配置
|
|
60
|
+
│ ├── store/ # Vuex 状态管理
|
|
61
|
+
│ ├── styles/ # 样式文件
|
|
62
|
+
│ ├── utils/ # 工具函数
|
|
63
|
+
│ └── views/ # 页面组件
|
|
64
|
+
├── public/ # 公共资源
|
|
65
|
+
├── mock/ # Mock 服务
|
|
66
|
+
├── .env.development # 开发环境配置
|
|
67
|
+
├── .env.production # 生产环境配置
|
|
68
|
+
├── rspack.config.js # Rspack 构建配置
|
|
69
|
+
└── package.json # 项目配置
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 配置说明
|
|
73
|
+
|
|
74
|
+
主要配置文件位于 `src/config/` 目录:
|
|
75
|
+
|
|
76
|
+
- `index.js` - 主配置入口
|
|
77
|
+
- `setting.config.js` - 通用配置(标题、端口号、路由模式等)
|
|
78
|
+
- `theme.config.js` - 主题配置
|
|
79
|
+
- `net.config.js` - 网络请求配置
|
|
80
|
+
|
|
81
|
+
## 开发命令
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# 启动开发服务器
|
|
85
|
+
npm run serve:rspack
|
|
86
|
+
|
|
87
|
+
# 构建生产版本
|
|
88
|
+
npm run build
|
|
89
|
+
|
|
90
|
+
# 构建并打包为 zip
|
|
91
|
+
npm run build:zip
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 浏览器支持
|
|
95
|
+
|
|
96
|
+
现代浏览器和 IE 11+
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
MIT
|
|
101
|
+
|
|
102
|
+
## 贡献
|
|
103
|
+
|
|
104
|
+
欢迎提交 Issue 和 Pull Request!
|
package/build-zip.cjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const archiver = require('archiver');
|
|
4
|
+
|
|
5
|
+
// 创建zip文件的函数
|
|
6
|
+
async function createZip() {
|
|
7
|
+
// 检查dist目录是否存在
|
|
8
|
+
if (!fs.existsSync('dist')) {
|
|
9
|
+
console.error('错误:dist目录不存在');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 检查dist.zip是否已存在,如果存在则删除
|
|
14
|
+
const zipPath = path.join('dist', 'dist.zip');
|
|
15
|
+
if (fs.existsSync(zipPath)) {
|
|
16
|
+
fs.unlinkSync(zipPath);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 创建一个输出流
|
|
20
|
+
const output = fs.createWriteStream(zipPath);
|
|
21
|
+
|
|
22
|
+
// 创建一个archiver实例
|
|
23
|
+
const archive = archiver('zip', {
|
|
24
|
+
zlib: { level: 9 } // 设置压缩级别
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// 监听错误
|
|
28
|
+
output.on('error', (err) => {
|
|
29
|
+
throw err;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 监听打包完成
|
|
33
|
+
output.on('close', () => {
|
|
34
|
+
console.log(`打包完成,生成了 ${archive.pointer()} 字节的 dist/dist.zip 文件`);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// 关联流
|
|
38
|
+
archive.pipe(output);
|
|
39
|
+
|
|
40
|
+
// 添加dist目录中的所有文件到压缩包(除了dist.zip本身)
|
|
41
|
+
archive.glob('**/*', {
|
|
42
|
+
cwd: 'dist',
|
|
43
|
+
ignore: ['dist.zip']
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 完成打包
|
|
47
|
+
await archive.finalize();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
createZip().catch(error => {
|
|
51
|
+
console.error('打包过程中出现错误:', error.message);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
package/cli.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// 获取命令行参数
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
const projectName = args[0] || 'my-admin-app';
|
|
9
|
+
|
|
10
|
+
// 颜色输出
|
|
11
|
+
const colors = {
|
|
12
|
+
reset: '\x1b[0m',
|
|
13
|
+
bright: '\x1b[1m',
|
|
14
|
+
green: '\x1b[32m',
|
|
15
|
+
blue: '\x1b[34m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const log = {
|
|
20
|
+
info: (msg) => console.log(`${colors.blue}${msg}${colors.reset}`),
|
|
21
|
+
success: (msg) => console.log(`${colors.green}${msg}${colors.reset}`),
|
|
22
|
+
warn: (msg) => console.log(`${colors.yellow}${msg}${colors.reset}`),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// 递归复制目录
|
|
26
|
+
function copyDir(src, dest, exclude = []) {
|
|
27
|
+
if (!fs.existsSync(dest)) {
|
|
28
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
32
|
+
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
const srcPath = path.join(src, entry.name);
|
|
35
|
+
const destPath = path.join(dest, entry.name);
|
|
36
|
+
|
|
37
|
+
// 跳过排除的文件/目录
|
|
38
|
+
if (exclude.some(pattern => srcPath.includes(pattern))) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (entry.isDirectory()) {
|
|
43
|
+
copyDir(srcPath, destPath, exclude);
|
|
44
|
+
} else {
|
|
45
|
+
fs.copyFileSync(srcPath, destPath);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 主函数
|
|
51
|
+
async function createProject() {
|
|
52
|
+
// 模板目录(cli.js 所在的目录)
|
|
53
|
+
const templateDir = __dirname;
|
|
54
|
+
// 目标目录(在当前工作目录下创建)
|
|
55
|
+
const targetDir = path.resolve(process.cwd(), projectName);
|
|
56
|
+
|
|
57
|
+
// 检查目标目录是否已存在
|
|
58
|
+
if (fs.existsSync(targetDir)) {
|
|
59
|
+
log.warn(`\n❌ 目录 ${projectName} 已存在\n`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
log.info(`\n🚀 创建 Vue3 Admin 项目: ${colors.bright}${projectName}${colors.reset}\n`);
|
|
64
|
+
|
|
65
|
+
// 排除不需要复制的文件和目录
|
|
66
|
+
const exclude = [
|
|
67
|
+
'node_modules',
|
|
68
|
+
'.git',
|
|
69
|
+
'dist',
|
|
70
|
+
'.DS_Store',
|
|
71
|
+
'cli.js',
|
|
72
|
+
'pnpm-lock.yaml',
|
|
73
|
+
'package-lock.json',
|
|
74
|
+
'yarn.lock',
|
|
75
|
+
'.claude',
|
|
76
|
+
// 排除常见的前端临时目录
|
|
77
|
+
'my-test-project',
|
|
78
|
+
'my-admin-app',
|
|
79
|
+
'test-project',
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
// 复制模板文件
|
|
83
|
+
log.info('📦 复制项目文件...');
|
|
84
|
+
copyDir(templateDir, targetDir, exclude);
|
|
85
|
+
log.success('✓ 项目文件复制完成\n');
|
|
86
|
+
|
|
87
|
+
// 更新 package.json 中的项目名称
|
|
88
|
+
const pkgPath = path.join(targetDir, 'package.json');
|
|
89
|
+
if (fs.existsSync(pkgPath)) {
|
|
90
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
91
|
+
pkg.name = projectName;
|
|
92
|
+
// 移除 bin 字段(脚手架项目不需要)
|
|
93
|
+
delete pkg.bin;
|
|
94
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
95
|
+
log.success('✓ package.json 已更新\n');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 输出安装说明
|
|
99
|
+
log.success('🎉 项目创建成功!\n');
|
|
100
|
+
log.info('接下来执行以下命令:\n');
|
|
101
|
+
console.log(` ${colors.bright}cd ${projectName}${colors.reset}`);
|
|
102
|
+
console.log(` ${colors.bright}npm install${colors.reset}`);
|
|
103
|
+
console.log(` ${colors.bright}npm run serve:rspack${colors.reset}\n`);
|
|
104
|
+
log.info('happy coding! 🎨\n');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
createProject().catch(err => {
|
|
108
|
+
console.error(err);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
});
|
package/jsconfig.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue3-admin-gpt",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A Vue3 admin template with Element Plus and Rspack",
|
|
5
|
+
"author": "pxq555",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/pxq555/vue3-admin-gpt#readme",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"serve:rspack": "node --no-deprecation rspack.js serve",
|
|
10
|
+
"build": "rimraf dist && node --no-deprecation rspack.js build",
|
|
11
|
+
"build:zip": "rimraf dist && node --no-deprecation rspack.js build && node build-zip.cjs"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pxq555/vue3-admin-gpt.git"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"create-vue3-admin-gpt": "./cli.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"public",
|
|
23
|
+
"rspack.config.js",
|
|
24
|
+
"rspack.js",
|
|
25
|
+
".env.*",
|
|
26
|
+
"jsconfig.json",
|
|
27
|
+
"cli.js",
|
|
28
|
+
"build-zip.cjs"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
32
|
+
"axios": "^1.13.5",
|
|
33
|
+
"caniuse-lite": "^1.0.30001769",
|
|
34
|
+
"clipboard": "^2.0.11",
|
|
35
|
+
"core-js": "^3.48.0",
|
|
36
|
+
"dayjs": "^1.11.19",
|
|
37
|
+
"echarts": "6.0.0",
|
|
38
|
+
"element-plus": "^2.13.2",
|
|
39
|
+
"jsencrypt": "^3.5.4",
|
|
40
|
+
"lodash": "^4.17.23",
|
|
41
|
+
"lodash-es": "^4.17.23",
|
|
42
|
+
"mitt": "^3.0.1",
|
|
43
|
+
"mockjs": "^1.1.0",
|
|
44
|
+
"nprogress": "^0.2.0",
|
|
45
|
+
"qs": "^6.14.1",
|
|
46
|
+
"screenfull": "^6.0.2",
|
|
47
|
+
"vue": "^3.5.27",
|
|
48
|
+
"vue-echarts": "^8.0.1",
|
|
49
|
+
"vue-router": "^5.0.2",
|
|
50
|
+
"vuedraggable": "^2.24.3",
|
|
51
|
+
"vuex": "^4.1.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@babel/core": "^7.29.0",
|
|
55
|
+
"@babel/preset-env": "^7.29.0",
|
|
56
|
+
"@rspack/cli": "^1.7.5",
|
|
57
|
+
"@rspack/core": "^1.7.5",
|
|
58
|
+
"@rspack/dev-server": "^1.2.1",
|
|
59
|
+
"@vue/compiler-sfc": "^3.5.27",
|
|
60
|
+
"archiver": "^7.0.1",
|
|
61
|
+
"babel-loader": "^10.0.0",
|
|
62
|
+
"body-parser": "^2.2.2",
|
|
63
|
+
"chalk": "4.1.2",
|
|
64
|
+
"chokidar": "^5.0.0",
|
|
65
|
+
"css-loader": "^7.1.3",
|
|
66
|
+
"dotenv": "^17.2.4",
|
|
67
|
+
"html-rspack-plugin": "^6.1.7",
|
|
68
|
+
"path-browserify": "^1.0.1",
|
|
69
|
+
"rimraf": "^6.1.2",
|
|
70
|
+
"sass": "1.71.1",
|
|
71
|
+
"sass-loader": "14.1.1",
|
|
72
|
+
"style-loader": "^4.0.0",
|
|
73
|
+
"vue-loader": "^17.4.2",
|
|
74
|
+
"vue-template-compiler": "^2.7.16"
|
|
75
|
+
},
|
|
76
|
+
"keywords": [
|
|
77
|
+
"vue",
|
|
78
|
+
"vue3",
|
|
79
|
+
"admin",
|
|
80
|
+
"template",
|
|
81
|
+
"scaffold",
|
|
82
|
+
"element-plus",
|
|
83
|
+
"rspack",
|
|
84
|
+
"dashboard",
|
|
85
|
+
"management-system",
|
|
86
|
+
"cli"
|
|
87
|
+
],
|
|
88
|
+
"engines": {
|
|
89
|
+
"node": ">=16.0.0",
|
|
90
|
+
"npm": ">= 7.0.0"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-cmn-Hans">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
|
|
6
|
+
<meta content="width=device-width,initial-scale=1.0" name="viewport" />
|
|
7
|
+
<meta content="<%= VUE_APP_TITLE %>" name="keywords" />
|
|
8
|
+
<meta content="<%= VUE_APP_AUTHOR %>" name="author" />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<noscript>
|
|
12
|
+
非常抱歉,您需要启用JavaScript才能访问本系统
|
|
13
|
+
</noscript>
|
|
14
|
+
<div id="app"></div>
|
|
15
|
+
<script>
|
|
16
|
+
/^http(s*):\/\//.test(location.href) ||
|
|
17
|
+
alert("系统需要部署到服务器下访问");
|
|
18
|
+
</script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|