feat: 关卡下学员获取,删除,进度图详情

This commit is contained in:
王熙东
2022-11-15 10:04:51 +08:00
parent d362f3db09
commit 3fa240bb5b
3 changed files with 144 additions and 179 deletions

View File

@@ -69,7 +69,7 @@
<div class="centerbox" style="color: rgba(255, 182, 78, 1)">
添加任务
</div>
<div class="centermain">快速添加任务/阶段</div>
<div class="centermain">快速添加任务/关卡</div>
</div>
<div
class="taskbox"
@@ -113,7 +113,7 @@
<!-- 概览无数据 -->
<!-- 概览有数据 -->
<div :style="{ display: nodata ? 'none' : 'block' }">
<div class="onerow"><div class="taskmain">项目概览</div></div>
<div class="onerow"><div class="taskmain">关卡概览</div></div>
<div class="second" style="margin-top: 0">
<div class="nubbox">
<span class="nub1">{{routerInfoOverview.totalStudentCnt}}</span>
@@ -149,7 +149,7 @@
<div class="nub2">总完成率</div>
</div>
</div>
<div class="onerow"><div class="taskmain">阶段信息</div></div>
<div class="onerow"><div class="taskmain">关卡信息</div></div>
<div class="stagemess">
<div v-for="item in stageList"
:class= "{ 'stage1': item.stageId == choosedStageId, 'stage2': item.stageId != choosedStageId }"
@@ -160,8 +160,8 @@
<div class="stage2">阶段2</div> -->
</div>
<div class="stagesecond">
<div class="staname">阶段名称</div>
<div class="stamess">管理者进阶-腾飞班1第一阶段</div>
<div class="staname">关卡名称</div>
<div class="stamess">管理者进阶-腾飞班1第一关卡</div>
</div>
<div class="stagelast">
<div class="stagepro">
@@ -546,6 +546,7 @@
:current="currentPage"
:total="tableDataTotal"
class="pagination"
style="display:none"
/>
</div>
</div>
@@ -847,7 +848,10 @@
<!-- 导入学员抽屉 -->
<imp-stu v-model:AddImpStuvisible="AddImpStuvisible" />
<!-- 学员管理查看抽屉 -->
<check-stu v-model:CheckStuvisible="CheckStuvisible" />
<check-stu
v-model:CheckStuvisible="CheckStuvisible"
v-model:studentId="studentId"
/>
<!-- 面授学员抽屉 -->
<face-stu v-model:FSvisible="FSvisible" />
<!-- 活动考勤抽屉 -->
@@ -871,8 +875,9 @@
</div>
</template>
<script>
import { ref, reactive, toRefs,onMounted } from "vue";
import { message } from "ant-design-vue";
import { ref, reactive, toRefs,onMounted, createVNode } from "vue";
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { message, Modal } from "ant-design-vue";
import PathAddStu from "../../components/drawers/pathStuAdd";
import ImpStu from "../../components/drawers/AddLevelImportStu";
import CheckStu from "../../components/drawers/CheckStu";
@@ -921,6 +926,7 @@ export default {
twobtnn: false,
inputbox: false,
Wvisible: false, //作业管理
studentId:null,
// 共享文档列表
docList:[
{
@@ -1012,80 +1018,7 @@ export default {
// test: 1,
// },
],
tableData: [
{
key: 1,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 2,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 3,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 4,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡1",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 5,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡1",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 6,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 7,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
{
key: 8,
name: "张三",
com: "产研部",
gang: "产品经理",
cur: "关卡2",
jin: "2/10",
time: "2022-07-15 14:00",
},
],
tableData: [],
});
const levelList = reactive({
@@ -1108,11 +1041,11 @@ export default {
stageList: [ // 阶段列表
{
stageId:1,
stage:"阶段一"
stage:"关卡一"
},
{
stageId:2,
stage:"阶段二"
stage:"关卡二"
}
]
})
@@ -1200,7 +1133,7 @@ export default {
<div class="opacation">
<span
onClick={() => {
showCheckStu();
showCheckStu(text.record.studentId);
}}
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
>
@@ -1216,7 +1149,7 @@ export default {
调整
</span>
<span style="color:#4EA6FF;cursor:pointer"
onClick={() => {myDelStudent}}
onClick={() => {delConfirm(text.record.studentId)}}
>删除</span>
</div>
</div>
@@ -1248,8 +1181,9 @@ export default {
const showImpStu = () => {
state.AddImpStuvisible = true;
};
const showCheckStu = () => {
const showCheckStu = (id) => {
state.CheckStuvisible = true;
state.studentId = id;
};
const showbtn = () => {
state.twobtn = false;
@@ -1329,32 +1263,44 @@ export default {
const getStudent = () => {
let obj = {
name: "",
pageNo: 0,
pageSize: 0,
routerId: state.routerId,
pageNo: 1,
pageSize: 10,
routerId: 100,
};
api
.getStudent(obj)
.then((res) => {
console.log("获取学员列表", res);
let data = res.data.data.rows || null;
state.tableData = []
if(data.length){
for(let i in data) {
let _time = new Date(data[i].beginStudyTime*1000);
state.tableData.push({
key:i+1,
com:data[i].userInfoBo.deptName,
name:data[i].userInfoBo.userName,
gang:data[i].userInfoBo.jobName,
cur:data[i].currentChapterName || '0',
jin:data[i].completeChapterCnt+'/'+ data[i].totalChapterCnt,
time:_time.toLocaleDateString(),
studentId:data[i].studentId,
})
// state.tableData[i].key = i+1;
// state.tableData[i].com = data[i].userInfoBo.deptName;
// state.tableData[i].name = data[i].userInfoBo.userName
// state.tableData[i].gang = data[i].userInfoBo.jobName
// state.tableData[i].cur = data[i].currentChapterName || '0'
// state.tableData[i].jin = data[i].completeChapterCnt+'/'+ data[i].totalChapterCnt
// state.tableData[i].time = _time.toLocaleDateString()
}
}
})
.catch((err) => {
console.log("获取学员列表失败", err);
});
};
const myDelStudent = () => {
let obj = {
"routerId": 0,
"studentIds": []
};
api.methods(obj).then(res => {
message.success("删除成功")
console.log(res)
}).catch(err => {
message.error("删除失败"+err)
console.log(err)
})
}
const checkType = (type) => {
let typeRules = [
"",
@@ -1436,6 +1382,25 @@ export default {
}
};
const delConfirm = (id) => {
Modal.confirm({
title: '是否确认删除',
icon: createVNode(ExclamationCircleOutlined),
content: '',
okText: '确认',
cancelText: '取消',
onOk(){
api.delStudent({routerId:100,studentIds:[id]}).then(res => {
message.success("删除成功")
console.log(res)
}).catch(err => {
message.error("删除失败"+err)
console.log(err)
})
}
});
}
return {
...toRefs(state),
...toRefs(levelList),
@@ -1465,7 +1430,7 @@ export default {
changeTabs,
checkType,
handleChange,
myDelStudent,
delConfirm,
};
},
};