Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
b37eff8c
提交
b37eff8c
authored
8月 27, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(router): 修改:勤策移动端_促销菜单跳转修复
上级
42ae05d6
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
70 行增加
和
53 行删除
+70
-53
permission.js
src/permission.js
+1
-0
permission.js
src/store/modules/permission.js
+8
-2
index.vue
src/views/mobile/index.vue
+19
-3
inspectionTask.vue
...ctivity/sales_point_inspection/examine/inspectionTask.vue
+0
-0
newTerminal.vue
...t_activity/sales_point_inspection/examine/newTerminal.vue
+0
-0
storeList.vue
...dit_activity/sales_point_inspection/examine/storeList.vue
+3
-1
taskList.vue
...udit_activity/sales_point_inspection/examine/taskList.vue
+0
-0
index.vue
src/views/mobile/pages/cp_activity/examine/index.vue
+0
-0
index.vue
...activity/promotion/plan/components/PickerBelong/index.vue
+0
-0
index.vue
.../mobile/pages/cp_activity/promotion/plan/detail/index.vue
+6
-1
taskList.vue
...bile/pages/cp_activity/promotion/plan/detail/taskList.vue
+1
-1
index.vue
...mobile/pages/cp_activity/promotion/plan/editing/index.vue
+0
-0
index.vue
...s/mobile/pages/cp_activity/promotion/plan/index/index.vue
+7
-5
planSearch.vue
...ile/pages/cp_activity/promotion/plan/index/planSearch.vue
+0
-0
index.vue
src/views/mobile/pages/menu/index.vue
+11
-11
index.vue
src/views/mobile/pages/other/logistics/index.vue
+0
-0
index.js
src/views/mobile/router/index.js
+14
-29
没有找到文件。
src/permission.js
浏览文件 @
b37eff8c
...
...
@@ -42,6 +42,7 @@ router.beforeEach((to, from, next) => {
useVersionStore
().
getVersion
().
then
((
res
)
=>
{
// 生成可访问路由表
accessRoutes
.
forEach
(
route
=>
{
console
.
log
(
'挂载路由'
,
route
)
if
(
!
isHttp
(
route
.
path
)
)
{
router
.
addRoute
(
route
)
}
...
...
src/store/modules/permission.js
浏览文件 @
b37eff8c
...
...
@@ -3,6 +3,7 @@ import router, { constantRoutes, dynamicRoutes } from '@/router'
import
{
getRouters
}
from
'@/api'
import
Layout
from
'@/layout/index'
import
ParentView
from
'@/components/ParentView'
import
MobileIndex
from
'@/views/mobile/index'
import
InnerLink
from
'@/layout/components/InnerLink'
import
useUserStore
from
'@/store/modules/user'
import
useAppStore
from
'@/store/modules/app'
...
...
@@ -44,7 +45,7 @@ const usePermissionStore = defineStore(
res
.
data
=
res
.
data
.
filter
(
item
=>
item
.
belongSys
==
0
)
}
else
{
// 勤策
res
.
data
=
res
.
data
.
filter
(
item
=>
item
.
belongSys
==
1
)
res
.
data
=
res
.
data
.
filter
(
item
=>
item
.
belongSys
==
1
)
[
0
].
children
}
const
sdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
const
rdata
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
...
...
@@ -84,7 +85,12 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
if
(
route
.
component
===
'Layout'
)
{
route
.
component
=
Layout
}
else
if
(
route
.
component
===
'ParentView'
)
{
route
.
component
=
ParentView
// 勤策移动端
if
(
useAppStore
().
belongSys
==
1
)
{
route
.
component
=
MobileIndex
}
else
{
route
.
component
=
ParentView
}
}
else
if
(
route
.
component
===
'InnerLink'
)
{
route
.
component
=
InnerLink
}
else
{
...
...
src/views/mobile/index.vue
浏览文件 @
b37eff8c
...
...
@@ -7,13 +7,29 @@
</
template
>
<
script
setup
>
import
{
constantMobileRoutes
}
from
'@/views/mobile/router'
import
usePermissionStore
from
'@/store/modules/permission'
;
const
permissionStore
=
usePermissionStore
();
// 递归判断有 children 往里走找到所有路由对象 meta 的 keepAlive 是 true 的然后返回 meta 同级的 name 名字的值,组成一个数组
const
cachedViews
=
[]
watch
(
()
=>
permissionStore
.
sidebarRouters
,
(
newRoutes
)
=>
{
if
(
newRoutes
.
length
>
0
)
{
// 路由加载完成后转换格式
// 把 hidden: true 的筛选掉
getKeepAliveName
(
newRoutes
)
}
},
{
immediate
:
true
,
deep
:
true
}
);
function
getKeepAliveName
(
routes
)
{
console
.
log
(
'routes'
,
routes
)
routes
.
forEach
((
item
)
=>
{
if
(
item
.
meta
?.
keepAlive
)
{
console
.
log
(
'1'
,
item
)
if
(
!
item
.
meta
?.
noCache
&&
item
.
name
)
{
// 是否缓存
cachedViews
.
push
(
item
.
name
)
}
if
(
item
.
children
)
{
...
...
@@ -21,5 +37,5 @@ function getKeepAliveName(routes) {
}
})
}
getKeepAliveName
(
constantMobileRoutes
)
</
script
>
src/views/mobile/
view
s/audit_activity/sales_point_inspection/examine/inspectionTask.vue
→
src/views/mobile/
page
s/audit_activity/sales_point_inspection/examine/inspectionTask.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/audit_activity/sales_point_inspection/examine/newTerminal.vue
→
src/views/mobile/
page
s/audit_activity/sales_point_inspection/examine/newTerminal.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/audit_activity/sales_point_inspection/examine/storeList.vue
→
src/views/mobile/
page
s/audit_activity/sales_point_inspection/examine/storeList.vue
浏览文件 @
b37eff8c
<
template
>
<!-- 门店列表 -->
<div>
门店列表
</div>
</
template
>
<
script
setup
>
...
...
src/views/mobile/
view
s/audit_activity/sales_point_inspection/examine/taskList.vue
→
src/views/mobile/
page
s/audit_activity/sales_point_inspection/examine/taskList.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/cp_activity/examine/index.vue
→
src/views/mobile/
page
s/cp_activity/examine/index.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/cp_activity/promotion/plan/components/PickerBelong/index.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/components/PickerBelong/index.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/cp_activity/promotion/plan/detail/index.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/detail/index.vue
浏览文件 @
b37eff8c
...
...
@@ -211,6 +211,11 @@ getPlanDetail()
// 点击稽查按钮
const
clickExamine
=
async
()
=>
{
if
(
examined
.
value
)
{
router
.
push
({
path
:
`/examine/${examined.value
}
`
}
)
return
}
// 确认是否开始稽查
showConfirmDialog
({
title
:
'系统提示'
,
...
...
@@ -234,7 +239,7 @@ const clickExamine = async () => {
}
newExamined
.
value
=
result
.
data
.
id
}
router
.
push
({
path
:
`/
m/
examine/${examined?.value || newExamined.value
}
`
}
)
router
.
push
({
path
:
`/examine/${examined?.value || newExamined.value
}
`
}
)
}
)
}
...
...
src/views/mobile/
view
s/cp_activity/promotion/plan/detail/taskList.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/detail/taskList.vue
浏览文件 @
b37eff8c
...
...
@@ -11,7 +11,7 @@
@
load=
"onLoad"
>
<van-cell-group
inset
v-if=
"planList?.length > 0"
>
<van-cell
v-for=
"item, index in planList
.concat(planList)
"
<van-cell
v-for=
"item, index in planList"
:key=
"item.id"
>
<template
#
title
>
<p
class=
"cell-info"
>
...
...
src/views/mobile/
view
s/cp_activity/promotion/plan/editing/index.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/editing/index.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/cp_activity/promotion/plan/index/index.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/index/index.vue
浏览文件 @
b37eff8c
...
...
@@ -84,7 +84,7 @@
<
script
setup
>
// 指定当前组件的名字
defineOptions
({
name
:
'
m_p
romotion_plan'
name
:
'
P
romotion_plan'
}
)
import
userStore
from
'@/store/modules/user'
import
{
parseTime
}
from
'@/utils'
...
...
@@ -105,7 +105,8 @@ const showSearch = ref(false)
// 从新增页面跳转回来需要刷新列表
watch
(()
=>
route
.
path
,
(
newPath
,
oldPath
)
=>
{
if
(
oldPath
.
includes
(
'/promotion_plan_editing'
)
&&
newPath
===
'/m/promotion_plan'
)
{
if
(
oldPath
.
includes
(
'/promotion_plan_editing'
)
&&
newPath
===
'/promotion_plan'
)
{
console
.
log
(
'刷新页面?'
)
planSearch
.
value
.
resetFn
()
}
}
);
...
...
@@ -184,7 +185,8 @@ const onRefresh = () => {
const
clickDetail
=
(
row
)
=>
{
// 当前处于长按状态 / 查看已删除列表,点击详情不做任何操作
if
(
showSelect
.
value
||
query
.
isDeleted
)
return
router
.
push
(
`/m/promotion_plan_detail/${row.id
}
?isDeleted=${query.isDeleted
}
`
)
// router.push(`/promotion_plan_detail/$
{
row
.
id
}
?
isDeleted
=
$
{
query
.
isDeleted
}
`)
router.push(`
/
promotion_plan_detail
/
$
{
row
.
id
}
`)
}
// 搜索表单
...
...
@@ -203,7 +205,7 @@ const editPlan = (row) => {
if (!checkPlanChangeExpire(row)) {
return showNotify({ type: 'warning', message: '无法变更,日期小于等于今日'
}
)
}
router
.
push
(
`/
m/
promotion_plan_editing/${row.id
}
`
)
router.push(`
/
promotion_plan_editing
/
$
{
row
.
id
}
`)
}
// 删除计划
...
...
@@ -327,7 +329,7 @@ onUnmounted(() => {
const addNewPlan = () => {
// 后台设置按钮权限分配就能新增
if (proxy.checkPermi(['promotion:plan:create'])) {
router
.
push
(
'/
m/
promotion_plan_editing'
)
router.push('/promotion_plan_editing')
}
else {
showNotify({ type: 'warning', message: '规定日期内_无法新增计划'
}
)
}
...
...
src/views/mobile/
view
s/cp_activity/promotion/plan/index/planSearch.vue
→
src/views/mobile/
page
s/cp_activity/promotion/plan/index/planSearch.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/
view
s/menu/index.vue
→
src/views/mobile/
page
s/menu/index.vue
浏览文件 @
b37eff8c
...
...
@@ -44,26 +44,26 @@ const modules = ref([]); // 替换原有的静态modules
// 格式化路由为菜单所需结构
const
formatRoutesToModules
=
(
routes
)
=>
{
// 根据实际路由结构转换,这里假设需要提取一级路由作为模块
modules
.
value
=
routes
[
0
].
children
.
map
(
o
=>
{
modules
.
value
=
routes
.
map
(
o
=>
{
return
{
title
:
o
.
meta
.
title
,
icons
:
o
.
children
?.
map
(
child
=>
({
name
:
child
.
meta
.
title
,
iconName
:
child
.
meta
.
icon
||
'default'
,
iconColor
:
child
.
meta
.
color
||
'#5aaeec'
,
to
:
child
.
path
to
:
o
.
path
+
'/'
+
child
.
path
}))
||
[]
}
})
// .map(route => ({
// title: route.meta.title,
// icons: route.children?.map(child => ({
// name: child.meta.title,
// iconName: child.meta.icon || 'default',
// iconColor: child.meta.color || '#5aaeec',
// to: child.path
// })) || []
// }))
// .map(route => ({
// title: route.meta.title,
// icons: route.children?.map(child => ({
// name: child.meta.title,
// iconName: child.meta.icon || 'default',
// iconColor: child.meta.color || '#5aaeec',
// to: child.path
// })) || []
// }))
}
// 监听路由变化
watch
(
...
...
src/views/mobile/
view
s/other/logistics/index.vue
→
src/views/mobile/
page
s/other/logistics/index.vue
浏览文件 @
b37eff8c
File moved
src/views/mobile/router/index.js
浏览文件 @
b37eff8c
// 移动端 静态路由
export
const
constantMobileRoutes
=
[
{
...
...
@@ -7,49 +8,34 @@ export const constantMobileRoutes = [
},
{
path
:
'/'
,
redirect
:
'/m'
},
{
path
:
'/m'
,
redirect
:
'/m/menu'
,
component
:
()
=>
import
(
'@/views/mobile/index'
),
hidden
:
true
,
redirect
:
'/menu'
,
children
:
[
// 菜单页
{
path
:
'menu'
,
component
:
()
=>
import
(
'@/views/mobile/views/menu'
),
name
:
'm_menu'
,
},
// 促销计划
{
path
:
'promotion_plan'
,
// 列表
component
:
()
=>
import
(
'@/views/mobile/views/cp_activity/promotion/plan/index'
),
name
:
'm_promotion_plan'
,
meta
:
{
keepAlive
:
true
}
// 标记该路由需要缓存
path
:
'menu'
,
// 菜单页
component
:
()
=>
import
(
'@/views/mobile/pages/menu'
),
name
:
'm_menu'
},
{
path
:
'promotion_plan_detail/:planId'
,
// 详情
component
:
()
=>
import
(
'@/views/mobile/
view
s/cp_activity/promotion/plan/detail'
),
component
:
()
=>
import
(
'@/views/mobile/
page
s/cp_activity/promotion/plan/detail'
),
name
:
'm_promotion_detail'
,
},
{
path
:
'promotion_plan_editing/:planId?'
,
// 增改
component
:
()
=>
import
(
'@/views/mobile/
view
s/cp_activity/promotion/plan/editing'
),
component
:
()
=>
import
(
'@/views/mobile/
page
s/cp_activity/promotion/plan/editing'
),
name
:
'm_promotion_editing'
,
},
// 稽查
{
path
:
'examine/:examineId'
,
component
:
()
=>
import
(
'@/views/mobile/
view
s/cp_activity/examine'
),
path
:
'examine/:examineId'
,
// 促销内稽查
component
:
()
=>
import
(
'@/views/mobile/
page
s/cp_activity/examine'
),
name
:
'm_promotion_examine'
,
},
{
path
:
'logistics'
,
// 物流信息页面
component
:
()
=>
import
(
'@/views/mobile/pages/other/logistics'
),
name
:
'logistics'
}
]
},
// 物流信息页面
{
path
:
'/logistics'
,
component
:
()
=>
import
(
'@/views/mobile/views/other/logistics'
),
name
:
'logistics'
}
]
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论