Commit c654fdbc authored by 黄奎's avatar 黄奎

页面修改

parent 48c15c81
...@@ -100,6 +100,18 @@ export function saveMenu(data) { ...@@ -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 * @param {JSON参数} data
...@@ -148,3 +160,15 @@ export function saveRoleInfo(data) { ...@@ -148,3 +160,15 @@ export function saveRoleInfo(data) {
data data
}) })
} }
/**
* 修改角色状态
* @param {JSON对象} data
*/
export function setRoleStatus(data) {
return request({
url: '/Public/SetRoleStatus',
method: 'post',
data
})
}
\ No newline at end of file
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
separator="none" title="菜单信息" :data="data" :columns="columns" row-key="name"> separator="none" title="菜单信息" :data="data" :columns="columns" row-key="name">
<template v-slot:body-cell-Status="props"> <template v-slot:body-cell-Status="props">
<q-td :props="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> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -56,7 +57,8 @@ ...@@ -56,7 +57,8 @@
import { import {
getMenuPage, getMenuPage,
getMenuTypeList, getMenuTypeList,
getMenuLevelList getMenuLevelList,
updateMenuStatus,
} from '../../api/system/index' } from '../../api/system/index'
import menuForm from '../../components/system/menu-form' import menuForm from '../../components/system/menu-form'
export default { export default {
...@@ -220,6 +222,39 @@ ...@@ -220,6 +222,39 @@
//关闭弹窗 //关闭弹窗
closeMenuSaveForm() { closeMenuSaveForm() {
this.isShowMenuForm = false 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();
}
})
});
} }
} }
} }
......
...@@ -20,7 +20,10 @@ ...@@ -20,7 +20,10 @@
separator="none" title="角色信息" :data="data" :columns="columns" row-key="name"> separator="none" title="角色信息" :data="data" :columns="columns" row-key="name">
<template v-slot:body-cell-Status="props"> <template v-slot:body-cell-Status="props">
<q-td :props="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> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -42,7 +45,8 @@ ...@@ -42,7 +45,8 @@
<script> <script>
import { import {
queryRolePage queryRolePage,
setRoleStatus
} from '../../api/system/index' } from '../../api/system/index'
import roleForm from '../../components/system/role-form' import roleForm from '../../components/system/role-form'
export default { export default {
...@@ -172,6 +176,39 @@ ...@@ -172,6 +176,39 @@
//关闭弹窗 //关闭弹窗
closeroleSaveForm() { closeroleSaveForm() {
this.isShowRoleForm = false 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();
}
})
});
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment