mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-04-02 11:22:40 +08:00
优化 ”组件“ 隐藏菜单 还需要访问路由的问题
修复 图片字段为空 报错的问题
This commit is contained in:
parent
d1b078f134
commit
f8c4f3ae70
File diff suppressed because one or more lines are too long
@ -40,8 +40,8 @@
|
|||||||
<a v-else-if="col.type == 'downloadAll'" @click="$common.downloadMore(scope.row[col.field])" href="javascript:;">下载</a>
|
<a v-else-if="col.type == 'downloadAll'" @click="$common.downloadMore(scope.row[col.field])" href="javascript:;">下载</a>
|
||||||
<el-image
|
<el-image
|
||||||
v-else-if="col.type === 'image'"
|
v-else-if="col.type === 'image'"
|
||||||
:src="scope.row[col.field].startsWith('http') ? scope.row[col.field] : $global.baseApi + scope.row[col.field]"
|
:src="scope.row[col.field] && scope.row[col.field].startsWith('http') ? scope.row[col.field] : $global.baseApi + scope.row[col.field]"
|
||||||
:preview-src-list="[scope.row[col.field].startsWith('http') ? scope.row[col.field] : $global.baseApi + scope.row[col.field]]"
|
:preview-src-list="[scope.row[col.field] && scope.row[col.field].startsWith('http') ? scope.row[col.field] : $global.baseApi + scope.row[col.field]]"
|
||||||
/>
|
/>
|
||||||
<span v-else-if="col.type === 'html'" v-html="scope.row[col.field]"></span>
|
<span v-else-if="col.type === 'html'" v-html="scope.row[col.field]"></span>
|
||||||
<span v-else-if="col.click">
|
<span v-else-if="col.click">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!item.hidden">
|
<div v-if="item.isShow == 1">
|
||||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
||||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||||
|
@ -14,11 +14,15 @@ export const filterAsyncRouter = (routers, level) => {
|
|||||||
router.props = { url: router.url }
|
router.props = { url: router.url }
|
||||||
router.path = "/" + sha256(router.url)
|
router.path = "/" + sha256(router.url)
|
||||||
}
|
}
|
||||||
if(router.url.startsWith('http')){
|
var setLayout = () => {
|
||||||
|
router.path = "/" + common.uuid()
|
||||||
|
router.component = level > 0 ? layoutModules[`../layout/none.vue`] : loadLayoutView()
|
||||||
|
}
|
||||||
|
if(router.url && router.url.startsWith('http')){
|
||||||
if(router.openMode == '0'){
|
if(router.openMode == '0'){
|
||||||
setIframe()
|
setIframe()
|
||||||
}
|
}
|
||||||
} else if(router.url.startsWith('/') && router.url.indexOf('.htm') != -1) {
|
} else if(router.url && router.url.startsWith('/') && router.url.indexOf('.htm') != -1) {
|
||||||
if(router.openMode == '0'){
|
if(router.openMode == '0'){
|
||||||
setIframe()
|
setIframe()
|
||||||
}else{
|
}else{
|
||||||
@ -30,16 +34,30 @@ export const filterAsyncRouter = (routers, level) => {
|
|||||||
} else if (router.component) {
|
} else if (router.component) {
|
||||||
const component = router.component
|
const component = router.component
|
||||||
if (component === 'Layout') {
|
if (component === 'Layout') {
|
||||||
router.path = "/" + common.uuid()
|
if (router.children && router.children.length > 0) {
|
||||||
router.component = level > 0 ? layoutModules[`../layout/none.vue`] : loadLayoutView(component)
|
const children = filterAsyncRouter(router.children, level + 1);
|
||||||
|
if(!children.some(it => it.isShow == 0)){
|
||||||
|
router.children = children
|
||||||
|
setLayout()
|
||||||
|
}else{
|
||||||
|
router.children = undefined
|
||||||
|
router.alwaysShow = false
|
||||||
|
router.redirect = ''
|
||||||
|
router.path = router.path.startsWith('/') ? router.path : '/' + router.path
|
||||||
|
router.component = loadView(router.path) || layoutModules[`../layout/empty.vue`]
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
setLayout()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
router.path = router.path.startsWith('/') ? router.path : '/' + router.path
|
router.path = router.path.startsWith('/') ? router.path : '/' + router.path
|
||||||
router.component = loadView(component) || layoutModules[`../layout/empty.vue`]
|
router.component = loadView(component) || layoutModules[`../layout/empty.vue`]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (router.children && router.children.length) {
|
return true
|
||||||
router.children = filterAsyncRouter(router.children, level + 1)
|
} else if (router.componentName) {
|
||||||
}
|
router.component = loadView(`/common/show-component`)
|
||||||
|
router.props = { name: router.componentName }
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -47,7 +65,7 @@ export const filterAsyncRouter = (routers, level) => {
|
|||||||
return accessedRouters
|
return accessedRouters
|
||||||
}
|
}
|
||||||
|
|
||||||
export const loadLayoutView = (view) => {
|
export const loadLayoutView = () => {
|
||||||
return layoutModules[`../layout/layout.vue`]
|
return layoutModules[`../layout/layout.vue`]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user