|
1 | 1 | <template> |
2 | 2 | <div class="dashboard-editor-container"> |
| 3 | + |
3 | 4 | <a href="https://github.com/PanJiaChen/vue-element-admin" target="_blank" class="github-corner" aria-label="View source on Github"> |
4 | 5 | <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4AB7BD; color:#fff; position: absolute; top: 50px; border: 0; right: 0;" |
5 | 6 | aria-hidden="true"> |
|
10 | 11 | fill="currentColor" class="octo-body"></path> |
11 | 12 | </svg> |
12 | 13 | </a> |
13 | | - <div class="btn-group"> |
14 | | - <el-row> |
15 | | - <el-col :span="4" class='text-center'> |
16 | | - <router-link class="pan-btn blue-btn" to="/components/index">Components</router-link> |
17 | | - </el-col> |
18 | | - <el-col :span="4" class='text-center'> |
19 | | - <router-link class="pan-btn light-blue-btn" to="/charts/index">Charts</router-link> |
20 | | - </el-col> |
21 | | - <el-col :span="4" class='text-center'> |
22 | | - <router-link class="pan-btn pink-btn" to="/excel/download">Export Excel</router-link> |
23 | | - </el-col> |
24 | | - <el-col :span="4" class='text-center'> |
25 | | - <router-link class="pan-btn green-btn" to="/example/table/table">Table</router-link> |
26 | | - </el-col> |
27 | | - <el-col :span="4" class='text-center'> |
28 | | - <router-link class="pan-btn tiffany-btn" to="/example/form/edit">Form</router-link> |
29 | | - </el-col> |
30 | | - <el-col :span="4" class='text-center'> |
31 | | - <router-link class="pan-btn yellow-btn" to="/example/form/edit">Theme</router-link> |
32 | | - </el-col> |
33 | | - </el-row> |
34 | 14 |
|
35 | | - </div> |
| 15 | + <el-row class="btn-group"> |
| 16 | + <el-col :span="4" class='text-center'> |
| 17 | + <router-link class="pan-btn blue-btn" to="/components/index">Components</router-link> |
| 18 | + </el-col> |
| 19 | + <el-col :span="4" class='text-center'> |
| 20 | + <router-link class="pan-btn light-blue-btn" to="/charts/index">Charts</router-link> |
| 21 | + </el-col> |
| 22 | + <el-col :span="4" class='text-center'> |
| 23 | + <router-link class="pan-btn pink-btn" to="/excel/download">Excel</router-link> |
| 24 | + </el-col> |
| 25 | + <el-col :span="4" class='text-center'> |
| 26 | + <router-link class="pan-btn green-btn" to="/example/table/table">Table</router-link> |
| 27 | + </el-col> |
| 28 | + <el-col :span="4" class='text-center'> |
| 29 | + <router-link class="pan-btn tiffany-btn" to="/example/form/edit">Form</router-link> |
| 30 | + </el-col> |
| 31 | + <el-col :span="4" class='text-center'> |
| 32 | + <router-link class="pan-btn yellow-btn" to="/example/form/edit">Theme</router-link> |
| 33 | + </el-col> |
| 34 | + </el-row> |
| 35 | + |
36 | 36 | <el-row> |
37 | 37 | <el-col :span="6"> |
38 | | - |
39 | 38 | <el-card class="box-card"> |
40 | | - <div slot="header" class="clearfix"> |
41 | | - <pan-thumb style="float: left" :image="avatar"> 你的权限: |
| 39 | + <div slot="header" class="box-card-header"> |
| 40 | + <pan-thumb class="panThumb" :image="avatar"> 你的权限: |
42 | 41 | <span class="pan-info-roles" v-for="item in roles">{{item}}</span> |
43 | 42 | </pan-thumb> |
44 | 43 | </div> |
45 | 44 | <span class="display_name">{{name}}</span> |
46 | | - <div class="info-item" :to="'/article/wscnlist?uid='+uid"> |
| 45 | + <div class="info-item"> |
47 | 46 | <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></countTo> |
48 | 47 | <span class="info-item-text">文章</span> |
49 | 48 | <wscn-icon-svg icon-class="a" class="dashboard-editor-icon" /> |
50 | 49 | </div> |
51 | | - <div class="info-item" style="cursor: auto"> |
| 50 | + <div class="info-item"> |
52 | 51 | <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></countTo> |
53 | 52 | <span class="info-item-text">浏览量</span> |
54 | 53 | <wscn-icon-svg icon-class="b" class="dashboard-editor-icon" /> |
55 | 54 | </div> |
56 | | - <div class="info-item" :to="'/comment/commentslist?res_author_id='+uid"> |
57 | | - <countTo class="info-item-num" ref='countTo3' :startVal='0' :endVal='statisticsData.comment_count' :duration='3800'></countTo> |
58 | | - <span class="info-item-text">评论</span> |
59 | | - <wscn-icon-svg icon-class="c" class="dashboard-editor-icon" /> |
60 | | - </div> |
61 | | - |
62 | 55 | </el-card> |
63 | 56 |
|
64 | 57 | </el-col> |
|
113 | 106 | import pieChart from './pieChart'; |
114 | 107 | import barChart from './barChart'; |
115 | 108 | import lineChart from './lineChart'; |
116 | | - import { getList } from 'api/article'; |
117 | 109 | import countTo from 'vue-count-to'; |
118 | 110 | export default { |
119 | 111 | name: 'dashboard-editor', |
120 | 112 | components: { PanThumb, countTo, pieChart, lineChart, barChart }, |
121 | 113 | data() { |
122 | 114 | return { |
123 | | - chart: null, |
124 | 115 | statisticsData: { |
125 | 116 | article_count: 1024, |
126 | 117 | comment_count: 102400, |
127 | 118 | latest_article: [], |
128 | 119 | month_article_count: 28, |
129 | | - pageviews_count: 1024, |
130 | | - week_article: [ |
131 | | - { count: 30, week: '201716' }, |
132 | | - { count: 26, week: '201715' }, |
133 | | - { count: 31, week: '201714' }, |
134 | | - { count: 28, week: '201713' }, |
135 | | - { count: 40, week: '201712' }, |
136 | | - { count: 41, week: '201711' }, |
137 | | - { count: 50, week: '201710' }, |
138 | | - { count: 42, week: '201709' }, |
139 | | - { count: 36, week: '201708' }, |
140 | | - { count: 32, week: '201707' }, |
141 | | - { count: 40, week: '201706' }, |
142 | | - { count: 41, week: '201705' } |
143 | | - ] |
144 | | - }, |
145 | | - list: [] |
| 120 | + pageviews_count: 1024 |
| 121 | + } |
146 | 122 | } |
147 | 123 | }, |
148 | | - created() { |
149 | | - this.fetchData(); |
150 | | - }, |
151 | 124 | computed: { |
152 | 125 | ...mapGetters([ |
153 | 126 | 'name', |
154 | 127 | 'avatar', |
155 | | - 'email', |
156 | | - 'uid', |
157 | | - 'introduction', |
158 | 128 | 'roles' |
159 | | - ]), |
160 | | - recentArticles() { |
161 | | - return this.list.slice(0, 7) |
162 | | - } |
163 | | - }, |
164 | | - methods: { |
165 | | - fetchData() { |
166 | | - getList(this.listQuery).then(response => { |
167 | | - this.list = response.data; |
168 | | - }) |
169 | | - } |
170 | | - }, |
171 | | - filters: { |
172 | | - statusFilter(status) { |
173 | | - const statusMap = { |
174 | | - published: '已发布', |
175 | | - draft: '草稿中', |
176 | | - deleted: '已删除' |
177 | | - }; |
178 | | - return statusMap[status]; |
179 | | - } |
| 129 | + ]) |
180 | 130 | } |
181 | 131 | } |
182 | 132 | </script> |
183 | 133 |
|
184 | 134 | <style rel="stylesheet/scss" lang="scss" scoped> |
185 | | -.dashboard-editor-container{ |
| 135 | +.dashboard-editor-container { |
186 | 136 | margin: 30px; |
| 137 | + .btn-group { |
| 138 | + margin-bottom: 60px; |
| 139 | + } |
| 140 | + .box-card-header { |
| 141 | + position: relative; |
| 142 | + height: 160px; |
| 143 | + } |
| 144 | + .panThumb { |
| 145 | + z-index: 100; |
| 146 | + height: 150px; |
| 147 | + width: 150px; |
| 148 | + position: absolute; |
| 149 | + left: 0px; |
| 150 | + right: 0px; |
| 151 | + margin: auto; |
| 152 | + } |
| 153 | + .display_name{ |
| 154 | + font-size: 30px; |
| 155 | + } |
| 156 | + .info-item{ |
| 157 | + display: inline-block; |
| 158 | + margin-top: 10px; |
| 159 | + &:last-of-type{ |
| 160 | + margin-left: 15px; |
| 161 | + } |
| 162 | + } |
187 | 163 | } |
188 | 164 | </style> |
0 commit comments