考试报表

This commit is contained in:
weixiaobo@boe.com.cn
2023-08-21 18:38:19 +08:00
parent d0256f0ae3
commit 7b5ca6dc8e

View File

@@ -12,24 +12,25 @@
allowClear
></a-select> -->
<a-cascader
change-on-select
:options="option"
placeholder="请选择组织"
v-model:value="orgId"
:allowClear="allowClear"
style="width: 100%"
placeholder="请选择归属组织"
:allowClear="allowClear"
:fieldNames="{
label: 'name',
value: 'id',
children: 'treeChildList',
label: 'orgName',
value: 'organizationId',
children: 'childList',
}"
>
>
</a-cascader>
</div>
<div class="select">
<a-input
style="width: 100%; height: 40px; border-radius: 8px"
placeholder="请输入姓名"
v-model:value="name"
placeholder="请输入考试名称"
v-model:value="testName"
allowClear
showSearch
>
@@ -38,22 +39,21 @@
<div class="select">
<a-input
style="width: 100%; height: 40px; border-radius: 8px"
placeholder="请输入工号"
v-model:value="userNo"
placeholder="请输入创建人"
v-model:value="creator"
allowClear
showSearch
>
</a-input>
</div>
<div class="select">
<a-input
style="width: 100%; height: 40px; border-radius: 8px"
placeholder="请输入Band"
v-model:value="band"
allowClear
showSearch
>
</a-input>
<a-range-picker
v-model:value="publishTime"
type="date"
valueFormat="YYYY-MM-DD"
:placeholder="['发布开始时间','结束时间']"
style="width: 100%; margin-right: 0px"
/>
</div>
<div style="display: flex; margin-bottom: 20px">
<div class="btnzx btnzx1" @click="getTableData">
@@ -94,6 +94,38 @@
onChange: onSelectChange,
}"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'published'">
<span>{{
record.published == 0
? "未发布"
: record.published == 1
? "已发布"
: ""
}}</span>
</template>
<template v-if="column.key === 'pertainCourse'">
<span>{{
record.pertainCourse == null
? "-"
: record.pertainCourse
}}</span>
</template>
<template v-if="column.key === 'pertainProject'">
<span>{{
record.pertainProject == null
? "-"
: record.pertainProject
}}</span>
</template>
<template v-if="column.key === 'pertainRouter'">
<span>{{
record.pertainRouter == null
? "-"
: record.pertainRouter
}}</span>
</template>
</template>
</a-table>
<div class="tableBox">
<div class="pa">
@@ -136,7 +168,10 @@ export default {
selectedRowKeys: [], // 选中的列
ids: [],
allowClear:true,
resetOrgId:[]
resetOrgId:[],
creator: "",
testName: "",
publishTime: [],
});
// table选中
const onSelectChange = (selectedRowKeys, record) => {
@@ -149,9 +184,9 @@ export default {
const getOrgList = async () => {
const res = await api.userGetUserOrg({});
if (res) {
state.option = res.data?.result?.list;
state.orgId = res.data?.result?.treeNodeList;
state.resetOrgId = res.data?.result?.treeNodeList;
state.option = res.data?.result;
state.orgId = [state.option[0]?.organizationId];
state.resetOrgId = [state.option[0]?.organizationId];
res.data?.result?.userType === 1
? (state.allowClear = true)
: (state.allowClear = false);
@@ -181,98 +216,162 @@ export default {
// cloumns 表头
const columns = ref([
{
title: "工号",
dataIndex: "userNo",
key: "userNo",
title: "考试名称",
dataIndex: "testName",
key: "testName",
width: 120,
ellipsis: true,
align: "center",
},
{
title: "姓名",
dataIndex: "name",
title: "归属组织",
dataIndex: "resOwner",
ellipsis: true,
key: "name",
key: "resOwner",
width: 120,
align: "center",
},
{
title: "组织信息",
dataIndex: "departmentName",
title: "归属课程",
dataIndex: "pertainCourse",
ellipsis: true,
key: "departmentName",
key: "pertainCourse",
width: 120,
align: "center",
},
{
title: "岗位",
dataIndex: "jobName",
title: "归属项目",
dataIndex: "pertainProject",
ellipsis: true,
key: "jobName",
key: "pertainProject",
align: "center",
width: 120,
},
{
title: "归属路径",
dataIndex: "pertainRouter",
ellipsis: true,
key: "pertainRouter",
align: "center",
width: 120,
},
{
title: "题量",
dataIndex: "numOfQuest",
ellipsis: true,
key: "numOfQuest",
width: 120,
align: "center",
},
{
title: "Band",
dataIndex: "bandCode",
title: "考试人数",
dataIndex: "totalNumber",
ellipsis: true,
key: "bandCode",
key: "totalNumber",
width: 120,
align: "center",
},
{
title: "授课次数",
dataIndex: "teachingTotal",
title: "参加人数",
dataIndex: "numOfAnswer",
ellipsis: true,
key: "teachingTotal",
key: "numOfAnswer",
width: 120,
align: "center",
},
{
title: "授课时长(分钟)",
dataIndex: "teachingTime",
title: "参加率",
dataIndex: "answerRate",
ellipsis: true,
key: "teachingTime",
key: "answerRate",
width: 120,
align: "center",
},
{
title: "案例数",
dataIndex: "caseTotal",
title: "考试次数",
dataIndex: "testTimes",
ellipsis: true,
key: "caseTotal",
key: "testTimes",
width: 120,
align: "center",
},
{
title: "学习项目",
dataIndex: "studyProject",
title: "考试时长",
dataIndex: "testDuration",
ellipsis: true,
key: "studyProject",
key: "testDuration",
width: 120,
align: "center",
},
{
title: "学习路径",
dataIndex: "studyRouter",
title: "考试满分",
dataIndex: "totalScore",
ellipsis: true,
key: "studyRouter",
key: "totalScore",
width: 120,
align: "center",
},
{
title: "学习课程",
dataIndex: "studyClass",
title: "考试合格分",
dataIndex: "passLine",
ellipsis: true,
key: "studyClass",
key: "passLine",
width: 120,
align: "center",
},
{
title: "累计学习时长(分钟)",
dataIndex: "studyTimeSum",
title: "平均答题时长",
dataIndex: "averageAnswerTime",
ellipsis: true,
key: "studyTimeSum",
key: "averageAnswerTime",
width: 120,
align: "center",
},
{
title: "平均得分",
dataIndex: "averageScore",
ellipsis: true,
key: "averageScore",
width: 120,
align: "center",
},
{
title: "通过人数",
dataIndex: "numOfPass",
ellipsis: true,
key: "numOfPass",
width: 120,
align: "center",
},
{
title: "通过率",
dataIndex: "passRate",
ellipsis: true,
key: "passRate",
width: 120,
align: "center",
},
{
title: "发布时间",
dataIndex: "publishTime",
ellipsis: true,
key: "publishTime",
width: 120,
align: "center",
},
{
title: "考试状态",
dataIndex: "published",
ellipsis: true,
key: "published",
width: 120,
align: "center",
},
{
title: "创建人",
dataIndex: "creator",
ellipsis: true,
key: "creator",
width: 120,
align: "center",
},
@@ -319,17 +418,21 @@ export default {
// 获取数据
const getTableData = async () => {
state.tableLoading = true;
const res = await api.boeuStudyDataPageList({
const res = await api.boeuExamPageListV2({
page: state.pageNo,
size: state.pageSize,
userNo: state.userNo,
name: state.name,
// userNo: state.userNo,
testName: state.testName,
creator: state.creator,
startTime: state.publishTime[0],
endTime: state.publishTime[1],
// name: state.name,
departmentId: state.orgId ? state.orgId[state.orgId.length - 1] : null,
bandCode: state.band,
// bandCode: state.band,
});
if (res) {
state.tableDataTotal = res.data.total;
const list = res.data.rows?.map((item) => {
state.tableDataTotal = res.data.result.total;
const list = res.data.result.rows?.map((item) => {
return {
key: item.id,
...item,
@@ -342,9 +445,12 @@ export default {
// 重置按钮
const reset = async () => {
state.tableLoading = true;
state.name = "";
state.band = "";
state.userNo = "";
// state.name = "";
// state.band = "";
// state.userNo = "";
state.testName = "";
state.creator = "";
state.publishTime = [];
state.orgId = state.resetOrgId;
getTableData();
};
@@ -355,10 +461,14 @@ export default {
method: "post",
url: "/report/boeu/studyData/exportAll",
data: {
userNo: state.userNo,
name: state.name,
// userNo: state.userNo,
// name: state.name,
testName: state.testName,
creator: state.creator,
startTime: state.publishTime[0],
endTime: state.publishTime[1],
departmentId: state.orgId ? state.orgId[state.orgId.length - 1] : null,
bandCode: state.band,
// bandCode: state.band,
},
responseType: "blob",
headers: {