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,27 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '登录日志'
|
|
4
|
+
this.icon = 'log'
|
|
5
|
+
this.name = 'admin_log_login'
|
|
6
|
+
this.path = '/admin/log/login'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_get`]
|
|
10
|
+
this.buttons = {
|
|
11
|
+
export: {
|
|
12
|
+
text: '导出',
|
|
13
|
+
type: 'text',
|
|
14
|
+
icon: 'export',
|
|
15
|
+
code: `${this.name}_export`,
|
|
16
|
+
permissions: [`${this.name}export_post`]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
})()
|
|
20
|
+
|
|
21
|
+
/** 路由信息 */
|
|
22
|
+
export const route = {
|
|
23
|
+
page,
|
|
24
|
+
component: () => import(/* webpackChunkName: "admin.log" */ './index')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default page
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form ref="form" v-bind="form" v-on="on">
|
|
3
|
+
<el-row :gutter="50">
|
|
4
|
+
<el-col :span="20" :offset="2">
|
|
5
|
+
<el-form-item label="父节点">
|
|
6
|
+
<el-input v-model="parent.path" disabled />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
</el-row>
|
|
10
|
+
<el-row :gutter="50">
|
|
11
|
+
<el-col :span="10" :offset="2">
|
|
12
|
+
<el-form-item label="菜单名称:" prop="name">
|
|
13
|
+
<el-input v-model="form.model.name" />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</el-col>
|
|
16
|
+
<el-col :span="10">
|
|
17
|
+
<el-form-item label="链接:" prop="url">
|
|
18
|
+
<el-input v-model="form.model.url" />
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
</el-row>
|
|
22
|
+
<el-row :gutter="50">
|
|
23
|
+
<el-col :span="10" :offset="2">
|
|
24
|
+
<el-form-item label="图标:" prop="icon">
|
|
25
|
+
<nm-icon-picker v-model="form.model.icon" />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
</el-col>
|
|
28
|
+
<el-col :span="10">
|
|
29
|
+
<el-form-item label="图标颜色:" prop="iconColor">
|
|
30
|
+
<nm-color-picker v-model="form.model.iconColor" />
|
|
31
|
+
</el-form-item>
|
|
32
|
+
</el-col>
|
|
33
|
+
</el-row>
|
|
34
|
+
<el-row :gutter="50">
|
|
35
|
+
<el-col :span="10" :offset="2">
|
|
36
|
+
<el-form-item label="打开方式:" prop="target">
|
|
37
|
+
<nm-enum-select v-model="form.model.target" module-code="admin" enum-name="MenuTarget" />
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</el-col>
|
|
40
|
+
</el-row>
|
|
41
|
+
<div v-show="dialogTarget">
|
|
42
|
+
<el-row :gutter="50">
|
|
43
|
+
<el-col :span="10" :offset="2">
|
|
44
|
+
<el-form-item label="宽度:" prop="dialogWidth">
|
|
45
|
+
<el-input v-model="form.model.dialogWidth" placeholder="默认 60%" />
|
|
46
|
+
</el-form-item>
|
|
47
|
+
</el-col>
|
|
48
|
+
<el-col :span="10">
|
|
49
|
+
<el-form-item label="高度:" prop="dialogHeight">
|
|
50
|
+
<el-input v-model="form.model.dialogHeight" placeholder="默认 70%" />
|
|
51
|
+
</el-form-item>
|
|
52
|
+
</el-col>
|
|
53
|
+
</el-row>
|
|
54
|
+
<el-row :gutter="50">
|
|
55
|
+
<el-col :span="10" :offset="2">
|
|
56
|
+
<el-form-item label="可全屏:" prop="dialogFullscreen">
|
|
57
|
+
<el-switch v-model="form.model.dialogFullscreen" />
|
|
58
|
+
</el-form-item>
|
|
59
|
+
</el-col>
|
|
60
|
+
</el-row>
|
|
61
|
+
</div>
|
|
62
|
+
<el-row :gutter="50">
|
|
63
|
+
<el-col :span="10" :offset="2">
|
|
64
|
+
<el-form-item label="排序:" prop="sort">
|
|
65
|
+
<el-input v-model="form.model.sort" />
|
|
66
|
+
</el-form-item>
|
|
67
|
+
</el-col>
|
|
68
|
+
<el-col :span="10">
|
|
69
|
+
<el-form-item label="显示:" prop="show">
|
|
70
|
+
<el-switch v-model="form.model.show" />
|
|
71
|
+
</el-form-item>
|
|
72
|
+
</el-col>
|
|
73
|
+
</el-row>
|
|
74
|
+
<el-row :gutter="50">
|
|
75
|
+
<el-col :span="20" :offset="2">
|
|
76
|
+
<el-form-item label="备注:" prop="remarks">
|
|
77
|
+
<el-input v-model="form.model.remarks" type="textarea" :rows="2" placeholder="请输入内容"></el-input>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
</el-col>
|
|
80
|
+
</el-row>
|
|
81
|
+
</nm-form>
|
|
82
|
+
</template>
|
|
83
|
+
<script>
|
|
84
|
+
import mixins from '../mixins'
|
|
85
|
+
export default {
|
|
86
|
+
mixins: [mixins],
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
route: '',
|
|
90
|
+
form: {
|
|
91
|
+
model: {
|
|
92
|
+
type: 2
|
|
93
|
+
},
|
|
94
|
+
rules: {
|
|
95
|
+
url: [{ type: 'url', message: '请输入正确的链接格式' }]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
dialogTarget() {
|
|
102
|
+
return this.form.model.target === 2
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {
|
|
4
|
+
form: {
|
|
5
|
+
noLoading: true,
|
|
6
|
+
action: $api.admin.menu.add,
|
|
7
|
+
model: {
|
|
8
|
+
// 所属模块
|
|
9
|
+
moduleCode: '',
|
|
10
|
+
// 父节点ID
|
|
11
|
+
parentId: '',
|
|
12
|
+
// 类型
|
|
13
|
+
type: 0,
|
|
14
|
+
// 名称
|
|
15
|
+
name: '',
|
|
16
|
+
// 路由名称
|
|
17
|
+
routeName: '',
|
|
18
|
+
// 路由参数
|
|
19
|
+
routeParams: '',
|
|
20
|
+
// 路由参数
|
|
21
|
+
routeQuery: '',
|
|
22
|
+
// 图标
|
|
23
|
+
icon: '',
|
|
24
|
+
// 图标颜色
|
|
25
|
+
iconColor: '',
|
|
26
|
+
// url链接
|
|
27
|
+
url: '',
|
|
28
|
+
// 是否显示
|
|
29
|
+
show: true,
|
|
30
|
+
// 链接打开目标
|
|
31
|
+
target: 0,
|
|
32
|
+
// 对话框宽度
|
|
33
|
+
dialogWidth: '',
|
|
34
|
+
// 对话框高度
|
|
35
|
+
dialogHeight: '',
|
|
36
|
+
// 对话框可全屏
|
|
37
|
+
dialogFullscreen: true,
|
|
38
|
+
// 排序
|
|
39
|
+
sort: 0,
|
|
40
|
+
// 备注
|
|
41
|
+
remarks: ''
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
name: [{ required: true, message: '请输入菜单名称' }]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
on: {
|
|
48
|
+
success: this.onSuccess,
|
|
49
|
+
error: this.onError,
|
|
50
|
+
'validate-error': this.onValidateError
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
props: ['parent', 'sort'],
|
|
55
|
+
methods: {
|
|
56
|
+
submit() {
|
|
57
|
+
if (this.submitBefore) {
|
|
58
|
+
this.submitBefore()
|
|
59
|
+
}
|
|
60
|
+
this.$refs.form.submit()
|
|
61
|
+
},
|
|
62
|
+
reset() {
|
|
63
|
+
this.$nextTick(() => {
|
|
64
|
+
this.$refs.form.reset()
|
|
65
|
+
this.setProps()
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
setProps() {
|
|
69
|
+
this.form.model.parentId = this.parent.id
|
|
70
|
+
this.form.model.sort = this.sort
|
|
71
|
+
},
|
|
72
|
+
onSuccess(id) {
|
|
73
|
+
this.form.model.id = id
|
|
74
|
+
this.$emit('success', { id, label: this.form.model.name, item: Object.assign({}, this.form.model) })
|
|
75
|
+
},
|
|
76
|
+
onError() {
|
|
77
|
+
this.$emit('error')
|
|
78
|
+
},
|
|
79
|
+
onValidateError() {
|
|
80
|
+
this.$emit('validate-error')
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form ref="form" v-bind="form" v-on="on">
|
|
3
|
+
<el-row :gutter="50">
|
|
4
|
+
<el-col :span="10" :offset="2">
|
|
5
|
+
<el-form-item label="父节点">
|
|
6
|
+
<el-input v-model="parent.path" disabled />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
<el-col :span="10">
|
|
10
|
+
<el-form-item label="菜单名称:" prop="name">
|
|
11
|
+
<el-input v-model="form.model.name" />
|
|
12
|
+
</el-form-item>
|
|
13
|
+
</el-col>
|
|
14
|
+
</el-row>
|
|
15
|
+
<el-row :gutter="50">
|
|
16
|
+
<el-col :span="10" :offset="2">
|
|
17
|
+
<el-form-item label="图标:" prop="icon">
|
|
18
|
+
<nm-icon-picker v-model="form.model.icon" />
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
<el-col :span="10">
|
|
22
|
+
<el-form-item label="图标颜色:" prop="iconColor">
|
|
23
|
+
<nm-color-picker v-model="form.model.iconColor" />
|
|
24
|
+
</el-form-item>
|
|
25
|
+
</el-col>
|
|
26
|
+
</el-row>
|
|
27
|
+
<el-row :gutter="50">
|
|
28
|
+
<el-col :span="10" :offset="2">
|
|
29
|
+
<el-form-item label="排序:" prop="sort">
|
|
30
|
+
<el-input v-model="form.model.sort" />
|
|
31
|
+
</el-form-item>
|
|
32
|
+
</el-col>
|
|
33
|
+
<el-col :span="10">
|
|
34
|
+
<el-form-item label="显示:" prop="show">
|
|
35
|
+
<el-switch v-model="form.model.show" />
|
|
36
|
+
</el-form-item>
|
|
37
|
+
</el-col>
|
|
38
|
+
</el-row>
|
|
39
|
+
<el-row :gutter="50">
|
|
40
|
+
<el-col :span="20" :offset="2">
|
|
41
|
+
<el-form-item label="备注:" prop="remarks">
|
|
42
|
+
<el-input v-model="form.model.remarks" type="textarea" :rows="2" placeholder="请输入内容"></el-input>
|
|
43
|
+
</el-form-item>
|
|
44
|
+
</el-col>
|
|
45
|
+
</el-row>
|
|
46
|
+
</nm-form>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import mixins from '../mixins'
|
|
50
|
+
export default {
|
|
51
|
+
mixins: [mixins]
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form ref="form" v-bind="form" v-on="on">
|
|
3
|
+
<el-row :gutter="50">
|
|
4
|
+
<el-col :span="20" :offset="2">
|
|
5
|
+
<el-form-item label="父节点">
|
|
6
|
+
<el-input v-model="parent.path" disabled />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
</el-row>
|
|
10
|
+
<el-row :gutter="50">
|
|
11
|
+
<el-col :span="10" :offset="2">
|
|
12
|
+
<el-form-item label="所属模块:" prop="moduleCode">
|
|
13
|
+
<nm-module-select v-model="form.model.moduleCode" />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</el-col>
|
|
16
|
+
<el-col :span="10">
|
|
17
|
+
<el-form-item label="选择页面:" prop="route">
|
|
18
|
+
<el-select v-model="form.model.routeName" placeholder="请选择" @change="onPageChange">
|
|
19
|
+
<el-option v-for="p in pages" :key="p.code" :label="p.name" :value="p.code">
|
|
20
|
+
<span>{{ p.name }}__{{ p.code }}</span>
|
|
21
|
+
</el-option>
|
|
22
|
+
</el-select>
|
|
23
|
+
</el-form-item>
|
|
24
|
+
</el-col>
|
|
25
|
+
</el-row>
|
|
26
|
+
<el-row :gutter="50">
|
|
27
|
+
<el-col :span="10" :offset="2">
|
|
28
|
+
<el-form-item label="菜单名称:" prop="name">
|
|
29
|
+
<el-input v-model="form.model.name" />
|
|
30
|
+
</el-form-item>
|
|
31
|
+
</el-col>
|
|
32
|
+
<el-col :span="10">
|
|
33
|
+
<el-form-item label="路由名称:" prop="routeName">
|
|
34
|
+
<el-input v-model="form.model.routeName" disabled />
|
|
35
|
+
</el-form-item>
|
|
36
|
+
</el-col>
|
|
37
|
+
</el-row>
|
|
38
|
+
<el-row :gutter="50">
|
|
39
|
+
<el-col :span="10" :offset="2">
|
|
40
|
+
<el-form-item label="路由参数:" prop="routeParams">
|
|
41
|
+
<el-input v-model="form.model.routeParams" type="textarea" :rows="2" placeholder="params"></el-input>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</el-col>
|
|
44
|
+
<el-col :span="10">
|
|
45
|
+
<el-form-item label="路由参数:" prop="routeQuery">
|
|
46
|
+
<el-input v-model="form.model.routeQuery" type="textarea" :rows="2" placeholder="query"></el-input>
|
|
47
|
+
</el-form-item>
|
|
48
|
+
</el-col>
|
|
49
|
+
</el-row>
|
|
50
|
+
<el-row :gutter="50">
|
|
51
|
+
<el-col :span="10" :offset="2">
|
|
52
|
+
<el-form-item label="图标:" prop="icon">
|
|
53
|
+
<nm-icon-picker v-model="form.model.icon" />
|
|
54
|
+
</el-form-item>
|
|
55
|
+
</el-col>
|
|
56
|
+
<el-col :span="10">
|
|
57
|
+
<el-form-item label="图标颜色:" prop="iconColor">
|
|
58
|
+
<nm-color-picker v-model="form.model.iconColor" />
|
|
59
|
+
</el-form-item>
|
|
60
|
+
</el-col>
|
|
61
|
+
</el-row>
|
|
62
|
+
<el-row :gutter="50">
|
|
63
|
+
<el-col :span="10" :offset="2">
|
|
64
|
+
<el-form-item label="排序:" prop="sort">
|
|
65
|
+
<el-input v-model="form.model.sort" />
|
|
66
|
+
</el-form-item>
|
|
67
|
+
</el-col>
|
|
68
|
+
<el-col :span="10">
|
|
69
|
+
<el-form-item label="显示:" prop="show">
|
|
70
|
+
<el-switch v-model="form.model.show" />
|
|
71
|
+
</el-form-item>
|
|
72
|
+
</el-col>
|
|
73
|
+
</el-row>
|
|
74
|
+
<el-row :gutter="50">
|
|
75
|
+
<el-col :span="20" :offset="2">
|
|
76
|
+
<el-form-item label="备注:" prop="remarks">
|
|
77
|
+
<el-input v-model="form.model.remarks" type="textarea" :rows="2" placeholder="请输入内容"></el-input>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
</el-col>
|
|
80
|
+
</el-row>
|
|
81
|
+
</nm-form>
|
|
82
|
+
</template>
|
|
83
|
+
<script>
|
|
84
|
+
import { mapState } from 'vuex'
|
|
85
|
+
import mixins from '../mixins'
|
|
86
|
+
export default {
|
|
87
|
+
mixins: [mixins],
|
|
88
|
+
data() {
|
|
89
|
+
return {
|
|
90
|
+
form: {
|
|
91
|
+
model: {
|
|
92
|
+
type: 1
|
|
93
|
+
},
|
|
94
|
+
rules: {
|
|
95
|
+
moduleCode: [{ required: true, message: '请选择模块' }],
|
|
96
|
+
routeName: [{ required: true, message: '请选择路由名称' }]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
computed: {
|
|
102
|
+
...mapState('app/page', { allPages: s => s.pages }),
|
|
103
|
+
pages() {
|
|
104
|
+
if (!this.form.model.moduleCode) return []
|
|
105
|
+
return this.allPages.filter(m => m.moduleCode.toLowerCase() === this.form.model.moduleCode.toLowerCase())
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
onPageChange(val) {
|
|
110
|
+
for (var i = 0; i < this.pages.length; i++) {
|
|
111
|
+
let page = this.pages[i]
|
|
112
|
+
if (page.code === val) {
|
|
113
|
+
this.form.model.name = page.name
|
|
114
|
+
this.form.model.routeName = page.code
|
|
115
|
+
this.form.model.icon = page.icon
|
|
116
|
+
break
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-dialog v-bind="dialog" @open="onOpen" :visible.sync="visible_">
|
|
3
|
+
<el-tabs class="nm-dialog-tabs" v-model="tab" type="card" @tab-click="setProps">
|
|
4
|
+
<el-tab-pane name="node">
|
|
5
|
+
<span slot="label"> <nm-icon name="node" />节点 </span>
|
|
6
|
+
<node-menu ref="node" :parent="parent" :sort="sort" v-on="on" />
|
|
7
|
+
</el-tab-pane>
|
|
8
|
+
<el-tab-pane name="route">
|
|
9
|
+
<span slot="label"> <nm-icon name="link" />路由菜单 </span>
|
|
10
|
+
<route-menu ref="route" :parent="parent" :sort="sort" v-on="on" />
|
|
11
|
+
</el-tab-pane>
|
|
12
|
+
<el-tab-pane name="link">
|
|
13
|
+
<span slot="label"> <nm-icon name="transmit" />链接菜单 </span>
|
|
14
|
+
<link-menu ref="link" :parent="parent" :sort="sort" v-on="on" />
|
|
15
|
+
</el-tab-pane>
|
|
16
|
+
</el-tabs>
|
|
17
|
+
<template v-slot:footer>
|
|
18
|
+
<nm-button text="添加" type="success" @click="onSubmit" />
|
|
19
|
+
<nm-button text="重置" type="info" @click="onReset" />
|
|
20
|
+
</template>
|
|
21
|
+
</nm-dialog>
|
|
22
|
+
</template>
|
|
23
|
+
<script>
|
|
24
|
+
import { mixins } from 'netmodular-ui'
|
|
25
|
+
import NodeMenu from './components/node'
|
|
26
|
+
import RouteMenu from './components/route'
|
|
27
|
+
import LinkMenu from './components/link'
|
|
28
|
+
export default {
|
|
29
|
+
mixins: [mixins.dialog],
|
|
30
|
+
components: { NodeMenu, RouteMenu, LinkMenu },
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
tab: 'node',
|
|
34
|
+
dialog: {
|
|
35
|
+
footer: true,
|
|
36
|
+
title: '添加菜单',
|
|
37
|
+
icon: 'add',
|
|
38
|
+
width: '60%',
|
|
39
|
+
class: 'nm-admin-menu-add',
|
|
40
|
+
loading: false,
|
|
41
|
+
draggable: true
|
|
42
|
+
},
|
|
43
|
+
on: {
|
|
44
|
+
success: this.onSuccess,
|
|
45
|
+
error: this.onError,
|
|
46
|
+
'validate-error': this.onValidateError
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
props: ['parent', 'sort'],
|
|
51
|
+
methods: {
|
|
52
|
+
onSubmit() {
|
|
53
|
+
this.dialog.loading = true
|
|
54
|
+
this.$refs[this.tab].submit()
|
|
55
|
+
},
|
|
56
|
+
onReset() {
|
|
57
|
+
this.$nextTick(() => {
|
|
58
|
+
this.$refs[this.tab].reset()
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
setProps() {
|
|
62
|
+
this.$refs[this.tab].setProps()
|
|
63
|
+
},
|
|
64
|
+
onSuccess(model) {
|
|
65
|
+
this.dialog.loading = false
|
|
66
|
+
this.$emit('success', model)
|
|
67
|
+
},
|
|
68
|
+
onError() {
|
|
69
|
+
this.dialog.loading = false
|
|
70
|
+
},
|
|
71
|
+
onValidateError() {
|
|
72
|
+
this.dialog.loading = false
|
|
73
|
+
},
|
|
74
|
+
onOpen() {
|
|
75
|
+
this.onReset()
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
<style lang="scss">
|
|
81
|
+
.nm-admin-menu-add {
|
|
82
|
+
.el-scrollbar__view {
|
|
83
|
+
padding: 0 !important;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form ref="form" v-bind="form" v-on="on">
|
|
3
|
+
<el-row :gutter="50">
|
|
4
|
+
<el-col :span="20" :offset="2">
|
|
5
|
+
<el-form-item label="父节点">
|
|
6
|
+
<el-input v-model="parent.path" disabled />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</el-col>
|
|
9
|
+
</el-row>
|
|
10
|
+
<el-row :gutter="50">
|
|
11
|
+
<el-col :span="10" :offset="2">
|
|
12
|
+
<el-form-item label="菜单名称:" prop="name">
|
|
13
|
+
<el-input v-model="form.model.name" />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
</el-col>
|
|
16
|
+
<el-col :span="10">
|
|
17
|
+
<el-form-item label="链接:" prop="url">
|
|
18
|
+
<el-input v-model="form.model.url" />
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
</el-row>
|
|
22
|
+
<el-row :gutter="50">
|
|
23
|
+
<el-col :span="10" :offset="2">
|
|
24
|
+
<el-form-item label="图标:" prop="icon">
|
|
25
|
+
<nm-icon-picker v-model="form.model.icon" />
|
|
26
|
+
</el-form-item>
|
|
27
|
+
</el-col>
|
|
28
|
+
<el-col :span="10">
|
|
29
|
+
<el-form-item label="图标颜色:" prop="iconColor">
|
|
30
|
+
<nm-color-picker v-model="form.model.iconColor" />
|
|
31
|
+
</el-form-item>
|
|
32
|
+
</el-col>
|
|
33
|
+
</el-row>
|
|
34
|
+
<el-row :gutter="50">
|
|
35
|
+
<el-col :span="10" :offset="2">
|
|
36
|
+
<el-form-item label="打开方式:" prop="target">
|
|
37
|
+
<nm-enum-select v-model="form.model.target" module-code="admin" enum-name="MenuTarget" />
|
|
38
|
+
</el-form-item>
|
|
39
|
+
</el-col>
|
|
40
|
+
</el-row>
|
|
41
|
+
<div v-show="dialogTarget">
|
|
42
|
+
<el-row :gutter="50">
|
|
43
|
+
<el-col :span="10" :offset="2">
|
|
44
|
+
<el-form-item label="宽度:" prop="dialogWidth">
|
|
45
|
+
<el-input v-model="form.model.dialogWidth" placeholder="默认 60%" />
|
|
46
|
+
</el-form-item>
|
|
47
|
+
</el-col>
|
|
48
|
+
<el-col :span="10">
|
|
49
|
+
<el-form-item label="高度:" prop="dialogHeight">
|
|
50
|
+
<el-input v-model="form.model.dialogHeight" placeholder="默认 70%" />
|
|
51
|
+
</el-form-item>
|
|
52
|
+
</el-col>
|
|
53
|
+
</el-row>
|
|
54
|
+
<el-row :gutter="50">
|
|
55
|
+
<el-col :span="10" :offset="2">
|
|
56
|
+
<el-form-item label="可全屏:" prop="dialogFullscreen">
|
|
57
|
+
<el-switch v-model="form.model.dialogFullscreen" />
|
|
58
|
+
</el-form-item>
|
|
59
|
+
</el-col>
|
|
60
|
+
</el-row>
|
|
61
|
+
</div>
|
|
62
|
+
<el-row :gutter="50">
|
|
63
|
+
<el-col :span="10" :offset="2">
|
|
64
|
+
<el-form-item label="排序:" prop="sort">
|
|
65
|
+
<el-input v-model="form.model.sort" />
|
|
66
|
+
</el-form-item>
|
|
67
|
+
</el-col>
|
|
68
|
+
<el-col :span="10">
|
|
69
|
+
<el-form-item label="显示:" prop="show">
|
|
70
|
+
<el-switch v-model="form.model.show" />
|
|
71
|
+
</el-form-item>
|
|
72
|
+
</el-col>
|
|
73
|
+
</el-row>
|
|
74
|
+
<el-row :gutter="50">
|
|
75
|
+
<el-col :span="20" :offset="2">
|
|
76
|
+
<el-form-item label="备注:" prop="remarks">
|
|
77
|
+
<el-input v-model="form.model.remarks" type="textarea" :rows="2" placeholder="请输入内容"></el-input>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
</el-col>
|
|
80
|
+
</el-row>
|
|
81
|
+
</nm-form>
|
|
82
|
+
</template>
|
|
83
|
+
<script>
|
|
84
|
+
import mixins from '../mixins'
|
|
85
|
+
export default {
|
|
86
|
+
mixins: [mixins],
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
route: '',
|
|
90
|
+
form: {
|
|
91
|
+
model: {
|
|
92
|
+
type: 2
|
|
93
|
+
},
|
|
94
|
+
rules: {
|
|
95
|
+
url: [{ type: 'url', message: '请输入正确的链接格式' }]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
computed: {
|
|
101
|
+
dialogTarget() {
|
|
102
|
+
return this.form.model.target === 2
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data() {
|
|
3
|
+
return {
|
|
4
|
+
form: {
|
|
5
|
+
noLoading: true,
|
|
6
|
+
action: $api.admin.menu.update,
|
|
7
|
+
model: {
|
|
8
|
+
// 所属模块
|
|
9
|
+
moduleCode: '',
|
|
10
|
+
// 父节点ID
|
|
11
|
+
parentId: '',
|
|
12
|
+
// 类型
|
|
13
|
+
type: 0,
|
|
14
|
+
// 名称
|
|
15
|
+
name: '',
|
|
16
|
+
// 路由名称
|
|
17
|
+
routeName: '',
|
|
18
|
+
// 路由参数
|
|
19
|
+
routeParams: '',
|
|
20
|
+
// 路由参数
|
|
21
|
+
routeQuery: '',
|
|
22
|
+
// 图标
|
|
23
|
+
icon: '',
|
|
24
|
+
// 图标颜色
|
|
25
|
+
iconColor: '',
|
|
26
|
+
// url链接
|
|
27
|
+
url: '',
|
|
28
|
+
// 是否显示
|
|
29
|
+
show: true,
|
|
30
|
+
// 链接打开目标
|
|
31
|
+
target: 0,
|
|
32
|
+
// 对话框宽度
|
|
33
|
+
dialogWidth: '',
|
|
34
|
+
// 对话框高度
|
|
35
|
+
dialogHeight: '',
|
|
36
|
+
// 可全屏
|
|
37
|
+
dialogFullscreen: true,
|
|
38
|
+
// 排序
|
|
39
|
+
sort: 0,
|
|
40
|
+
// 备注
|
|
41
|
+
remarks: ''
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
name: [{ required: true, message: '请输入菜单名称' }]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
on: {
|
|
48
|
+
success: this.onSuccess,
|
|
49
|
+
error: this.onError,
|
|
50
|
+
'validate-error': this.onValidateError
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
props: ['model', 'parent'],
|
|
55
|
+
methods: {
|
|
56
|
+
submit() {
|
|
57
|
+
if (this.submitBefore) {
|
|
58
|
+
this.submitBefore()
|
|
59
|
+
}
|
|
60
|
+
this.$refs.form.submit()
|
|
61
|
+
},
|
|
62
|
+
reset() {
|
|
63
|
+
this.$nextTick(() => {
|
|
64
|
+
this.$refs.form.reset()
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
setModel() {
|
|
68
|
+
this.form.model = this.model
|
|
69
|
+
},
|
|
70
|
+
onSuccess() {
|
|
71
|
+
this.$emit('success', { id: this.form.model.id, label: this.form.model.name, item: Object.assign({}, this.form.model) })
|
|
72
|
+
},
|
|
73
|
+
onError() {
|
|
74
|
+
this.$emit('error')
|
|
75
|
+
},
|
|
76
|
+
onValidateError() {
|
|
77
|
+
this.$emit('validate-error')
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|