refactor: dictData ==> dictClass

This commit is contained in:
xingyu
2022-11-17 23:09:29 +08:00
parent 5725d4862b
commit 6291a3d7d8
36 changed files with 63 additions and 63 deletions

View File

@ -17,7 +17,7 @@ export type CrudSchema = Omit<TableColumn, 'children'> & {
detail?: CrudDescriptionsParams // 详情的详细配置
children?: CrudSchema[]
dictType?: string // 字典类型
dictData?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
dictClass?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
}
type CrudSearchParams = {
@ -157,11 +157,11 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
let comonentProps = {}
if (schemaItem.dictType) {
const options: ComponentOptions[] = []
if (schemaItem.dictData && schemaItem.dictData === 'number') {
if (schemaItem.dictClass && schemaItem.dictClass === 'number') {
getIntDictOptions(schemaItem.dictType).forEach((dict) => {
options.push(dict)
})
} else if (schemaItem.dictData && schemaItem.dictData === 'boolean') {
} else if (schemaItem.dictClass && schemaItem.dictClass === 'boolean') {
getBoolDictOptions(schemaItem.dictType).forEach((dict) => {
options.push(dict)
})

View File

@ -38,7 +38,7 @@ type VxeCrudColumns = Omit<VxeTableColumn, 'children'> & {
print?: CrudPrintParams // vxe 打印的字段
children?: VxeCrudColumns[] // 子级
dictType?: string // 字典类型
dictData?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
dictClass?: 'string' | 'number' | 'boolean' // 字典数据类型 string | number | boolean
}
type CrudSearchParams = {
@ -239,11 +239,11 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => {
let comonentProps = {}
if (schemaItem.dictType) {
const options: ComponentOptions[] = []
if (schemaItem.dictData && schemaItem.dictData === 'number') {
if (schemaItem.dictClass && schemaItem.dictClass === 'number') {
getIntDictOptions(schemaItem.dictType).forEach((dict) => {
options.push(dict)
})
} else if (schemaItem.dictData && schemaItem.dictData === 'boolean') {
} else if (schemaItem.dictClass && schemaItem.dictClass === 'boolean') {
getBoolDictOptions(schemaItem.dictType).forEach((dict) => {
options.push(dict)
})