This commit is contained in:
2025-01-15 15:04:38 +08:00
parent db357a83f3
commit c50651c267
17 changed files with 24 additions and 24 deletions

View File

@@ -232,14 +232,14 @@ const Xi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
}, ri = (e = [], t = /* @__PURE__ */ new Map(), i = "id", n) => {
const r = Y(n ? (a) => c.get(a, i, c.get(a, [n, i])) : (a) => c.get(a, i), [i, n]);
return Y((a) => e == null ? void 0 : e.filter((o) => !o.uuid || !t.has(o.uuid) || t.get(o.uuid).includes(`${r(a)}`)), [e, t, r]);
}, ht = (e = [], t = [], i = /* @__PURE__ */ new Map(), n = "id", r) => {
}, ht = (e = [], t = /* @__PURE__ */ new Map(), i = [], n = "id", r) => {
const a = Y(r ? (o) => c.get(o, n, c.get(o, [r, n])) : (o) => c.get(o, n), [n, r]);
return H(() => {
if (c.isEmpty(t) || !t.some(({ uuid: s }) => Gi.check(s))) return !1;
if (c.isEmpty(i) || c.isEmpty(e)) return !0;
const o = e.map((s) => `${a(s)}`);
return t.some(({ uuid: s }) => !s || !i.has(s) || i.get(s).some((l) => o.includes(`${l}`)));
}, [t, e, i, a]);
if (c.isEmpty(e) || !e.some(({ uuid: s }) => Gi.check(s))) return !1;
if (c.isEmpty(t) || c.isEmpty(i)) return !0;
const o = i.map((s) => `${a(s)}`);
return e.some(({ uuid: s }) => !s || !t.has(s) || t.get(s).some((l) => o.includes(`${l}`)));
}, [e, i, t, a]);
}, Qi = (e, t, i = "id", n = null) => {
const r = rt(), a = U(!1), o = U(e.dataSource), s = U(e.itemOperationsAccess);
return A(() => (o.current = e.dataSource, s.current = e.itemOperationsAccess, () => a.current = !1), [e.dataSource, e.itemOperationsAccess]), a.current && (e.dataSource = o.current, e.itemOperationsAccess = s.current), [e, (l = 0, u = null) => {
@@ -278,7 +278,7 @@ const Xi = (e, t = {}) => H(() => e == null ? void 0 : e.map(({ widgetByJs: i, w
const { classNames: T, onClickCallback: z } = le(te), M = ri(l, u, d, p), q = Y((j, V, $) => g(tn, { className: I("ff-data-list-framework-item", T.item), operations: a ? M(V) : [], data: p ? { [p]: V } : V, children: j, onClickCallback: z }), [p, d, a, z, l, u]);
return L("div", { className: I("ff-data-list-framework", t), children: [g(i.sider, { isTreeSider: x, ...N }), L("div", { className: I("ff-data-list-container", T == null ? void 0 : T.container), children: [g(i.filter, { isConditionFormLayout: w }), g(i.toolbar, { title: h, tabs: C }), g(mn, { ...m, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: d, itemRender: q, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] });
}, tn = ({ className: e, operations: t, children: i, data: n, onClickCallback: r }) => L("div", { className: I("data-list-grid-layout-item-container", e), children: [i, !!(t != null && t.length) && g("div", { className: "data-list-grid-layout-item-actions", children: t.map((a) => g("span", { className: "data-list-grid-layout-item-action", children: g(P.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Le()) }, (a == null ? void 0 : a.uuid) || Le())) })] }), nn = ({ listCode: e, className: t, layouts: i, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: u, resource: p, primaryKey: d, title: h, tabs: m, isPaginate: f, isTreeSider: C, treeSiderConfig: w, isConditionFormLayout: x, ...N }) => {
const { classNames: T, onClickCallback: z } = le(te), M = ri(l, u, d, p), q = ht(n, l, u, d, p);
const { classNames: T, onClickCallback: z } = le(te), M = ri(l, u, d, p), q = ht(l, u, n, d, p);
return L("div", { className: I("ff-data-table-framework", t), children: [g(i.sider, { isTreeSider: C, ...w }), L("div", { className: I("ff-data-table-container", T == null ? void 0 : T.container), children: [g(i.filter, { isConditionFormLayout: x }), g(i.toolbar, { title: h, tabs: m }), g(cn, { ...N, primaryKey: d, className: "ff-data-table-content", columns: r, dataSource: n, operationRender: q ? (j) => {
var V;
return g("div", { className: "ff-data-table-actions", children: (V = M(j)) == null ? void 0 : V.map(($, v) => g(P.Link, { size: "small", uuid: $.uuid, type: $.type, name: $.name, widget: $.widget, widgetType: $.widgetType, widgetProps: $.widgetProps, widgetData: $.widgetData, widgetSetting: $.widgetSetting, widgetContainerProps: $.widgetContainerSetting, data: j, confirm: $.confirm, onAfterClick: (E) => E !== !1 && (z == null ? void 0 : z($.isRefresh, j)) }, $.uuid || v)) });
@@ -373,7 +373,7 @@ const re = class re {
me = new WeakMap(), de = new WeakMap(), ve = new WeakMap(), it = new WeakMap(), R(re, me, null), S(re, "getInstance", () => (y(re, me) || W(re, me, new re()), y(re, me)));
let ft = re;
const li = ft.getInstance(), St = k.forwardRef(({ listCode: e, base62params: t, className: i, theme: n, themeProps: r, layouts: a, classNames: o }, s) => {
const [{ resource: l, primaryKey: u, batchOperations: p = [], itemOperations: d = [], columns: h = [], themeConfig: m, theme: f, isConditionFormLayout: C = !1, isTreeSider: w, treeSiderConfig: x, isItemGridLayout: N, itemGridLayout: T, title: z, isPaginate: M, tabs: q }, j] = F({ isItemGridLayout: !1, itemGridLayout: {} }), V = Zi(e, t), [{ dataSource: $, itemOperationsAccess: v, condition: E, tab: B, keyword: X, page: Se, total: K, pageSize: st, sider: He, onConditionChange: ot, onTabChange: Ft, onKeywordChange: wi, onPageChange: bi, onPageSizeChange: Ci, onSiderChange: ki, onReload: lt }, Et] = Qi(V, e, u, l), xi = ht(d, $, v, u), vi = ht(p);
const [{ resource: l, primaryKey: u, batchOperations: p = [], itemOperations: d = [], columns: h = [], themeConfig: m, theme: f, isConditionFormLayout: C = !1, isTreeSider: w, treeSiderConfig: x, isItemGridLayout: N, itemGridLayout: T, title: z, isPaginate: M, tabs: q }, j] = F({ isItemGridLayout: !1, itemGridLayout: {} }), V = Zi(e, t), [{ dataSource: $, itemOperationsAccess: v, condition: E, tab: B, keyword: X, page: Se, total: K, pageSize: st, sider: He, onConditionChange: ot, onTabChange: Ft, onKeywordChange: wi, onPageChange: bi, onPageSizeChange: Ci, onSiderChange: ki, onReload: lt }, Et] = Qi(V, e, u, l), xi = ht(d, v, $, u), vi = ht(p);
return A(() => {
let Ke = null;
return e && O.get(`/api/_/${e}`).resp(({ data: Je, res: Si }) => {