zant-admin 1.0.1 → 2.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +414 -25
  3. package/README.md +426 -277
  4. package/bin/cli.js +99 -99
  5. package/bin/generator.js +502 -502
  6. package/bin/prompts.js +158 -158
  7. package/bin/utils.js +133 -133
  8. package/package.json +3 -3
  9. package/public/logo.png +0 -0
  10. package/src/App.vue +1 -1
  11. package/src/api/methods/sysAccount.js +0 -1
  12. package/src/api/methods/sysDictItem.js +3 -3
  13. package/src/api/methods/system.js +10 -11
  14. package/src/api/request.js +39 -39
  15. package/src/assets/css/style.css +0 -11
  16. package/src/assets/css/zcui.css +1002 -319
  17. package/src/assets/imgs/logo.png +0 -0
  18. package/src/assets/imgs/md/console.png +0 -0
  19. package/src/assets/imgs/md/login.png +0 -0
  20. package/src/assets/imgs/md/menu.png +0 -0
  21. package/src/assets/imgs/md/serviceMonitoring.png +0 -0
  22. package/src/assets/imgs/md/statistics.png +0 -0
  23. package/src/components/FormTable.vue +50 -37
  24. package/src/components/IconPicker.vue +351 -344
  25. package/src/components/MainPage.vue +220 -339
  26. package/src/components/edit/QuartzEdit.vue +1 -1
  27. package/src/components/edit/SysAccountEdit.vue +15 -8
  28. package/src/components/edit/SysDictEdit.vue +6 -4
  29. package/src/components/edit/SysDictItemEdit.vue +8 -6
  30. package/src/components/edit/SysRoleEdit.vue +5 -3
  31. package/src/components/edit/sysMenuEdit.vue +10 -25
  32. package/src/config/index.js +74 -74
  33. package/src/directives/permission.js +49 -45
  34. package/src/main.js +2 -3
  35. package/src/router/index.js +48 -30
  36. package/src/stores/config.js +7 -1
  37. package/src/stores/menu.js +32 -8
  38. package/src/stores/user.js +17 -17
  39. package/src/utils/regionUtils.js +20 -16
  40. package/src/utils/useFormCRUD.js +59 -60
  41. package/src/views/baiscstatis/center.vue +53 -42
  42. package/src/views/baiscstatis/iframePage.vue +9 -11
  43. package/src/views/console.vue +92 -42
  44. package/src/views/demo/button.vue +269 -0
  45. package/src/views/demo/importexport.vue +8 -12
  46. package/src/views/demo/region.vue +103 -21
  47. package/src/views/demo/statistics.vue +38 -19
  48. package/src/views/home.vue +2 -3
  49. package/src/views/login.vue +254 -149
  50. package/src/views/operations/log/logQuartz.vue +0 -1
  51. package/src/views/operations/quartz.vue +22 -24
  52. package/src/views/system/sysAccount.vue +16 -11
  53. package/src/views/system/sysDict.vue +9 -6
  54. package/src/views/system/sysMenu.vue +17 -15
  55. package/src/views/system/sysRole.vue +44 -21
  56. package/SCAFFOLD_README.md +0 -215
  57. package/src/assets/imgs/md/1.png +0 -0
  58. package/src/assets/imgs/md/10.png +0 -0
  59. package/src/assets/imgs/md/11.png +0 -0
  60. package/src/assets/imgs/md/2.png +0 -0
  61. package/src/assets/imgs/md/3.png +0 -0
  62. package/src/assets/imgs/md/4.png +0 -0
  63. package/src/assets/imgs/md/5.png +0 -0
  64. package/src/assets/imgs/md/6.png +0 -0
  65. package/src/assets/imgs/md/7.png +0 -0
  66. package/src/assets/imgs/md/8.png +0 -0
  67. package/src/assets/imgs/md/9.png +0 -0
@@ -4,7 +4,7 @@
4
4
  :columns="columns"
5
5
  modulePath="sysMenu"
6
6
  pageAction="MenuTreeList"
7
- :permissionModulePath="permissionModulePath"
7
+ :permissionModulePath="permissionModulePath"
8
8
  method="get"
9
9
  :page="false"
10
10
  @update="edit"
@@ -12,7 +12,7 @@
12
12
  ref="childRef"
13
13
  >
14
14
  <!-- 可以通过插槽自定义单元格 -->
15
- <!-- <template #custom-title="{ record }">
15
+ <!-- <template #custom-title="{ record }">
16
16
  {{record.type != 4 ? record.title : record.btnName}}
17
17
  </template> -->
18
18
  <template #custom-isEnable="{ record }">
@@ -42,16 +42,18 @@
42
42
  />
43
43
  </template>
44
44
 
