feat: 报表管理接口联调

This commit is contained in:
mx00085@163.com
2023-02-20 16:00:13 +08:00
parent d19aba8623
commit e0a18e1e4d
3 changed files with 159 additions and 132 deletions

View File

@@ -677,55 +677,63 @@ export default {
{
href: "/learningpathmap",
openKeys: "sub17",
// openKeyss:'sub17-2',
openKeys2: "sub17-2",
selectedKeys: "sub17-2-1",
pagename: "学习路径图",
},
{
href: "/project",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-2",
pagename: "项目",
},
{
href: "/curriculum",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-3",
pagename: "课程",
},
{
href: "/caseess",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-4",
pagename: "案例",
},
{
href: "/article",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-5",
pagename: "文章",
},
{
href: "/questionsandanswers",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-6",
pagename: "问答",
},
{
href: "/examination",
openKeys: "sub17",
openKeys2: "sub17-2",
selectedKeys: "sub17-2-7",
pagename: "考试",
},
{
href: "/overvoew",
openKeys: "sub17",
openKeys2: "sub17-3",
selectedKeys: "sub17-3-1",
pagename: "概览",
},
{
href: "/employeelearning",
openKeys: "sub17",
openKeys2: "sub17-3",
selectedKeys: "sub17-3-2",
pagename: "员工学习数据",
},
@@ -738,12 +746,13 @@ export default {
);
if (state.rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
state.openKeys = openKeys;
console.log('111',openKeys)
} else {
state.openKeys = latestOpenKey ? [latestOpenKey] : [];
console.log('222222222222222')
}
};
const selectItem = (e) => {
// console.log("onSelect", e, );
let arr = state.keysList;
arr.map((value) => {
if (e.key === value.selectedKeys) {
@@ -752,9 +761,11 @@ export default {
"selectedKeys",
JSON.stringify([value.selectedKeys])
);
state.openKeys = [value.openKeys];
// console.log('2222',[value.openKeys,value.openKeys2])
state.openKeys = [value.openKeys,value.openKeys2];
// state.openKeys=['sub17', 'sub17-2']
state.selectedKeys = [value.selectedKeys];
state.openKeys2 = [value.openKeys];
state.openKeys2 = [value.openKeys,value.openKeys2];
state.selectedKeys2 = [value.openKeys];
}
});
@@ -774,9 +785,9 @@ export default {
"selectedKeys",
JSON.stringify([value.selectedKeys])
);
state.openKeys = [value.openKeys];
state.openKeys = [value.openKeys,value.openKeys2];
state.selectedKeys = [value.selectedKeys];
state.openKeys2 = [value.openKeys];
state.openKeys2 = [value.openKeys2];
state.selectedKeys2 = [value.openKeys];
}
});

View File

@@ -145,7 +145,7 @@ export default {
token: Cookies.get("token"),
},
}).then((res) => {
downLoad(res.data, "案例.xlsx");
downLoad(res.data, "学习员工数据.xlsx");
});
}
};

View File

@@ -73,13 +73,14 @@
:scroll="{ x: 700 }"
:pagination="false"
@expand="expandTable"
childrenColumnName="children"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'courseType'">
<template v-if="column.key === 'courseType'">
<span>{{
record.courseType == "0"
? "在线"
@@ -89,56 +90,59 @@
}}</span>
</template>
<!-- 项目状态 -->
<template v-if="column.key === 'projectStatus'">
<template v-if="column.key === 'projectStatus'">
<span>{{
record.status == "0"
? "草稿"
: record.status == "1"
? "已发布"
: record.status == "-1"
? "已结束":''
: record.status == "-1"
? "已结束"
: ""
}}</span>
</template>
<!-- 学习路径图状态 -->
<template v-if="column.key === 'boeRouterStatus'">
<!-- 学习路径图状态 -->
<template v-if="column.key === 'boeRouterStatus'">
<span>{{
record.status == "0"
? "草稿"
: record.status == "1"
? "已发布"
: record.status == "-1"
? "已停用":''
: record.status == "-1"
? "已停用"
: ""
}}</span>
</template>
<!-- 授课状态 -->
<template v-if="column.key === 'teachingStatus'">
<!-- 授课状态 -->
<template v-if="column.key === 'teachingStatus'">
<span>{{
record.status == "0"
? "未开始"
: record.status == "1"
? "进行中"
: record.status == "2"
? "已完成":''
: record.status == "2"
? "已完成"
: ""
}}</span>
</template>
<!-- 课程状态 -->
<template v-if="column.key === 'classStatus'">
<!-- 课程状态 -->
<template v-if="column.key === 'classStatus'">
<span>{{
record.publishStatus == "0"
? "未发布"
: record.publishStatus == "1"
? "已发布"
: ''
: ""
}}</span>
</template>
<!-- 考试状态 -->
<template v-if="column.key === 'classStatus'">
<template v-if="column.key === 'classStatus'">
<span>{{
record.publishStatus == "0"
? "未发布"
: record.publishStatus == "1"
? "已发布"
: ''
: ""
}}</span>
</template>
@@ -335,7 +339,7 @@ export default {
// 表格数据
let tableData = ref([]);
const getTableData = async () => {
state.tableLoading=true
state.tableLoading = true;
if (state.currentTab === 4) {
//考试列表
const res = await api.boeuExamPageList({
@@ -354,7 +358,7 @@ export default {
};
});
tableData.value = list;
state.tableLoading=false
state.tableLoading = false;
}
} else if (state.currentTab === 5) {
//案例列表
@@ -374,7 +378,7 @@ export default {
};
});
tableData.value = list;
state.tableLoading=false
state.tableLoading = false;
}
} else if (state.currentTab === 3) {
const res = await api.boeuCoursePageList({
@@ -392,7 +396,7 @@ export default {
});
tableData.value = list;
state.tableDataTotal = res.data.total;
state.tableLoading=false
state.tableLoading = false;
} else if (state.currentTab === 2) {
const res = await api.boeuTeachingPageList({
page: state.pageNo,
@@ -409,7 +413,7 @@ export default {
});
tableData.value = list;
state.tableDataTotal = res.data.total;
state.tableLoading=false
state.tableLoading = false;
} else if (state.currentTab === 1) {
const res = await api.boeuRoterPageList({
page: state.pageNo,
@@ -425,25 +429,37 @@ export default {
};
});
tableData.value = list;
state.tableLoading=false
state.tableLoading = false;
state.tableDataTotal = res.data.total;
} else if (state.currentTab === 0) {
const res = await api.boeuProjectPageList({
page: state.pageNo,
size: state.pageSize,
org: state.orgId,
orgId: state.orgId,
createName: state.creator,
projectName: state.name,
});
const list = res.data.rows?.map((item) => {
return {
key: item.boeProjectInfoId,
...item,
};
});
tableData.value = list;
// const list = res.data.rows?.map((item) => {
// return {
// key: item.boeProjectInfoId,
// ...item,
// };
// });
// tableData.value = list;
const fun = (arr) => {
const list = arr.map((item) => {
return {
key: item.boeProjectInfoId,
children: fun(item.reportProjectOverview),
...item,
};
});
return list;
};
console.log(fun(res.data.rows));
tableData.value = fun(res.data.rows);
state.tableDataTotal = res.data.total;
state.tableLoading=false
state.tableLoading = false;
}
};
const searchClick = () => {
@@ -453,99 +469,99 @@ export default {
getTableData();
};
// cloumns 表头
const columns = ref( [
{
title: "名称",
dataIndex: "projectName",
key: "projectName",
width: 120,
ellipsis: true,
align: "left",
fixed: "left",
},
{
title: "归属组织",
dataIndex: "sourceBelongName",
ellipsis: true,
key: "sourceBelongName",
width: 120,
align: "center",
fixed: "left",
},
{
title: "分类",
dataIndex: "trainingType",
ellipsis: true,
key: "trainingType",
width: 120,
align: "center",
fixed: "left",
},
{
title: "阶段总数",
dataIndex: "stageTotal",
ellipsis: true,
key: "stageTotal",
width: 120,
align: "center",
},
{
title: "任务总数",
dataIndex: "taskTotal",
ellipsis: true,
key: "taskTotal",
width: 120,
align: "center",
},
{
title: "学习人数",
dataIndex: "startLearnerTotal",
ellipsis: true,
key: "startLearnerTotal",
width: 120,
align: "center",
},
{
title: "完成人数",
dataIndex: "peopleCompletedTotal",
ellipsis: true,
key: "peopleCompletedTotal",
width: 120,
align: "center",
},
{
title: "项目时间",
dataIndex: "proTime",
ellipsis: true,
key: "proTime",
width: 120,
align: "center",
},
{
title: "发布时间",
dataIndex: "publishTime",
ellipsis: true,
key: "publishTime",
width: 120,
align: "center",
},
{
title: "状态",
dataIndex: "status",
ellipsis: true,
key: "projectStatus",
width: 120,
align: "center",
},
{
title: "创建人",
dataIndex: "createName",
ellipsis: true,
key: "manager",
width: 120,
align: "center",
},
]);
const columns = ref([
{
title: "名称",
dataIndex: "projectName",
key: "projectName",
width: 120,
ellipsis: true,
align: "left",
fixed: "left",
},
{
title: "归属组织",
dataIndex: "sourceBelongName",
ellipsis: true,
key: "sourceBelongName",
width: 120,
align: "center",
fixed: "left",
},
{
title: "分类",
dataIndex: "trainingType",
ellipsis: true,
key: "trainingType",
width: 120,
align: "center",
fixed: "left",
},
{
title: "阶段总数",
dataIndex: "stageTotal",
ellipsis: true,
key: "stageTotal",
width: 120,
align: "center",
},
{
title: "任务总数",
dataIndex: "taskTotal",
ellipsis: true,
key: "taskTotal",
width: 120,
align: "center",
},
{
title: "学习人数",
dataIndex: "startLearnerTotal",
ellipsis: true,
key: "startLearnerTotal",
width: 120,
align: "center",
},
{
title: "完成人数",
dataIndex: "peopleCompletedTotal",
ellipsis: true,
key: "peopleCompletedTotal",
width: 120,
align: "center",
},
{
title: "项目时间",
dataIndex: "proTime",
ellipsis: true,
key: "proTime",
width: 120,
align: "center",
},
{
title: "发布时间",
dataIndex: "publishTime",
ellipsis: true,
key: "publishTime",
width: 120,
align: "center",
},
{
title: "状态",
dataIndex: "status",
ellipsis: true,
key: "projectStatus",
width: 120,
align: "center",
},
{
title: "创建人",
dataIndex: "createName",
ellipsis: true,
key: "manager",
width: 120,
align: "center",
},
]);
const tabData = ref([
{ text: "项目", num: "2" },
{ text: "学习路径图", num: "6" },