--fix 项目概览

This commit is contained in:
yuping
2023-01-29 00:06:19 +08:00
parent b6856d7195
commit 97ff929bff
2 changed files with 54 additions and 49 deletions

View File

@@ -49,7 +49,7 @@
<a-tab-pane key="1" tab="概览"> <a-tab-pane key="1" tab="概览">
<div class="split"></div> <div class="split"></div>
<!-- 概览无数据 --> <!-- 概览无数据 -->
<div :style="{ display: 'block' }"> <div v-if="!hasTask">
<div class="onerow"> <div class="onerow">
<div class="taskmain">快速创建路径图详情</div> <div class="taskmain">快速创建路径图详情</div>
</div> </div>
@@ -117,7 +117,7 @@
</div> </div>
</div> </div>
<!-- 概览有数据 --> <!-- 概览有数据 -->
<div :style="{ display: 'none' }"> <div v-if="hasTask">
<div class="onerow"> <div class="onerow">
<div class="taskmain">关卡概览</div> <div class="taskmain">关卡概览</div>
</div> </div>
@@ -173,13 +173,13 @@
</div> </div>
<div class="stagemess"> <div class="stagemess">
<div <div
v-for="item in stageList" v-for="(item,index) in stageList"
:class="{ :class="{
stage1: item.stageId == choosedStageId, stage1: item.stageId == choosedStageId,
stage2: item.stageId != choosedStageId, stage2: item.stageId != choosedStageId,
}" }"
:key="item.stageId" :key="item.stageId"
@click="stageChange(item.name, item.stageId)" @click="stageChange(item.name, item.stageId,index)"
> >
关卡{{ item.stageId }} 关卡{{ item.stageId }}
</div> </div>
@@ -195,7 +195,7 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="chapterOverviewList.completeCourseRatio" :percent="chapterOverviewList[choosedStageIndex]?.completeCourseRatio"
:width="140" :width="140"
/> />
<div class="protext">课程完成率</div> <div class="protext">课程完成率</div>
@@ -204,7 +204,7 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="chapterOverviewList.completeExamRatio" :percent="chapterOverviewList[choosedStageIndex]?.completeExamRatio"
:width="140" :width="140"
/> />
<div class="protext">考试通过率</div> <div class="protext">考试通过率</div>
@@ -213,39 +213,39 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="chapterOverviewList.completeRatio" :percent="chapterOverviewList[choosedStageIndex]?.completeRatio"
:width="140" :width="140"
/> />
<div class="protext">作业完成率</div> <div class="protext">作业完成率</div>
</div> </div>
<div class="proright"> <div class="proright">
<div class="pronub" style="margin-left: 280px"> <div class="pronub" style="margin-left: 280px">
{{ chapterOverviewList.totalTaskCnt }} {{ chapterOverviewList[choosedStageIndex].totalTaskCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">关卡任务总数</span> <span class="textpro">关卡任务总数</span>
<a-progress <a-progress
:percent="chapterOverviewList.totalTaskCnt" :percent="chapterOverviewList[choosedStageIndex].totalTaskCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
<div class="pronub" style="margin-left: 206px"> <div class="pronub" style="margin-left: 206px">
{{ chapterOverviewList.totalReqCnt }} {{ chapterOverviewList[choosedStageIndex].totalReqCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">必修课</span> <span class="textpro">必修课</span>
<a-progress <a-progress
:percent="chapterOverviewList.totalReqCnt" :percent="chapterOverviewList[choosedStageIndex].totalReqCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
<div class="pronub" style="margin-left: 142px"> <div class="pronub" style="margin-left: 142px">
{{ chapterOverviewList.totalOptCnt }} {{ chapterOverviewList[choosedStageIndex].totalOptCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">选修课</span> <span class="textpro">选修课</span>
<a-progress <a-progress
:percent="chapterOverviewList.totalOptCnt" :percent="chapterOverviewList[choosedStageIndex].totalOptCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
@@ -1357,6 +1357,7 @@ export default {
const router = useRouter(); const router = useRouter();
// const store = useStore(); // const store = useStore();
const state = reactive({ const state = reactive({
hasTask:false,
stage: [], stage: [],
statess: [], statess: [],
routerId: storage.get("routerId") routerId: storage.get("routerId")
@@ -1383,6 +1384,7 @@ export default {
CheckStuvisible: false, //学员管理的查看抽屉 CheckStuvisible: false, //学员管理的查看抽屉
addLoading: false, // 加载动画 addLoading: false, // 加载动画
choosedStageId: 1, // 选择的阶段id choosedStageId: 1, // 选择的阶段id
choosedStageIndex: 0, // 选择的阶段ID
selectedRowKeys: [], selectedRowKeys: [],
twobtn: true, twobtn: true,
number: true, number: true,
@@ -1802,9 +1804,10 @@ export default {
const closehuodModal = () => { const closehuodModal = () => {
state.huodModal = false; state.huodModal = false;
}; };
const stageChange = (name, id) => { const stageChange = (name, id,index) => {
state.choosedStageId = id; state.choosedStageId = id;
state.stateName = name; state.stateName = name;
state.choosedStageIndex = index;
}; };
const changeTabs = (e) => { const changeTabs = (e) => {
console.log("切换tabs", e, state.routerId); console.log("切换tabs", e, state.routerId);
@@ -2099,6 +2102,7 @@ export default {
state.picUrl = res.data.data.routerInfo.picUrl; state.picUrl = res.data.data.routerInfo.picUrl;
state.action = res.data.data.routerInfo.status; state.action = res.data.data.routerInfo.status;
state.remark = res.data.data.routerInfo.remark; state.remark = res.data.data.routerInfo.remark;
state.hasTask = !!res.data.data?.chapterList.some(({taskList})=>taskList.length);
state.act = state.act =
state.action == 0 state.action == 0
? "发布" ? "发布"

View File

@@ -191,7 +191,7 @@
<a-tab-pane key="1" tab="概览"> <a-tab-pane key="1" tab="概览">
<div class="split"></div> <div class="split"></div>
<!-- 概览(无数据) --> <!-- 概览(无数据) -->
<div> <div v-if="!hasTask">
<div class="onerow"> <div class="onerow">
<div class="taskmain">快速创建项目详情</div> <div class="taskmain">快速创建项目详情</div>
</div> </div>
@@ -266,7 +266,7 @@
</div> </div>
<!-- 概览(无数据) --> <!-- 概览(无数据) -->
<!-- 概览(有数据) --> <!-- 概览(有数据) -->
<div style="display: none"> <div v-if="hasTask">
<div class="onerow"> <div class="onerow">
<div class="taskmain">项目概览</div> <div class="taskmain">项目概览</div>
</div> </div>
@@ -326,15 +326,15 @@
</div> --> </div> -->
<div class="stagemess"> <div class="stagemess">
<div <div
v-for="item in stageList" v-for="(item,index) in stageList"
:class="{ :class="{
stage1: item.stageId == choosedStageId, stage1: index === choosedStageIndex,
stage2: item.stageId != choosedStageId, stage2: index !== choosedStageIndex,
}" }"
:key="item.stageId" :key="item.stageId"
@click="choosedStageId = item.stageId" @click="stageChange(item,index)"
> >
{{ item.stage }} {{ item.name || '无阶段' }}
</div> </div>
<!-- <div class="stage1">阶段1</div> <!-- <div class="stage1">阶段1</div>
<div class="stage2">阶段2</div> --> <div class="stage2">阶段2</div> -->
@@ -348,7 +348,7 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="stageOverviewList.completeCourseRatio" :percent="stageOverviewList[choosedStageIndex]?.completeCourseRatio"
:width="140" :width="140"
/> />
<div class="protext">课程完成率</div> <div class="protext">课程完成率</div>
@@ -357,7 +357,7 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="stageOverviewList.completeExamRatio" :percent="stageOverviewList[choosedStageIndex]?.completeExamRatio"
:width="140" :width="140"
/> />
<div class="protext">考试通过率</div> <div class="protext">考试通过率</div>
@@ -366,39 +366,39 @@
<a-progress <a-progress
type="dashboard" type="dashboard"
gapDegree="0" gapDegree="0"
:percent="stageOverviewList.completeRatio" :percent="stageOverviewList[choosedStageIndex]?.completeRatio"
:width="140" :width="140"
/> />
<div class="protext">作业完成率</div> <div class="protext">作业完成率</div>
</div> </div>
<div class="proright"> <div class="proright">
<div class="pronub" style="margin-left: 280px"> <div class="pronub" style="margin-left: 280px">
{{ stageOverviewList.totalTaskCnt }} {{ stageOverviewList[choosedStageIndex]?.totalTaskCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">阶段任务总数</span> <span class="textpro">阶段任务总数</span>
<a-progress <a-progress
:percent="stageOverviewList.totalTaskCnt" :percent="stageOverviewList[choosedStageIndex]?.totalTaskCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
<div class="pronub" style="margin-left: 206px"> <div class="pronub" style="margin-left: 206px">
{{ stageOverviewList.totalReqCnt }} {{ stageOverviewList[choosedStageIndex]?.totalReqCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">必修课</span> <span class="textpro">必修课</span>
<a-progress <a-progress
:percent="stageOverviewList.totalReqCnt" :percent="stageOverviewList[choosedStageIndex]?.totalReqCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
<div class="pronub" style="margin-left: 142px"> <div class="pronub" style="margin-left: 142px">
{{ stageOverviewList.totalOptCnt }} {{ stageOverviewList[choosedStageIndex]?.totalOptCnt }}
</div> </div>
<div class="proright1"> <div class="proright1">
<span class="textpro">选修课</span> <span class="textpro">选修课</span>
<a-progress <a-progress
:percent="stageOverviewList.totalOptCnt" :percent="stageOverviewList[choosedStageIndex]?.totalOptCnt"
style="width: 369px" style="width: 369px"
/> />
</div> </div>
@@ -1826,6 +1826,8 @@ export default {
const route = useRoute(); const route = useRoute();
const state = reactive({ const state = reactive({
editRecord: {}, editRecord: {},
choosedStageIndex:0,
hasTask:false,
tabFlag: true, tabFlag: true,
stage: [], stage: [],
stuColumns: [ stuColumns: [
@@ -2513,7 +2515,8 @@ export default {
offLineCourseCnt: 0, offLineCourseCnt: 0,
completeRatio: 0, completeRatio: 0,
}, },
stageOverviewList: { stageOverviewList: [
{
// 阶段数据概览 // 阶段数据概览
completeCourseRatio: 0, completeCourseRatio: 0,
completeExamRatio: 0, completeExamRatio: 0,
@@ -2521,17 +2524,10 @@ export default {
totalTaskCnt: 0, totalTaskCnt: 0,
totalReqCnt: 0, totalReqCnt: 0,
totalOptCnt: 0, totalOptCnt: 0,
}, }
],
stageList: [ stageList: [
// 阶段列表 // 阶段列表
{
stageId: 1,
stage: "阶段一",
},
{
stageId: 2,
stage: "阶段二",
},
], ],
}); });
// 输入接入 -- start -- // 输入接入 -- start --
@@ -2569,7 +2565,7 @@ export default {
} }
} }
} }
levelList.stageList = res.data.data.stageList
//暂时传个固定的id用 到时候看数据里面是否有在更换 //暂时传个固定的id用 到时候看数据里面是否有在更换
// state.projectTaskId = res.data.data.stageList[0].taskList[0].projectTaskId // state.projectTaskId = res.data.data.stageList[0].taskList[0].projectTaskId
let leng = res.data.data.stageList.length; let leng = res.data.data.stageList.length;
@@ -3529,7 +3525,7 @@ export default {
state.noticeFlag = info.noticeFlag; state.noticeFlag = info.noticeFlag;
state.switchopen = info.attachSwitch == 1 ? true : false; state.switchopen = info.attachSwitch == 1 ? true : false;
state.docChecked = info.attachSwitch == 1 ? true : false; state.docChecked = info.attachSwitch == 1 ? true : false;
state.hasTask = !!res.data.data?.stageList.some(({taskList})=>taskList.length);
// state.attach = info.attach; // state.attach = info.attach;
// state.templateId = info.templateId; // state.templateId = info.templateId;
state.sourceBelong = state.sourceBelong =
@@ -4172,10 +4168,15 @@ export default {
// x.send() // x.send()
// } // }
} }
function stageChange(item,index){
state.choosedStageId = item.stageId
state.choosedStageIndex = index;
}
return { return {
...toRefs(state), ...toRefs(state),
...toRefs(levelList), ...toRefs(levelList),
stageChange,
showStudent, showStudent,
settingTopFlag, settingTopFlag,
totask, totask,