增加新的列

This commit is contained in:
zhx 2026-05-23 21:27:23 +08:00
parent 8677241ae8
commit 2ff4c11f0a

View File

@ -17,6 +17,7 @@ import {
} from 'antdv-next';
import UserProfileLink from './components/user-profile-link.vue';
import { CP_RELATION_TYPE_OPTIONS } from './constants';
defineOptions({ name: 'OperateCpApply' });
@ -33,6 +34,10 @@ const statusFilterOptions = STATUS_OPTIONS.map(({ label, value }) => ({
value,
}));
const cpRelationTypeLabelMap = new Map(
CP_RELATION_TYPE_OPTIONS.map((item) => [item.value, item.name]),
);
const loading = ref(false);
const total = ref(0);
const list = ref<Array<Record<string, any>>>([]);
@ -64,6 +69,7 @@ const columns: any[] = [
title: '金额',
width: 120,
},
{ dataIndex: 'relationType', key: 'relationType', title: '关系类型', width: 120 },
{ dataIndex: 'status', key: 'status', title: '状态', width: 120 },
{ dataIndex: 'time', key: 'time', title: '时间', width: 220 },
];
@ -77,6 +83,11 @@ function getStatusMeta(status?: string) {
);
}
function getCpRelationTypeName(relationType?: string) {
const value = relationType || 'CP';
return cpRelationTypeLabelMap.get(value) || value || '-';
}
async function loadData(reset = false) {
if (reset) {
query.cursor = 1;
@ -137,7 +148,7 @@ void loadData(true);
:loading="loading"
:pagination="false"
row-key="id"
:scroll="{ x: 1060 }"
:scroll="{ x: 1180 }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'sendApplyUser'">
@ -151,6 +162,9 @@ void loadData(true);
{{ getStatusMeta(record.status).label }}
</Tag>
</template>
<template v-else-if="column.key === 'relationType'">
<Tag>{{ getCpRelationTypeName(record.relationType) }}</Tag>
</template>
<template v-else-if="column.key === 'time'">
<div>创建: {{ formatDate(record.createTime) }}</div>
<div>修改: {{ formatDate(record.updateTime) }}</div>