feat: 统一 api 组件的调用方法
This commit is contained in:
@@ -25,13 +25,9 @@ export function useImportTableFormSchema(): VbenFormSchema[] {
|
||||
label: '数据源',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const data = await getDataSourceConfigList();
|
||||
return data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
api: () => getDataSourceConfigList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
autoSelect: 'first',
|
||||
placeholder: '请选择数据源',
|
||||
},
|
||||
|
||||
@@ -75,7 +75,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '负责人',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleUserList,
|
||||
api: () => getSimpleUserList(),
|
||||
labelField: 'nickname',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择负责人',
|
||||
|
||||
@@ -186,7 +186,7 @@ export function useDataFormSchema(): VbenFormSchema[] {
|
||||
component: 'ApiSelect',
|
||||
componentProps: (values) => {
|
||||
return {
|
||||
api: getSimpleDictTypeList,
|
||||
api: () => getSimpleDictTypeList(),
|
||||
placeholder: '请输入字典类型',
|
||||
labelField: 'name',
|
||||
valueField: 'type',
|
||||
|
||||
@@ -59,7 +59,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '邮箱账号',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleMailAccountList(),
|
||||
api: () => getSimpleMailAccountList(),
|
||||
labelField: 'mail',
|
||||
valueField: 'id',
|
||||
clearable: true,
|
||||
|
||||
@@ -42,7 +42,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '邮箱账号',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleMailAccountList(),
|
||||
api: () => getSimpleMailAccountList(),
|
||||
labelField: 'mail',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择邮箱账号',
|
||||
@@ -187,7 +187,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '邮箱账号',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleMailAccountList(),
|
||||
api: () => getSimpleMailAccountList(),
|
||||
labelField: 'mail',
|
||||
valueField: 'id',
|
||||
clearable: true,
|
||||
|
||||
@@ -196,7 +196,7 @@ export function useSendNotifyFormSchema(): VbenFormSchema[] {
|
||||
label: '接收人',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleUserList,
|
||||
api: () => getSimpleUserList(),
|
||||
labelField: 'nickname',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择接收人',
|
||||
|
||||
@@ -16,11 +16,9 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '操作人',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleUserList,
|
||||
fieldNames: {
|
||||
label: 'nickname',
|
||||
value: 'id',
|
||||
},
|
||||
api: () => getSimpleUserList(),
|
||||
labelField: 'nickname',
|
||||
valueField: 'id',
|
||||
clearable: true,
|
||||
placeholder: '请选择操作人员',
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '短信渠道',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleSmsChannelList(),
|
||||
api: () => getSimpleSmsChannelList(),
|
||||
labelField: 'signature',
|
||||
valueField: 'id',
|
||||
clearable: true,
|
||||
|
||||
@@ -52,7 +52,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '短信渠道',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleSmsChannelList(),
|
||||
api: () => getSimpleSmsChannelList(),
|
||||
labelField: 'signature',
|
||||
valueField: 'id',
|
||||
placeholder: '请选择短信渠道',
|
||||
@@ -146,7 +146,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '短信渠道',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => await getSimpleSmsChannelList(),
|
||||
api: () => getSimpleSmsChannelList(),
|
||||
labelField: 'signature',
|
||||
valueField: 'id',
|
||||
clearable: true,
|
||||
|
||||
@@ -70,7 +70,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '岗位',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimplePostList,
|
||||
api: () => getSimplePostList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
tag: true,
|
||||
@@ -216,7 +216,7 @@ export function useAssignRoleFormSchema(): VbenFormSchema[] {
|
||||
label: '角色',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: getSimpleRoleList,
|
||||
api: () => getSimpleRoleList(),
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
tag: true,
|
||||
|
||||
Reference in New Issue
Block a user