feat: Select defaultValue
parent
f4e9d2f5e2
commit
d8312d57c5
|
@ -130,16 +130,14 @@ export const importTableSearchFormSchema: FormSchema[] = [
|
|||
{
|
||||
label: '数据源',
|
||||
field: 'dataSourceConfigId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: ({ formModel }) => {
|
||||
return {
|
||||
api: async () => {
|
||||
const res = await getDataSourceConfigList()
|
||||
formModel.dataSourceConfigId = res[0].id
|
||||
return res
|
||||
},
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
component: 'Select',
|
||||
required: true,
|
||||
defaultValue: dataSourceConfigs[0].id,
|
||||
componentProps: {
|
||||
options: dataSourceConfigs,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
colProps: { span: 8 }
|
||||
|
|
|
@ -11,15 +11,21 @@ import { getSimpleAccounts } from '@/api/mp/account'
|
|||
import { deleteFreePublish, getFreePublishPage } from '@/api/mp/freePublish'
|
||||
import { FormSchema } from '@/components/Form'
|
||||
|
||||
const simpleAccountsOptinos = await getSimpleAccounts()
|
||||
|
||||
const searchSchema: FormSchema[] = [
|
||||
{
|
||||
label: '公众号',
|
||||
field: 'accountId',
|
||||
component: 'ApiSelect',
|
||||
component: 'Select',
|
||||
required: true,
|
||||
defaultValue: simpleAccountsOptinos[0].id,
|
||||
componentProps: {
|
||||
api: () => getSimpleAccounts(),
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
options: simpleAccountsOptinos,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
colProps: { span: 8 }
|
||||
}
|
||||
|
|
|
@ -103,15 +103,21 @@ export const columns: BasicColumn[] = [
|
|||
}
|
||||
]
|
||||
|
||||
const simpleAccountsOptinos = await getSimpleAccounts()
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '公众号',
|
||||
field: 'accountId',
|
||||
component: 'ApiSelect',
|
||||
component: 'Select',
|
||||
required: true,
|
||||
defaultValue: simpleAccountsOptinos[0].id,
|
||||
componentProps: {
|
||||
api: () => getSimpleAccounts(),
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
options: simpleAccountsOptinos,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
colProps: { span: 8 }
|
||||
},
|
||||
|
|
|
@ -27,15 +27,21 @@ export const columns: BasicColumn[] = [
|
|||
}
|
||||
]
|
||||
|
||||
const simpleAccountsOptinos = await getSimpleAccounts()
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '公众号',
|
||||
field: 'accountId',
|
||||
component: 'ApiSelect',
|
||||
component: 'Select',
|
||||
required: true,
|
||||
defaultValue: simpleAccountsOptinos[0].id,
|
||||
componentProps: {
|
||||
api: () => getSimpleAccounts(),
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
options: simpleAccountsOptinos,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
colProps: { span: 8 }
|
||||
},
|
||||
|
|
|
@ -49,15 +49,21 @@ export const columns: BasicColumn[] = [
|
|||
}
|
||||
]
|
||||
|
||||
const simpleAccountsOptinos = await getSimpleAccounts()
|
||||
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '公众号',
|
||||
field: 'accountId',
|
||||
component: 'ApiSelect',
|
||||
component: 'Select',
|
||||
required: true,
|
||||
defaultValue: simpleAccountsOptinos[0].id,
|
||||
componentProps: {
|
||||
api: () => getSimpleAccounts(),
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
options: simpleAccountsOptinos,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
colProps: { span: 8 }
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue