Showing
4 changed files
with
48 additions
and
11 deletions
@@ -72,6 +72,7 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP | @@ -72,6 +72,7 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP | ||
72 | return null; | 72 | return null; |
73 | } | 73 | } |
74 | 74 | ||
75 | + // 获取子菜单 | ||
75 | PageDetail root = PageDetail.builder() | 76 | PageDetail root = PageDetail.builder() |
76 | .pageCode(one.getPageCode()) | 77 | .pageCode(one.getPageCode()) |
77 | .pageName(one.getPageName()) | 78 | .pageName(one.getPageName()) |
@@ -79,24 +80,33 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP | @@ -79,24 +80,33 @@ public class ExtPageConfigServiceImpl extends ServiceImpl<ExtPageConfigDao, ExtP | ||
79 | .child(new ArrayList<>()) | 80 | .child(new ArrayList<>()) |
80 | .build(); | 81 | .build(); |
81 | 82 | ||
83 | + Integer id = one.getId(); | ||
84 | + getPageNode(id,root); | ||
82 | 85 | ||
86 | + return root; | ||
87 | + } | ||
83 | 88 | ||
89 | + | ||
90 | + private void getPageNode( Integer id ,PageDetail root){ | ||
84 | LambdaQueryWrapper<ExtPageConfig> queryWrapper1 = new LambdaQueryWrapper<>(); | 91 | LambdaQueryWrapper<ExtPageConfig> queryWrapper1 = new LambdaQueryWrapper<>(); |
85 | - queryWrapper1.eq(ExtPageConfig::getParentId,one.getId()); | 92 | + queryWrapper1.eq(ExtPageConfig::getParentId,id); |
86 | queryWrapper1.orderByAsc(ExtPageConfig::getSort); | 93 | queryWrapper1.orderByAsc(ExtPageConfig::getSort); |
87 | List<ExtPageConfig> list = this.list(queryWrapper1); | 94 | List<ExtPageConfig> list = this.list(queryWrapper1); |
88 | - | 95 | + if(list == null || list.isEmpty()){ |
96 | + return; | ||
97 | + } | ||
89 | list.stream().forEach(item ->{ | 98 | list.stream().forEach(item ->{ |
90 | PageDetail child = PageDetail.builder() | 99 | PageDetail child = PageDetail.builder() |
91 | .pageCode(item.getPageCode()) | 100 | .pageCode(item.getPageCode()) |
92 | .pageName(item.getPageName()) | 101 | .pageName(item.getPageName()) |
93 | .reportCode(item.getReportCode()) | 102 | .reportCode(item.getReportCode()) |
103 | + .child(new ArrayList<>()) | ||
94 | .build(); | 104 | .build(); |
95 | 105 | ||
106 | + getPageNode(item.getId(), child); | ||
107 | + | ||
96 | root.getChild().add(child); | 108 | root.getChild().add(child); |
97 | }); | 109 | }); |
98 | - | ||
99 | - return root; | ||
100 | } | 110 | } |
101 | 111 | ||
102 | 112 |
No preview for this file type
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | <div class="layout" style="margin-left: -30px;margin-top: -10px;;height: 100%;display: flex"> | 47 | <div class="layout" style="margin-left: -30px;margin-top: -10px;;height: 100%;display: flex"> |
48 | <div v-if="dataSource.child && dataSource.child.length > 0" style="width: 200px;height: 100%"> | 48 | <div v-if="dataSource.child && dataSource.child.length > 0" style="width: 200px;height: 100%"> |
49 | <Sider breakpoint="md" collapsible :collapsed-width="78" v-model="isCollapsed"> | 49 | <Sider breakpoint="md" collapsible :collapsed-width="78" v-model="isCollapsed"> |
50 | - <i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo" | 50 | + <#--<i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo" |
51 | :open-names="['sub']" @on-select="onMenuSelect"> | 51 | :open-names="['sub']" @on-select="onMenuSelect"> |
52 | <Submenu name="sub"> | 52 | <Submenu name="sub"> |
53 | <template slot="title"> | 53 | <template slot="title"> |
@@ -59,15 +59,41 @@ | @@ -59,15 +59,41 @@ | ||
59 | <span>{{item.pageName}}</span> | 59 | <span>{{item.pageName}}</span> |
60 | </Menu-Item> | 60 | </Menu-Item> |
61 | </Submenu> | 61 | </Submenu> |
62 | + </i-menu>--> | ||
63 | + | ||
64 | + <i-menu theme="primary" width="auto" :class="menuitemClasses" active-name="datainfo" | ||
65 | + :open-names="['sub']" @on-select="onMenuSelect"> | ||
66 | + <Submenu name="sub"> | ||
67 | + <template slot="title"> | ||
68 | + <Icon type="ios-apps"/> | ||
69 | + </Icon> | ||
70 | + {{dataSource.pageName}} | ||
71 | + </template> | ||
72 | + <span v-for="(item,index) in dataSource.child"> | ||
73 | + <Menu-Item :name="item.pageCode" v-if="item.child && item.child.length == 0"> | ||
74 | + <span>{{item.pageName}}</span> | ||
75 | + </Menu-Item> | ||
76 | + | ||
77 | + <Submenu :name="item.pageCode" v-else> | ||
78 | + <template slot="title">{{item.pageName}}</template> | ||
79 | + <Menu-Item :name="item1.pageCode" v-for="(item1,index) in item.child"> | ||
80 | + <span>{{item1.pageName}}</span> | ||
81 | + </Menu-Item> | ||
82 | + </Submenu> | ||
83 | + | ||
84 | + </span> | ||
85 | + </Submenu> | ||
62 | </i-menu> | 86 | </i-menu> |
63 | <div slot="trigger"></div> | 87 | <div slot="trigger"></div> |
64 | </Sider> | 88 | </Sider> |
65 | </div> | 89 | </div> |
66 | <div v-if="dataSource.child && dataSource.child.length > 0" style="width: calc(100% - 200px);height: 100%"> | 90 | <div v-if="dataSource.child && dataSource.child.length > 0" style="width: calc(100% - 200px);height: 100%"> |
67 | - <iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" style="border: none;padding-top: 15px;"></iframe> | 91 | + <iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" |
92 | + style="border: none;padding-top: 15px;"></iframe> | ||
68 | </div> | 93 | </div> |
69 | <div v-else> | 94 | <div v-else> |
70 | - <iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" style="border: none;padding-top: 15px;"></iframe> | 95 | + <iframe id="reportFrame" frameborder="0" width="100%" :height="height" :src="src" |
96 | + style="border: none;padding-top: 15px;"></iframe> | ||
71 | </div> | 97 | </div> |
72 | </div> | 98 | </div> |
73 | 99 | ||
@@ -79,8 +105,8 @@ | @@ -79,8 +105,8 @@ | ||
79 | data: { | 105 | data: { |
80 | isCollapsed: false, | 106 | isCollapsed: false, |
81 | token: '',//token | 107 | token: '',//token |
82 | - src:'', | ||
83 | - height:document.documentElement.clientHeight, | 108 | + src: '', |
109 | + height: document.documentElement.clientHeight, | ||
84 | dataSource: {}, | 110 | dataSource: {}, |
85 | }, | 111 | }, |
86 | computed: { | 112 | computed: { |
@@ -137,10 +163,11 @@ | @@ -137,10 +163,11 @@ | ||
137 | setReportSrc(code) { | 163 | setReportSrc(code) { |
138 | //const reportFrame = document.getElementById('reportFrame'); | 164 | //const reportFrame = document.getElementById('reportFrame'); |
139 | //reportFrame.src = "/jmreport/view/" + code ;//+ "?token=" + that.token; | 165 | //reportFrame.src = "/jmreport/view/" + code ;//+ "?token=" + that.token; |
140 | - this.src = window.location.origin + "/jmreport/view/" + code ; | 166 | + this.src = window.location.origin + "/jmreport/view/" + code; |
141 | }, | 167 | }, |
142 | 168 | ||
143 | onMenuSelect: function (key) { | 169 | onMenuSelect: function (key) { |
170 | + console.log(111111111111); | ||
144 | let that = this; | 171 | let that = this; |
145 | let ds = this.dataSource; | 172 | let ds = this.dataSource; |
146 | 173 | ||
@@ -165,6 +192,6 @@ | @@ -165,6 +192,6 @@ | ||
165 | } | 192 | } |
166 | }) | 193 | }) |
167 | </script> | 194 | </script> |
168 | - <#include "./common/tj.ftl"> | 195 | +<#include "./common/tj.ftl"> |
169 | </body> | 196 | </body> |
170 | </html> | 197 | </html> |
-
Please register or login to post a comment