feat:增加学员端面授作业

This commit is contained in:
lixg
2023-01-05 15:55:19 +08:00
parent 0ea1a8de85
commit 421697c0ea
7 changed files with 2091 additions and 1496 deletions

View File

@@ -68,11 +68,11 @@
</div>
</div>
<div class="btnss" style="margin-top: 20px">
<div class="btn btn2">
<div class="btn btn2" @click="exportTaskStu">
<div class="img2"></div>
<div class="wz">导出数据</div>
</div>
<div class="btn btn2">
<div class="btn btn2" @click="exportHomeWork">
<div class="wz">导出作业</div>
</div>
<div class="btn btn2">
@@ -189,20 +189,20 @@ export default {
projectName: null,
projectNameList: [
{
id: 1,
value: "-1",
id: 0,
value: "0",
label: "未开始",
},
{
id: 2,
value: "0",
label: "未完成",
},
{
id: 3,
id: 1,
value: "1",
label: "已完成",
},
{
id: 2,
value: "2",
label: "未完成",
},
],
selectedRowKeys: [],
@@ -231,6 +231,15 @@ export default {
width: 50,
align: "left",
className: "h head",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.studentUserNo ? text.record.studentUserNo : "-"}
</span>
</div>
);
},
},
{
title: "姓名",
@@ -239,6 +248,15 @@ export default {
width: 50,
align: "left",
className: "h head",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.studentName ? text.record.studentName : "-"}
</span>
</div>
);
},
},
{
title: "所在部门",
@@ -247,6 +265,17 @@ export default {
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.studentDepartName
? text.record.studentDepartName
: "-"}
</span>
</div>
);
},
},
{
title: "所在岗位",
@@ -255,6 +284,17 @@ export default {
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.studentJobName
? text.record.studentJobName
: "-"}
</span>
</div>
);
},
},
{
title: "所属小组",
@@ -263,31 +303,77 @@ export default {
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.studentOrgName
? text.record.studentOrgName
: "-"}
</span>
</div>
);
},
},
{
title: "成绩",
dataIndex: "score",
key: "score",
dataIndex: "workScore",
key: "workScore",
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.workScore || text.record.workScore == 0
? text.record.workScore
: "-"}
</span>
</div>
);
},
},
{
title: "完成时间",
dataIndex: "comptime",
key: "comptime",
dataIndex: "lastStudyTime",
key: "lastStudyTime",
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.lastStudyTime ? text.record.lastStudyTime : "-"}
</span>
</div>
);
},
},
{
title: "任务状态",
dataIndex: "status",
key: "status",
dataIndex: "finishStatus",
key: "finishStatus",
width: 60,
align: "center",
className: "h",
customRender: (text) => {
return (
<div class="racona">
<span>
{text.record.finishStatus == 0
? "未开始"
: text.record.finishStatus == 1
? "已完成"
: text.record.finishStatus == 2
? "未完成"
: "-"}
</span>
</div>
);
},
},
{
title: "操作",
@@ -303,7 +389,7 @@ export default {
const ListOpera = () => {
let arr = state.tabledata;
arr.map((value) => {
if (value.status == "已完成") {
if (value.finishStatus == 1) {
value.operation = (
<div
style={{
@@ -346,7 +432,6 @@ export default {
}
});
};
ListOpera();
const closeDrawer = () => {
ctx.emit("update:Wvisible", false);
state.name = "";
@@ -366,9 +451,9 @@ export default {
state.projectName = value;
};
const onSelectChange = (selectedRowKeys) => {
if (selectedRowKeys.length > 2) {
return;
}
// if (selectedRowKeys.length > 2) {
// return;
// }
state.selectedRowKeys = selectedRowKeys;
};
@@ -396,9 +481,10 @@ export default {
currentStageId: props.projectTaskInfo.stageId,
type: 1,
pid: props.projectTaskInfo.projectId,
status: state.projectName,
status: Number(state.projectName),
studentName: state.name,
currentTaskId: props.projectTaskInfo.projectTaskId,
taskType: props.projectTaskInfo.type,
});
api
.AssessmentManagementMessage({
@@ -407,14 +493,21 @@ export default {
currentStageId: props.projectTaskInfo.stageId,
type: 1,
pid: props.projectTaskInfo.projectId,
status: state.projectName,
status: Number(state.projectName),
studentName: state.name,
currentTaskId: props.projectTaskInfo.projectTaskId,
taskType: props.projectTaskInfo.type,
})
.then((res) => {
console.log(res);
if (res.status == 200) {
state.tabledata = res.data.data.records;
if (res.data.code == 200) {
let newData = [];
for (let i = 0; i < res.data.data.records.length; i++) {
res.data.data.records[i].key = res.data.data.records[i].id;
newData.push(res.data.data.records[i]);
}
state.tabledata = newData;
ListOpera();
state.tableDataTotal = res.data.data.total;
state.tableDataTotal2 = res.data.data.total;
}
@@ -450,21 +543,43 @@ export default {
// 导出数据
function exportTaskStu() {
api
.exportTaskStudent({
pageNo: state.currentPage,
pageSize: state.pageSize,
currentStageId: props.projectTaskInfo.stageId,
currentTaskId: props.projectTaskInfo.projectTaskId,
type: 1,
pid: props.projectTaskInfo.projectId,
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
});
window.open(
`${
process.env.VUE_APP_PROXY_URL
}admin/student/exportTaskStudent?currentStageId=${
props.projectTaskInfo.stageId
}&type=${1}&pid=${props.projectTaskInfo.projectId}&taskId=${
props.projectTaskInfo.projectTaskId
}&taskType=${props.projectTaskInfo.type}`
);
// api
// .exportTaskStudent({
// pageNo: state.currentPage,
// pageSize: state.pageSize,
// currentStageId: props.projectTaskInfo.stageId,
// currentTaskId: props.projectTaskInfo.projectTaskId,
// type: 1,
// pid: props.projectTaskInfo.projectId,
// })
// .then((res) => {
// console.log(res);
// })
// .catch((err) => {
// console.log(err);
// });
}
//导出作业
function exportHomeWork() {
console.log("props.projectTaskInfo", props.projectTaskInfo);
window.open(
`${
process.env.VUE_APP_PROXY_URL
}admin/student/exportHomeWork?currentStageId=${
props.projectTaskInfo.stageId
}&type=${1}&pid=${props.projectTaskInfo.projectId}&taskId=${
props.projectTaskInfo.projectTaskId
}&taskType=${props.projectTaskInfo.type}`
);
}
return {
...toRefs(state),
@@ -481,6 +596,7 @@ export default {
resetTaskList,
changePaginationStu,
exportTaskStu,
exportHomeWork,
};
},
};