fix
This commit is contained in:
parent
5e8b25d174
commit
9e35d38f13
|
|
@ -94,7 +94,7 @@ export const generateForm = async (
|
|||
};
|
||||
const existing_childs = (
|
||||
(item.component?.props.body as any)?.content as IItem
|
||||
).childs;
|
||||
)?.childs;
|
||||
|
||||
let child_body = createItem({
|
||||
name: "item",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ export const generateMasterDetail: GenFn<{
|
|||
if (!title && item.edit.props?.gen_table) {
|
||||
const table = { ...item.edit.props?.gen_table };
|
||||
table.value = `${formatName(table.value as string)}`;
|
||||
console.log(table.value);
|
||||
item.edit.setProp("title", table.value);
|
||||
}
|
||||
} catch (e) {}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ const get_layer = async (
|
|||
return options;
|
||||
};
|
||||
|
||||
const pending = {} as Record<string, Promise<any>[]>;
|
||||
|
||||
const loadSingle = async (id_site: string, table: string) => {
|
||||
const ls_key = `schema-md-${id_site}`;
|
||||
const idb_key = `${id_site}-${table}`;
|
||||
|
|
@ -143,10 +145,18 @@ const loadSingle = async (id_site: string, table: string) => {
|
|||
if (cached) {
|
||||
single[table] = cached;
|
||||
} else {
|
||||
if (!pending[table]) {
|
||||
pending[table] = [
|
||||
db._schema.columns(table as any),
|
||||
db._schema.rels(table as any),
|
||||
];
|
||||
}
|
||||
await Promise.all(pending[table]);
|
||||
single[table] = {
|
||||
cols: await db._schema.columns(table as any),
|
||||
rels: await db._schema.rels(table as any),
|
||||
cols: await pending[table][0] as any,
|
||||
rels: await pending[table][1] as any,
|
||||
};
|
||||
|
||||
await kset(idb_key, single[table]);
|
||||
localStorage.setItem(ls_key, JSON.stringify([...cached_keys, table]));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue