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

View File

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

View File

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