refine css
This commit is contained in:
parent
f27b16718e
commit
54884f50c1
1 changed files with 56 additions and 80 deletions
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="dashboard-editor-container">
|
<div class="dashboard-editor-container">
|
||||||
|
|
||||||
<a href="https://github.com/PanJiaChen/vue-element-admin" target="_blank" class="github-corner" aria-label="View source on Github">
|
<a href="https://github.com/PanJiaChen/vue-element-admin" target="_blank" class="github-corner" aria-label="View source on Github">
|
||||||
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4AB7BD; color:#fff; position: absolute; top: 50px; border: 0; right: 0;"
|
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4AB7BD; color:#fff; position: absolute; top: 50px; border: 0; right: 0;"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
|
@ -10,8 +11,8 @@
|
||||||
fill="currentColor" class="octo-body"></path>
|
fill="currentColor" class="octo-body"></path>
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
<div class="btn-group">
|
|
||||||
<el-row>
|
<el-row class="btn-group">
|
||||||
<el-col :span="4" class='text-center'>
|
<el-col :span="4" class='text-center'>
|
||||||
<router-link class="pan-btn blue-btn" to="/components/index">Components</router-link>
|
<router-link class="pan-btn blue-btn" to="/components/index">Components</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
<router-link class="pan-btn light-blue-btn" to="/charts/index">Charts</router-link>
|
<router-link class="pan-btn light-blue-btn" to="/charts/index">Charts</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class='text-center'>
|
<el-col :span="4" class='text-center'>
|
||||||
<router-link class="pan-btn pink-btn" to="/excel/download">Export Excel</router-link>
|
<router-link class="pan-btn pink-btn" to="/excel/download">Excel</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class='text-center'>
|
<el-col :span="4" class='text-center'>
|
||||||
<router-link class="pan-btn green-btn" to="/example/table/table">Table</router-link>
|
<router-link class="pan-btn green-btn" to="/example/table/table">Table</router-link>
|
||||||
|
@ -32,33 +33,25 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
|
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="box-card-header">
|
||||||
<pan-thumb style="float: left" :image="avatar"> 你的权限:
|
<pan-thumb class="panThumb" :image="avatar"> 你的权限:
|
||||||
<span class="pan-info-roles" v-for="item in roles">{{item}}</span>
|
<span class="pan-info-roles" v-for="item in roles">{{item}}</span>
|
||||||
</pan-thumb>
|
</pan-thumb>
|
||||||
</div>
|
</div>
|
||||||
<span class="display_name">{{name}}</span>
|
<span class="display_name">{{name}}</span>
|
||||||
<div class="info-item" :to="'/article/wscnlist?uid='+uid">
|
<div class="info-item">
|
||||||
<countTo class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></countTo>
|
<countTo class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></countTo>
|
||||||
<span class="info-item-text">文章</span>
|
<span class="info-item-text">文章</span>
|
||||||
<wscn-icon-svg icon-class="a" class="dashboard-editor-icon" />
|
<wscn-icon-svg icon-class="a" class="dashboard-editor-icon" />
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item" style="cursor: auto">
|
<div class="info-item">
|
||||||
<countTo class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></countTo>
|
<countTo class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></countTo>
|
||||||
<span class="info-item-text">浏览量</span>
|
<span class="info-item-text">浏览量</span>
|
||||||
<wscn-icon-svg icon-class="b" class="dashboard-editor-icon" />
|
<wscn-icon-svg icon-class="b" class="dashboard-editor-icon" />
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item" :to="'/comment/commentslist?res_author_id='+uid">
|
|
||||||
<countTo class="info-item-num" ref='countTo3' :startVal='0' :endVal='statisticsData.comment_count' :duration='3800'></countTo>
|
|
||||||
<span class="info-item-text">评论</span>
|
|
||||||
<wscn-icon-svg icon-class="c" class="dashboard-editor-icon" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -113,70 +106,27 @@
|
||||||
import pieChart from './pieChart';
|
import pieChart from './pieChart';
|
||||||
import barChart from './barChart';
|
import barChart from './barChart';
|
||||||
import lineChart from './lineChart';
|
import lineChart from './lineChart';
|
||||||
import { getList } from 'api/article';
|
|
||||||
import countTo from 'vue-count-to';
|
import countTo from 'vue-count-to';
|
||||||
export default {
|
export default {
|
||||||
name: 'dashboard-editor',
|
name: 'dashboard-editor',
|
||||||
components: { PanThumb, countTo, pieChart, lineChart, barChart },
|
components: { PanThumb, countTo, pieChart, lineChart, barChart },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
|
||||||
statisticsData: {
|
statisticsData: {
|
||||||
article_count: 1024,
|
article_count: 1024,
|
||||||
comment_count: 102400,
|
comment_count: 102400,
|
||||||
latest_article: [],
|
latest_article: [],
|
||||||
month_article_count: 28,
|
month_article_count: 28,
|
||||||
pageviews_count: 1024,
|
pageviews_count: 1024
|
||||||
week_article: [
|
}
|
||||||
{ count: 30, week: '201716' },
|
|
||||||
{ count: 26, week: '201715' },
|
|
||||||
{ count: 31, week: '201714' },
|
|
||||||
{ count: 28, week: '201713' },
|
|
||||||
{ count: 40, week: '201712' },
|
|
||||||
{ count: 41, week: '201711' },
|
|
||||||
{ count: 50, week: '201710' },
|
|
||||||
{ count: 42, week: '201709' },
|
|
||||||
{ count: 36, week: '201708' },
|
|
||||||
{ count: 32, week: '201707' },
|
|
||||||
{ count: 40, week: '201706' },
|
|
||||||
{ count: 41, week: '201705' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
list: []
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.fetchData();
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'name',
|
'name',
|
||||||
'avatar',
|
'avatar',
|
||||||
'email',
|
|
||||||
'uid',
|
|
||||||
'introduction',
|
|
||||||
'roles'
|
'roles'
|
||||||
]),
|
])
|
||||||
recentArticles() {
|
|
||||||
return this.list.slice(0, 7)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fetchData() {
|
|
||||||
getList(this.listQuery).then(response => {
|
|
||||||
this.list = response.data;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
filters: {
|
|
||||||
statusFilter(status) {
|
|
||||||
const statusMap = {
|
|
||||||
published: '已发布',
|
|
||||||
draft: '草稿中',
|
|
||||||
deleted: '已删除'
|
|
||||||
};
|
|
||||||
return statusMap[status];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -184,5 +134,31 @@
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
.dashboard-editor-container {
|
.dashboard-editor-container {
|
||||||
margin: 30px;
|
margin: 30px;
|
||||||
|
.btn-group {
|
||||||
|
margin-bottom: 60px;
|
||||||
|
}
|
||||||
|
.box-card-header {
|
||||||
|
position: relative;
|
||||||
|
height: 160px;
|
||||||
|
}
|
||||||
|
.panThumb {
|
||||||
|
z-index: 100;
|
||||||
|
height: 150px;
|
||||||
|
width: 150px;
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.display_name{
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
.info-item{
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: 10px;
|
||||||
|
&:last-of-type{
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue