Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c657ad49
authored
Sep 30, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://github.com/glsx-web/authority
2 parents
b4e126f3
dc5dc3d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
38 deletions
src/components/UserCreate/src/main.vue
src/styles/role-user-common.scss
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/components/UserCreate/src/main.vue
View file @
c657ad4
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<gl-form-item
label=
"用户名"
prop=
"username"
>
<gl-form-item
label=
"用户名"
prop=
"username"
>
<gl-input
v-model=
"userManageForm.username"
clearable
></gl-input>
<gl-input
v-model=
"userManageForm.username"
clearable
></gl-input>
<!--
<input
v-color=
"red"
/>
-->
<!--
<div
v-show=
"!isEdit"
class=
"err"
>
{{
msg
}}
</div>
-->
<!--
<div
v-show=
"!isEdit"
class=
"err"
>
{{
msg
}}
</div>
-->
</gl-form-item>
</gl-form-item>
</el-col>
</el-col>
...
@@ -27,7 +28,7 @@
...
@@ -27,7 +28,7 @@
</gl-col>
</gl-col>
<gl-col
:span=
"12"
>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"注册IP"
prop=
"joinip"
>
<gl-form-item
label=
"注册IP"
prop=
"joinip"
>
<gl-masked
v-model=
"userManageForm.joinip"
:mask=
"tel"
placeholder=
'请输入
手机号码
'
clearable
></gl-masked>
<gl-masked
v-model=
"userManageForm.joinip"
:mask=
"tel"
placeholder=
'请输入
注册IP
'
clearable
></gl-masked>
<!--
<gl-input
v-model=
"userManageForm.joinip"
clearable
></gl-input>
-->
<!--
<gl-input
v-model=
"userManageForm.joinip"
clearable
></gl-input>
-->
</gl-form-item>
</gl-form-item>
</gl-col>
</gl-col>
...
@@ -59,6 +60,7 @@
...
@@ -59,6 +60,7 @@
<tree
ref=
'tree'
:isDepart=
"isDepart"
:defaultExpandAll=
"defaultExpandAll"
@
node-click=
'clickDepart'
style=
"height:160px"
></tree>
<tree
ref=
'tree'
:isDepart=
"isDepart"
:defaultExpandAll=
"defaultExpandAll"
@
node-click=
'clickDepart'
style=
"height:160px"
></tree>
</gl-option>
</gl-option>
</gl-select>
</gl-select>
<gl-input-tree
:data=
'data'
:props=
'props'
:treeStyle=
'
{ maxHeight: "160px" }' v-model="userManageForm.departName" />
<!--
<gl-select
v-model=
"userManageForm.departId"
placeholder=
"请选择"
>
<!--
<gl-select
v-model=
"userManageForm.departId"
placeholder=
"请选择"
>
<gl-option
<gl-option
v-for=
"item in userManageForm.options"
v-for=
"item in userManageForm.options"
...
@@ -104,23 +106,19 @@ export default {
...
@@ -104,23 +106,19 @@ export default {
!
val
&&
this
.
$refs
[
'userManageForm'
].
resetFields
()
!
val
&&
this
.
$refs
[
'userManageForm'
].
resetFields
()
},
},
'userManageForm.id'
(
val
)
{
'userManageForm.id'
(
val
)
{
console
.
log
(
val
)
val
&&
(
this
.
placeholder
=
'不填为不修改'
)
val
&&
(
this
.
placeholder
=
'不填为不修改'
)
!
val
&&
(
this
.
placeholder
=
''
)
!
val
&&
(
this
.
placeholder
=
''
)
}
}
},
},
mounted
()
{
// this.list = this.userManageForm.roleList.map(item => item.roleName)
},
data
()
{
data
()
{
return
{
return
{
key
:
Date
.
now
(),
key
:
Date
.
now
(),
isDepart
:
true
,
isDepart
:
true
,
// userData: {}
,
data
:
''
,
placeholder
:
''
,
placeholder
:
''
,
defaultExpandAll
:
true
,
defaultExpandAll
:
true
,
val
:
''
,
val
:
''
,
tel
:
[
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
],
tel
:
[
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
,
'.'
,
/
\d{1,3}
/
],
rules
:
{
rules
:
{
username
:
[
username
:
[
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
...
@@ -166,11 +164,11 @@ export default {
...
@@ -166,11 +164,11 @@ export default {
})
})
},
},
clickDepart
(
data
,
treeData
,
vue
,
props
)
{
clickDepart
(
data
,
treeData
,
vue
,
props
)
{
console
.
log
(
treeData
)
if
(
data
.
parent
!==
'#'
||
!
data
.
children
)
{
if
(
data
.
parent
!==
'#'
||
!
data
.
children
)
{
this
.
userManageForm
.
departId
=
data
.
id
this
.
userManageForm
.
departId
=
data
.
id
this
.
userManageForm
.
departName
=
data
.
text
this
.
userManageForm
.
departName
=
data
.
text
this
.
getDepartName
(
treeData
)
this
.
getDepartName
(
treeData
)
// this.userManageForm.departName = this.departName.join(' - ')
this
.
departName
=
[]
this
.
departName
=
[]
}
}
},
},
...
@@ -182,14 +180,6 @@ export default {
...
@@ -182,14 +180,6 @@ export default {
return
true
return
true
}
}
},
},
// isPoneAvailable(pone) {
// this.tel = '/^[1][3,4,5,7,8][0-9]{9}$/'
// if (!this.tel.test(pone)) {
// return false
// } else {
// return true
// }
// },
submitForm
(
formName
)
{
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
this
.
userData
=
this
.
$deep_clone
(
this
.
userManageForm
)
this
.
userData
=
this
.
$deep_clone
(
this
.
userManageForm
)
...
@@ -208,6 +198,7 @@ export default {
...
@@ -208,6 +198,7 @@ export default {
this
.
$emit
(
'userFormData'
)
this
.
$emit
(
'userFormData'
)
},
},
handleCheckedChange
(
value
)
{
handleCheckedChange
(
value
)
{
console
.
log
(
value
)
if
(
!
value
)
return
if
(
!
value
)
return
this
.
val
=
value
.
join
(
','
)
this
.
val
=
value
.
join
(
','
)
}
}
...
...
src/styles/role-user-common.scss
View file @
c657ad4
...
@@ -13,9 +13,12 @@
...
@@ -13,9 +13,12 @@
right
:
25px
;
right
:
25px
;
top
:
-56px
;
top
:
-56px
;
}
}
.m-rl8
{
//
.m-rl8{
margin
:
0
8px
;
//
margin: 0 8px;
}
//
}
.w-75
{
.w-75
{
width
:
75px
;
width
:
75px
;
}
.el-pagination
{
margin-top
:
25px
;
}
}
\ No newline at end of file
\ No newline at end of file
src/views/customer/role/index.vue
View file @
c657ad4
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
<gl-input
class=
"search-w250"
placeholder=
"请输入角色名称"
v-model=
"roleName"
clearable
></gl-input>
<gl-input
class=
"search-w250"
placeholder=
"请输入角色名称"
v-model=
"roleName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
click=
"handleSearchRoleName"
>
搜索
</gl-button>
<gl-button
type=
"primary"
@
click=
"handleSearchRoleName"
>
搜索
</gl-button>
</div>
</div>
<hr>
<div
class=
"default p-t15"
>
<div
class=
"default p-t15"
>
<gl-button
class=
"control-tabledata-button"
size=
"small"
@
click=
"handleCreateOrEdit(flagCOrE = true)"
>
创建
</gl-button>
<gl-button
class=
"control-tabledata-button"
size=
"small"
@
click=
"handleCreateOrEdit(flagCOrE = true)"
>
创建
</gl-button>
<role-create
:createVisible=
"createVisible"
:createRuleForm=
"roleParam"
:defaultCheckedKeys=
"roleMenu"
:flagCOrE=
"flagCOrE"
@
createClose=
"handleCreateClose"
></role-create>
<role-create
:createVisible=
"createVisible"
:createRuleForm=
"roleParam"
:defaultCheckedKeys=
"roleMenu"
:flagCOrE=
"flagCOrE"
@
createClose=
"handleCreateClose"
></role-create>
...
@@ -61,7 +60,7 @@ export default {
...
@@ -61,7 +60,7 @@ export default {
// 分页所需参数-end
// 分页所需参数-end
roleData
:
{
roleData
:
{
border
:
true
,
border
:
true
,
height
:
400
,
height
:
parseInt
(
this
.
$client_height
()
-
140
)
,
data
:
[],
data
:
[],
column
:
roleDataColumn
,
column
:
roleDataColumn
,
console
:
{
console
:
{
...
@@ -123,7 +122,7 @@ export default {
...
@@ -123,7 +122,7 @@ export default {
// 删除角色,根据返回的code值来判断是否删除成功(已有拦截器)
// 删除角色,根据返回的code值来判断是否删除成功(已有拦截器)
this
.
deleteRole
(
rows
[
index
].
id
)
this
.
deleteRole
(
rows
[
index
].
id
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
message
(
'取消删除'
,
'info'
)
//
this.message('取消删除', 'info')
})
})
},
},
// 获取页面参数
// 获取页面参数
...
...
src/views/customer/user/index.vue
View file @
c657ad4
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
<gl-input
class=
"search-w250"
placeholder=
"请输入用户名或姓名"
v-model=
"userName"
clearable
></gl-input>
<gl-input
class=
"search-w250"
placeholder=
"请输入用户名或姓名"
v-model=
"userName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
click=
"finduserName"
>
搜索
</gl-button>
<gl-button
type=
"primary"
@
click=
"finduserName"
>
搜索
</gl-button>
</div>
</div>
<hr>
<div
class=
"default p-t15"
>
<div
class=
"default p-t15"
>
<div
class=
"control-tabledata-button"
>
<div
class=
"control-tabledata-button"
>
<gl-button
size=
"small"
@
click=
"createUser()"
>
新增用户
</gl-button>
<gl-button
size=
"small"
@
click=
"createUser()"
>
新增用户
</gl-button>
...
@@ -59,7 +58,7 @@ export default {
...
@@ -59,7 +58,7 @@ export default {
select
:
this
.
handleSelectionChange
,
select
:
this
.
handleSelectionChange
,
border
:
true
,
border
:
true
,
align
:
'center'
,
align
:
'center'
,
height
:
500
,
height
:
parseInt
(
this
.
$client_height
()
-
140
)
,
data
:
[],
data
:
[],
column
:
[{
column
:
[{
label
:
'用户序号'
,
label
:
'用户序号'
,
...
@@ -156,6 +155,7 @@ export default {
...
@@ -156,6 +155,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
parseInt
(
this
.
$client_height
()))
this
.
findUserList
()
this
.
findUserList
()
this
.
getRoleOptions
()
this
.
getRoleOptions
()
findDepartTree
.
req
().
then
(
res
=>
{
findDepartTree
.
req
().
then
(
res
=>
{
...
@@ -248,7 +248,7 @@ export default {
...
@@ -248,7 +248,7 @@ export default {
this
.
updateUser_Post
(
params
)
this
.
updateUser_Post
(
params
)
}
else
{
}
else
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
message
(
'取消操作'
,
'info'
)
//
this.message('取消操作', 'info')
}
}
// !params && this.message('取消操作', 'info')
// !params && this.message('取消操作', 'info')
// params && this.updateUser_Post(params)
// params && this.updateUser_Post(params)
...
@@ -275,12 +275,11 @@ export default {
...
@@ -275,12 +275,11 @@ export default {
}
}
})
})
Promise
.
all
([
findAll
,
getRoleList
]).
then
((
result
)
=>
{
Promise
.
all
([
findAll
,
getRoleList
]).
then
((
result
)
=>
{
console
.
log
(
row
.
roles
)
if
(
row
.
roles
&&
typeof
(
row
.
roles
)
===
'string'
)
{
if
(
row
.
roles
&&
typeof
(
row
.
roles
)
===
'string'
)
{
row
.
roles
=
(
row
.
roles
+
''
).
split
(
','
).
map
(
role
=>
+
role
)
row
.
roles
=
(
row
.
roles
+
''
).
split
(
','
).
map
(
role
=>
+
role
)
}
else
{
}
else
{
(
typeof
(
row
.
roles
)
===
'object'
)
&&
row
.
roles
(
typeof
(
row
.
roles
)
===
'object'
)
&&
row
.
roles
!
(
typeof
(
row
.
roles
)
===
'object'
)
&&
[]
row
.
roles
=
[]
}
}
this
.
userManageForm
=
this
.
$deep_clone
(
row
)
this
.
userManageForm
=
this
.
$deep_clone
(
row
)
})
})
...
@@ -306,18 +305,10 @@ export default {
...
@@ -306,18 +305,10 @@ export default {
this
.
batcheDel
(
ids
.
join
(
','
))
this
.
batcheDel
(
ids
.
join
(
','
))
this
.
message
(
'删除成功'
,
'success'
)
this
.
message
(
'删除成功'
,
'success'
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
message
(
'取消删除'
,
'info'
)
console
.
log
(
'error'
)
// this.message('取消删除', 'info')
})
})
}
}
// else {
// this.message('', '操作失败')
// }
},
// 提示
createOrEditSuccess
()
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
message
(
!
this
.
isEdit
?
'创建角色成功'
:
'已经成功修改数据'
,
'success'
)
this
.
findUserList
()
},
},
// 搜索
// 搜索
finduserName
()
{
finduserName
()
{
...
@@ -342,7 +333,7 @@ export default {
...
@@ -342,7 +333,7 @@ export default {
this
.
operatUser
({
id
:
rows
[
index
].
id
,
state
:
2
})
this
.
operatUser
({
id
:
rows
[
index
].
id
,
state
:
2
})
this
.
message
(
'成功删除该用户'
,
'success'
)
this
.
message
(
'成功删除该用户'
,
'success'
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
message
(
'取消删除'
,
'info'
)
//
this.message('取消删除', 'info')
})
})
},
},
findRolesName
(
params
)
{
findRolesName
(
params
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment