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
@@ -1,207 +1,207 @@
1
- <template>
2
- <form-table
3
- :formState="formState"
4
- :columns="columns"
5
- modulePath="sysRole"
6
- :permissionModulePath="permissionModulePath"
7
- @edit="edit"
8
- @empower="empower"
9
- ref="childRef"
10
- >
11
- <!-- 可以通过插槽自定义单元格 -->
12
- <template #custom-isEnable="{ record }">
13
- <a-switch
14
- v-model:checked="record.isEnable"
15
- checked-children="是"
16
- un-checked-children="否"
17
- @change="handleSwitchChange(record)"
18
- />
19
- </template>
20
- <template #custom-operation="{ record }">
21
- <a-divider type="vertical" />
22
- <a
23
- @click="empower(record)"
24
- v-permission="permissionModulePath + ':empower'"
25
- >关联菜单</a
26
- >
27
- </template>
28
- </form-table>
29
- <!-- 新增修改 -->
30
- <SysRoleEdit
31
- :open="editopen"
32
- @close="editopen = false"
33
- @updateData="refreshData"
34
- ref="editRef"
35
- >
36
- </SysRoleEdit>
37
- <a-drawer
38
- title="关联菜单"
39
- :width="540"
40
- :open="empoweropen"
41
- :body-style="{ paddingBottom: '80px' }"
42
- :footer-style="{ textAlign: 'right' }"
43
- @close="
44
- () => {
45
- empoweropen = false
46
- }
47
- "
48
- :destroyOnClose="true"
49
- >
50
- <a-tree
51
- v-model:checkedKeys="checkedKeys"
52
- checkable
53
- :tree-data="roleMenutreeData"
54
- :checkStrictly="true"
55
- @check="onTreeCheck"
56
- >
57
- <template #title="{ title, type, btnName }">
58
- {{ title }}
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
- >
79
- </template>
80
- </a-tree>
81
-
82
- <template #extra>
83
- <a-space>
84
- <a-button type="primary" @click="empowerSave">保存</a-button>
85
- </a-space>
86
- </template>
87
- </a-drawer>
88
- </template>
89
- <script setup>
90
- import { ref, inject } from 'vue'
91
- import FormTable from '@/components/FormTable.vue'
92
- import SysRoleEdit from '@/components/edit/SysRoleEdit.vue'
93
- import sysRole from '@/api/methods/sysRole'
94
- import { message } from 'ant-design-vue'
95
- import { menuStore } from '@/stores/menu'
96
- import sysMenu from '@/api/methods/sysMenu'
97
- import { refreshRoutes } from '@/router'
98
- // 注入父组件的方法
99
- const menuinit = inject('menuinit')
100
- // 权限模块路径
101
- const permissionModulePath = ref('system:sysRole')
102
-
103
- const formState = ref({
104
- name: { label: '角色名称', value: '', defaultvalue: '', type: 'text' },
105
- })
106
- const columns = ref([
107
- {
108
- title: '角色名称',
109
- dataIndex: 'name',
110
- resizable: true,
111
- },
112
- {
113
- title: '备注',
114
- dataIndex: 'remark',
115
- resizable: true,
116
- },
117
- {
118
- title: '是否启用',
119
- key: 'isEnable',
120
- resizable: true,
121
- },
122
- {
123
- title: '创建时间',
124
- dataIndex: 'createTime',
125
- resizable: true,
126
- },
127
- {
128
- title: '操作',
129
- key: 'operation',
130
- fixed: 'right',
131
- width: 200,
132
- },
133
- ])
134
- const childRef = ref(null)
135
-
136
- //编辑
137
- const editopen = ref(false)
138
- const editRef = ref(null)
139
- const edit = record => {
140
- editRef.value.init(record.id)
141
- editopen.value = true
142
- }
143
- const refreshData = () => {
144
- childRef.value.tableLoad()
145
- }
146
-
147
- //修改是否启用
148
- const handleSwitchChange = record => {
149
- var data = {
150
- id: record.id,
151
- isEnabled: record.isEnable,
152
- }
153
- sysRole.updateIsEnabled(data).then(() => {
154
- childRef.value.tableLoad()
155
- })
156
- }
157
-
158
- const empoweropen = ref(false)
159
- const roleMenutreeData = ref([])
160
- const halfCheckedKeys = ref([])
161
- const checkedKeys = ref([])
162
- const recordId = ref(0)
163
- //关联菜单
164
- const empower = record => {
165
- recordId.value = record.id
166
- sysRole.getRoleMenu({ roleId: record.id }).then(res => {
167
- roleMenutreeData.value = res.data.output
168
- checkedKeys.value = res.data.checkedKeys
169
- empoweropen.value = true
170
- })
171
- }
172
-
173
- //处理Tree组件的check事件,获取半选状态的父节点
174
- const onTreeCheck = (checkedKeysValue, e) => {
175
- checkedKeys.value = checkedKeysValue
176
- halfCheckedKeys.value = e.halfCheckedKeys || []
177
- }
178
- //关联菜单保存
179
- const empowerSave = () => {
180
- var data = {
181
- Id: recordId.value,
182
- Menus: checkedKeys.value.checked,
183
- }
184
- sysRole.savePower(data).then(() => {
185
- const menu = menuStore()
186
- sysMenu
187
- .getRoutesMenu()
188
- .then(res => {
189
- menu.menus = res.data
190
- message.success('成功', 1, () => {
191
- if (menuinit) {
192
- refreshRoutes().then(() => {
193
- // 重新加载菜单树(如果你有菜单组件)
194
- menuinit()
195
- // 跳转到新菜单页面,或者刷新当前页
196
- // router.replace(router.currentRoute.value.fullPath)
197
- })
198
- }
199
- empoweropen.value = false
200
- })
201
- })
202
- .catch()
203
- })
204
- }
205
- </script>
206
-
207
- <style></style>
1
+ <template>
2
+ <form-table
3
+ :formState="formState"
4
+ :columns="columns"
5
+ modulePath="sysRole"
6
+ :permissionModulePath="permissionModulePath"
7
+ @edit="edit"
8
+ @empower="empower"
9
+ ref="childRef"
10
+ >
11
+ <!-- 可以通过插槽自定义单元格 -->
12
+ <template #custom-isEnable="{ record }">
13
+ <a-switch
14
+ v-model:checked="record.isEnable"
15
+ checked-children="是"
16
+ un-checked-children="否"
17
+ @change="handleSwitchChange(record)"
18
+ />
19
+ </template>
20
+ <template #custom-operation="{ record }">
21
+ <a-divider type="vertical" />
22
+ <a
23
+ @click="empower(record)"
24
+ v-permission="permissionModulePath + ':empower'"
25
+ >关联菜单</a
26
+ >
27
+ </template>
28
+ </form-table>
29
+ <!-- 新增修改 -->
30
+ <SysRoleEdit
31
+ :open="editopen"
32
+ @close="editopen = false"
33
+ @updateData="refreshData"
34
+ ref="editRef"
35
+ >
36
+ </SysRoleEdit>
37
+ <a-drawer
38
+ title="关联菜单"
39
+ :width="540"
40
+ :open="empoweropen"
41
+ :body-style="{ paddingBottom: '80px' }"
42
+ :footer-style="{ textAlign: 'right' }"
43
+ @close="
44
+ () => {
45
+ empoweropen = false
46
+ }
47
+ "
48
+ :destroyOnClose="true"
49
+ >
50
+ <a-tree
51
+ v-model:checkedKeys="checkedKeys"
52
+ checkable
53
+ :tree-data="roleMenutreeData"
54
+ :checkStrictly="true"
55
+ @check="onTreeCheck"
56
+ >
57
+ <template #title="{ title, type, btnName }">
58
+ {{ title }}
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
+ >
79
+ </template>
80
+ </a-tree>
81
+
82
+ <template #extra>
83
+ <a-space>
84
+ <a-button type="primary" @click="empowerSave">保存</a-button>
85
+ </a-space>
86
+ </template>
87
+ </a-drawer>
88
+ </template>
89
+ <script setup>
90
+ import { ref, inject } from 'vue'
91
+ import FormTable from '@/components/FormTable.vue'
92
+ import SysRoleEdit from '@/components/edit/SysRoleEdit.vue'
93
+ import sysRole from '@/api/methods/sysRole'
94
+ import { message } from 'ant-design-vue'
95
+ import { menuStore } from '@/stores/menu'
96
+ import sysMenu from '@/api/methods/sysMenu'
97
+ import { refreshRoutes } from '@/router'
98
+ // 注入父组件的方法
99
+ const menuinit = inject('menuinit')
100
+ // 权限模块路径
101
+ const permissionModulePath = ref('system:sysRole')
102
+
103
+ const formState = ref({
104
+ name: { label: '角色名称', value: '', defaultvalue: '', type: 'text' },
105
+ })
106
+ const columns = ref([
107
+ {
108
+ title: '角色名称',
109
+ dataIndex: 'name',
110
+ resizable: true,
111
+ },
112
+ {
113
+ title: '备注',
114
+ dataIndex: 'remark',
115
+ resizable: true,
116
+ },
117
+ {
118
+ title: '是否启用',
119
+ key: 'isEnable',
120
+ resizable: true,
121
+ },
122
+ {
123
+ title: '创建时间',
124
+ dataIndex: 'createTime',
125
+ resizable: true,
126
+ },
127
+ {
128
+ title: '操作',
129
+ key: 'operation',
130
+ fixed: 'right',
131
+ width: 200,
132
+ },
133
+ ])
134
+ const childRef = ref(null)
135
+
136
+ //编辑
137
+ const editopen = ref(false)
138
+ const editRef = ref(null)
139
+ const edit = record => {
140
+ editRef.value.init(record.id)
141
+ editopen.value = true
142
+ }
143
+ const refreshData = () => {
144
+ childRef.value.tableLoad()
145
+ }
146
+
147
+ //修改是否启用
148
+ const handleSwitchChange = record => {
149
+ var data = {
150
+ id: record.id,
151
+ isEnabled: record.isEnable,
152
+ }
153
+ sysRole.updateIsEnabled(data).then(() => {
154
+ childRef.value.tableLoad()
155
+ })
156
+ }
157
+
158
+ const empoweropen = ref(false)
159
+ const roleMenutreeData = ref([])
160
+ const halfCheckedKeys = ref([])
161
+ const checkedKeys = ref([])
162
+ const recordId = ref(0)
163
+ //关联菜单
164
+ const empower = record => {
165
+ recordId.value = record.id
166
+ sysRole.getRoleMenu({ roleId: record.id }).then(res => {
167
+ roleMenutreeData.value = res.data.output
168
+ checkedKeys.value = res.data.checkedKeys
169
+ empoweropen.value = true
170
+ })
171
+ }
172
+
173
+ //处理Tree组件的check事件,获取半选状态的父节点
174
+ const onTreeCheck = (checkedKeysValue, e) => {
175
+ checkedKeys.value = checkedKeysValue
176
+ halfCheckedKeys.value = e.halfCheckedKeys || []
177
+ }
178
+ //关联菜单保存
179
+ const empowerSave = () => {
180
+ var data = {
181
+ Id: recordId.value,
182
+ Menus: checkedKeys.value.checked,
183
+ }
184
+ sysRole.savePower(data).then(() => {
185
+ const menu = menuStore()
186
+ sysMenu
187
+ .getRoutesMenu()
188
+ .then(res => {
189
+ menu.menus = res.data
190
+ message.success('成功', 1, () => {
191
+ if (menuinit) {
192
+ refreshRoutes().then(() => {
193
+ // 重新加载菜单树(如果你有菜单组件)
194
+ menuinit()
195
+ // 跳转到新菜单页面,或者刷新当前页
196
+ // router.replace(router.currentRoute.value.fullPath)
197
+ })
198
+ }
199
+ empoweropen.value = false
200
+ })
201
+ })
202
+ .catch()
203
+ })
204
+ }
205
+ </script>
206
+
207
+ <style></style>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file