Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
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 4ce59807
authored
Sep 19, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
test
1 parent
4132e498
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
9 deletions
src/global/history.js
src/layout/components/LeftSide/LeftSideMenuLv3.vue
src/layout/components/LeftSide/MenuLv4.vue
src/store/modules/app.js
src/global/history.js
View file @
4ce5980
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
* @Author: limin
* @Author: limin
* @Date: 2021-08-25 14:52:15
* @Date: 2021-08-25 14:52:15
* @LastEditors: limin
* @LastEditors: limin
* @LastEditTime: 202
1-10-13 11:22:37
* @LastEditTime: 202
3-09-19 11:18:00
* @FilePath: \scrm
\scrm
-base\src\global\history.js
* @FilePath: \scrm-base\src\global\history.js
*/
*/
import
store
from
'@/store'
import
store
from
'@/store'
import
{
utils
}
from
'glsx-common'
import
{
utils
}
from
'glsx-common'
...
@@ -36,8 +36,9 @@ function push(menu) {
...
@@ -36,8 +36,9 @@ function push(menu) {
if
(
!
url
)
{
if
(
!
url
)
{
throw
new
Error
(
'history.push:必须传入URL'
)
throw
new
Error
(
'history.push:必须传入URL'
)
}
}
const
to
=
store
.
getters
.
app
.
flatten
.
find
(
mod
=>
url
===
mod
.
path
||
'/'
+
url
===
mod
.
path
)
const
to
=
utils
.
array
.
valInDeep
(
store
.
getters
.
app
.
menuList
,
url
,
'path'
,
'children'
)
||
[]
to
&&
val
(
to
)
// const to = store.getters.app.flatten.find(mod => url === mod.path || '/' + url === mod.path)
to
[
0
]
&&
val
(
to
[
0
])
if
(
!
url
)
{
if
(
!
url
)
{
throw
new
Error
(
'跳转页面失败,请检查页面参数是否正确'
)
throw
new
Error
(
'跳转页面失败,请检查页面参数是否正确'
)
}
}
...
...
src/layout/components/LeftSide/LeftSideMenuLv3.vue
View file @
4ce5980
...
@@ -20,8 +20,8 @@ export default {
...
@@ -20,8 +20,8 @@ export default {
handleSelect
({
path
,
children
=
[]
})
{
handleSelect
({
path
,
children
=
[]
})
{
if
(
path
)
{
if
(
path
)
{
this
.
$router
.
push
(
path
)
this
.
$router
.
push
(
path
)
this
.
bus
.
$emit
(
'menu3Changed'
,
children
.
noHidden
())
}
}
this
.
bus
.
$emit
(
'menu3Changed'
,
children
.
noHidden
())
}
}
}
}
}
}
...
...
src/layout/components/LeftSide/MenuLv4.vue
View file @
4ce5980
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<
script
>
<
script
>
import
{
currentId
}
from
'./mixins/index'
import
{
currentId
}
from
'./mixins/index'
import
{
utils
}
from
'glsx-common'
export
default
{
export
default
{
name
:
'MenuLv4'
,
name
:
'MenuLv4'
,
inject
:
[
'bus'
],
inject
:
[
'bus'
],
...
@@ -38,16 +39,18 @@ export default {
...
@@ -38,16 +39,18 @@ export default {
this
.
$nextTick
(()
=>
(
this
.
activeName
=
sub
.
path
))
this
.
$nextTick
(()
=>
(
this
.
activeName
=
sub
.
path
))
}
}
},
},
find
(
id
)
{
return
this
.
app
.
flatten
.
find
(
item
=>
item
.
id
==
id
)
},
onMenu3Changed
(
menus
=
[])
{
onMenu3Changed
(
menus
=
[])
{
this
.
setActive
(
menus
[
0
]?.
id
,
menus
)
this
.
setActive
(
menus
[
0
]?.
id
,
menus
)
},
},
find
(
id
)
{
const
item
=
utils
.
array
.
valInDeep
(
this
.
app
.
menuList
,
id
,
'id'
,
'children'
)
||
[]
return
item
[
0
]
},
onLoad
()
{
onLoad
()
{
const
{
lv1
,
lv2
,
lv3
,
lv4
}
=
this
.
current
const
{
lv1
,
lv2
,
lv3
,
lv4
}
=
this
.
current
const
lv3id
=
`
${
lv1
}
-
${
lv2
}
-
${
lv3
}
`
const
lv3id
=
`
${
lv1
}
-
${
lv2
}
-
${
lv3
}
`
const
lv4id
=
`
${
lv3id
}
-
${
lv4
}
`
const
lv4id
=
`
${
lv3id
}
-
${
lv4
}
`
console
.
log
(
lv4id
)
const
sub
=
this
.
find
(
lv3id
)?.
children
const
sub
=
this
.
find
(
lv3id
)?.
children
if
(
sub
?.
length
)
{
if
(
sub
?.
length
)
{
const
nav4
=
sub
.
noHidden
()
const
nav4
=
sub
.
noHidden
()
...
...
src/store/modules/app.js
View file @
4ce5980
...
@@ -18,7 +18,7 @@ const app = {
...
@@ -18,7 +18,7 @@ const app = {
},
},
SET_MENU_LIST
(
state
,
list
)
{
SET_MENU_LIST
(
state
,
list
)
{
state
.
menuList
=
list
state
.
menuList
=
list
state
.
flatten
=
utils
.
array
.
flattenDeep
(
list
)
//
state.flatten = utils.array.flattenDeep(list)
},
},
SET_ROUTES
(
state
,
payload
)
{
SET_ROUTES
(
state
,
payload
)
{
state
.
routers
=
payload
state
.
routers
=
payload
...
...
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