Skip to content

Commit f33a0ab

Browse files
committed
折线图请求得到数据后的处理时间过长添加loading
1 parent ed4ac3c commit f33a0ab

File tree

5 files changed

+8
-55
lines changed

5 files changed

+8
-55
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
node_modules
33
/blog-user
4+
blog-user
45

56
# local env files
67
.env.local
@@ -19,3 +20,4 @@ yarn-error.log*
1920
*.njsproj
2021
*.sln
2122
*.sw*
23+
blog-user/index.html

blog-user/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<!DOCTYPE html><html><head><meta charset=utf-8><title>孙权的博客</title><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name=keywords content="孙权的博客,sunq's blog,sunq,sunq's blog,个人博客,vue.js+node.js,vue.js,node.js,vue,jquery,css3,html5,前端博客,前端技术,css3学习,前端"><meta name=description content=孙权,前端程序猿,自己的技术博客,会一直更新。><link rel=icon href=favicon.jpg><meta name=google-site-verification content=Z4gA0x6X_RESh5-dFgNOtRjV9GFGqSrQCh3kXYgBTrQ><link href=https://cdn.bootcss.com/github-markdown-css/2.10.0/github-markdown.min.css rel=stylesheet><script async src=//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js></script><script>(adsbygoogle = window.adsbygoogle || []).push({
22
google_ad_client: "ca-pub-8100230607365371",
33
enable_page_level_ads: true
4-
});</script><link href=css/app.51a56299.css rel=preload as=style><link href=js/app.f75c9070.js rel=preload as=script><link href=js/chunk-vendors.79888f69.js rel=preload as=script><link href=css/app.51a56299.css rel=stylesheet></head><body><noscript><strong>We're sorry but sunblog doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><div style="display: none;"><script src="https://s13.cnzz.com/z_stat.php?id=1275087148&web_id=1275087148" language=JavaScript></script></div><script src=js/chunk-vendors.79888f69.js></script><script src=js/app.f75c9070.js></script></body></html>
4+
});</script><link href=css/app.9d0f7099.css rel=preload as=style><link href=js/app.8f1783cc.js rel=preload as=script><link href=js/chunk-vendors.68751b68.js rel=preload as=script><link href=css/app.9d0f7099.css rel=stylesheet></head><body><noscript><strong>We're sorry but sunblog doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><div style="display: none;"><script src="https://s13.cnzz.com/z_stat.php?id=1275087148&web_id=1275087148" language=JavaScript></script></div><script src=js/chunk-vendors.68751b68.js></script><script src=js/app.8f1783cc.js></script></body></html>

blog-user/js/chunk-vendors.79888f69.js

Lines changed: 0 additions & 54 deletions
This file was deleted.
-257 KB
Binary file not shown.

src/components/MainPage/analytics.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@
335335
},
336336
Success: function (data) {
337337
let dates = [], readings = [], ipArray = [];
338+
339+
Store.commit('ChangeLoading', true);
340+
338341
if (!that.todayVisit) that.todayVisit = data.dateCountList[0].reading; // 设置今日浏览量PV
339342
if (!that.todayIpNum) that.todayIpNum = data.dateCountList[0].ipNum; // 设置今日IP数
340343
if (!that.yesterdayVisit) that.yesterdayVisit = data.dateCountList[1].reading; // 设置昨日浏览量PV
@@ -354,6 +357,8 @@
354357
that.lineChartOption.series[0].data = readings.reverse();
355358
that.lineChartOption.series[1].data = ipArray.reverse();
356359
that.lineChart.setOption(that.lineChartOption);
360+
361+
Store.commit('ChangeLoading', false);
357362
// 初始化时不创建日志,切换时间维度后,记日志并刷新日志列表
358363
if (!init) {
359364
that.createLog({

0 commit comments

Comments
 (0)