fixed form builder
This commit is contained in:
parent
f019c3a1c4
commit
059b2e3e64
3 changed files with 15 additions and 8 deletions
|
@ -78,7 +78,7 @@ export const ffContext = `type ITEM = {
|
|||
`;
|
||||
|
||||
export const ff1Result = `{
|
||||
"scene":\${<SelectDetail/>:OBJECT:{"details": []},
|
||||
"detailForm":\${<SelectDetail/>:OBJECT:{"details": []},
|
||||
"empty":\${NAME:string:default},
|
||||
"params": \${ITEM:Array<ITEM>:[]}
|
||||
}`;
|
||||
|
|
|
@ -15,6 +15,7 @@ export const FormBuilderForm = observer((props: IPropsForm<Partial<FormBuilderVa
|
|||
const store = useStore(FormsFormBuilderStore);
|
||||
useEffect(() => {
|
||||
store.initParam(isBtScreen(), props.store);
|
||||
store.loadClassInstance(FormBuilderValidationModel, props.dependency as FormBuilderValidationModel);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -26,7 +27,7 @@ export const FormBuilderForm = observer((props: IPropsForm<Partial<FormBuilderVa
|
|||
formBuilder={store.viewModel}
|
||||
onChange={(form) => {
|
||||
store.viewModel = form;
|
||||
console.log(form)
|
||||
console.log(form);
|
||||
}}
|
||||
/>
|
||||
<div style={{ height: 100 }} />
|
||||
|
@ -45,18 +46,17 @@ export const FormBuilderForm = observer((props: IPropsForm<Partial<FormBuilderVa
|
|||
) : (
|
||||
<>
|
||||
<CoreInput
|
||||
style={{height:'100%'}}
|
||||
|
||||
style={{ height: "100%" }}
|
||||
value={store.viewModel.result}
|
||||
label="Result"
|
||||
styleContentEditable={{height:'100%'}}
|
||||
styleContentEditable={{ height: "100%" }}
|
||||
onChange={(text) => store.updateForm({ result: text })}
|
||||
/>
|
||||
<CoreInput
|
||||
style={{height:'100%'}}
|
||||
style={{ height: "100%" }}
|
||||
value={store.viewModel.context}
|
||||
label="Context"
|
||||
styleContentEditable={{height:'100%'}}
|
||||
styleContentEditable={{ height: "100%" }}
|
||||
onChange={(text) => store.updateForm({ context: text })}
|
||||
/>
|
||||
<div style={{ width: 100 }}>
|
||||
|
|
|
@ -7,6 +7,8 @@ import { RouterProvider } from "react-router-dom";
|
|||
import { router } from "./core/routers/routers";
|
||||
import { configure } from "mobx";
|
||||
import { ThemeStore } from "./core/store/theme_store";
|
||||
import { FormBuilderValidationModel } from "./core/model/form_builder_validation_model";
|
||||
import { FormBuilder } from "./core/ui/form_builder/form_builder";
|
||||
|
||||
configure({
|
||||
enforceActions: "never",
|
||||
|
@ -22,6 +24,11 @@ root.render(
|
|||
<SocketListener>
|
||||
<RouterProvider router={router} />
|
||||
</SocketListener>
|
||||
|
||||
{/* <FormBuilder
|
||||
formBuilder={FormBuilderValidationModel.test()}
|
||||
onChange={function (change: FormBuilderValidationModel): void {
|
||||
console.log(JSON.stringify(change.output));
|
||||
}}
|
||||
/> */}
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue