ff-dist/dist/common/main-D2ZjkFcD.js

2176 lines
78 KiB
JavaScript
Raw Normal View History

2024-06-28 09:26:11 +08:00
var Rn = Object.defineProperty;
var kn = (e, t, n) => t in e ? Rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var F = (e, t, n) => (kn(e, typeof t != "symbol" ? t + "" : t, n), n), Zt = (e, t, n) => {
2024-06-24 15:44:25 +08:00
if (!t.has(e))
throw TypeError("Cannot " + n);
};
2024-06-28 09:26:11 +08:00
var u = (e, t, n) => (Zt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), R = (e, t, n) => {
2024-06-24 15:44:25 +08:00
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
t instanceof WeakSet ? t.add(e) : t.set(e, n);
2024-06-28 09:26:11 +08:00
}, U = (e, t, n, s) => (Zt(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
var He = (e, t, n, s) => ({
2024-06-24 15:44:25 +08:00
set _(r) {
2024-06-28 09:26:11 +08:00
U(e, t, r, n);
2024-06-24 15:44:25 +08:00
},
get _() {
return u(e, t, s);
}
});
2024-06-28 09:26:11 +08:00
import d from "lodash";
import Be from "axios";
import v, { useMemo as le, useEffect as L, useRef as K, useState as k, useCallback as _, useContext as De, useLayoutEffect as Fn, useId as Vn } from "react";
import vt from "ff-request";
import Ln from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url";
import { jsx as f, jsxs as Z, Fragment as Nn } from "react/jsx-runtime";
import { QuestionOutlined as In, LoadingOutlined as wn, createFromIconfontCN as En } from "@ant-design/icons";
import T from "classnames";
import { P as S, N as Ye } from "./vender-CijlkmMW.js";
import Ke, { Field as Dt, FieldContext as Wn } from "rc-field-form";
import { notification as Xt, Drawer as Pn, Modal as Zn, Form as Me, ConfigProvider as jt, Input as Tn, Breadcrumb as Gn, Tree as Sn, Pagination as $n, Table as zn, Empty as On, Popconfirm as xn, Tooltip as Un, Button as Dn, Popover as Xn } from "antd";
import { flushSync as jn } from "react-dom";
import Tt from "immutability-helper";
import { useParams as Hn, generatePath as Bn, Navigate as Yn, createBrowserRouter as Kn } from "react-router-dom";
const Ct = ({ type: e, className: t, ...n }) => {
2024-06-24 15:44:25 +08:00
if (!(e != null && e.startsWith("icon-")))
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(In, {});
2024-06-24 15:44:25 +08:00
if (e === "icon-loading")
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(wn, { className: t, ...n });
const s = le(() => En({ scriptUrl: Pe.get("Common.ICONFONT", []) }), [Pe.get("Common.ICONFONT")]);
return /* @__PURE__ */ f(s, { type: e, className: T("iconfont", t), ...n });
}, Mn = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => {
const [c, l] = Xt.useNotification();
return L(() => {
c[o || "open"]({
2024-06-24 15:44:25 +08:00
className: e,
message: t,
description: n,
icon: s,
duration: i,
onClose: () => r(!1)
});
}, [t, n, s]), l;
2024-06-28 09:26:11 +08:00
}, An = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => {
var a;
const i = K(), [c, l] = k();
return L(() => (c > 0 && (i.current = setTimeout(() => {
c <= 1 ? r() : l((p) => p - 1);
}, 1e3)), () => clearTimeout(i.current)), [c]), L(() => {
2024-06-24 15:44:25 +08:00
l(Math.max(Math.ceil(o / 1e3), 0));
2024-06-28 09:26:11 +08:00
}, [o]), /* @__PURE__ */ f("div", { className: T("ff-confirm", e), onClick: (p) => p.mpEvent.currentTarget.id === p.mpEvent.target.id && r(), children: /* @__PURE__ */ Z("div", { className: "ff-confirm-container", children: [
/* @__PURE__ */ f("div", { className: "ff-confirm-title", children: t }),
/* @__PURE__ */ f("div", { className: "ff-confirm-content", children: n }),
/* @__PURE__ */ Z("div", { className: "ff-confirm-operations", children: [
/* @__PURE__ */ Z("div", { className: "ff-confirm-cancel", onClick: () => r(!1), children: [
2024-06-24 15:44:25 +08:00
"取消 (",
2024-06-28 09:26:11 +08:00
c,
2024-06-24 15:44:25 +08:00
")"
] }),
v.isValidElement(s) ? v.cloneElement(s, {
onClick: () => r(!0),
2024-06-28 09:26:11 +08:00
className: T("ff-confirm-ok", (a = s.props) == null ? void 0 : a.className)
}) : /* @__PURE__ */ f("div", { className: "ff-confirm-ok", onClick: () => r(!0), children: s || "确定" })
2024-06-24 15:44:25 +08:00
] })
] }) });
2024-06-28 09:26:11 +08:00
}, Xe = v.createContext({
2024-06-24 15:44:25 +08:00
ele: {},
mount: () => {
},
unmount: () => {
}
2024-06-28 09:26:11 +08:00
}), Y = ({ className: e, children: t, actions: n, title: s, subTitle: r, extras: o, style: i }) => (n && Y.Action({ children: n }), s && Y.Title({ children: s }), r && Y.SubTitle({ children: r }), o && Y.Extra({ children: o }), /* @__PURE__ */ f("div", { className: T("ff-container", e), style: i, children: t })), ct = (e) => ({ children: t, className: n }) => {
const { mount: s, unmount: r } = v.useContext(Xe);
return L(() => (s(e, v.createElement("div", {
2024-06-24 15:44:25 +08:00
key: `ff-${e}`,
2024-06-28 09:26:11 +08:00
className: T(`ff-popup-${e}`, n)
2024-06-24 15:44:25 +08:00
}, t)), () => r(e)), [n, t]), null;
};
2024-06-28 09:26:11 +08:00
Y.Action = ct("actions");
Y.Title = ct("title");
Y.SubTitle = ct("sub-title");
Y.Extra = ct("extras");
const nr = ({ name: e }) => {
const { ele: t } = v.useContext(Xe);
2024-06-24 15:44:25 +08:00
return t == null ? void 0 : t[e];
};
Y.propTypes = {
// 容器 className
className: S.string,
// 容器样式
style: S.object,
// 标题占位符
title: S.any,
// 副标题占位符
subTitle: S.any,
// 操作按钮占位符
actions: S.any,
// 扩展安装占位符
extras: S.any
};
Y.defaultProps = {
style: {}
};
2024-06-28 09:26:11 +08:00
const Jn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => {
const i = K(), [c, l] = k(!0), [a, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []);
2024-06-24 15:44:25 +08:00
return v.useImperativeHandle(o, () => ({
handleClose: (h) => {
i.current = h, l(!1);
}
2024-06-28 09:26:11 +08:00
})), /* @__PURE__ */ f(Xe.Provider, { value: { ele: a, mount: g, unmount: m }, children: /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
Pn,
{
...r,
2024-06-28 09:26:11 +08:00
title: s || (a == null ? void 0 : a.title),
open: c,
onClose: () => {
i.current = !1, l(!1);
},
2024-06-24 15:44:25 +08:00
afterOpenChange: (h) => !h && e(i.current),
2024-06-28 09:26:11 +08:00
className: T("ff-popup ff-drawer", n, a == null ? void 0 : a.className),
extra: a == null ? void 0 : a["sub-title"],
2024-06-24 15:44:25 +08:00
classNames: { header: "ff-popup-header", footer: "ff-popup-footer" },
2024-06-28 09:26:11 +08:00
footer: a != null && a.extras || a != null && a.actions ? /* @__PURE__ */ Z(v.Fragment, { children: [
(a == null ? void 0 : a.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }),
(a == null ? void 0 : a.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" })
2024-06-24 15:44:25 +08:00
] }) : void 0,
children: t
}
) });
2024-06-28 09:26:11 +08:00
}), Qn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => {
const i = K(), [c, l] = k(!0), [a, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []);
2024-06-24 15:44:25 +08:00
return v.useImperativeHandle(o, () => ({
handleClose: (h) => {
i.current = h, l(!1);
}
2024-06-28 09:26:11 +08:00
})), /* @__PURE__ */ f(Xe.Provider, { value: { ele: a, mount: g, unmount: m }, children: /* @__PURE__ */ f(
Zn,
2024-06-24 15:44:25 +08:00
{
...r,
2024-06-28 09:26:11 +08:00
title: /* @__PURE__ */ Z(Nn, { children: [
s || (a == null ? void 0 : a.title),
a == null ? void 0 : a["sub-title"]
2024-06-24 15:44:25 +08:00
] }),
2024-06-28 09:26:11 +08:00
open: c,
2024-06-24 15:44:25 +08:00
onCancel: () => {
2024-06-28 09:26:11 +08:00
i.current = !1, l(!1);
2024-06-24 15:44:25 +08:00
},
afterOpenChange: (h) => !h && e(i.current),
2024-06-28 09:26:11 +08:00
className: T("ff-popup ff-modal", n, a == null ? void 0 : a.className),
2024-06-24 15:44:25 +08:00
keyboard: !0,
classNames: { header: "ff-popup-header", footer: "ff-popup-footer" },
2024-06-28 09:26:11 +08:00
footer: a != null && a.extras || a != null && a.actions ? /* @__PURE__ */ Z(v.Fragment, { children: [
(a == null ? void 0 : a.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }),
(a == null ? void 0 : a.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" })
2024-06-24 15:44:25 +08:00
] }) : null,
children: t
}
) });
});
2024-06-28 09:26:11 +08:00
var fe, ae, we, nt;
2024-06-24 15:44:25 +08:00
const ee = class ee {
constructor() {
R(this, ae, null);
2024-06-28 09:26:11 +08:00
R(this, we, /* @__PURE__ */ new Map());
R(this, nt, () => {
2024-06-24 15:44:25 +08:00
if (u(this, ae))
return u(this, ae).port.postMessage({ command: "status", data: [] });
2024-06-28 09:26:11 +08:00
U(this, ae, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, ae).port.onmessage = (t) => {
2024-06-24 15:44:25 +08:00
var n, s;
2024-06-28 09:26:11 +08:00
(n = t.data) != null && n.uuid ? u(this, we).forEach((r, o) => {
2024-06-24 15:44:25 +08:00
var i;
(r == "*" || (i = r == null ? void 0 : r.includes) != null && i.call(r, t.data.uuid)) && o(t.data);
}) : ((s = t.data) == null ? void 0 : s.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: o }) => {
2024-06-28 09:26:11 +08:00
u(this, ae).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(It, "http")}api/user-resource-status-ws?token=${r}`] });
2024-06-24 15:44:25 +08:00
});
}, u(this, ae).port.postMessage({ command: "status", data: [] });
});
2024-06-28 09:26:11 +08:00
F(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, we).set(t, n), u(this, we).size == 1 && u(this, nt).call(this), () => this.unsubscribe(t)));
F(this, "unsubscribe", (t) => u(this, we).delete(t));
if (u(ee, fe))
return u(ee, fe);
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
fe = new WeakMap(), ae = new WeakMap(), we = new WeakMap(), nt = new WeakMap(), R(ee, fe, null), F(ee, "getInstance", () => (u(ee, fe) || U(ee, fe, new ee()), u(ee, fe)));
let ft = ee;
const Ht = ft.getInstance(), Bt = () => {
2024-06-24 15:44:25 +08:00
const e = K(!0), [t, n] = k(0);
2024-06-28 09:26:11 +08:00
return L(() => () => e.current = !1, []), () => e.current && jn(() => {
2024-06-24 15:44:25 +08:00
n(t + 1);
});
2024-06-28 09:26:11 +08:00
}, sr = ({ value: e, defaultValue: t, onChange: n }) => {
const s = Bt(), r = K(e !== void 0 ? e : t);
2024-06-24 15:44:25 +08:00
e !== void 0 && (r.current = e);
2024-06-28 09:26:11 +08:00
const o = _(d.debounce((i) => {
2024-06-24 15:44:25 +08:00
e === void 0 && (r.current = i, s()), n && n(i);
}, 380, { leading: !0, trailing: !1 }), [e]);
return [r.current, o];
2024-06-28 09:26:11 +08:00
}, Gt = (e) => {
2024-06-24 15:44:25 +08:00
const t = K();
2024-06-28 09:26:11 +08:00
return L(() => {
2024-06-24 15:44:25 +08:00
t.current = e;
}), t.current;
2024-06-28 09:26:11 +08:00
}, qn = (e) => {
2024-06-24 15:44:25 +08:00
const t = K(), [n, s] = k(e);
2024-06-28 09:26:11 +08:00
return L(() => {
d.isFunction(t.current) && t.current(n);
2024-06-24 15:44:25 +08:00
}, [n]), [n, function(r, o) {
t.current = o, s(r);
}];
2024-06-28 09:26:11 +08:00
}, lt = (e = v.EffectCallback, t, n = d.isEqual) => {
2024-06-24 15:44:25 +08:00
const s = v.useRef(t);
(!s.current || !n(t, s.current)) && (s.current = t), v.useEffect(e, [s.current]);
2024-06-28 09:26:11 +08:00
}, Yt = (e, t = "string") => {
2024-06-24 15:44:25 +08:00
var n;
if (!Array.isArray(e))
return e;
for (let s = 0; s < e.length; s++)
2024-06-28 09:26:11 +08:00
e[s].value = d.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = Yt(e[s].children, t));
2024-06-24 15:44:25 +08:00
return e;
2024-06-28 09:26:11 +08:00
}, rr = (e, t = "json", n = "string", s, r = null) => {
const [o] = Ke.useForm(s), [i, c] = k([{ label: "无", value: "", disabled: !0 }]), l = K([]), a = Ke.useWatch((p) => l.current.length === 0 ? null : d.pick(p, l.current), o) || null;
return L(() => {
Array.isArray(e) ? c(e) : t === "javascript" && e ? ke.exec(e, {}, {
2024-06-24 15:44:25 +08:00
getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), o.getFieldValue(p)),
getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : o.getFieldValue(p))
}).then((p) => {
2024-06-28 09:26:11 +08:00
c(d.toPrimitive(p, "array"));
}) : e && c(d.toPrimitive(e, "array"));
}, [e, t, a]), Yt(i, n);
}, or = (e) => {
2024-06-24 15:44:25 +08:00
const [t, n] = k(), s = { type: "GET" };
2024-06-28 09:26:11 +08:00
if (typeof e == "string" ? s.url = e : d.isPlainObject(e) && Object.assign(s, e), !(s != null && s.url))
2024-06-24 15:44:25 +08:00
throw "url is required";
const r = (o) => I.request(s, !1).resp((i) => (console.log("useSubscribeRequest", o), n(i), i));
2024-06-28 09:26:11 +08:00
return lt(() => {
2024-06-24 15:44:25 +08:00
let o = null;
return r().then((i) => {
2024-06-28 09:26:11 +08:00
o = Ht.subscribe(d.throttle(r, 180, { leading: !1, trailing: !0 }), i.res);
2024-06-24 15:44:25 +08:00
}), () => o == null ? void 0 : o();
}, s), t;
2024-06-28 09:26:11 +08:00
}, _n = (e) => {
2024-06-24 15:44:25 +08:00
const [t, n] = v.useState({ gridItems: [], hideItems: [] });
return v.useEffect(() => {
e && I.get(`/api/_/${e}`).then(({
pk: s,
uuid: r,
code: o,
resource: i,
2024-06-28 09:26:11 +08:00
align: c,
2024-06-24 15:44:25 +08:00
listenChangeFields: l,
2024-06-28 09:26:11 +08:00
listenChangeFieldsFunc: a,
2024-06-24 15:44:25 +08:00
fields: p
}) => ({
pk: s,
uuid: r,
code: o,
resource: i,
2024-06-28 09:26:11 +08:00
align: c,
2024-06-24 15:44:25 +08:00
listenChangeFields: l,
2024-06-28 09:26:11 +08:00
listenChangeFieldsFunc: a,
2024-06-24 15:44:25 +08:00
...p.reduce((g, m) => {
var h;
return (h = m == null ? void 0 : m.field) != null && h.hidden ? g.hides.push(m == null ? void 0 : m.field) : g.items.push(m), g;
}, { items: [], hides: [] })
})).then(n);
}, [e]), t;
2024-06-28 09:26:11 +08:00
}, es = ({
2024-06-24 15:44:25 +08:00
max: e = 0,
min: t = 0,
type: n = "",
message: s,
pattern: r,
required: o = !1,
validator: i
2024-06-28 09:26:11 +08:00
} = {}, c, l) => {
const [a, p] = k([]);
return L(() => {
2024-06-24 15:44:25 +08:00
const g = [];
if (o) {
let m = l;
switch (l) {
case "number":
case "string":
case "array":
break;
case "bool":
m = "boolean";
break;
case "json":
m = "object";
break;
}
g.push({ type: m, required: !0, whitespace: !0, message: "该项必填" });
}
switch (n) {
case "string":
g.push({
type: n,
max: e,
min: t,
message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`)
});
break;
case "pattern":
g.push({ type: "string", pattern: r, message: s });
break;
case "validator":
i && g.push(({ getFieldValue: m }) => ({
validator: async (h, y) => {
2024-06-28 09:26:11 +08:00
const b = await ke.exec(i, { value: y, fieldName: c }, { getFieldValue: m });
return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(s) : Promise.resolve();
2024-06-24 15:44:25 +08:00
}
}));
break;
}
p(g);
2024-06-28 09:26:11 +08:00
}, [e, t, n, s, r, o, i]), a;
}, ts = (e, t, n) => {
2024-06-24 15:44:25 +08:00
const [s, r] = k(null);
2024-06-28 09:26:11 +08:00
return L(() => {
2024-06-24 15:44:25 +08:00
const {
initDataUri: o = `/api/${e}`,
initDataMethod: i = "GET"
} = n || {};
t && I.request({
method: i,
2024-06-28 09:26:11 +08:00
url: d.trimEnd(`${o}/${t}`, "/")
}).then((c) => {
r(c);
2024-06-24 15:44:25 +08:00
});
}, [e, t, n]), s;
2024-06-28 09:26:11 +08:00
}, ns = (e, t, n, s = {}) => {
const r = Bt(), o = K(!0), i = K([]), [c, l] = k(n), a = Ke.useWatch((p) => JSON.stringify(d.pick(p, i.current)), t) || "{}";
return L(() => {
e && ke.exec(e, s, {
getFieldValue: d.wrap(t.getFieldValue, (p, g) => (i.current.some((m) => d.isEqual(m, g)) || (i.current.push(g), r()), p(g))),
2024-06-24 15:44:25 +08:00
isFieldTouched: t.isFieldTouched,
isFieldsTouched: t.isFieldsTouched
}).then((p) => o.current && l(p));
2024-06-28 09:26:11 +08:00
}, [e, a, t, s]), L(() => () => o.current = !1, []), c;
}, ss = (e) => ({
2024-06-24 15:44:25 +08:00
code: t,
layout: n,
name: s,
primaryKey: r = 0,
style: o = {},
formProps: i = {},
2024-06-28 09:26:11 +08:00
form: c,
2024-06-24 15:44:25 +08:00
isPreview: l = !1,
2024-06-28 09:26:11 +08:00
className: a,
2024-06-24 15:44:25 +08:00
onFinish: p,
onValuesChange: g = () => {
},
...m
}) => {
const {
align: h,
autoComplete: y,
resource: b,
2024-06-28 09:26:11 +08:00
items: N,
hides: w,
rowHeight: $,
marginX: E,
2024-06-24 15:44:25 +08:00
marginY: Q,
listenChangeFields: M,
listenChangeFieldsFunc: G,
2024-06-28 09:26:11 +08:00
pk: W,
2024-06-24 15:44:25 +08:00
uuid: z
2024-06-28 09:26:11 +08:00
} = _n(t), [O] = Me.useForm(c), D = ({
changedValues: X,
allValues: x,
listenChangeFields: ut,
listenChangeFieldsFunc: je,
onValuesChange: Fe,
2024-06-24 15:44:25 +08:00
code: Et
}) => {
2024-06-28 09:26:11 +08:00
Fe(X, x), je && Array.isArray(ut) && ke.exec(
je,
{ changedValues: X, allValues: x },
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
getFieldValue: O.getFieldValue,
setFieldsValue: O.setFieldsValue,
isFieldTouched: O.isFieldTouched,
isFieldsTouched: O.isFieldsTouched
2024-06-24 15:44:25 +08:00
}
);
}, oe = le(() => [
2024-06-28 09:26:11 +08:00
{ name: "__PK__", value: W },
2024-06-24 15:44:25 +08:00
{ name: "__PROPS__", value: i },
{ name: "__RESOURCE__", value: b },
{ name: "__LAYOUT_KEY__", value: t },
{ name: "__LAYOUT_UUID__", value: z },
{ name: "__PRIMARY_KEY__", value: r }
2024-06-28 09:26:11 +08:00
], [W, t, z, b, r, i]);
return /* @__PURE__ */ Z(
Me,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
className: a,
2024-06-24 15:44:25 +08:00
requiredMark: !0,
name: s || t,
layout: n || h,
fields: oe,
2024-06-28 09:26:11 +08:00
form: O,
2024-06-24 15:44:25 +08:00
autoComplete: y,
style: { ...o, position: "relative" },
onFinish: p,
2024-06-28 09:26:11 +08:00
onValuesChange: (X, x) => D(
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
changedValues: X,
allValues: x,
2024-06-24 15:44:25 +08:00
listenChangeFields: M,
listenChangeFieldsFunc: G,
onValuesChange: g,
code: t
}
),
children: [
2024-06-28 09:26:11 +08:00
/* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
e,
{
...m,
2024-06-28 09:26:11 +08:00
form: O,
2024-06-24 15:44:25 +08:00
code: t,
2024-06-28 09:26:11 +08:00
fields: N,
rowHeight: $,
marginX: E,
2024-06-24 15:44:25 +08:00
marginY: Q
}
),
2024-06-28 09:26:11 +08:00
w == null ? void 0 : w.map((X) => {
var x;
return /* @__PURE__ */ f(Dt, { name: X.code, children: /* @__PURE__ */ f(
rs,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
form: O,
name: X.code,
type: X.type,
initialValue: X.initialValue,
initialValueLanguage: (x = X.extras) == null ? void 0 : x.initialValueLanguage
2024-06-24 15:44:25 +08:00
}
2024-06-28 09:26:11 +08:00
) }, JSON.stringify(X.code));
2024-06-24 15:44:25 +08:00
})
]
}
);
2024-06-28 09:26:11 +08:00
}, rs = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => {
const o = ns(
2024-06-24 15:44:25 +08:00
n == "javascript" && t,
r,
n == "javascript" ? void 0 : t,
{}
);
2024-06-28 09:26:11 +08:00
return L(() => {
n == "javascript" ? s(d.toPrimitive(o, e)) : s(d.toPrimitive(t, e));
2024-06-24 15:44:25 +08:00
}, [e, t, o]), null;
2024-06-28 09:26:11 +08:00
}, os = (e) => function({ code: n, data: s, ...r }) {
2024-06-24 15:44:25 +08:00
const [o, i] = k({
resource: null,
cols: 12,
rowHeight: 21,
fields: []
});
2024-06-28 09:26:11 +08:00
return L(() => {
n && I.get(`/api/_/${n}`).then((c) => i(d.pick(c, ["resource", "cols", "rowHeight", "fields"])));
}, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
e,
{
...r,
rowHeight: o.rowHeight,
cols: o.cols,
fields: o.fields,
data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {}
}
);
2024-06-28 09:26:11 +08:00
}, is = "RC_FORM_INTERNAL_HOOKS", Kt = (e, {
2024-06-24 15:44:25 +08:00
initialValue: t,
initialValueLanguage: n,
convertJs: s,
convertJsSetting: r,
type: o = "string"
}, i = null) => {
2024-06-28 09:26:11 +08:00
const c = K(!1), l = De(Wn), [a, p] = k(), [g, m] = k(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: h } = l.getInternalHooks(is) || {};
return L(() => h == null ? void 0 : h((y, b, N) => {
if (!c.current)
2024-06-24 15:44:25 +08:00
return;
2024-06-28 09:26:11 +08:00
const w = d.get(b, e);
d.isEqual(w, g) || m(d.toPrimitive(w, o));
}), [g]), L(() => {
n == "javascript" && t ? ke.exec(t, {}, {
2024-06-24 15:44:25 +08:00
getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y),
getFieldValue: (y) => l.getFieldValue(y)
2024-06-28 09:26:11 +08:00
}).then((y) => m(d.toPrimitive(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => c.current = !0) : (t && m(d.toPrimitive(t ?? l.getFieldValue(e), o)), c.current = !0);
}, [t, n]), lt(() => {
c.current && s && J.getWidgetComponent(s).then(({ default: y }) => y({ value: g, record: l.getFieldsValue(!0), $setting: r })).then(p).catch((y) => console.error("布局数据转换错误: ", y, s));
}, [g, s, r]), [a || g, g];
}, as = (e, t, n, s, r, o) => {
2024-06-24 15:44:25 +08:00
const i = {
"--grid-layout-h": `${s}`,
"--grid-layout-w": `${n}`,
"--grid-layout-x": `${e}`,
"--grid-layout-y": `${t}`,
"--grid-layout-row-height-offset": "0px"
};
2024-06-28 09:26:11 +08:00
return r != null && r.autoHeight ? i.height = "fit-content" : i["--grid-layout-row"] = `${s}`, i["--grid-layout-box-margin"] = St(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), i["--grid-layout-box-padding"] = St(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (i.height = `${o}px`), i;
}, St = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Mt = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: c, ...l }) => {
const [a] = Ke.useForm(), p = At(n, ls, "@pkg/grid-layouts"), g = le(() => [
2024-06-24 15:44:25 +08:00
{ name: "__PROPS__", value: i }
], [i]);
2024-06-28 09:26:11 +08:00
return lt(() => {
a.setFieldsValue(s);
}, [s]), /* @__PURE__ */ f(Ke, { fields: g, form: a, component: !1, children: /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
"div",
{
...l,
2024-06-28 09:26:11 +08:00
className: T("ff-grid-layout", c),
2024-06-24 15:44:25 +08:00
style: {
"--grid-layout-item-margin-y": `${(o == null ? void 0 : o[0]) || 0}px`,
"--grid-layout-item-margin-x": `${(o == null ? void 0 : o[1]) || 0}px`,
"--grid-layout-container-padding-y": `${(r == null ? void 0 : r[0]) || 0}px`,
"--grid-layout-container-padding-x": `${(r == null ? void 0 : r[1]) || 0}px`,
"--grid-layout-cols": e || 12,
"--grid-layout-row-height": `${t || 21}px`
},
children: p
}
) });
2024-06-28 09:26:11 +08:00
}, At = (e, t, n = "@pkg/grid-layouts", s = null) => le(() => {
2024-06-24 15:44:25 +08:00
var r;
2024-06-28 09:26:11 +08:00
return (r = d.sortBy(e, ["y", "x"])) == null ? void 0 : r.map(
({ i: o, x: i, y: c, w: l, h: a, field: { boxStyle: p, widgetPrefix: g = n, widget: m, ...h } }, y) => /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
"div",
{
className: "grid-layout-item",
2024-06-28 09:26:11 +08:00
style: as(i, c, l, a, p, m === "Height" && (h == null ? void 0 : h.initialValue)),
children: /* @__PURE__ */ f(
cs,
2024-06-24 15:44:25 +08:00
{
...h,
basicForm: s,
itemWidget: m != null && m.startsWith("@") ? m : `${g}/${m}`,
itemWidgetRender: t
}
)
},
o || y
)
);
2024-06-28 09:26:11 +08:00
}, [e]), cs = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => {
2024-06-24 15:44:25 +08:00
const [r, o] = k();
2024-06-28 09:26:11 +08:00
return L(() => {
J.getWidgetComponent(e).then(({ defaultProps: i, default: c }) => {
o(v.createElement(t(c, i, n), s));
2024-06-24 15:44:25 +08:00
}).catch((i) => o(e));
}, [e]), r;
2024-06-28 09:26:11 +08:00
}, ls = (e, t, n = null) => (s) => {
2024-06-24 15:44:25 +08:00
const {
code: r,
label: o,
extras: i,
2024-06-28 09:26:11 +08:00
isVirtual: c,
2024-06-24 15:44:25 +08:00
initialValue: l,
2024-06-28 09:26:11 +08:00
initialValueLanguage: a,
2024-06-24 15:44:25 +08:00
convertJs: p,
convertJsSetting: g,
...m
2024-06-28 09:26:11 +08:00
} = d.merge({}, t, s), [h, y] = Kt(c ? null : r, {
2024-06-24 15:44:25 +08:00
initialValue: l,
2024-06-28 09:26:11 +08:00
initialValueLanguage: a,
2024-06-24 15:44:25 +08:00
convertJs: p,
convertJsSetting: g,
type: (m == null ? void 0 : m.type) || "string"
}, n);
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(e, { ...m, value: h, rawValue: y, $setting: i || {} });
}, ir = os(Mt), Jt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => {
const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [c, l] = k();
return L(() => {
i && J.getWidgetComponent(i).then(({ defaultProps: a, default: p }) => ({
default: Qt(p, a, r)
})).catch((a) => ({ default: () => `${a}` })).then((a) => l(v.createElement(a.default, o)));
}, [i]), c && v.cloneElement(c, o);
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
Jt.defaultProps = {
2024-06-24 15:44:25 +08:00
widgetPrefix: "@pkg/grid-layout-forms",
widget: "Input"
};
2024-06-28 09:26:11 +08:00
const Qt = (e, t, n = null) => (s) => {
2024-06-24 15:44:25 +08:00
const {
type: r,
code: o,
label: i,
2024-06-28 09:26:11 +08:00
noStyle: c,
2024-06-24 15:44:25 +08:00
placeholder: l,
2024-06-28 09:26:11 +08:00
extras: a,
2024-06-24 15:44:25 +08:00
validators: p,
help: g,
isVirtual: m,
initialValue: h,
initialValueLanguage: y,
convertJs: b,
2024-06-28 09:26:11 +08:00
convertJsSetting: N,
widgetPerfix: w,
boxStyle: $,
widgetDecorator: E,
2024-06-24 15:44:25 +08:00
subWidgets: Q,
...M
2024-06-28 09:26:11 +08:00
} = { ...t, ...s }, G = es(p || {}, o, r), W = {
2024-06-24 15:44:25 +08:00
label: i,
2024-06-28 09:26:11 +08:00
noStyle: c,
2024-06-24 15:44:25 +08:00
colon: !1
}, z = {
placeholder: l,
...M
2024-06-28 09:26:11 +08:00
}, O = _((D) => D == null ? void 0 : d.toPrimitive(D, r), [r]);
return /* @__PURE__ */ f(
Dt,
2024-06-24 15:44:25 +08:00
{
name: o,
rules: G,
2024-06-28 09:26:11 +08:00
initialValue: O(h),
normalize: O,
children: (D, oe, X) => {
var x;
return /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
e,
{
type: r,
2024-06-28 09:26:11 +08:00
rcform: X,
2024-06-24 15:44:25 +08:00
itemProps: {
validateStatus: oe.errors.length > 0 ? "error" : "success",
tooltip: g,
help: oe.errors.length > 0 ? oe.errors.join("、") : null,
2024-06-28 09:26:11 +08:00
required: ((x = G == null ? void 0 : G[0]) == null ? void 0 : x.required) || !1,
...W
2024-06-24 15:44:25 +08:00
},
fieldProps: { ...z, ...D },
2024-06-28 09:26:11 +08:00
$setting: a || {}
2024-06-24 15:44:25 +08:00
}
);
}
}
);
2024-06-28 09:26:11 +08:00
}, Rt = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => {
const o = At(r, Qt, "@pkg/grid-layout-forms");
return /* @__PURE__ */ f(jt, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ f("div", { className: "ff-grid-layout-form", style: {
2024-06-24 15:44:25 +08:00
"--grid-layout-item-margin-x": `${(n == null ? void 0 : n[0]) || 0}px`,
"--grid-layout-item-margin-y": `${(n == null ? void 0 : n[1]) || 0}px`,
"--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`,
"--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`,
"--grid-layout-cols": e || 24,
"--grid-layout-row-height": `${t || 16}px`
}, children: o }) });
};
2024-06-28 09:26:11 +08:00
Rt.propTypes = {
2024-06-24 15:44:25 +08:00
fields: S.array.isRequired
};
2024-06-28 09:26:11 +08:00
Rt.defaultProps = {
2024-06-24 15:44:25 +08:00
fields: []
};
2024-06-28 09:26:11 +08:00
const us = ss(Rt), qt = ({ children: e }) => {
const [t, n] = k({}), s = _((o, i) => n((c) => ({ ...c, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []);
return /* @__PURE__ */ f(Xe.Provider, { value: { ele: t, mount: s, unmount: r }, children: e });
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
qt.defaultProps = {
2024-06-24 15:44:25 +08:00
isDrawerRender: !1
};
2024-06-28 09:26:11 +08:00
qt.propTypes = {
2024-06-24 15:44:25 +08:00
isDrawerRender: S.bool
};
2024-06-28 09:26:11 +08:00
const _t = (e = {}, t = {}, n = {}, s = "") => d.deepSome(e, (r, o) => o === "type" && r === "code") ? en(e, t, n, s) : tn(e, t, s), en = async (e = {}, t = {}, n = {}, s = "") => {
2024-06-24 15:44:25 +08:00
let r = /* @__PURE__ */ Object.create(null);
for (let o in e) {
let i;
if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) {
2024-06-28 09:26:11 +08:00
const { type: c, value: l = "", default: a = s } = e[o];
switch (c) {
2024-06-24 15:44:25 +08:00
case "code":
2024-06-28 09:26:11 +08:00
i = await ke.exec(l, t, n);
2024-06-24 15:44:25 +08:00
break;
case "field":
2024-06-28 09:26:11 +08:00
i = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1));
2024-06-24 15:44:25 +08:00
break;
case "router":
case "query":
2024-06-28 09:26:11 +08:00
i = Re.getPageParams(l);
2024-06-24 15:44:25 +08:00
break;
case "string":
i = l;
}
2024-06-28 09:26:11 +08:00
i ?? (i = a);
2024-06-24 15:44:25 +08:00
} else
2024-06-28 09:26:11 +08:00
i = await en(e[o], t, n, s);
d.set(r, o, i);
2024-06-24 15:44:25 +08:00
}
return r;
2024-06-28 09:26:11 +08:00
}, tn = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((s, r) => {
if (d.isPlainObject(e[r])) {
2024-06-24 15:44:25 +08:00
let o;
if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) {
2024-06-28 09:26:11 +08:00
const { type: i, value: c = "", default: l = n } = e[r];
2024-06-24 15:44:25 +08:00
switch (i) {
case "field":
2024-06-28 09:26:11 +08:00
o = d.get(t, c) ?? d.get(t, c.substring(c.indexOf(".") + 1));
2024-06-24 15:44:25 +08:00
break;
case "router":
case "query":
2024-06-28 09:26:11 +08:00
o = Re.getPageParams(c);
2024-06-24 15:44:25 +08:00
break;
case "string":
2024-06-28 09:26:11 +08:00
o = c;
2024-06-24 15:44:25 +08:00
break;
}
o ?? (o = l);
} else
2024-06-28 09:26:11 +08:00
o = tn(e[r], t, n);
d.set(s, r, o);
2024-06-24 15:44:25 +08:00
}
return s;
2024-06-28 09:26:11 +08:00
}, {}), ds = ({
2024-06-24 15:44:25 +08:00
className: e,
itemClassName: t,
classNames: n,
dataSource: s,
isPaginate: r,
pageSize: o,
isItemOperations: i,
2024-06-28 09:26:11 +08:00
isBatchOperations: c,
2024-06-24 15:44:25 +08:00
batchOperations: l,
2024-06-28 09:26:11 +08:00
itemOperations: a,
2024-06-24 15:44:25 +08:00
itemOperationsAccess: p,
resource: g,
primaryKey: m,
title: h,
itemGridLayout: y,
$setting: b,
2024-06-28 09:26:11 +08:00
isTreeSider: N,
treeSiderConfig: w
2024-06-24 15:44:25 +08:00
}) => {
2024-06-28 09:26:11 +08:00
const { getBase62params: $, onClickCallback: E } = De(Ze), { total: Q, page: M } = $() || {}, G = _((W, z, O) => /* @__PURE__ */ f(
fs,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
className: T("ff-data-list-framework-item", t),
operations: i && z ? a == null ? void 0 : a.filter((D) => !m || !D.uuid || !p.has(D.uuid) ? !0 : p.get(D.uuid).includes(z == null ? void 0 : z[m])) : [],
2024-06-24 15:44:25 +08:00
data: g ? { [g]: z } : z,
2024-06-28 09:26:11 +08:00
children: W,
onClickCallback: E
2024-06-24 15:44:25 +08:00
}
2024-06-28 09:26:11 +08:00
), [g, m, i, E, a, p]);
return /* @__PURE__ */ Z("div", { className: T("ff-data-list-framework", e), children: [
/* @__PURE__ */ f(Ft, { className: n == null ? void 0 : n.sider, isTreeSider: N, ...w }),
/* @__PURE__ */ Z("div", { className: T("ff-data-list-container", n == null ? void 0 : n.container), children: [
/* @__PURE__ */ f(sn, { className: n == null ? void 0 : n.filter }),
/* @__PURE__ */ f(rn, { title: h, className: n == null ? void 0 : n.toolbar }),
/* @__PURE__ */ f(
ln,
2024-06-24 15:44:25 +08:00
{
...y,
className: n == null ? void 0 : n.content,
style: { "--col-num": (b == null ? void 0 : b.colNum) || 1 },
primaryKey: m,
itemRender: G,
dataSource: s
}
),
2024-06-28 09:26:11 +08:00
/* @__PURE__ */ f(
on,
2024-06-24 15:44:25 +08:00
{
className: n == null ? void 0 : n.footer,
isPaginate: r,
2024-06-28 09:26:11 +08:00
isOperations: c,
2024-06-24 15:44:25 +08:00
operations: l,
total: Q,
page: M,
pageSize: o
}
)
] })
] });
2024-06-28 09:26:11 +08:00
}, fs = ({ className: e, operations: t, children: n, data: s, onClickCallback: r }) => /* @__PURE__ */ Z("div", { className: T("data-list-grid-layout-item-container", e), children: [
2024-06-24 15:44:25 +08:00
n,
2024-06-28 09:26:11 +08:00
!!(t != null && t.length) && /* @__PURE__ */ f("div", { className: "data-list-grid-layout-item-actions", children: t.map((o) => /* @__PURE__ */ f("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
C.Link,
{
2024-06-28 09:26:11 +08:00
uuid: o.uuid,
type: o.type,
name: o.name,
widget: o.widget,
widgetType: o.widgetType,
widgetProps: o.widgetProps,
widgetSetting: o.widgetSetting,
widgetContainerProps: o.widgetContainerSetting,
2024-06-24 15:44:25 +08:00
data: s,
2024-06-28 09:26:11 +08:00
onAfterClick: (i) => i !== !1 && (r == null ? void 0 : r(o.isRefresh, s))
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
o.uuid || useId()
) }, (o == null ? void 0 : o.uuid) || useId())) })
] }), ps = ({
2024-06-24 15:44:25 +08:00
className: e,
itemClassName: t,
dataSource: n,
columns: s,
isItemOperations: r,
isBatchOperations: o,
batchOperations: i,
2024-06-28 09:26:11 +08:00
itemOperations: c,
2024-06-24 15:44:25 +08:00
itemOperationsAccess: l,
2024-06-28 09:26:11 +08:00
resource: a,
2024-06-24 15:44:25 +08:00
primaryKey: p,
title: g,
isPaginate: m,
pageSize: h,
isTreeSider: y,
treeSiderConfig: b,
2024-06-28 09:26:11 +08:00
...N
2024-06-24 15:44:25 +08:00
}) => {
2024-06-28 09:26:11 +08:00
const { getBase62params: w, onClickCallback: $ } = De(Ze), { total: E, page: Q } = w() || {};
return /* @__PURE__ */ Z("div", { className: T("ff-data-table-framework", e), children: [
/* @__PURE__ */ f(Ft, { isTreeSider: y, ...b }),
/* @__PURE__ */ Z("div", { className: "ff-data-table-container", children: [
/* @__PURE__ */ f(sn, {}),
/* @__PURE__ */ f(rn, { title: g }),
/* @__PURE__ */ f(
cn,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
...N,
2024-06-24 15:44:25 +08:00
className: "ff-data-table-content",
columns: s,
dataSource: n,
2024-06-28 09:26:11 +08:00
operationRender: (M) => /* @__PURE__ */ f("div", { className: "ff-data-table-actions", children: c == null ? void 0 : c.reduce((G, W, z) => [
2024-06-24 15:44:25 +08:00
...G,
2024-06-28 09:26:11 +08:00
/* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
C.Link,
{
size: "small",
2024-06-28 09:26:11 +08:00
uuid: W.uuid,
type: W.type,
name: W.name,
widget: W.widget,
widgetType: W.widgetType,
widgetProps: W.widgetProps,
widgetSetting: W.widgetSetting,
widgetContainerProps: W.widgetContainerSetting,
2024-06-24 15:44:25 +08:00
data: M,
2024-06-28 09:26:11 +08:00
onAfterClick: (O) => O !== !1 && ($ == null ? void 0 : $(W.isRefresh, data))
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
W.uuid || z
2024-06-24 15:44:25 +08:00
)
], []) })
}
),
2024-06-28 09:26:11 +08:00
/* @__PURE__ */ f(
on,
2024-06-24 15:44:25 +08:00
{
isPaginate: m,
isOperations: o,
operations: i,
2024-06-28 09:26:11 +08:00
total: E,
2024-06-24 15:44:25 +08:00
page: Q,
pageSize: h
}
)
] })
] });
}, Ze = v.createContext({
getBase62params: (e, t) => {
},
onReload: () => {
},
onClickCallback: () => {
},
onConditonChange: () => {
},
onTabChange: () => {
},
onSiderChange: () => {
},
onKeywordChange: () => {
},
onPageChange: () => {
},
onPageSizeChange: () => {
}
2024-06-28 09:26:11 +08:00
}), nn = ({
2024-06-24 15:44:25 +08:00
isItemGridLayout: e,
theme: t,
themeProps: n,
onClickCallback: s,
onReload: r,
getBase62params: o,
onPageChange: i,
2024-06-28 09:26:11 +08:00
onPageSizeChange: c,
2024-06-24 15:44:25 +08:00
onTabChange: l,
2024-06-28 09:26:11 +08:00
onSiderChange: a,
2024-06-24 15:44:25 +08:00
onKeywordChange: p,
onConditonChange: g,
...m
}) => {
const [h, y] = k();
2024-06-28 09:26:11 +08:00
return L(() => {
2024-06-24 15:44:25 +08:00
t ? J.getWidgetComponent(t).then((b) => {
if (!b)
throw `${t} not found`;
return b;
}).catch((b) => ({ default: () => `${b}` })).then((b) => y(v.createElement(b.default, { ...m, $setting: n }))) : h || y(null);
2024-06-28 09:26:11 +08:00
}, [t, n]), /* @__PURE__ */ f(Ze.Provider, { value: {
2024-06-24 15:44:25 +08:00
onClickCallback: s,
onReload: r,
getBase62params: o,
onPageChange: i,
2024-06-28 09:26:11 +08:00
onPageSizeChange: c,
2024-06-24 15:44:25 +08:00
onTabChange: l,
2024-06-28 09:26:11 +08:00
onSiderChange: a,
2024-06-24 15:44:25 +08:00
onKeywordChange: p,
onConditonChange: g
2024-06-28 09:26:11 +08:00
}, children: h ? v.cloneElement(h, { ...m, $setting: n }) : e ? /* @__PURE__ */ f(ds, { ...m, $setting: n }) : /* @__PURE__ */ f(ps, { ...m, $setting: n }) });
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
nn.defaultProps = {
2024-06-24 15:44:25 +08:00
onReload: () => {
},
getBase62params: () => {
}
};
2024-06-28 09:26:11 +08:00
const hs = (e, t, n, s, r) => {
2024-06-24 15:44:25 +08:00
const o = v.lazy(() => J.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })));
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(v.Suspense, { children: /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
o,
{
value: t,
record: n,
$setting: s,
base62params: r
}
) }, e);
2024-06-28 09:26:11 +08:00
}, gs = (e, t = {}) => (Gt(e), Gt(t), le(() => e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? {
2024-06-24 15:44:25 +08:00
...o,
2024-06-28 09:26:11 +08:00
render: (c, l) => {
const a = hs(s, c, l, r, t);
return d.isFunction(o == null ? void 0 : o.render) ? o.render(a, c, l) : a;
2024-06-24 15:44:25 +08:00
}
2024-06-28 09:26:11 +08:00
} : o), [e, t])), ar = (e) => {
2024-06-24 15:44:25 +08:00
const [t, n] = k({});
2024-06-28 09:26:11 +08:00
return L(() => {
2024-06-24 15:44:25 +08:00
let s = !1;
2024-06-28 09:26:11 +08:00
return e && I.get(`/api/_/${e}`).then((r) => d.pick(r, [
2024-06-24 15:44:25 +08:00
"uuid",
"name",
"code",
"resource",
"marginX",
"marginY",
"cols",
"rowHeight",
"primaryKey",
"columns",
"itemOperations",
"batchOperations",
"isConditionFormLayout",
"layout",
"tabs",
"pageSize",
"layoutConfig"
])).then((r) => !s && n(r)), () => s = !0;
}, [e]), t;
2024-06-28 09:26:11 +08:00
}, cr = (e, t = {}) => {
2024-06-24 15:44:25 +08:00
const [n, s] = k({ dataSource: [] });
2024-06-28 09:26:11 +08:00
return lt(() => {
2024-06-24 15:44:25 +08:00
let r = !1;
return e && I.get(`/api/${e}/${I.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0;
}, [e, t]), n;
2024-06-28 09:26:11 +08:00
}, $t = (e, t = null, n = null, s = "id") => le(() => {
if (d.isEmpty(e) || !e.every(({ uuid: o }) => Vs.check(o)))
2024-06-24 15:44:25 +08:00
return !1;
2024-06-28 09:26:11 +08:00
if (d.isEmpty(n) || d.isEmpty(t))
2024-06-24 15:44:25 +08:00
return !0;
const r = t.map((o) => o == null ? void 0 : o[s]);
return e.some(({ uuid: o }) => !o || !n.has(o) ? !0 : n.get(o).some((i) => r.includes(i)));
2024-06-28 09:26:11 +08:00
}, [e, t, n, s]), kt = v.forwardRef(({ listCode: e, base62params: t, className: n, itemClassName: s, theme: r, themeProps: o, classNames: i }, c) => {
const [{ tab: l, page: a, total: p, condition: g, sider: m, keyword: h, dataSource: y, itemOperationsAccess: b, pageSize: N }, w] = qn(t), [{
resource: $,
primaryKey: E,
batchOperations: Q = [],
itemOperations: M = [],
columns: G = [],
themeConfig: W,
theme: z,
isTreeSider: O,
treeSiderConfig: D,
isItemGridLayout: oe,
itemGridLayout: X,
title: x,
isPaginate: ut
}, je] = k({ isItemGridLayout: !1, itemGridLayout: {} }), Fe = (j) => I.list(e, { tab: l, page: a, total: p, condition: g, sider: m, keyword: h, ...j }).then(({
2024-06-24 15:44:25 +08:00
condition: H,
2024-06-28 09:26:11 +08:00
total: ue,
2024-06-24 15:44:25 +08:00
tab: Ve,
2024-06-28 09:26:11 +08:00
page: de,
2024-06-24 15:44:25 +08:00
pageSize: Le,
operationsAccess: ie,
dataSource: B
}) => {
2024-06-28 09:26:11 +08:00
w({
2024-06-24 15:44:25 +08:00
dataSource: B,
pageSize: Le,
2024-06-28 09:26:11 +08:00
total: ue,
page: de,
2024-06-24 15:44:25 +08:00
tab: Ve,
condition: H,
2024-06-28 09:26:11 +08:00
sider: m,
keyword: h,
2024-06-24 15:44:25 +08:00
itemOperationsAccess: new Map(ie)
});
2024-06-28 09:26:11 +08:00
}), Et = $t(M, y, b, E), pn = $t(Q);
L(() => {
let j = null;
return e && I.get(`/api/_/${e}`).resp(({ data: H, res: ue }) => {
H != null && H.isDynamicRefresh && (j = Ht.subscribe(() => Fe(), ue)), je(H);
}).catch(() => je({})), w((H) => ({ ...H, dataSource: [] })), () => j == null ? void 0 : j();
}, [e]), L(() => {
e && Fe(t);
2024-06-24 15:44:25 +08:00
}, [t]);
2024-06-28 09:26:11 +08:00
const hn = () => {
}, gn = () => {
}, mn = () => {
}, yn = () => {
}, bn = (j, H) => Fe({ page: j, pageSize: H }), vn = (j) => Fe({ pageSize: j, page: 1 }), Cn = (j, H) => {
const ue = { tab: l, sider: m, keyword: h, page: a, pageSize: N, condition: g, total: p };
return j ? d.get(ue, j, H) : ue;
}, tt = () => {
Fe();
}, Wt = (j = 0, H = null) => {
if (j === 2) {
const ue = d.get(H, "__PARENT_ID__", ""), Ve = d.get(H, E, d.get(H, [$, E], "")), de = d.findIndex(y, ["__PARENT_ID__", ue]), Le = d.findIndex(de > -1 ? d.get(y, [de, "children"]) : y, [E, Ve]);
2024-06-24 15:44:25 +08:00
Le > -1 ? (I.get(`/api/${e}/detail/${Ve}`).then((ie) => {
2024-06-28 09:26:11 +08:00
w((B) => {
const Ne = d.get(B.dataSource, de > -1 ? [de, "children", Le, "children"] : [Le, "children"]);
2024-06-24 15:44:25 +08:00
return {
...B,
2024-06-28 09:26:11 +08:00
dataSource: de > -1 ? Tt(B.dataSource, { [de]: { children: { $splice: [[Le, 1, { ...ie, children: Ne }]] } } }) : Tt(B.dataSource, { $splice: [[Le, 1, { ...ie, children: Ne }]] })
2024-06-24 15:44:25 +08:00
};
});
}), I.post(`/api/${e}/list-operations-access`, { ids: Ve }).then((ie) => new Map(ie)).then((ie) => {
2024-06-28 09:26:11 +08:00
w((B) => (B.itemOperationsAccess.forEach((Ne, Ie) => {
2024-06-24 15:44:25 +08:00
var Pt;
2024-06-28 09:26:11 +08:00
(Pt = ie.get(Ie)) != null && Pt.some((dt) => dt == Ve) || B.itemOperationsAccess.set(Ie, Ne.filter((dt) => dt !== Ve));
2024-06-24 15:44:25 +08:00
}), ie.forEach((Ne, Ie) => {
2024-06-28 09:26:11 +08:00
B.itemOperationsAccess.has(Ie) ? B.itemOperationsAccess.set(Ie, d.uniq([...B.itemOperationsAccess.get(Ie) || [], ...Ne])) : B.itemOperationsAccess.set(Ie, Ne);
2024-06-24 15:44:25 +08:00
}), { ...B }));
2024-06-28 09:26:11 +08:00
})) : tt();
2024-06-24 15:44:25 +08:00
} else
2024-06-28 09:26:11 +08:00
j === 1 && tt();
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
return v.useImperativeHandle(c, () => ({
onReload: tt,
onClickCallback: Wt
})), /* @__PURE__ */ f(
nn,
2024-06-24 15:44:25 +08:00
{
...{
2024-06-28 09:26:11 +08:00
title: x,
2024-06-24 15:44:25 +08:00
itemClassName: s,
classNames: i,
2024-06-28 09:26:11 +08:00
resource: $,
primaryKey: E,
theme: r || z,
themeProps: o || W,
isPaginate: ut,
pageSize: N,
page: a,
isTreeSider: O,
treeSiderConfig: D,
isItemOperations: Et,
isBatchOperations: pn,
batchOperations: Q,
itemOperations: M,
itemOperationsAccess: b,
dataSource: y,
isItemGridLayout: oe,
columns: G,
itemGridLayout: X
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
className: T("ff-data-list-helper", n),
getBase62params: Cn,
onReload: tt,
onClickCallback: Wt,
onConditonChange: hn,
onTabChange: gn,
onSiderChange: mn,
onKeywordChange: yn,
onPageChange: bn,
onPageSizeChange: vn
2024-06-24 15:44:25 +08:00
}
);
2024-06-28 09:26:11 +08:00
}), sn = ({ className: e }) => (v.useContext(Ze), /* @__PURE__ */ Z("div", { className: T("ff-data-list-filter", e), children: [
/* @__PURE__ */ f(
Tn,
2024-06-24 15:44:25 +08:00
{
placeholder: "关键字",
style: { width: "30%", maxWidth: 300 },
2024-06-28 09:26:11 +08:00
prefix: /* @__PURE__ */ f(Ct, { type: "icon-search" })
2024-06-24 15:44:25 +08:00
}
),
2024-06-28 09:26:11 +08:00
/* @__PURE__ */ Z("div", { className: "ff-data-list-actions", children: [
/* @__PURE__ */ f(C, { children: "重置" }),
/* @__PURE__ */ f(C, { type: "primary", children: "查询" }),
/* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
C.Link,
{
className: "ff-data-list-filter-submit-button",
type: "primary",
name: "展开",
icon: "icon-down",
iconPosition: "end"
}
)
] })
2024-06-28 09:26:11 +08:00
] })), ms = [
2024-06-24 15:44:25 +08:00
{ title: "全部", className: "active" },
{ title: "运行中" },
{ title: "已上线" }
2024-06-28 09:26:11 +08:00
], rn = ({ className: e, title: t }) => /* @__PURE__ */ Z("div", { className: T("ff-data-list-toolbar", e), children: [
/* @__PURE__ */ f("div", { className: "ff-data-list-title", children: t }),
/* @__PURE__ */ f(Gn, { className: "ff-data-list-tabs", items: ms }),
/* @__PURE__ */ Z("div", { className: "ff-data-list-actions", children: [
/* @__PURE__ */ f(C.Link, { icon: "icon-reload" }),
/* @__PURE__ */ f(C.Link, { icon: "icon-setting" })
2024-06-24 15:44:25 +08:00
] })
2024-06-28 09:26:11 +08:00
] }), ys = [
2024-06-24 15:44:25 +08:00
{
title: "parent 1",
key: "0-0",
children: [
{
title: "parent 1-0",
key: "0-0-0",
disabled: !0,
children: [
{
title: "leaf",
key: "0-0-0-0",
disableCheckbox: !0
},
{
title: "leaf",
key: "0-0-0-1"
}
]
},
{
title: "parent 1-1",
key: "0-0-1",
children: [
{
2024-06-28 09:26:11 +08:00
title: /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
"span",
{
style: {
color: "#1677ff"
},
children: "sss"
}
),
key: "0-0-1-0"
}
]
}
]
}
2024-06-28 09:26:11 +08:00
], Ft = ({ className: e, width: t, isTreeSider: n }) => n ? /* @__PURE__ */ f(
Sn.DirectoryTree,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
className: T("ff-data-list-sider", e),
2024-06-24 15:44:25 +08:00
style: { "--sider-width": t },
showLine: !0,
showIcon: !1,
2024-06-28 09:26:11 +08:00
treeData: ys
2024-06-24 15:44:25 +08:00
}
) : null;
2024-06-28 09:26:11 +08:00
Ft.defaultProps = {
2024-06-24 15:44:25 +08:00
width: 280
};
2024-06-28 09:26:11 +08:00
const on = ({ className: e, operations: t, isOperations: n, isPaginate: s, total: r, page: o, pageSize: i }) => {
const { onPageChange: c, onPageSizeChange: l, onClickCallback: a } = v.useContext(Ze);
return n && !d.isEmpty(t) || s ? /* @__PURE__ */ Z("div", { className: T("ff-data-list-footer", e), children: [
/* @__PURE__ */ f("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, g) => /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
C,
{
uuid: p.uuid,
type: p.type,
name: p.name,
widget: p.widget,
widgetType: p.widgetType,
widgetProps: p.widgetProps,
widgetSetting: p.widgetSetting,
widgetContainerProps: p.widgetContainerSetting,
2024-06-28 09:26:11 +08:00
onAfterClick: (m) => m !== !1 && (a == null ? void 0 : a(p.isRefresh, null))
2024-06-24 15:44:25 +08:00
},
p.uuid || g
)) }),
2024-06-28 09:26:11 +08:00
s && /* @__PURE__ */ f(
$n,
2024-06-24 15:44:25 +08:00
{
size: "small",
total: r,
pageSize: i,
showSizeChanger: !1,
showTotal: (p) => `${o} 页 / 总共 ${p}`,
2024-06-28 09:26:11 +08:00
onChange: c,
2024-06-24 15:44:25 +08:00
onShowSizeChange: l
}
)
] }) : null;
2024-06-28 09:26:11 +08:00
}, an = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : d.isArray(e) && !d.isEmpty(e) ? e.reduce((s, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && s.push(r[t]), Reflect.has(r, "children") && !d.isEmpty(r.children) ? s.concat(an(r.children, t, n)) : s), []) : [], cn = ({
2024-06-24 15:44:25 +08:00
className: e,
primaryKey: t,
columns: n,
dataSource: s,
operationRender: r,
operationWidth: o,
...i
}) => {
2024-06-28 09:26:11 +08:00
const c = K(null), l = K(null), [a, p] = k([]), [g, m] = k({ width: 0, height: 0 });
L(() => {
p(an(s, t));
}, [s, t]), Fn(() => {
2024-06-24 15:44:25 +08:00
const y = new ResizeObserver(() => {
var b;
m({
2024-06-28 09:26:11 +08:00
width: ((b = c.current) == null ? void 0 : b.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth,
2024-06-24 15:44:25 +08:00
height: l.current.offsetHeight
});
});
return l.current && y.observe(l.current), () => {
l.current && y.unobserve(l.current);
};
}, []);
2024-06-28 09:26:11 +08:00
const h = gs(n);
return /* @__PURE__ */ f("div", { ref: l, className: T("ff-data-list-table", e), children: g.height ? /* @__PURE__ */ f(
zn,
2024-06-24 15:44:25 +08:00
{
...i,
2024-06-28 09:26:11 +08:00
ref: c,
2024-06-24 15:44:25 +08:00
rowKey: (y, b) => (y == null ? void 0 : y[t]) ?? b,
columns: h == null ? void 0 : h.concat(r ? [{
title: "操作",
align: "center",
fixed: "right",
width: `${Math.ceil(o / g.width * 100).toFixed(2)}%`,
2024-06-28 09:26:11 +08:00
render: (y, b, N) => r(b, N)
2024-06-24 15:44:25 +08:00
}] : []),
dataSource: s,
size: "middle",
scroll: { x: "max-content", y: g.height - 47 },
pagination: !1,
expandable: {
defaultExpandAllRows: !0,
expandRowByClick: !0,
onExpandedRowsChange: p,
2024-06-28 09:26:11 +08:00
expandedRowKeys: a
2024-06-24 15:44:25 +08:00
}
}
) : null });
};
2024-06-28 09:26:11 +08:00
cn.defaultProps = {
2024-06-24 15:44:25 +08:00
operationWidth: 180,
columns: [],
dataSource: []
};
2024-06-28 09:26:11 +08:00
const bs = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => {
2024-06-24 15:44:25 +08:00
const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = k();
2024-06-28 09:26:11 +08:00
return L(() => {
r && J.getWidgetComponent(r).then(({ defaultProps: c, default: l }) => ({
default: vs(l, c, n)
})).catch((c) => ({ default: () => `${c}` })).then((c) => i(v.createElement(c.default, s)));
2024-06-24 15:44:25 +08:00
}, [r]), o;
2024-06-28 09:26:11 +08:00
}, vs = (e, t, n = null) => (s) => {
2024-06-24 15:44:25 +08:00
const {
code: r,
label: o,
extras: i,
2024-06-28 09:26:11 +08:00
isVirtual: c,
2024-06-24 15:44:25 +08:00
initialValue: l,
2024-06-28 09:26:11 +08:00
initialValueLanguage: a,
2024-06-24 15:44:25 +08:00
convertJs: p,
convertJsSetting: g,
value: m,
...h
2024-06-28 09:26:11 +08:00
} = d.merge({}, t, s), [y, b] = Kt(c ? null : r, {
2024-06-24 15:44:25 +08:00
initialValue: l,
2024-06-28 09:26:11 +08:00
initialValueLanguage: a,
2024-06-24 15:44:25 +08:00
convertJs: p,
convertJsSetting: g,
type: (h == null ? void 0 : h.type) || "string"
}, n);
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(e, { ...h, value: y, rawValue: b, $setting: i || {} });
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
bs.defaultProps = {
2024-06-24 15:44:25 +08:00
widgetPrefix: "@pkg/grid-layouts"
};
2024-06-28 09:26:11 +08:00
const ln = ({
2024-06-24 15:44:25 +08:00
cols: e,
rowHeight: t,
itemMargin: n,
fields: s,
primaryKey: r,
itemRender: o,
dataSource: i,
2024-06-28 09:26:11 +08:00
itemClassName: c,
2024-06-24 15:44:25 +08:00
empty: l,
2024-06-28 09:26:11 +08:00
className: a,
2024-06-24 15:44:25 +08:00
style: p
}) => {
2024-06-28 09:26:11 +08:00
const g = Vn(), m = le(() => /* @__PURE__ */ f(
Mt,
2024-06-24 15:44:25 +08:00
{
cols: e,
rowHeight: t,
itemMargin: n,
fields: s,
2024-06-28 09:26:11 +08:00
className: c
2024-06-24 15:44:25 +08:00
}
), [s, e, t, n]);
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f("div", { className: T("ff-data-list-content", a), style: p, children: d.isEmpty(i) ? l : i == null ? void 0 : i.map((h, y) => /* @__PURE__ */ f(v.Fragment, { children: o(v.cloneElement(m, { data: h }), h, y) }, `${g}-${(h == null ? void 0 : h[r]) || y}`)) });
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
ln.defaultProps = {
2024-06-24 15:44:25 +08:00
itemRender: (e, t, n) => e,
2024-06-28 09:26:11 +08:00
empty: /* @__PURE__ */ f(On, { description: null }),
2024-06-24 15:44:25 +08:00
style: {}
};
2024-06-28 09:26:11 +08:00
const Cs = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => Re.redirect(t, e, { replace: n }), zt = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => {
2024-06-24 15:44:25 +08:00
const o = {
2024-06-28 09:26:11 +08:00
loading: (i) => i === void 0 ? n : r((c) => ({ ...c, loading: i })),
disabled: (i) => i === void 0 ? s : r((c) => ({ ...c, disabled: i }))
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
return d.isFunction(t) ? t.call(null, { ...e, ...o }) : d.isString(t) && t ? ke.exec(t, e, o) : null;
}, Ot = (e, t, n, s) => d.isString(t) && t ? J.getWidgetComponent(t).then(({ default: r }) => V.modal(
r,
{ ...e, $setting: n },
s
)).catch((r) => {
V.error(t, { content: r.toString() });
}) : V.modal(
2024-06-24 15:44:25 +08:00
t,
2024-06-28 09:26:11 +08:00
{ ...e, $setting: n },
2024-06-24 15:44:25 +08:00
s
2024-06-28 09:26:11 +08:00
), Rs = (e, t, n, s) => V.modal(
un,
2024-06-24 15:44:25 +08:00
{ ...e, $setting: n, code: t },
s
2024-06-28 09:26:11 +08:00
), ks = (e, t, n, s) => V.modal(
kt,
2024-06-24 15:44:25 +08:00
{ base62params: e, $setting: n, listCode: t },
s
2024-06-28 09:26:11 +08:00
), Fs = ({
2024-06-24 15:44:25 +08:00
widget: e,
widgetType: t,
widgetData: n,
widgetProps: s,
widgetSetting: r,
widgetContainerProps: o
2024-06-28 09:26:11 +08:00
}, { onAfterClick: i, onBeforeClick: c }) => {
2024-06-24 15:44:25 +08:00
const l = De(Ze);
2024-06-28 09:26:11 +08:00
De(dn);
const [a, p] = k({ leading: !0, trailing: !1 }), g = le(() => {
2024-06-24 15:44:25 +08:00
switch (t) {
case "redirect":
2024-06-28 09:26:11 +08:00
return d.partialRight(Cs, e, r);
2024-06-24 15:44:25 +08:00
case "func":
2024-06-28 09:26:11 +08:00
return d.partialRight(zt, (r == null ? void 0 : r.code) ?? e, { status: a, setStatus: p });
2024-06-24 15:44:25 +08:00
case "fsdpf-component":
2024-06-28 09:26:11 +08:00
return d.partialRight(Ot, e, r, o);
2024-06-24 15:44:25 +08:00
case "grid-layout-form":
2024-06-28 09:26:11 +08:00
return d.partialRight(Rs, e, r, o);
2024-06-24 15:44:25 +08:00
case "data-list":
2024-06-28 09:26:11 +08:00
return d.partialRight(ks, e, r, o);
2024-06-24 15:44:25 +08:00
default:
2024-06-28 09:26:11 +08:00
if (wt(e) || v.isValidElement(e))
return d.partialRight(Ot, e, r, o);
if (d.isFunction(e))
return d.partialRight(zt, (r == null ? void 0 : r.code) || e, { status: a, setStatus: p });
2024-06-24 15:44:25 +08:00
}
return (...h) => console.error("useButton unknown widgetType", t, ...h);
}, [e, t]);
2024-06-28 09:26:11 +08:00
return [d.debounce((h) => (c == null || c(h), Promise.resolve(_t(s, h, { list: l })).then((y) => g({ ...n, ...y })).then((y) => i == null ? void 0 : i(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), a];
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
var pe, Se;
2024-06-24 15:44:25 +08:00
const te = class te {
constructor() {
R(this, Se, null);
2024-06-28 09:26:11 +08:00
F(this, "init", (t) => U(this, Se, new Map(t)));
F(this, "check", (t) => !u(this, Se).has(t) || u(this, Se).get(t));
if (u(te, pe))
return u(te, pe);
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
pe = new WeakMap(), Se = new WeakMap(), R(te, pe, null), F(te, "getInstance", () => (u(te, pe) || U(te, pe, new te()), u(te, pe)));
let pt = te;
const Vs = pt.getInstance(), et = (e) => function({
2024-06-24 15:44:25 +08:00
className: n,
children: s,
name: r,
icon: o,
type: i,
2024-06-28 09:26:11 +08:00
data: c,
2024-06-24 15:44:25 +08:00
noAuthType: l,
2024-06-28 09:26:11 +08:00
onAfterClick: a,
2024-06-24 15:44:25 +08:00
onBeforeClick: p,
loading: g,
disabled: m,
tooltip: h,
popConfirm: y,
widget: b,
2024-06-28 09:26:11 +08:00
widgetType: N,
widgetData: w,
widgetProps: $,
widgetSetting: E,
2024-06-24 15:44:25 +08:00
widgetContainerProps: Q,
...M
}) {
const G = {
type: "primary",
2024-06-28 09:26:11 +08:00
className: T("ff-button", n)
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
i === "danger" ? G.danger = !0 : i === "default" && (G.type = i), e === "link" || e === "dashed" ? (G.type = e, i === "default" && (G.className = T(G.className, "ff-default"))) : (e === "circle" || e === "round") && (G.shape = e), o && (G.icon = /* @__PURE__ */ f(Ct, { type: o }));
const [W, z] = k(!1), [O, { disabled: D, loading: oe }] = Fs({ widget: b, widgetType: N, widgetData: w, widgetProps: $, widgetSetting: E, widgetContainerProps: Q }, { onAfterClick: a, onBeforeClick: p });
return /* @__PURE__ */ f(
xn,
2024-06-24 15:44:25 +08:00
{
okText: "确定",
cancelText: "取消",
...y || {},
disabled: D || m,
2024-06-28 09:26:11 +08:00
open: W,
onOpenChange: (x) => {
if (!x)
return z(x);
y ? z(x) : O(c);
2024-06-24 15:44:25 +08:00
},
onConfirm: () => {
2024-06-28 09:26:11 +08:00
O(c);
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
onClick: (x) => {
x.stopPropagation();
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
children: /* @__PURE__ */ f(Un, { ...h, title: W ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: /* @__PURE__ */ f(
Dn,
2024-06-24 15:44:25 +08:00
{
loading: oe || g,
disabled: D || m,
...G,
...M,
children: s || r
}
) })
}
);
2024-06-28 09:26:11 +08:00
}, C = et("default"), Ls = et("link"), Ns = et("circle"), Is = et("round"), ws = et("dashed"), Vt = ({ data: e, widget: t, widgetType: n, children: s, widgetData: r, widgetProps: o, widgetSetting: i, widgetContainerProps: c }) => {
const l = De(Ze), [a, p] = k(!1), [g, m] = k("hover"), [h, y] = k({}), [b, N] = k();
L(() => {
n == "grid-layout-form" ? N(v.createElement(un, { ...r, $setting: i, code: t })) : n == "data-list" ? N(v.createElement(kt, { base62params: e, $setting: i, listCode: t })) : d.isString(t) ? J.getWidgetComponent(t).then(({ default: E }) => {
N(v.createElement(E, { ...r, $setting: i }));
}).catch((E) => N(E.toString())) : wt(t) ? N(v.createElement(t, { ...r, $setting: i })) : v.isValidElement(t) && N(v.cloneElement(t, { ...r, $setting: i }));
}, [t, n, r]), L(() => {
Promise.resolve(_t(o, e, { list: l })).then(y);
2024-06-24 15:44:25 +08:00
}, [o, e]);
2024-06-28 09:26:11 +08:00
const w = (E) => {
p(E), !E && m("hover");
}, $ = () => {
2024-06-24 15:44:25 +08:00
p(!0), m("click");
};
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(
Xn,
2024-06-24 15:44:25 +08:00
{
2024-06-28 09:26:11 +08:00
zIndex: 1e3,
...c,
onPopupClick: $,
onClick: $,
open: a,
2024-06-24 15:44:25 +08:00
trigger: g,
2024-06-28 09:26:11 +08:00
content: /* @__PURE__ */ f(Es, { children: b && v.cloneElement(b, { ...h, $close: () => w(!1) }) }),
2024-06-24 15:44:25 +08:00
children: s,
2024-06-28 09:26:11 +08:00
onOpenChange: w,
2024-06-24 15:44:25 +08:00
overlayClassName: "ff-popup ff-popover"
}
);
2024-06-28 09:26:11 +08:00
}, Es = ({ children: e }) => {
const [t, n] = k({}), s = _((o, i) => n((c) => ({ ...c, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []);
return /* @__PURE__ */ Z(Xe.Provider, { value: { ele: t, mount: s, unmount: r }, children: [
t != null && t.title || t != null && t["sub-title"] ? /* @__PURE__ */ Z("div", { className: "ff-popup-header", children: [
(t == null ? void 0 : t.title) || /* @__PURE__ */ f("div", { className: "ff-popup-title" }),
(t == null ? void 0 : t["sub-title"]) || /* @__PURE__ */ f("div", { className: "ff-popup-sub-title" })
2024-06-24 15:44:25 +08:00
] }) : null,
e,
2024-06-28 09:26:11 +08:00
t != null && t.extras || t != null && t.actions ? /* @__PURE__ */ Z("div", { className: "ff-popup-footer", children: [
(t == null ? void 0 : t.extras) || /* @__PURE__ */ f("div", { className: "ff-popup-extras" }),
(t == null ? void 0 : t.actions) || /* @__PURE__ */ f("div", { className: "ff-popup-actions" })
2024-06-24 15:44:25 +08:00
] }) : null
] });
};
2024-06-28 09:26:11 +08:00
Vt.defaultProps = {
2024-06-24 15:44:25 +08:00
widgetType: "fsdpf-component"
};
2024-06-28 09:26:11 +08:00
Vt.propTypes = {
2024-06-24 15:44:25 +08:00
widgetType: S.oneOf(["fsdpf-component", "grid-layout-form", "data-list"])
};
C.defaultProps = {
type: "default",
iconPosition: "start"
};
C.propTypes = {
type: S.oneOf(["primary", "default", "danger", ""]),
name: S.string,
// 按钮名称
icon: S.string,
// 图标
iconPosition: S.oneOf(["start", "end"]),
// 图标位置
data: S.any,
// onClick 数据源, 会受到 widgetProps 数据结构影响
widget: S.any,
// 组件
widgetType: S.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]),
// 组件类型
widgetData: S.object,
// onClick缺省数据
widgetProps: S.object,
// data 数据结构
widgetSetting: S.object,
// $setting
widgetContainerProps: S.object
// 容器配置
};
2024-06-28 09:26:11 +08:00
C.Link = Ls;
2024-06-24 15:44:25 +08:00
C.Link.defaultProps = C.defaultProps;
C.Link.propTypes = C.propTypes;
2024-06-28 09:26:11 +08:00
C.Circle = Ns;
2024-06-24 15:44:25 +08:00
C.Circle.defaultProps = C.defaultProps;
C.Circle.propTypes = C.propTypes;
2024-06-28 09:26:11 +08:00
C.Round = Is;
2024-06-24 15:44:25 +08:00
C.Round.defaultProps = C.defaultProps;
C.Round.propTypes = C.propTypes;
2024-06-28 09:26:11 +08:00
C.Dashed = ws;
2024-06-24 15:44:25 +08:00
C.Dashed.defaultProps = C.defaultProps;
C.Dashed.propTypes = C.propTypes;
2024-06-28 09:26:11 +08:00
C.Popover = Vt;
const un = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => {
const [i] = Me.useForm(), c = ts(s, r, e);
L(() => {
c && i.setFieldsValue(c);
}, [c]);
2024-06-24 15:44:25 +08:00
const l = () => {
2024-06-28 09:26:11 +08:00
const a = i.getFieldValue("__RESOURCE__"), {
2024-06-24 15:44:25 +08:00
initDataUri: p = `/api/${s}`
} = e || {};
2024-06-28 09:26:11 +08:00
i.validateFields(!0).then((g) => a ? d.pick(g, [a]) : g).then((g) => I.post(r ? `${p}/${r}` : `${p}`, g).msg(t)).catch(() => V.error("请先完善表单信息", { duration: 2e3 }));
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(
2024-06-24 15:44:25 +08:00
Y,
{
2024-06-28 09:26:11 +08:00
actions: /* @__PURE__ */ Z(v.Fragment, { children: [
/* @__PURE__ */ f(C, { name: "保存", type: "primary", widget: l }),
/* @__PURE__ */ f(C, { name: "取消", widget: () => t(!1) })
2024-06-24 15:44:25 +08:00
] }),
extras: n,
2024-06-28 09:26:11 +08:00
children: /* @__PURE__ */ f(us, { form: i, code: s, primaryKey: r, ...o })
2024-06-24 15:44:25 +08:00
}
);
2024-06-28 09:26:11 +08:00
}, Ws = (e, t, n = "children") => {
if (d.isEmpty(e))
2024-06-24 15:44:25 +08:00
return {};
2024-06-28 09:26:11 +08:00
const s = d.find(e, ["value", t]);
if (!d.isEmpty(s))
2024-06-24 15:44:25 +08:00
return s;
const r = e.length;
for (let o = 0; o < r; o++) {
2024-06-28 09:26:11 +08:00
const { [n]: i } = e[o], c = Ws(i, t, n);
if (!d.isEmpty(c))
return c;
2024-06-24 15:44:25 +08:00
}
return {};
}, Ps = ({ fields: e, formProps: t, $close: n }) => {
2024-06-28 09:26:11 +08:00
const [s] = Me.useForm(), r = () => s.validateFields(!0).then(n), o = le(() => [
2024-06-24 15:44:25 +08:00
{ name: "__PROPS__", value: t }
], [t]);
2024-06-28 09:26:11 +08:00
return /* @__PURE__ */ f(Y, { actions: /* @__PURE__ */ Z(v.Fragment, { children: [
/* @__PURE__ */ f(C, { name: "取消", widget: () => n(!1) }),
/* @__PURE__ */ f(C, { name: "确定", type: "primary", widget: () => r() })
] }), children: /* @__PURE__ */ f(jt, { theme: { components: { Form: { itemMarginBottom: 6 } } }, children: /* @__PURE__ */ f(Me, { fields: o, layout: "vertical", form: s, children: e == null ? void 0 : e.map(({ code: i, ...c }) => /* @__PURE__ */ f(Jt, { code: i, ...c }, i)) }) }) });
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
var st, $e, he, rt, ot, Ae, it, ze;
2024-06-24 15:44:25 +08:00
const Ge = class Ge extends v.Component {
constructor(n) {
super(n);
2024-06-28 09:26:11 +08:00
R(this, st, null);
2024-06-24 15:44:25 +08:00
R(this, $e, 0);
2024-06-28 09:26:11 +08:00
R(this, he, /* @__PURE__ */ new Map());
R(this, rt, (n) => new Promise((s) => {
const r = He(this, $e)._++;
u(this, he).set(r, v.createElement(Mn, {
2024-06-24 15:44:25 +08:00
...n,
key: r,
$close: (o) => u(this, ze).call(this, r, () => s(o))
})), this.forceUpdate();
}));
2024-06-28 09:26:11 +08:00
R(this, ot, (n, s) => new Promise((r) => {
const o = He(this, $e)._++;
u(this, he).set(o, v.createElement(An, {
2024-06-24 15:44:25 +08:00
...s,
content: n,
key: o,
$close: (i) => u(this, ze).call(this, o, () => r(i))
})), this.forceUpdate();
}));
2024-06-28 09:26:11 +08:00
R(this, Ae, (n, s, { mode: r, ...o } = {}) => new Promise((i) => {
const c = He(this, $e)._++, l = { current: null };
u(this, he).set(c, v.createElement(
r == "drawer" ? Jn : Qn,
2024-06-24 15:44:25 +08:00
{
ref: l,
2024-06-28 09:26:11 +08:00
key: c,
2024-06-24 15:44:25 +08:00
maskClosable: !1,
...o,
2024-06-28 09:26:11 +08:00
$close: (a) => u(this, ze).call(this, c, () => i(a))
2024-06-24 15:44:25 +08:00
},
v.createElement(n, {
...s,
2024-06-28 09:26:11 +08:00
$close: (a) => l.current.handleClose(a)
2024-06-24 15:44:25 +08:00
})
)), this.forceUpdate();
}));
2024-06-28 09:26:11 +08:00
R(this, it, (n, s = {}, r = {}) => u(this, Ae).call(this, Ps, { formProps: r, fields: n }, s).then((o) => {
if (o === !1)
throw !1;
return o;
}));
2024-06-24 15:44:25 +08:00
R(this, ze, (n, s) => {
2024-06-28 09:26:11 +08:00
u(this, he).delete(n), this.forceUpdate(s);
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
Ge.modal = u(this, Ae), Ge.notification = u(this, rt), Ge.confirm = u(this, ot), Ge.form = u(this, it);
2024-06-24 15:44:25 +08:00
}
componentWillUnmount() {
var n, s;
2024-06-28 09:26:11 +08:00
(s = (n = u(this, st)) == null ? void 0 : n[1]) == null || s.call(n);
2024-06-24 15:44:25 +08:00
}
render() {
2024-06-28 09:26:11 +08:00
const n = Array.from(u(this, he));
return /* @__PURE__ */ f(v.Fragment, { children: n.map(([s, r]) => r) });
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
st = new WeakMap(), $e = new WeakMap(), he = new WeakMap(), rt = new WeakMap(), ot = new WeakMap(), Ae = new WeakMap(), it = new WeakMap(), ze = new WeakMap();
let V = Ge;
V.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(Xt[s || "open"]({
2024-06-24 15:44:25 +08:00
...r,
2024-06-28 09:26:11 +08:00
icon: n ? /* @__PURE__ */ f(Ct, { type: n || "" }) : void 0,
2024-06-24 15:44:25 +08:00
message: e,
description: t
}));
2024-06-28 09:26:11 +08:00
V.success = (e, t = {}) => V.notification({ title: e, category: "success", ...t });
V.error = (e, t = {}) => V.notification({ title: e, category: "error", ...t });
V.confirm = (e, t = {}) => V.notification({ content: e, ...t });
V.form = (e, t = {}) => V.notification({ title: e, ...t });
V.modal = (e = {}) => V.notification(e);
const ht = "mine", Lt = "token", Zs = "web", Ts = 60 * 60 * 24 * 30, Nt = () => {
const e = window.localStorage.getItem(Lt);
2024-06-24 15:44:25 +08:00
if (!e)
return "";
const t = e.split(".");
if (!Array.isArray(t) || t.length !== 3)
throw "登录令牌无效!";
const { iat: n } = JSON.parse(window.atob(t[1]));
2024-06-28 09:26:11 +08:00
if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > Ts)
2024-06-24 15:44:25 +08:00
throw "登录令牌已过期, 请重新登录!";
return e;
2024-06-28 09:26:11 +08:00
}, Gs = () => {
2024-06-24 15:44:25 +08:00
try {
2024-06-28 09:26:11 +08:00
return !!Nt();
2024-06-24 15:44:25 +08:00
} catch {
return !1;
}
2024-06-28 09:26:11 +08:00
}, lr = (e = !0) => {
2024-06-24 15:44:25 +08:00
var t;
try {
2024-06-28 09:26:11 +08:00
const n = Nt();
2024-06-24 15:44:25 +08:00
if (!n)
return Promise.resolve(null);
2024-06-28 09:26:11 +08:00
const { iat: s } = JSON.parse(window.atob((t = n == null ? void 0 : n.split(".")) == null ? void 0 : t[1])), { iat: r, ...o } = I.decode(window.localStorage.getItem(ht) || "", {});
return r === s ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(ht, I.encode({ ...i, iat: s })), i));
2024-06-24 15:44:25 +08:00
} catch (n) {
2024-06-28 09:26:11 +08:00
console.error(n), e && V.error("请登录").then(Ss);
2024-06-24 15:44:25 +08:00
}
return Promise.resolve(null);
2024-06-28 09:26:11 +08:00
}, ur = (e, t, n = {}) => I.post("/api/user-token", {
2024-06-24 15:44:25 +08:00
username: e,
2024-06-28 09:26:11 +08:00
passwd: Ln.hash(t),
platform: Zs,
2024-06-24 15:44:25 +08:00
...n
2024-06-28 09:26:11 +08:00
}).then(({ token: s }) => (window.localStorage.setItem(Lt, s), s)), Ss = () => {
window.localStorage.removeItem(ht), window.localStorage.removeItem(Lt);
2024-06-24 15:44:25 +08:00
};
2024-06-28 09:26:11 +08:00
Ye.configure({ showSpinner: !1 });
Be.interceptors.request.use((e) => {
2024-06-24 15:44:25 +08:00
e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS");
try {
2024-06-28 09:26:11 +08:00
const t = Nt();
2024-06-24 15:44:25 +08:00
e.headers.Authorization = t ? `Bearer ${t} ` : void 0;
} catch {
}
2024-06-28 09:26:11 +08:00
return Ye.inc(), e;
}, (e) => (Ye.done(), Promise.reject({ code: -1, msg: e })));
Be.interceptors.response.use(({ data: e, headers: t }) => (Ye.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
return Ye.done(), Promise.reject(e.message);
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
window.addEventListener("unhandledrejection", vt.onUnhandledRejection);
vt.onMsg = (e, t) => V[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Re.redirect(Pe.get("Common.WEBSITE_LOGIN_PAGE")));
const $s = v.createContext({
2024-06-24 15:44:25 +08:00
user: {},
initUser: () => {
},
initUserComplete: !1
2024-06-28 09:26:11 +08:00
}), dn = v.createContext({
2024-06-24 15:44:25 +08:00
set: () => {
},
get: () => {
},
assign: () => {
},
currentRoute: () => {
}
});
2024-06-28 09:26:11 +08:00
var Oe, Je, xe, ce, Ee, We;
class fn {
2024-06-24 15:44:25 +08:00
constructor(t, n) {
R(this, Oe, /* @__PURE__ */ new Map());
2024-06-28 09:26:11 +08:00
R(this, Je, !0);
2024-06-24 15:44:25 +08:00
R(this, xe, []);
R(this, ce, void 0);
2024-06-28 09:26:11 +08:00
R(this, Ee, () => u(this, ce));
2024-06-24 15:44:25 +08:00
R(this, We, () => Promise.resolve());
2024-06-28 09:26:11 +08:00
F(this, "get", (...t) => new Promise((n, s) => {
2024-06-24 15:44:25 +08:00
const r = JSON.stringify(t);
if (u(this, Oe).has(r))
return n(u(this, We).call(this, u(this, ce), ...t));
if (u(this, ce) === void 0)
2024-06-28 09:26:11 +08:00
u(this, xe).push([t, n, s]), u(this, Je) && (U(this, Je, !1), Promise.resolve(typeof u(this, Ee) == "function" ? u(this, Ee).call(this) : u(this, Ee)).then((o) => U(this, ce, o || null)).finally(() => {
u(this, xe).forEach(([o, i, c]) => {
2024-06-24 15:44:25 +08:00
try {
const l = u(this, We).call(this, u(this, ce), ...o);
u(this, Oe).set(JSON.stringify(o), l), i(l);
} catch (l) {
2024-06-28 09:26:11 +08:00
c(l);
2024-06-24 15:44:25 +08:00
}
}), u(this, xe).length = 0;
}));
else {
const o = u(this, We).call(this, u(this, ce), ...t);
u(this, Oe).set(r, o), n(o);
}
}));
2024-06-28 09:26:11 +08:00
U(this, We, n), U(this, Ee, t);
2024-06-24 15:44:25 +08:00
}
}
2024-06-28 09:26:11 +08:00
Oe = new WeakMap(), Je = new WeakMap(), xe = new WeakMap(), ce = new WeakMap(), Ee = new WeakMap(), We = new WeakMap();
var ge, Qe;
2024-06-24 15:44:25 +08:00
const ne = class ne {
constructor() {
2024-06-28 09:26:11 +08:00
R(this, Qe, null);
F(this, "init", (t) => U(this, Qe, t));
F(this, "get", (t, n) => d.get(u(this, Qe), t, n));
if (u(ne, ge))
return u(ne, ge);
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
ge = new WeakMap(), Qe = new WeakMap(), R(ne, ge, null), F(ne, "getInstance", () => (u(ne, ge) || U(ne, ge, new ne()), u(ne, ge)));
let gt = ne;
const Pe = gt.getInstance(), zs = ({ component: e }) => {
const { base62params: t } = Hn();
return /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
kt,
2024-06-24 15:44:25 +08:00
{
listCode: e,
base62params: I.decode(t)
}
) });
2024-06-28 09:26:11 +08:00
}, Os = ({ component: e, $setting: t }) => {
2024-06-24 15:44:25 +08:00
const [n, s] = k();
2024-06-28 09:26:11 +08:00
L(() => {
2024-06-24 15:44:25 +08:00
if (!e)
2024-06-28 09:26:11 +08:00
return s(/* @__PURE__ */ f(Empty, { description: null }));
2024-06-24 15:44:25 +08:00
J.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => v.createElement(o.default, { $setting: t })).then(s);
}, [e]);
const r = {};
return n ? v.cloneElement(n, r) : null;
};
2024-06-28 09:26:11 +08:00
var me, q, ye, be, qe, _e;
2024-06-24 15:44:25 +08:00
const se = class se {
constructor() {
R(this, q, /* @__PURE__ */ new Map());
2024-06-28 09:26:11 +08:00
R(this, ye, {});
R(this, be, null);
F(this, "init", (t, n) => {
U(this, q, t), U(this, ye, n);
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
F(this, "get", (t) => (u(this, q).has(t) || (t = Array.from(u(this, q).keys()).find((n) => u(this, q).get(n).uri === t)), u(this, q).get(t) || {}));
F(this, "redirect", (t, n, s = {}) => {
2024-06-24 15:44:25 +08:00
const { uri: r, type: o, widgetProps: i } = this.get(t) || {};
2024-06-28 09:26:11 +08:00
let c = Bn(r || t, o != "list" ? n : d.mapValues(n, (a) => I.encode(a)));
2024-06-24 15:44:25 +08:00
const l = new URLSearchParams();
2024-06-28 09:26:11 +08:00
for (const a in i || {})
(i == null ? void 0 : i.type) == "query" && l.append(a, n[a]);
return l.size > 0 && (c = `${c}?${l.toString()}`), u(this, be).navigate(c, s);
2024-06-24 15:44:25 +08:00
});
/**
*
* @param {*} category // user, system, navigator
* @returns
*/
2024-06-28 09:26:11 +08:00
F(this, "getMenus", (t) => {
2024-06-24 15:44:25 +08:00
var n;
2024-06-28 09:26:11 +08:00
return ((n = u(this, ye)) == null ? void 0 : n[t]) || [];
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
F(this, "findMenuPathByUuid", (t) => {
2024-06-24 15:44:25 +08:00
let n = [];
2024-06-28 09:26:11 +08:00
for (const s in u(this, ye))
if (n = u(this, qe).call(this, u(this, ye)[s], t, [s]), n.length > 1)
2024-06-24 15:44:25 +08:00
return n;
return n;
});
2024-06-28 09:26:11 +08:00
F(this, "getMenusByRouteUuid", (t) => u(this, _e).call(this, t, Object.values(u(this, ye)).flat()));
R(this, qe, (t, n, s = []) => {
if (d.isEmpty(t))
2024-06-24 15:44:25 +08:00
return s;
for (const { uuid: r, children: o } of t) {
if (r == n)
return s.concat(r);
2024-06-28 09:26:11 +08:00
if (!d.isEmpty(o))
return s.concat(r, u(this, qe).call(this, o, n));
2024-06-24 15:44:25 +08:00
}
return s;
});
2024-06-28 09:26:11 +08:00
R(this, _e, (t, n) => {
2024-06-24 15:44:25 +08:00
var r;
let s = [];
for (const o of n)
2024-06-28 09:26:11 +08:00
o.widgetType == "redirect" && (o.uuid == t || o.widget == t ? s.push(o) : (r = o.children) != null && r.length && (s = s.concat(u(this, _e).call(this, t, o.children))));
2024-06-24 15:44:25 +08:00
return s;
});
2024-06-28 09:26:11 +08:00
F(this, "getCurrentMenu", () => {
2024-06-24 15:44:25 +08:00
const { uuid: t } = this.getCurrentRoute() || {};
if (!t)
return;
const n = this.getMenusByRouteUuid(t);
2024-06-28 09:26:11 +08:00
if (!d.isEmpty(n))
2024-06-24 15:44:25 +08:00
return n[0];
});
2024-06-28 09:26:11 +08:00
F(this, "getCurrentRoute", (t = 0) => {
2024-06-24 15:44:25 +08:00
var s;
2024-06-28 09:26:11 +08:00
const n = (s = u(this, be).state.matches[u(this, be).state.matches.length - 1 - t]) == null ? void 0 : s.route;
2024-06-24 15:44:25 +08:00
if (!n)
return null;
for (let [r, o] of u(this, q))
if (o.uri === n.path)
return o;
return null;
});
2024-06-28 09:26:11 +08:00
F(this, "getPageParams", (t) => {
2024-06-24 15:44:25 +08:00
var o;
2024-06-28 09:26:11 +08:00
const { location: n, matches: s } = u(this, be).state, r = ((o = s[s.length - 1]) == null ? void 0 : o.params) || {};
return n.search && new URLSearchParams(n.search).forEach((i, c) => {
r[c] = i;
}), t ? d.get(r, t) : r;
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
F(this, "createBrowserRouter", (t = {}) => {
2024-06-24 15:44:25 +08:00
if (u(this, q).size == 0)
return null;
2024-06-28 09:26:11 +08:00
const n = Pe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), s = Pe.get(Gs() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = Array.from(u(this, q).values()).reduce((i, { uuid: c, uri: l, name: a, type: p, component: g, widgetSetting: m, isLogin: h, isLayout: y, extra: b }) => {
let N = {}, w = 0;
2024-06-24 15:44:25 +08:00
switch (p) {
case "list":
2024-06-28 09:26:11 +08:00
N.element = v.createElement(zs, { component: g });
2024-06-24 15:44:25 +08:00
break;
case "fsdpf-component":
2024-06-28 09:26:11 +08:00
N.element = v.createElement(Os, { key: g, component: g, $setting: m });
2024-06-24 15:44:25 +08:00
break;
}
if (b != null && b.layout)
if (r[b == null ? void 0 : b.layout])
2024-06-28 09:26:11 +08:00
w = r[b == null ? void 0 : b.layout];
2024-06-24 15:44:25 +08:00
else
return r[b == null ? void 0 : b.layout] = i.length, [...i, {
path: "/",
2024-06-28 09:26:11 +08:00
lazy: () => J.getWidgetComponent(b == null ? void 0 : b.layout).then(($) => ({ Component: $.default })),
children: [{ path: l, ...N }]
2024-06-24 15:44:25 +08:00
}];
2024-06-28 09:26:11 +08:00
return y && w > -1 ? (i[w].children.push({ path: l, ...N }), i) : [...i, { path: l, ...N }];
2024-06-24 15:44:25 +08:00
}, [
{
path: "/",
lazy: () => J.getWidgetComponent(n).then((i) => ({ Component: i.default })),
children: []
}
]);
2024-06-28 09:26:11 +08:00
return o.push({ index: !0, element: v.createElement(Yn, { to: s, replace: !0 }) }), U(this, be, Kn(o, t));
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
if (u(se, me))
return u(se, me);
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
me = new WeakMap(), q = new WeakMap(), ye = new WeakMap(), be = new WeakMap(), qe = new WeakMap(), _e = new WeakMap(), R(se, me, null), F(se, "getInstance", () => (u(se, me) || U(se, me, new se()), u(se, me)));
let mt = se;
const Re = mt.getInstance(), Te = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), xt = {
getConfigure: (e) => Pe.get(e),
2024-06-24 15:44:25 +08:00
route: {
2024-06-28 09:26:11 +08:00
redirect: (...e) => Re.redirect(...e),
getPageParams: (...e) => Re.getPageParams(...e),
getCurrentRoute: () => Re.getCurrentRoute()
2024-06-24 15:44:25 +08:00
},
modal: {
2024-06-28 09:26:11 +08:00
notification: (...e) => V.notification(...e),
success: (...e) => V.success(...e),
error: (...e) => V.error(...e),
form: (...e) => V.form(...e)
2024-06-24 15:44:25 +08:00
},
popup: {
2024-06-28 09:26:11 +08:00
notification: (...e) => V.notification(...e),
success: (...e) => V.success(...e),
error: (...e) => V.error(...e),
form: (...e) => V.form(...e)
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
var at, Ue, ve;
const P = class P {
2024-06-24 15:44:25 +08:00
constructor() {
2024-06-28 09:26:11 +08:00
F(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => {
const c = He(P, at)._++;
u(P, Ue).set(c, s), P.mQueue.set(c, [o, i]), Te.postMessage({ id: c, session: r, category: "eval", method: t, args: n });
2024-06-24 15:44:25 +08:00
}));
2024-06-28 09:26:11 +08:00
F(this, "clear", (t) => Te.postMessage({ session: t, category: "clear" }));
if (u(P, ve))
return u(P, ve);
Promise.resolve().then(() => xs).then((t) => {
xt.http = t.http;
}), Te.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: o, data: i, error: c, session: l } }) => {
if (o === "eval" && P.mQueue.has(t))
c !== null ? P.mQueue.get(t)[1](c) : P.mQueue.get(t)[0](i), u(P, Ue).delete(t), P.mQueue.delete(t);
2024-06-24 15:44:25 +08:00
else if (o === "util")
try {
2024-06-28 09:26:11 +08:00
const a = d.get(xt, s.split("/")) || d.get(u(P, Ue).get(n), s.split("/"));
if (!d.isFunction(a))
2024-06-24 15:44:25 +08:00
throw `${s} not found`;
2024-06-28 09:26:11 +08:00
Promise.resolve(Reflect.apply(a, void 0, r)).then((p) => {
2024-06-24 15:44:25 +08:00
Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: p, error: null });
}).catch((p) => {
Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: p });
});
2024-06-28 09:26:11 +08:00
} catch (a) {
Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: a });
2024-06-24 15:44:25 +08:00
}
}, !1);
}
};
2024-06-28 09:26:11 +08:00
at = new WeakMap(), Ue = new WeakMap(), ve = new WeakMap(), F(P, "mQueue", /* @__PURE__ */ new Map()), R(P, at, 0), R(P, Ue, /* @__PURE__ */ new Map()), R(P, ve, null), F(P, "getInstance", () => (u(P, ve) || U(P, ve, new P()), u(P, ve)));
let yt = P;
const ke = yt.getInstance();
var Ce, A;
2024-06-24 15:44:25 +08:00
const re = class re {
constructor() {
R(this, A, /* @__PURE__ */ new Map());
2024-06-28 09:26:11 +08:00
F(this, "setVendor", (t, n) => u(this, A).set(t, new fn(n, (s, r) => s.dynamicRequireFsdpfComponent(r))));
F(this, "getWidgetComponent", async (t) => {
2024-06-24 15:44:25 +08:00
if (!t)
throw "getWidgetComponent widget is required";
const [, n] = t == null ? void 0 : t.split("@ff/"), [, s] = t == null ? void 0 : t.split("@app/"), [, r] = t == null ? void 0 : t.split("@pkg/"), [, o] = t == null ? void 0 : t.split("@fsdpf/");
try {
switch (!0) {
case (!!n && u(this, A).has("pkg")):
return await u(this, A).get("pkg").get(n);
case (!!s && u(this, A).has("pkg")):
return await u(this, A).get("pkg").get(s);
case (!!r && u(this, A).has("pkg")):
return await u(this, A).get("pkg").get(r);
case (!!o && u(this, A).has("pkg")):
return await u(this, A).get("pkg").get(o);
}
} catch (i) {
throw i;
}
});
2024-06-28 09:26:11 +08:00
if (u(re, Ce))
return u(re, Ce);
2024-06-24 15:44:25 +08:00
}
};
2024-06-28 09:26:11 +08:00
Ce = new WeakMap(), A = new WeakMap(), R(re, Ce, null), F(re, "getInstance", () => (u(re, Ce) || U(re, Ce, new re()), u(re, Ce)));
let bt = re;
const J = bt.getInstance(), Ut = {
2024-06-24 15:44:25 +08:00
null2json: (e) => null,
null2array: (e) => null,
null2number: (e) => null,
null2bool: (e) => null,
null2string: (e) => null,
null2integer: (e) => null,
null2float: (e) => null,
// null2json: (data) => ({}),
// null2array: (data) => ([]),
// null2number: (data) => 0,
// null2bool: (data) => false,
// null2string: (data) => '',
string2json: (e) => e ? JSON.parse(e) : "{}",
string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","),
string2number: (e) => e == "" ? null : +e,
string2integer: (e) => e == "" ? null : +e,
string2float: (e) => e == "" ? null : +e,
string2bool: (e) => {
switch (`${e}`.toLowerCase()) {
case "0":
case "false":
case "[]":
case "{}":
return !1;
}
return !!e;
},
string2string: (e) => e,
json2json: (e) => e,
json2array: (e) => e ? Object.values(e) : [],
json2number: (e) => Object.keys(e).length,
json2integer: (e) => Object.keys(e).length,
json2float: (e) => Object.keys(e).length,
json2bool: (e) => Object.keys(e).length > 0,
json2string: (e) => e ? JSON.stringify(e) : "",
array2json: (e) => ({ ...e }),
array2array: (e) => e,
array2number: (e) => e.length,
array2integer: (e) => e.length,
array2float: (e) => e.length,
array2bool: (e) => e.length > 0,
array2string: (e) => JSON.stringify(e),
number2json: (e) => ({}),
number2array: (e) => [e],
number2number: (e) => e,
number2integer: (e) => e,
number2float: (e) => e,
number2bool: (e) => !!e,
number2string: (e) => e.toString(),
boolean2json: (e) => ({}),
boolean2array: (e) => [],
boolean2number: (e) => +e,
boolean2integer: (e) => +e,
boolean2float: (e) => +e,
boolean2bool: (e) => e,
boolean2string: (e) => e ? "true" : "false"
};
2024-06-28 09:26:11 +08:00
d.mixin({
toPairsDeep: (e, t) => d.flatMap(
d.toPairs(e),
([n, s]) => d.isObjectLike(s) ? d.toPairsDeep(s, n) : [[`${d.isUndefined(t) ? "" : t + "."}${n}`, s]]
2024-06-24 15:44:25 +08:00
),
2024-06-28 09:26:11 +08:00
deepSome: (e, t = () => !1) => d.some(e, (n) => {
if (d.some(n, t))
2024-06-24 15:44:25 +08:00
return !0;
2024-06-28 09:26:11 +08:00
if (!d.isEmpty(n) && (d.isPlainObject(n) || d.isArray(n)))
return d.deepSome(n, t);
2024-06-24 15:44:25 +08:00
}),
toPrimitive: (e, t) => {
let n = "string";
2024-06-28 09:26:11 +08:00
Array.isArray(e) ? n = "array" : n = typeof e, d.isObject(e) && (n = "json");
2024-06-24 15:44:25 +08:00
const s = `${n}2${t}`;
2024-06-28 09:26:11 +08:00
return Reflect.has(Ut, s) ? Ut[s](e) : e;
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
replaceKeys: (e, t) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((n) => d.replaceKeys(n, t)) : Object.keys(e).reduce((n, s) => (t[s] ? n[t[s]] = d.replaceKeys(e[s], t) : n[s] = d.replaceKeys(e[s], t), n), {})
2024-06-24 15:44:25 +08:00
});
2024-06-28 09:26:11 +08:00
let It = "";
2024-06-24 15:44:25 +08:00
const I = {
init: (e, t, n) => {
2024-06-28 09:26:11 +08:00
Be.defaults.baseURL = It = n, Be.defaults.timeout = 15e3, Object.assign(I, new vt(e, t, Be));
2024-06-24 15:44:25 +08:00
}
2024-06-28 09:26:11 +08:00
}, wt = (e) => {
2024-06-24 15:44:25 +08:00
var t;
return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof v.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase()));
2024-06-28 09:26:11 +08:00
}, xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2024-06-24 15:44:25 +08:00
__proto__: null,
2024-06-28 09:26:11 +08:00
AppGlobalParamsContext: dn,
2024-06-24 15:44:25 +08:00
get AppUrl() {
2024-06-28 09:26:11 +08:00
return It;
2024-06-24 15:44:25 +08:00
},
2024-06-28 09:26:11 +08:00
cache: fn,
configure: Pe,
2024-06-24 15:44:25 +08:00
core: J,
2024-06-28 09:26:11 +08:00
default: $s,
func: ke,
2024-06-24 15:44:25 +08:00
http: I,
2024-06-28 09:26:11 +08:00
isReactComponent: wt,
route: Re
}, Symbol.toStringTag, { value: "Module" })), dr = () => I.get("/api/my-router").then((e) => [
2024-06-24 15:44:25 +08:00
...e,
{ uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } },
{ uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" },
{ uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" }
2024-06-28 09:26:11 +08:00
].map(({ uuid: t, ...n }) => [t, { uuid: t, ...n }])).then((e) => new Map(e)), fr = () => I.get("/api/my-menu"), pr = () => I.get("api/init-configure"), hr = () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((t, { uuid: n, auth: s }) => [...t, [n, s]], [])), gr = (e) => I.get(`/api/user-wx-phone-number/${e}`);
2024-06-24 15:44:25 +08:00
export {
2024-06-28 09:26:11 +08:00
Pe as $,
$t as A,
2024-06-24 15:44:25 +08:00
C as B,
2024-06-28 09:26:11 +08:00
Fs as C,
nn as D,
Vs as E,
2024-06-24 15:44:25 +08:00
Y as F,
2024-06-28 09:26:11 +08:00
ir as G,
us as H,
Rt as I,
Jt as J,
un as K,
ns as L,
Ws as M,
Ct as N,
Nt as O,
Gs as P,
lr as Q,
Ht as R,
Xe as S,
ur as T,
Ss as U,
It as V,
2024-06-24 15:44:25 +08:00
I as W,
2024-06-28 09:26:11 +08:00
wt as X,
$s as Y,
dn as Z,
fn as _,
sr as a,
ke as a0,
2024-06-24 15:44:25 +08:00
J as a1,
2024-06-28 09:26:11 +08:00
Re as a2,
dr as a3,
fr as a4,
pr as a5,
hr as a6,
gr as a7,
Gt as b,
qn as c,
lt as d,
rr as e,
or as f,
nr as g,
qt as h,
V as i,
an as j,
Mt as k,
bs as l,
sn as m,
rn as n,
Ft as o,
on as p,
kt as q,
2024-06-24 15:44:25 +08:00
Ze as r,
2024-06-28 09:26:11 +08:00
cn as s,
ln as t,
Bt as u,
ds as v,
hs as w,
gs as x,
ar as y,
cr as z
2024-06-24 15:44:25 +08:00
};