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 748a4b95
authored
Dec 05, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加回车事件、修改样式、添加必填等
1 parent
fd62a72f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
20 deletions
package.json
src/common/userConst.js
src/components/LeftManager/src/main.vue
src/components/RightForm/src/main.vue
src/components/RoleDetail/src/main.vue
src/components/UserCreate/src/main.vue
src/views/customer/role/index.vue
src/views/customer/user/index.vue
package.json
View file @
748a4b9
...
...
@@ -8,7 +8,7 @@
"lint"
:
"vue-cli-service lint"
},
"dependencies"
:
{
"glsx-vue-common"
:
"^1.1.1
7
"
,
"glsx-vue-common"
:
"^1.1.1
9
"
,
"glsx-vue-components"
:
"^1.0.15"
,
"node-sass"
:
"^4.9.3"
,
"sass-loader"
:
"^7.1.0"
,
...
...
src/common/userConst.js
View file @
748a4b9
...
...
@@ -23,7 +23,7 @@ const userDetailColumn = [{
label
:
'管理员'
,
prop
:
'isadmin'
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'否'
:
'是'
return
cellValue
.
isadmin
<
1
?
'否'
:
'是'
}
},
{
label
:
'手机号码'
,
...
...
src/components/LeftManager/src/main.vue
View file @
748a4b9
...
...
@@ -6,7 +6,7 @@
<div><gl-button
@
click=
"pushSublings"
type=
'primary'
:disabled=
"value.push"
>
添加同级菜单
</gl-button></div>
<div><gl-button
@
click=
"pushChildren"
type=
'primary'
:disabled=
"value.push"
>
添加子菜单
</gl-button></div>
</div>
<gl-scroll
:height=
'parseInt(this.$client_height() - this.height -
60
)'
>
<gl-scroll
:height=
'parseInt(this.$client_height() - this.height -
108
)'
>
<tree
ref=
'tree'
@
node-click=
'nodeClick'
...
...
@@ -43,6 +43,7 @@ export default {
eventBus
:
Object
},
mounted
()
{
console
.
log
()
this
.
height
=
this
.
$refs
.
topInfo
.
offsetHeight
},
methods
:
{
...
...
src/components/RightForm/src/main.vue
View file @
748a4b9
...
...
@@ -158,21 +158,21 @@ export default {
})
:
delMenu
.
req
({
menuId
:
obj
.
id
}).
then
(
res
=>
{
this
.
delLoading
=
false
this
.
delTip
(
true
)
this
.
delTip
(
true
,
'删除成功,首页查看需重新登录'
)
}).
catch
(
err
=>
{
this
.
delLoading
=
false
console
.
log
(
err
)
this
.
delErrTip
()
})
},
delTip
(
val
)
{
delTip
(
val
,
tips
)
{
if
(
val
)
{
const
parent
=
this
.
value
.
node
.
parent
const
children
=
parent
.
data
.
children
||
parent
.
data
const
index
=
children
.
findIndex
(
d
=>
d
.
id
===
this
.
value
.
data
.
id
)
children
.
splice
(
index
,
1
)
this
.
$notify
({
title
:
'删除成功'
,
title
:
tips
||
'删除成功'
,
type
:
'success'
})
this
.
value
.
showDetails
=
false
...
...
@@ -199,8 +199,10 @@ export default {
if
(
this
.
value
.
sublings
)
{
if
(
treeData
.
parent
===
'#'
)
{
obj
.
parentId
=
0
obj
.
grade
=
0
}
else
{
obj
.
parentId
=
treeData
.
parent
obj
.
grade
=
this
.
menu
.
grade
}
this
.
addData
(
obj
)
// 添加子级
...
...
@@ -213,7 +215,7 @@ export default {
if
(
!
this
.
isDepart
)
{
editMenu
.
req
(
obj
).
then
(
res
=>
{
this
.
subLoading
=
false
this
.
Tip
(
true
)
this
.
Tip
(
true
,
'操作成功,首页查看需重新登录'
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
this
.
subLoading
=
false
...
...
@@ -241,7 +243,7 @@ export default {
if
(
!
this
.
isDepart
)
{
addMenu
.
req
(
obj
).
then
(
res
=>
{
this
.
subLoading
=
false
this
.
Tip
(
true
)
this
.
Tip
(
true
,
'操作成功,首页查看需重新登录'
)
}).
catch
(
err
=>
{
this
.
subLoading
=
false
console
.
log
(
err
)
...
...
@@ -256,10 +258,10 @@ export default {
this
.
addOrEditDepart
(
obj
)
}
},
Tip
(
val
)
{
Tip
(
val
,
tips
)
{
if
(
val
)
{
this
.
$notify
({
title
:
'操作成功'
,
title
:
tips
||
'操作成功'
,
type
:
'success'
})
this
.
value
.
showDetails
=
false
...
...
src/components/RoleDetail/src/main.vue
View file @
748a4b9
...
...
@@ -3,13 +3,17 @@
<gl-dialog
title=
"角色列表"
:visible
.
sync=
"detailVisible"
:before-close=
"handleDetailCancel"
>
<gl-form
label-width=
"105px"
>
<gl-form-item
label=
"角色名称:"
>
<span>
{{
roleParam
.
roleName
}}
</span>
<span
style=
"line-height:40px;"
>
{{
roleParam
.
roleName
}}
</span>
</gl-form-item>
<gl-form-item
label=
"角色描述:"
>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
<div
style=
"padding-top:10px;"
>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
</div>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
>
<tree
ref=
'tree'
:propsData=
"roleMenuTree"
:defaultExpandAll=
"defaultExpandAll"
style=
"height:160px;overflow-y: auto;"
></tree>
<div
style=
"padding-top:10px;"
>
<tree
ref=
'tree'
:propsData=
"roleMenuTree"
:defaultExpandAll=
"defaultExpandAll"
style=
"height:160px;overflow-y: auto;"
></tree>
</div>
</gl-form-item>
</gl-form>
</gl-dialog>
...
...
src/components/UserCreate/src/main.vue
View file @
748a4b9
...
...
@@ -75,18 +75,20 @@
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"状态"
prop=
"state"
>
<gl-select
v-model=
"userManageForm.state"
placeholder=
"启用
"
>
<gl-select
v-model=
"userManageForm.state"
data-vv-as=
"状态"
name=
"state"
v-validate=
"'required'
"
>
<gl-option
label=
"禁用"
value=
'0'
></gl-option>
<gl-option
label=
"启用"
value=
'1'
></gl-option>
</gl-select>
<span
v-show=
"errorBags.has('state')"
class=
"error"
>
{{
errorBags
.
first
(
'state'
)
}}
</span>
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"管理员"
>
<gl-select
v-model=
"userManageForm.isadmin"
placeholder=
"否
"
>
<gl-form-item
label=
"管理员"
prop=
"isadmin"
>
<gl-select
v-model=
"userManageForm.isadmin"
data-vv-as=
"管理员"
name=
"isadmin"
v-validate=
"'required'
"
>
<gl-option
label=
"否"
value=
'0'
></gl-option>
<gl-option
label=
"是"
value=
'1'
></gl-option>
</gl-select>
<span
v-show=
"errorBags.has('isadmin')"
class=
"error"
>
{{
errorBags
.
first
(
'isadmin'
)
}}
</span>
</gl-form-item>
</gl-col>
<gl-col
:span=
"24"
>
...
...
@@ -182,6 +184,12 @@ export default {
email
:
[
{
required
:
true
}
],
state
:
[
{
required
:
true
}
],
isadmin
:
[
{
required
:
true
}
],
departName
:
[
{
required
:
true
}
],
...
...
src/views/customer/role/index.vue
View file @
748a4b9
...
...
@@ -2,8 +2,8 @@
<
template
>
<div>
<div
class=
"default m-b20"
>
<gl-input
class=
"search-w250"
placeholder=
"请输入角色名称"
v-model=
"roleName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
click=
"handleSearchRoleName"
>
搜索
</gl-button>
<gl-input
class=
"search-w250"
placeholder=
"请输入角色名称"
@
keyup
.
enter
.
native=
"handleSearchRoleName"
v-model=
"roleName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
keyup
.
enter=
"handleSearchRoleName"
@
click=
"handleSearchRoleName"
>
搜索
</gl-button>
</div>
<div
class=
"default p-t15"
>
<gl-button
class=
"control-tabledata-button"
size=
"small"
@
click=
"handleCreateOrEdit(flagCOrE = true)"
>
创建
</gl-button>
...
...
@@ -88,6 +88,7 @@ export default {
roleData
:
{
border
:
true
,
height
:
parseInt
(
this
.
$client_height
()
-
140
),
align
:
'center'
,
data
:
[],
column
:
roleDataColumn
,
console
:
{
...
...
@@ -125,6 +126,13 @@ export default {
}
}
},
created
()
{
document
.
onkeydown
=
e
=>
{
if
(
e
.
keyCode
===
13
)
{
this
.
handleSearchRoleName
()
}
}
},
mounted
()
{
this
.
getList
()
this
.
getdepartData
()
...
...
src/views/customer/user/index.vue
View file @
748a4b9
...
...
@@ -2,8 +2,8 @@
<
template
>
<div>
<div
class=
"default m-b20"
>
<gl-input
class=
"search-w250"
placeholder=
"请输入用户名或姓名"
v-model=
"userName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
click=
"finduserName"
>
搜索
</gl-button>
<gl-input
class=
"search-w250"
@
keyup
.
enter
.
native=
"finduserName"
placeholder=
"请输入用户名或姓名"
v-model=
"userName"
clearable
></gl-input>
<gl-button
type=
"primary"
@
keyup
.
enter=
"finduserName"
@
click=
"finduserName"
>
搜索
</gl-button>
</div>
<div
class=
"default p-t15"
>
<div
class=
"control-tabledata-button"
>
...
...
@@ -173,6 +173,13 @@ export default {
}
}
},
created
()
{
document
.
onkeydown
=
e
=>
{
if
(
e
.
keyCode
===
13
)
{
this
.
finduserName
()
}
}
},
mounted
()
{
this
.
findUserList
()
this
.
getRoleOptions
()
...
...
@@ -369,6 +376,7 @@ export default {
})
},
findRolesName
(
params
)
{
if
(
!
params
)
return
null
var
nameArray
=
[]
const
userRoles
=
params
.
split
(
','
)
userRoles
.
forEach
(
userItem
=>
{
...
...
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