diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue index 530b3d5..8ad5f9a 100644 --- a/src/layout/components/Sidebar/Link.vue +++ b/src/layout/components/Sidebar/Link.vue @@ -19,21 +19,22 @@ export default { return isExternal(this.to) }, type() { - if (this.isExternal) { - return 'a' - } + + // if (this.isExternal) { + // return 'a' + // } return 'router-link' } }, methods: { linkProps(to) { - if (this.isExternal) { - return { - href: to, - target: '_blank', - rel: 'noopener' - } - } + // if (this.isExternal) { + // return { + // href: to, + // target: '_blank', + // rel: 'noopener' + // } + // } return { to: to } diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index 7c8b0e3..d18d626 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -11,12 +11,29 @@ @@ -77,7 +94,6 @@ if (showingChildren.length === 1) { return true } - // Show parent if there are no child router to display if (showingChildren.length === 0) { this.onlyOneChild = { @@ -87,16 +103,20 @@ } return true } - + console.log("this.onlyOneChild", this.onlyOneChild) return false }, - resolvePath(routePath) { - if (isExternal(routePath)) { + resolvePath(routePath) { + + if (isExternal(routePath)) { + console.log("path",routePath) return routePath } - if (isExternal(this.basePath)) { + if (isExternal(this.basePath)) { + console.log("basePath",this.basePath) return this.basePath - } + } + console.log("resolve",path.resolve(this.basePath, routePath)) return path.resolve(this.basePath, routePath) } } @@ -108,7 +128,11 @@ } */ ::v-deep .submenu-item .el-submenu__title { padding: 0 !important; - } + } + ::v-deep .menuwrap .el-menu-item { + padding: 0 !important; + } + ::v-deep .submenu-item .sublink { padding-left: 40px !important; diff --git a/src/layout/index.vue b/src/layout/index.vue index cd17a2e..f973cae 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -7,7 +7,7 @@ - + @@ -46,6 +46,10 @@ withoutAnimation: this.sidebar.withoutAnimation, mobile: this.device === 'mobile' } + }, + key() { + + return this.$route.path } }, methods: { diff --git a/src/main.js b/src/main.js index b4f3354..2d7aa25 100644 --- a/src/main.js +++ b/src/main.js @@ -75,8 +75,8 @@ import XySelectors from '@/components/XySelectors' Vue.component('xy-selectors',XySelectors) import draggable from 'vuedraggable'; Vue.component('draggable',draggable) -// import tinymce from '@/components/XyTinymce' -// Vue.component('my-tinymce',tinymce) +import tinymce from '@/components/XyTinymce' +Vue.component('my-tinymce',tinymce) import myMap from "@/components/XyMap" Vue.component('my-map',myMap) import afTableColumn from 'af-table-column' diff --git a/src/router/index.js b/src/router/index.js index cf0b2f5..0e0d57a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -60,11 +60,11 @@ export const constantRoutes = [{ hidden: true }, { - path: '/record/index', + path: '/record/search', component: Layout, children: [{ - path: '/record/index', - component: () => import('@/views/record/index'), + path: '/record/search', + component: () => import('@/views/record/search'), name: '搜索', meta: { title: '搜索' diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 3859c95..232c00e 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -125,7 +125,8 @@ export function generaMenu(routes, data) { children: [{ path: "", name: 'menu_' + item.id, - component: (item.url.includes('#')||item.path == '') ? Layout : loadView(item.url), + // component: (item.url.includes('#')||item.path == '') ? Layout : loadView(item.url), + component: Layout, meta: { title: item.name, id: item.id, diff --git a/src/utils/common.js b/src/utils/common.js index eb59e7e..a40d752 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -358,9 +358,27 @@ let base = { } }); - return rootNodes; - } + }, + findNodesById(nodes, targetId) { + let result = []; + + // 遍历每个节点 + nodes.forEach(node => { + // 如果当前节点的ID匹配,添加到结果数组 + if (node.id == targetId) { + result.push(node); + } + // 如果节点有子节点,递归查找 + if (node.children && node.children.length > 0) { + const childNodes = this.findNodesById(node.children, targetId); + result = result.concat(childNodes); + } + }); + + return result; + } + } export default base diff --git a/src/views/catalog/components/addCatalog.vue b/src/views/catalog/components/addCatalog.vue index 2578fc0..efc16f2 100644 --- a/src/views/catalog/components/addCatalog.vue +++ b/src/views/catalog/components/addCatalog.vue @@ -1,6 +1,6 @@