44 lines
848 B
TypeScript
Raw Normal View History

2023-01-19 16:49:57 +08:00
import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
2022-07-28 12:18:38 +08:00
const { t } = useI18n() // 国际化
// 表单校验
export const rules = reactive({
name: [required]
})
// CrudSchema
2023-01-19 16:49:57 +08:00
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '表单编号',
action: true,
columns: [
{
title: '表单名',
field: 'name',
isSearch: true
2022-07-28 12:18:38 +08:00
},
2023-01-19 16:49:57 +08:00
{
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictClass: 'number'
},
{
title: '备注',
field: 'remark'
2022-07-28 12:18:38 +08:00
},
2023-01-19 16:49:57 +08:00
{
title: t('common.createTime'),
field: 'createTime',
formatter: 'formatDate',
2023-01-20 15:12:12 +08:00
isForm: false,
table: {
width: 180
}
2022-07-28 12:18:38 +08:00
}
2023-01-19 16:49:57 +08:00
]
})
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)