Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cee29c9d
authored
May 25, 2021
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新版菜单调整基本完成
1 parent
295ed6b8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
59 additions
and
24 deletions
linkwe-ui/src/layout/components/AppMain.vue
linkwe-ui/src/layout/components/Hamburger/index.vue
linkwe-ui/src/layout/components/Navbar.vue
linkwe-ui/src/layout/components/View.vue
linkwe-ui/src/layout/index.vue
linkwe-ui/src/router/index.js
linkwe-ui/src/store/modules/permission.js
linkwe-ui/src/styles/sidebar.scss
linkwe-ui/src/styles/variables.scss
linkwe-ui/src/layout/components/AppMain.vue
View file @
cee29c9
<
style
lang=
"scss"
scoped
>
.page
{
padding
:
16px
24px
24px
;
}
</
style
>
<
template
>
<
template
>
<section
class=
"app-main"
>
<section
class=
"app-main"
>
<transition
name=
"fade-transform"
mode=
"out-in"
>
<transition
name=
"fade-transform"
mode=
"out-in"
>
...
@@ -34,7 +29,7 @@ export default {
...
@@ -34,7 +29,7 @@ export default {
width
:
100%
;
width
:
100%
;
position
:
relative
;
position
:
relative
;
overflow
:
auto
;
overflow
:
auto
;
background-color
:
#fff
;
//
background-color
:
#fff
;
}
}
.fixed-header
+
.app-main
{
.fixed-header
+
.app-main
{
...
...
linkwe-ui/src/layout/components/Hamburger/index.vue
View file @
cee29c9
<
template
>
<
template
>
<div
style=
"padding
: 0
15px;display: inline-block;"
@
click=
"toggleClick"
>
<div
style=
"padding
-right:
15px;display: inline-block;"
@
click=
"toggleClick"
>
<svg
<svg
:class=
"
{ 'is-active': $store.state.app.sidebar.opened }"
:class=
"
{ 'is-active': $store.state.app.sidebar.opened }"
class="hamburger"
class="hamburger"
...
@@ -22,7 +22,7 @@ export default {
...
@@ -22,7 +22,7 @@ export default {
$route
(
route
)
{
$route
(
route
)
{
// if you go to the redirect page, do not update the breadcrumbs
// if you go to the redirect page, do not update the breadcrumbs
if
(
route
.
name
==
'首页'
)
{
if
(
route
.
name
==
'首页'
)
{
// this.$store.state.app.sidebar.opened = false
this
.
$store
.
state
.
app
.
sidebar
.
opened
=
0
}
}
},
},
},
},
...
...
linkwe-ui/src/layout/components/Navbar.vue
View file @
cee29c9
...
@@ -197,6 +197,7 @@ export default {
...
@@ -197,6 +197,7 @@ export default {
margin
:
0
20px
;
margin
:
0
20px
;
flex
:
none
;
flex
:
none
;
position
:
relative
;
position
:
relative
;
cursor
:
pointer
;
&.
active
::
after
{
&.
active
::
after
{
content
:
''
;
content
:
''
;
display
:
inline-block
;
display
:
inline-block
;
...
...
linkwe-ui/src/layout/components/View.vue
0 → 100644
View file @
cee29c9
<
template
>
<router-view></router-view>
</
template
>
<
script
>
export
default
{}
</
script
>
<
style
></
style
>
linkwe-ui/src/layout/index.vue
View file @
cee29c9
...
@@ -12,8 +12,14 @@
...
@@ -12,8 +12,14 @@
<div
class=
"main main-size"
>
<div
class=
"main main-size"
>
<sidebar
v-if=
"$route.name !== '首页'"
class=
"sidebar-container"
/>
<sidebar
v-if=
"$route.name !== '首页'"
class=
"sidebar-container"
/>
<div
class=
"main-container"
>
<div
class=
"main-container"
>
<hamburger
id=
"hamburger-container"
class=
"hamburger-container"
/>
<div
v-show=
"$route.name !== '首页'"
>
<breadcrumb
id=
"breadcrumb-container"
class=
"breadcrumb-container"
/>
<hamburger
id=
"hamburger-container"
class=
"hamburger-container"
/>
<span
class=
"slogan"
>
仟微科技 |
</span>
<breadcrumb
id=
"breadcrumb-container"
class=
"breadcrumb-container"
/>
</div>
<!--
<div
:class=
"
{ 'fixed-header': fixedHeader }">
<!--
<div
:class=
"
{ 'fixed-header': fixedHeader }">
<navbar
/>
<navbar
/>
...
@@ -99,6 +105,12 @@ export default {
...
@@ -99,6 +105,12 @@ export default {
.main-wrap
{
.main-wrap
{
height
:
calc
(
100vh
-
58px
);
height
:
calc
(
100vh
-
58px
);
background
:
#eee
;
background
:
#eee
;
.main
{
height
:
100%
;
padding
:
10px
;
display
:
flex
;
align-items
:
stretch
;
}
}
}
}
}
...
@@ -138,4 +150,9 @@ export default {
...
@@ -138,4 +150,9 @@ export default {
background
:
rgba
(
0
,
0
,
0
,
0.025
);
background
:
rgba
(
0
,
0
,
0
,
0.025
);
}
}
}
}
.slogan
{
font-size
:
22px
;
color
:
#999
;
vertical-align
:
middle
;
}
</
style
>
</
style
>
linkwe-ui/src/router/index.js
View file @
cee29c9
...
@@ -38,6 +38,11 @@ export const constantRoutes = [
...
@@ -38,6 +38,11 @@ export const constantRoutes = [
],
],
},
},
{
{
path
:
''
,
redirect
:
'/index'
,
hidden
:
true
,
},
{
path
:
'/index'
,
path
:
'/index'
,
component
:
Layout
,
component
:
Layout
,
redirect
:
'/index'
,
redirect
:
'/index'
,
...
...
linkwe-ui/src/store/modules/permission.js
View file @
cee29c9
import
{
constantRoutes
}
from
'@/router'
import
{
constantRoutes
}
from
'@/router'
import
{
getRouters
}
from
'@/api/menu'
import
{
getRouters
}
from
'@/api/menu'
import
Layout
from
'@/layout/index'
import
Layout
from
'@/layout/index'
import
View
from
'@/layout/components/View'
const
permission
=
{
const
permission
=
{
state
:
{
state
:
{
...
@@ -30,7 +31,7 @@ const permission = {
...
@@ -30,7 +31,7 @@ const permission = {
}
}
// 遍历后台传来的路由字符串,转换为组件对象
// 遍历后台传来的路由字符串,转换为组件对象
function
filterAsyncRouter
(
asyncRouterMap
)
{
function
filterAsyncRouter
(
asyncRouterMap
,
level
)
{
return
asyncRouterMap
.
filter
((
route
)
=>
{
return
asyncRouterMap
.
filter
((
route
)
=>
{
if
(
route
.
component
)
{
if
(
route
.
component
)
{
// Layout组件特殊处理
// Layout组件特殊处理
...
@@ -38,13 +39,17 @@ function filterAsyncRouter(asyncRouterMap) {
...
@@ -38,13 +39,17 @@ function filterAsyncRouter(asyncRouterMap) {
if
(
route
.
redirect
===
'noRedirect'
&&
route
.
children
.
length
)
{
if
(
route
.
redirect
===
'noRedirect'
&&
route
.
children
.
length
)
{
route
.
redirect
=
route
.
path
+
'/'
+
route
.
children
[
0
].
path
route
.
redirect
=
route
.
path
+
'/'
+
route
.
children
[
0
].
path
}
}
route
.
component
=
Layout
if
(
level
===
2
)
{
route
.
component
=
View
}
else
{
route
.
component
=
Layout
}
}
else
{
}
else
{
route
.
component
=
loadView
(
route
.
component
)
route
.
component
=
loadView
(
route
.
component
)
}
}
}
}
if
(
route
.
children
!=
null
&&
route
.
children
&&
route
.
children
.
length
)
{
if
(
route
.
children
!=
null
&&
route
.
children
&&
route
.
children
.
length
)
{
route
.
children
=
filterAsyncRouter
(
route
.
children
)
route
.
children
=
filterAsyncRouter
(
route
.
children
,
2
)
}
}
return
true
return
true
})
})
...
...
linkwe-ui/src/styles/sidebar.scss
View file @
cee29c9
#app
{
#app
{
.main-container
{
.main-container
{
min-height
:
100%
;
min-height
:
100%
;
transition
:
margin-left
0
.28s
;
transition
:
all
0
.28s
;
margin-left
:
$sideBarWidth
;
margin-left
:
40px
;
position
:
relative
;
position
:
relative
;
flex
:
auto
;
overflow
:
hidden
;
}
}
.sidebar-container
{
.sidebar-container
{
transition
:
width
0
.28s
;
transition
:
width
0
.28s
;
width
:
$sideBarWidth
!
important
;
width
:
$sideBarWidth
!
important
;
background-color
:
$menuBg
;
background-color
:
$menuBg
;
height
:
calc
(
100%
-
58px
);
position
:
fixed
;
font-size
:
0px
;
font-size
:
0px
;
bottom
:
0
;
bottom
:
0
;
z-index
:
1001
;
z-index
:
1001
;
overflow
:
hidden
;
overflow
:
hidden
;
flex
:
none
;
box-shadow
:
0px
2px
2px
0px
rgba
(
228
,
228
,
228
,
0
.35
);
border-radius
:
10px
;
.el-menu-item.is-active
{
.el-menu-item.is-active
{
color
:
#fff
!
important
;
background-color
:
$menuActiveBg
!
important
;
background-color
:
$menuActiveBg
!
important
;
border-right
:
2px
solid
#0079de
;
}
}
// reset element-ui css
// reset element-ui css
...
@@ -91,11 +94,11 @@
...
@@ -91,11 +94,11 @@
.hideSidebar
{
.hideSidebar
{
.sidebar-container
{
.sidebar-container
{
width
:
54px
!
important
;
width
:
0
!
important
;
}
}
.main-container
{
.main-container
{
margin-left
:
54px
;
margin-left
:
0
;
}
}
.submenu-title-noDropdown
{
.submenu-title-noDropdown
{
...
...
linkwe-ui/src/styles/variables.scss
View file @
cee29c9
...
@@ -15,12 +15,12 @@ $menuActiveText: #333;
...
@@ -15,12 +15,12 @@ $menuActiveText: #333;
$subMenuActiveText
:
#333
;
// https://github.com/ElemeFE/element/issues/12951
$subMenuActiveText
:
#333
;
// https://github.com/ElemeFE/element/issues/12951
$menuBg
:
#fff
;
$menuBg
:
#fff
;
$menuActiveBg
:
#
4ca1e8
;
$menuActiveBg
:
#
fafafa
;
$menuHover
:
#
4ca1e8
;
$menuHover
:
#
fafafa
;
$subMenuBg
:
#fff
;
$subMenuBg
:
#fff
;
$subMenuActiveBg
:
#
4ca1e8
;
$subMenuActiveBg
:
#
fafafa
;
$subMenuHover
:
#
4ca1e8
;
$subMenuHover
:
#
fafafa
;
$sideBarWidth
:
200px
;
$sideBarWidth
:
200px
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment