From 75a5ff497f3e4fb632ceeb096a6a756b2c2b8096 Mon Sep 17 00:00:00 2001 From: rizky Date: Fri, 2 Aug 2024 03:51:19 -0700 Subject: [PATCH] fix --- comps/form/gen/on_load.ts | 8 ++++---- comps/md/gen/tbl-list/on_load.ts | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/comps/form/gen/on_load.ts b/comps/form/gen/on_load.ts index 1a33079..bd87d87 100755 --- a/comps/form/gen/on_load.ts +++ b/comps/form/gen/on_load.ts @@ -1,4 +1,4 @@ -import { GFCol } from "./fields"; +import { formatName, GFCol } from "./fields"; export const on_load = ({ pk, @@ -23,16 +23,16 @@ export const on_load = ({ sample[k] = {}; Object.keys(v.select).map((e) => { - sample[k][e] = "sample"; + sample[k][e] = formatName(e); }); } else { - sample[k] = "sample"; + sample[k] = formatName(k); } } let is_md: string | boolean = typeof opt?.is_md === "undefined" ? true : !!opt?.is_md; - + if (!is_md) is_md = ""; return `\ diff --git a/comps/md/gen/tbl-list/on_load.ts b/comps/md/gen/tbl-list/on_load.ts index aec416a..f47e814 100755 --- a/comps/md/gen/tbl-list/on_load.ts +++ b/comps/md/gen/tbl-list/on_load.ts @@ -1,3 +1,5 @@ +import { formatName } from "lib/gen/utils"; + export const on_load = ({ pk, table, @@ -19,7 +21,7 @@ export const on_load = ({ Object.keys(v.select) .filter((e) => e !== pks[k]) .map((e) => { - val[e] = "sample"; + val[e] = formatName(`${e}_${k}`); }); const field = fields.find((e) => e.name === k); sample[k] = val; @@ -29,7 +31,7 @@ export const on_load = ({ } } } else { - sample[k] = "sample"; + sample[k] = formatName(k); } }