Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
96db9287
authored
2022-11-03 17:11:31 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:路由跳转
1 parent
0f132bd5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
40 deletions
src/components/publicPicture/index.vue
src/components/tanchuang/index.vue
src/components/tanchuang/redeme.md
src/layout/components/Sidebar/index.vue
src/permission.js
src/utils/asyncRouter.js
src/components/publicPicture/index.vue
View file @
96db928
<
template
>
<el-image-viewer
:on-close=
"closeViewer"
:url-list=
"urlList"
>
<el-image-viewer
:on-close=
"closeViewer"
:url-list=
"urlList"
>
</el-image-viewer>
</
template
>
<
script
>
import
ElImageViewer
from
'element-ui/packages/image/src/image-viewer'
export
default
{
import
ElImageViewer
from
'element-ui/packages/image/src/image-viewer'
export
default
{
components
:
{
ElImageViewer
,
},
...
...
@@ -16,12 +13,12 @@
type
:
Array
,
default
:
function
()
{
return
[]
},
},
}
}
},
data
()
{
return
{
wrapperElem
:
null
,
wrapperElem
:
null
}
},
mounted
()
{
...
...
@@ -79,11 +76,11 @@
xhr
.
send
()
},
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
/
deep
/
.el-image-viewer__close
{
/
deep
/
.el-image-viewer__close
{
color
:
#ffffff
;
}
}
</
style
>
\ No newline at end of file
...
...
src/components/tanchuang/index.vue
View file @
96db928
...
...
@@ -9,7 +9,6 @@
</div>
<svg-icon
icon-class=
'close'
class=
"closeStyle"
@
click=
"onCancel"
/>
</div>
<div
class=
"ls-mask-content"
ref=
'contentRef'
:style=
"
{ 'height': contentHeight }">
<component
:is=
"editItem"
ref=
'childRef'
@
loading=
'loadingFn'
:key=
"key"
:formData=
'formData'
/>
</div>
...
...
@@ -27,7 +26,7 @@ export default {
data
()
{
return
{
btnShow
:
false
,
title
:
'
提示
'
,
title
:
'
标题
'
,
cancelText
:
'取消'
,
confirmText
:
'确认'
,
isSync
:
false
,
...
...
src/components/tanchuang/redeme.md
View file @
96db928
...
...
@@ -5,13 +5,8 @@
this.$popup({
title: '提示', // 弹窗标题
titleStyle:"", //标题存在的位置 center left
width:"", //弹窗的宽度
height:"", //弹窗的高度
editItem: 'ywbl/dbx/aa', // 子组件的路径 相当于你平时img取的路径
formData:this.formData, //父组件传给子组件的参数
btnShow:false,//按钮显隐 false隐藏 true显示
confirmText:"" // 确认按钮的文字
cancelText:"" //取消按钮的文字
cancel: function () {}, //取消事件的回调
confirm: function () {}, //确认事件的回调
iconClass:"",//标题前面icon图标名称
...
...
src/layout/components/Sidebar/index.vue
View file @
96db928
...
...
@@ -2,8 +2,8 @@
<div>
<el-scrollbar
wrap-class=
"scrollbar-wrapper"
>
<el-menu
router
:default-active=
"activeMenu"
:background-color=
"variables.menuBg"
:text-color=
"variables.menuText"
:unique-opened=
"true"
@
open=
"handleOpen"
:active-text-color=
"variables.menuActiveText
"
:collapse-transition=
"false"
mode=
"vertical"
>
:unique-opened=
"true"
:active-text-color=
"variables.menuActiveText"
:collapse-transition=
"false
"
mode=
"vertical"
>
<!-- 权限菜单 -->
<sidebar-item
v-for=
"route in permission_routes"
:key=
"route.path"
:item=
"route"
:base-path=
"route.path"
/>
<!-- 菜单全部展示 -->
...
...
@@ -36,17 +36,7 @@ export default {
},
asyncRoutes
()
{
return
asyncRoutes
},
},
methods
:
{
handleOpen
(
key
,
keyPath
)
{
let
that
=
this
this
.
permission_routes
.
forEach
(
element
=>
{
if
(
element
.
path
==
key
)
{
that
.
$router
.
push
({
path
:
element
.
redirect
})
}
})
}
},
}
</
script
>
...
...
src/permission.js
View file @
96db928
...
...
@@ -21,15 +21,20 @@ router.beforeEach(async (to, from, next) => {
}
else
{
const
{
result
:
getMenuData
}
=
await
getMenuInfo
()
const
accessRoutes
=
await
store
.
dispatch
(
'permission/generateRoutes'
,
getMenuData
)
console
.
log
(
accessRoutes
);
router
.
addRoutes
(
accessRoutes
)
const
routeTo
=
Cookies
.
get
(
'routerTo'
)
if
(
routeTo
)
{
next
(
routeTo
)
}
else
{
next
({
...
to
,
replace
:
true
})
}
}
NProgress
.
done
()
})
router
.
afterEach
(
to
=>
{
// 解决刷新页面报404问题
console
.
log
(
to
.
fullPath
);
Cookies
.
set
(
"routerTo"
,
to
.
fullPath
)
NProgress
.
done
()
})
...
...
src/utils/asyncRouter.js
View file @
96db928
...
...
@@ -3,6 +3,8 @@ export default function filterAsyncRouter (routers) {
routers
.
forEach
(
item
=>
{
if
(
!
item
.
children
)
{
delete
item
.
children
}
else
{
item
.
children
=
filterAsyncRouter
(
item
.
children
)
}
item
.
path
=
JSON
.
parse
(
item
.
metadata
).
path
if
(
!
item
.
parentId
)
{
...
...
@@ -14,14 +16,6 @@ export default function filterAsyncRouter (routers) {
title
:
item
.
name
,
icon
:
item
.
icon
}
if
(
item
.
children
)
{
item
.
children
=
filterAsyncRouter
(
item
.
children
)
if
(
item
.
path
!==
'/'
)
{
item
.
redirect
=
item
.
path
+
'/'
+
item
.
children
[
0
].
path
}
else
{
item
.
redirect
=
'/'
+
item
.
children
[
0
].
path
}
}
})
return
routers
}
...
...
Please
register
or
sign in
to post a comment