feat: tenant
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { reactive } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { required } from '@/utils/formRules'
|
||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
// 表单校验
|
||||
@@ -18,115 +18,82 @@ export const rules = reactive({
|
||||
})
|
||||
|
||||
// CrudSchema.
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
{
|
||||
label: t('common.index'),
|
||||
field: 'id',
|
||||
type: 'index',
|
||||
form: {
|
||||
show: false
|
||||
const crudSchemas = reactive<VxeCrudSchema>({
|
||||
primaryKey: 'id',
|
||||
primaryType: 'seq',
|
||||
action: true,
|
||||
columns: [
|
||||
{
|
||||
title: '租户名称',
|
||||
field: 'name',
|
||||
isSearch: true
|
||||
},
|
||||
detail: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '租户名称',
|
||||
field: 'name',
|
||||
search: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '租户套餐',
|
||||
field: 'packageId'
|
||||
},
|
||||
{
|
||||
label: '联系人',
|
||||
field: 'contactName',
|
||||
search: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '联系手机',
|
||||
field: 'contactMobile',
|
||||
search: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '用户名称',
|
||||
field: 'username',
|
||||
table: {
|
||||
show: false
|
||||
{
|
||||
title: '租户套餐',
|
||||
field: 'packageId'
|
||||
},
|
||||
detail: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '用户密码',
|
||||
field: 'password',
|
||||
table: {
|
||||
show: false
|
||||
{
|
||||
title: '联系人',
|
||||
field: 'contactName',
|
||||
isSearch: true
|
||||
},
|
||||
detail: {
|
||||
show: false
|
||||
{
|
||||
title: '联系手机',
|
||||
field: 'contactMobile',
|
||||
isSearch: true
|
||||
},
|
||||
form: {
|
||||
component: 'InputPassword'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '账号额度',
|
||||
field: 'accountCount',
|
||||
form: {
|
||||
component: 'InputNumber'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '过期时间',
|
||||
field: 'expireTime',
|
||||
form: {
|
||||
show: true,
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'datetime',
|
||||
valueFormat: 'x'
|
||||
{
|
||||
title: '用户名称',
|
||||
field: 'username',
|
||||
isTable: false,
|
||||
isDetail: false
|
||||
},
|
||||
{
|
||||
title: '用户密码',
|
||||
field: 'password',
|
||||
isTable: false,
|
||||
isDetail: false,
|
||||
form: {
|
||||
component: 'InputPassword'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '绑定域名',
|
||||
field: 'domain'
|
||||
},
|
||||
{
|
||||
label: '租户状态',
|
||||
field: 'status',
|
||||
dictType: DICT_TYPE.COMMON_STATUS,
|
||||
dictClass: 'number',
|
||||
search: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('table.createTime'),
|
||||
field: 'createTime',
|
||||
form: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
{
|
||||
label: t('table.action'),
|
||||
field: 'action',
|
||||
width: '240px',
|
||||
form: {
|
||||
show: false
|
||||
},
|
||||
detail: {
|
||||
show: false
|
||||
{
|
||||
title: '账号额度',
|
||||
field: 'accountCount',
|
||||
form: {
|
||||
component: 'InputNumber'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '过期时间',
|
||||
field: 'expireTime',
|
||||
formatter: 'formatDate',
|
||||
form: {
|
||||
show: true,
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'datetime',
|
||||
valueFormat: 'x'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '绑定域名',
|
||||
field: 'domain'
|
||||
},
|
||||
{
|
||||
title: '租户状态',
|
||||
field: 'status',
|
||||
dictType: DICT_TYPE.COMMON_STATUS,
|
||||
dictClass: 'number',
|
||||
isSearch: true
|
||||
},
|
||||
{
|
||||
title: t('table.createTime'),
|
||||
field: 'createTime',
|
||||
formatter: 'formatDate',
|
||||
isForm: false
|
||||
}
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
]
|
||||
})
|
||||
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||
|
||||
Reference in New Issue
Block a user