feat: 添加字典方法
Some checks failed
coverage CI / build (push) Has been cancelled

This commit is contained in:
2025-09-27 15:52:40 +08:00
parent 39f9e0e714
commit b4d3535b91
10 changed files with 1290 additions and 35 deletions

View File

@@ -2,10 +2,10 @@ import type {
ProColumns,
ProFormColumnsType,
} from '@ant-design/pro-components';
import { DatePicker, Modal, Popconfirm } from 'antd';
import { FormInstance } from 'antd/lib';
import { Tag } from 'antd';
import dayjs from 'dayjs';
import { deleteTenant, type TenantVO } from '@/services/system/tenant/list';
import type { TenantVO } from '@/services/system/tenant/list';
import { getTenantPackageList } from '@/services/system/tenant/package';
export const baseTenantColumns: ProColumns<TenantVO>[] = [
@@ -29,8 +29,22 @@ export const baseTenantColumns: ProColumns<TenantVO>[] = [
request: async () => {
const packageList: { id: number; name: string }[] =
await getTenantPackageList();
packageList.map((item) => ({ label: item.name, value: item.id }));
return packageList.map((item) => ({ label: item.name, value: item.id }));
const newData = packageList.map((item) => ({
label: item.name,
value: item.id,
}));
const defData = [{ value: 0, label: '系统' }];
return [...defData, ...newData];
},
render: (dom, record) => {
return (
<Tag
key={record.id}
color={record.packageId === 0 ? 'error' : 'success'}
>
{dom}
</Tag>
);
},
// valueEnum: {
// all: { text: "全部", status: "Default" },