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 9c936dde
authored
Jun 05, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
路由名称问题
1 parent
bc997c6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
vue3-lw-pc/src/stores/modules/permission.js
vue3-lw-pc/src/views/contentCenter/components/liveCodeTable.vue
vue3-lw-pc/src/views/customerManage/dimission/allocatedStaffDetailList.vue
vue3-lw-pc/src/stores/modules/permission.js
View file @
9c936dd
...
@@ -66,6 +66,8 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
...
@@ -66,6 +66,8 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
route
.
meta
=
route
.
meta
||
{}
route
.
meta
=
route
.
meta
||
{}
route
.
meta
.
hidden
=
route
.
hidden
route
.
meta
.
hidden
=
route
.
hidden
// 默认返回的name为大驼峰式的组件名
// 删除name,避免vue router自动删除重名的路由
delete
route
.
name
delete
route
.
name
if
(
parentPath
)
{
if
(
parentPath
)
{
...
@@ -88,7 +90,7 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
...
@@ -88,7 +90,7 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
route
.
component
=
Layout
route
.
component
=
Layout
}
}
}
else
{
}
else
{
route
.
component
=
loadView
(
route
.
component
)
route
.
component
=
loadView
(
route
)
}
}
}
}
let
children
=
route
.
children
let
children
=
route
.
children
...
@@ -103,12 +105,25 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
...
@@ -103,12 +105,25 @@ function filterAsyncRouter(asyncRouterMap, parentPath) {
// 匹配views里面所有的.vue文件
// 匹配views里面所有的.vue文件
const
modules
=
import
.
meta
.
glob
(
'./../../views/**/*.vue'
)
const
modules
=
import
.
meta
.
glob
(
'./../../views/**/*.vue'
)
export
const
loadView
=
(
view
)
=>
{
export
const
loadView
=
(
route
)
=>
{
let
res
let
res
for
(
const
path
in
modules
)
{
for
(
const
path
in
modules
)
{
const
dir
=
path
.
split
(
'views/'
)[
1
].
split
(
'.vue'
)[
0
]
const
dir
=
path
.
split
(
'views/'
)[
1
].
split
(
'.vue'
)[
0
]
if
(
dir
===
view
)
{
if
(
dir
===
route
.
component
)
{
res
=
modules
[
path
]
res
=
modules
[
path
]
// 为需要单独使用的路由命名,避免使用绝对路径跳转
let
routeNames
=
{
'customerManage/customerDetail'
:
'customerDetail'
,
// 客户详情
'drainageCode/staff/list'
:
'staffCode'
,
// 员工活码
'drainageCode/group/list'
:
'customerGroupCode'
,
// 群活码
'drainageCode/store/list'
:
'storeCode'
,
//门店活码
'drainageCode/identity/list'
:
'identityCode'
,
//识客码
'drainageCode/pullNews/list'
:
'pullNewsCode'
,
//拉新活码
'enterpriseWechat/list'
:
window
.
lwConfig
.
WORKWEIXINPAGENAME
,
//企微配置
}
routeNames
[
route
.
component
]
&&
(
route
.
name
=
routeNames
[
route
.
component
])
break
break
}
}
}
}
...
...
vue3-lw-pc/src/views/contentCenter/components/liveCodeTable.vue
View file @
9c936dd
...
@@ -400,11 +400,11 @@ export default {
...
@@ -400,11 +400,11 @@ export default {
},
},
goAdd
()
{
goAdd
()
{
let
router
=
{
let
router
=
{
ygcode
:
'
Staff
'
,
ygcode
:
'
staffCode
'
,
kqcode
:
'
CustomerGroup
'
,
kqcode
:
'
customerGroupCode
'
,
mdcoed
:
'
Stor
e'
,
mdcoed
:
'
storeCod
e'
,
skcode
:
'
Identity
'
,
skcode
:
'
identityCode
'
,
lxcode
:
'
NewCustomer
'
,
lxcode
:
'
pullNewsCode
'
,
}
}
this
.
$router
.
push
({
name
:
router
[
this
.
type
]
})
this
.
$router
.
push
({
name
:
router
[
this
.
type
]
})
},
},
...
...
vue3-lw-pc/src/views/customerManage/dimission/allocatedStaffDetailList.vue
View file @
9c936dd
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
v-hasPermi=
"['customerManage:dimission:edit']"
v-hasPermi=
"['customerManage:dimission:edit']"
@
click=
"
@
click=
"
$router.push(
{
$router.push(
{
path
: 'customerDetail',
name
: 'customerDetail',
query: { externalUserid: row.externalUserid, userId: row.firstUserId, isDelete: true }
query: { externalUserid: row.externalUserid, userId: row.firstUserId, isDelete: true }
})
})
"
"
...
...
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