fix: tenant tenantPackage

This commit is contained in:
xingyu4j
2025-10-09 18:38:13 +08:00
parent 378cdd4c38
commit b2ba1d9d37
4 changed files with 18 additions and 48 deletions

View File

@@ -8,6 +8,8 @@ import { z } from '#/adapter/form';
import { getTenantPackageList } from '#/api/system/tenant-package';
import { getRangePickerDefaultProps } from '#/utils';
const tenantPackageList = await getTenantPackageList();
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
@@ -164,9 +166,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
export function useGridColumns(
getPackageName?: (packageId: number) => string | undefined,
): VxeTableGridOptions['columns'] {
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'checkbox', width: 40 },
{
@@ -183,8 +183,10 @@ export function useGridColumns(
field: 'packageId',
title: '租户套餐',
minWidth: 180,
formatter: (row: { cellValue: number }) => {
return getPackageName?.(row.cellValue) || '-';
formatter: ({ cellValue }) => {
return cellValue === 0
? '系统租户'
: tenantPackageList.find((pkg) => pkg.id === cellValue)?.name || '-';
},
},
{