Commit 529686b6 authored by zhengke's avatar zhengke

修改

parent 23be16ad
......@@ -10,7 +10,7 @@
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SName" ref="SName"
class="col-6 q-pr-lg q-pb-lg" label="校区名称" :rules="[val => !!val || '请填写校区名称']" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.SAddress" ref="SAddress"
class="col-6 q-pb-lg" label="校区地址" />
class="col-6 q-pb-lg" label="校区地址" :rules="[val => !!val || '请填写校区地址']" />
<q-select class="col-6 q-pb-lg q-pr-lg" clearable filled stack-label use-input option-value="Id"
option-label="EmployeeName" v-model="objOption.ManagerId" ref="ManagerId" :options="EmployeeList"
label="校区联系人" :dense="false" emit-value map-options @filter="filterFn">
......@@ -23,7 +23,7 @@
</template>
</q-select>
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.SLinkTel" ref="SLinkTel"
class="col-6 q-pb-lg" label="校区联系电话" />
class="col-6 q-pb-lg" label="校区联系电话" :rules="[val => !!val || '请填写校区联系电话']" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.Remark"
class="col-6 q-pb-lg q-pr-lg" label="校区备注" />
<selectTree v-if="DeptList&&DeptList.length>0" :treeData='DeptList' :defaultArray="returnString"
......@@ -182,15 +182,6 @@
},
//保存校区
saveSchool() {
if(this.objOption.SName==''){
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写校区名称`
})
return;
}
this.saveLoading = true;
this.$refs.SName.validate()
this.$refs.SAddress.validate()
this.$refs.SLinkTel.validate()
......@@ -202,6 +193,7 @@
if (this.tempManager && this.tempManager.Id) {
this.objOption.ManagerId = this.tempManager.Id;
}
this.saveLoading = true;
saveSchool(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
......
......@@ -34,21 +34,21 @@
}
.role-form .role_TreeList::-webkit-scrollbar {
width: 3px;
height: 3px;
background-color: #F5F5F5;
width: 3px;
height: 3px;
background-color: #F5F5F5;
}
.role-form .role_TreeList::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
.role-form .role_TreeList::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae;
border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae;
}
......@@ -79,9 +79,11 @@
border-radius: 4px;
overflow: auto;
}
.role-form .role_ItemList:last-child{
margin-right:0;
.role-form .role_ItemList:last-child {
margin-right: 0;
}
.role-form .role_ItemList::-webkit-scrollbar {
width: 3px;
height: 6px;
......@@ -475,104 +477,99 @@
},
//保存菜单
saveRole() {
if (this.objOption.RoleName == "") {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写角色名称!`
})
return;
}
this.saveLoading = true;
//角色菜单权限
var rolePermissionList = [];
//角色功能权限
var roleFunctionList = [];
if (this.AuthMenuList && this.AuthMenuList.length > 0) {
this.AuthMenuList.forEach(item => {
//一级菜单权限
if (item.IsChecked) {
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) {
//系统菜单
if (secondItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: secondItem.MenuId
});
} //功能菜单
else if (secondItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: secondItem.MenuId
});
}
}
//三级菜单权限
if (secondItem.SubList && secondItem.SubList.length > 0) {
secondItem.SubList.forEach(thirdItem => {
if (thirdItem.IsChecked) {
//系统菜单
if (thirdItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: thirdItem.MenuId
});
}
//功能菜单
else if (thirdItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: thirdItem.MenuId
});
}
this.$refs.RoleName.validate()
if (!this.$refs.RoleName.hasError) {
this.saveLoading = true;
//角色菜单权限
var rolePermissionList = [];
//角色功能权限
var roleFunctionList = [];
if (this.AuthMenuList && this.AuthMenuList.length > 0) {
this.AuthMenuList.forEach(item => {
//一级菜单权限
if (item.IsChecked) {
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) {
//系统菜单
if (secondItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: secondItem.MenuId
});
} //功能菜单
else if (secondItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: secondItem.MenuId
});
}
//四级--功能权限
if (thirdItem.SubList && thirdItem.SubList.length > 0) {
thirdItem.SubList.forEach(fourthItem => {
if (fourthItem.IsChecked) {
}
//三级菜单权限
if (secondItem.SubList && secondItem.SubList.length > 0) {
secondItem.SubList.forEach(thirdItem => {
if (thirdItem.IsChecked) {
//系统菜单
if (thirdItem.MenuType == 1) {
rolePermissionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Menu_Id: thirdItem.MenuId
});
}
//功能菜单
else if (thirdItem.MenuType == 2) {
roleFunctionList.push({
ID: 0,
Role_Id: this.objOption.RoleId,
Action_Id: fourthItem.MenuId
Action_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
});
}
})
}
});
}
})
}
})
}
this.objOption.RolePermissionList = rolePermissionList;
this.objOption.RoleFunctionList = roleFunctionList;
saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
}
this.objOption.RolePermissionList = rolePermissionList;
this.objOption.RoleFunctionList = roleFunctionList;
saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
}
},
}
......
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