feat:增加查看作业

This commit is contained in:
lixg
2023-01-30 16:48:10 +08:00
parent 8d85ff297e
commit 86060275ac
7 changed files with 276 additions and 122 deletions

View File

@@ -1,3 +1,11 @@
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-12-13 09:24:38
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-01-30 10:50:28
* @FilePath: /fe-manage/src/api/indexAudit.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import http from "./config";
//获取待审核面授课列表
@@ -29,4 +37,7 @@ export const auditList = (obj) => http.post('/admin/project/auditList', obj)
export const auditView = (obj) => http.post('/admin/project/auditView', obj)
//面授课审核
export const courseAuditView = (obj) => http.post('/admin/offcourse/auditView', obj)
export const courseAuditView = (obj) => http.post('/admin/offcourse/auditView', obj)
//项目修改记录
export const editRecord = (chooseProject) => http.get(`/modifyRecord/page?id=${chooseProject}&type=1&size=2`)

View File

@@ -1,3 +1,11 @@
/*
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-17 21:25:14
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-01-30 11:32:33
* @FilePath: /fe-manage/src/api/indexWork.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import http from "./config";
// 创建作业信息接口
export const createWorkTask = (obj) =>
@@ -13,3 +21,5 @@ export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById
// 修改作业信息接口
export const updateWorkTaskUsing = (obj) =>
http.post("/work/updateWorkTask", obj);
//查看作业
export const getWorkSubmitInfo = (workId, stuId) => http.get(`/admin/student/getWorkSubmitInfo?id=${workId}&stuId=${stuId}`)

View File

@@ -25,13 +25,83 @@
<span>作业要求</span
><span style="color: #999ba3">{{ workRequirement }}</span>
</div>
<div class="HW Need">
<span>作业内容</span
><span style="color: #999ba3">{{
workSubmitContent ? workSubmitContent : "-"
}}</span>
</div>
<div class="HWText">
<span>作业信息</span>
<div class="hwText">
<img src="@/assets/images/projectadd/keep.png" />
<div class="hwName">{{ "京东方商业模型.jpeg" }}</div>
<div class="op"><span>查看</span></div>
<div class="op"><span>下载</span></div>
<span>作业附件</span>
<div class="hwText" v-if="workUploadAddress">
<div class="file_img">
<img
v-if="
workUploadAddress?.indexOf('jpg') !== -1 ||
workUploadAddress?.indexOf('jpeg') !== -1 ||
workUploadAddress?.indexOf('png') !== -1
"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/pngpic.png"
/>
<div v-else>
<img
v-if="workUploadAddress?.indexOf('doc') !== -1"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/docpic.png"
/>
<div v-else>
<img
v-if="workUploadAddress?.indexOf('xls') !== -1"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/xlspic.png"
/>
<div v-else>
<img
v-if="workUploadAddress?.indexOf('ppt') !== -1"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/pptpic.png"
/>
<div v-else>
<img
v-if="workUploadAddress?.indexOf('pdf') !== -1"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/pdfpic.png"
/>
<div v-else>
<img
v-if="workUploadAddress?.indexOf('zip') !== -1"
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/zippic.png"
/>
<img
v-else
style="width: 22px; height: 26px"
src="@/assets/images/coursewareManage/docpic.png"
/>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="hwName">
{{ workUploadAddressName }}
</div>
<div
class="op"
v-if="
workUploadAddress?.indexOf('jpg') !== -1 ||
workUploadAddress?.indexOf('jpeg') !== -1 ||
workUploadAddress?.indexOf('png') !== -1
"
@click="checkImg"
>
<span>查看</span>
</div>
<div class="op" v-else>
<a :href="workUploadAddress">下载</a>
</div>
</div>
</div>
</div>
@@ -40,12 +110,38 @@
<button class="btn2">确定</button>
</div>
</div>
<!-- 查看弹窗 -->
<a-modal
v-model:visible="checkImgModalV"
:title="null"
:footer="null"
:closable="false"
wrapClassName="checkImgModal"
width="100%"
height="100%"
>
<div class="modalClose" @click="closeCheckImg">
<img
style="width: 33px; height: 33px"
src="../../assets/images/basicinfo/close22.png"
/>
</div>
<div class="modalMain">
<img style="width: 500px; height: 660px" :src="workUploadAddress" />
</div>
<!-- 加载动画 -->
<div class="aeLoading" :style="{ display: pubLoading ? 'flex' : 'none' }">
<a-spin :spinning="pubLoading" />
</div>
</a-modal>
<!-- 查看弹窗 -->
</a-drawer>
</template>
<script>
import { toRefs, reactive } from "@vue/reactivity";
import { queryWorkDetailById } from "@/api/indexWork";
import { getWorkSubmitInfo } from "@/api/indexWork";
export default {
name: "CheckWork",
props: {
@@ -57,11 +153,21 @@ export default {
type: Number,
default: null,
},
stuId: {
type: String,
default: null,
},
},
setup(props, ctx) {
const state = reactive({
workName: null,
workRequirement: null,
workSubmitContent: null,
workUploadAddressName: null,
workUploadAddress: null,
checkImgModalV: false,
pubLoading: true,
});
const closeDrawer = () => {
ctx.emit("update:CWvisible", false);
@@ -77,24 +183,41 @@ export default {
};
//获取作业详情
const getWorkDetail = () => {
queryWorkDetailById({ workId: props.workId })
console.log("props.workId, props.stuId", props.workId, props.stuId);
getWorkSubmitInfo(props.workId, props.stuId)
.then((res) => {
console.log("获取作业详情", res);
console.log("获取作业", res);
if (res.data.code === 200) {
state.workName = res.data.data.workName;
state.workRequirement = res.data.data.workRequirement;
state.workSubmitContent = res.data.data.workSubmitContent;
state.workUploadAddressName = res.data.data.workUploadAddress;
state.workUploadAddress =
process.env.VUE_APP_FILE_PATH + res.data.data.workUploadAddress;
state.pubLoading = false;
console.log("workUploadAddress", state.workUploadAddress);
}
})
.catch((err) => {
console.log("获取作业详情失败", err);
console.log("获取作业失败", err);
});
// http://43.143.139.204/upload/文件名
};
//显示查看作业图片弹窗
const checkImg = () => {
state.checkImgModalV = true;
};
const closeCheckImg = () => {
state.checkImgModalV = false;
};
return {
...toRefs(state),
closeDrawer,
afterVisibleChange,
getWorkDetail,
checkImg,
closeCheckImg,
};
},
};
@@ -185,4 +308,42 @@ export default {
}
}
}
.checkImgModal {
.ant-modal {
top: 0;
display: flex;
align-items: center;
justify-content: center;
.ant-modal-content {
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0);
}
.ant-modal-body {
padding: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.modalClose {
position: absolute;
right: 35px;
top: 46px;
width: 78px;
height: 78px;
background: #ffffff;
box-shadow: 0px 2px 4px 0px #878787;
border-radius: 8px;
border: 1px solid #ffffff;
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
}
.modalMain {
}
}
}
}
</style>

View File

@@ -144,6 +144,8 @@
:loading="tableDataTotal === -1 ? true : false"
:scroll="{ x: 900 }"
:pagination="false"
childrenColumnName="childrens"
rowKey="id"
>
<template #expandedRowRender="{ record }">
<div class="reworkTitle">
@@ -152,18 +154,18 @@
<div style="width: 40%; text-align: center">修改后</div>
</div>
<div
v-for="(elem, index) in record.data"
v-for="(elem, index) in record.children"
:key="index"
class="reworkCon"
>
<div style="width: 20%; text-align: center">
{{ elem.content }}
{{ elem.columnName }}
</div>
<div style="width: 40%; text-align: center">
{{ elem.before }}
{{ elem.beforeValue }}
</div>
<div style="width: 40%; text-align: center">
{{ elem.after }}
{{ elem.afterValue }}
</div>
</div>
</template>
@@ -218,7 +220,7 @@
</div>
<div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="closeDrawer">确定</button>
<button class="btn2" @click="subMit">确定</button>
</div>
</div>
</a-drawer>
@@ -228,7 +230,7 @@
import { toRefs, reactive, onMounted } from "vue";
import { getTask } from "../../api/indexTaskadd";
import { toDate } from "../../api/method";
import { auditView } from "../../api/indexAudit";
import { auditView, editRecord } from "../../api/indexAudit";
import { message } from "ant-design-vue";
import * as api1 from "@/api/index1";
import ProjectLevel from "@/components/project/ProjectLevel";
@@ -305,91 +307,25 @@ export default {
tableDataTotal: 20,
pageSize: 10,
currentPage: 1,
tableData: [
{
key: 1,
people: "张三",
time: "2023-01-13",
data: [
{
content: "项目归属",
before: "产品部",
after: "研发部",
},
{
content: "项目时间",
before: "2022-10-31 23:002022-11-10 23:00",
after: "2022-11-11 23:002022-11-30 23:00",
},
],
},
{
key: 2,
people: "张三",
time: "2023-01-13",
data: [
{
content: "项目归属",
before: "产品部",
after: "研发部",
},
{
content: "项目时间",
before: "2022-10-31 23:002022-11-10 23:00",
after: "2022-11-11 23:002022-11-30 23:00",
},
],
},
],
tableData: [],
columns: [
{
title: "修改人",
dataIndex: "people",
key: "people",
dataIndex: "updateName",
key: "updateName",
align: "center",
className: "h",
width: "40%",
},
{
title: "修改时间",
dataIndex: "time",
key: "time",
dataIndex: "updateTime",
key: "updateTime",
align: "center",
className: "h",
width: "40%",
},
],
tableData2: [
{
key: 1,
people: "张三",
time: "2023-01-13",
},
],
columns2: [
{
title: "内容",
dataIndex: "people",
key: "people",
align: "center",
className: "h",
},
{
title: "修改前",
dataIndex: "time",
key: "time",
align: "center",
className: "h",
},
{
title: "修改后",
dataIndex: "time",
key: "time",
align: "center",
className: "h",
},
],
});
const closeDrawer = () => {
@@ -467,6 +403,7 @@ export default {
const afterVisibleChange = () => {
getTaskInfo();
getrecord();
};
const changeDe = () => {
state.showDetail = !state.showDetail;
@@ -517,6 +454,21 @@ export default {
value: e.dictCode,
})); //场景
});
//获取项目修改记录
const getrecord = () => {
editRecord(props.chooseProject)
.then((res) => {
console.log("获取修改记录", res);
if (res.data.code === 200) {
state.tableData = res.data.data.records;
// console.log("state.tableData", state.tableData);
}
})
.catch((err) => {
console.log("获取修改记录失败", err);
});
};
return {
...toRefs(state),
closeDrawer,

View File

@@ -138,7 +138,11 @@
v-model:searchTaskList="searchTaskList"
/>
<!-- 查看作业抽屉 -->
<CKWork v-model:CWvisible="CWvisible" :workId="projectTaskInfo?.courseId" />
<CKWork
v-model:CWvisible="CWvisible"
:workId="projectTaskInfo?.courseId"
:stuId="stuId"
/>
<!-- 查看答卷抽屉 -->
<CQue v-model:CQvisible="CQvisible" />
@@ -406,6 +410,8 @@ export default {
],
exportHomeWorkV: false,
downloadUrl: null,
stuId: null,
});
//面授直播管理列表操作
const ListOpera = () => {
@@ -423,8 +429,9 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;"
style="cursor:pointer;margin-right:10px;color: rgba(56, 125, 247, 1)"
onClick={() => {
state.stuId = value.studentId;
state.CWvisible = true;
}}
>
@@ -441,7 +448,11 @@ export default {
justifyContent: "center",
}}
>
<a-button class="operation" style="margin-right:10px;" disabled>
<a-button
class="operation"
style="margin-right:10px;color:rgba(56, 125, 247, 0.5)"
disabled
>
查看
</a-button>
</div>

View File

@@ -80,7 +80,7 @@
<div class="wz">导出作业</div>
</div>
</div>
<!-- <div class="line">
<!-- <div class="line">
<div class="inline">
<div class="left">
<div class="img"></div>
@@ -122,7 +122,7 @@
</div>
</div>
</div>
<!-- <div class="btnn">
<!-- <div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="closeDrawer">确定</button>
</div>-->
@@ -219,8 +219,8 @@ export default {
//{
// id: 2,
// value: "2",
// label: "进行中",
// },
// label: "进行中",
// },
],
selectedRowKeys: [],
@@ -317,7 +317,7 @@ export default {
);
},
},
/** {
/** {
title: "学员关卡",
dataIndex: "chapterName",
key: "chapterName",
@@ -334,7 +334,7 @@ export default {
</div>
);
},
},*/
},*/
{
title: "作业成绩",
dataIndex: "workScore",
@@ -384,7 +384,8 @@ export default {
align: "center",
ellipsis: true,
className: "h",
customRender: ({record:{assessmentScore}}) => (assessmentScore ? Math.round(assessmentScore * 100) / 100 : "-"),
customRender: ({ record: { assessmentScore } }) =>
assessmentScore ? Math.round(assessmentScore * 100) / 100 : "-",
},
{
title: "任务状态",
@@ -411,15 +412,15 @@ export default {
);
},
},
// {
// title: "操作",
// dataIndex: "operation",
// key: "operation",
// width: 100,
// align: "center",
// ellipsis: true,
// className: "h",
// },
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: 100,
align: "center",
ellipsis: true,
className: "h",
},
],
exportHomeWorkV: false,
downloadUrl: null,
@@ -440,7 +441,7 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;"
style="cursor:pointer;margin-right:10px;color: rgba(56, 125, 247, 1)"
onClick={() => {
state.CWvisible = true;
}}
@@ -450,7 +451,7 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;"
style="cursor:pointer;margin-right:10px;color: rgba(56, 125, 247, 1)"
onClick={() => {
state.CQvisible = true;
}}
@@ -471,7 +472,7 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;"
style="margin-right:10px;color:rgba(56, 125, 247, 0.5)"
disabled
>
查看作业
@@ -479,7 +480,7 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;"
style="margin-right:10px;color:rgba(56, 125, 247, 0.5)"
disabled
>
查看答卷
@@ -575,7 +576,7 @@ export default {
function resetTaskList() {
state.currentPage = 1;
state.name = "";
state.projectName =undefined;
state.projectName = undefined;
state.tableDataTotal = -1;
state.tableDataTotal2 = 0;
getStudent();
@@ -592,10 +593,7 @@ export default {
function exportTaskStu() {
console.log("props.datasource", props.datasource);
window.open(
`${
process.env.VUE_APP_BASE_API}/admin/student/exportTaskStudent?currentStageId=${
props.datasource.chapterId
}&type=3&pid=${props.datasource.courseId}&thirdType=5&taskId=${props.datasource.routerTaskId}`
`${process.env.VUE_APP_BASE_API}/admin/student/exportTaskStudent?currentStageId=${props.datasource.chapterId}&type=3&pid=${props.datasource.courseId}&thirdType=5&taskId=${props.datasource.routerTaskId}`
);
// api
// .exportTaskStudent({
@@ -630,8 +628,8 @@ export default {
.then((res) => {
console.log("导出作业", res.data.data);
if (res.data.code === 200) {
// message.destroy();
// message.success("导出作业成功");
// message.destroy();
// message.success("导出作业成功");
state.exportHomeWorkV = true;
state.downloadUrl = res.data.data;
}
@@ -648,7 +646,8 @@ export default {
console.log("props.datasource", props.datasource);
window.open(
`${
process.env.VUE_APP_BASE_API}/admin/student/exportHomeWork?currentStageId=${
process.env.VUE_APP_BASE_API
}/admin/student/exportHomeWork?currentStageId=${
props.datasource.chapterId
}&type=${2}&pid=${props.datasource.routerId}&taskId=${
props.datasource.routerTaskId

View File

@@ -133,7 +133,11 @@
v-model:searchTaskList="searchTaskList"
/>
<!-- 查看作业抽屉 -->
<CKWork v-model:CWvisible="CWvisible" :workId="datasource?.courseId" />
<CKWork
v-model:CWvisible="CWvisible"
:workId="datasource?.courseId"
v-model:stuId="stuId"
/>
<!-- 查看答卷抽屉 -->
<CQue v-model:CQvisible="CQvisible" />
@@ -400,6 +404,8 @@ export default {
],
exportHomeWorkV: false,
downloadUrl: null,
stuId: null,
});
//面授直播管理列表操作
const ListOpera = () => {
@@ -417,8 +423,9 @@ export default {
<a-button
type="link"
class="operation"
style="cursor:pointer;margin-right:10px;color: #387DF7;"
style="cursor:pointer;margin-right:10px;color: rgba(56, 125, 247, 1);"
onClick={() => {
state.stuId = value.studentId;
state.CWvisible = true;
}}
>
@@ -435,7 +442,10 @@ export default {
justifyContent: "center",
}}
>
<a-button class="operation" style="margin-right:10px;">
<a-button
class="operation"
style="margin-right:10px;color:rgba(56, 125, 247, 0.5)"
>
查看
</a-button>
</div>