Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
c654fdbc
Commit
c654fdbc
authored
Oct 15, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
48c15c81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
4 deletions
+100
-4
index.js
src/api/system/index.js
+24
-0
menu.vue
src/pages/system/menu.vue
+37
-2
role.vue
src/pages/system/role.vue
+39
-2
No files found.
src/api/system/index.js
View file @
c654fdbc
...
...
@@ -100,6 +100,18 @@ export function saveMenu(data) {
})
}
/**
* 设置菜单状态
* @param {JSON参数对象} data
*/
export
function
updateMenuStatus
(
data
)
{
return
request
({
url
:
'/Public/SetMenuStatus'
,
method
:
'post'
,
data
})
}
/**
* 获取树形结构菜单
* @param {JSON参数} data
...
...
@@ -148,3 +160,15 @@ export function saveRoleInfo(data) {
data
})
}
/**
* 修改角色状态
* @param {JSON对象} data
*/
export
function
setRoleStatus
(
data
)
{
return
request
({
url
:
'/Public/SetRoleStatus'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/pages/system/menu.vue
View file @
c654fdbc
...
...
@@ -32,7 +32,8 @@
separator=
"none"
title=
"菜单信息"
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==0?'正常':'禁用'"
/>
<q-toggle
size=
"md"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"props.row.Status"
title=
"注意:关闭后,分类将无法正常使用."
@
input=
"DeleteMenu(props.row)"
/>
</q-td>
</
template
>
<
template
v-slot:bottom
>
...
...
@@ -56,7 +57,8 @@
import
{
getMenuPage
,
getMenuTypeList
,
getMenuLevelList
getMenuLevelList
,
updateMenuStatus
,
}
from
'../../api/system/index'
import
menuForm
from
'../../components/system/menu-form'
export
default
{
...
...
@@ -220,6 +222,39 @@
//关闭弹窗
closeMenuSaveForm
()
{
this
.
isShowMenuForm
=
false
},
//修改菜单状态
DeleteMenu
(
obj
)
{
var
that
=
this
;
var
delMsg
=
{
MenuId
:
obj
.
MenuId
,
Status
:
obj
.
Status
};
var
tipMsg
=
""
;
if
(
delMsg
.
Status
==
0
)
{
tipMsg
=
"是否启用【"
+
obj
.
MenuName
+
"】菜单?"
;
}
else
{
tipMsg
=
"是否禁用【"
+
obj
.
MenuName
+
"】菜单?"
;
}
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
tipMsg
,
cancel
:
true
,
persistent
:
true
}).
onOk
(()
=>
{
updateMenuStatus
(
delMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
that
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
that
.
getmenulist
();
}
})
});
}
}
}
...
...
src/pages/system/role.vue
View file @
c654fdbc
...
...
@@ -20,7 +20,10 @@
separator=
"none"
title=
"角色信息"
:data=
"data"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:body-cell-Status=
"props"
>
<q-td
:props=
"props"
>
<q-badge
:color=
"props.value==1?'negative':'primary'"
:label=
"props.value==0?'正常':'禁用'"
/>
<q-td
:props=
"props"
>
<q-toggle
size=
"md"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"props.row.Status"
title=
"注意:关闭后,分类将无法正常使用."
@
input=
"DeleteRole(props.row)"
/>
</q-td>
</q-td>
</
template
>
<
template
v-slot:bottom
>
...
...
@@ -42,7 +45,8 @@
<
script
>
import
{
queryRolePage
queryRolePage
,
setRoleStatus
}
from
'../../api/system/index'
import
roleForm
from
'../../components/system/role-form'
export
default
{
...
...
@@ -172,6 +176,39 @@
//关闭弹窗
closeroleSaveForm
()
{
this
.
isShowRoleForm
=
false
},
//修改角色状态
DeleteRole
(
obj
)
{
var
that
=
this
;
var
delMsg
=
{
RoleId
:
obj
.
RoleId
,
Status
:
obj
.
Status
};
var
tipMsg
=
""
;
if
(
delMsg
.
Status
==
0
)
{
tipMsg
=
"是否启用【"
+
obj
.
RoleName
+
"】角色?"
;
}
else
{
tipMsg
=
"是否禁用【"
+
obj
.
RoleName
+
"】角色?"
;
}
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
tipMsg
,
cancel
:
true
,
persistent
:
true
}).
onOk
(()
=>
{
setRoleStatus
(
delMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
that
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'操作成功'
,
position
:
'top'
})
that
.
getRolelist
();
}
})
});
}
}
}
...
...
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