|
@@ -82,7 +82,7 @@ store.currentLocation = "项目管理 / 关联分析";
|
|
|
let rootOrgId = $ref(undefined as unknown as number);
|
|
|
|
|
|
let projectIds: number[] = $ref([]); //$ref([4, 5]);
|
|
|
-let contrastProjectId: number = $ref(); //$ref(4);
|
|
|
+let contrastProjectId = $ref(undefined as unknown as number); //$ref(4);
|
|
|
|
|
|
let data = $shallowRef<SASPaper[]>([]);
|
|
|
let pageSize = $ref(1000);
|
|
@@ -116,7 +116,10 @@ async function fetchData() {
|
|
|
pageNo,
|
|
|
});
|
|
|
// console.log(res);
|
|
|
- data = res.data.content.map((v) => {
|
|
|
+ let resData = filterData(res.data.content, projectIds.length + 1);
|
|
|
+ console.log(resData);
|
|
|
+
|
|
|
+ data = resData.map((v) => {
|
|
|
v.avgScore = Math.round(v.avgScore * 100) / 100;
|
|
|
v.stdev = Math.round(v.stdev * 100) / 100;
|
|
|
v.coefficient = Math.round(v.coefficient * 100) / 100;
|
|
@@ -130,6 +133,28 @@ async function fetchData() {
|
|
|
totalElements = res.data.totalElements;
|
|
|
}
|
|
|
|
|
|
+function filterData(data: SASPaper[], groupCount: number) {
|
|
|
+ let curCourseId: number | null = null;
|
|
|
+ let curCourseList: SASPaper[] = [];
|
|
|
+ let nData = [];
|
|
|
+
|
|
|
+ data.forEach((item) => {
|
|
|
+ if (item.courseId !== curCourseId) {
|
|
|
+ curCourseId = item.courseId;
|
|
|
+ if (curCourseList.length > 1 && curCourseList.length <= groupCount) {
|
|
|
+ nData.push(...curCourseList);
|
|
|
+ }
|
|
|
+ curCourseList = [];
|
|
|
+ }
|
|
|
+ curCourseList.push(item);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (curCourseList.length > 1 && curCourseList.length < groupCount) {
|
|
|
+ nData.push(...curCourseList);
|
|
|
+ }
|
|
|
+ return nData;
|
|
|
+}
|
|
|
+
|
|
|
function cellRender(prop: keyof SASPaper) {
|
|
|
return ({ record, index }: { record: SASPaper; index: number }) => {
|
|
|
let getClass = "";
|
|
@@ -261,7 +286,10 @@ const columns = [
|
|
|
children: h(
|
|
|
Button,
|
|
|
{
|
|
|
- onClick: () => rowSpan > 1 && goCompareDetail(record.courseCode),
|
|
|
+ onClick: () => {
|
|
|
+ if (rowSpan > 1)
|
|
|
+ goCompareDetail(record.courseCode).catch(() => false);
|
|
|
+ },
|
|
|
},
|
|
|
() => "查看详情"
|
|
|
),
|