|
7 | 7 | <div class="info-container">
|
8 | 8 | <span class="display_name">{{name}}</span>
|
9 | 9 | <div class="info-wrapper">
|
10 |
| - <router-link class="info-item" :to="'/article/wscnlist?uid='+uid"> |
11 |
| - <span class="info-item-num">{{statisticsData.article_count | toThousandslsFilter}}</span> |
| 10 | + <div class="info-item" :to="'/article/wscnlist?uid='+uid"> |
| 11 | + <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></countTo> |
12 | 12 | <span class="info-item-text">文章</span>
|
13 | 13 | <wscn-icon-svg icon-class="a" class="dashboard-editor-icon"/>
|
14 |
| - </router-link> |
| 14 | + </div> |
15 | 15 | <div class="info-item" style="cursor: auto">
|
16 |
| - <span class="info-item-num"> {{statisticsData.pageviews_count | toThousandslsFilter}}</span> |
| 16 | + <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></countTo> |
17 | 17 | <span class="info-item-text">浏览量</span>
|
18 | 18 | <wscn-icon-svg icon-class="b" class="dashboard-editor-icon"/>
|
19 | 19 | </div>
|
20 |
| - <router-link class="info-item" :to="'/comment/commentslist?res_author_id='+uid"> |
21 |
| - <span class="info-item-num">{{statisticsData.comment_count | toThousandslsFilter}}</span> |
| 20 | + <div class="info-item" :to="'/comment/commentslist?res_author_id='+uid"> |
| 21 | + <countTo class="info-item-num" ref='countTo3' :startVal='0' :endVal='statisticsData.comment_count' :duration='3800'></countTo> |
22 | 22 | <span class="info-item-text">评论</span>
|
23 | 23 | <wscn-icon-svg icon-class="c" class="dashboard-editor-icon"/>
|
24 |
| - </router-link> |
| 24 | + </div> |
25 | 25 | </div>
|
26 | 26 | </div>
|
27 | 27 | </div>
|
28 | 28 |
|
29 | 29 | <div class="btn-group">
|
30 |
| - <router-link class="pan-btn blue-btn" to="/article/create">发表文章</router-link> |
31 |
| - <router-link class="pan-btn light-blue-btn" to="/livenews/create">发布快讯</router-link> |
32 |
| - <router-link class="pan-btn red-btn" to="/push/create">推送</router-link> |
33 |
| - <router-link class="pan-btn pink-btn" to="/comment/commentslist">评论管理</router-link> |
34 |
| - <router-link class="pan-btn green-btn" to="/article/wscnlist">文章列表</router-link> |
35 |
| - <router-link class="pan-btn tiffany-btn" to="/livenews/list">实时列表</router-link> |
| 30 | + <router-link class="pan-btn blue-btn" to="/components/index">组价</router-link> |
| 31 | + <router-link class="pan-btn light-blue-btn" to="/charts/index">图表</router-link> |
| 32 | + <router-link class="pan-btn red-btn" to="/errorpage/404">错误页面</router-link> |
| 33 | + <router-link class="pan-btn pink-btn" to="/errlog/log">错误日志</router-link> |
| 34 | + <router-link class="pan-btn green-btn" to="/article/wscnlist">导出excel</router-link> |
| 35 | + <router-link class="pan-btn tiffany-btn" to="/excel/download">实时列表</router-link> |
36 | 36 | </div>
|
37 | 37 |
|
38 | 38 | <div class="clearfix main-dashboard-container">
|
|
47 | 47 | <template v-if="recentArticles.length!=0">
|
48 | 48 | <div class="recent-articles-item" v-for="item in recentArticles">
|
49 | 49 | <span class="recent-articles-status">{{item.status | statusFilter}}</span>
|
50 |
| - <router-link class="recent-articles-content" :to="'/article/edit/'+item.id"> |
51 |
| - <span>{{item.title}}</span> |
52 |
| - </router-link> |
53 |
| - <span class="recent-articles-time"><i style="padding-right: 4px;" class="el-icon-time"></i>{{item.display_time | parseTime('{m}-{d} {h}:{i}')}}</span> |
| 50 | + <span class="recent-articles-content" :to="'/article/edit/'+item.id"> |
| 51 | + {{item.title}} |
| 52 | + </span> |
| 53 | + <span class="recent-articles-time">{{item.author}}</span> |
54 | 54 | </div>
|
55 | 55 | </template>
|
56 | 56 | <template v-else>
|
57 | 57 | <div class="recent-articles-emptyTitle">你太懒了最近都没有撸</div>
|
58 | 58 | <!--<img class="emptyGif" :src="emptyGif">-->
|
59 | 59 | </template>
|
60 | 60 | </div>
|
61 |
| - <router-link class="recent-articles-more" :to="'/article/wscnlist?uid='+uid"> |
62 |
| - Show more |
63 |
| - </router-link> |
64 | 61 | </div>
|
65 | 62 | </div>
|
66 | 63 | </div>
|
|
71 | 68 | import PanThumb from 'components/PanThumb';
|
72 | 69 | import MonthKpi from './monthKpi';
|
73 | 70 | import ArticlesChart from './articlesChart';
|
74 |
| - // import { getStatistics } from 'api/article'; |
75 |
| -
|
| 71 | + import { getList } from 'api/article'; |
76 | 72 | import emptyGif from 'assets/compbig.gif';
|
| 73 | + import countTo from 'vue-count-to'; |
77 | 74 | export default {
|
78 | 75 | name: 'dashboard-editor',
|
79 |
| - components: { PanThumb, MonthKpi, ArticlesChart }, |
| 76 | + components: { PanThumb, MonthKpi, ArticlesChart, countTo }, |
80 | 77 | data() {
|
81 | 78 | return {
|
82 | 79 | chart: null,
|
83 | 80 | statisticsData: {
|
84 |
| - article_count: undefined, |
85 |
| - comment_count: undefined, |
| 81 | + article_count: 1024, |
| 82 | + comment_count: 102400, |
86 | 83 | latest_article: [],
|
87 |
| - month_article_count: undefined, |
88 |
| - pageviews_count: undefined, |
89 |
| - week_article: [] |
| 84 | + month_article_count: 28, |
| 85 | + pageviews_count: 1024, |
| 86 | + week_article: [ |
| 87 | + { count: 30, week: '201716' }, |
| 88 | + { count: 26, week: '201715' }, |
| 89 | + { count: 31, week: '201714' }, |
| 90 | + { count: 28, week: '201713' }, |
| 91 | + { count: 40, week: '201712' }, |
| 92 | + { count: 41, week: '201711' }, |
| 93 | + { count: 50, week: '201710' }, |
| 94 | + { count: 42, week: '201709' }, |
| 95 | + { count: 36, week: '201708' }, |
| 96 | + { count: 32, week: '201707' }, |
| 97 | + { count: 40, week: '201706' }, |
| 98 | + { count: 41, week: '201705' } |
| 99 | + ] |
90 | 100 | },
|
| 101 | + list: [], |
91 | 102 | emptyGif
|
92 | 103 | }
|
93 | 104 | },
|
|
104 | 115 | 'roles'
|
105 | 116 | ]),
|
106 | 117 | recentArticles() {
|
107 |
| - return this.statisticsData.latest_article.slice(0, 7) |
| 118 | + return this.list.slice(0, 7) |
108 | 119 | }
|
109 | 120 | },
|
110 | 121 | methods: {
|
111 | 122 | fetchData() {
|
112 |
| - // getStatistics().then(response => { |
113 |
| - // this.statisticsData = response.data; |
114 |
| - // this.statisticsData.week_article = this.statisticsData.week_article.slice().reverse(); |
115 |
| - // }) |
| 123 | + getList(this.listQuery).then(response => { |
| 124 | + console.log(response.data) |
| 125 | + this.list = response.data; |
| 126 | + }) |
116 | 127 | }
|
117 | 128 | },
|
118 | 129 | filters: {
|
|
0 commit comments