fix
This commit is contained in:
parent
9e35d38f13
commit
c9e591fac3
|
|
@ -22,7 +22,12 @@ export type GFCol = {
|
||||||
};
|
};
|
||||||
export const newField = async (
|
export const newField = async (
|
||||||
field: GFCol,
|
field: GFCol,
|
||||||
opt: { parent_table: string; value: Array<string>; on_change?: string },
|
opt: {
|
||||||
|
parent_table: string;
|
||||||
|
value: Array<string>;
|
||||||
|
on_change?: string;
|
||||||
|
is_from_table_edit?: boolean;
|
||||||
|
},
|
||||||
show_label: boolean
|
show_label: boolean
|
||||||
) => {
|
) => {
|
||||||
let show = typeof show_label === "boolean" ? show_label : true;
|
let show = typeof show_label === "boolean" ? show_label : true;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,11 @@ export const generateForm = async (
|
||||||
if (["has-one", "has-many"].includes(item.type)) {
|
if (["has-one", "has-many"].includes(item.type)) {
|
||||||
value = get(item, "value.checked") as any;
|
value = get(item, "value.checked") as any;
|
||||||
}
|
}
|
||||||
const field = await newField(item, { parent_table: table, value }, true);
|
const field = await newField(
|
||||||
|
item,
|
||||||
|
{ parent_table: table, value, is_from_table_edit: false },
|
||||||
|
true
|
||||||
|
);
|
||||||
child_fields.push(field);
|
child_fields.push(field);
|
||||||
}
|
}
|
||||||
let submit = null;
|
let submit = null;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ export const genTableEdit = async (
|
||||||
parent_table: table,
|
parent_table: table,
|
||||||
value,
|
value,
|
||||||
on_change: `() => { ext_fm.change(); }`,
|
on_change: `() => { ext_fm.change(); }`,
|
||||||
|
is_from_table_edit: true
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ const events = {
|
||||||
form: {
|
form: {
|
||||||
where: async (fm: FMLocal, where: any) => {},
|
where: async (fm: FMLocal, where: any) => {},
|
||||||
before_save: async (fm: FMLocal, record: any) => {},
|
before_save: async (fm: FMLocal, record: any) => {},
|
||||||
|
relation_before_save: async (table: string, record: any) => {},
|
||||||
after_save: async (fm: FMLocal, record: any) => {},
|
after_save: async (fm: FMLocal, record: any) => {},
|
||||||
before_load: async (fm: FMLocal) => {},
|
before_load: async (fm: FMLocal) => {},
|
||||||
after_load: async (fm: FMLocal) => {},
|
after_load: async (fm: FMLocal) => {},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue