zant-admin 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/README.en.md +36 -0
- package/README.md +248 -0
- package/SCAFFOLD_README.md +215 -0
- package/bin/cli.js +99 -0
- package/bin/generator.js +503 -0
- package/bin/prompts.js +159 -0
- package/bin/utils.js +134 -0
- package/package.json +74 -0
- package/public/logo.png +0 -0
- package/src/App.vue +16 -0
- package/src/api/methods/logError.js +8 -0
- package/src/api/methods/logOperation.js +8 -0
- package/src/api/methods/login.js +6 -0
- package/src/api/methods/quartz.js +36 -0
- package/src/api/methods/region.js +16 -0
- package/src/api/methods/sysAccount.js +30 -0
- package/src/api/methods/sysDict.js +29 -0
- package/src/api/methods/sysDictItem.js +26 -0
- package/src/api/methods/sysMenu.js +42 -0
- package/src/api/methods/sysRole.js +35 -0
- package/src/api/methods/sysUser.js +25 -0
- package/src/api/methods/system.js +16 -0
- package/src/api/request.js +225 -0
- package/src/assets/css/style.css +70 -0
- package/src/assets/css/zcui.css +340 -0
- package/src/assets/imgs/loginbackground.svg +69 -0
- package/src/assets/imgs/logo.png +0 -0
- package/src/assets/imgs/md/1.png +0 -0
- package/src/assets/imgs/md/10.png +0 -0
- package/src/assets/imgs/md/11.png +0 -0
- package/src/assets/imgs/md/2.png +0 -0
- package/src/assets/imgs/md/3.png +0 -0
- package/src/assets/imgs/md/4.png +0 -0
- package/src/assets/imgs/md/5.png +0 -0
- package/src/assets/imgs/md/6.png +0 -0
- package/src/assets/imgs/md/7.png +0 -0
- package/src/assets/imgs/md/8.png +0 -0
- package/src/assets/imgs/md/9.png +0 -0
- package/src/components/FormTable.vue +875 -0
- package/src/components/IconPicker.vue +344 -0
- package/src/components/MainPage.vue +957 -0
- package/src/components/details/logErrorDetails.vue +58 -0
- package/src/components/details/logOperationDetails.vue +76 -0
- package/src/components/edit/QuartzEdit.vue +221 -0
- package/src/components/edit/SysAccountEdit.vue +178 -0
- package/src/components/edit/SysDictEdit.vue +114 -0
- package/src/components/edit/SysDictItemEdit.vue +134 -0
- package/src/components/edit/SysRoleEdit.vue +109 -0
- package/src/components/edit/sysMenuEdit.vue +305 -0
- package/src/config/index.js +74 -0
- package/src/directives/permission.js +45 -0
- package/src/main.js +38 -0
- package/src/router/index.js +270 -0
- package/src/stores/config.js +37 -0
- package/src/stores/dict.js +33 -0
- package/src/stores/menu.js +57 -0
- package/src/stores/user.js +21 -0
- package/src/utils/baseEcharts.js +661 -0
- package/src/utils/dictTemplate.js +26 -0
- package/src/utils/regionUtils.js +169 -0
- package/src/utils/useFormCRUD.js +60 -0
- package/src/views/baiscstatis/center.vue +463 -0
- package/src/views/baiscstatis/iframePage.vue +31 -0
- package/src/views/baiscstatis/notFound.vue +192 -0
- package/src/views/console.vue +771 -0
- package/src/views/demo/importexport.vue +123 -0
- package/src/views/demo/region.vue +240 -0
- package/src/views/demo/statistics.vue +195 -0
- package/src/views/home.vue +7 -0
- package/src/views/login.vue +272 -0
- package/src/views/operations/log/logError.vue +78 -0
- package/src/views/operations/log/logLogin.vue +66 -0
- package/src/views/operations/log/logOperation.vue +103 -0
- package/src/views/operations/log/logQuartz.vue +57 -0
- package/src/views/operations/quartz.vue +181 -0
- package/src/views/operations/serviceMonitoring.vue +134 -0
- package/src/views/system/sysAccount.vue +123 -0
- package/src/views/system/sysDict.vue +156 -0
- package/src/views/system/sysDictItem.vue +118 -0
- package/src/views/system/sysMenu.vue +223 -0
- package/src/views/system/sysRole.vue +184 -0
- package/templates/env.production +2 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form-table
|
|
3
|
+
:formState="formState"
|
|
4
|
+
:columns="columns"
|
|
5
|
+
modulePath="sysMenu"
|
|
6
|
+
pageAction="MenuTreeList"
|
|
7
|
+
:permissionModulePath="permissionModulePath"
|
|
8
|
+
method="get"
|
|
9
|
+
:page="false"
|
|
10
|
+
@update="edit"
|
|
11
|
+
@edit="edit"
|
|
12
|
+
ref="childRef"
|
|
13
|
+
>
|
|
14
|
+
<!-- 可以通过插槽自定义单元格 -->
|
|
15
|
+
<!-- <template #custom-title="{ record }">
|
|
16
|
+
{{record.type != 4 ? record.title : record.btnName}}
|
|
17
|
+
</template> -->
|
|
18
|
+
<template #custom-isEnable="{ record }">
|
|
19
|
+
<a-switch
|
|
20
|
+
v-model:checked="record.isEnable"
|
|
21
|
+
checked-children="是"
|
|
22
|
+
un-checked-children="否"
|
|
23
|
+
@change="handleSwitchIsEnableChange(record)"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
<template #custom-cache="{ record }">
|
|
27
|
+
<a-switch
|
|
28
|
+
v-if="record.type != 4"
|
|
29
|
+
v-model:checked="record.cache"
|
|
30
|
+
checked-children="是"
|
|
31
|
+
un-checked-children="否"
|
|
32
|
+
@change="handleSwitchCacheChange(record)"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|
|
35
|
+
<template #custom-isShowMenu="{ record }">
|
|
36
|
+
<a-switch
|
|
37
|
+
v-if="record.type != 4"
|
|
38
|
+
v-model:checked="record.isShowMenu"
|
|
39
|
+
checked-children="是"
|
|
40
|
+
un-checked-children="否"
|
|
41
|
+
@change="handleSwitchIsShowMenuChange(record)"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<template #custom-icon="{ record }">
|
|
47
|
+
<component v-if="record.icon && $icons[record.icon]" :is="$icons[record.icon]" />
|
|
48
|
+
<span v-else>{{ record.icon }}</span>
|
|
49
|
+
</template>
|
|
50
|
+
<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>
|
|
55
|
+
</template>
|
|
56
|
+
<template #custom-operation="{ record }">
|
|
57
|
+
<a-divider type="vertical" />
|
|
58
|
+
<a v-if="record.type == 1" @click="addSubmenu(record)">新增子菜单</a>
|
|
59
|
+
<a v-if="record.type == 2" @click="addSubtn(record)">新增按钮</a>
|
|
60
|
+
</template>
|
|
61
|
+
</form-table>
|
|
62
|
+
<!-- 新增修改 -->
|
|
63
|
+
<sysMenuEdit
|
|
64
|
+
:open="editopen"
|
|
65
|
+
@close="editopen = false"
|
|
66
|
+
@updateData="refreshData"
|
|
67
|
+
ref="editRef"
|
|
68
|
+
>
|
|
69
|
+
</sysMenuEdit>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<style></style>
|
|
73
|
+
|
|
74
|
+
<script setup>
|
|
75
|
+
import { ref, inject, getCurrentInstance } from 'vue'
|
|
76
|
+
import FormTable from '@/components/FormTable.vue'
|
|
77
|
+
import sysMenuEdit from '@/components/edit/sysMenuEdit.vue'
|
|
78
|
+
import sysMenu from '@/api/methods/sysMenu'
|
|
79
|
+
import { menuStore } from '@/stores/menu'
|
|
80
|
+
// 权限模块路径
|
|
81
|
+
const permissionModulePath = ref('system:sysRole')
|
|
82
|
+
// 获取当前实例,以便访问全局图标
|
|
83
|
+
const { proxy } = getCurrentInstance()
|
|
84
|
+
const $icons = proxy.$icons
|
|
85
|
+
// 注入父组件的方法
|
|
86
|
+
const menuinit = inject('menuinit')
|
|
87
|
+
const formState = ref({
|
|
88
|
+
name: { label: '菜单名', value: '', type: 'text' },
|
|
89
|
+
})
|
|
90
|
+
const columns = ref([
|
|
91
|
+
{
|
|
92
|
+
title: '菜单名',
|
|
93
|
+
dataIndex: 'title',
|
|
94
|
+
resizable: true,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
title: '图标',
|
|
98
|
+
key: 'icon',
|
|
99
|
+
resizable: true,
|
|
100
|
+
width: 50,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: '类型',
|
|
104
|
+
key: 'type',
|
|
105
|
+
resizable: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: '命名路由',
|
|
109
|
+
dataIndex: 'path',
|
|
110
|
+
resizable: true,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
title: '权限标识',
|
|
114
|
+
dataIndex: 'perms',
|
|
115
|
+
resizable: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: '排序',
|
|
119
|
+
dataIndex: 'sort',
|
|
120
|
+
resizable: true,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
title: '是否启用',
|
|
124
|
+
key: 'isEnable',
|
|
125
|
+
resizable: true,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: '显示系统菜单栏',
|
|
129
|
+
key: 'isShowMenu',
|
|
130
|
+
resizable: 'true',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: '是否缓存',
|
|
134
|
+
key: 'cache',
|
|
135
|
+
resizable: true,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
title: '创建时间',
|
|
139
|
+
dataIndex: 'createTime',
|
|
140
|
+
resizable: true,
|
|
141
|
+
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: '操作',
|
|
145
|
+
key: 'operation',
|
|
146
|
+
fixed: 'right',
|
|
147
|
+
width: 200,
|
|
148
|
+
},
|
|
149
|
+
])
|
|
150
|
+
const childRef = ref(null)
|
|
151
|
+
|
|
152
|
+
//编辑
|
|
153
|
+
const editopen = ref(false)
|
|
154
|
+
const editRef = ref(null)
|
|
155
|
+
const edit = record => {
|
|
156
|
+
editRef.value.getMenuTree()
|
|
157
|
+
editRef.value.init(record.id)
|
|
158
|
+
editopen.value = true
|
|
159
|
+
}
|
|
160
|
+
//新增子菜单
|
|
161
|
+
const addSubmenu = record => {
|
|
162
|
+
editRef.value.getMenuTree()
|
|
163
|
+
editRef.value.addSubmenu(record)
|
|
164
|
+
editopen.value = true
|
|
165
|
+
}
|
|
166
|
+
const addSubtn = record => {
|
|
167
|
+
editRef.value.getMenuTree()
|
|
168
|
+
editRef.value.addSubtn(record)
|
|
169
|
+
editopen.value = true
|
|
170
|
+
}
|
|
171
|
+
const refreshData = () => {
|
|
172
|
+
const menu = menuStore()
|
|
173
|
+
sysMenu.getRoutesMenu().then(res => {
|
|
174
|
+
menu.menus = res.data
|
|
175
|
+
if (menuinit) {
|
|
176
|
+
menuinit()
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
childRef.value.tableLoad()
|
|
180
|
+
}
|
|
181
|
+
//修改是否启用
|
|
182
|
+
const handleSwitchIsEnableChange = record => {
|
|
183
|
+
var data = {
|
|
184
|
+
id: record.id,
|
|
185
|
+
isEnabled: record.isEnable,
|
|
186
|
+
}
|
|
187
|
+
sysMenu.updateIsEnabled(data).then(() => {
|
|
188
|
+
childRef.value.tableLoad()
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
//修改是否缓存
|
|
192
|
+
const handleSwitchCacheChange = record => {
|
|
193
|
+
var data = {
|
|
194
|
+
id: record.id,
|
|
195
|
+
cache: record.cache,
|
|
196
|
+
}
|
|
197
|
+
sysMenu.updateCache(data).then(() => {
|
|
198
|
+
childRef.value.tableLoad()
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
//修改是否启用
|
|
202
|
+
const handleSwitchIsShowMenuChange = record => {
|
|
203
|
+
var data = {
|
|
204
|
+
id: record.id,
|
|
205
|
+
isShowMenu: record.isShowMenu,
|
|
206
|
+
}
|
|
207
|
+
sysMenu.updateIsShowMenu(data).then(() => {
|
|
208
|
+
childRef.value.tableLoad()
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
</script>
|
|
212
|
+
|
|
213
|
+
<style>
|
|
214
|
+
.slide-enter-active, .slide-leave-active {
|
|
215
|
+
transition: transform 0.5s;
|
|
216
|
+
}
|
|
217
|
+
.slide-enter {
|
|
218
|
+
transform: translateX(-100%);
|
|
219
|
+
}
|
|
220
|
+
.slide-leave-to {
|
|
221
|
+
transform: translateX(-100%);
|
|
222
|
+
}
|
|
223
|
+
</style>
|
|
@@ -0,0 +1,184 @@
|
|
|
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 @click="empower(record)" v-permission="permissionModulePath+':empower'">关联菜单</a>
|
|
23
|
+
</template>
|
|
24
|
+
</form-table>
|
|
25
|
+
<!-- 新增修改 -->
|
|
26
|
+
<SysRoleEdit
|
|
27
|
+
:open="editopen"
|
|
28
|
+
@close="editopen = false"
|
|
29
|
+
@updateData="refreshData"
|
|
30
|
+
ref="editRef"
|
|
31
|
+
>
|
|
32
|
+
</SysRoleEdit>
|
|
33
|
+
<a-drawer
|
|
34
|
+
title="关联菜单"
|
|
35
|
+
:width="540"
|
|
36
|
+
:open="empoweropen"
|
|
37
|
+
:body-style="{ paddingBottom: '80px' }"
|
|
38
|
+
:footer-style="{ textAlign: 'right' }"
|
|
39
|
+
@close="()=>{empoweropen=false}"
|
|
40
|
+
:destroyOnClose="true"
|
|
41
|
+
>
|
|
42
|
+
<a-tree
|
|
43
|
+
v-model:checkedKeys="checkedKeys"
|
|
44
|
+
checkable
|
|
45
|
+
:tree-data="roleMenutreeData"
|
|
46
|
+
:checkStrictly="true"
|
|
47
|
+
@check="onTreeCheck"
|
|
48
|
+
>
|
|
49
|
+
<template #title="{ title,type,btnName }">
|
|
50
|
+
{{ 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>
|
|
55
|
+
</template>
|
|
56
|
+
</a-tree>
|
|
57
|
+
|
|
58
|
+
<template #extra>
|
|
59
|
+
<a-space>
|
|
60
|
+
<a-button type="primary" @click="empowerSave">保存</a-button>
|
|
61
|
+
</a-space>
|
|
62
|
+
</template>
|
|
63
|
+
</a-drawer>
|
|
64
|
+
</template>
|
|
65
|
+
<script setup>
|
|
66
|
+
import { ref, inject } from 'vue'
|
|
67
|
+
import FormTable from '@/components/FormTable.vue'
|
|
68
|
+
import SysRoleEdit from '@/components/edit/SysRoleEdit.vue'
|
|
69
|
+
import sysRole from '@/api/methods/sysRole'
|
|
70
|
+
import { message } from 'ant-design-vue'
|
|
71
|
+
import { menuStore } from '@/stores/menu'
|
|
72
|
+
import sysMenu from '@/api/methods/sysMenu'
|
|
73
|
+
import { refreshRoutes } from '@/router'
|
|
74
|
+
// 注入父组件的方法
|
|
75
|
+
const menuinit = inject('menuinit')
|
|
76
|
+
// 权限模块路径
|
|
77
|
+
const permissionModulePath = ref('system:sysRole')
|
|
78
|
+
|
|
79
|
+
const formState = ref({
|
|
80
|
+
name: { label: '角色名称', value: '',defaultvalue:'', type: 'text' },
|
|
81
|
+
})
|
|
82
|
+
const columns = ref([
|
|
83
|
+
{
|
|
84
|
+
title: '角色名称',
|
|
85
|
+
dataIndex: 'name',
|
|
86
|
+
resizable: true,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: '备注',
|
|
90
|
+
dataIndex: 'remark',
|
|
91
|
+
resizable: true,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: '是否启用',
|
|
95
|
+
key: 'isEnable',
|
|
96
|
+
resizable: true,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: '创建时间',
|
|
100
|
+
dataIndex: 'createTime',
|
|
101
|
+
resizable: true,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: '操作',
|
|
105
|
+
key: 'operation',
|
|
106
|
+
fixed: 'right',
|
|
107
|
+
width: 200,
|
|
108
|
+
},
|
|
109
|
+
])
|
|
110
|
+
const childRef = ref(null)
|
|
111
|
+
|
|
112
|
+
//编辑
|
|
113
|
+
const editopen = ref(false)
|
|
114
|
+
const editRef = ref(null)
|
|
115
|
+
const edit = record => {
|
|
116
|
+
editRef.value.init(record.id)
|
|
117
|
+
editopen.value = true
|
|
118
|
+
}
|
|
119
|
+
const refreshData = () => {
|
|
120
|
+
childRef.value.tableLoad()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//修改是否启用
|
|
124
|
+
const handleSwitchChange = record => {
|
|
125
|
+
var data = {
|
|
126
|
+
id: record.id,
|
|
127
|
+
isEnabled: record.isEnable,
|
|
128
|
+
}
|
|
129
|
+
sysRole.updateIsEnabled(data).then(() => {
|
|
130
|
+
childRef.value.tableLoad()
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const empoweropen = ref(false)
|
|
135
|
+
const roleMenutreeData = ref([])
|
|
136
|
+
const halfCheckedKeys = ref([])
|
|
137
|
+
const checkedKeys = ref([])
|
|
138
|
+
const recordId = ref(0)
|
|
139
|
+
//关联菜单
|
|
140
|
+
const empower = record => {
|
|
141
|
+
recordId.value = record.id
|
|
142
|
+
sysRole.getRoleMenu({ roleId: record.id }).then(res => {
|
|
143
|
+
roleMenutreeData.value = res.data.output
|
|
144
|
+
checkedKeys.value = res.data.checkedKeys
|
|
145
|
+
empoweropen.value = true
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
//处理Tree组件的check事件,获取半选状态的父节点
|
|
150
|
+
const onTreeCheck = (checkedKeysValue, e) => {
|
|
151
|
+
checkedKeys.value = checkedKeysValue
|
|
152
|
+
halfCheckedKeys.value = e.halfCheckedKeys || []
|
|
153
|
+
}
|
|
154
|
+
//关联菜单保存
|
|
155
|
+
const empowerSave = () => {
|
|
156
|
+
var data = {
|
|
157
|
+
Id: recordId.value,
|
|
158
|
+
Menus:checkedKeys.value.checked,
|
|
159
|
+
}
|
|
160
|
+
sysRole.savePower(data).then(() => {
|
|
161
|
+
const menu = menuStore()
|
|
162
|
+
sysMenu
|
|
163
|
+
.getRoutesMenu()
|
|
164
|
+
.then(res => {
|
|
165
|
+
menu.menus = res.data
|
|
166
|
+
message.success('成功', 1, () => {
|
|
167
|
+
if (menuinit) {
|
|
168
|
+
refreshRoutes().then(() => {
|
|
169
|
+
// 重新加载菜单树(如果你有菜单组件)
|
|
170
|
+
menuinit()
|
|
171
|
+
// 跳转到新菜单页面,或者刷新当前页
|
|
172
|
+
// router.replace(router.currentRoute.value.fullPath)
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
empoweropen.value = false
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
.catch()
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<style></style>
|