顶部搜索栏:
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
title: '列表',
api: getCouponGroupList,
columns: Columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true,
showTableSetting: true,
actionColumn: {
width: 140,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
},
});
async function getbrandListSelect() {
const res = await getBrandDropDown({ type: 1 });
brandList.value = res;
const list = [] as any;
res.forEach((item) => {
list.push({ label: item.name, value: item.name });
});
brandList.value = list;
//将数据放入下拉框中
const { updateSchema } = getForm();
await updateSchema({
field: 'brand',
componentProps: {
options: unref(brandList.value),
},
});
}
表单下拉框:
const [registerForm, { updateSchema }] = useForm({
labelWidth: 130,
baseColProps: { span: 24 },
schemas: formSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 },
});
updateSchema({
field: 'couponInfoId',
componentProps: {
options: data,
},
});