|
|
@@ -182,6 +182,14 @@ |
|
|
|
@click="handlePermission(scope.row)" |
|
|
|
>权限 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
v-if="roleManager_btn_perm" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
icon="el-icon-plus" |
|
|
|
@click="geTmenu(scope.row)" |
|
|
|
>小程序权限 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@@ -320,6 +328,37 @@ |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
:visible.sync="geTmenuListisshow" |
|
|
|
:close-on-click-modal="false" |
|
|
|
title="小程序权限" |
|
|
|
> |
|
|
|
<div class="dialog-main-tree"> |
|
|
|
<el-tree |
|
|
|
ref="menuTree" |
|
|
|
:data="geTmenuList" |
|
|
|
:default-checked-keys="checkedKeys2" |
|
|
|
:check-strictly="false" |
|
|
|
:props="defaultProps9" |
|
|
|
:filter-node-method="filterNode" |
|
|
|
class="filter-tree" |
|
|
|
node-key="id" |
|
|
|
highlight-current |
|
|
|
show-checkbox |
|
|
|
/> |
|
|
|
<!-- default-expand-all --> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" size="small" @click="updatePermession2(roleId2)" |
|
|
|
>更 新 |
|
|
|
</el-button> |
|
|
|
<el-button type="default" size="small" @click="cancal()" |
|
|
|
>取消</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@@ -329,12 +368,14 @@ import { |
|
|
|
delObj, |
|
|
|
fetchList, |
|
|
|
fetchRoleTree, |
|
|
|
fetchRoleTree2, |
|
|
|
permissionUpd, |
|
|
|
papiMenuUpd, |
|
|
|
putObj, |
|
|
|
} from "@/api/admin/role"; |
|
|
|
import { tableOption } from "@/const/crud/admin/role"; |
|
|
|
import { fetchTree } from "@/api/admin/dept"; |
|
|
|
import { fetchMenuTree } from "@/api/admin/menu"; |
|
|
|
import { fetchMenuTree, fetchMenuTree2} from "@/api/admin/menu"; |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
|
|
|
export default { |
|
|
@@ -414,6 +455,19 @@ export default { |
|
|
|
roleManager_btn_edit: false, |
|
|
|
roleManager_btn_del: false, |
|
|
|
roleManager_btn_perm: false, |
|
|
|
|
|
|
|
|
|
|
|
geTmenuList:[], |
|
|
|
geTmenuListisshow:false, |
|
|
|
checkedKeys2:[], |
|
|
|
defaultProps9: { |
|
|
|
label: "name", |
|
|
|
value: "id", |
|
|
|
}, |
|
|
|
roleId2:'', |
|
|
|
roleCode2:'', |
|
|
|
menuIds2:'' |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
async created() { |
|
|
@@ -433,6 +487,36 @@ export default { |
|
|
|
...mapGetters(["elements", "permissions"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
geTmenu(row){ |
|
|
|
fetchRoleTree2(row.roleId).then((response) => { |
|
|
|
this.checkedKeys2 = response.data; |
|
|
|
return fetchMenuTree2(); |
|
|
|
}).then((response) => { |
|
|
|
this.geTmenuList = response.data; |
|
|
|
console.log(this.geTmenuList,'55555555555') |
|
|
|
// 解析出所有的太监节点 |
|
|
|
this.checkedKeys2 = this.resolveAllEunuchNodeId( |
|
|
|
this.geTmenuList, |
|
|
|
this.checkedKeys2, |
|
|
|
[] |
|
|
|
); |
|
|
|
this.geTmenuListisshow = true; |
|
|
|
this.roleId2 = row.roleId; |
|
|
|
this.roleCode2 = row.roleCode; |
|
|
|
}); |
|
|
|
}, |
|
|
|
updatePermession2(roleId) { |
|
|
|
this.menuIds2 = ""; |
|
|
|
this.menuIds2 = this.$refs.menuTree |
|
|
|
.getCheckedKeys() |
|
|
|
.join(",") |
|
|
|
.concat(",") |
|
|
|
.concat(this.$refs.menuTree.getHalfCheckedKeys().join(",")); |
|
|
|
papiMenuUpd(roleId, this.menuIds2).then(() => { |
|
|
|
this.geTmenuListisshow = false; |
|
|
|
this.$notify.success("修改成功"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 单选框改变 |
|
|
|
radioChange(e) { |
|
|
|
// console.log(e) |
|
|
@@ -662,14 +746,13 @@ export default { |
|
|
|
}, |
|
|
|
cancal() { |
|
|
|
this.dialogPermissionVisible = false; |
|
|
|
this.geTmenuListisshow=false; |
|
|
|
}, |
|
|
|
handlePermission(row) { |
|
|
|
fetchRoleTree(row.roleId) |
|
|
|
.then((response) => { |
|
|
|
fetchRoleTree(row.roleId).then((response) => { |
|
|
|
this.checkedKeys = response.data; |
|
|
|
return fetchMenuTree(); |
|
|
|
}) |
|
|
|
.then((response) => { |
|
|
|
}).then((response) => { |
|
|
|
this.treeData = response.data; |
|
|
|
// 解析出所有的太监节点 |
|
|
|
this.checkedKeys = this.resolveAllEunuchNodeId( |
|
|
|