mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
时长天数排行榜区分当前和累计
This commit is contained in:
@@ -117,6 +117,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="total">累计</el-dropdown-item>
|
<el-dropdown-item command="total">累计</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="now">当前</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item command="weeks">本周</el-dropdown-item>
|
<!-- <el-dropdown-item command="weeks">本周</el-dropdown-item>
|
||||||
<el-dropdown-item command="months">本月</el-dropdown-item>
|
<el-dropdown-item command="months">本月</el-dropdown-item>
|
||||||
<el-dropdown-item command="years">本年</el-dropdown-item> -->
|
<el-dropdown-item command="years">本年</el-dropdown-item> -->
|
||||||
@@ -126,10 +127,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="myselftext">
|
<div class="myselftext">
|
||||||
<div class="myranking">
|
<div class="myranking">
|
||||||
当前排名 : <span> {{learningDurationTotalData.rankNo}}</span>
|
{{isStudyTime ? '当前' : '累计'}}排名 : <span> {{learningDurationTotalData.rankNo}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="myexperience">
|
<div class="myexperience">
|
||||||
累计学习时长: <span> {{formatSecondToHour(learningDurationTotalData.rankValue)}}</span> h
|
{{isStudyTime ? '当前' : '累计'}}学习时长: <span> {{formatSecondToHour(learningDurationTotalData.rankValue)}}</span> h
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-table" style="margin-top:20px;">
|
<div class="exp-table" style="margin-top:20px;">
|
||||||
@@ -205,6 +206,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="total">累计</el-dropdown-item>
|
<el-dropdown-item command="total">累计</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="now">当前</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item command="weeks">本周</el-dropdown-item>
|
<!-- <el-dropdown-item command="weeks">本周</el-dropdown-item>
|
||||||
<el-dropdown-item command="months">本月</el-dropdown-item>
|
<el-dropdown-item command="months">本月</el-dropdown-item>
|
||||||
<el-dropdown-item command="years">本年</el-dropdown-item> -->
|
<el-dropdown-item command="years">本年</el-dropdown-item> -->
|
||||||
@@ -214,10 +216,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="myselftext">
|
<div class="myselftext">
|
||||||
<div class="myranking">
|
<div class="myranking">
|
||||||
当前排名 : <span> {{learningDaysTotalData.rankNo}}</span>
|
{{isStudyDay ? '当前' : '累计'}}排名 : <span> {{learningDaysTotalData.rankNo}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="myexperience">
|
<div class="myexperience">
|
||||||
累计学习天数 : <span>{{learningDaysTotalData.rankValue}}</span>
|
{{isStudyDay ? '当前' : '累计'}}学习天数 : <span>{{learningDaysTotalData.rankValue}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-table" style="margin-top:20px;">
|
<div class="exp-table" style="margin-top:20px;">
|
||||||
@@ -284,11 +286,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import apiUser from "@/api/system/user.js";
|
import apiUser from "@/api/system/user.js";
|
||||||
import apiStat from '@/api/phase2/stat.js';
|
import apiStat from '@/api/phase2/stat.js';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import authorImg from '@/components/Portal/authorImg.vue';
|
import authorImg from '@/components/Portal/authorImg.vue';
|
||||||
import {translate,experienceValue,formatSecondToHour,cutOrgNamePath} from "@/utils/tools.js";
|
import {translate,experienceValue,formatSecondToHour,cutOrgNamePath} from "@/utils/tools.js";
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
@@ -343,6 +345,8 @@ export default {
|
|||||||
list:[],
|
list:[],
|
||||||
},
|
},
|
||||||
isNow: false,
|
isNow: false,
|
||||||
|
isStudyTime: false,
|
||||||
|
isStudyDay: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -361,12 +365,14 @@ export default {
|
|||||||
},
|
},
|
||||||
// 学习时长(下拉框事件)
|
// 学习时长(下拉框事件)
|
||||||
durationCommand(e) {
|
durationCommand(e) {
|
||||||
|
this.isStudyTime = false
|
||||||
this.learningDuration.field = e;
|
this.learningDuration.field = e;
|
||||||
this.learningDuration.name = this.translate(e)
|
this.learningDuration.name = this.translate(e)
|
||||||
this.getDuration();
|
this.getDuration();
|
||||||
},
|
},
|
||||||
// 学习天数(下拉框事件)
|
// 学习天数(下拉框事件)
|
||||||
daysCommand(e) {
|
daysCommand(e) {
|
||||||
|
this.isStudyDay = false
|
||||||
this.learningDays.field = e;
|
this.learningDays.field = e;
|
||||||
this.learningDays.name = this.translate(e)
|
this.learningDays.name = this.translate(e)
|
||||||
this.getDays();
|
this.getDays();
|
||||||
@@ -427,6 +433,12 @@ export default {
|
|||||||
field:this.learningDuration.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
field:this.learningDuration.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
||||||
num:5,// #显示的条数
|
num:5,// #显示的条数
|
||||||
}
|
}
|
||||||
|
if(data.field == 'now'){
|
||||||
|
data.statType = 12
|
||||||
|
data.field = 'total'
|
||||||
|
this.experience.field = 'total'
|
||||||
|
this.isStudyTime = true
|
||||||
|
}
|
||||||
apiStat.getRanking(data).then(res=>{
|
apiStat.getRanking(data).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
if(res.result.currentUserRankingData) {
|
if(res.result.currentUserRankingData) {
|
||||||
@@ -470,6 +482,12 @@ export default {
|
|||||||
field:this.learningDays.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
field:this.learningDays.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
||||||
num:5,// #显示的条数
|
num:5,// #显示的条数
|
||||||
}
|
}
|
||||||
|
if(data.field == 'now'){
|
||||||
|
data.statType = 13
|
||||||
|
data.field = 'total'
|
||||||
|
this.experience.field = 'total'
|
||||||
|
this.isStudyDay = true
|
||||||
|
}
|
||||||
apiStat.getRanking(data).then(res=>{
|
apiStat.getRanking(data).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
if(res.result.currentUserRankingData) {
|
if(res.result.currentUserRankingData) {
|
||||||
@@ -523,29 +541,29 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
//只是控制布局
|
//只是控制布局
|
||||||
.page-ranking{
|
.page-ranking{
|
||||||
padding:15px 18px;
|
padding:15px 18px;
|
||||||
display:flex;
|
display:flex;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover{
|
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover{
|
||||||
background-color: #fff !important;
|
background-color: #fff !important;
|
||||||
color: #0059FF !important;
|
color: #0059FF !important;
|
||||||
}
|
}
|
||||||
::v-deep.el-dropdown-menu {
|
::v-deep.el-dropdown-menu {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
.page-ranking-col{
|
.page-ranking-col{
|
||||||
min-width: 430px;
|
min-width: 430px;
|
||||||
//padding-right:30px;
|
//padding-right:30px;
|
||||||
padding-right: 5%;
|
padding-right: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.omit{
|
.omit{
|
||||||
padding-left: 13px;
|
padding-left: 13px;
|
||||||
@@ -582,8 +600,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.myselftext{
|
.myselftext{
|
||||||
height: 75px;
|
height: 75px;
|
||||||
padding: 0 25px;
|
padding: 0 25px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -614,7 +632,7 @@ export default {
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tab-jy{
|
.tab-jy{
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|||||||
Reference in New Issue
Block a user