|
@@ -22,8 +22,10 @@
|
|
<div class="tw-bg-white tw-p-5 tw-rounded-xl">
|
|
<div class="tw-bg-white tw-p-5 tw-rounded-xl">
|
|
<a-table
|
|
<a-table
|
|
rowKey="id"
|
|
rowKey="id"
|
|
|
|
+ :customRow="customRow"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data-source="data"
|
|
:data-source="data"
|
|
|
|
+ :scroll="{ x: 1200, y: 800 }"
|
|
:pagination="{
|
|
:pagination="{
|
|
pageSize: pageSize,
|
|
pageSize: pageSize,
|
|
current: pageNo,
|
|
current: pageNo,
|
|
@@ -38,7 +40,7 @@
|
|
<template #courseName="{ record }">
|
|
<template #courseName="{ record }">
|
|
<a>{{ record.courseName }}({{ record.courseCode }})</a>
|
|
<a>{{ record.courseName }}({{ record.courseCode }})</a>
|
|
</template>
|
|
</template>
|
|
- <template #action="{ record }">
|
|
|
|
|
|
+ <!-- <template #action="{ record }">
|
|
<span>
|
|
<span>
|
|
<a-button
|
|
<a-button
|
|
v-if="record.projectId !== contrastProjectId"
|
|
v-if="record.projectId !== contrastProjectId"
|
|
@@ -46,7 +48,7 @@
|
|
>查看详情</a-button
|
|
>查看详情</a-button
|
|
>
|
|
>
|
|
</span>
|
|
</span>
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
</a-table>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -56,9 +58,9 @@
|
|
import { getProjectCompareList } from "@/api/projectCompareManagementPage";
|
|
import { getProjectCompareList } from "@/api/projectCompareManagementPage";
|
|
import router from "@/router";
|
|
import router from "@/router";
|
|
import { useMainStore } from "@/store";
|
|
import { useMainStore } from "@/store";
|
|
-import { SASPaper } from "@/types";
|
|
|
|
-import { message } from "ant-design-vue";
|
|
|
|
-import { watch, onMounted, toRaw } from "vue";
|
|
|
|
|
|
+import type { SASPaper } from "@/types";
|
|
|
|
+import { message, Button } from "ant-design-vue";
|
|
|
|
+import { watch, onMounted, toRaw, h } from "vue";
|
|
|
|
|
|
const store = useMainStore();
|
|
const store = useMainStore();
|
|
store.currentLocation = "项目管理 / 关联分析";
|
|
store.currentLocation = "项目管理 / 关联分析";
|
|
@@ -115,6 +117,7 @@ const columns = [
|
|
title: "科目",
|
|
title: "科目",
|
|
dataIndex: "courseName",
|
|
dataIndex: "courseName",
|
|
slots: { customRender: "courseName" },
|
|
slots: { customRender: "courseName" },
|
|
|
|
+ fixed: "left",
|
|
width: 140,
|
|
width: 140,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -169,30 +172,48 @@ const columns = [
|
|
{
|
|
{
|
|
title: "操作",
|
|
title: "操作",
|
|
key: "action",
|
|
key: "action",
|
|
- slots: { customRender: "action" },
|
|
|
|
|
|
+ fixed: "right",
|
|
|
|
+ width: "140px",
|
|
|
|
+ // dataIndex: "courseName",
|
|
|
|
+ // slots: { customRender: "action" },
|
|
// slots: {
|
|
// slots: {
|
|
- // customRender: ({ text, index }) => {
|
|
|
|
- // console.log(text, index);
|
|
|
|
- // const obj = {
|
|
|
|
- // children: text,
|
|
|
|
- // props: {} as any,
|
|
|
|
- // };
|
|
|
|
- // if (index === 2) {
|
|
|
|
- // obj.props.rowSpan = 2;
|
|
|
|
- // }
|
|
|
|
- // // These two are merged into above cell
|
|
|
|
- // if (index === 3) {
|
|
|
|
- // obj.props.rowSpan = 0;
|
|
|
|
- // }
|
|
|
|
- // if (index === 4) {
|
|
|
|
- // obj.props.colSpan = 0;
|
|
|
|
- // }
|
|
|
|
- // return obj;
|
|
|
|
- // },
|
|
|
|
|
|
+ customRender: ({ record, index }: { record: SASPaper; index: number }) => {
|
|
|
|
+ // console.log(text, index);
|
|
|
|
+ // These two are merged into above cell
|
|
|
|
+ let rowSpan = 1;
|
|
|
|
+ if (index % projectIds.length === 0) {
|
|
|
|
+ rowSpan = projectIds.length;
|
|
|
|
+ } else {
|
|
|
|
+ rowSpan = 0;
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ children: h(
|
|
|
|
+ Button,
|
|
|
|
+ {
|
|
|
|
+ onClick: () => goCompareDetail(record.courseCode),
|
|
|
|
+ },
|
|
|
|
+ () => "查看详情"
|
|
|
|
+ ),
|
|
|
|
+ props: {
|
|
|
|
+ rowSpan,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ },
|
|
// },
|
|
// },
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+function customRow(record: SASPaper, index: number) {
|
|
|
|
+ // console.log(args);
|
|
|
|
+ let backgroundColor = "white";
|
|
|
|
+ if (index % projectIds.length === 0) {
|
|
|
|
+ backgroundColor = "lightgrey";
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ style: { backgroundColor },
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
rootOrgId = store.userInfo.rootOrgId;
|
|
rootOrgId = store.userInfo.rootOrgId;
|
|
});
|
|
});
|