fix: 修复下拉字典每次点击触发一次
parent
d41e280db3
commit
f3c8969719
|
@ -4,6 +4,13 @@ import { FormSchema } from '@/components/Form'
|
||||||
import { BasicColumn } from '@/components/Table'
|
import { BasicColumn } from '@/components/Table'
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
||||||
|
async function getDictTypeOptions() {
|
||||||
|
const dictTypeOptions: any[] = []
|
||||||
|
const res = await listSimpleDictType()
|
||||||
|
dictTypeOptions.push(...res)
|
||||||
|
return dictTypeOptions
|
||||||
|
}
|
||||||
|
|
||||||
export const basicInfoSchemas: FormSchema[] = [
|
export const basicInfoSchemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
label: '基本信息',
|
label: '基本信息',
|
||||||
|
@ -307,11 +314,9 @@ export const columns: BasicColumn[] = [
|
||||||
title: '字典类型',
|
title: '字典类型',
|
||||||
dataIndex: 'dictType',
|
dataIndex: 'dictType',
|
||||||
editRow: true,
|
editRow: true,
|
||||||
editComponent: 'ApiSelect',
|
editComponent: 'Select',
|
||||||
editComponentProps: {
|
editComponentProps: {
|
||||||
api: () => listSimpleDictType(),
|
options: (await getDictTypeOptions()).map((item) => ({ value: item.type, label: item.name }))
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'type'
|
|
||||||
},
|
},
|
||||||
width: 100
|
width: 100
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue