Authored by 王涛

优化

... ... @@ -72,6 +72,7 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP
return null;
}
// 获取子菜单
PageDetail root = PageDetail.builder()
.pageCode(one.getPageCode())
.pageName(one.getPageName())
... ... @@ -79,24 +80,33 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP
.child(new ArrayList<>())
.build();
Integer id = one.getId();
getPageNode(id,root);
return root;
}
private void getPageNode( Integer id ,PageDetail root){
LambdaQueryWrapper<ExtPageConfig> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(ExtPageConfig::getParentId,one.getId());
queryWrapper1.eq(ExtPageConfig::getParentId,id);
queryWrapper1.orderByAsc(ExtPageConfig::getSort);
List<ExtPageConfig> list = this.list(queryWrapper1);
if(list == null || list.isEmpty()){
return;
}
list.stream().forEach(item ->{
PageDetail child = PageDetail.builder()
.pageCode(item.getPageCode())
.pageName(item.getPageName())
.reportCode(item.getReportCode())
.child(new ArrayList<>())
.build();
getPageNode(item.getId(), child);
root.getChild().add(child);
});
return root;
}
... ...
... ... @@ -47,7 +47,7 @@
<div class="layout" style="margin-left: -30px;margin-top: -10px;;height: 100%;display: flex">
<div v-if="dataSource.child && dataSource.child.length > 0" style="width: 200px;height: 100%">
<Sider breakpoint="md" collapsible :collapsed-width="78" v-model="isCollapsed">
<i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo"
<#--<i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo"
:open-names="['sub']" @on-select="onMenuSelect">
<Submenu name="sub">
<template slot="title">
... ... @@ -59,15 +59,41 @@
<span>{{item.pageName}}</span>
</Menu-Item>
</Submenu>
</i-menu>-->
<i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo"
:open-names="['sub']" @on-select="onMenuSelect">
<Submenu name="sub">
<template slot="title">
<Icon type="ios-apps"/>
</Icon>
{{dataSource.pageName}}
</template>
<span v-for="(item,index) in dataSource.child">
<Menu-Item :name="item.pageCode" v-if="item.child && item.child.length == 0">
<span>{{item.pageName}}</span>
</Menu-Item>
<Submenu :name="item.pageCode" v-else>
<template slot="title">{{item.pageName}}</template>
<Menu-Item :name="item1.pageCode" v-for="(item1,index) in item.child">
<span>{{item1.pageName}}</span>
</Menu-Item>
</Submenu>
</span>
</Submenu>
</i-menu>
<div slot="trigger"></div>
</Sider>
</div>
<div v-if="dataSource.child && dataSource.child.length > 0" style="width: calc(100% - 200px);height: 100%">
<iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" style="border: none;padding-top: 15px;"></iframe>
<iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src"
style="border: none;padding-top: 15px;"></iframe>
</div>
<div v-else>
<iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" style="border: none;padding-top: 15px;"></iframe>
<iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src"
style="border: none;padding-top: 15px;"></iframe>
</div>
</div>
... ... @@ -79,8 +105,8 @@
data: {
isCollapsed: false,
token: '',//token
src:'',
height:document.documentElement.clientHeight,
src: '',
height: document.documentElement.clientHeight,
dataSource: {},
},
computed: {
... ... @@ -137,10 +163,11 @@
setReportSrc(code) {
//const reportFrame = document.getElementById('reportFrame');
//reportFrame.src = "/jmreport/view/" + code ;//+ "?token=" + that.token;
this.src = window.location.origin + "/jmreport/view/" + code ;
this.src = window.location.origin + "/jmreport/view/" + code;
},
onMenuSelect: function (key) {
console.log(111111111111);
let that = this;
let ds = this.dataSource;
... ... @@ -165,6 +192,6 @@
}
})
</script>
<#include "./common/tj.ftl">
<#include "./common/tj.ftl">
</body>
</html>
... ...