fix
This commit is contained in:
parent
55801d62fb
commit
6e0ba25f08
|
|
@ -16,7 +16,7 @@ export const generateTableList = async (
|
||||||
let table = "" as string;
|
let table = "" as string;
|
||||||
try {
|
try {
|
||||||
table = eval(data.gen__table.value);
|
table = eval(data.gen__table.value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
table = data.gen__table?.value;
|
table = data.gen__table?.value;
|
||||||
}
|
}
|
||||||
const raw_fields = JSON.parse(data.gen__fields.value) as (
|
const raw_fields = JSON.parse(data.gen__fields.value) as (
|
||||||
|
|
|
||||||
|
|
@ -18,28 +18,26 @@ export const FormatValue: FC<{
|
||||||
if (gen_fields) {
|
if (gen_fields) {
|
||||||
const gf = JSON.stringify(gen_fields);
|
const gf = JSON.stringify(gen_fields);
|
||||||
if (!fields_map.has(gf)) {
|
if (!fields_map.has(gf)) {
|
||||||
fields_map.set(
|
const result = gen_fields.map((e: any) => {
|
||||||
gf,
|
if (typeof e === "string") {
|
||||||
gen_fields.map((e: any) => {
|
return JSON.parse(e);
|
||||||
if (typeof e === "string") {
|
} else {
|
||||||
return JSON.parse(e);
|
return {
|
||||||
} else {
|
...JSON.parse(e.value),
|
||||||
return {
|
checked: e.checked.map((ex: any) => {
|
||||||
...JSON.parse(e.value),
|
if (typeof ex === "string") {
|
||||||
checked: e.checked.map((ex: any) => {
|
return JSON.parse(ex);
|
||||||
if (typeof ex === "string") {
|
}
|
||||||
return JSON.parse(ex);
|
try {
|
||||||
}
|
return JSON.parse(ex["value"]);
|
||||||
try {
|
} catch (em) {
|
||||||
return JSON.parse(ex["value"]);
|
return null;
|
||||||
} catch (em) {
|
}
|
||||||
return null;
|
}),
|
||||||
}
|
};
|
||||||
}),
|
}
|
||||||
};
|
});
|
||||||
}
|
fields_map.set(gf, result);
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const fields = fields_map.get(gf);
|
const fields = fields_map.get(gf);
|
||||||
|
|
@ -178,4 +176,4 @@ const timeAgo = (date: any) => {
|
||||||
const ceil_comma = (number: number) => {
|
const ceil_comma = (number: number) => {
|
||||||
if (!number) return 0;
|
if (!number) return 0;
|
||||||
return Math.ceil(number * 100) / 100;
|
return Math.ceil(number * 100) / 100;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue