mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-09 19:06:48 +08:00
fix -- bug
This commit is contained in:
@@ -77,13 +77,13 @@ export default createStore({
|
||||
},
|
||||
actions: {
|
||||
getProjectInfo(content, {projectId}) {
|
||||
content.state.projectInfo.projectId || request(PROJECT_PROCESS, {projectId}).then(res => {
|
||||
request(PROJECT_PROCESS, {projectId}).then(res => {
|
||||
content.commit('SET_PROJECT_INFO', res.data)
|
||||
content.commit('INIT_PROJECT_INFO')
|
||||
})
|
||||
},
|
||||
getRouterInfo(content, {routerId}) {
|
||||
content.state.routerInfo.routerId || request(ROUTER_PROCESS, {routerId}).then(res => {
|
||||
request(ROUTER_PROCESS, {routerId}).then(res => {
|
||||
content.commit('SET_ROUTER_INFO', res.data)
|
||||
content.commit('INIT_ROUTER_INFO')
|
||||
})
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
<div>总进度</div>
|
||||
<div class="progress">
|
||||
<div style="width: 291px">
|
||||
<el-progress :percentage="parseInt((data.totalProgress ? data.totalProgress : 0) * 100)"
|
||||
<el-progress :percentage="parseInt((data.totalProgress || 0) * 100)"
|
||||
:show-text="false" :stroke-width="8" :color="
|
||||
{
|
||||
0: 'rgba(238, 112, 108, 1)',
|
||||
@@ -179,11 +179,11 @@
|
||||
3: 'rgba(59, 94, 251, 1)',
|
||||
4: 'rgba(57, 219, 183, 1)',
|
||||
5: 'rgba(57, 219, 183, 1)',
|
||||
}[parseInt(((data.totalProgress ? data.totalProgress : 0) * 100) / 20)]
|
||||
}[parseInt(((data.totalProgress || 0) * 100) / 20)]
|
||||
" />
|
||||
</div>
|
||||
<div style="font-size: 14px; font-weight: 500; margin-left: 10px;color:#677d86;">
|
||||
{{ parseInt(data.totalProgress ? data.totalProgress > 1 ? 1 : data.totalProgress : 0 * 100) }}%
|
||||
{{ parseInt((data.totalProgress || 0) * 100) }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
<div>必修进度</div>
|
||||
<div class="progress">
|
||||
<div style="width: 291px">
|
||||
<el-progress :percentage="parseInt((data.compulsoryProgress ? data.compulsoryProgress : 0) * 100)"
|
||||
<el-progress :percentage="parseInt((data.compulsoryProgress || 0) * 100)"
|
||||
:show-text="false" :stroke-width="8" :color="
|
||||
{
|
||||
0: 'rgba(238, 112, 108, 1)',
|
||||
@@ -202,7 +202,7 @@
|
||||
3: 'rgba(59, 94, 251, 1)',
|
||||
4: 'rgba(57, 219, 183, 1)',
|
||||
5: 'rgba(57, 219, 183, 1)',
|
||||
}[parseInt(((data.compulsoryProgress ? data.compulsoryProgress : 0) * 100) / 20)]
|
||||
}[parseInt(((data.compulsoryProgress || 0) * 100) / 20)]
|
||||
" />
|
||||
</div>
|
||||
<div style="
|
||||
@@ -210,9 +210,7 @@
|
||||
font-weight: 500;
|
||||
color: #277aff;
|
||||
margin-left: 10px;color:#677d86;">
|
||||
{{
|
||||
parseInt(((data.compulsoryProgress ? data.compulsoryProgress : 0) > 1 ? 1 : (data.compulsoryProgress ? data.compulsoryProgress : 0))
|
||||
* 100) }}%
|
||||
{{parseInt(((data.compulsoryProgress || 0) * 100)) }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -366,6 +364,7 @@ const { commit, dispatch, state } = useStore()
|
||||
const store = useStore()
|
||||
const userInfo = computed(() => state.userInfo)
|
||||
const data = computed(() => state.projectInfo)
|
||||
|
||||
onMounted(() => {
|
||||
dispatch('getProjectInfo', { projectId })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user