fix:学习路径/项目-总进度、必修进度数值显示及调整,超出问题

This commit is contained in:
wuyx
2023-02-23 11:25:19 +08:00
parent 629b04d89e
commit 2167b33c2f
2 changed files with 253 additions and 304 deletions

View File

@@ -26,11 +26,9 @@
</div> </div>
</div> </div>
<div v-if="i.id == '0' && i.taskProcessList?.length == 0"></div> <div v-if="i.id == '0' && i.taskProcessList?.length == 0"></div>
<div v-else class="course" <div v-else class="course" v-for="(value, index) in (i.taskProcessList.sort((a, b) => { return a.id - b.id; })).filter(
v-for="(value, index) in (i.taskProcessList.sort((a,b)=>{ return a.id - b.id; })).filter(
(e) => !whiteTypes(e.type) (e) => !whiteTypes(e.type)
)" )" :key="index">
:key="index">
<div style="width: 70%"> <div style="width: 70%">
<div v-if="value.name.length > 50" class="coursename" :title="value.name"> <div v-if="value.name.length > 50" class="coursename" :title="value.name">
<el-popover ref="popover" placement="right" trigger="hover" :width="300" :content="value.name"> <el-popover ref="popover" placement="right" trigger="hover" :width="300" :content="value.name">
@@ -62,11 +60,7 @@
<div>当前进度</div> <div>当前进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress <el-progress :percentage="parseInt(value.currentRatio)" :show-text="false" :stroke-width="8" :color="
:percentage="parseInt(value.currentRatio)"
:show-text="false"
:stroke-width="8"
:color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -119,10 +113,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="共享文档" name="second"> <el-tab-pane label="共享文档" name="second">
<div style="padding: 19px 30px 17px 28px"> <div style="padding: 19px 30px 17px 28px">
<div <div v-for="(value, index) in JSON.parse(data.attach ? data.attach : '[]')" :key="index" style="
v-for="(value, index) in JSON.parse(data.attach?data.attach:'[]')"
:key="index"
style="
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 15px;"> margin-bottom: 15px;">
@@ -132,10 +123,7 @@
:style="{ width: '22px', height: '26px' }"></FileTypeImg> :style="{ width: '22px', height: '26px' }"></FileTypeImg>
<div class="sharedocname">{{ value.name }}</div> <div class="sharedocname">{{ value.name }}</div>
<div class="download"> <div class="download">
<img <img src="../../assets/image/download.png" style="width: 16px; height: 15px" />
src="../../assets/image/download.png"
style="width: 16px; height: 15px"
/>
<div style="margin-left: 7px" @click="downloadFile(value.response.data)">下载</div> <div style="margin-left: 7px" @click="downloadFile(value.response.data)">下载</div>
</div> </div>
</div> </div>
@@ -182,8 +170,8 @@
<div>总进度</div> <div>总进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress :percentage="parseInt(data.totalProgress * 100)" :show-text="false" :stroke-width="8" <el-progress :percentage="parseInt((data.totalProgress ? data.totalProgress : 0) * 100)"
:color=" :show-text="false" :stroke-width="8" :color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -191,11 +179,11 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.totalProgress * 100) / 20)] }[parseInt(((data.totalProgress ? data.totalProgress : 0) * 100) / 20)]
" /> " />
</div> </div>
<div style="font-size: 14px; font-weight: 500; margin-left: 10px;color:#677d86;"> <div style="font-size: 14px; font-weight: 500; margin-left: 10px;color:#677d86;">
{{ parseInt(data.totalProgress * 100) }}% {{ parseInt(data.totalProgress ? data.totalProgress > 1 ? 1 : data.totalProgress : 0 * 100) }}%
</div> </div>
</div> </div>
</div> </div>
@@ -205,8 +193,8 @@
<div>必修进度</div> <div>必修进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress :percentage="parseInt(data.compulsoryProgress * 100)" :show-text="false" <el-progress :percentage="parseInt((data.compulsoryProgress ? data.compulsoryProgress : 0) * 100)"
:stroke-width="8" :color=" :show-text="false" :stroke-width="8" :color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -214,7 +202,7 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.compulsoryProgress * 100) / 20)] }[parseInt(((data.compulsoryProgress ? data.compulsoryProgress : 0) * 100) / 20)]
" /> " />
</div> </div>
<div style=" <div style="
@@ -222,7 +210,9 @@
font-weight: 500; font-weight: 500;
color: #277aff; color: #277aff;
margin-left: 10px;color:#677d86;"> margin-left: 10px;color:#677d86;">
{{ parseInt(data.compulsoryProgress * 100) }}% {{
parseInt(((data.compulsoryProgress ? data.compulsoryProgress : 0) > 1 ? 1 : (data.compulsoryProgress ? data.compulsoryProgress : 0))
* 100) }}%
</div> </div>
</div> </div>
</div> </div>
@@ -235,34 +225,21 @@
<div class="info"> <div class="info">
<div <div
style="display:flex;justify-content: space-between;align-items: center;height: 56px;padding-left: 27px;padding-right: 27px;"> style="display:flex;justify-content: space-between;align-items: center;height: 56px;padding-left: 27px;padding-right: 27px;">
<div <div @click="tabChange(1)"
@click="tabChange(1)" style="font-size: 14px;color: rgba(51, 51, 51, 1);font-weight: 600;cursor: pointer;" :style="{}">积分排行榜
style="font-size: 14px;color: rgba(51, 51, 51, 1);font-weight: 600;cursor: pointer;"
:style="{}"
>积分排行榜
</div> </div>
<!-- <div style="font-size: 14px;color: rgba(51, 51, 51, 1);font-weight: 600;">完成度排行榜</div> --> <!-- <div style="font-size: 14px;color: rgba(51, 51, 51, 1);font-weight: 600;">完成度排行榜</div> -->
<el-select <el-select @change="choiceStatus" v-model="stateValue" class="m-2" mode="tags" placeholder="完成度排行榜"
@change="choiceStatus"
v-model="stateValue"
class="m-2"
mode="tags"
placeholder="完成度排行榜"
style="width: 130px;border: 0px solid red !important; box-shadow:none !important; "> style="width: 130px;border: 0px solid red !important; box-shadow:none !important; ">
<el-option <el-option v-for="item in studyProgress" :key="item.value" :label="item.label" :value="item.value" />
v-for="item in studyProgress"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</div> </div>
<!-- line --> <!-- line -->
<div style="display: flex;height: 1px;background-color: #ecf5ff;justify-content: space-between;"> <div style="display: flex;height: 1px;background-color: #ecf5ff;justify-content: space-between;">
<div v-if="tabValue == 1" style="width:90px;height: 2px;background-color: #409EFF;margin-left: 18px;"></div> <div v-if="tabValue == 1" style="width:90px;height: 2px;background-color: #409EFF;margin-left: 18px;"></div>
<div v-else style="width:90px;height: 2px;background-color: rgba(0,0,0,0);margin-left: 18px;"></div> <div v-else style="width:90px;height: 2px;background-color: rgba(0,0,0,0);margin-left: 18px;"></div>
<div v-if="tabValue!==1" <div v-if="tabValue !== 1" style="width:146px;height: 2px;background-color: #409EFF;margin-right: 18px;">
style="width:146px;height: 2px;background-color: #409EFF;margin-right: 18px;"></div> </div>
<div v-else style="width:146px;height: 2px;background-color: rgba(0,0,0,0);margin-right: 18px;"></div> <div v-else style="width:146px;height: 2px;background-color: rgba(0,0,0,0);margin-right: 18px;"></div>
</div> </div>
<!-- line --> <!-- line -->
@@ -292,39 +269,20 @@
</div> </div>
<!-- 学员列表 --> <!-- 学员列表 -->
<div> <div>
<div <div v-for="(item, i) in tableRankData" :key="i"
v-for="(item,i) in tableRankData" :key="i"
style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;"> style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;">
<div <div
style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;position: relative;"> style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;position: relative;">
{{ i + 1 == 1 || i + 1 == 2 || i + 1 == 3 ? '' : i + 1 }} {{ i + 1 == 1 || i + 1 == 2 || i + 1 == 3 ? '' : i + 1 }}
<img <img v-if="i + 1 == 1" style="width: 24px; height: 24px;" src="../../assets/image/rank1.png" />
v-if="i + 1 == 1" <img v-if="i + 1 == 2" style="width: 24px; height: 24px;" src="../../assets/image/rank2.png" />
style="width: 24px; height: 24px;" <img v-if="i + 1 == 3" style="width: 24px; height: 24px;" src="../../assets/image/rank3.png" />
src="../../assets/image/rank1.png" <img v-if="i + 1 == myIndex" style="width: 24px; height: 24px;position: absolute;left:110px;"
/> src="../../assets/image/rankme.png" />
<img
v-if="i + 1 == 2"
style="width: 24px; height: 24px;"
src="../../assets/image/rank2.png"
/>
<img
v-if="i + 1 == 3"
style="width: 24px; height: 24px;"
src="../../assets/image/rank3.png"
/>
<img
v-if="i + 1 == myIndex"
style="width: 24px; height: 24px;position: absolute;left:110px;"
src="../../assets/image/rankme.png"
/>
</div> </div>
<div <div
style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:34%;display: flex;justify-content: center;align-items: center;"> style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:34%;display: flex;justify-content: center;align-items: center;">
<img <img style="width: 28px; height: 28px;border-radius: 28px;" :src="item?.avatar" />
style="width: 28px; height: 28px;border-radius: 28px;"
:src="item?.avatar"
/>
{{ item.name }} {{ item.name }}
</div> </div>
<div <div
@@ -334,8 +292,7 @@
</div> </div>
<!-- 我的排名 --> <!-- 我的排名 -->
<div <div v-if="myIndex > tableRankData.length"
v-if="myIndex > tableRankData.length"
style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;"> style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;">
<div <div
style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;"> style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;">
@@ -351,23 +308,17 @@
</div> </div>
</div> </div>
<div <div v-if="myIndex > tableRankData.length"
v-if="myIndex > tableRankData.length"
style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;"> style="display: flex;justify-content: center;align-items: center;width: 100%;position: relative;top:-60px;margin-bottom: 38px;">
<div <div
style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;"> style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:30%;display: flex;justify-content: center;align-items: center;">
{{ myIndex }} {{ myIndex }}
<img <img style="width: 24px; height: 24px;position: absolute;left:110px;"
style="width: 24px; height: 24px;position: absolute;left:110px;" src="../../assets/image/rankme.png" />
src="../../assets/image/rankme.png"
/>
</div> </div>
<div <div
style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:34%;display: flex;justify-content: center;align-items: center;"> style="font-size: 14px;color:rgba(36, 120, 255, 1);font-weight: 600;width:34%;display: flex;justify-content: center;align-items: center;">
<img <img style="width: 28px; height: 28px;border-radius: 28px;" :src="tableRankData[myIndex - 1]?.avatar" />
style="width: 28px; height: 28px;border-radius: 28px;"
:src="tableRankData[myIndex-1]?.avatar"
/>
{{ tableRankData[myIndex - 1]?.name }} {{ tableRankData[myIndex - 1]?.name }}
</div> </div>
<div <div

View File

@@ -7,8 +7,7 @@
<div class="pdname"> <div class="pdname">
{{ data.name }} {{ data.name }}
<el-popover v-if="data.chapterRemark" ref="popover" popper-class="jianjie" placement="right" trigger="hover" <el-popover v-if="data.chapterRemark" ref="popover" popper-class="jianjie" placement="right" trigger="hover"
:width="300" :width="300" :content="data.chapterRemark">
:content="data.chapterRemark">
<template #reference><span style="font-size: 16px;font-weight: 600;">关卡说明></span></template> <template #reference><span style="font-size: 16px;font-weight: 600;">关卡说明></span></template>
</el-popover> </el-popover>
</div> </div>
@@ -27,8 +26,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="course" v-for="(value, index) in data.taskBoList?.filter((e) => !whiteTypes(e.type))" <div class="course" v-for="(value, index) in data.taskBoList?.filter((e) => !whiteTypes(e.type))" :key="index">
:key="index">
<div style="width: 70%"> <div style="width: 70%">
<div v-if="value.name.length > 50" class="coursename" :title="value.name"> <div v-if="value.name.length > 50" class="coursename" :title="value.name">
<el-popover ref="popover" placement="right" trigger="hover" :width="300" :content="value.name"> <el-popover ref="popover" placement="right" trigger="hover" :width="300" :content="value.name">
@@ -63,8 +61,7 @@
<div>当前进度</div> <div>当前进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress :percentage="parseInt(value.currentRatio)" :show-text="false" :stroke-width="8" <el-progress :percentage="parseInt(value.currentRatio)" :show-text="false" :stroke-width="8" :color="
:color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -125,10 +122,7 @@
<el-tab-pane label="共享文档" name="second" v-if="data.attachSwitch == '1'"> <el-tab-pane label="共享文档" name="second" v-if="data.attachSwitch == '1'">
<div style="padding: 19px 30px 17px 28px"> <div style="padding: 19px 30px 17px 28px">
<div <div v-for="(value, index) in JSON.parse(data.attach ? data.attach : '[]')" :key="index" style="
v-for="(value, index) in JSON.parse(data.attach?data.attach:'[]')"
:key="index"
style="
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 15px;"> margin-bottom: 15px;">
@@ -138,10 +132,7 @@
:style="{ width: '22px', height: '26px' }"></FileTypeImg> :style="{ width: '22px', height: '26px' }"></FileTypeImg>
<div class="sharedocname">{{ value.name }}</div> <div class="sharedocname">{{ value.name }}</div>
<div class="download"> <div class="download">
<img <img src="../../assets/image/download.png" style="width: 16px; height: 15px" />
src="../../assets/image/download.png"
style="width: 16px; height: 15px"
/>
<div style="margin-left: 7px" @click="downloadFile(value.response.data)">下载</div> <div style="margin-left: 7px" @click="downloadFile(value.response.data)">下载</div>
</div> </div>
</div> </div>
@@ -192,7 +183,8 @@
<div>总进度</div> <div>总进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress :percentage="parseInt(data.currentChapterCnt / data.totalChapterCnt * 100)" <el-progress
:percentage="parseInt((data.currentChapterCnt ? data.currentChapterCnt : 0 / data.totalChapterCnt ? data.totalChapterCn : 0) * 100)"
:show-text="false" :stroke-width="8" :color=" :show-text="false" :stroke-width="8" :color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
@@ -201,7 +193,7 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[(parseInt(data.currentChapterCnt / data.totalChapterCnt) * 100) / 20] }[(parseInt(data.currentChapterCnt ? data.currentChapterCnt : 0 / data.totalChapterCnt ? data.totalChapterCnt : 0) * 100) / 20]
" /> " />
</div> </div>
<div style="font-size: 14px; font-weight: 500; margin-left: 10px" :style="{ <div style="font-size: 14px; font-weight: 500; margin-left: 10px" :style="{
@@ -212,9 +204,12 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.currentChapterCnt / data.totalChapterCnt * 100) / 20)], }[parseInt(((data.currentChapterCnt ? data.currentChapterCnt : 0 / data.totalChapterCnt ? data.totalChapterCnt : 0) * 100) / 20)],
}"> }">
{{ parseInt(data.currentChapterCnt / data.totalChapterCnt * 100) }}% {{ parseInt((data.currentChapterCnt ? data.currentChapterCnt : 0 /
data.totalChapterCnt ? data.totalChapterCnt : 0) > 1 ? 1 : (data.currentChapterCnt ?
data.currentChapterCnt : 0 /
data.totalChapterCnt ? data.totalChapterCnt : 0) * 100) }}%
</div> </div>
</div> </div>
</div> </div>
@@ -224,8 +219,9 @@
<div>必修进度</div> <div>必修进度</div>
<div class="progress"> <div class="progress">
<div style="width: 291px"> <div style="width: 291px">
<el-progress :percentage="parseInt(data.currentReqCnt / data.totalReqCnt * 100)" :show-text="false" <el-progress
:stroke-width="8" :color=" :percentage="parseInt((data.currentReqCnt ? data.currentReqCnt : 0 / data.totalReqCnt ? data.totalReqCnt : 0) * 100)"
:show-text="false" :stroke-width="8" :color="
{ {
0: 'rgba(238, 112, 108, 1)', 0: 'rgba(238, 112, 108, 1)',
1: 'rgba(255, 151, 38, 1)', 1: 'rgba(255, 151, 38, 1)',
@@ -233,7 +229,7 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.currentReqCnt / data.totalReqCnt * 100) / 20)] }[parseInt(((data.currentReqCnt ? data.currentReqCnt : 0 / data.totalReqCnt ? data.totalReqCnt : 0) * 100) / 20)]
" /> " />
</div> </div>
<div style=" <div style="
@@ -249,9 +245,11 @@
3: 'rgba(59, 94, 251, 1)', 3: 'rgba(59, 94, 251, 1)',
4: 'rgba(57, 219, 183, 1)', 4: 'rgba(57, 219, 183, 1)',
5: 'rgba(57, 219, 183, 1)', 5: 'rgba(57, 219, 183, 1)',
}[parseInt((data.currentReqCnt / data.totalReqCnt * 100) / 20)], }[parseInt(((data.currentReqCnt ? data.currentReqCnt : 0 / data.totalReqCnt ? data.totalReqCnt : 0) * 100) / 20)],
}"> }">
{{ parseInt(data.currentReqCnt?data.currentReqCnt:0 / data.totalReqCnt?data.totalReqCnt:0 * 100) }}% {{ parseInt((data.currentReqCnt ? data.currentReqCnt : 0 / data.totalReqCnt ? data.totalReqCnt :
0) > 1 ? 1 : (data.currentReqCnt ? data.currentReqCnt : 0 / data.totalReqCnt ? data.totalReqCnt : 0) *
100) }}%
</div> </div>
</div> </div>
</div> </div>