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,127 @@
|
|
|
1
|
+
import { mapState } from 'vuex'
|
|
2
|
+
export default {
|
|
3
|
+
data() {
|
|
4
|
+
return {
|
|
5
|
+
action: $api.admin.file.getUploadUrl(),
|
|
6
|
+
loading: false
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
props: {
|
|
10
|
+
/**模块编码 */
|
|
11
|
+
module: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
/**分组 */
|
|
16
|
+
group: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
/**访问方式,0、私有 1、公开 2、授权 */
|
|
21
|
+
accessMode: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
},
|
|
25
|
+
/**授权模式下关联的账户ID,使用英文","分割 */
|
|
26
|
+
accounts: String,
|
|
27
|
+
/** 上传前函数 */
|
|
28
|
+
beforeUpload: Function,
|
|
29
|
+
/** 接受上传的文件类型 */
|
|
30
|
+
accept: String,
|
|
31
|
+
/** 文件最大大小 */
|
|
32
|
+
maxSize: String,
|
|
33
|
+
/** 是否可拖拽上传 */
|
|
34
|
+
drag: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
/** 可接受文件类型 */
|
|
39
|
+
fileType: {
|
|
40
|
+
type: Array
|
|
41
|
+
},
|
|
42
|
+
//禁用
|
|
43
|
+
disabled: Boolean,
|
|
44
|
+
//自动上传
|
|
45
|
+
autoUpload: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
...mapState('app/token', ['accessToken']),
|
|
52
|
+
headers() {
|
|
53
|
+
return {
|
|
54
|
+
Authorization: 'Bearer ' + this.accessToken
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
uploadData() {
|
|
58
|
+
return {
|
|
59
|
+
moduleCode: this.module,
|
|
60
|
+
group: this.group,
|
|
61
|
+
accessMode: this.accessMode,
|
|
62
|
+
accounts: this.accounts
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
maxSizeBytes() {
|
|
66
|
+
if (this.maxSize) {
|
|
67
|
+
const max = this.maxSize.toLowerCase()
|
|
68
|
+
if (max.endsWith('kb')) {
|
|
69
|
+
return parseFloat(max.replace('kb', '')) * 1024
|
|
70
|
+
} else if (max.endsWith('mb')) {
|
|
71
|
+
return parseFloat(max.replace('mb', '')) * 1024 * 1024
|
|
72
|
+
} else if (max.endsWith('gb')) {
|
|
73
|
+
return parseFloat(max.replace('gb', '')) * 1024 * 1024 * 1024
|
|
74
|
+
} else if (max.endsWith('tb')) {
|
|
75
|
+
return parseFloat(max.replace('tb', '')) * 1024 * 1024 * 1024 * 1024
|
|
76
|
+
} else if (max.endsWith('b')) {
|
|
77
|
+
return parseFloat(max.replace('b', ''))
|
|
78
|
+
} else {
|
|
79
|
+
return parseFloat(max)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return ''
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
onError() {
|
|
87
|
+
this._error('上传失败')
|
|
88
|
+
this.$emit('error')
|
|
89
|
+
this.loading = false
|
|
90
|
+
},
|
|
91
|
+
getSizeUnit(size) {
|
|
92
|
+
if (size === null || size === '') {
|
|
93
|
+
return '0 B'
|
|
94
|
+
}
|
|
95
|
+
var unitArr = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
96
|
+
var index = 0
|
|
97
|
+
var srcsize = parseFloat(size)
|
|
98
|
+
index = Math.floor(Math.log(srcsize) / Math.log(1024))
|
|
99
|
+
var s = srcsize / Math.pow(1024, index)
|
|
100
|
+
s = s.toFixed(2)
|
|
101
|
+
return s + unitArr[index]
|
|
102
|
+
},
|
|
103
|
+
/** 获取文件后缀名 */
|
|
104
|
+
getFileExt(name) {
|
|
105
|
+
let ext = ''
|
|
106
|
+
const arr = name.split('.')
|
|
107
|
+
if (arr.length > 1) {
|
|
108
|
+
ext = arr[arr.length - 1]
|
|
109
|
+
}
|
|
110
|
+
return ext
|
|
111
|
+
},
|
|
112
|
+
/** 验证文件类型 */
|
|
113
|
+
verifyFileType(file) {
|
|
114
|
+
if (this.fileType && this.fileType.length > 0) {
|
|
115
|
+
var ext = this.getFileExt(file.name)
|
|
116
|
+
if (this.fileType.every(m => m.toLowerCase() !== ext)) {
|
|
117
|
+
this._error(`.${ext} 文件类型不支持!`)
|
|
118
|
+
return false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return true
|
|
122
|
+
},
|
|
123
|
+
submit() {
|
|
124
|
+
this.$refs.upload.submit()
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const isDev = process.env.NODE_ENV !== 'production'
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
baseUrl: '/api/'
|
|
5
|
+
/** 账户类型 */
|
|
6
|
+
// accountTypes: [
|
|
7
|
+
// { label: '管理员', value: 0 },
|
|
8
|
+
// { label: '企业', value: 2 },
|
|
9
|
+
// { label: '员工', value: 1 }
|
|
10
|
+
// ]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 开发模式
|
|
14
|
+
if (isDev) {
|
|
15
|
+
config.baseUrl = 'http://localhost:6220/api/'
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default config
|
package/src/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import NetModularUI from 'netmodular-ui'
|
|
2
|
+
import './api'
|
|
3
|
+
import module from './module'
|
|
4
|
+
import routes from './routes'
|
|
5
|
+
import store from './store'
|
|
6
|
+
import components from './components'
|
|
7
|
+
import NetmodularSkinsClassics from 'netmodular-skins-classics'
|
|
8
|
+
|
|
9
|
+
const admin = {
|
|
10
|
+
module,
|
|
11
|
+
routes,
|
|
12
|
+
store,
|
|
13
|
+
components
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// 模块列表
|
|
17
|
+
let modules = [admin]
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
/**
|
|
21
|
+
* @description 注册模块
|
|
22
|
+
* @param {Object} module 模块信息
|
|
23
|
+
*/
|
|
24
|
+
registerModule(module) {
|
|
25
|
+
if (module) modules.push(module)
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @description 注册皮肤
|
|
29
|
+
* @param {object} skin 皮肤
|
|
30
|
+
*/
|
|
31
|
+
registerSkin(skin) {
|
|
32
|
+
if (skin) NetModularUI.registerSkin(skin)
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* @description 启动
|
|
36
|
+
*/
|
|
37
|
+
async start(config) {
|
|
38
|
+
// 设置接口信息
|
|
39
|
+
NetModularUI.configApi(config)
|
|
40
|
+
// 使用皮肤
|
|
41
|
+
NetModularUI.registerSkin(NetmodularSkinsClassics)
|
|
42
|
+
|
|
43
|
+
// 获取UI配置信息
|
|
44
|
+
const UIConfig = await $api.admin.config.getUI()
|
|
45
|
+
|
|
46
|
+
// 方法
|
|
47
|
+
let actions = {
|
|
48
|
+
//身份认证相关方法
|
|
49
|
+
...$api.admin.auth,
|
|
50
|
+
// 修改密码方法
|
|
51
|
+
updatePassword: $api.admin.account.updatePassword,
|
|
52
|
+
// 皮肤修改方法
|
|
53
|
+
saveSkin: $api.admin.account.skinUpdate
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 设置账户类型
|
|
57
|
+
if (config.accountTypes) {
|
|
58
|
+
UIConfig.component.login.accountTypes = config.accountTypes
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
window.loaded = true
|
|
62
|
+
const t = setInterval(() => {
|
|
63
|
+
if (window.loadProgress > 98) {
|
|
64
|
+
clearInterval(t)
|
|
65
|
+
NetModularUI.use({ config: UIConfig, modules, actions })
|
|
66
|
+
}
|
|
67
|
+
}, 20)
|
|
68
|
+
}
|
|
69
|
+
}
|
package/src/main.js
ADDED
package/src/module.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
|
|
3
|
+
<el-row>
|
|
4
|
+
<el-col :span="20" :offset="1">
|
|
5
|
+
<el-form-item label="用户名:" prop="userName">
|
|
6
|
+
<el-input v-model="form.model.userName" />
|
|
7
|
+
</el-form-item>
|
|
8
|
+
<el-form-item label="角色:" prop="roles">
|
|
9
|
+
<nm-role-select ref="roles" multiple v-model="form.model.roles" />
|
|
10
|
+
</el-form-item>
|
|
11
|
+
<el-form-item label="名称:" prop="name">
|
|
12
|
+
<el-input v-model="form.model.name" />
|
|
13
|
+
</el-form-item>
|
|
14
|
+
<el-form-item v-if="isAdd_" label="密码:" prop="password">
|
|
15
|
+
<el-input v-model="form.model.password" placeholder="默认密码123456" clearable />
|
|
16
|
+
</el-form-item>
|
|
17
|
+
<el-form-item label="手机:" prop="phone">
|
|
18
|
+
<el-input type="number" v-model="form.model.phone" clearable />
|
|
19
|
+
</el-form-item>
|
|
20
|
+
<el-form-item label="邮箱:" prop="email">
|
|
21
|
+
<el-input type="email" v-model="form.model.email" clearable />
|
|
22
|
+
</el-form-item>
|
|
23
|
+
</el-col>
|
|
24
|
+
</el-row>
|
|
25
|
+
</nm-form-dialog>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import { mixins } from 'netmodular-ui'
|
|
29
|
+
|
|
30
|
+
// 接口
|
|
31
|
+
const { add, edit, update } = $api.admin.account
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
mixins: [mixins.formSave],
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
title: '账户',
|
|
38
|
+
actions: {
|
|
39
|
+
add,
|
|
40
|
+
edit,
|
|
41
|
+
update
|
|
42
|
+
},
|
|
43
|
+
form: {
|
|
44
|
+
width: '500px',
|
|
45
|
+
model: {
|
|
46
|
+
id: '',
|
|
47
|
+
name: '',
|
|
48
|
+
roles: [],
|
|
49
|
+
userName: '',
|
|
50
|
+
phone: '',
|
|
51
|
+
email: '',
|
|
52
|
+
password: ''
|
|
53
|
+
},
|
|
54
|
+
rules: {
|
|
55
|
+
name: [{ required: true, message: '请输入名称' }],
|
|
56
|
+
userName: [{ required: true, message: '请输入用户名' }],
|
|
57
|
+
password: [{ min: 6, message: '密码长度不能小于6位' }],
|
|
58
|
+
phone: [{ len: 11, message: '请输入正确的手机号' }],
|
|
59
|
+
email: [{ type: 'email', message: '请输入正确的邮箱地址' }]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
width: 240,
|
|
6
|
+
show: false
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'typeName',
|
|
10
|
+
label: '类型'
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'name',
|
|
14
|
+
label: '名称'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'userName',
|
|
18
|
+
label: '用户名',
|
|
19
|
+
width: 150
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'roles',
|
|
23
|
+
label: '角色',
|
|
24
|
+
width: 300
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'phone',
|
|
28
|
+
label: '手机号'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'email',
|
|
32
|
+
label: '邮箱',
|
|
33
|
+
width: 150
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'status',
|
|
37
|
+
label: '状态',
|
|
38
|
+
width: 150
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'loginTime',
|
|
42
|
+
label: '最后登录时间',
|
|
43
|
+
width: 150
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'loginIP',
|
|
47
|
+
label: '最后登录IP',
|
|
48
|
+
width: 150
|
|
49
|
+
}
|
|
50
|
+
]
|
|
@@ -0,0 +1,127 @@
|
|
|
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="userName">
|
|
7
|
+
<el-input v-model="list.model.userName" clearable />
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="名称:" prop="name">
|
|
10
|
+
<el-input v-model="list.model.name" clearable />
|
|
11
|
+
</el-form-item>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<!--高级查询-->
|
|
15
|
+
<template v-slot:querybar-advanced>
|
|
16
|
+
<el-row>
|
|
17
|
+
<el-col :span="20" :offset="1">
|
|
18
|
+
<el-form-item label="手机号:" prop="phone">
|
|
19
|
+
<el-input v-model="list.model.phone" clearable />
|
|
20
|
+
</el-form-item>
|
|
21
|
+
<el-form-item label="邮箱:" prop="email">
|
|
22
|
+
<el-input v-model="list.model.name" clearable />
|
|
23
|
+
</el-form-item>
|
|
24
|
+
</el-col>
|
|
25
|
+
</el-row>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<!--按钮-->
|
|
29
|
+
<template v-slot:querybar-buttons="{ total }">
|
|
30
|
+
<nm-button v-bind="buttons.add" @click="add(total)" />
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<!--角色-->
|
|
34
|
+
<template v-slot:col-roles="{ row }">
|
|
35
|
+
<template v-if="row.roles && row.roles.length > 0">
|
|
36
|
+
<template v-for="(role, index) in row.roles">
|
|
37
|
+
<el-tag :key="role.value" :text="role.label">{{ role.label }}</el-tag>
|
|
38
|
+
<template v-if="index < row.roles.length - 1">、</template>
|
|
39
|
+
</template>
|
|
40
|
+
</template>
|
|
41
|
+
<span v-else>未绑定</span>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<!--状态-->
|
|
45
|
+
<template v-slot:col-status="{ row }">
|
|
46
|
+
<el-tag v-if="row.status === 0" type="info">未激活</el-tag>
|
|
47
|
+
<el-tag v-else-if="row.status === 1" type="success">正常</el-tag>
|
|
48
|
+
<el-tag v-else-if="row.status === 2" type="warning">禁用</el-tag>
|
|
49
|
+
<el-tag v-else-if="row.status === 3" type="danger">注销</el-tag>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<!--登录时间-->
|
|
53
|
+
<template v-slot:col-loginTime="{ row }">{{ row.status === 0 ? '未登录' : row.loginTime }}</template>
|
|
54
|
+
<template v-slot:col-loginIP="{ row }">{{ row.status === 0 ? '未登录' : row.loginIP }}</template>
|
|
55
|
+
|
|
56
|
+
<!--操作列-->
|
|
57
|
+
<template v-slot:col-operation="{ row }">
|
|
58
|
+
<nm-button v-if="!row.isLock && row.status === 0" v-bind="buttons.active" @click="active(row)" />
|
|
59
|
+
<nm-button v-if="!row.isLock" v-bind="buttons.edit" @click="edit(row)" />
|
|
60
|
+
<nm-button v-if="!row.isLock" v-bind="buttons.resetPassword" @click="resetPassword(row)" />
|
|
61
|
+
<nm-button-delete v-if="!row.isLock" v-bind="buttons.del" :disabled="row.id === accountId" :action="removeAction" :id="row.id" @success="refresh" />
|
|
62
|
+
<nm-button v-if="row.isLock" type="text" text="锁定" :disabled="true" />
|
|
63
|
+
</template>
|
|
64
|
+
</nm-list>
|
|
65
|
+
|
|
66
|
+
<!--保存页-->
|
|
67
|
+
<save-page :id="curr.id" :visible.sync="dialog.save" @success="refresh" />
|
|
68
|
+
</nm-container>
|
|
69
|
+
</template>
|
|
70
|
+
<script>
|
|
71
|
+
import { mapState } from 'vuex'
|
|
72
|
+
import { mixins } from 'netmodular-ui'
|
|
73
|
+
import page from './page'
|
|
74
|
+
import cols from './cols'
|
|
75
|
+
import SavePage from '../components/save'
|
|
76
|
+
|
|
77
|
+
// 接口
|
|
78
|
+
const api = $api.admin.account
|
|
79
|
+
|
|
80
|
+
export default {
|
|
81
|
+
name: page.name,
|
|
82
|
+
mixins: [mixins.list],
|
|
83
|
+
components: { SavePage },
|
|
84
|
+
data() {
|
|
85
|
+
return {
|
|
86
|
+
list: {
|
|
87
|
+
title: page.title,
|
|
88
|
+
cols,
|
|
89
|
+
action: api.query,
|
|
90
|
+
operationWidth: '270',
|
|
91
|
+
advanced: {
|
|
92
|
+
enabled: true,
|
|
93
|
+
width: '400px'
|
|
94
|
+
},
|
|
95
|
+
model: {
|
|
96
|
+
userName: '',
|
|
97
|
+
name: '',
|
|
98
|
+
phone: '',
|
|
99
|
+
email: ''
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
removeAction: api.remove,
|
|
103
|
+
buttons: page.buttons
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
computed: {
|
|
107
|
+
...mapState('app/account', { accountId: 'id' })
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
resetPassword(row) {
|
|
111
|
+
this._confirm(`您确定要重置账户(${row.name})的密码吗?`).then(() => {
|
|
112
|
+
api.resetPassword(row.id).then(() => {
|
|
113
|
+
this._success('已重置')
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
},
|
|
117
|
+
active(row) {
|
|
118
|
+
this._confirm(`您确定要激活账户(${row.name})吗?`).then(() => {
|
|
119
|
+
api.active(row.id).then(() => {
|
|
120
|
+
this._success('已激活')
|
|
121
|
+
row.status = 1
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
</script>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** 页面信息 */
|
|
2
|
+
const page = new (function() {
|
|
3
|
+
this.title = '账户管理'
|
|
4
|
+
this.icon = 'user'
|
|
5
|
+
this.name = 'admin_account'
|
|
6
|
+
this.path = '/admin/account'
|
|
7
|
+
|
|
8
|
+
// 关联权限
|
|
9
|
+
this.permissions = [`${this.name}_query_get`]
|
|
10
|
+
|
|
11
|
+
// 按钮
|
|
12
|
+
this.buttons = {
|
|
13
|
+
add: {
|
|
14
|
+
text: '添加',
|
|
15
|
+
type: 'success',
|
|
16
|
+
icon: 'add',
|
|
17
|
+
code: `${this.name}_add`,
|
|
18
|
+
permissions: [`${this.name}_add_post`]
|
|
19
|
+
},
|
|
20
|
+
edit: {
|
|
21
|
+
text: '编辑',
|
|
22
|
+
type: 'text',
|
|
23
|
+
icon: 'edit',
|
|
24
|
+
code: `${this.name}_edit`,
|
|
25
|
+
permissions: [`${this.name}_edit_get`, `${this.name}_update_post`]
|
|
26
|
+
},
|
|
27
|
+
del: {
|
|
28
|
+
text: '删除',
|
|
29
|
+
type: 'text',
|
|
30
|
+
icon: 'delete',
|
|
31
|
+
code: `${this.name}_del`,
|
|
32
|
+
permissions: [`${this.name}_delete_delete`]
|
|
33
|
+
},
|
|
34
|
+
resetPassword: {
|
|
35
|
+
text: '重置密码',
|
|
36
|
+
type: 'text',
|
|
37
|
+
icon: 'refresh',
|
|
38
|
+
code: `${this.name}_reset_password`,
|
|
39
|
+
permissions: [`${this.name}_resetpassword_post`]
|
|
40
|
+
},
|
|
41
|
+
active: {
|
|
42
|
+
text: '激活',
|
|
43
|
+
type: 'text',
|
|
44
|
+
icon: 'run',
|
|
45
|
+
code: `${this.name}_active`,
|
|
46
|
+
permissions: [`${this.name}_active_post`]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
})()
|
|
50
|
+
|
|
51
|
+
/** 路由信息 */
|
|
52
|
+
export const route = {
|
|
53
|
+
page,
|
|
54
|
+
component: () => import(/* webpackChunkName: "admin.account" */ './index')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default page
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nm-drawer v-bind="drawer" :visible.sync="visible_">
|
|
3
|
+
<el-form label-width="120px" disabled>
|
|
4
|
+
<el-form-item label="账户:">{{ model.accountName }}</el-form-item>
|
|
5
|
+
<el-form-item label="模块:">{{ model.module }}({{ model.area }})</el-form-item>
|
|
6
|
+
<el-form-item label="控制器:">{{ model.controller }}({{ model.controllerDesc }})</el-form-item>
|
|
7
|
+
<el-form-item label="方法:">{{ model.action }}({{ model.actionDesc }})</el-form-item>
|
|
8
|
+
<el-form-item label="执行时间:">{{ model.executionTime }}</el-form-item>
|
|
9
|
+
<el-form-item label="用时:">{{ model.executionDuration }}ms</el-form-item>
|
|
10
|
+
<el-form-item label="IP:">{{ model.ip }}</el-form-item>
|
|
11
|
+
<el-form-item label="平台:">{{ model.platformName }}</el-form-item>
|
|
12
|
+
<el-form-item label="浏览器信息:">
|
|
13
|
+
<el-input type="textarea" :value="model.browserInfo" :rows="5" />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="参数:">
|
|
16
|
+
<el-input type="textarea" :value="model.parameters" :rows="10" />
|
|
17
|
+
</el-form-item>
|
|
18
|
+
<el-form-item label="结果:">
|
|
19
|
+
<el-input type="textarea" :value="model.result" :rows="10" />
|
|
20
|
+
</el-form-item>
|
|
21
|
+
</el-form>
|
|
22
|
+
</nm-drawer>
|
|
23
|
+
</template>
|
|
24
|
+
<script>
|
|
25
|
+
import { mixins } from 'netmodular-ui'
|
|
26
|
+
|
|
27
|
+
// 接口
|
|
28
|
+
const api = $api.admin.auditInfo
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
mixins: [mixins.drawer],
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
drawer: {
|
|
35
|
+
header: true,
|
|
36
|
+
title: '审计日志详情',
|
|
37
|
+
icon: 'log',
|
|
38
|
+
width: '600px',
|
|
39
|
+
draggable: true
|
|
40
|
+
},
|
|
41
|
+
model: {}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
props: ['id'],
|
|
45
|
+
methods: {
|
|
46
|
+
get() {
|
|
47
|
+
if (this.id === '') {
|
|
48
|
+
this._warning('请选择要查看的数据~')
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
api.details(this.id).then(data => {
|
|
52
|
+
this.model = data
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
watch: {
|
|
57
|
+
id() {
|
|
58
|
+
if (this.id > 0) {
|
|
59
|
+
this.get()
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'id',
|
|
4
|
+
label: '编号',
|
|
5
|
+
show: false
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: 'accountName',
|
|
9
|
+
label: '账户',
|
|
10
|
+
export: {
|
|
11
|
+
width: 15
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'module',
|
|
16
|
+
label: '模块',
|
|
17
|
+
export: {
|
|
18
|
+
width: 15
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'controller',
|
|
23
|
+
label: '控制器',
|
|
24
|
+
export: {
|
|
25
|
+
width: 15
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'action',
|
|
30
|
+
label: '方法',
|
|
31
|
+
export: {
|
|
32
|
+
width: 15
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'platformName',
|
|
37
|
+
label: '平台',
|
|
38
|
+
export: {
|
|
39
|
+
width: 15
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'ip',
|
|
44
|
+
label: 'IP',
|
|
45
|
+
export: {
|
|
46
|
+
width: 15
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'executionTime',
|
|
51
|
+
label: '执行时间',
|
|
52
|
+
export: {
|
|
53
|
+
width: 20
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'executionDuration',
|
|
58
|
+
label: '执行用时(ms)',
|
|
59
|
+
export: {
|
|
60
|
+
width: 15
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|