Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
22a2ac5d
Commit
22a2ac5d
authored
May 01, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
f52bfe02
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
193 additions
and
4 deletions
+193
-4
iview-admin/src/api/user.js
+11
-0
iview-admin/src/components/tables/tables.vue
+1
-1
iview-admin/src/config/index.js
+1
-1
iview-admin/src/router/routers.js
+10
-1
iview-admin/src/store/module/meta.js
+3
-0
iview-admin/src/store/module/metainfo/tanentinfo.js
+82
-0
iview-admin/src/view/components/tables/biztables.vue
+2
-1
iview-admin/src/view/userinfo/tanentinfo_page.vue
+83
-0
No files found.
iview-admin/src/api/user.js
View file @
22a2ac5d
import
axios
from
'@/libs/api.request'
export
const
allowOrNot
=
(
upobj
)
=>
{
let
url
=
"/web/auth/userCtl/allowOrNot"
return
axios
.
request
({
url
:
url
,
data
:
upobj
,
method
:
'post'
}).
catch
((
e
)
=>
{
console
.
log
(
e
)
})
}
export
const
login
=
(
upobj
)
=>
{
let
url
=
"/web/auth/userCtl/pmlogin"
if
(
upobj
.
mobile
){
...
...
iview-admin/src/components/tables/tables.vue
View file @
22a2ac5d
...
...
@@ -264,7 +264,7 @@ export default {
},
on
:
{
click
:
()
=>
{
vmobj
.
$emit
(
"on-exec"
,
btninfo
.
key
,
params
.
row
);
vmobj
.
$emit
(
"on-exec"
,
btninfo
.
key
,
params
.
row
,
btninfo
);
}
}
},
...
...
iview-admin/src/config/index.js
View file @
22a2ac5d
...
...
@@ -3,7 +3,7 @@ export default {
* @description 配置显示在浏览器标签的title
*/
title
:
'智慧中台 '
,
appkey
:
'1
09d8eb3-11ce-4886-b73b-4fdb15837d1b
'
,
appkey
:
'1
b306383-683c-4b1d-933f-c2eb709e412d
'
,
/**
* @description token在Cookie中存储的天数,默认1天
*/
...
...
iview-admin/src/router/routers.js
View file @
22a2ac5d
...
...
@@ -75,7 +75,16 @@ export default [
icon
:
'ios-man'
,
title
:
'租户信息'
},
component
:
()
=>
import
(
'@/view/appinfo/appinfo_page.vue'
)
component
:
()
=>
import
(
'@/view/userinfo/tanentinfo_page.vue'
)
},
{
path
:
'my_app'
,
name
:
'my_app'
,
meta
:
{
icon
:
'ios-man'
,
title
:
'我的应用'
},
component
:
()
=>
import
(
'@/view/userinfo/tanentinfo_page.vue'
)
}
]
},
...
...
iview-admin/src/store/module/meta.js
View file @
22a2ac5d
import
{
btnAuthFilter
,
setToken
,
getToken
}
from
'@/libs/util'
import
userinfo
from
"./metainfo/userinfo"
import
tanentinfo
from
"./metainfo/tanentinfo"
import
dicinfo
from
"./metainfo/dict"
import
roleinfo
from
'./metainfo/roleinfo'
;
import
appinfo
from
'./metainfo/appinfo'
;
...
...
@@ -7,6 +8,7 @@ export default {
state
:
{
dict_info
:
dicinfo
,
user_info
:
userinfo
,
tanent_info
:
tanentinfo
,
role_info
:
roleinfo
,
app_info
:
appinfo
,
},
...
...
@@ -15,6 +17,7 @@ export default {
},
getters
:
{
user_info
:
(
state
,
getters
,
{
user
})
=>
btnAuthFilter
(
state
.
user_info
,
user
),
//定义一个函数添加权限控制逻辑
tanent_info
:
(
state
,
getters
,
{
user
})
=>
btnAuthFilter
(
state
.
tanent_info
,
user
),
//定义一个函数添加权限控制逻辑
role_info
:
(
state
,
getters
,
{
user
})
=>
btnAuthFilter
(
state
.
role_info
,
user
),
//定义一个函数添加权限控制逻辑
app_info
:
(
state
,
getters
,
{
user
})
=>
btnAuthFilter
(
state
.
app_info
,
user
),
//定义一个函数添加权限控制逻辑
dict_info
:
state
=>
state
.
dict_info
...
...
iview-admin/src/store/module/metainfo/tanentinfo.js
0 → 100644
View file @
22a2ac5d
export
default
{
bizCode
:
"tanentinfo"
,
name
:
"用户信息维护"
,
list
:
[
{
title
:
'账号'
,
key
:
'userName'
,
sortable
:
true
,
insearch
:
true
},
//slot--自定义列 insearch--是否快速查询
{
title
:
'昵称'
,
key
:
'nickName'
,
sortable
:
true
,
insearch
:
true
},
{
title
:
'是否启用'
,
key
:
'isEnabled'
,
sortable
:
false
,
insearch
:
false
,
slot
:
'isEnabled'
},
// { title: '邮件', key: 'mail', editable: true, insearch: true },
{
title
:
'创建时间'
,
key
:
'created_at'
,
slot
:
'created_at'
},
{
title
:
'操作'
,
key
:
'handle'
,
button
:
[
//这个数组中内容,需要按照权限字符串,在服务端构造
]
}
],
"form"
:
{
name
:
"xxx"
,
main
:
[
{
"title"
:
"关键信息"
,
ctls
:[
{
"type"
:
"switch"
,
"label"
:
"是否启用"
,
"prop"
:
"isEnabled"
,
"opentext"
:
"是"
,
"closetext"
:
"否"
,
"trurcolor"
:
""
,
"falsecolor"
:
""
,
"placeHolder"
:
""
,
"style"
:
""
},
{
"type"
:
"input"
,
"label"
:
"帐户"
,
"prop"
:
"userName"
,
"placeHolder"
:
"请输入帐户名"
,
"style"
:
""
,
rules
:
[{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]
},
]
},
{
"title"
:
"基本信息"
,
"key"
:
"baseinfo"
,
ctls
:
[
{
"type"
:
"input"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"请输入昵称"
,
"style"
:
""
,
rules
:
[{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]
},
{
"type"
:
"input"
,
"label"
:
"邮件"
,
"prop"
:
"mail"
,
"placeHolder"
:
"请输入邮件"
,
"style"
:
""
,
rules
:
[{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]
},
{
"type"
:
"model-select"
,
"refModel"
:
"auth.role"
,
"isMulti"
:
true
,
"label"
:
"角色"
,
"prop"
:
"roles"
,
"labelField"
:
"name"
,
"valueField"
:
"id"
,
"style"
:
""
},
{
"type"
:
"upload"
,
"label"
:
"头像"
,
"prop"
:
"headUrl"
,
"placeHolder"
:
"请上传头像"
,
"style"
:
""
,
rules
:
[{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]
},
]
}
],
lists
:
[
{
title
:
"子列表"
,
bizCode
:
"xxx"
}
]
},
"search"
:
{
name
:
"search"
,
main
:
[
{
"title"
:
"基本信息"
,
"key"
:
"baseinfo"
,
ctls
:
[
{
"type"
:
"input"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"昵称"
,
"style"
:
""
,
rules
:
[]
},
{
"type"
:
"input"
,
"label"
:
"邮件"
,
"prop"
:
"mail"
,
"placeHolder"
:
"邮件"
,
"style"
:
""
,
rules
:
[]
},
// {"type":"select","refModel":"auth.role","isMulti":true,"label":"角色","prop":"roles","labelField":"name","valueField":"id","style":""},
]
}
]
},
"auths"
:
{
"add"
:
[
{
"icon"
:
"ios-add-circle-outline"
,
"title"
:
"新增"
,
"type"
:
"text"
,
"key"
:
"create"
,
"isOnGrid"
:
true
},
{
"icon"
:
"ios-square-outline"
,
"title"
:
"保存"
,
"type"
:
"text"
,
"key"
:
"save"
,
"isOnForm"
:
true
},
{
"icon"
:
"ios-cloud-download-outline"
,
"title"
:
"下载"
,
"type"
:
"text"
,
"key"
:
"export"
,
"isOnGrid"
:
true
},
],
"edit"
:
[
{
"icon"
:
"ios-create-outline"
,
"title"
:
"禁用"
,
"type"
:
"text"
,
"key"
:
"allowornot"
,
"isInRow"
:
true
}
],
"delete"
:
[
// { "icon": "ios-trash-outline", "title": "删除", "type": "text", "key": "deletes", "isOnGrid": true },
// { "icon": "ios-trash-outline", "title": "删除", "type": "text", "key": "delete", "isInRow": true },
],
"common"
:
[
{
"icon"
:
"ios-undo-outline"
,
"title"
:
"取消"
,
"type"
:
"text"
,
"key"
:
"cancel"
,
"isOnForm"
:
true
},
{
"icon"
:
"ios-undo-outline"
,
"title"
:
"取消"
,
"type"
:
"text"
,
"key"
:
"cancel-search"
,
"isInSearch"
:
true
},
{
"icon"
:
"ios-search-outline"
,
"title"
:
"搜索"
,
"type"
:
"text"
,
"key"
:
"start-search"
,
"isInSearch"
:
true
},
{
"icon"
:
"ios-search-outline"
,
"title"
:
"高级"
,
"type"
:
"text"
,
"key"
:
"adv-search"
,
"isOnGrid"
:
true
},
],
}
}
iview-admin/src/view/components/tables/biztables.vue
View file @
22a2ac5d
...
...
@@ -235,7 +235,8 @@ export default {
this
.
currentRow
=
null
;
},
500
);
},
doexec
(
key
,
row
)
{
doexec
(
key
,
row
,
btninfo
)
{
this
.
$emit
(
"onexec"
,
key
,
row
,
btninfo
)
if
(
key
==
"delete"
)
{
this
.
currentRow
=
row
;
this
.
isdel
=
true
;
...
...
iview-admin/src/view/userinfo/tanentinfo_page.vue
0 → 100644
View file @
22a2ac5d
<
template
>
<div>
<BizTable
ref=
"bt"
:formatCol=
"formatCol"
modelName=
"user"
metaName=
"tanent_info"
packageName=
"auth"
isMulti
@
onnew=
"onnew"
@
onedit=
"onedit"
@
onexec=
"onexec"
></BizTable>
</div>
</
template
>
<
script
>
import
BizTable
from
"../components/tables/biztables"
;
import
{
allowOrNot
}
from
"@/api/user"
;
export
default
{
name
:
"userinfo_page"
,
data
()
{
return
{};
},
components
:
{
BizTable
},
methods
:
{
onexec
(
k
,
row
,
btninfo
)
{
if
(
btninfo
)
{
if
(
k
==
"allowornot"
)
{
this
.
$Modal
.
confirm
({
title
:
"提示"
,
content
:
"<p>您真的要禁用租户及相关所有用户吗?</p>"
,
loading
:
true
,
onOk
:
()
=>
{
allowOrNot
({
isEnabled
:
row
.
isEnabled
,
company_id
:
row
.
company_id
}).
then
(
res
=>
{
let
ret
=
res
.
data
;
if
(
ret
.
status
==
0
)
{
this
.
$Modal
.
remove
();
this
.
$Message
.
success
(
"当前操作成功完成."
);
if
(
row
.
isEnabled
)
{
btninfo
.
title
=
"禁用"
;
}
else
{
btninfo
.
title
=
"启用"
;
}
this
.
$refs
.
bt
.
fetchData
()
}
else
{
this
.
$Message
.
error
(
"当前操作失败,请稍后重试或联系管理员."
);
}
});
}
});
}
}
},
onnew
()
{
this
.
$refs
.
bt
.
setFormCtlVisable
(
"userName"
,
true
);
},
onedit
()
{
this
.
$refs
.
bt
.
setFormCtlVisable
(
"userName"
,
false
);
},
formatCol
(
row
,
key
,
index
)
{
if
(
key
==
"roleName"
)
{
let
rolestr
=
row
.
Roles
.
map
(
item
=>
item
.
name
).
join
(
","
);
row
.
roles
=
row
.
Roles
.
map
(
item
=>
item
.
id
);
return
`<span>
${
rolestr
}
</span>`
;
}
if
(
key
==
"isAdmin"
||
key
==
"isSuper"
)
{
return
`<span>
${
row
[
key
]
?
"是"
:
"否"
}
</span>`
;
}
if
(
key
==
"created_at"
)
{
return
`<span>
${
new
Date
(
row
[
key
]).
toLocaleString
()}
</span>`
;
}
return
row
[
key
];
}
}
};
</
script
>
<
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment