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