Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
5ce409fd
Commit
5ce409fd
authored
Aug 05, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: keep-alive
parent
cab5d0e0
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
62 additions
and
126 deletions
+62
-126
index.vue
src/components/layout/index.vue
+30
-4
main.js
src/main.js
+0
-24
attractFlowLinkRouter.js
src/router/actCodeManageRouter/attractFlowLinkRouter.js
+6
-4
staffActCodeRouter.js
src/router/actCodeManageRouter/staffActCodeRouter.js
+6
-18
index.js
src/router/index.js
+6
-6
memberGroupSet.vue
src/views/apps/customerApp/memberGroupSet.vue
+1
-1
monthTask.vue
src/views/apps/quota/monthTask.vue
+1
-1
salutatory.vue
src/views/enterprise/salutatory.vue
+0
-8
salutatoryIndex.vue
src/views/enterprise/salutatoryIndex.vue
+1
-0
salutatorySet.vue
src/views/enterprise/salutatorySet.vue
+1
-4
detail.vue
...views/salesleads/actCodeManage/attractFlowLink/detail.vue
+0
-1
index.vue
src/views/salesleads/actCodeManage/attractFlowLink/index.vue
+1
-9
detail.vue
...eads/actCodeManage/attractFlowLink/landingPage/detail.vue
+0
-1
list.vue
...sleads/actCodeManage/attractFlowLink/landingPage/list.vue
+1
-8
act-code-table.vue
...leads/actCodeManage/staffActCode/views/act-code-table.vue
+3
-22
batchAddCode.vue
...esleads/actCodeManage/staffActCode/views/batchAddCode.vue
+2
-2
group-list.vue
...alesleads/actCodeManage/staffActCode/views/group-list.vue
+2
-11
setActCode.vue
...alesleads/actCodeManage/staffActCode/views/setActCode.vue
+0
-1
grStoreList.vue
src/views/salesleads/groupSend/grStoreList.vue
+1
-1
No files found.
src/components/layout/index.vue
View file @
5ce409fd
...
...
@@ -6,11 +6,9 @@
<bread-menu
v-if=
"activedMenu.length > 3"
:menu-list=
"activedMenu.slice(2)"
></bread-menu>
<div
class=
"hb-layout-pager"
id=
"hb-layout-pager-one"
:style=
"
{ height: activedMenu.length > 3 ? `calc(100% - 30px)` : '100%', 'padding-bottom': pagePaddingBottom }">
<!-- 页面内容 -->
<!--
<router-view
v-if=
"activeBrand"
:brandId=
"activeBrand"
:activeGroupId=
"activeGroup"
:tabType=
"activeTab"
@
showTab=
"showTab"
></router-view>
-->
<keep-alive>
<router-view
:brand-id=
"enterpriseId"
:key=
"$route.path"
v-if=
"$route.meta.keepAlive"
></router-view>
<keep-alive
:exclude=
"keepAlive"
>
<router-view
:key=
"$route.path"
:brand-id=
"enterpriseId"
></router-view>
</keep-alive>
<router-view
v-if=
"!$route.meta.keepAlive"
:key=
"$route.path"
:brand-id=
"enterpriseId"
></router-view>
</div>
</div>
</div>
...
...
@@ -27,6 +25,33 @@ export default {
name
:
'DmHbLayout'
,
components
:
{
MainMenu
,
AsideMenu
,
BreadMenu
},
provide
:
()
=>
provideData
,
beforeRouteUpdate
(
to
,
from
,
next
)
{
if
(
Array
.
isArray
(
to
.
meta
.
fromPath
))
{
to
.
meta
.
fromPath
.
some
(
el
=>
{
let
menuUrlReg
=
el
;
let
pathConfigReg
=
/
(
:.*
)(\/?)
/
;
const
pathRegStr
=
'([
\\
d
\\
w]+[
\\
-]*[
\\
d
\\
w]*)'
;
while
(
pathConfigReg
.
test
(
menuUrlReg
))
{
menuUrlReg
=
menuUrlReg
.
replace
(
pathConfigReg
,
`
${
pathRegStr
}
$2`
);
}
pathConfigReg
=
/
(\/\*)(\/?)
/
;
while
(
pathConfigReg
.
test
(
menuUrlReg
))
{
menuUrlReg
=
menuUrlReg
.
replace
(
pathConfigReg
,
`
${
pathRegStr
}
$2`
);
}
const
reg
=
new
RegExp
(
`^
${
menuUrlReg
}
$`
);
if
(
reg
.
test
(
from
.
path
))
{
this
.
keepAlive
=
[];
}
else
{
this
.
keepAlive
=
[
to
.
meta
.
componentName
];
}
return
reg
.
test
(
from
.
path
);
});
setTimeout
(()
=>
{
this
.
keepAlive
=
[];
},
100
);
}
next
();
},
props
:
{
// 菜单树数据
menuList
:
{
...
...
@@ -40,6 +65,7 @@ export default {
},
data
()
{
return
{
keepAlive
:
[],
showAside
:
true
,
pagePaddingBottom
:
null
,
enterpriseId
:
''
,
...
...
src/main.js
View file @
5ce409fd
...
...
@@ -79,30 +79,6 @@ router.beforeEach((to, from, next) => {
}
else
{
baseUrl
=
host
;
}
const
{
fromPath
=
[],
refresh
}
=
from
.
meta
||
{};
if
(
Array
.
isArray
(
fromPath
))
{
from
.
meta
.
keepAlive
=
fromPath
.
some
(
el
=>
{
let
menuUrlReg
=
el
;
let
pathConfigReg
=
/
(
:.*
)(\/?)
/
;
const
pathRegStr
=
'([
\\
d
\\
w]+[
\\
-]*[
\\
d
\\
w]*)'
;
while
(
pathConfigReg
.
test
(
menuUrlReg
))
{
menuUrlReg
=
menuUrlReg
.
replace
(
pathConfigReg
,
`
${
pathRegStr
}
$2`
);
}
pathConfigReg
=
/
(\/\*)(\/?)
/
;
while
(
pathConfigReg
.
test
(
menuUrlReg
))
{
menuUrlReg
=
menuUrlReg
.
replace
(
pathConfigReg
,
`
${
pathRegStr
}
$2`
);
}
const
reg
=
new
RegExp
(
menuUrlReg
);
return
reg
.
test
(
to
.
path
);
});
if
(
from
.
meta
.
keepAlive
){
to
.
meta
.
refresh
=
false
;
}
else
{
to
.
meta
.
refresh
=
refresh
;
}
}
next
();
});
...
...
src/router/actCodeManageRouter/attractFlowLinkRouter.js
View file @
5ce409fd
...
...
@@ -6,8 +6,10 @@ const attractFlowLinkRouter = [
name
:
'引流链接'
,
component
:
_import
(
'salesleads/actCodeManage/attractFlowLink'
,
'index'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/attractFlowLinkAdd'
,
'/attractFlowLinkEdit/:id'
,
'/attractFlowLinkInfo/:id'
,
'/attractFlowLinkInfos/:id'
]
// 页面组件的name属性
componentName
:
'attractFlowLink'
,
// 从fromPath回到当前页面时,需要使用keep-alive
fromPath
:
[
'/attractFlowLinkEdit/:id'
,
'/attractFlowLinkInfo/:id'
,
'/attractFlowLinkInfos/:id'
]
}
},
{
...
...
@@ -52,8 +54,8 @@ const attractFlowLinkRouter = [
name
:
'落地页列表'
,
component
:
_import
(
'salesleads/actCodeManage/attractFlowLink/landingPage'
,
'list'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/ladingPage
Add'
,
'/ladingPage
Edit/:id'
]
componentName
:
'ladingPageList'
,
fromPath
:
[
'/ladingPageEdit/:id'
]
}
},
{
...
...
src/router/actCodeManageRouter/staffActCodeRouter.js
View file @
5ce409fd
...
...
@@ -6,8 +6,8 @@ const staffActCodeRouter = [
name
:
'员工活码'
,
component
:
_import
(
'salesleads/actCodeManage/staffActCode'
,
'index'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/actCode
Add'
,
'/actCode
Edit'
,
'/actCodeBatch'
,
'/actCodeDetail'
,
'/actCodeDetails'
]
componentName
:
'staffActCode'
,
fromPath
:
[
'/actCodeEdit'
,
'/actCodeBatch'
,
'/actCodeDetail'
,
'/actCodeDetails'
]
}
},
{
...
...
@@ -25,36 +25,24 @@ const staffActCodeRouter = [
name
:
'活码详情-详情'
,
component
:
_import
(
'salesleads/actCodeManage/staffActCode'
,
'actCodeDetail'
),
meta
:
{
keepAlive
:
true
,
componentName
:
'actCodeDetail'
,
fromPath
:
[
'/actCodeRecord'
]
}
},
{
path
:
'/actCodeAdd'
,
name
:
'新增活码'
,
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'setActCode'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/salutatorySet'
]
}
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'setActCode'
)
},
{
path
:
'/actCodeEdit'
,
name
:
'编辑活码'
,
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'setActCode'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/salutatorySet'
]
}
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'setActCode'
)
},
{
path
:
'/actCodeBatch'
,
name
:
'批量创建活码'
,
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'batchAddCode'
),
meta
:
{
keepAlive
:
true
,
fromPath
:
[
'/salutatorySet'
]
}
component
:
_import
(
'salesleads/actCodeManage/staffActCode/views'
,
'batchAddCode'
)
}
];
export
default
staffActCodeRouter
;
src/router/index.js
View file @
5ce409fd
...
...
@@ -102,8 +102,8 @@ export const constantRouterMap = [
name
:
'欢迎语'
,
component
:
_import
(
'enterprise'
,
'salutatoryIndex'
),
meta
:{
keepAlive
:
true
,
fromPath
:
[
'/editSalutatorySet'
,
'/salutatorySet'
]
componentName
:
'salutatoryIndex'
,
fromPath
:
[
'/editSalutatorySet'
]
}
},
{
...
...
@@ -148,7 +148,7 @@ export const constantRouterMap = [
name
:
'话务任务记录'
,
component
:
_import
(
'salesleads/trafficTask'
,
'taskRecord'
),
meta
:
{
keepAlive
:
true
,
componentName
:
'TaskRecord'
,
fromPath
:
[
'/taskDetail'
]
}
...
...
@@ -178,7 +178,7 @@ export const constantRouterMap = [
name
:
'门店视图'
,
component
:
_import
(
'salesleads/groupSend'
,
'grStoreList'
),
meta
:
{
keepAlive
:
true
,
componentName
:
'grStoreList'
,
fromPath
:
[
'/grStoreDetail/:id'
]
}
},
...
...
@@ -246,7 +246,7 @@ export const constantRouterMap = [
name
:
'客户分组设置'
,
component
:
_import
(
'apps/customerApp'
,
'memberGroupSet'
),
meta
:
{
keepAlive
:
true
,
componentName
:
'memberGroupSet'
,
fromPath
:
[
'/addGroupTemplate'
,
'/editGroupTemplate'
,
'/storeRangeSet'
]
}
},
...
...
@@ -357,7 +357,7 @@ export const constantRouterMap = [
name
:
'月指标任务'
,
component
:
_import
(
'apps/quota'
,
'monthTask'
),
meta
:
{
keepAlive
:
true
,
componentName
:
'monthTask'
,
fromPath
:
[
'/monthTaskDetail'
]
}
},
...
...
src/views/apps/customerApp/memberGroupSet.vue
View file @
5ce409fd
...
...
@@ -27,7 +27,7 @@
import
MemberGroupList
from
'./memberGroupList.vue'
;
import
MemberGroupSetList
from
'./memberGroupSetList.vue'
;
export
default
{
name
:
'
app-detail
'
,
name
:
'
memberGroupSet
'
,
components
:
{
MemberGroupList
,
MemberGroupSetList
},
props
:
{
brandId
:
{
...
...
src/views/apps/quota/monthTask.vue
View file @
5ce409fd
...
...
@@ -51,7 +51,7 @@ import { getRequest, postExcel } from '@/api/api';
import
{
_debounce
}
from
'@/common/js/public'
;
import
errMsg
from
'@/common/js/error'
;
export
default
{
name
:
'
reviewed
'
,
name
:
'
monthTask
'
,
props
:
{
brandId
:
{
type
:
String
,
...
...
src/views/enterprise/salutatory.vue
View file @
5ce409fd
...
...
@@ -125,16 +125,8 @@ export default {
},
mounted
()
{
this
.
getData
();
console
.
log
(
'mounted'
);
},
activated
()
{
if
(
this
.
$route
.
meta
.
refresh
)
{
this
.
form
=
{
title
:
''
,
pageSize
:
20
,
pageNum
:
1
};
}
this
.
getData
();
},
props
:
{
...
...
src/views/enterprise/salutatoryIndex.vue
View file @
5ce409fd
...
...
@@ -14,6 +14,7 @@
<
script
>
import
salutatory
from
'./salutatory.vue'
;
export
default
{
name
:
'salutatoryIndex'
,
components
:
{
salutatory
},
...
...
src/views/enterprise/salutatorySet.vue
View file @
5ce409fd
...
...
@@ -684,10 +684,7 @@ export default {
type
:
'success'
,
message
:
'保存成功!'
});
if
(
!
this
.
$route
.
query
.
id
)
{
this
.
$route
.
meta
.
refresh
=
true
;
}
sessionStorage
.
setItem
(
'activeName'
,
para
.
type
);
this
.
$router
.
push
(
'salutatory'
);
}
})
...
...
src/views/salesleads/actCodeManage/attractFlowLink/detail.vue
View file @
5ce409fd
...
...
@@ -443,7 +443,6 @@ export default {
.
then
(
res
=>
{
setTimeout
(()
=>
{
this
.
btnLoading
=
false
;
this
.
$route
.
meta
.
refresh
=
true
;
this
.
$router
.
go
(
-
1
);
},
1000
);
})
...
...
src/views/salesleads/actCodeManage/attractFlowLink/index.vue
View file @
5ce409fd
...
...
@@ -136,6 +136,7 @@ const tableHead = [
}
];
export
default
{
name
:
'attractFlowLink'
,
data
()
{
let
tableMaxHeight
=
document
.
body
.
clientHeight
-
285
+
'px'
;
return
{
...
...
@@ -219,15 +220,6 @@ export default {
this
.
getList
();
},
activated
()
{
if
(
this
.
$route
.
meta
.
refresh
)
{
this
.
form
=
{
pageSize
:
20
,
pageNum
:
1
,
linkType
:
''
,
searchParams
:
''
,
dateRange
:
[]
};
}
this
.
getList
();
},
components
:
{
...
...
src/views/salesleads/actCodeManage/attractFlowLink/landingPage/detail.vue
View file @
5ce409fd
...
...
@@ -137,7 +137,6 @@ export default {
guidePageSave
(
this
.
form
)
.
then
(
_
=>
{
this
.
$router
.
push
(
'/ladingPageList'
);
this
.
$route
.
meta
.
refresh
=
true
;
this
.
$message
.
success
(
'保存成功'
);
})
.
finally
(
_
=>
{
...
...
src/views/salesleads/actCodeManage/attractFlowLink/landingPage/list.vue
View file @
5ce409fd
...
...
@@ -26,6 +26,7 @@ import relationDialog from './relationDialog';
import
{
guidePageList
,
guidePageDel
,
guidePageRelation
}
from
'@/api/actCode'
;
import
{
_debounce
}
from
'@/common/js/public'
;
export
default
{
name
:
'ladingPageList'
,
data
()
{
return
{
form
:
{
...
...
@@ -115,14 +116,6 @@ export default {
this
.
getList
();
},
activated
()
{
if
(
this
.
$route
.
meta
.
refresh
)
{
this
.
form
=
{
pageSearchText
:
''
,
dateRange
:
[],
pageSize
:
20
,
pageNum
:
1
};
}
this
.
getList
();
},
methods
:
{
...
...
src/views/salesleads/actCodeManage/staffActCode/views/act-code-table.vue
View file @
5ce409fd
...
...
@@ -373,30 +373,11 @@ export default {
}
;
}
,
created() {
if (!this.$route.meta.keepAlive) {
this.getTableList();
this.searchGroup();
}
this.searchGroup();
this.getTableList();
}
,
activated() {
if (this.$route.meta.refresh) {
this.inFields = {
hmSelect: '',
statusFlagInt: '',
storeSelect: '',
clerkSelect: '',
hmTypeInt: '',
startTime: '',
endTime: '',
orderByField: 'createTime desc',
hmGroupId: '-1'
}
;
this.pageParam = {
pageSize: 20,
pageNo: 1
}
;
}
this.searchGroup();
this.getTableList();
}
,
methods: {
...
...
src/views/salesleads/actCodeManage/staffActCode/views/batchAddCode.vue
View file @
5ce409fd
...
...
@@ -75,16 +75,16 @@ export default {
if
(
this
.
memberType
==
1
)
{
this
.
form
.
clerkIdList
=
[
'-1'
];
this
.
form
.
hmUserNum
=
this
.
hmMemberNum
;
}
else
{
this
.
form
.
clerkIdList
=
this
.
form
.
clerkList
.
map
(
el
=>
el
.
clerkId
);
}
let
obj
=
{
...
event
,
...
this
.
form
};
obj
.
clerkIdList
=
obj
.
clerkList
.
map
(
el
=>
el
.
clerkId
);
postJsonRequest
(
'/haoban-manage3-web/hm/qrcode/addList'
,
obj
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
setTimeout
(()
=>
{
this
.
$route
.
meta
.
refresh
=
true
;
this
.
$refs
.
setActCodePage
.
saveLoading
=
false
;
this
.
$router
.
go
(
-
1
);
},
1000
);
...
...
src/views/salesleads/actCodeManage/staffActCode/views/group-list.vue
View file @
5ce409fd
...
...
@@ -100,19 +100,10 @@ export default {
}
;
}
,
created
()
{
if
(
!
this
.
$route
.
meta
.
refresh
)
{
this
.
searchGroup
();
}
this
.
searchGroup
();
}
,
activated
()
{
if
(
this
.
$route
.
meta
.
refresh
)
{
this
.
pageP
=
{
groupName
:
''
,
pageNum
:
1
,
pageSize
:
40
}
;
this
.
searchGroup
();
}
this
.
searchGroup
();
}
,
methods
:
{
onSearch
()
{
...
...
src/views/salesleads/actCodeManage/staffActCode/views/setActCode.vue
View file @
5ce409fd
...
...
@@ -114,7 +114,6 @@ export default {
postJsonRequest
(
'/haoban-manage3-web/hm/qrcode/add'
,
obj
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
0
)
{
setTimeout
(()
=>
{
this
.
$route
.
meta
.
refresh
=
true
;
this
.
$refs
.
setActCodePage
.
btnLoading
=
false
;
this
.
$refs
.
setActCodePage
.
saveLoading
=
false
;
this
.
$router
.
go
(
-
1
);
...
...
src/views/salesleads/groupSend/grStoreList.vue
View file @
5ce409fd
...
...
@@ -93,7 +93,7 @@ import { getRequest, postExcel } from '@/api/api';
import
errMsg
from
'@/common/js/error'
;
import
{
_debounce
}
from
'@/common/js/public'
;
export
default
{
name
:
'
s
toreList'
,
name
:
'
grS
toreList'
,
props
:
{
brandId
:
{
type
:
String
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment