Commit 174cd757 authored by Mac's avatar Mac

1

parent 5bd0f1fb
<style>
</style>
<template> <template>
<q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale"> <q-dialog v-model="persistent" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;"> <q-card style="width: 800px;max-width:900px;" class="post-form">
<q-card-section> <q-card-section>
<div class="text-h6">{{objOption.MenuId==0?'新增岗位信息':'修改岗位信息'}}</div> <div class="text-h6">{{objOption.MenuId==0?'新增岗位信息':'修改岗位信息'}}</div>
</q-card-section> </q-card-section>
...@@ -20,12 +23,18 @@ ...@@ -20,12 +23,18 @@
</div> </div>
<div class="text-caption q-mb-lg q-px-md text-grey-6">绑定角色</div> <div class="text-caption q-mb-lg q-px-md text-grey-6">绑定角色</div>
<div class="row wrap"> <div class="row wrap">
<div v-for="(item,index) in RoleList"> <template>
<div> <el-transfer
<span>{{item.RoleName}}</span> filterable
<q-checkbox v-model="item.IsChecked" /> :filter-method="filterMethod"
</div> filter-placeholder="请输入城市拼音"
</div> :props="{key: 'RoleId',label: 'RoleName'}"
v-model="value"
:titles="['可选角色', '已选角色']"
:data="data">
</el-transfer>
</template>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
...@@ -79,6 +88,11 @@ ...@@ -79,6 +88,11 @@
DeptTreeList: [], DeptTreeList: [],
saveLoading: false, saveLoading: false,
RoleList: [], //角色列表 RoleList: [], //角色列表
data: [],
value: [],
filterMethod(query, item) {//根据名称搜索
return item.RoleName.indexOf(query) > -1;
}
} }
}, },
created() { created() {
...@@ -93,6 +107,7 @@ ...@@ -93,6 +107,7 @@
getRoleList() { getRoleList() {
queryRoleDropdown({}).then(res => { queryRoleDropdown({}).then(res => {
this.RoleList = res.Data; this.RoleList = res.Data;
this.data = res.Data;
}) })
}, },
getChild(menuArray) { getChild(menuArray) {
...@@ -121,6 +136,12 @@ ...@@ -121,6 +136,12 @@
this.returnString.push(this.objOption.RB_Dept_Id); this.returnString.push(this.objOption.RB_Dept_Id);
this.objOption.PostName = res.Data.PostName; this.objOption.PostName = res.Data.PostName;
this.objOption.Status = res.Data.Status; this.objOption.Status = res.Data.Status;
if(res.Data.PostRoleList.length>0){
res.Data.PostRoleList.forEach(x=>{
this.value.push(x.RoleId)
})
}
}) })
this.optionTitle = "修改岗位信息" this.optionTitle = "修改岗位信息"
} else { } else {
...@@ -131,6 +152,7 @@ ...@@ -131,6 +152,7 @@
this.objOption.Status = 0; this.objOption.Status = 0;
} }
}, },
//关闭弹窗 //关闭弹窗
closeSaveForm() { closeSaveForm() {
this.$emit('close') this.$emit('close')
...@@ -140,14 +162,12 @@ ...@@ -140,14 +162,12 @@
savePost() { savePost() {
var tempRole = []; var tempRole = [];
if (this.RoleList && this.RoleList.length > 0) { if (this.RoleList && this.RoleList.length > 0) {
this.RoleList.forEach(item => { this.RoleList.forEach(x => {
if (item.IsChecked) { this.value.forEach(j=>{
tempRole.push({ if(x.RoleId==j){
Id: 0, tempRole.push(x)
PostId: 0, }
RoleId: item.RoleId })
});
}
}) })
} }
this.objOption.PostRoleList=tempRole; this.objOption.PostRoleList=tempRole;
......
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