You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

192 lines
3.6 KiB

2 years ago
import { getTenantPackageList } from '@/api/system/tenantPackage'
import type { BasicColumn, FormSchema } from '@/components/Table'
import { useRender } from '@/components/Table'
2 years ago
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
2 years ago
export const columns: BasicColumn[] = [
{
title: '租户编号',
dataIndex: 'id',
width: 100,
2 years ago
},
{
title: '租户名',
dataIndex: 'name',
width: 180,
2 years ago
},
{
title: '租户套餐',
dataIndex: 'packageId',
width: 100,
2 years ago
},
{
title: '联系人',
dataIndex: 'contactName',
width: 120,
2 years ago
},
{
title: '联系手机',
dataIndex: 'contactMobile',
width: 120,
2 years ago
},
{
title: '账号额度',
dataIndex: 'accountCount',
width: 120,
customRender: ({ text }) => {
return useRender.renderTag(text)
},
2 years ago
},
{
title: '过期时间',
dataIndex: 'expireTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
},
2 years ago
},
{
title: '绑定域名',
dataIndex: 'website',
width: 200,
2 years ago
},
{
title: '租户状态',
dataIndex: 'status',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.COMMON_STATUS)
},
2 years ago
},
{
title: '备注',
dataIndex: 'remark',
width: 180,
2 years ago
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
},
},
2 years ago
]
export const searchFormSchema: FormSchema[] = [
{
label: '租户名',
field: 'name',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
label: '联系人',
field: 'contactName',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
label: '联系手机',
field: 'contactMobile',
component: 'Input',
colProps: { span: 8 },
2 years ago
},
{
label: '状态',
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
2 years ago
},
colProps: { span: 8 },
2 years ago
},
{
label: '创建时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 },
},
2 years ago
]
export const formSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input',
2 years ago
},
{
label: '租户名',
field: 'name',
required: true,
component: 'Input',
2 years ago
},
{
label: '租户套餐',
field: 'packageId',
required: true,
component: 'ApiSelect',
componentProps: {
api: () => getTenantPackageList(),
labelField: 'name',
valueField: 'id',
},
2 years ago
},
{
label: '联系人',
field: 'contactName',
required: true,
component: 'Input',
2 years ago
},
{
label: '联系手机',
field: 'contactMobile',
component: 'Input',
2 years ago
},
{
label: '用户名称',
field: 'username',
component: 'Input',
ifShow: ({ values }) => !values.id,
2 years ago
},
{
label: '用户密码',
field: 'password',
component: 'InputPassword',
ifShow: ({ values }) => !values.id,
2 years ago
},
{
label: '账号额度',
field: 'accountCount',
required: true,
defaultValue: 0,
component: 'InputNumber',
2 years ago
},
{
label: '过期时间',
field: 'expireTime',
required: true,
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
},
2 years ago
},
{
label: '绑定域名',
field: 'website',
2 years ago
required: true,
component: 'Input',
2 years ago
},
{
label: '租户状态',
field: 'status',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
},
},
2 years ago
]