提交 58f417d1 编写于 作者: laizhilong's avatar laizhilong

添加统一资源树,并给应用菜单添加根节点‘系统’

上级 ba57e004
......@@ -3,11 +3,11 @@
<card class='view-card view-no-caption view-no-toolbar' :dis-hover="true" :padding="0" :bordered="false">
<div class="content-container pickup-view">
<div class="translate-contant">
<!--菜单分配-->
<div class="center" :style="{width : '50%',border:'0px solid red' }">
<!--应用菜单-->
<div class="center" :style="{width : '33%',border:'0px solid red' }">
<context-menu-container class='design-tree-container' >
<div >
<div class="text">菜单分配</div>
<div class="text">应用菜单</div>
<div class="roll">
<el-tree
class="tre"
......@@ -25,11 +25,11 @@
</div>
</context-menu-container>
</div>
<!--权限分配-->
<div class="center" :style="{width : '50%',border:'0px solid red' }">
<!--数据能力-->
<div class="center" :style="{width : '33%',border:'0px solid red' }">
<context-menu-container class='design-tree-container' >
<div >
<div class="text">权限分配</div>
<div class="text">数据能力</div>
<div class="roll">
<el-tree
class="tre"
......@@ -47,6 +47,28 @@
</div>
</context-menu-container>
</div>
<!--统一资源-->
<div class="center" :style="{width : '33%',border:'0px solid red' }">
<context-menu-container class='design-tree-container' >
<div >
<div class="text">统一资源</div>
<div class="roll">
<el-tree
class="tre"
:data="this.ZYdata"
ref="ZYtree"
show-checkbox
node-key="id"
:default-expanded-keys="this.ZYdataexpandedKeys"
highlight-current
:props="this.defaultProps"
@check-change="handleCheckChange"
>
</el-tree>
</div>
</div>
</context-menu-container>
</div>
</div>
<div>
<!--操作按钮-->
......@@ -84,14 +106,19 @@
export default class SYS_PERMISSIONMPickupView extends Vue{
/*菜单分配数据*/
/*应用菜单数据*/
protected CDdata: any = [];
/*菜单分配数据默认展开节点*/
/*应用菜单数据默认展开节点*/
protected CDdataexpandedKeys:any =[];
/*权限分配数据*/
/*数据能力数据*/
protected QXdata: any = [];
/*权限分配数据默认展开节点*/
/*数据能力数据默认展开节点*/
protected QXdataexpandedKeys:any =[];
/*统一资源数据*/
protected ZYdata: any = [];
/*统一资源数据默认展开节点*/
protected ZYdataexpandedKeys:any =[];
/**
* 树显示说明:子树为节点对象的children,节点标签为节点对象的label
*/
......@@ -146,7 +173,7 @@
private initTree(){
const _this = this;
// get全部菜单和权限的请求路径
const url = `sys_permissions/getallMenuAndPermission`;
const url = `sys_permissions/getallMenuAndPermissionAndUnires`;
this.$http.get(url).then((response: any)=>{
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: response.message });
......@@ -155,7 +182,7 @@
// 给树赋值,数据结构在后台已经按照eltree格式化
_this.CDdata = response.data[0];
_this.QXdata = response.data[1];
console.log(this.CDdata)
_this.ZYdata = response.data[2];
// 树视图默认展开一级节点
if (_this.CDdata && _this.CDdata.length>0){
_this.CDdata.forEach((item:any, index:any)=> {
......@@ -171,6 +198,13 @@
}
})
}
if (_this.ZYdata && _this.ZYdata.length>0){
_this.ZYdata.forEach((item:any, index:any)=> {
if (item[index].id){
_this.ZYdataexpandedKeys.push(item[index]);
}
})
}
}
}).catch((e) => {
console.log(e);
......@@ -181,14 +215,15 @@
* 处理选中节点
*/
protected handleCheckChange() {
console.log("SYS_PERMISSIONMPickupView执行了handleCheckChange")
// console.log("SYS_PERMISSIONMPickupView执行了handleCheckChange")
// 两棵树
const CDtree: any = this.$refs.CDtree;
const QXtree: any = this.$refs.QXtree;
const ZYtree: any = this.$refs.ZYtree;
// 获取选中状态的节点
const arr = CDtree.getCheckedNodes().concat(QXtree.getCheckedNodes());
const arr = CDtree.getCheckedNodes().concat(QXtree.getCheckedNodes()).concat(ZYtree.getCheckedNodes());
this.selectData = arr;
// console.log("选中的node:" + arr);
// console.log("选中的node:" + JSON.stringify(this.selectData));
}
/**
......@@ -208,7 +243,7 @@
this.selectData.forEach((item: any) => {
let _itemTemp: any = JSON.parse(JSON.stringify(item));
let _item:any = {};
if (_itemTemp.sys_permissionId) {// 一级菜单
if (_itemTemp.sys_permissionId) {// 应用菜单
_item.srfdataaccaction = _itemTemp.sys_permissionId;
_item.srfkey = _itemTemp.sys_permissionId;
_item.sys_permission = _itemTemp.sys_permissionId;
......@@ -218,7 +253,7 @@
Object.assign(_item, { _select: false })
this.viewSelections.push(_item);
}else{
if(!_itemTemp.children){// 是末节点则为库中存在的权限数据,添加到viewSelections
if(!_itemTemp.children){// 数据能力或者统一资源
_item.srfdataaccaction = _itemTemp.id;
_item.srfkey = _itemTemp.id;
_item.sys_permission = _itemTemp.id;
......
......@@ -15,17 +15,19 @@ public class UAACoreResource {
private UAACoreService uaaCoreService;
/**
* 获取全部权限列表或菜单列表
* 获取全部菜单列表和数据能力列表和统一资源列表
*
* @return
*/
@GetMapping(value = "/sys_permissions/getallMenuAndPermission")
@GetMapping(value = "/sys_permissions/getallMenuAndPermissionAndUnires")
public ResponseEntity<JSONArray> getAllPermission() {
JSONArray treeNode = new JSONArray();
// 获取菜单
// 获取应用菜单
treeNode.add(uaaCoreService.getAppMenu());
//获取数据能力
// 获取数据能力
treeNode.add(uaaCoreService.getDEOppriv());
// 获取统一资源
treeNode.add(uaaCoreService.getUnires());
return ResponseEntity.ok().body(treeNode);
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册