Commit 008d184d authored by 黄奎's avatar 黄奎

页面修改

parent cc999715
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
saveObj: { saveObj: {
type: Object, type: Object,
default: null default: null
},
paramObj:{
type:Number,
default:0
} }
}, },
data() { data() {
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
persistent: true, persistent: true,
objOption: { objOption: {
Id: 0, //主键编号 Id: 0, //主键编号
Menu_Id: 0, //菜单编号 MenuId: 0, //菜单编号
FunctionName: "", //权限名称 FunctionName: "", //权限名称
FunctionCode: "", //权限编号 FunctionCode: "", //权限编号
Remarks: "", //权限备注 Remarks: "", //权限备注
...@@ -67,7 +71,7 @@ ...@@ -67,7 +71,7 @@
Id: this.saveObj.Id Id: this.saveObj.Id
}).then(res => { }).then(res => {
this.objOption.Id = res.Data.Id; this.objOption.Id = res.Data.Id;
this.objOption.Menu_Id = res.Data.Menu_Id; this.objOption.MenuId = res.Data.MenuId;
this.objOption.FunctionName = res.Data.FunctionName; this.objOption.FunctionName = res.Data.FunctionName;
this.objOption.FunctionCode = res.Data.FunctionCode; this.objOption.FunctionCode = res.Data.FunctionCode;
this.objOption.Remarks = res.Data.Remarks; this.objOption.Remarks = res.Data.Remarks;
...@@ -77,7 +81,7 @@ ...@@ -77,7 +81,7 @@
} else { } else {
this.optionTitle = "新增菜单功能权限" this.optionTitle = "新增菜单功能权限"
this.objOption.Id = 0; this.objOption.Id = 0;
this.objOption.Menu_Id = 0; this.objOption.MenuId = this.paramObj;
this.objOption.FunctionName = ""; this.objOption.FunctionName = "";
this.objOption.FunctionCode = ""; this.objOption.FunctionCode = "";
this.objOption.Remarks = ""; this.objOption.Remarks = "";
......
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
font-size: 12px; font-size: 12px;
white-space: nowrap; white-space: nowrap;
} }
.role-form .role_TreeList{
height:250px; .role-form .role_TreeList {
height: 250px;
overflow: auto; overflow: auto;
} }
.role-form .role_TreeList::-webkit-scrollbar { .role-form .role_TreeList::-webkit-scrollbar {
width: 3px; width: 3px;
height: 3px; height: 3px;
...@@ -65,6 +67,7 @@ ...@@ -65,6 +67,7 @@
border-radius: 4px; border-radius: 4px;
overflow: auto; overflow: auto;
} }
.role-form .role_ItemList::-webkit-scrollbar { .role-form .role_ItemList::-webkit-scrollbar {
width: 3px; width: 3px;
height: 6px; height: 6px;
...@@ -111,7 +114,7 @@ ...@@ -111,7 +114,7 @@
width: 100%; width: 100%;
height: 40px; height: 40px;
background-color: #3fc4ff; background-color: #3fc4ff;
padding:0 10px 0 20px; padding: 0 10px 0 20px;
display: flex; display: flex;
align-items: center; align-items: center;
color: #fff; color: #fff;
...@@ -122,11 +125,13 @@ ...@@ -122,11 +125,13 @@
margin: 20px 0; margin: 20px 0;
white-space: nowrap; white-space: nowrap;
overflow: auto; overflow: auto;
padding-bottom:20px; padding-bottom: 20px;
} }
.role-form .role_textarea .q-field__control-container{
height:85px; .role-form .role_textarea .q-field__control-container {
height: 85px;
} }
</style> </style>
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
...@@ -143,7 +148,8 @@ ...@@ -143,7 +148,8 @@
</div> </div>
</div> </div>
<div class="row wrap role_textarea"> <div class="row wrap role_textarea">
<q-input filled v-model="objOption.RoleIntro" class="col-12 row-2" maxlength="100" label="角色介绍" type="textarea" /> <q-input filled v-model="objOption.RoleIntro" class="col-12 row-2" maxlength="100" label="角色介绍"
type="textarea" />
<div class="col-12 q-pr-lg q-pb-lg q-pt-lg"> <div class="col-12 q-pr-lg q-pb-lg q-pt-lg">
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status" <q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status"
title="注意:关闭后,角色将无法正常使用." /> title="注意:关闭后,角色将无法正常使用." />
...@@ -161,39 +167,13 @@ ...@@ -161,39 +167,13 @@
<q-checkbox v-model="subItem.IsChecked" /> <q-checkbox v-model="subItem.IsChecked" />
</div> </div>
<div class="role_TreeList"> <div class="role_TreeList">
<q-tree v-if="subItem.SubList.length>0" :nodes="subItem.SubList" node-key="MenuId" <q-tree v-if="subItem.SubList.length>0" :nodes="subItem.SubList" node-key="MenuId" label-key="MenuName"
label-key="MenuName" children-key="SubList" tick-strategy="strict" :default-expand-all="true" children-key="SubList" tick-strategy="strict" :default-expand-all="true" no-connectors
no-connectors :ticked.sync="chooseCategroyArray"> :ticked.sync="chooseCategroyArray">
</q-tree> </q-tree>
</div> </div>
</div> </div>
</div> </div>
<!-- <q-card>
<template v-for="(item,index) in AuthMenuList">
<q-checkbox v-model="item.IsChecked" :label="item.MenuName"
@input="menuChange(item)" />
</template>
<div class="row wrap">
<template v-if="SubMenuList&&SubMenuList.length>0" v-for="(subItem,subIndex) in SubMenuList">
<q-card class="my-card" flat style="width:200px;border:1px solid red;float:left;">
<q-card-section>
<div class="text-h6">
<q-checkbox v-model="subItem.IsChecked" :false-value="subItem.IsChecked"
:label="subItem.MenuName" />
</div>
<template v-if="subItem.SubList&&subItem.SubList.length>0"
v-for="(chiildItem,index) in subItem.SubList">
<span style="display:inline-block">
&nbsp;&nbsp;
<q-checkbox v-model="chiildItem.IsChecked" :false-value="chiildItem.IsChecked"
:label="chiildItem.MenuName" />
</span>
</template>
</q-card-section>
</q-card>
</template>
</div>
</q-card> -->
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
...@@ -229,7 +209,9 @@ ...@@ -229,7 +209,9 @@
RoleId: 0, //角色编号 RoleId: 0, //角色编号
RoleName: "", //角色名称 RoleName: "", //角色名称
RoleIntro: "", //角色介绍 RoleIntro: "", //角色介绍
Status: 0, //状态(0-正常,1-禁用)}, Status: 0, //状态(0-正常,1-禁用),
RolePermissionList: [], //菜单权限
RoleFunctionList: [], //功能权限
}, },
returnString: [], returnString: [],
optionTitle: "", optionTitle: "",
...@@ -238,7 +220,7 @@ ...@@ -238,7 +220,7 @@
SubMenuList: [], //下级菜单权限 SubMenuList: [], //下级菜单权限
group: [], group: [],
checkedIndex: 0, //默认选中 checkedIndex: 0, //默认选中
chooseCategroyArray:[], chooseCategroyArray: [],
} }
}, },
computed: { computed: {
...@@ -251,26 +233,21 @@ ...@@ -251,26 +233,21 @@
methods: { methods: {
//菜单切换 //菜单切换
menuChange(item) { menuChange(item) {
console.log(item, 'item111');
this.SubMenuList = []; this.SubMenuList = [];
if (item.IsChecked) { if (item.IsChecked) {
this.SubMenuList = item.SubList; this.SubMenuList = item.SubList;
} }
console.log(this.SubMenuList, 'submenuList');
}, },
//点击选中 //点击选中
getItem(item, index) { getItem(item, index) {
if(this.checkedIndex != index){ if (this.checkedIndex != index) {
this.checkedIndex = index; this.checkedIndex = index;
this.SubMenuList = []; this.SubMenuList = [];
this.SubMenuList = item.SubList; this.SubMenuList = item.SubList;
}else{ } else {
this.checkedIndex=-1; this.checkedIndex = -1;
this.SubMenuList = []; this.SubMenuList = [];
} }
// this.checkedIndex = index;
// this.SubMenuList = [];
// this.SubMenuList = item.SubList;
}, },
//获取权限 //获取权限
queryRolePermission() { queryRolePermission() {
...@@ -278,11 +255,10 @@ ...@@ -278,11 +255,10 @@
Role_Id: this.objOption.RoleId Role_Id: this.objOption.RoleId
}; };
GetRolePermission(qMsg).then(res => { GetRolePermission(qMsg).then(res => {
console.log("res", res.Data)
if (res.Code == 1) { if (res.Code == 1) {
this.AuthMenuList = res.Data; this.AuthMenuList = res.Data;
if(this.AuthMenuList.length>0){ if (this.AuthMenuList.length > 0) {
this.SubMenuList=this.AuthMenuList[0].SubList; this.SubMenuList = this.AuthMenuList[0].SubList;
} }
} }
}).catch(() => {}) }).catch(() => {})
...@@ -316,19 +292,61 @@ ...@@ -316,19 +292,61 @@
}, },
//保存菜单 //保存菜单
saveRole() { saveRole() {
this.saveLoading = true; //this.saveLoading = true;
var tempArray = []; //角色菜单权限
var rolePermissionList = [];
//角色功能权限
var roleFunctionList = [];
if (this.AuthMenuList && this.AuthMenuList.length > 0) { if (this.AuthMenuList && this.AuthMenuList.length > 0) {
this.AuthMenuList.forEach(item => { this.AuthMenuList.forEach(item => {
//一级菜单权限
if (item.IsChecked) { if (item.IsChecked) {
tempArray.push({ rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: item.MenuId
});
}
//二级菜单权限
if (item.SubList && item.SubList.length > 0) {
item.SubList.forEach(secondItem => {
if (secondItem.IsChecked) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: secondItem.MenuId
});
}
//三级菜单权限
if (secondItem.SubList && secondItem.SubList.length > 0) {
secondItem.SubList.forEach(thirdItem => {
if (thirdItem.IsChecked) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: thirdItem.MenuId
});
}
//四级--功能权限
if (thirdItem.SubList && thirdItem.SubList.length > 0) {
thirdItem.SubList.forEach(fourthItem => {
if (fourthItem.IsChecked) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: fourthItem.MenuId
}); });
} }
}) })
} }
console.log() });
}
})
}
})
}
this.objOption.RolePermissionList = rolePermissionList;
this.objOption.RoleFunctionList = roleFunctionList;
saveRoleInfo(this.objOption).then(res => { saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false this.saveLoading = false
this.$q.notify({ this.$q.notify({
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<menufunction-form v-if="isShowMenuForm" :save-obj="menuObjOption" @close="closeMenuSaveForm" @success="refreshPage"> <menufunction-form v-if="isShowMenuForm" :save-obj="menuObjOption" :paramObj="MenuId" @close="closeMenuSaveForm" @success="refreshPage">
</menufunction-form> </menufunction-form>
</div> </div>
</div> </div>
......
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