|
|
@ -20,7 +20,7 @@ |
|
|
|
<el-table :data="roleTable" border style="width: 100%;"> |
|
|
|
<el-table-column label="序号" width="50px" type="index" align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="440px" align="center"> |
|
|
|
<el-table-column label="操作" width="440px" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button @click="sourceMenus(scope.row)" type="primary" size="mini">资源授权</el-button> |
|
|
|
<el-button @click="funMenus(scope.row)" type="primary" size="mini">功能授权</el-button> |
|
|
@ -54,18 +54,18 @@ |
|
|
|
<el-dialog :title="dialogTitle + '角色信息'" :visible.sync="editDialog" width="40%"> |
|
|
|
<table class="e-table" cellspacing="0"> |
|
|
|
<tr> |
|
|
|
<td>岗位</td> |
|
|
|
<td> |
|
|
|
<el-select v-model="roleForm.postSid" style="width:300px"> |
|
|
|
<el-option |
|
|
|
v-for="(item, i) in postSidData" |
|
|
|
:key="i" |
|
|
|
:label="item.name" |
|
|
|
:value="item.sid"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<td>岗位</td> |
|
|
|
<td> |
|
|
|
<el-select v-model="roleForm.postSid" style="width:300px"> |
|
|
|
<el-option |
|
|
|
v-for="(item, i) in postSidData" |
|
|
|
:key="i" |
|
|
|
:label="item.name" |
|
|
|
:value="item.sid"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>角色名称</td> |
|
|
|
<td> |
|
|
@ -153,9 +153,9 @@ |
|
|
|
<el-input v-model="roleForm.name" readonly></el-input> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr > |
|
|
|
<tr> |
|
|
|
<td>可操作菜单列表</td> |
|
|
|
<td > |
|
|
|
<td> |
|
|
|
<div style="height:230px;line-height:120px;overflow:auto;overflow-x:hidden;"> |
|
|
|
<el-tree v-loading="loading" :data="treedata" ref="Tree" show-checkbox accordion node-key="sid" |
|
|
|
:default-expand-all='true' :check-strictly="true" |
|
|
@ -225,314 +225,314 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
roleOrgList, |
|
|
|
saveOrgroles, |
|
|
|
putOrgroles, |
|
|
|
delOrgroles, |
|
|
|
setRoleEnable, |
|
|
|
roleMenuTree, |
|
|
|
saveorgrolemenus, |
|
|
|
sourceMenuTree, |
|
|
|
saveSource, |
|
|
|
funMenuTree, |
|
|
|
savefunMenu, |
|
|
|
postList |
|
|
|
} from '@/api/system/roleAdminister/index.js' |
|
|
|
import { |
|
|
|
roleOrgList, |
|
|
|
saveOrgroles, |
|
|
|
putOrgroles, |
|
|
|
delOrgroles, |
|
|
|
setRoleEnable, |
|
|
|
roleMenuTree, |
|
|
|
saveorgrolemenus, |
|
|
|
sourceMenuTree, |
|
|
|
saveSource, |
|
|
|
funMenuTree, |
|
|
|
savefunMenu, |
|
|
|
postList |
|
|
|
} from '@/api/system/roleAdminister/index.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dialogTitle: '', |
|
|
|
activeName: 'roleList', |
|
|
|
roleForm: { |
|
|
|
name: '', |
|
|
|
code: '', |
|
|
|
sort: '', |
|
|
|
type: '2', |
|
|
|
postSid:'', |
|
|
|
remarks: '' |
|
|
|
}, |
|
|
|
formBackup: {}, |
|
|
|
search: { |
|
|
|
name: '' |
|
|
|
}, |
|
|
|
page: { |
|
|
|
total: 0, // 默认数据总数 |
|
|
|
current: 1, // 默认开始页面 |
|
|
|
size: 10, // 每页的数据条数 |
|
|
|
}, |
|
|
|
roleTable: [], |
|
|
|
postSidData:[], |
|
|
|
editDialog: false, |
|
|
|
// 树形 |
|
|
|
loading: false, |
|
|
|
defaultProps: { |
|
|
|
children: 'children', |
|
|
|
label: 'name' |
|
|
|
}, |
|
|
|
checkedId: [], // 菜单授权 已选中 |
|
|
|
treedata: [], // 菜单授权 |
|
|
|
chace: [], |
|
|
|
roleDialog: false, |
|
|
|
Thisrow: {}, |
|
|
|
// 资源授权 |
|
|
|
sourceDialog: false, |
|
|
|
sourcetreedata: [], |
|
|
|
sourcedefaultProps: { |
|
|
|
children: 'children', |
|
|
|
label: 'sourceName' |
|
|
|
}, |
|
|
|
// 功能授权 |
|
|
|
funDialog: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.formBackup = Object.assign({}, this.roleForm), |
|
|
|
this.getroleOrgList() |
|
|
|
this.getPostList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
pagination(val) { // 分页函数 |
|
|
|
this.page.current = val.pageNum |
|
|
|
this.page.size = val.pageSize |
|
|
|
this.getroleOrgList() |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dialogTitle: '', |
|
|
|
activeName: 'roleList', |
|
|
|
roleForm: { |
|
|
|
name: '', |
|
|
|
code: '', |
|
|
|
sort: '', |
|
|
|
type: '2', |
|
|
|
postSid: '', |
|
|
|
remarks: '' |
|
|
|
}, |
|
|
|
getPostList(){ |
|
|
|
postList().then((res)=>{ |
|
|
|
if(res.code==='200'){ |
|
|
|
this.postSidData=res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
formBackup: {}, |
|
|
|
search: { |
|
|
|
name: '' |
|
|
|
}, |
|
|
|
// 分页列表 |
|
|
|
getroleOrgList(flag) { |
|
|
|
if (flag == '1') { |
|
|
|
this.page.current = 1 |
|
|
|
} |
|
|
|
let params = this.page |
|
|
|
params.params = this.search |
|
|
|
roleOrgList(params).then(res => { |
|
|
|
this.page.total = res.data.total |
|
|
|
this.roleTable = res.data.records |
|
|
|
for (let i = 0; i < this.roleTable.length; i++) { |
|
|
|
if (this.roleTable[i].isEnable == '1') { |
|
|
|
this.roleTable[i].isEnableName = '是' |
|
|
|
} else { |
|
|
|
this.roleTable[i].isEnableName = '否' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
page: { |
|
|
|
total: 0, // 默认数据总数 |
|
|
|
current: 1, // 默认开始页面 |
|
|
|
size: 10 // 每页的数据条数 |
|
|
|
}, |
|
|
|
handleClick(tab, event) { |
|
|
|
if (tab.name == 'addrole') { |
|
|
|
this.dialogTitle = '新增' |
|
|
|
this.roleForm = Object.assign({}, this.formBackup) |
|
|
|
} else { |
|
|
|
this.getroleOrgList() |
|
|
|
} |
|
|
|
roleTable: [], |
|
|
|
postSidData: [], |
|
|
|
editDialog: false, |
|
|
|
// 树形 |
|
|
|
loading: false, |
|
|
|
defaultProps: { |
|
|
|
children: 'children', |
|
|
|
label: 'name' |
|
|
|
}, |
|
|
|
editRow(row) { |
|
|
|
this.dialogTitle = '编辑' |
|
|
|
this.editDialog = true |
|
|
|
this.roleForm = Object.assign({}, row) |
|
|
|
checkedId: [], // 菜单授权 已选中 |
|
|
|
treedata: [], // 菜单授权 |
|
|
|
chace: [], |
|
|
|
roleDialog: false, |
|
|
|
Thisrow: {}, |
|
|
|
// 资源授权 |
|
|
|
sourceDialog: false, |
|
|
|
sourcetreedata: [], |
|
|
|
sourcedefaultProps: { |
|
|
|
children: 'children', |
|
|
|
label: 'sourceName' |
|
|
|
}, |
|
|
|
delRow(row) { |
|
|
|
this.$confirm('确定要删除该角色吗, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
delOrgroles({ |
|
|
|
sid: row.sid |
|
|
|
}).then(res => { |
|
|
|
this.getroleOrgList() |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: '删除成功!' |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 保存角色 |
|
|
|
save() { |
|
|
|
if (this.roleForm.sid) { |
|
|
|
putOrgroles(this.roleForm).then(res => { |
|
|
|
if (res.code == '200') { |
|
|
|
this.getroleOrgList() |
|
|
|
this.editDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
saveOrgroles(this.roleForm).then(res => { |
|
|
|
if (res.code == '200') { |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
this.activeName = "roleList" |
|
|
|
this.getroleOrgList() |
|
|
|
} |
|
|
|
}) |
|
|
|
// 功能授权 |
|
|
|
funDialog: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.formBackup = Object.assign({}, this.roleForm), |
|
|
|
this.getroleOrgList() |
|
|
|
this.getPostList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
pagination(val) { // 分页函数 |
|
|
|
this.page.current = val.pageNum |
|
|
|
this.page.size = val.pageSize |
|
|
|
this.getroleOrgList() |
|
|
|
}, |
|
|
|
getPostList() { |
|
|
|
postList().then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.postSidData = res.data |
|
|
|
} |
|
|
|
}, |
|
|
|
// 是否可用 按钮 |
|
|
|
enabledChange(value, row) { |
|
|
|
setRoleEnable({ |
|
|
|
isEnable: value, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 分页列表 |
|
|
|
getroleOrgList(flag) { |
|
|
|
if (flag == '1') { |
|
|
|
this.page.current = 1 |
|
|
|
} |
|
|
|
let params = this.page |
|
|
|
params.params = this.search |
|
|
|
roleOrgList(params).then(res => { |
|
|
|
this.page.total = res.data.total |
|
|
|
this.roleTable = res.data.records |
|
|
|
for (let i = 0; i < this.roleTable.length; i++) { |
|
|
|
if (this.roleTable[i].isEnable == '1') { |
|
|
|
this.roleTable[i].isEnableName = '是' |
|
|
|
} else { |
|
|
|
this.roleTable[i].isEnableName = '否' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleClick(tab, event) { |
|
|
|
if (tab.name == 'addrole') { |
|
|
|
this.dialogTitle = '新增' |
|
|
|
this.roleForm = Object.assign({}, this.formBackup) |
|
|
|
} else { |
|
|
|
this.getroleOrgList() |
|
|
|
} |
|
|
|
}, |
|
|
|
editRow(row) { |
|
|
|
this.dialogTitle = '编辑' |
|
|
|
this.editDialog = true |
|
|
|
this.roleForm = Object.assign({}, row) |
|
|
|
}, |
|
|
|
delRow(row) { |
|
|
|
this.$confirm('确定要删除该角色吗, 是否继续?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
delOrgroles({ |
|
|
|
sid: row.sid |
|
|
|
}).then(res => { |
|
|
|
this.getroleOrgList() |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: res.msg |
|
|
|
message: '删除成功!' |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
sourceMenus(row) { |
|
|
|
this.sourceDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} |
|
|
|
sourceMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 保存角色 |
|
|
|
save() { |
|
|
|
if (this.roleForm.sid) { |
|
|
|
putOrgroles(this.roleForm).then(res => { |
|
|
|
if (res.code == '200') { |
|
|
|
this.getroleOrgList() |
|
|
|
this.editDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.treedata = res.data |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
funMenus(row) { |
|
|
|
this.funDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} else { |
|
|
|
saveOrgroles(this.roleForm).then(res => { |
|
|
|
if (res.code == '200') { |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
this.activeName = "roleList" |
|
|
|
this.getroleOrgList() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 是否可用 按钮 |
|
|
|
enabledChange(value, row) { |
|
|
|
setRoleEnable({ |
|
|
|
sid: row.sid, |
|
|
|
isEnable: value |
|
|
|
}).then(res => { |
|
|
|
this.$message({ |
|
|
|
type: 'success', |
|
|
|
message: res.msg |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
sourceMenus(row) { |
|
|
|
this.sourceDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} |
|
|
|
sourceMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
} |
|
|
|
} |
|
|
|
funMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
this.treedata = res.data |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
funMenus(row) { |
|
|
|
this.funDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} |
|
|
|
funMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
} |
|
|
|
for (let j = 0; j < data1[i].children.length; j++) { |
|
|
|
let data2 = data1[i].children |
|
|
|
if (data2[j].checked == 0) { |
|
|
|
this.checkedId.push(data2[j].sid) |
|
|
|
} |
|
|
|
for (let j = 0; j < data1[i].children.length; j++) { |
|
|
|
let data2 = data1[i].children |
|
|
|
if (data2[j].checked == 0) { |
|
|
|
this.checkedId.push(data2[j].sid) |
|
|
|
} |
|
|
|
for (let k = 0; k < data2[j].children.length; k++) { |
|
|
|
let data3 = data2[j].children |
|
|
|
if (data3[k].checked == 0) { |
|
|
|
this.checkedId.push(data3[k].sid) |
|
|
|
} |
|
|
|
for (let k = 0; k < data2[j].children.length; k++) { |
|
|
|
let data3 = data2[j].children |
|
|
|
if (data3[k].checked == 0) { |
|
|
|
this.checkedId.push(data3[k].sid) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.treedata = res.data |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取授权菜单树形 |
|
|
|
roleMenus(row) { |
|
|
|
this.roleDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} |
|
|
|
roleMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
this.treedata = res.data |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取授权菜单树形 |
|
|
|
roleMenus(row) { |
|
|
|
this.roleDialog = true |
|
|
|
this.checkedId = [] |
|
|
|
this.roleForm.name = row.name |
|
|
|
this.Thisrow = row |
|
|
|
this.loading = true |
|
|
|
let params = { |
|
|
|
roleSid: row.sid |
|
|
|
} |
|
|
|
roleMenuTree(params).then(res => { |
|
|
|
let data1 = res.data |
|
|
|
for (let i = 0; i < data1.length; i++) { |
|
|
|
if (data1[i].checked == 0) { |
|
|
|
this.checkedId.push(data1[i].sid) |
|
|
|
} |
|
|
|
for (let j = 0; j < data1[i].children.length; j++) { |
|
|
|
let data2 = data1[i].children |
|
|
|
if (data2[j].checked == 0) { |
|
|
|
this.checkedId.push(data2[j].sid) |
|
|
|
} |
|
|
|
for (let j = 0; j < data1[i].children.length; j++) { |
|
|
|
let data2 = data1[i].children |
|
|
|
if (data2[j].checked == 0) { |
|
|
|
this.checkedId.push(data2[j].sid) |
|
|
|
} |
|
|
|
for (let k = 0; k < data2[j].children.length; k++) { |
|
|
|
let data3 = data2[j].children |
|
|
|
if (data3[k].checked == 0) { |
|
|
|
this.checkedId.push(data3[k].sid) |
|
|
|
} |
|
|
|
for (let k = 0; k < data2[j].children.length; k++) { |
|
|
|
let data3 = data2[j].children |
|
|
|
if (data3[k].checked == 0) { |
|
|
|
this.checkedId.push(data3[k].sid) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.treedata = res.data |
|
|
|
this.getTreeParentNode(res.data, this.checkedId) |
|
|
|
this.getTreeParentid(res.data) |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 递归查询所有上级数据 |
|
|
|
getTreeParentNode(menus, ids) { |
|
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
|
if (menus[i].children && menus[i].children.length != 0) { |
|
|
|
this.getTreeParentNode(menus[i].children, ids) |
|
|
|
} else if (menus[i].isCheck) { |
|
|
|
ids.push(menus[i].sid) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 所有一级菜单ID |
|
|
|
getTreeParentid(menus) { |
|
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
|
this.chace.push(menus[i].sid) |
|
|
|
this.treedata = res.data |
|
|
|
this.getTreeParentNode(res.data, this.checkedId) |
|
|
|
this.getTreeParentid(res.data) |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 递归查询所有上级数据 |
|
|
|
getTreeParentNode(menus, ids) { |
|
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
|
if (menus[i].children && menus[i].children.length !== 0) { |
|
|
|
this.getTreeParentNode(menus[i].children, ids) |
|
|
|
} else if (menus[i].isCheck) { |
|
|
|
ids.push(menus[i].sid) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
// 所有一级菜单ID |
|
|
|
getTreeParentid(menus) { |
|
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
|
this.chace.push(menus[i].sid) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 资源授权保存 |
|
|
|
sourceSave() { |
|
|
|
let _this = this |
|
|
|
let sourceMenus = this.$refs.sourceTree.getCheckedKeys() |
|
|
|
let params = { |
|
|
|
sorceSid: sourceMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
saveSource(params).then(res => { |
|
|
|
this.sourceDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
sourceSave() { |
|
|
|
let _this = this |
|
|
|
let sourceMenus = this.$refs.sourceTree.getCheckedKeys() |
|
|
|
let params = { |
|
|
|
sorceSid: sourceMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
saveSource(params).then(res => { |
|
|
|
this.sourceDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
}, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 功能授权保存 |
|
|
|
funSave() { |
|
|
|
let _this = this |
|
|
|
let funMenus = this.$refs.funTree.getCheckedKeys() |
|
|
|
let params = { |
|
|
|
functionSid: funMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
savefunMenu(params).then(res => { |
|
|
|
this.funDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
funSave() { |
|
|
|
let _this = this |
|
|
|
let funMenus = this.$refs.funTree.getCheckedKeys() |
|
|
|
let params = { |
|
|
|
functionSid: funMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
savefunMenu(params).then(res => { |
|
|
|
this.funDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
}, |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 菜单授权 |
|
|
|
getCheckedKeys() { |
|
|
|
let _this = this |
|
|
|
let roleMenus = [] |
|
|
|
roleMenus = this.$refs.Tree.getCheckedKeys() |
|
|
|
getCheckedKeys() { |
|
|
|
let _this = this |
|
|
|
let roleMenus = [] |
|
|
|
roleMenus = this.$refs.Tree.getCheckedKeys() |
|
|
|
|
|
|
|
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys() |
|
|
|
// for (let i = 0; i < parentTrue.length; i++) { |
|
|
@ -542,27 +542,27 @@ |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
let params = { |
|
|
|
menuSid: roleMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
saveorgrolemenus(params).then(res => { |
|
|
|
this.roleDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
let params = { |
|
|
|
menuSid: roleMenus.toString(), |
|
|
|
roleSid: _this.Thisrow.sid |
|
|
|
} |
|
|
|
saveorgrolemenus(params).then(res => { |
|
|
|
this.roleDialog = false |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkchange() { |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkchange() { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped="scoped"> |
|
|
|
.my-tabs { |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
.my-tabs { |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
</style> |
|
|
|