3d076a77 by lihua

修改嵌入菜单路径

1 parent 4a6a6a8a
...@@ -19,9 +19,9 @@ function onSidebarScroll(e: Event) { ...@@ -19,9 +19,9 @@ function onSidebarScroll(e: Event) {
19 const defaultMenuActive = computed(() => { 19 const defaultMenuActive = computed(() => {
20 let path = route.meta.activeMenu || route.path; 20 let path = route.meta.activeMenu || route.path;
21 let sideMenus = menuStore.sidebarMenus; 21 let sideMenus = menuStore.sidebarMenus;
22 let isSide = sideMenus.some(s => s.path === path || s.children?.some(c => path === `${s.path}/${c.path}`) || (path.includes('/data-meta/report') && s.path?.includes('/data-meta/report'))); 22 let isSide = sideMenus.some(s => s.path === path || s.children?.some(c => path === `${s.path}/${c.path}`) || (path.includes('/data-metas/report') && s.path?.includes('/data-metas/report')));
23 if (isSide) { 23 if (isSide) {
24 if (path.includes('/data-meta/report')) { 24 if (path.includes('/data-metas/report')) {
25 let index = route.fullPath.indexOf("?"); 25 let index = route.fullPath.indexOf("?");
26 if (index > -1) { 26 if (index > -1) {
27 let params = route.fullPath.substring(index + 1); 27 let params = route.fullPath.substring(index + 1);
......
...@@ -134,7 +134,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -134,7 +134,7 @@ const routes: RouteRecordRaw[] = [
134 ], 134 ],
135 }, 135 },
136 { 136 {
137 path: '/data-meta/report', 137 path: '/data-metas/report',
138 component: Layout, 138 component: Layout,
139 meta: { 139 meta: {
140 title: '报表查看', 140 title: '报表查看',
...@@ -151,13 +151,13 @@ const routes: RouteRecordRaw[] = [ ...@@ -151,13 +151,13 @@ const routes: RouteRecordRaw[] = [
151 breadcrumb: false, 151 breadcrumb: false,
152 cache: true, 152 cache: true,
153 reuse: true, 153 reuse: true,
154 activeMenu: '/data-meta/report/budgetDataIndex', 154 activeMenu: '/data-metas/report/budgetDataIndex',
155 }, 155 },
156 } 156 }
157 ] 157 ]
158 }, 158 },
159 { 159 {
160 path: '/data-meta/reports', 160 path: '/data-metas/reports',
161 component: Layout, 161 component: Layout,
162 meta: { 162 meta: {
163 title: '资源目录', 163 title: '资源目录',
...@@ -174,7 +174,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -174,7 +174,7 @@ const routes: RouteRecordRaw[] = [
174 breadcrumb: false, 174 breadcrumb: false,
175 cache: true, 175 cache: true,
176 reuse: true, 176 reuse: true,
177 activeMenu: '/data-meta/reports/iframePage', 177 activeMenu: '/data-metas/reports/iframePage',
178 }, 178 },
179 }, 179 },
180 { 180 {
...@@ -187,13 +187,13 @@ const routes: RouteRecordRaw[] = [ ...@@ -187,13 +187,13 @@ const routes: RouteRecordRaw[] = [
187 breadcrumb: false, 187 breadcrumb: false,
188 cache: true, 188 cache: true,
189 reuse: true, 189 reuse: true,
190 activeMenu: '/data-meta/reports/portraitMaps', 190 activeMenu: '/data-metas/reports/portraitMaps',
191 }, 191 },
192 } 192 }
193 ] 193 ]
194 }, 194 },
195 { 195 {
196 path: '/data-meta/reports', 196 path: '/data-metas/reports',
197 component: Layout, 197 component: Layout,
198 meta: { 198 meta: {
199 title: '资源目录', 199 title: '资源目录',
...@@ -210,7 +210,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -210,7 +210,7 @@ const routes: RouteRecordRaw[] = [
210 breadcrumb: false, 210 breadcrumb: false,
211 cache: true, 211 cache: true,
212 reuse: true, 212 reuse: true,
213 activeMenu: '/data-meta/reports/iframePage', 213 activeMenu: '/data-metas/reports/iframePage',
214 }, 214 },
215 } 215 }
216 ] 216 ]
......
...@@ -174,7 +174,7 @@ const useMenuStore = defineStore( ...@@ -174,7 +174,7 @@ const useMenuStore = defineStore(
174 else { 174 else {
175 // 如果是 string 类型,则认为是路由,需要查找对应的主导航索引 175 // 如果是 string 类型,则认为是路由,需要查找对应的主导航索引
176 const findIndex = allMenus.value.findIndex(item => item.children.some(r => { 176 const findIndex = allMenus.value.findIndex(item => item.children.some(r => {
177 if ((data== "/data-meta/reports/iframePage" || data == '/data-meta/reports/portraitMaps' || data== "/data-meta/report/budgetDataIndex") && r.path?.includes('/data-meta/report')) { 177 if ((data== "/data-metas/reports/iframePage" || data == '/data-metas/reports/portraitMaps' || data== "/data-metas/report/budgetDataIndex") && r.path?.includes('/data-metas/report')) {
178 return true; 178 return true;
179 } 179 }
180 if (data== "/data-meta/portraitMap" && r.path?.includes('/data-meta/portraitMap')) { 180 if (data== "/data-meta/portraitMap" && r.path?.includes('/data-meta/portraitMap')) {
......
...@@ -157,7 +157,7 @@ const useRouteStore = defineStore( ...@@ -157,7 +157,7 @@ const useRouteStore = defineStore(
157 }; 157 };
158 } 158 }
159 r = routes.find((route: any) => { 159 r = routes.find((route: any) => {
160 return route.path === path || route.path === m.path || `/${route.path}` === m.path || ((path.includes('budgetDataIndex') && path.includes('/data-meta/report') && route.path.includes('/data-meta/report')) || (path.includes('iframePage') && path.includes('/data-meta/report')) || (path.includes('portraitMaps') && path.includes('/data-meta/report')) || (path.includes('/data-meta/portraitMap') && route.path.includes('/data-meta/portraitMap'))); 160 return route.path === path || route.path === m.path || `/${route.path}` === m.path || ((path.includes('budgetDataIndex') && path.includes('/data-metas/report') && route.path.includes('/data-metas/report')) || (path.includes('iframePage') && path.includes('/data-metas/report')) || (path.includes('portraitMaps') && path.includes('/data-metas/report')) || (path.includes('/data-meta/portraitMap') && route.path.includes('/data-meta/portraitMap')));
161 }); 161 });
162 if (r && (path.includes('budgetDataIndex') || path.includes('iframePage')) || path.includes('portraitMap')) { 162 if (r && (path.includes('budgetDataIndex') || path.includes('iframePage')) || path.includes('portraitMap')) {
163 r.path = path; 163 r.path = path;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!