fix
This commit is contained in:
parent
ae7c35b871
commit
eb4d36c730
|
|
@ -1,11 +1,10 @@
|
||||||
import { useLocal } from "@/utils/use-local";
|
import { useLocal } from "@/utils/use-local";
|
||||||
import { FC, ReactNode, useEffect } from "react";
|
import { FC, ReactNode } from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { GenField } from "../form/typings";
|
import { GenField } from "../form/typings";
|
||||||
import { default_filter_local, filter_window } from "./utils/types";
|
|
||||||
import { FilterContent } from "./FilterContent";
|
import { FilterContent } from "./FilterContent";
|
||||||
import { getPathname } from "lib/utils/pathname";
|
|
||||||
import { getFilter } from "./utils/get-filter";
|
import { getFilter } from "./utils/get-filter";
|
||||||
|
import { default_filter_local } from "./utils/types";
|
||||||
|
|
||||||
type FilterMode = "regular" | "inline" | "popup";
|
type FilterMode = "regular" | "inline" | "popup";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ async (opt) => {
|
||||||
raw_id = md.selected[pk];
|
raw_id = md.selected[pk];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (parseInt(raw_id)) raw_id = parseInt(raw_id);
|
||||||
|
|
||||||
${opt?.before_load ? opt.before_load : `let id = raw_id`}
|
${opt?.before_load ? opt.before_load : `let id = raw_id`}
|
||||||
let item = {};
|
let item = {};
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ export const TableList: FC<TableListProp> = ({
|
||||||
const orderBy = local.sort.orderBy || undefined;
|
const orderBy = local.sort.orderBy || undefined;
|
||||||
const where = filterWhere(filter_name, __props);
|
const where = filterWhere(filter_name, __props);
|
||||||
|
|
||||||
call_prasi_events("tablelist", "where", [where]);
|
call_prasi_events("tablelist", "where", [__props?.gen__table, where]);
|
||||||
|
|
||||||
const load_args: any = {
|
const load_args: any = {
|
||||||
async reload() {},
|
async reload() {},
|
||||||
|
|
@ -327,7 +327,7 @@ export const TableList: FC<TableListProp> = ({
|
||||||
);
|
);
|
||||||
if (mode_child) {
|
if (mode_child) {
|
||||||
const tbl = _item.edit.childs[0].edit.childs.find(
|
const tbl = _item.edit.childs[0].edit.childs.find(
|
||||||
(e) => get(e, "id") === mode_child.id
|
(e: any) => get(e, "id") === mode_child.id
|
||||||
);
|
);
|
||||||
const meta = tbl;
|
const meta = tbl;
|
||||||
if (meta && meta.childs) {
|
if (meta && meta.childs) {
|
||||||
|
|
@ -830,7 +830,7 @@ function isAtBottom({ currentTarget }: React.UIEvent<HTMLDivElement>): boolean {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProp(child: IItem, name: string, defaultValue?: any) {
|
function getProp(child: any, name: string, defaultValue?: any) {
|
||||||
const fn = new Function(
|
const fn = new Function(
|
||||||
`return ${get(child, `component.props.${name}.valueBuilt`) || `null`}`
|
`return ${get(child, `component.props.${name}.valueBuilt`) || `null`}`
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ async (opt) => {
|
||||||
raw_id = md.selected[pk];
|
raw_id = md.selected[pk];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (parseInt(raw_id)) raw_id = parseInt(raw_id);
|
||||||
|
|
||||||
${
|
${
|
||||||
opt?.before_load
|
opt?.before_load
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { FMLocal } from "../..";
|
import { FMLocal } from "../..";
|
||||||
|
import { Prisma } from "../../typings/prisma";
|
||||||
|
|
||||||
const events = {
|
const events = {
|
||||||
form: {
|
form: {
|
||||||
|
|
@ -10,7 +11,9 @@ const events = {
|
||||||
before_load: async (fm: FMLocal) => {},
|
before_load: async (fm: FMLocal) => {},
|
||||||
after_load: async (fm: FMLocal) => {},
|
after_load: async (fm: FMLocal) => {},
|
||||||
},
|
},
|
||||||
tablelist: { where: async (where: any) => {} },
|
tablelist: {
|
||||||
|
where: async <T extends Prisma.ModelName>(table: T, where: any) => {},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let w = null as any;
|
let w = null as any;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue