3d64e30e by lihua

修改嵌入菜单

1 parent c85e2a40
...@@ -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: '报表查看',
...@@ -156,7 +156,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -156,7 +156,7 @@ const routes: RouteRecordRaw[] = [
156 ] 156 ]
157 }, 157 },
158 { 158 {
159 path: '/data-meta/reports', 159 path: '/data-metas/reports',
160 component: Layout, 160 component: Layout,
161 meta: { 161 meta: {
162 title: '资源目录', 162 title: '资源目录',
...@@ -173,7 +173,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -173,7 +173,7 @@ const routes: RouteRecordRaw[] = [
173 breadcrumb: false, 173 breadcrumb: false,
174 cache: true, 174 cache: true,
175 reuse: true, 175 reuse: true,
176 activeMenu: '/data-meta/reports/iframePage', 176 activeMenu: '/data-metas/reports/iframePage',
177 }, 177 },
178 }, 178 },
179 { 179 {
...@@ -186,13 +186,13 @@ const routes: RouteRecordRaw[] = [ ...@@ -186,13 +186,13 @@ const routes: RouteRecordRaw[] = [
186 breadcrumb: false, 186 breadcrumb: false,
187 cache: true, 187 cache: true,
188 reuse: true, 188 reuse: true,
189 activeMenu: '/data-meta/reports/portraitMaps', 189 activeMenu: '/data-metas/reports/portraitMaps',
190 }, 190 },
191 } 191 }
192 ] 192 ]
193 }, 193 },
194 { 194 {
195 path: '/data-meta/portraitMap', 195 path: '/data-metas/portraitMap',
196 component: Layout, 196 component: Layout,
197 meta: { 197 meta: {
198 title: '全景地图', 198 title: '全景地图',
......
...@@ -174,13 +174,13 @@ const useMenuStore = defineStore( ...@@ -174,13 +174,13 @@ 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-metas/portraitMap" && r.path?.includes('/data-metas/portraitMap')) {
181 return true; 181 return true;
182 } 182 }
183 if (data== "/data-meta/portraitMap" && r.path?.includes('/data-meta/portraitMap')) { 183 if (data== "/data-metas/portraitMap" && r.path?.includes('/data-metas/portraitMap')) {
184 return true; 184 return true;
185 } 185 }
186 if (data.indexOf(`${r.path}/`) === 0 || data === r.path) { 186 if (data.indexOf(`${r.path}/`) === 0 || data === r.path) {
......
...@@ -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-metas/portraitMap') && route.path.includes('/data-metas/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!