Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
supervise-wecom
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 ce1517b4
authored
Jun 04, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(性能概览): 添加页面激活状态管理,优化数据获取逻辑
1 parent
b1883ddc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
src/views/performance/components/storeTabItem/index.vue
src/views/performance/components/supervisorTabItem/index.vue
src/views/performance/view/index.vue
src/views/performance/components/storeTabItem/index.vue
View file @
ce1517b
...
@@ -111,6 +111,13 @@ export default {
...
@@ -111,6 +111,13 @@ export default {
RegionPicker
,
RegionPicker
,
WarnList
,
WarnList
,
},
},
inject
:
{
// 自定义内部变量名
getPageActive
:
{
from
:
"getPageActive"
,
// 来自 provide 的 key
default
:
()
=>
true
,
// 没传时的默认值
},
},
data
()
{
data
()
{
return
{
return
{
throttledFilterSearchKeyword
:
null
,
throttledFilterSearchKeyword
:
null
,
...
@@ -210,6 +217,9 @@ export default {
...
@@ -210,6 +217,9 @@ export default {
};
};
},
},
async
getData
()
{
async
getData
()
{
if
(
!
this
.
getPageActive
())
{
return
;
}
this
.
list
.
loading
=
true
;
this
.
list
.
loading
=
true
;
this
.
$loading
.
show
();
this
.
$loading
.
show
();
try
{
try
{
...
...
src/views/performance/components/supervisorTabItem/index.vue
View file @
ce1517b
...
@@ -78,6 +78,13 @@ export default {
...
@@ -78,6 +78,13 @@ export default {
StatisticsItem
,
StatisticsItem
,
Empty
,
Empty
,
},
},
inject
:
{
// 自定义内部变量名
getPageActive
:
{
from
:
"getPageActive"
,
// 来自 provide 的 key
default
:
()
=>
true
,
// 没传时的默认值
},
},
data
()
{
data
()
{
return
{
return
{
throttledFilterSearchKeyword
:
null
,
throttledFilterSearchKeyword
:
null
,
...
@@ -134,7 +141,9 @@ export default {
...
@@ -134,7 +141,9 @@ export default {
};
};
},
},
async
getData
()
{
async
getData
()
{
console
.
log
(
"parent"
);
if
(
!
this
.
getPageActive
())
{
return
;
}
this
.
list
.
loading
=
true
;
this
.
list
.
loading
=
true
;
this
.
$loading
.
show
();
this
.
$loading
.
show
();
try
{
try
{
...
...
src/views/performance/view/index.vue
View file @
ce1517b
...
@@ -2,7 +2,9 @@
...
@@ -2,7 +2,9 @@
<div
class=
"page-container"
<div
class=
"page-container"
lazy-render
lazy-render
:style=
"
{ backgroundImage: `url(${pageBgUrl})` }">
:style=
"
{ backgroundImage: `url(${pageBgUrl})` }">
<van-tabs
animated
>
<van-tabs
v-model=
"tabs.active"
animated
lazy-render
>
<van-tab
title=
"督导业绩"
>
<van-tab
title=
"督导业绩"
>
<SupervisorTabItem
/>
<SupervisorTabItem
/>
</van-tab>
</van-tab>
...
@@ -24,11 +26,31 @@ export default {
...
@@ -24,11 +26,31 @@ export default {
SupervisorTabItem
,
SupervisorTabItem
,
StoreTabItem
,
StoreTabItem
,
},
},
provide
()
{
return
{
getPageActive
:
()
=>
{
return
this
.
isPageActive
;
},
};
},
data
()
{
data
()
{
return
{
return
{
isPageActive
:
false
,
tabs
:
{
active
:
0
,
},
pageBgUrl
:
"https://img02.glsx.com.cn/weapp/resource/supervise-wecom/page-bg.png"
,
pageBgUrl
:
"https://img02.glsx.com.cn/weapp/resource/supervise-wecom/page-bg.png"
,
};
};
},
},
activated
()
{
console
.
log
(
"当前页面激活了 ✅"
);
this
.
isPageActive
=
true
;
},
// 页面被隐藏时触发
deactivated
()
{
console
.
log
(
"当前页面离开了 ❌"
);
this
.
isPageActive
=
false
;
},
created
()
{
created
()
{
},
},
async
mounted
()
{
async
mounted
()
{
...
...
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