haiwei-module-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/package.json +54 -0
- package/src/api/components/account.js +58 -0
- package/src/api/components/auditInfo.js +30 -0
- package/src/api/components/auth.js +47 -0
- package/src/api/components/cache.js +16 -0
- package/src/api/components/config.js +34 -0
- package/src/api/components/file.js +41 -0
- package/src/api/components/log.js +22 -0
- package/src/api/components/menu.js +68 -0
- package/src/api/components/mime.js +10 -0
- package/src/api/components/module.js +18 -0
- package/src/api/components/permission.js +25 -0
- package/src/api/components/role.js +73 -0
- package/src/api/components/tool.js +29 -0
- package/src/api/index.js +13 -0
- package/src/components/config-admin/index.vue +47 -0
- package/src/components/enum-checkbox/index.vue +31 -0
- package/src/components/enum-radio/index.vue +31 -0
- package/src/components/enum-select/index.vue +31 -0
- package/src/components/file-download/index.vue +81 -0
- package/src/components/file-img/index.vue +55 -0
- package/src/components/file-upload/index.vue +140 -0
- package/src/components/file-upload-img/index.vue +263 -0
- package/src/components/index.js +10 -0
- package/src/components/login-mode-select/index.vue +11 -0
- package/src/components/module-select/index.vue +11 -0
- package/src/components/platform-select/index.vue +28 -0
- package/src/components/role-select/index.vue +11 -0
- package/src/components/upload-mixins.js +127 -0
- package/src/config/index.js +18 -0
- package/src/index.js +69 -0
- package/src/main.js +5 -0
- package/src/module.js +10 -0
- package/src/routes/index.js +3 -0
- package/src/store/index.js +4 -0
- package/src/views/account/components/save/index.vue +65 -0
- package/src/views/account/index/cols.js +50 -0
- package/src/views/account/index/index.vue +127 -0
- package/src/views/account/index/page.js +57 -0
- package/src/views/auditInfo/components/details/index.vue +64 -0
- package/src/views/auditInfo/index/cols.js +63 -0
- package/src/views/auditInfo/index/index.vue +118 -0
- package/src/views/auditInfo/index/page.js +34 -0
- package/src/views/button/permission-bind/index.vue +50 -0
- package/src/views/cache/index/cols.js +10 -0
- package/src/views/cache/index/index.vue +64 -0
- package/src/views/cache/index/page.js +29 -0
- package/src/views/config/index.vue +43 -0
- package/src/views/config/library/components/auth/index.vue +165 -0
- package/src/views/config/library/components/component/index.vue +149 -0
- package/src/views/config/library/components/path/index.vue +45 -0
- package/src/views/config/library/components/quartz/index.vue +66 -0
- package/src/views/config/library/components/system/index.vue +58 -0
- package/src/views/config/library/form-mixins.js +25 -0
- package/src/views/config/library/index.vue +76 -0
- package/src/views/config/module/index.vue +64 -0
- package/src/views/config/page.js +21 -0
- package/src/views/file/index/cols.js +53 -0
- package/src/views/file/index/index.vue +52 -0
- package/src/views/file/index/page.js +42 -0
- package/src/views/home/components/bottom/index.vue +217 -0
- package/src/views/home/components/top-left/index.vue +43 -0
- package/src/views/home/components/top-right/index.vue +148 -0
- package/src/views/home/index.vue +27 -0
- package/src/views/home/page.js +15 -0
- package/src/views/icon/index.vue +92 -0
- package/src/views/icon/page.js +15 -0
- package/src/views/log/login-log/cols.js +43 -0
- package/src/views/log/login-log/index.vue +86 -0
- package/src/views/log/login-log/page.js +27 -0
- package/src/views/menu/components/add/components/link/index.vue +106 -0
- package/src/views/menu/components/add/components/mixins.js +83 -0
- package/src/views/menu/components/add/components/node/index.vue +53 -0
- package/src/views/menu/components/add/components/route/index.vue +122 -0
- package/src/views/menu/components/add/index.vue +86 -0
- package/src/views/menu/components/edit/components/link/index.vue +106 -0
- package/src/views/menu/components/edit/components/mixins.js +80 -0
- package/src/views/menu/components/edit/components/node/index.vue +53 -0
- package/src/views/menu/components/edit/components/route/index.vue +122 -0
- package/src/views/menu/components/edit/index.vue +95 -0
- package/src/views/menu/components/tree/index.vue +153 -0
- package/src/views/menu/index/cols.js +46 -0
- package/src/views/menu/index/index.vue +175 -0
- package/src/views/menu/index/page.js +48 -0
- package/src/views/mime/components/save/index.vue +45 -0
- package/src/views/mime/index/cols.js +16 -0
- package/src/views/mime/index/index.vue +55 -0
- package/src/views/mime/index/page.js +42 -0
- package/src/views/module/components/page-list/index.vue +234 -0
- package/src/views/module/components/permission-list/cols.js +36 -0
- package/src/views/module/components/permission-list/index.vue +90 -0
- package/src/views/module/index/index.vue +226 -0
- package/src/views/module/index/page.js +21 -0
- package/src/views/role/components/menu-bind/index.vue +85 -0
- package/src/views/role/components/page-bind/index.vue +221 -0
- package/src/views/role/components/platform-bind/index.vue +105 -0
- package/src/views/role/components/save/index.vue +45 -0
- package/src/views/role/components/tree/index.vue +112 -0
- package/src/views/role/index/index.vue +67 -0
- package/src/views/role/index/page.js +64 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-list ref="list" v-bind="list">
|
|
4
|
+
<!--查询条件-->
|
|
5
|
+
<template v-slot:querybar>
|
|
6
|
+
<el-form-item label="账户编号:" prop="accountId">
|
|
7
|
+
<el-input v-model="list.model.accountId" clearable />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="模块:" prop="moduleCode">
|
|
10
|
+
<nm-module-select v-model="list.model.moduleCode" clearable />
|
|
11
|
+
</el-form-item>
|
|
12
|
+
<el-form-item label="控制器:" prop="controller">
|
|
13
|
+
<el-input v-model="list.model.controller" clearable />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="操作:" prop="action">
|
|
16
|
+
<el-input v-model="list.model.action" clearable />
|
|
17
|
+
</el-form-item>
|
|
18
|
+
<el-form-item label="访问来源:" prop="platform">
|
|
19
|
+
<nm-platform-select v-model="list.model.platform" clearable />
|
|
20
|
+
</el-form-item>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<template v-slot:header-toolbar>
|
|
24
|
+
<nm-date-range-picker size="mini" :start.sync="list.model.startDate" :end.sync="list.model.endDate" @change="refresh" />
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<template v-slot:col-moduleName="{ row }">
|
|
28
|
+
<span>{{ row.moduleName }}({{ row.area }})</span>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<template v-slot:col-controller="{ row }">
|
|
32
|
+
<span>{{ row.controllerDesc }}({{ row.controller }})</span>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<template v-slot:col-action="{ row }">
|
|
36
|
+
<span>{{ row.actionDesc }}({{ row.action }})</span>
|
|
37
|
+
</template>
|
|
38
|
+
<template v-slot:col-executionDuration="{ row }">
|
|
39
|
+
<span>{{ row.executionDuration }}ms</span>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<!--操作列-->
|
|
43
|
+
<template v-slot:col-operation="{ row }">
|
|
44
|
+
<nm-button v-bind="buttons.details" @click="details(row)" />
|
|
45
|
+
</template>
|
|
46
|
+
</nm-list>
|
|
47
|
+
|
|
48
|
+
<details-page :id="detailsPage.id" :visible.sync="detailsPage.visible" />
|
|
49
|
+
</nm-container>
|
|
50
|
+
</template>
|
|
51
|
+
<script>
|
|
52
|
+
import page from './page'
|
|
53
|
+
import cols from './cols'
|
|
54
|
+
import DetailsPage from '../components/details'
|
|
55
|
+
|
|
56
|
+
// 接口
|
|
57
|
+
const api = $api.admin.auditInfo
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
name: page.name,
|
|
61
|
+
components: { DetailsPage },
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
list: {
|
|
65
|
+
title: page.title,
|
|
66
|
+
action: api.query,
|
|
67
|
+
model: {
|
|
68
|
+
accountId: '',
|
|
69
|
+
moduleCode: '',
|
|
70
|
+
controller: '',
|
|
71
|
+
action: '',
|
|
72
|
+
platform: '',
|
|
73
|
+
startDate: null,
|
|
74
|
+
endDate: null
|
|
75
|
+
},
|
|
76
|
+
cols,
|
|
77
|
+
/**导出配置 */
|
|
78
|
+
exportOptions: {
|
|
79
|
+
/**启用导出按钮 */
|
|
80
|
+
enabled: true,
|
|
81
|
+
/**导出数据的方法 */
|
|
82
|
+
action: api.exportData,
|
|
83
|
+
/**启用高级配置 */
|
|
84
|
+
advanced: true,
|
|
85
|
+
/**导出按钮位置 */
|
|
86
|
+
btnLocation: 'querybar',
|
|
87
|
+
/**导出按钮权限编码 */
|
|
88
|
+
btnCode: page.buttons.export.code,
|
|
89
|
+
/**默认是否显示标题 */
|
|
90
|
+
showTitle: true,
|
|
91
|
+
/**默认是否显示版权信息 */
|
|
92
|
+
showCopyright: true,
|
|
93
|
+
/**默认是否显示列名 */
|
|
94
|
+
showColName: true,
|
|
95
|
+
/**默认是否显示导出日期 */
|
|
96
|
+
showExportDate: true,
|
|
97
|
+
/**默认是否显示导出人 */
|
|
98
|
+
showExportPeople: true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
detailsPage: {
|
|
102
|
+
visible: false,
|
|
103
|
+
id: 0
|
|
104
|
+
},
|
|
105
|
+
buttons: page.buttons
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
refresh() {
|
|
110
|
+
this.$refs.list.refresh()
|
|
111
|
+
},
|
|
112
|
+
details(row) {
|
|
113
|
+
this.detailsPage.id = row.id
|
|
114
|
+
this.detailsPage.visible = true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '审计日志'
|
|
4
|
+
this.icon = 'log'
|
|
5
|
+
this.name = 'admin_auditinfo'
|
|
6
|
+
this.path = '/admin/auditinfo'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`]
|
|
10
|
+
this.buttons = {
|
|
11
|
+
details: {
|
|
12
|
+
text: '详情',
|
|
13
|
+
type: 'text',
|
|
14
|
+
icon: 'detail',
|
|
15
|
+
code: `${this.name}_details`,
|
|
16
|
+
permissions: [`${this.name}_details_get`]
|
|
17
|
+
},
|
|
18
|
+
export: {
|
|
19
|
+
text: '导出',
|
|
20
|
+
type: 'text',
|
|
21
|
+
icon: 'export',
|
|
22
|
+
code: `${this.name}_export`,
|
|
23
|
+
permissions: [`${this.name}_export_post`]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
})()
|
|
27
|
+
|
|
28
|
+
/** 路由信息 */
|
|
29
|
+
export const route = {
|
|
30
|
+
page,
|
|
31
|
+
component: () => import(/* webpackChunkName: "admin.auditinfo" */ './index')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default page
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-dialog v-bind="dialog" :visible.sync="visible_" @open="onOpen">
|
|
3
|
+
<bind-page ref="bind" :query="query" :action="action" />
|
|
4
|
+
</nm-dialog>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import { mixins } from 'netmodular-ui'
|
|
8
|
+
import BindPage from '../../permission/components/bind'
|
|
9
|
+
|
|
10
|
+
// 接口
|
|
11
|
+
const api = $api.admin.button
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
mixins: [mixins.dialog],
|
|
15
|
+
components: { BindPage },
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
id_: ''
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
props: ['id', 'name'],
|
|
22
|
+
computed: {
|
|
23
|
+
dialog() {
|
|
24
|
+
return {
|
|
25
|
+
noScrollbar: true,
|
|
26
|
+
title: `权限绑定(${this.name})`,
|
|
27
|
+
icon: 'bind',
|
|
28
|
+
width: '70%',
|
|
29
|
+
height: '70%'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
query() {
|
|
35
|
+
return api.getPermissionList(this.id)
|
|
36
|
+
},
|
|
37
|
+
action(list) {
|
|
38
|
+
return api.bindPermission({ id: this.id, permissionList: list })
|
|
39
|
+
},
|
|
40
|
+
onOpen() {
|
|
41
|
+
if (this.id && this.id !== this.id_) {
|
|
42
|
+
this.$nextTick(() => {
|
|
43
|
+
this.$refs.bind.refresh()
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
this.id_ = this.id
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-list ref="list" v-bind="list">
|
|
4
|
+
<!--查询条件-->
|
|
5
|
+
<template v-slot:querybar>
|
|
6
|
+
<el-form-item label="选择模块:" prop="moduleCode">
|
|
7
|
+
<nm-module-select v-model="list.model.moduleCode" checked-first clearable @change="onModuleChange" />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<!--操作列-->
|
|
12
|
+
<template v-slot:col-operation="{ row }">
|
|
13
|
+
<nm-button v-bind="buttons.clear" @click="clear(row)" />
|
|
14
|
+
</template>
|
|
15
|
+
</nm-list>
|
|
16
|
+
</nm-container>
|
|
17
|
+
</template>
|
|
18
|
+
<script>
|
|
19
|
+
import { mixins } from 'netmodular-ui'
|
|
20
|
+
import page from './page'
|
|
21
|
+
import cols from './cols'
|
|
22
|
+
|
|
23
|
+
// 接口
|
|
24
|
+
const api = $api.admin.cache
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: page.name,
|
|
28
|
+
mixins: [mixins.list],
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
list: {
|
|
32
|
+
title: page.title,
|
|
33
|
+
cols,
|
|
34
|
+
action: api.query,
|
|
35
|
+
queryOnCreated: false,
|
|
36
|
+
model: {
|
|
37
|
+
moduleCode: ''
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
buttons: page.buttons
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
clear(row) {
|
|
45
|
+
this._delete(async () => {
|
|
46
|
+
this._openLoading('正在清除缓存,请稍后...')
|
|
47
|
+
api
|
|
48
|
+
.clear(row.name)
|
|
49
|
+
.then(() => {
|
|
50
|
+
this._closeLoading()
|
|
51
|
+
this._success('清除成功~')
|
|
52
|
+
})
|
|
53
|
+
.catch(() => {
|
|
54
|
+
this._closeLoading()
|
|
55
|
+
this._error('清除失败~')
|
|
56
|
+
})
|
|
57
|
+
}, `您确定要清除缓存《${row.desc}》吗?`).catch(() => {})
|
|
58
|
+
},
|
|
59
|
+
onModuleChange() {
|
|
60
|
+
this.$refs.list.refresh()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '缓存清理'
|
|
4
|
+
this.icon = 'redis'
|
|
5
|
+
this.name = 'admin_cache'
|
|
6
|
+
this.path = '/admin/cache'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`]
|
|
10
|
+
|
|
11
|
+
// 按钮
|
|
12
|
+
this.buttons = {
|
|
13
|
+
clear: {
|
|
14
|
+
text: '清除',
|
|
15
|
+
type: 'text',
|
|
16
|
+
icon: 'delete',
|
|
17
|
+
code: `${this.name}_clear`,
|
|
18
|
+
permissions: [`${this.name}_clear_delete`]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})()
|
|
22
|
+
|
|
23
|
+
/** 路由信息 */
|
|
24
|
+
export const route = {
|
|
25
|
+
page,
|
|
26
|
+
component: () => import(/* webpackChunkName: "admin.cache" */ './index')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default page
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-container>
|
|
3
|
+
<nm-tabs>
|
|
4
|
+
<el-tabs v-model="tab">
|
|
5
|
+
<el-tab-pane name="module" lazy>
|
|
6
|
+
<span slot="label"> <nm-icon name="app"></nm-icon>业务模块 </span>
|
|
7
|
+
<module-pane ref="module" />
|
|
8
|
+
</el-tab-pane>
|
|
9
|
+
<el-tab-pane name="library" lazy>
|
|
10
|
+
<span slot="label"> <nm-icon name="system"></nm-icon>基础类库 </span>
|
|
11
|
+
<library-pane ref="library" :descriptors="libraries" />
|
|
12
|
+
</el-tab-pane>
|
|
13
|
+
</el-tabs>
|
|
14
|
+
</nm-tabs>
|
|
15
|
+
</nm-container>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import page from './page'
|
|
19
|
+
import ModulePane from './module'
|
|
20
|
+
import LibraryPane from './library'
|
|
21
|
+
|
|
22
|
+
const { getDescriptors } = $api.admin.config
|
|
23
|
+
export default {
|
|
24
|
+
name: page.name,
|
|
25
|
+
components: { ModulePane, LibraryPane },
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
tab: 'module',
|
|
29
|
+
descriptors: []
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
libraries() {
|
|
34
|
+
return this.descriptors.filter(m => m.type === 0)
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
created() {
|
|
38
|
+
getDescriptors().then(data => {
|
|
39
|
+
this.descriptors = data
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form-page v-bind="form" @success="onSuccess">
|
|
3
|
+
<el-divider content-position="left">认证&授权</el-divider>
|
|
4
|
+
<el-row>
|
|
5
|
+
<el-col :span="5" :offset="1">
|
|
6
|
+
<el-form-item label="验证码:" prop="verifyCode">
|
|
7
|
+
<el-switch v-model="form.model.verifyCode" />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
</el-col>
|
|
10
|
+
<el-col :span="5">
|
|
11
|
+
<el-form-item label="权限验证:" prop="validate">
|
|
12
|
+
<el-switch v-model="form.model.validate" />
|
|
13
|
+
</el-form-item>
|
|
14
|
+
</el-col>
|
|
15
|
+
<el-col :span="5">
|
|
16
|
+
<el-form-item label="按钮验证:" prop="button">
|
|
17
|
+
<el-switch v-model="form.model.button" />
|
|
18
|
+
</el-form-item>
|
|
19
|
+
</el-col>
|
|
20
|
+
<el-col :span="5">
|
|
21
|
+
<el-form-item label="单账户登录:" prop="singleAccount">
|
|
22
|
+
<el-switch v-model="form.model.singleAccount" />
|
|
23
|
+
</el-form-item>
|
|
24
|
+
</el-col>
|
|
25
|
+
</el-row>
|
|
26
|
+
<el-row>
|
|
27
|
+
<el-col :span="5" :offset="1">
|
|
28
|
+
<el-form-item label="审计日志:" prop="auditing">
|
|
29
|
+
<el-switch v-model="form.model.auditing" />
|
|
30
|
+
</el-form-item>
|
|
31
|
+
</el-col>
|
|
32
|
+
</el-row>
|
|
33
|
+
<el-divider content-position="left">JWT参数</el-divider>
|
|
34
|
+
<el-row>
|
|
35
|
+
<el-col :span="10" :offset="1">
|
|
36
|
+
<el-form-item label="密钥(Key):" prop="jwt.key">
|
|
37
|
+
<el-input v-model="form.model.jwt.key" clearable />
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</el-col>
|
|
40
|
+
<el-col :span="10">
|
|
41
|
+
<el-form-item label="有效期(Expires):" prop="jwt.expires">
|
|
42
|
+
<el-input v-model.number="form.model.jwt.expires">
|
|
43
|
+
<template slot="append">分钟</template>
|
|
44
|
+
</el-input>
|
|
45
|
+
</el-form-item>
|
|
46
|
+
</el-col>
|
|
47
|
+
</el-row>
|
|
48
|
+
<el-row>
|
|
49
|
+
<el-col :span="10" :offset="1">
|
|
50
|
+
<el-form-item label="发行人(Issuer):" prop="jwt.issuer">
|
|
51
|
+
<el-input v-model="form.model.jwt.issuer" clearable />
|
|
52
|
+
</el-form-item>
|
|
53
|
+
</el-col>
|
|
54
|
+
<el-col :span="10">
|
|
55
|
+
<el-form-item label="消费者(Audience):" prop="jwt.audience">
|
|
56
|
+
<el-input v-model="form.model.jwt.audience" clearable />
|
|
57
|
+
</el-form-item>
|
|
58
|
+
</el-col>
|
|
59
|
+
</el-row>
|
|
60
|
+
<el-divider content-position="left">登录方式</el-divider>
|
|
61
|
+
<el-row>
|
|
62
|
+
<el-col :span="5" :offset="1">
|
|
63
|
+
<el-form-item label="用户名:">
|
|
64
|
+
<el-switch v-model="form.model.loginMode.userName" />
|
|
65
|
+
</el-form-item>
|
|
66
|
+
</el-col>
|
|
67
|
+
<el-col :span="5">
|
|
68
|
+
<el-form-item label="邮箱:">
|
|
69
|
+
<el-switch v-model="form.model.loginMode.email" />
|
|
70
|
+
</el-form-item>
|
|
71
|
+
</el-col>
|
|
72
|
+
<el-col :span="5">
|
|
73
|
+
<el-form-item label="用户名或邮箱:">
|
|
74
|
+
<el-switch v-model="form.model.loginMode.userNameOrEmail" />
|
|
75
|
+
</el-form-item>
|
|
76
|
+
</el-col>
|
|
77
|
+
<el-col :span="5">
|
|
78
|
+
<el-form-item label="手机号:">
|
|
79
|
+
<el-switch v-model="form.model.loginMode.phone" />
|
|
80
|
+
</el-form-item>
|
|
81
|
+
</el-col>
|
|
82
|
+
</el-row>
|
|
83
|
+
<el-row>
|
|
84
|
+
<el-col :span="5" :offset="1">
|
|
85
|
+
<el-form-item label="微信扫码登录:">
|
|
86
|
+
<el-switch v-model="form.model.loginMode.weChatScanCode" disabled />
|
|
87
|
+
</el-form-item>
|
|
88
|
+
</el-col>
|
|
89
|
+
<el-col :span="5">
|
|
90
|
+
<el-form-item label="QQ:">
|
|
91
|
+
<el-switch v-model="form.model.loginMode.qq" disabled />
|
|
92
|
+
</el-form-item>
|
|
93
|
+
</el-col>
|
|
94
|
+
<el-col :span="5">
|
|
95
|
+
<el-form-item label="GitHub:">
|
|
96
|
+
<el-switch v-model="form.model.loginMode.gitHub" disabled />
|
|
97
|
+
</el-form-item>
|
|
98
|
+
</el-col>
|
|
99
|
+
</el-row>
|
|
100
|
+
</nm-form-page>
|
|
101
|
+
</template>
|
|
102
|
+
<script>
|
|
103
|
+
import mixins from '../../form-mixins'
|
|
104
|
+
export default {
|
|
105
|
+
mixins: [mixins],
|
|
106
|
+
data() {
|
|
107
|
+
return {
|
|
108
|
+
code: 'Auth',
|
|
109
|
+
form: {
|
|
110
|
+
labelWidth: '200px',
|
|
111
|
+
model: {
|
|
112
|
+
verifyCode: false,
|
|
113
|
+
validate: false,
|
|
114
|
+
button: false,
|
|
115
|
+
singleAccount: false,
|
|
116
|
+
auditing: false,
|
|
117
|
+
jwt: {
|
|
118
|
+
key: '',
|
|
119
|
+
issuer: '',
|
|
120
|
+
audience: '',
|
|
121
|
+
expires: 120,
|
|
122
|
+
refreshTokenExpires: 7
|
|
123
|
+
},
|
|
124
|
+
loginMode: {
|
|
125
|
+
userName: true,
|
|
126
|
+
email: false,
|
|
127
|
+
userNameOrEmail: false,
|
|
128
|
+
phone: false,
|
|
129
|
+
weChatScanCode: false,
|
|
130
|
+
qq: false,
|
|
131
|
+
gitHub: false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
rules: {
|
|
135
|
+
'jwt.key': [
|
|
136
|
+
{ required: true, message: '请填写JWT的key' },
|
|
137
|
+
{
|
|
138
|
+
type: 'string',
|
|
139
|
+
len: 16,
|
|
140
|
+
message: '密钥长度必须为16位'
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
'jwt.expires': [
|
|
144
|
+
{ required: true, message: '请填写令牌有效期' },
|
|
145
|
+
{ type: 'number', min: 1, message: '有效期不能小于1分钟' }
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
methods: {
|
|
152
|
+
onSuccess() {
|
|
153
|
+
this.setUIConfig({
|
|
154
|
+
permission: {
|
|
155
|
+
validate: this.form.model.validate,
|
|
156
|
+
button: this.form.model.button
|
|
157
|
+
},
|
|
158
|
+
component: {
|
|
159
|
+
login: { verifyCode: this.form.model.verifyCode }
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
</script>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form-page v-bind="form" @success="onSuccess">
|
|
3
|
+
<el-divider content-position="left">登录页</el-divider>
|
|
4
|
+
<el-row>
|
|
5
|
+
<el-col :span="10" :offset="1">
|
|
6
|
+
<el-form-item label="默认账户类型:" prop="defaultAccountType">
|
|
7
|
+
<el-select v-model="form.model.login.defaultAccountType">
|
|
8
|
+
<el-option label="管理员" :value="0"></el-option>
|
|
9
|
+
<el-option label="个人" :value="1"></el-option>
|
|
10
|
+
<el-option label="企业" :value="2"></el-option>
|
|
11
|
+
</el-select>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
</el-col>
|
|
14
|
+
<el-col :span="10">
|
|
15
|
+
<el-form-item label="页类型:" prop="pageType">
|
|
16
|
+
<el-select v-model="form.model.login.pageType">
|
|
17
|
+
<el-option v-for="item in pageTypeOptions" :key="item" :label="item" :value="item"></el-option>
|
|
18
|
+
</el-select>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
</el-row>
|
|
22
|
+
<el-divider content-position="left">工具栏</el-divider>
|
|
23
|
+
<el-row>
|
|
24
|
+
<el-col :span="5" :offset="1">
|
|
25
|
+
<el-form-item label="全屏控制:" prop="fullscreen">
|
|
26
|
+
<el-switch v-model="form.model.toolbar.fullscreen" />
|
|
27
|
+
</el-form-item>
|
|
28
|
+
</el-col>
|
|
29
|
+
<el-col :span="5">
|
|
30
|
+
<el-form-item label="皮肤设置:" prop="skin">
|
|
31
|
+
<el-switch v-model="form.model.toolbar.skin" />
|
|
32
|
+
</el-form-item>
|
|
33
|
+
</el-col>
|
|
34
|
+
<el-col :span="5">
|
|
35
|
+
<el-form-item label="退出按钮:" prop="logout">
|
|
36
|
+
<el-switch v-model="form.model.toolbar.logout" />
|
|
37
|
+
</el-form-item>
|
|
38
|
+
</el-col>
|
|
39
|
+
<el-col :span="5">
|
|
40
|
+
<el-form-item label="用户信息:" prop="userInfo">
|
|
41
|
+
<el-switch v-model="form.model.toolbar.userInfo" />
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</el-col>
|
|
44
|
+
</el-row>
|
|
45
|
+
<el-divider content-position="left">菜单</el-divider>
|
|
46
|
+
<el-row>
|
|
47
|
+
<el-col :span="10" :offset="1">
|
|
48
|
+
<el-form-item label="保持一个子菜单的展开:" prop="menu.uniqueOpened">
|
|
49
|
+
<el-switch v-model="form.model.menu.uniqueOpened" />
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</el-col>
|
|
52
|
+
</el-row>
|
|
53
|
+
<el-divider content-position="left">对话框</el-divider>
|
|
54
|
+
<el-row>
|
|
55
|
+
<el-col :span="10" :offset="1">
|
|
56
|
+
<el-form-item label="可点击模态框关闭:" prop="dialog.closeOnClickModal">
|
|
57
|
+
<el-switch v-model="form.model.dialog.closeOnClickModal" />
|
|
58
|
+
</el-form-item>
|
|
59
|
+
</el-col>
|
|
60
|
+
<el-col :span="10">
|
|
61
|
+
<el-form-item label="默认可拖拽:" prop="dialog.draggable">
|
|
62
|
+
<el-switch v-model="form.model.dialog.draggable" />
|
|
63
|
+
</el-form-item>
|
|
64
|
+
</el-col>
|
|
65
|
+
</el-row>
|
|
66
|
+
<el-divider content-position="left">列表页</el-divider>
|
|
67
|
+
<el-row>
|
|
68
|
+
<el-col :span="10" :offset="1">
|
|
69
|
+
<el-form-item label="序号表头名称:" prop="list.serialNumberName">
|
|
70
|
+
<el-input v-model="form.model.list.serialNumberName" placeholder="默认 #" />
|
|
71
|
+
</el-form-item>
|
|
72
|
+
</el-col>
|
|
73
|
+
</el-row>
|
|
74
|
+
<el-divider content-position="left">标签导航</el-divider>
|
|
75
|
+
<el-row>
|
|
76
|
+
<el-col :span="10" :offset="1">
|
|
77
|
+
<el-form-item label="启用:" prop="tabnav.enabled">
|
|
78
|
+
<el-switch v-model="form.model.tabnav.enabled" />
|
|
79
|
+
</el-form-item>
|
|
80
|
+
</el-col>
|
|
81
|
+
<el-col :span="10">
|
|
82
|
+
<el-form-item label="显示图标:" prop="tabnav.showIcon">
|
|
83
|
+
<el-switch v-model="form.model.tabnav.showIcon" />
|
|
84
|
+
</el-form-item>
|
|
85
|
+
</el-col>
|
|
86
|
+
</el-row>
|
|
87
|
+
<el-row>
|
|
88
|
+
<el-col :span="10" :offset="1">
|
|
89
|
+
<el-form-item label="显示首页" prop="tabnav.showHome">
|
|
90
|
+
<el-switch v-model="form.model.tabnav.showHome" />
|
|
91
|
+
</el-form-item>
|
|
92
|
+
</el-col>
|
|
93
|
+
<el-col :span="10">
|
|
94
|
+
<el-form-item label="首页地址:" prop="tabnav.homeUrl">
|
|
95
|
+
<el-input v-model="form.model.tabnav.homeUrl" placeholder="路由的完整地址" />
|
|
96
|
+
</el-form-item>
|
|
97
|
+
</el-col>
|
|
98
|
+
</el-row>
|
|
99
|
+
<el-row>
|
|
100
|
+
<el-col :span="10" :offset="1">
|
|
101
|
+
<el-form-item label="最大页面数量:" prop="tabnav.maxOpenCount">
|
|
102
|
+
<el-input v-model.number="form.model.tabnav.maxOpenCount" placeholder="默认 20" />
|
|
103
|
+
</el-form-item>
|
|
104
|
+
</el-col>
|
|
105
|
+
</el-row>
|
|
106
|
+
<el-divider content-position="left">自定义CSS</el-divider>
|
|
107
|
+
<el-row>
|
|
108
|
+
<el-col :span="22" :offset="1">
|
|
109
|
+
<el-form-item labelWidth="0" prop="customCss">
|
|
110
|
+
<el-input type="textarea" :rows="5" placeholder="如果需要重新某个组件的样式,可以在此处添加覆盖的CSS" v-model="form.model.customCss"></el-input>
|
|
111
|
+
</el-form-item>
|
|
112
|
+
</el-col>
|
|
113
|
+
</el-row>
|
|
114
|
+
</nm-form-page>
|
|
115
|
+
</template>
|
|
116
|
+
<script>
|
|
117
|
+
import { mapState } from 'vuex'
|
|
118
|
+
import mixins from '../../form-mixins'
|
|
119
|
+
export default {
|
|
120
|
+
mixins: [mixins],
|
|
121
|
+
data() {
|
|
122
|
+
return {
|
|
123
|
+
code: 'Component',
|
|
124
|
+
form: {
|
|
125
|
+
labelWidth: '200px',
|
|
126
|
+
model: {
|
|
127
|
+
login: { defaultAccountType: 0, pageType: null },
|
|
128
|
+
menu: { uniqueOpened: true },
|
|
129
|
+
dialog: { closeOnClickModal: false, draggable: false },
|
|
130
|
+
list: { serialNumberName: null },
|
|
131
|
+
tabnav: { enabled: true, showHome: true, homeUrl: null, showIcon: true, maxOpenCount: 20 },
|
|
132
|
+
toolbar: { fullscreen: true, skin: true, logout: true, userInfo: true },
|
|
133
|
+
customCss: null
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
computed: {
|
|
139
|
+
...mapState('app/config', { pageTypeOptions: s => s.component.login.pageTypeOptions })
|
|
140
|
+
},
|
|
141
|
+
methods: {
|
|
142
|
+
onSuccess() {
|
|
143
|
+
this.setUIConfig({
|
|
144
|
+
component: this.form.model
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
</script>
|