fix: 修复下拉字典每次点击触发一次

pull/5/MERGE
xingyu 2023-04-26 18:34:35 +08:00
parent d41e280db3
commit f3c8969719
1 changed files with 9 additions and 4 deletions

View File

@ -4,6 +4,13 @@ import { FormSchema } from '@/components/Form'
import { BasicColumn } from '@/components/Table'
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[] = [
{
label: '基本信息',
@ -307,11 +314,9 @@ export const columns: BasicColumn[] = [
title: '字典类型',
dataIndex: 'dictType',
editRow: true,
editComponent: 'ApiSelect',
editComponent: 'Select',
editComponentProps: {
api: () => listSimpleDictType(),
labelField: 'name',
valueField: 'type'
options: (await getDictTypeOptions()).map((item) => ({ value: item.type, label: item.name }))
},
width: 100
},