45
-
46
- <template #custom-icon="{ record }">
47
- <component v-if="record.icon && $icons[record.icon]" :is="$icons[record.icon]" />
45
+ <template #custom-icon="{ record }">
46
+ <component
47
+ v-if="record.icon && $icons[record.icon]"
48
+ :is="$icons[record.icon]"
49
+ />
48
50
  <span v-else>{{ record.icon }}</span>
49
51
  </template>
50
52
  <template #custom-type="{ record }">
51
- <a-tag v-if="record.type == 1" color="blue">目录</a-tag>
52
- <a-tag v-if="record.type == 2" color="cyan">菜单</a-tag>
53
- <a-tag v-if="record.type == 3" color="purple">链接</a-tag>
54
- <a-tag v-if="record.type == 4" color="orange">按钮</a-tag>
53
+ <a-tag v-if="record.type == 1" color="blue">目录</a-tag>
54
+ <a-tag v-if="record.type == 2" color="cyan">菜单</a-tag>
55
+ <a-tag v-if="record.type == 3" color="purple">链接</a-tag>
56
+ <a-tag v-if="record.type == 4" color="orange">按钮</a-tag>
55
57
  </template>
56
58
  <template #custom-operation="{ record }">
57
59
  <a-divider type="vertical" />
@@ -124,7 +126,7 @@ const columns = ref([
124
126
  key: 'isEnable',
125
127
  resizable: true,
126
128
  },
127
- {
129
+ {
128
130
  title: '显示系统菜单栏',
129
131
  key: 'isShowMenu',
130
132
  resizable: 'true',
@@ -138,7 +140,6 @@ const columns = ref([
138
140
  title: '创建时间',
139
141
  dataIndex: 'createTime',
140
142
  resizable: true,
141
-
142
143
  },
143
144
  {
144
145
  title: '操作',
@@ -153,18 +154,18 @@ const childRef = ref(null)
153
154
  const editopen = ref(false)
154
155
  const editRef = ref(null)
155
156
  const edit = record => {
156
- editRef.value.getMenuTree()
157
+ editRef.value.getMenuTree()
157
158
  editRef.value.init(record.id)
158
159
  editopen.value = true
159
160
  }
160
161
  //新增子菜单
161
162
  const addSubmenu = record => {
162
- editRef.value.getMenuTree()
163
+ editRef.value.getMenuTree()
163
164
  editRef.value.addSubmenu(record)
164
165
  editopen.value = true
165
166
  }
166
167
  const addSubtn = record => {
167
- editRef.value.getMenuTree()
168
+ editRef.value.getMenuTree()
168
169
  editRef.value.addSubtn(record)
169
170
  editopen.value = true
170
171
  }
@@ -211,7 +212,8 @@ const handleSwitchIsShowMenuChange = record => {
211
212
  </script>
212
213
 
213
214
  <style>
214
- .slide-enter-active, .slide-leave-active {
215
+ .slide-enter-active,
216
+ .slide-leave-active {
215
217
  transition: transform 0.5s;
216
218
  }
217
219
  .slide-enter {
@@ -17,9 +17,13 @@
17
17
  @change="handleSwitchChange(record)"
18
18
  />
19
19
  </template>
20
- <template #custom-operation="{ record }">
20
+ <template #custom-operation="{ record }">
21
21
  <a-divider type="vertical" />
22
- <a @click="empower(record)" v-permission="permissionModulePath+':empower'">关联菜单</a>
22
+ <a
23
+ @click="empower(record)"
24
+ v-permission="permissionModulePath + ':empower'"
25
+ >关联菜单</a
26
+ >
23
27
  </template>
24
28
  </form-table>
25
29
  <!-- 新增修改 -->
@@ -36,22 +40,42 @@
36
40
  :open="empoweropen"
37
41
  :body-style="{ paddingBottom: '80px' }"
38
42
  :footer-style="{ textAlign: 'right' }"
39
- @close="()=>{empoweropen=false}"
43
+ @close="
44
+ () => {
45
+ empoweropen = false
46
+ }
47
+ "
40
48
  :destroyOnClose="true"
41
49
  >
42
- <a-tree
50
+ <a-tree
43
51
  v-model:checkedKeys="checkedKeys"
44
52
  checkable
45
53
  :tree-data="roleMenutreeData"
46
54
  :checkStrictly="true"
47
55
  @check="onTreeCheck"
48
56
  >
49
- <template #title="{ title,type,btnName }">
57
+ <template #title="{ title, type, btnName }">
50
58
  {{ title }}
51
- <span v-if="type === 1" class="padding-left-20 text-font-11 text-color-textgray">目录</span>
52
- <span v-if="type === 2" class="padding-left-20 text-font-11 text-color-primary">菜单</span>
53
- <span v-if="type === 3" class="padding-left-20 text-font-11 text-color-yellow">链接</span>
54
- <span v-if="type === 4" class="padding-left-20 text-font-11 text-color-lime">按钮</span>
59
+ <span
60
+ v-if="type === 1"
61
+ class="padding-left-20 text-font-11 text-color-textgray"
62
+ >目录</span
63
+ >
64
+ <span
65
+ v-if="type === 2"
66
+ class="padding-left-20 text-font-11 text-color-primary"
67
+ >菜单</span
68
+ >
69
+ <span
70
+ v-if="type === 3"
71
+ class="padding-left-20 text-font-11 text-color-yellow"
72
+ >链接</span
73
+ >
74
+ <span
75
+ v-if="type === 4"
76
+ class="padding-left-20 text-font-11 text-color-lime"
77
+ >按钮</span
78
+ >
55
79
  </template>
56
80
  </a-tree>
57
81
 
@@ -77,28 +101,28 @@ const menuinit = inject('menuinit')
77
101
  const permissionModulePath = ref('system:sysRole')
78
102
 
79
103
  const formState = ref({
80
- name: { label: '角色名称', value: '',defaultvalue:'', type: 'text' },
104
+ name: { label: '角色名称', value: '', defaultvalue: '', type: 'text' },
81
105
  })
82
106
  const columns = ref([
83
107
  {
84
108
  title: '角色名称',
85
109
  dataIndex: 'name',
86
- resizable: true,
110
+ resizable: true,
87
111
  },
88
112
  {
89
113
  title: '备注',
90
114
  dataIndex: 'remark',
91
- resizable: true,
115
+ resizable: true,
92
116
  },
93
117
  {
94
118
  title: '是否启用',
95
119
  key: 'isEnable',
96
- resizable: true,
120
+ resizable: true,
97
121
  },
98
122
  {
99
123
  title: '创建时间',
100
124
  dataIndex: 'createTime',
101
- resizable: true,
125
+ resizable: true,
102
126
  },
103
127
  {
104
128
  title: '操作',
@@ -155,7 +179,7 @@ const onTreeCheck = (checkedKeysValue, e) => {
155
179
  const empowerSave = () => {
156
180
  var data = {
157
181
  Id: recordId.value,
158
- Menus:checkedKeys.value.checked,
182
+ Menus: checkedKeys.value.checked,
159
183
  }
160
184
  sysRole.savePower(data).then(() => {
161
185
  const menu = menuStore()
@@ -165,13 +189,12 @@ const empowerSave = () => {
165
189
  menu.menus = res.data
166
190
  message.success('成功', 1, () => {
167
191
  if (menuinit) {
168
- refreshRoutes().then(() => {
169
- // 重新加载菜单树(如果你有菜单组件)
170
- menuinit()
171
- // 跳转到新菜单页面,或者刷新当前页
192
+ refreshRoutes().then(() => {
193
+ // 重新加载菜单树(如果你有菜单组件)
194
+ menuinit()
195
+ // 跳转到新菜单页面,或者刷新当前页
172
196
  // router.replace(router.currentRoute.value.fullPath)
173
- })
174
-
197
+ })
175
198
  }
176
199
  empoweropen.value = false
177
200
  })
@@ -1,215 +0,0 @@
1
- # ZAnt Admin 脚手架使用指南
2
-
3
- ## 简介
4
-
5
- ZAnt Admin 脚手架是一个基于 Vue 3 + Vite + Ant Design Vue 的前端管理系统快速生成工具。通过简单的命令行操作,您可以快速创建功能完整的管理系统项目。
6
-
7
- ## 快速开始
8
-
9
- ### 安装脚手架
10
-
11
- ```bash
12
- # 全局安装脚手架
13
- npm install -g .
14
-
15
- # 或者使用 npx 直接运行
16
- npx zant-admin create my-project
17
- ```
18
-
19
- ### 创建新项目
20
-
21
- #### 交互式创建(推荐)
22
-
23
- ```bash
24
- zant-admin create my-project --interactive
25
- ```
26
-
27
- 系统将引导您完成以下配置:
28
- - 项目描述
29
- - 作者名称
30
- - 项目模板选择
31
- - 功能特性选择
32
- - 是否跳过依赖安装
33
-
34
- #### 命令行参数创建
35
-
36
- ```bash
37
- # 基本创建
38
- zant-admin create my-project
39
-
40
- # 指定模板和描述
41
- zant-admin create my-project --template basic --description "基础管理系统"
42
-
43
- # 跳过依赖安装
44
- zant-admin create my-project --skip-install
45
-
46
- # 禁用交互式模式
47
- zant-admin create my-project --no-interactive
48
- ```
49
-
50
- ## 命令说明
51
-
52
- ### create 命令
53
-
54
- 创建一个新的 ZAnt Admin 项目。
55
-
56
- **参数:**
57
- - `<project-name>`: 项目名称(必需)
58
-
59
- **选项:**
60
- - `-t, --template <template>`: 项目模板 (default: "default")
61
- - `-d, --description <description>`: 项目描述
62
- - `-a, --author <author>`: 作者名称
63
- - `--skip-install`: 跳过依赖安装
64
- - `--no-interactive`: 禁用交互式模式
65
-
66
- ### list-templates 命令
67
-
68
- 显示可用的项目模板。
69
-
70
- ```bash
71
- zant-admin list-templates
72
- ```
73
-
74
- ## 项目模板
75
-
76
- ### 默认模板 (default)
77
- - 包含完整的管理系统功能
78
- - 预设了常用的页面和组件
79
- - 推荐用于大多数项目
80
-
81
- ### 基础模板 (basic)
82
- - 仅包含核心功能
83
- - 适合需要高度自定义的项目
84
- - 包含登录、首页、控制台等基础页面
85
-
86
- ### 完整模板 (full)
87
- - 包含所有示例页面和高级功能
88
- - 适合学习和参考
89
- - 包含用户管理、权限管理等完整示例
90
-
91
- ## 功能特性
92
-
93
- 在交互式模式下,您可以选择以下功能特性:
94
-
95
- ### 用户管理模块
96
- - 用户列表页面
97
- - 用户增删改查功能
98
- - 用户状态管理
99
-
100
- ### 权限管理模块
101
- - 角色管理
102
- - 权限配置
103
- - 访问控制
104
-
105
- ### 数据可视化图表
106
- - ECharts 集成
107
- - 数据统计图表
108
- - 仪表盘展示
109
-
110
- ### 文件上传功能
111
- - 图片上传
112
- - 文件管理
113
- - 上传进度显示
114
-
115
- ### 国际化支持
116
- - 多语言切换
117
- - 中英文支持
118
- - 语言包管理
119
-
120
- ## 项目结构
121
-
122
- 生成的项目具有以下结构:
123
-
124
- ```
125
- my-project/
126
- ├── public/ # 静态资源
127
- ├── src/
128
- │ ├── api/ # 接口请求
129
- │ ├── assets/ # 静态资源
130
- │ ├── components/ # 公共组件
131
- │ ├── config/ # 配置文件
132
- │ ├── locales/ # 国际化文件(如果选择)
133
- │ ├── router/ # 路由配置
134
- │ ├── stores/ # 状态管理
135
- │ ├── utils/ # 工具函数
136
- │ ├── views/ # 页面视图
137
- │ ├── App.vue # 根组件
138
- │ └── main.js # 入口文件
139
- ├── package.json # 项目配置
140
- ├── vite.config.js # Vite 配置
141
- └── README.md # 项目说明
142
- ```
143
-
144
- ## 开发指南
145
-
146
- ### 启动开发服务器
147
-
148
- ```bash
149
- cd my-project
150
- npm install # 如果跳过了依赖安装
151
- npm run dev
152
- ```
153
-
154
- ### 构建生产版本
155
-
156
- ```bash
157
- npm run build
158
- ```
159
-
160
- ### 代码检查
161
-
162
- ```bash
163
- npm run lint
164
- ```
165
-
166
- ### 代码格式化
167
-
168
- ```bash
169
- npm run format
170
- ```
171
-
172
- ## 技术栈
173
-
174
- - **Vue 3**: 渐进式 JavaScript 框架
175
- - **Vite**: 下一代前端构建工具
176
- - **Ant Design Vue**: 企业级 UI 设计语言
177
- - **Pinia**: Vue 状态管理
178
- - **Vue Router**: Vue 官方路由
179
- - **ESLint + Prettier**: 代码规范和格式化
180
-
181
- ## 系统要求
182
-
183
- - Node.js >= 16.0.0
184
- - npm >= 7.0.0
185
-
186
- ## 常见问题
187
-
188
- ### Q: 创建项目时出现权限错误?
189
- A: 请确保您有足够的权限在目标目录创建文件。
190
-
191
- ### Q: 依赖安装失败?
192
- A: 可以尝试使用 `--skip-install` 跳过安装,然后手动运行 `npm install`。
193
-
194
- ### Q: 如何自定义模板?
195
- A: 您可以修改 `templates/` 目录下的模板文件来自定义生成内容。
196
-
197
- ### Q: 支持 TypeScript 吗?
198
- A: 当前版本主要支持 JavaScript,TypeScript 支持将在后续版本中添加。
199
-
200
- ## 许可证
201
-
202
- MIT License
203
-
204
- ## 贡献
205
-
206
- 欢迎提交 Issue 和 Pull Request 来改进这个脚手架工具。
207
-
208
- ## 更新日志
209
-
210
- ### v1.0.0
211
- - 初始版本发布
212
- - 支持项目创建和模板选择
213
- - 交互式配置向导
214
- - 功能特性选择
215
- - 依赖自动安装
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file