feat: harden ai agent admin workflow experience
This commit is contained in:
@@ -1,23 +1,14 @@
|
||||
import type {
|
||||
VbenFormSchema as FormSchema,
|
||||
VbenFormProps,
|
||||
} from '@vben-core/form-ui';
|
||||
} from '@vben/common-ui';
|
||||
|
||||
import type { ComponentType } from './component';
|
||||
|
||||
import { setupVbenForm, useVbenForm as useForm, z } from '@vben-core/form-ui';
|
||||
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { initComponentAdapter } from './component';
|
||||
|
||||
let initialized = false;
|
||||
|
||||
function initSetupVbenForm() {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
initComponentAdapter();
|
||||
async function initSetupVbenForm() {
|
||||
setupVbenForm<ComponentType>({
|
||||
config: {
|
||||
modelPropNameMap: {
|
||||
@@ -40,13 +31,9 @@ function initSetupVbenForm() {
|
||||
},
|
||||
},
|
||||
});
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
const useVbenForm = ((...args: Parameters<typeof useForm<ComponentType>>) => {
|
||||
initSetupVbenForm();
|
||||
return useForm<ComponentType>(...args);
|
||||
}) as typeof useForm<ComponentType>;
|
||||
const useVbenForm = useForm<ComponentType>;
|
||||
|
||||
export { initSetupVbenForm, useVbenForm, z };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user