diff --git a/dist/button.js b/dist/button.js index 299c456..a106b68 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,6 +1,7 @@ -import { B as e, o as r } from "./common/main-v06hYH4g.js"; +import { v as s, B as u, t as e } from "./common/main-DF2XGSyn.js"; import "./common/vender-B-S-5jfg.js"; export { - e as default, - r as useButton + s as auth, + u as default, + e as useButton }; diff --git a/dist/common/main-DF2XGSyn.js b/dist/common/main-DF2XGSyn.js new file mode 100644 index 0000000..80edaed --- /dev/null +++ b/dist/common/main-DF2XGSyn.js @@ -0,0 +1,2076 @@ +var hn = Object.defineProperty; +var gn = (e, t, n) => t in e ? hn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var N = (e, t, n) => (gn(e, typeof t != "symbol" ? t + "" : t, n), n), wt = (e, t, n) => { + if (!t.has(e)) + throw TypeError("Cannot " + n); +}; +var u = (e, t, n) => (wt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), v = (e, t, n) => { + 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); +}, S = (e, t, n, s) => (wt(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); +var Xe = (e, t, n, s) => ({ + set _(r) { + S(e, t, r, n); + }, + get _() { + return u(e, t, s); + } +}); +import d from "lodash"; +import je from "axios"; +import C, { useMemo as Re, useEffect as V, useRef as j, useState as F, useCallback as ce, useContext as He, useLayoutEffect as pn, useId as mn } from "react"; +import bt from "ff-request"; +import yn from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; +import { jsx as h, jsxs as z, Fragment as bn } from "react/jsx-runtime"; +import { QuestionOutlined as Cn, LoadingOutlined as vn, createFromIconfontCN as Rn } from "@ant-design/icons"; +import Z from "classnames"; +import { P as G } from "./vender-B-S-5jfg.js"; +import Be, { Field as zt, FieldContext as Nn } from "rc-field-form"; +import { notification as Ot, Drawer as kn, Modal as Fn, Form as ut, ConfigProvider as Ln, Popconfirm as Vn, Tooltip as wn, Button as In, Input as Wn, Breadcrumb as Pn, Tree as Zn, Pagination as En, Table as Tn, Empty as Gn } from "antd"; +import { flushSync as Sn } from "react-dom"; +import It from "immutability-helper"; +import { useParams as zn, generatePath as On, createBrowserRouter as $n } from "react-router-dom"; +const Ct = ({ type: e, className: t, ...n }) => { + if (!(e != null && e.startsWith("icon-"))) + return /* @__PURE__ */ h(Cn, {}); + if (e === "icon-loading") + return /* @__PURE__ */ h(vn, { className: t, ...n }); + const s = Re(() => Rn({ scriptUrl: Ze.get("Common.ICONFONT", []) }), [Ze.get("Common.ICONFONT")]); + return /* @__PURE__ */ h(s, { type: e, className: Z("iconfont", t), ...n }); +}, Dn = ({ className: e, title: t, content: n, icon: s, $close: r, category: i, duration: o = 4.5 }) => { + const [a, l] = Ot.useNotification(); + return V(() => { + a[i || "open"]({ + className: e, + message: t, + description: n, + icon: s, + duration: o, + onClose: () => r(!1) + }); + }, [t, n, s]), l; +}, Un = ({ className: e, title: t, content: n, okText: s, $close: r, duration: i = 5e3 }) => { + var c; + const o = j(), [a, l] = F(); + return V(() => (a > 0 && (o.current = setTimeout(() => { + a <= 1 ? r() : l((f) => f - 1); + }, 1e3)), () => clearTimeout(o.current)), [a]), V(() => { + l(Math.max(Math.ceil(i / 1e3), 0)); + }, [i]), /* @__PURE__ */ h("div", { className: Z("ff-toast-confirm", e), onClick: (f) => f.mpEvent.currentTarget.id === f.mpEvent.target.id && r(), children: /* @__PURE__ */ z("div", { className: "ff-toast-confirm-container", children: [ + /* @__PURE__ */ h("div", { className: "ff-toast-confirm-title", children: t }), + /* @__PURE__ */ h("div", { className: "ff-toast-confirm-content", children: n }), + /* @__PURE__ */ z("div", { className: "ff-toast-confirm-operations", children: [ + /* @__PURE__ */ z("div", { className: "ff-toast-confirm-cancel", onClick: () => r(!1), children: [ + "取消 (", + a, + ")" + ] }), + C.isValidElement(s) ? C.cloneElement(s, { + onClick: () => r(!0), + className: Z("ff-toast-confirm-ok", (c = s.props) == null ? void 0 : c.className) + }) : /* @__PURE__ */ h("div", { className: "ff-toast-confirm-ok", onClick: () => r(!0), children: s || "确定" }) + ] }) + ] }) }); +}, Ee = C.createContext({ + ele: {}, + mount: () => { + }, + unmount: () => { + } +}), J = ({ className: e, rootClassName: t, children: n, actions: s, title: r, subTitle: i, extras: o }) => { + const { mount: a, unmount: l } = C.useContext(Ee); + return V(() => (a("className", t), () => l("className")), [t]), s && J.Action({ children: s }), r && J.Title({ children: r }), i && J.SubTitle({ children: i }), o && J.Extra({ children: o }), /* @__PURE__ */ h("div", { className: Z("ff-container", e), children: n }); +}, it = (e) => ({ children: t, className: n }) => { + const { mount: s, unmount: r } = C.useContext(Ee); + return V(() => (s(e, C.createElement("div", { + key: `ff-${e}`, + className: Z(`ff-toast-${e}`, n) + }, t)), () => r(e)), [n, t]), null; +}; +J.Action = it("actions"); +J.Title = it("title"); +J.SubTitle = it("sub-title"); +J.Extra = it("extras"); +const Ys = ({ name: e }) => { + const { ele: t } = C.useContext(Ee); + return t == null ? void 0 : t[e]; +}; +J.propTypes = { + // root className + rootClassName: G.string, + // 容器 className + className: G.string, + // 标题占位符 + title: G.any, + // 副标题占位符 + subTitle: G.any, + // 操作按钮占位符 + actions: G.any, + // 扩展安装占位符 + extras: G.any +}; +const xn = C.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, i) => { + const o = j(), [a, l] = F(!0), [c, f] = F({}), p = ce((g, y) => f((b) => ({ ...b, [g]: y })), []), m = ce((g) => f((y) => ({ ...y, [g]: void 0 })), []); + return C.useImperativeHandle(i, () => ({ + handleClose: (g) => { + o.current = g, l(!1); + } + })), /* @__PURE__ */ h(Ee.Provider, { value: { ele: c, mount: p, unmount: m }, children: /* @__PURE__ */ h( + kn, + { + ...r, + title: s || (c == null ? void 0 : c.title), + open: a, + onClose: () => l(!1), + afterOpenChange: (g) => !g && e(o.current), + className: Z("ff-toast ff-toast-drawer", n, c == null ? void 0 : c.className), + extra: c == null ? void 0 : c["sub-title"], + classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ z(C.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ h("div", { className: "ff-toast-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ h("div", { className: "ff-toast-actions" }) + ] }) : void 0, + children: t + } + ) }); +}), Xn = C.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, i) => { + const o = j(), [a, l] = F(!0), [c, f] = F({}), p = ce((g, y) => f((b) => ({ ...b, [g]: y })), []), m = ce((g) => f((y) => ({ ...y, [g]: void 0 })), []); + return C.useImperativeHandle(i, () => ({ + handleClose: (g) => { + o.current = g, l(!1); + } + })), /* @__PURE__ */ h(Ee.Provider, { value: { ele: c, mount: p, unmount: m }, children: /* @__PURE__ */ h( + Fn, + { + ...r, + title: /* @__PURE__ */ z(bn, { children: [ + s || (c == null ? void 0 : c.title), + c == null ? void 0 : c["sub-title"] + ] }), + open: a, + onCancel: () => { + o.current = !1, l(!1); + }, + afterOpenChange: (g) => !g && e(o.current), + className: Z("ff-toast ff-toast-modal", n, c == null ? void 0 : c.className), + keyboard: !0, + classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ z(C.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ h("div", { className: "ff-toast-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ h("div", { className: "ff-toast-actions" }) + ] }) : null, + children: t + } + ) }); +}); +var qe, Se, de, _e, et, tt, nt, ze; +const Ge = class Ge extends C.Component { + constructor(n) { + super(n); + v(this, qe, null); + v(this, Se, 0); + v(this, de, /* @__PURE__ */ new Map()); + v(this, _e, (n) => new Promise((s) => { + const r = Xe(this, Se)._++; + u(this, de).set(r, C.createElement(Dn, { + ...n, + key: r, + $close: (i) => u(this, ze).call(this, r, () => s(i)) + })), this.forceUpdate(); + })); + v(this, et, (n, s) => new Promise((r) => { + const i = Xe(this, Se)._++; + u(this, de).set(i, C.createElement(Un, { + ...s, + content: n, + key: i, + $close: (o) => u(this, ze).call(this, i, () => r(o)) + })), this.forceUpdate(); + })); + v(this, tt, (n, s, { mode: r, ...i } = {}) => new Promise((o) => { + const a = Xe(this, Se)._++, l = { current: null }; + u(this, de).set(a, C.createElement( + r == "drawer" ? xn : Xn, + { + ref: l, + key: a, + maskClosable: !1, + ...i, + $close: (c) => u(this, ze).call(this, a, () => o(c)) + }, + C.createElement(n, { + ...s, + $close: (c) => l.current.handleClose(c) + }) + )), this.forceUpdate(); + })); + v(this, nt, (n, s) => { + }); + v(this, ze, (n, s) => { + u(this, de).delete(n), this.forceUpdate(s); + }); + Ge.modal = u(this, tt), Ge.notification = u(this, _e), Ge.confirm = u(this, et), Ge.form = u(this, nt); + } + componentWillUnmount() { + var n, s; + (s = (n = u(this, qe)) == null ? void 0 : n[1]) == null || s.call(n); + } + render() { + const n = Array.from(u(this, de)); + return /* @__PURE__ */ h(Ee.Provider, { value: {}, children: n.map(([s, r]) => r) }); + } +}; +qe = new WeakMap(), Se = new WeakMap(), de = new WeakMap(), _e = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), ze = new WeakMap(); +let w = Ge; +w.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(Ot[s || "open"]({ + ...r, + icon: n ? /* @__PURE__ */ h(Ct, { type: n || "" }) : void 0, + message: e, + description: t +})); +w.success = (e, t = {}) => w.notification({ title: e, category: "success", ...t }); +w.error = (e, t = {}) => w.notification({ title: e, category: "error", ...t }); +w.confirm = (e, t = {}) => w.notification({ content: e, ...t }); +w.form = (e = {}) => w.notification(e); +w.modal = (e = {}) => w.notification(e); +const dt = "mine", vt = "token", jn = "web", Hn = 60 * 60 * 24 * 30, Rt = () => { + const e = window.localStorage.getItem(vt); + if (!e) + return ""; + const t = e.split("."); + if (!Array.isArray(t) || t.length !== 3) + throw "登录令牌无效!"; + const { iat: n } = JSON.parse(window.atob(t[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > Hn) + throw "登录令牌已过期, 请重新登录!"; + return e; +}, Bn = () => { + try { + return !!Rt(); + } catch { + return !1; + } +}, As = (e = !0) => { + var t; + try { + const n = Rt(); + if (!n) + return Promise.resolve(null); + const { iat: s } = JSON.parse(window.atob((t = n == null ? void 0 : n.split(".")) == null ? void 0 : t[1])), { iat: r, ...i } = L.decode(window.localStorage.getItem(dt) || "", {}); + return r === s ? Promise.resolve(i) : L.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(dt, L.encode({ ...o, iat: s })), o)); + } catch (n) { + console.error(n), e && w.error("请登录").then(Kn); + } + return Promise.resolve(null); +}, Ms = (e, t, n = {}) => L.post("/api/user-token", { + username: e, + passwd: yn.hash(t), + platform: jn, + ...n +}).then(({ token: s }) => (window.localStorage.setItem(vt, s), s)), Kn = () => { + window.localStorage.removeItem(dt), window.localStorage.removeItem(vt); +}; +je.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + try { + const t = Rt(); + e.headers.Authorization = t ? `Bearer ${t} ` : void 0; + } catch { + } + return e; +}, (e) => Promise.reject({ code: -1, msg: e })); +je.interceptors.response.use(({ data: e, headers: t }) => ({ ...e, res: t == null ? void 0 : t.res }), function(e) { + return Promise.reject(e.message); +}); +window.addEventListener("unhandledrejection", bt.onUnhandledRejection); +bt.onToast = (e, t) => w[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ve.redirect(Ze.get("Common.WEBSITE_LOGIN_PAGE"))); +const Yn = C.createContext({ + user: {}, + initUser: () => { + }, + initUserComplete: !1 +}), $t = C.createContext({ + set: () => { + }, + get: () => { + }, + assign: () => { + }, + currentRoute: () => { + } +}); +var Oe, Ke, $e, oe, Ie, We; +class Dt { + constructor(t, n) { + v(this, Oe, /* @__PURE__ */ new Map()); + v(this, Ke, !0); + v(this, $e, []); + v(this, oe, void 0); + v(this, Ie, () => u(this, oe)); + v(this, We, () => Promise.resolve()); + N(this, "get", (...t) => new Promise((n, s) => { + const r = JSON.stringify(t); + if (u(this, Oe).has(r)) + return n(u(this, We).call(this, u(this, oe), ...t)); + if (u(this, oe) === void 0) + u(this, $e).push([t, n, s]), u(this, Ke) && (S(this, Ke, !1), Promise.resolve(typeof u(this, Ie) == "function" ? u(this, Ie).call(this) : u(this, Ie)).then((i) => S(this, oe, i || null)).finally(() => { + u(this, $e).forEach(([i, o, a]) => { + try { + const l = u(this, We).call(this, u(this, oe), ...i); + u(this, Oe).set(JSON.stringify(i), l), o(l); + } catch (l) { + a(l); + } + }), u(this, $e).length = 0; + })); + else { + const i = u(this, We).call(this, u(this, oe), ...t); + u(this, Oe).set(r, i), n(i); + } + })); + S(this, We, n), S(this, Ie, t); + } +} +Oe = new WeakMap(), Ke = new WeakMap(), $e = new WeakMap(), oe = new WeakMap(), Ie = new WeakMap(), We = new WeakMap(); +var fe, Ye; +const _ = class _ { + constructor() { + v(this, Ye, null); + N(this, "init", (t) => S(this, Ye, t)); + N(this, "get", (t, n) => d.get(u(this, Ye), t, n)); + if (u(_, fe)) + return u(_, fe); + } +}; +fe = new WeakMap(), Ye = new WeakMap(), v(_, fe, null), N(_, "getInstance", () => (u(_, fe) || S(_, fe, new _()), u(_, fe))); +let ft = _; +const Ze = ft.getInstance(), An = (e = {}, t = {}, n = {}, s = "") => d.deepSome(e, (r, i) => i === "type" && r === "code") ? Ut(e, t, n, s) : xt(e, t, s), Ut = async (e = {}, t = {}, n = {}, s = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let i in e) { + let o; + if (Reflect.has(e[i], "type") && ["code", "field", "router", "query", "string"].includes(e[i].type)) { + const { type: a, value: l = "", default: c = s } = e[i]; + switch (a) { + case "code": + o = await Ne.exec(l, t, n); + break; + case "field": + o = d.get(t, l) ?? d.get(t, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + o = ve.getPageParams(l); + break; + case "string": + o = l; + } + o ?? (o = c); + } else + o = await Ut(e[i], t, n, s); + d.set(r, i, o); + } + return r; +}, xt = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((s, r) => { + if (d.isPlainObject(e[r])) { + let i; + if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { + const { type: o, value: a = "", default: l = n } = e[r]; + switch (o) { + case "field": + i = d.get(t, a) ?? d.get(t, a.substring(a.indexOf(".") + 1)); + break; + case "router": + case "query": + i = ve.getPageParams(a); + break; + case "string": + i = a; + break; + } + i ?? (i = l); + } else + i = xt(e[r], t, n); + d.set(s, r, i); + } + return s; +}, {}); +var he, ae, Pe, st; +const ee = class ee { + constructor() { + v(this, ae, null); + v(this, Pe, /* @__PURE__ */ new Map()); + v(this, st, () => { + if (u(this, ae)) + return u(this, ae).port.postMessage({ command: "status", data: [] }); + S(this, ae, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, ae).port.onmessage = (t) => { + var n, s; + (n = t.data) != null && n.uuid ? u(this, Pe).forEach((r, i) => { + var o; + (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, t.data.uuid)) && i(t.data); + }) : ((s = t.data) == null ? void 0 : s.readyState) == WebSocket.CLOSED && L.get("/api/user-api-token").then(({ token: r, expire_at: i }) => { + u(this, ae).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(Ft, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, u(this, ae).port.postMessage({ command: "status", data: [] }); + }); + N(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, Pe).set(t, n), u(this, Pe).size == 1 && u(this, st).call(this), () => this.unsubscribe(t))); + N(this, "unsubscribe", (t) => u(this, Pe).delete(t)); + if (u(ee, he)) + return u(ee, he); + } +}; +he = new WeakMap(), ae = new WeakMap(), Pe = new WeakMap(), st = new WeakMap(), v(ee, he, null), N(ee, "getInstance", () => (u(ee, he) || S(ee, he, new ee()), u(ee, he))); +let ht = ee; +const Xt = ht.getInstance(), jt = () => { + const e = j(!0), [t, n] = F(0); + return V(() => () => e.current = !1, []), () => e.current && Sn(() => { + n(t + 1); + }); +}, Js = ({ value: e, defaultValue: t, onChange: n }) => { + const s = jt(), r = j(e !== void 0 ? e : t); + e !== void 0 && (r.current = e); + const i = ce(d.debounce((o) => { + e === void 0 && (r.current = o, s()), n && n(o); + }, 380, { leading: !0, trailing: !1 }), [e]); + return [r.current, i]; +}, Wt = (e) => { + const t = j(); + return V(() => { + t.current = e; + }), t.current; +}, Mn = (e) => { + const t = j(), [n, s] = F(e); + return V(() => { + d.isFunction(t.current) && t.current(n); + }, [n]), [n, function(r, i) { + t.current = i, s(r); + }]; +}, ot = (e = C.EffectCallback, t, n = d.isEqual) => { + const s = C.useRef(t); + (!s.current || !n(t, s.current)) && (s.current = t), C.useEffect(e, [s.current]); +}, Ht = (e, t = "string") => { + var n; + if (!Array.isArray(e)) + return e; + for (let s = 0; s < e.length; s++) + e[s].value = d.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = Ht(e[s].children, t)); + return e; +}, Qs = (e, t = "json", n = "string", s, r = null) => { + const [i] = Be.useForm(s), [o, a] = F([{ label: "无", value: "", disabled: !0 }]), l = j([]), c = Be.useWatch((f) => l.current.length === 0 ? null : d.pick(f, l.current), i) || null; + return V(() => { + Array.isArray(e) ? a(e) : t === "javascript" && e ? Ne.exec(e, {}, { + getFieldValue: (f) => (l.current.includes(f) || l.current.push(f), i.getFieldValue(f)), + getFieldValueForBasicForm: (f) => (l.current.includes(f) || l.current.push(f), r ? r.getFieldValue(f) : i.getFieldValue(f)) + }).then((f) => { + a(d.toPrimitive(f, "array")); + }) : e && a(d.toPrimitive(e, "array")); + }, [e, t, c]), Ht(o, n); +}, qs = (e) => { + const [t, n] = F(), s = { type: "GET" }; + if (typeof e == "string" ? s.url = e : d.isPlainObject(e) && Object.assign(s, e), !(s != null && s.url)) + throw "url is required"; + const r = (i) => L.request(s, !1).resp((o) => (console.log("useSubscribeRequest", i), n(o), o)); + return ot(() => { + let i = null; + return r().then((o) => { + i = Xt.subscribe(r, o.res); + }), () => i == null ? void 0 : i(); + }, s), t; +}, Jn = (e) => { + const [t, n] = C.useState({ gridItems: [], hideItems: [] }); + return C.useEffect(() => { + e && L.get(`/api/_/${e}`).then(({ + pk: s, + uuid: r, + code: i, + resource: o, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + fields: f + }) => ({ + pk: s, + uuid: r, + code: i, + resource: o, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + ...f.reduce((p, m) => { + var g; + return (g = m == null ? void 0 : m.field) != null && g.hidden ? p.hides.push(m == null ? void 0 : m.field) : p.items.push(m), p; + }, { items: [], hides: [] }) + })).then(n); + }, [e]), t; +}, Qn = ({ + max: e = 0, + min: t = 0, + type: n = "", + message: s, + pattern: r, + required: i = !1, + validator: o +} = {}, a, l) => { + const [c, f] = F([]); + return V(() => { + const p = []; + if (i) { + let m = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + m = "boolean"; + break; + case "json": + m = "object"; + break; + } + p.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + p.push({ + type: n, + max: e, + min: t, + message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) + }); + break; + case "pattern": + p.push({ type: "string", pattern: r, message: s }); + break; + case "validator": + o && p.push(({ getFieldValue: m }) => ({ + validator: async (g, y) => { + const b = await Ne.exec(o, { value: y, fieldName: a }, { getFieldValue: m }); + return d.isString(b) && b ? Promise.reject(b) : d.isBoolean(b) && !b ? Promise.reject(s) : Promise.resolve(); + } + })); + break; + } + f(p); + }, [e, t, n, s, r, i, o]), c; +}, qn = (e, t, n) => { + const [s, r] = F(null); + return V(() => { + const { + initDataUri: i = `/api/${e}`, + initDataMethod: o = "GET" + } = n || {}; + L.request({ + method: o, + url: d.trimEnd(`${i}/${t}`, "/") + }).then((a) => { + r(a); + }); + }, [e, t, n]), s; +}, _n = (e, t, n, s = {}) => { + const r = jt(), i = j(!0), o = j([]), [a, l] = F(n), c = Be.useWatch((f) => JSON.stringify(d.pick(f, o.current)), t) || "{}"; + return V(() => { + e && Ne.exec(e, s, { + getFieldValue: d.wrap(t.getFieldValue, (f, p) => (o.current.some((m) => d.isEqual(m, p)) || (o.current.push(p), r()), f(p))), + isFieldTouched: t.isFieldTouched, + isFieldsTouched: t.isFieldsTouched + }).then((f) => i.current && l(f)); + }, [e, c, t, s]), V(() => () => i.current = !1, []), a; +}, es = (e) => ({ + code: t, + layout: n, + name: s, + primaryKey: r = 0, + style: i = {}, + formProps: o = {}, + form: a, + isPreview: l = !1, + className: c, + onFinish: f, + onValuesChange: p = () => { + }, + ...m +}) => { + const { + align: g, + autoComplete: y, + resource: b, + items: O, + hides: E, + rowHeight: X, + marginX: A, + marginY: q, + listenChangeFields: H, + listenChangeFieldsFunc: W, + pk: k, + uuid: B + } = Jn(t), [P] = ut.useForm(a), K = ({ + changedValues: $, + allValues: T, + listenChangeFields: ke, + listenChangeFieldsFunc: Qe, + onValuesChange: at, + code: Lt + }) => { + at($, T), Qe && Array.isArray(ke) && Ne.exec( + Qe, + { changedValues: $, allValues: T }, + { + getFieldValue: P.getFieldValue, + setFieldsValue: P.setFieldsValue, + isFieldTouched: P.isFieldTouched, + isFieldsTouched: P.isFieldsTouched + } + ); + }, re = Re(() => [ + { name: "__PK__", value: k }, + { name: "__PROPS__", value: o }, + { name: "__RESOURCE__", value: b }, + { name: "__LAYOUT_KEY__", value: t }, + { name: "__LAYOUT_UUID__", value: B }, + { name: "__PRIMARY_KEY__", value: r } + ], [k, t, B, b, r, o]); + return /* @__PURE__ */ z( + ut, + { + className: c, + requiredMark: !0, + name: s || t, + layout: n || g, + fields: re, + form: P, + autoComplete: y, + style: { ...i, position: "relative" }, + onFinish: f, + onValuesChange: ($, T) => K( + { + changedValues: $, + allValues: T, + listenChangeFields: H, + listenChangeFieldsFunc: W, + onValuesChange: p, + code: t + } + ), + children: [ + /* @__PURE__ */ h( + e, + { + ...m, + form: P, + code: t, + fields: O, + rowHeight: X, + marginX: A, + marginY: q + } + ), + E == null ? void 0 : E.map(($) => { + var T; + return /* @__PURE__ */ h(zt, { name: $.code, children: /* @__PURE__ */ h( + ts, + { + form: P, + name: $.code, + type: $.type, + initialValue: $.initialValue, + initialValueLanguage: (T = $.extras) == null ? void 0 : T.initialValueLanguage + } + ) }, JSON.stringify($.code)); + }) + ] + } + ); +}, ts = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { + const i = _n( + n == "javascript" && t, + r, + n == "javascript" ? void 0 : t, + {} + ); + return V(() => { + n == "javascript" ? s(d.toPrimitive(i, e)) : s(d.toPrimitive(t, e)); + }, [e, t, i]), null; +}, ns = (e) => function({ code: n, data: s, ...r }) { + const [i, o] = F({ + resource: null, + cols: 12, + rowHeight: 21, + fields: [] + }); + return V(() => { + n && L.get(`/api/_/${n}`).then((a) => o(d.pick(a, ["resource", "cols", "rowHeight", "fields"]))); + }, [n]), (i == null ? void 0 : i.resource) && /* @__PURE__ */ h( + e, + { + ...r, + rowHeight: i.rowHeight, + cols: i.cols, + fields: i.fields, + data: i != null && i.resource ? { [i == null ? void 0 : i.resource]: s } : {} + } + ); +}, ss = "RC_FORM_INTERNAL_HOOKS", Bt = (e, { + initialValue: t, + initialValueLanguage: n, + convertJs: s, + convertJsSetting: r, + type: i = "string" +}, o = null) => { + const a = j(!1), l = He(Nn), [c, f] = F(), [p, m] = F(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: g } = l.getInternalHooks(ss) || {}; + return V(() => g == null ? void 0 : g((y, b, O) => { + if (!a.current) + return; + const E = d.get(b, e); + d.isEqual(E, p) || m(d.toPrimitive(E, i)); + }), [p]), V(() => { + n == "javascript" && t ? Ne.exec(t, {}, { + getFieldValueForBasicForm: (y) => o ? o.getFieldValue(y) : l.getFieldValue(y), + getFieldValue: (y) => l.getFieldValue(y) + }).then((y) => m(d.toPrimitive(y, i))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => a.current = !0) : (t && m(d.toPrimitive(t ?? l.getFieldValue(e), i)), a.current = !0); + }, [t, n]), ot(() => { + a.current && s && Q.getWidgetComponent(s).then(({ default: y }) => y({ value: p, record: l.getFieldsValue(!0), $setting: r })).then(f).catch((y) => console.error("布局数据转换错误: ", y, s)); + }, [p, s, r]), [c || p, p]; +}, rs = (e, t, n, s, r, i) => { + const o = { + "--grid-layout-h": `${s}`, + "--grid-layout-w": `${n}`, + "--grid-layout-x": `${e}`, + "--grid-layout-y": `${t}`, + "--grid-layout-row-height-offset": "0px" + }; + return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${s}`, o["--grid-layout-box-margin"] = Pt(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Pt(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), i && (o.height = `${i}px`), o; +}, Pt = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Kt = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: i = [4, 0], formProps: o = {}, className: a, ...l }) => { + const [c] = Be.useForm(), f = Yt(n, os, "@pkg/grid-layouts"), p = Re(() => [ + { name: "__PROPS__", value: o } + ], [o]); + return ot(() => { + c.setFieldsValue(s); + }, [s]), /* @__PURE__ */ h(Be, { fields: p, form: c, component: !1, children: /* @__PURE__ */ h( + "div", + { + ...l, + className: Z("ff-grid-layout", a), + style: { + "--grid-layout-item-margin-y": `${(i == null ? void 0 : i[0]) || 0}px`, + "--grid-layout-item-margin-x": `${(i == null ? void 0 : i[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: f + } + ) }); +}, Yt = (e, t, n = "@pkg/grid-layouts", s = null) => Re(() => { + var r; + return (r = d.sortBy(e, ["y", "x"])) == null ? void 0 : r.map( + ({ i, x: o, y: a, w: l, h: c, field: { boxStyle: f, widgetPrefix: p = n, widget: m, ...g } }, y) => /* @__PURE__ */ h( + "div", + { + className: "grid-layout-item", + style: rs(o, a, l, c, f, m === "Height" && (g == null ? void 0 : g.initialValue)), + children: /* @__PURE__ */ h( + is, + { + ...g, + basicForm: s, + itemWidget: m != null && m.startsWith("@") ? m : `${p}/${m}`, + itemWidgetRender: t + } + ) + }, + i || y + ) + ); +}, [e]), is = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { + const [r, i] = F(); + return V(() => { + Q.getWidgetComponent(e).then(({ defaultProps: o, default: a }) => { + i(C.createElement(t(a, o, n), s)); + }).catch((o) => i(e)); + }, [e]), r; +}, os = (e, t, n = null) => (s) => { + const { + code: r, + label: i, + extras: o, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: f, + convertJsSetting: p, + ...m + } = d.merge({}, t, s), [g, y] = Bt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: f, + convertJsSetting: p, + type: (m == null ? void 0 : m.type) || "string" + }, n); + return /* @__PURE__ */ h(e, { ...m, value: g, rawValue: y, $setting: o || {} }); +}, _s = ns(Kt), as = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...i }) => { + const o = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, l] = F(); + return V(() => { + o && Q.getWidgetComponent(o).then(({ defaultProps: c, default: f }) => ({ + default: At(f, c, r) + })).catch((c) => ({ default: () => `${c}` })).then((c) => l(C.createElement(c.default, i))); + }, [o]), a && C.cloneElement(a, i); +}; +as.defaultProps = { + widgetPrefix: "@pkg/grid-layout-forms", + widget: "Input" +}; +const At = (e, t, n = null) => (s) => { + const { + type: r, + code: i, + label: o, + noStyle: a, + placeholder: l, + extras: c, + validators: f, + help: p, + isVirtual: m, + initialValue: g, + initialValueLanguage: y, + convertJs: b, + convertJsSetting: O, + widgetPerfix: E, + boxStyle: X, + widgetDecorator: A, + subWidgets: q, + ...H + } = { ...t, ...s }, W = Qn(f || {}, i, r), k = { + label: o, + noStyle: a, + colon: !1 + }, B = { + placeholder: l, + ...H + }, P = ce((K) => K == null ? void 0 : d.toPrimitive(K, r), [r]); + return /* @__PURE__ */ h( + zt, + { + name: i, + rules: W, + initialValue: P(g), + normalize: P, + children: (K, re, $) => { + var T; + return /* @__PURE__ */ h( + e, + { + type: r, + rcform: $, + itemProps: { + validateStatus: re.errors.length > 0 ? "error" : "success", + tooltip: p, + help: re.errors.length > 0 ? re.errors.join("、") : null, + required: ((T = W == null ? void 0 : W[0]) == null ? void 0 : T.required) || !1, + ...k + }, + fieldProps: { ...B, ...K }, + $setting: c || {} + } + ); + } + } + ); +}, Nt = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { + const i = Yt(r, At, "@pkg/grid-layout-forms"); + return /* @__PURE__ */ h(Ln, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ h("div", { className: "ff-grid-layout-form", style: { + "--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: i }) }); +}; +Nt.propTypes = { + fields: G.array.isRequired +}; +Nt.defaultProps = { + fields: [] +}; +const cs = es(Nt), Mt = ({ children: e }) => { + const [t, n] = F({}), s = ce((i, o) => n((a) => ({ ...a, [i]: o })), []), r = ce((i) => n((o) => ({ ...o, [i]: void 0 })), []); + return /* @__PURE__ */ h(Ee.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); +}; +Mt.defaultProps = { + isDrawerRender: !1 +}; +Mt.propTypes = { + isDrawerRender: G.bool +}; +const ls = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...i }) => { + const [o] = ut.useForm(), a = qn(s, r, e); + V(() => { + a && o.setFieldsValue(a); + }, [a]); + const l = () => { + const c = o.getFieldValue("__RESOURCE__"), { + initDataUri: f = `/api/${s}` + } = e || {}; + o.validateFields(!0).then((p) => c ? d.pick(p, [c]) : p).then((p) => L.post(r ? `${f}/${r}` : `${f}`, p).msg(t)).catch(() => Toast.error("请先完善表单信息", { duration: 2e3 })); + }; + return /* @__PURE__ */ h( + J, + { + actions: /* @__PURE__ */ z(C.Fragment, { children: [ + /* @__PURE__ */ h(R, { name: "保存", type: "primary", widget: l }), + /* @__PURE__ */ h(R, { name: "取消", widget: () => t(!1) }) + ] }), + extras: n, + children: /* @__PURE__ */ h(cs, { form: o, code: s, primaryKey: r, ...i }) + } + ); +}, us = (e, t, n = "children") => { + if (d.isEmpty(e)) + return {}; + const s = d.find(e, ["value", t]); + if (!d.isEmpty(s)) + return s; + const r = e.length; + for (let i = 0; i < r; i++) { + const { [n]: o } = e[i], a = us(o, t, n); + if (!d.isEmpty(a)) + return a; + } + return {}; +}, ds = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => ve.redirect(t, e, { replace: n }), Zt = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => { + const i = { + loading: (o) => o === void 0 ? n : r((a) => ({ ...a, loading: o })), + disabled: (o) => o === void 0 ? s : r((a) => ({ ...a, disabled: o })) + }; + return d.isFunction(t) ? t.call(null, { ...e, ...i }) : d.isString(t) && t ? Ne.exec(t, e, i) : null; +}, Et = (e, t, n, s) => d.isString(t) && t ? Q.getWidgetComponent(t).then(({ default: r }) => { + w.modal( + r, + { ...e, $setting: n, code: t }, + s + ); +}).catch((r) => { + w.error(t, { content: r.toString() }); +}) : w.modal( + t, + { ...e, $setting: n, code: t }, + s +), fs = (e, t, n, s) => w.modal( + ls, + { ...e, $setting: n, code: t }, + s +), hs = (e, t, n, s) => w.modal( + Jt, + { base62params: e, $setting: n, listCode: t }, + s +), gs = ({ + widget: e, + widgetType: t, + widgetData: n, + widgetProps: s, + widgetSetting: r, + widgetContainerProps: i +}, { onAfterClick: o, onBeforeClick: a }) => { + const l = He(xe); + He($t); + const [c, f] = F({ leading: !0, trailing: !1 }), p = Re(() => { + switch (t) { + case "redirect": + return d.partialRight(ds, e, r); + case "func": + return d.partialRight(Zt, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: f }); + case "fsdpf-component": + return d.partialRight(Et, e, r, i); + case "grid-layout-form": + return d.partialRight(fs, e, r, i); + case "data-list": + return d.partialRight(hs, e, r, i); + default: + if (sn(e)) + return d.partialRight(Et, e, r, i); + if (d.isFunction(e)) + return d.partialRight(Zt, (r == null ? void 0 : r.code) || e, { status: c, setStatus: f }); + } + return (...g) => console.error("useButton unknown widgetType", t, ...g); + }, [e, t]); + return [d.debounce((g) => (a == null || a(g), Promise.resolve(An(s, g, { list: l })).then((y) => p({ ...n, ...y })).then((y) => o == null ? void 0 : o(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; +}; +var ge, De; +const te = class te { + constructor() { + v(this, De, null); + N(this, "init", (t) => S(this, De, new Map(t))); + N(this, "check", (t) => !u(this, De).has(t) || u(this, De).get(t)); + if (u(te, ge)) + return u(te, ge); + } +}; +ge = new WeakMap(), De = new WeakMap(), v(te, ge, null), N(te, "getInstance", () => (u(te, ge) || S(te, ge, new te()), u(te, ge))); +let gt = te; +const ps = gt.getInstance(), Je = (e) => function({ + className: n, + children: s, + name: r, + icon: i, + type: o, + data: a, + noAuthType: l, + onAfterClick: c, + onBeforeClick: f, + loading: p, + disabled: m, + tooltip: g, + popConfirm: y, + widget: b, + widgetType: O, + widgetData: E, + widgetProps: X, + widgetSetting: A, + widgetContainerProps: q, + ...H +}) { + const W = { + type: "primary", + className: Z("ff-button", n) + }; + o === "danger" ? W.danger = !0 : o === "default" && (W.type = o), e === "link" || e === "dashed" ? (W.type = e, o === "default" && (W.className = Z(W.className, "ff-default"))) : (e === "circle" || e === "round") && (W.shape = e), i && (W.icon = /* @__PURE__ */ h(Ct, { type: i })); + const [k, B] = F(!1), [P, { disabled: K, loading: re }] = gs({ widget: b, widgetType: O, widgetData: E, widgetProps: X, widgetSetting: A, widgetContainerProps: q }, { onAfterClick: c, onBeforeClick: f }); + return /* @__PURE__ */ h( + Vn, + { + okText: "确定", + cancelText: "取消", + ...y || {}, + disabled: K || m, + open: k, + onOpenChange: (T) => { + if (!T) + return B(T); + y ? B(T) : P(a); + }, + onConfirm: () => { + P(a); + }, + onClick: (T) => { + T.stopPropagation(); + }, + children: /* @__PURE__ */ h(wn, { ...g, title: k ? null : g == null ? void 0 : g.title, trigger: ["hover", "click"], children: /* @__PURE__ */ h( + In, + { + loading: re || p, + disabled: K || m, + ...W, + ...H, + children: s || r + } + ) }) + } + ); +}, R = Je("default"), ms = Je("link"), ys = Je("circle"), bs = Je("round"), Cs = Je("dashed"); +R.defaultProps = { + type: "default", + iconPosition: "start" +}; +R.propTypes = { + type: G.oneOf(["primary", "default", "danger", ""]), + name: G.string, + // 按钮名称 + icon: G.string, + // 图标 + iconPosition: G.oneOf(["start", "end"]), + // 图标位置 + data: G.any, + // onClick 数据源, 会受到 widgetProps 数据结构影响 + widget: G.any, + // 组件 + widgetType: G.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), + // 组件类型 + widgetData: G.object, + // onClick缺省数据 + widgetProps: G.object, + // data 数据结构 + widgetSetting: G.object, + // $setting + widgetContainerProps: G.object + // 容器配置 +}; +R.Link = ms; +R.Link.defaultProps = R.defaultProps; +R.Link.propTypes = R.propTypes; +R.Circle = ys; +R.Circle.defaultProps = R.defaultProps; +R.Circle.propTypes = R.propTypes; +R.Round = bs; +R.Round.defaultProps = R.defaultProps; +R.Round.propTypes = R.propTypes; +R.Dashed = Cs; +R.Dashed.defaultProps = R.defaultProps; +R.Dashed.propTypes = R.propTypes; +const vs = ({ + className: e, + itemClassName: t, + dataSource: n, + isPaginate: s, + pageSize: r, + isItemOperations: i, + isBatchOperations: o, + batchOperations: a, + itemOperations: l, + itemOperationsAccess: c, + resource: f, + primaryKey: p, + title: m, + itemGridLayout: g, + $setting: y, + isTreeSider: b, + treeSiderConfig: O, + onClickCallback: E +}) => { + const { getBase62params: X } = He(xe), { total: A, page: q } = X() || {}, H = ce((W, k, B) => /* @__PURE__ */ h( + Rs, + { + className: Z("ff-data-list-framework-item", t), + operations: i && k ? l == null ? void 0 : l.filter((P) => !p || !P.uuid || !c.has(P.uuid) ? !0 : c.get(P.uuid).includes(k == null ? void 0 : k[p])) : [], + data: f ? { [f]: k } : k, + children: W, + onClickCallback: E + } + ), [f, p, i, E, c]); + return /* @__PURE__ */ z("div", { className: Z("ff-data-list-framework", e), children: [ + /* @__PURE__ */ h(kt, { isTreeSider: b, ...O }), + /* @__PURE__ */ z("div", { className: "ff-data-list-container", children: [ + /* @__PURE__ */ h(Qt, {}), + /* @__PURE__ */ h(qt, { title: m }), + /* @__PURE__ */ h("div", { className: "ff-data-list-content", style: { + "--col-num": (y == null ? void 0 : y.colNum) || 1 + }, children: /* @__PURE__ */ h(nn, { ...g, primaryKey: p, itemRender: H, dataSource: n }) }), + /* @__PURE__ */ h( + _t, + { + isPaginate: s, + isOperations: o, + operations: a, + total: A, + page: q, + pageSize: r + } + ) + ] }) + ] }); +}, Rs = ({ className: e, operations: t, children: n, data: s, onClickCallback: r }) => /* @__PURE__ */ z("div", { className: Z("data-list-grid-layout-item-container", e), children: [ + n, + !!(t != null && t.length) && /* @__PURE__ */ h("div", { className: "data-list-grid-layout-item-actions", children: t.map(({ isRefresh: i, ...o }) => /* @__PURE__ */ h("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ h( + R.Link, + { + uuid: o.uuid, + type: o.type, + name: o.name, + widget: o.widget, + widgetType: o.widgetType, + widgetProps: o.widgetProps, + widgetSetting: o.widgetSetting, + widgetContainerProps: o.widgetContainerSetting, + data: s, + onAfterClick: (a) => r == null ? void 0 : r(o.isRefresh, s) + }, + o.uuid || useId() + ) }, (o == null ? void 0 : o.uuid) || useId())) }) +] }), Ns = ({ + className: e, + itemClassName: t, + dataSource: n, + columns: s, + isItemOperations: r, + isBatchOperations: i, + batchOperations: o, + itemOperations: a, + itemOperationsAccess: l, + resource: c, + primaryKey: f, + title: p, + isPaginate: m, + pageSize: g, + isTreeSider: y, + treeSiderConfig: b, + ...O +}) => { + const { getBase62params: E, onClickCallback: X } = He(xe), { total: A, page: q } = E(); + return /* @__PURE__ */ z("div", { className: Z("ff-data-table-framework", e), children: [ + /* @__PURE__ */ h(kt, { isTreeSider: y, ...b }), + /* @__PURE__ */ z("div", { className: "ff-data-table-container", children: [ + /* @__PURE__ */ h(Qt, {}), + /* @__PURE__ */ h(qt, { title: p }), + /* @__PURE__ */ h( + tn, + { + ...O, + className: "ff-data-table-content", + columns: s, + dataSource: n, + operationRender: (H) => /* @__PURE__ */ h("div", { className: "ff-data-table-actions", children: a == null ? void 0 : a.reduce((W, k, B) => [ + ...W, + /* @__PURE__ */ h( + R.Link, + { + size: "small", + uuid: k.uuid, + type: k.type, + name: k.name, + widget: k.widget, + widgetType: k.widgetType, + widgetProps: k.widgetProps, + widgetSetting: k.widgetSetting, + widgetContainerProps: k.widgetContainerSetting, + data: H, + onAfterClick: (P) => X == null ? void 0 : X(k.isRefresh, H) + }, + k.uuid || B + ) + ], []) }) + } + ), + /* @__PURE__ */ h( + _t, + { + isPaginate: m, + isOperations: i, + operations: o, + total: A, + page: q, + pageSize: g + } + ) + ] }) + ] }); +}, xe = C.createContext({ + getBase62params: (e, t) => { + }, + onReload: () => { + }, + onClickCallback: () => { + }, + onConditonChange: () => { + }, + onTabChange: () => { + }, + onSiderChange: () => { + }, + onKeywordChange: () => { + }, + onPageChange: () => { + }, + onPageSizeChange: () => { + } +}), ks = ({ + isItemGridLayout: e, + theme: t, + themeProps: n, + onPageChange: s, + onPageSizeChange: r, + onTabChange: i, + onSiderChange: o, + onKeywordChange: a, + onConditonChange: l, + onClickCallback: c, + onReload: f, + getBase62params: p, + ...m +}) => { + const [g, y] = F(); + return V(() => { + t ? Q.getWidgetComponent(t).then((b) => { + if (!b) + throw `${t} not found`; + return b; + }).catch((b) => ({ default: () => `${b}` })).then((b) => y(C.createElement(b.default, { ...m, $setting: n }))) : g || y(null); + }, [t, n]), /* @__PURE__ */ h(xe.Provider, { value: { + onClickCallback: c, + onReload: f, + getBase62params: p, + onPageChange: s, + onPageSizeChange: r, + onTabChange: i, + onSiderChange: o, + onKeywordChange: a, + onConditonChange: l + }, children: g ? C.cloneElement(g, m) : e ? /* @__PURE__ */ h(vs, { ...m, $setting: n }) : /* @__PURE__ */ h(Ns, { ...m, $setting: n }) }); +}, Fs = (e, t, n, s, r) => { + const i = C.lazy(() => Q.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` }))); + return /* @__PURE__ */ h(C.Suspense, { children: /* @__PURE__ */ h( + i, + { + value: t, + record: n, + $setting: s, + base62params: r + } + ) }, e); +}, Ls = (e, t = {}) => (Wt(e), Wt(t), Re(() => e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...i }, o) => s && !s.endsWith("/BasicShowFieldData") ? { + ...i, + render: (a, l) => { + const c = Fs(s, a, l, r, t); + return d.isFunction(i == null ? void 0 : i.render) ? i.render(c, a, l) : c; + } +} : i), [e, t])), er = (e) => { + const [t, n] = F({}); + return V(() => { + let s = !1; + return e && L.get(`/api/_/${e}`).then((r) => d.pick(r, [ + "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; +}, tr = (e, t = {}) => { + const [n, s] = F({ dataSource: [] }); + return ot(() => { + let r = !1; + return e && L.get(`/api/${e}/${L.encode({ page: 1, ...t })}`).then((i) => !r && s(i)), () => r = !0; + }, [e, t]), n; +}, Tt = (e, t = null, n = null, s = "id") => Re(() => { + if (d.isEmpty(e) || !e.every(({ uuid: i }) => ps.check(i))) + return !1; + if (d.isEmpty(n) || d.isEmpty(t)) + return !0; + const r = t.map((i) => i == null ? void 0 : i[s]); + return e.some(({ uuid: i }) => !i || !n.has(i) ? !0 : n.get(i).some((o) => r.includes(o))); +}, [e, t, n, s]), Jt = ({ listCode: e, base62params: t, className: n, itemClassName: s, theme: r, themeProps: i }) => { + const [{ tab: o, page: a, total: l, condition: c, sider: f, keyword: p, dataSource: m, itemOperationsAccess: g, pageSize: y }, b] = Mn(t), [{ + resource: O, + primaryKey: E, + batchOperations: X = [], + itemOperations: A = [], + columns: q = [], + themeConfig: H, + theme: W, + isTreeSider: k, + treeSiderConfig: B, + isItemGridLayout: P, + itemGridLayout: K, + title: re, + isPaginate: $ + }, T] = F({ isItemGridLayout: !1, itemGridLayout: {} }), ke = (D) => L.list(e, { tab: o, page: a, total: l, condition: c, sider: f, keyword: p, ...D }).then(({ + condition: U, + total: le, + tab: Fe, + page: ue, + pageSize: Le, + operationsAccess: ie, + dataSource: x + }) => { + b({ + dataSource: x, + pageSize: Le, + total: le, + page: ue, + tab: Fe, + condition: U, + sider: f, + keyword: p, + itemOperationsAccess: new Map(ie) + }); + }), Qe = Tt(A, m, g, E), at = Tt(X); + V(() => { + let D = null; + return e && L.get(`/api/_/${e}`).resp(({ data: U, res: le }) => { + U != null && U.isDynamicRefresh && (D = Xt.subscribe(() => ke(), le)), T(U); + }).catch(() => T({})), b((U) => ({ ...U, dataSource: [] })), () => D == null ? void 0 : D(); + }, [e]), V(() => { + e && ke(t); + }, [t]); + const Lt = () => { + }, rn = () => { + }, on = () => { + }, an = () => { + }, cn = (D, U) => ke({ page: D, pageSize: U }), ln = (D) => ke({ pageSize: D, page: 1 }), un = (D, U) => { + const le = { tab: o, sider: f, keyword: p, page: a, pageSize: y, condition: c, total: l }; + return D ? d.get(le, D, U) : le; + }, ct = () => { + ke(); + }, dn = (D = 0, U = null) => { + if (D === 2) { + const le = d.get(U, "__PARENT_ID__", ""), Fe = d.get(U, E, ""), ue = d.findIndex(m, ["__PARENT_ID__", le]), Le = d.findIndex(ue > -1 ? d.get(m, [ue, "children"]) : m, [E, Fe]); + Le > -1 ? (L.get(`/api/${e}/detail/${Fe}`).then((ie) => { + b((x) => { + const Ve = d.get(x.dataSource, ue > -1 ? [ue, "children", Le, "children"] : [Le, "children"]); + return { + ...x, + dataSource: ue > -1 ? It(x.dataSource, { [ue]: { children: { $splice: [[Le, 1, { ...ie, children: Ve }]] } } }) : It(x.dataSource, { $splice: [[Le, 1, { ...ie, children: Ve }]] }) + }; + }); + }), L.post(`/api/${e}/list-operations-access`, { ids: Fe }).then((ie) => new Map(ie)).then((ie) => { + b((x) => (x.itemOperationsAccess.forEach((Ve, we) => { + var Vt; + (Vt = ie.get(we)) != null && Vt.some((lt) => lt == Fe) || x.itemOperationsAccess.set(we, Ve.filter((lt) => lt !== Fe)); + }), ie.forEach((Ve, we) => { + x.itemOperationsAccess.has(we) ? x.itemOperationsAccess.set(we, d.uniq([...x.itemOperationsAccess.get(we) || [], ...Ve])) : x.itemOperationsAccess.set(we, Ve); + }), { ...x })); + })) : ct(); + } else + D === 1 && ct(); + }, fn = { + title: re, + itemClassName: s, + resource: O, + primaryKey: E, + theme: r || W, + themeProps: i || H, + isPaginate: $, + pageSize: y, + page: a, + isTreeSider: k, + treeSiderConfig: B, + isItemOperations: Qe, + isBatchOperations: at, + batchOperations: X, + itemOperations: A, + itemOperationsAccess: g, + dataSource: m, + isItemGridLayout: P, + columns: q, + itemGridLayout: K + }; + return /* @__PURE__ */ h(J, { className: Z("ff-data-list-helper", n), children: /* @__PURE__ */ h( + ks, + { + ...fn, + getBase62params: un, + onReload: ct, + onClickCallback: dn, + onConditonChange: Lt, + onTabChange: rn, + onSiderChange: on, + onKeywordChange: an, + onPageChange: cn, + onPageSizeChange: ln + } + ) }); +}, Qt = ({ className: e }) => (C.useContext(xe), /* @__PURE__ */ z("div", { className: Z("ff-data-list-filter", e), children: [ + /* @__PURE__ */ h( + Wn, + { + placeholder: "关键字", + style: { width: "30%", maxWidth: 300 }, + prefix: /* @__PURE__ */ h(Ct, { type: "icon-search" }) + } + ), + /* @__PURE__ */ z("div", { className: "ff-data-list-actions", children: [ + /* @__PURE__ */ h(R, { children: "重置" }), + /* @__PURE__ */ h(R, { type: "primary", children: "查询" }), + /* @__PURE__ */ h( + R.Link, + { + className: "ff-data-list-filter-submit-button", + type: "primary", + name: "展开", + icon: "icon-down", + iconPosition: "end" + } + ) + ] }) +] })), Vs = [ + { title: "全部", className: "active" }, + { title: "运行中" }, + { title: "已上线" } +], qt = ({ className: e, title: t }) => /* @__PURE__ */ z("div", { className: Z("ff-data-list-toolbar", e), children: [ + /* @__PURE__ */ h("div", { className: "ff-data-list-title", children: t }), + /* @__PURE__ */ h(Pn, { className: "ff-data-list-tabs", items: Vs }), + /* @__PURE__ */ z("div", { className: "ff-data-list-actions", children: [ + /* @__PURE__ */ h(R.Link, { icon: "icon-reload" }), + /* @__PURE__ */ h(R.Link, { icon: "icon-setting" }) + ] }) +] }), ws = [ + { + 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: [ + { + title: /* @__PURE__ */ h( + "span", + { + style: { + color: "#1677ff" + }, + children: "sss" + } + ), + key: "0-0-1-0" + } + ] + } + ] + } +], kt = ({ className: e, width: t, isTreeSider: n }) => n ? /* @__PURE__ */ h( + Zn.DirectoryTree, + { + className: Z("ff-data-list-sider", e), + style: { "--sider-width": t }, + showLine: !0, + showIcon: !1, + treeData: ws + } +) : null; +kt.defaultProps = { + width: 280 +}; +const _t = ({ className: e, operations: t, isOperations: n, isPaginate: s, total: r, page: i, pageSize: o }) => { + const { onPageChange: a, onPageSizeChange: l, onClickCallback: c } = C.useContext(xe); + return n && !d.isEmpty(t) || s ? /* @__PURE__ */ z("div", { className: Z("ff-data-list-footer", e), children: [ + /* @__PURE__ */ h("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((f, p) => /* @__PURE__ */ h( + R, + { + uuid: f.uuid, + type: f.type, + name: f.name, + widget: f.widget, + widgetType: f.widgetType, + widgetProps: f.widgetProps, + widgetSetting: f.widgetSetting, + widgetContainerProps: f.widgetContainerSetting, + onAfterClick: (m) => c(f.isRefresh, null) + }, + f.uuid || p + )) }), + s && /* @__PURE__ */ h( + En, + { + size: "small", + total: r, + pageSize: o, + showSizeChanger: !1, + showTotal: (f) => `第 ${i} 页 / 总共 ${f} 条`, + onChange: a, + onShowSizeChange: l + } + ) + ] }) : null; +}, en = (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(en(r.children, t, n)) : s), []) : [], tn = ({ + className: e, + primaryKey: t, + columns: n, + dataSource: s, + operationRender: r, + operationWidth: i, + ...o +}) => { + const a = j(null), l = j(null), [c, f] = F([]), [p, m] = F({ width: 0, height: 0 }); + V(() => { + f(en(s, t)); + }, [s, t]), pn(() => { + const y = new ResizeObserver(() => { + var b; + m({ + width: ((b = a.current) == null ? void 0 : b.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, + height: l.current.offsetHeight + }); + }); + return l.current && y.observe(l.current), () => { + l.current && y.unobserve(l.current); + }; + }, []); + const g = Ls(n); + return /* @__PURE__ */ h("div", { ref: l, className: Z("ff-data-list-table", e), children: p.height ? /* @__PURE__ */ h( + Tn, + { + ...o, + ref: a, + rowKey: (y, b) => (y == null ? void 0 : y[t]) ?? b, + columns: g == null ? void 0 : g.concat(r ? [{ + title: "操作", + align: "center", + fixed: "right", + width: `${Math.ceil(i / p.width * 100).toFixed(2)}%`, + render: (y, b, O) => r(b, O) + }] : []), + dataSource: s, + size: "middle", + scroll: { x: "max-content", y: p.height - 47 }, + pagination: !1, + expandable: { + defaultExpandAllRows: !0, + expandRowByClick: !0, + onExpandedRowsChange: f, + expandedRowKeys: c + } + } + ) : null }); +}; +tn.defaultProps = { + operationWidth: 180, + columns: [], + dataSource: [] +}; +const Is = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { + const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [i, o] = F(); + return V(() => { + r && Q.getWidgetComponent(r).then(({ defaultProps: a, default: l }) => ({ + default: Ws(l, a, n) + })).catch((a) => ({ default: () => `${a}` })).then((a) => o(C.createElement(a.default, s))); + }, [r]), i; +}, Ws = (e, t, n = null) => (s) => { + const { + code: r, + label: i, + extras: o, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: f, + convertJsSetting: p, + value: m, + ...g + } = d.merge({}, t, s), [y, b] = Bt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: f, + convertJsSetting: p, + type: (g == null ? void 0 : g.type) || "string" + }, n); + return /* @__PURE__ */ h(e, { ...g, value: y, rawValue: b, $setting: o || {} }); +}; +Is.defaultProps = { + widgetPrefix: "@pkg/grid-layouts" +}; +const nn = ({ + cols: e, + rowHeight: t, + itemMargin: n, + fields: s, + primaryKey: r, + itemRender: i, + dataSource: o, + itemClassName: a, + empty: l +}) => { + const c = mn(), f = Re(() => /* @__PURE__ */ h( + Kt, + { + cols: e, + rowHeight: t, + itemMargin: n, + fields: s, + className: a + } + ), [s, e, t, n]); + return d.isEmpty(o) ? l : o == null ? void 0 : o.map((p, m) => /* @__PURE__ */ h(C.Fragment, { children: i(C.cloneElement(f, { data: p }), p, m) }, `${c}-${(p == null ? void 0 : p[r]) || m}`)); +}; +nn.defaultProps = { + itemRender: (e, t, n) => e, + empty: /* @__PURE__ */ h(Gn, { description: null }) +}; +const Ps = ({ component: e }) => { + const { base62params: t } = zn(); + return /* @__PURE__ */ h( + Jt, + { + listCode: e, + base62params: L.decode(t) + } + ); +}; +var pe, M, me, ye, Ae, Me; +const ne = class ne { + constructor() { + v(this, M, /* @__PURE__ */ new Map()); + v(this, me, {}); + v(this, ye, null); + N(this, "init", (t, n) => { + S(this, M, t), S(this, me, n); + }); + N(this, "get", (t) => (u(this, M).has(t) || (t = Array.from(u(this, M).keys()).find((n) => u(this, M).get(n).uri === t)), u(this, M).get(t) || {})); + N(this, "redirect", (t, n, s = {}) => { + const { uri: r, type: i, widgetProps: o } = this.get(t) || {}; + let a = On(r || t, i != "list" ? n : d.mapValues(n, (c) => L.encode(c))); + const l = new URLSearchParams(); + for (const c in o || {}) + (o == null ? void 0 : o.type) == "query" && l.append(c, n[c]); + return l.size > 0 && (a = `${a}?${l.toString()}`), u(this, ye).navigate(a, s); + }); + /** + * + * @param {*} category // user, system, navigator + * @returns + */ + N(this, "getMenus", (t) => { + var n; + return ((n = u(this, me)) == null ? void 0 : n[t]) || []; + }); + N(this, "findMenuPathByUuid", (t) => { + let n = []; + for (const s in u(this, me)) + if (n = u(this, Ae).call(this, u(this, me)[s], t, [s]), n.length > 1) + return n; + return n; + }); + N(this, "getMenusByRouteUuid", (t) => u(this, Me).call(this, t, Object.values(u(this, me)).flat())); + v(this, Ae, (t, n, s = []) => { + if (d.isEmpty(t)) + return s; + for (const { uuid: r, children: i } of t) { + if (r == n) + return s.concat(r); + if (!d.isEmpty(i)) + return s.concat(r, u(this, Ae).call(this, i, n)); + } + return s; + }); + v(this, Me, (t, n) => { + var r; + let s = []; + for (const i of n) + i.widgetType == "redirect" && (i.uuid == t || i.widget == t ? s.push(i) : (r = i.children) != null && r.length && (s = s.concat(u(this, Me).call(this, t, i.children)))); + return s; + }); + N(this, "getCurrentMenu", () => { + const { uuid: t } = this.getCurrentRoute() || {}; + if (!t) + return; + const n = this.getMenusByRouteUuid(t); + if (!d.isEmpty(n)) + return n[0]; + }); + N(this, "getCurrentRoute", (t = 0) => { + var s; + const n = (s = u(this, ye).state.matches[u(this, ye).state.matches.length - 1 - t]) == null ? void 0 : s.route; + if (!n) + return null; + for (let [r, i] of u(this, M)) + if (i.uri === n.path) + return i; + return null; + }); + N(this, "getPageParams", (t) => { + var i; + const { location: n, matches: s } = u(this, ye).state, r = ((i = s[s.length - 1]) == null ? void 0 : i.params) || {}; + return n.search && new URLSearchParams(n.search).forEach((o, a) => { + r[a] = o; + }), t ? d.get(r, t) : r; + }); + N(this, "createBrowserRouter", (t = {}) => { + if (u(this, M).size == 0) + return null; + const n = Ze.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"); + Ze.get(Bn() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"); + const s = { [n]: 0 }, r = Array.from(u(this, M).values()).reduce((i, { uuid: o, uri: a, name: l, type: c, component: f, isLogin: p, isLayout: m, extra: g }) => { + let y = {}, b = 0; + switch (c) { + case "list": + y.element = C.createElement(Ps, { component: f }); + break; + case "fsdpf-component": + y.lazy = () => Q.getWidgetComponent(f).then((O) => ({ Component: O.default })); + break; + } + if (g != null && g.layout) + if (s[g == null ? void 0 : g.layout]) + b = s[g == null ? void 0 : g.layout]; + else + return s[g == null ? void 0 : g.layout] = i.length, [...i, { + path: "/", + lazy: () => Q.getWidgetComponent(g == null ? void 0 : g.layout).then((O) => ({ Component: O.default })), + children: [{ path: a, ...y }] + }]; + return m && b > -1 ? (i[b].children.push({ path: a, ...y }), i) : [...i, { path: a, ...y }]; + }, [ + { + path: "/", + lazy: () => Q.getWidgetComponent(n).then((i) => ({ Component: i.default })), + children: [] + } + ]); + return S(this, ye, $n(r, t)); + }); + if (u(ne, pe)) + return u(ne, pe); + } +}; +pe = new WeakMap(), M = new WeakMap(), me = new WeakMap(), ye = new WeakMap(), Ae = new WeakMap(), Me = new WeakMap(), v(ne, pe, null), N(ne, "getInstance", () => (u(ne, pe) || S(ne, pe, new ne()), u(ne, pe))); +let pt = ne; +const ve = pt.getInstance(), Te = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), Gt = { + getConfigure: (e) => Ze.get(e), + route: { + redirect: (...e) => ve.redirect(...e), + getPageParams: (...e) => ve.getPageParams(...e), + getCurrentRoute: () => ve.getCurrentRoute() + }, + modal: { + notification: (...e) => w.notification(...e), + success: (...e) => w.success(...e), + error: (...e) => w.error(...e) + } +}; +var rt, Ue, be; +const I = class I { + constructor() { + N(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((i, o) => { + const a = Xe(I, rt)._++; + u(I, Ue).set(a, s), I.mQueue.set(a, [i, o]), Te.postMessage({ id: a, session: r, category: "eval", method: t, args: n }); + })); + N(this, "clear", (t) => Te.postMessage({ session: t, category: "clear" })); + if (u(I, be)) + return u(I, be); + Promise.resolve().then(() => Zs).then((t) => { + Gt.http = t.http; + }), Te.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: i, data: o, error: a, session: l } }) => { + if (i === "eval" && I.mQueue.has(t)) + a !== null ? I.mQueue.get(t)[1](a) : I.mQueue.get(t)[0](o), u(I, Ue).delete(t), I.mQueue.delete(t); + else if (i === "util") + try { + const c = d.get(Gt, s.split("/")) || d.get(u(I, Ue).get(n), s.split("/")); + if (!d.isFunction(c)) + throw `${s} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((f) => { + Te.postMessage({ id: t, task_id: n, category: i, method: s, args: r, session: l, data: f, error: null }); + }).catch((f) => { + Te.postMessage({ id: t, task_id: n, category: i, method: s, args: r, session: l, data: null, error: f }); + }); + } catch (c) { + Te.postMessage({ id: t, task_id: n, category: i, method: s, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +rt = new WeakMap(), Ue = new WeakMap(), be = new WeakMap(), N(I, "mQueue", /* @__PURE__ */ new Map()), v(I, rt, 0), v(I, Ue, /* @__PURE__ */ new Map()), v(I, be, null), N(I, "getInstance", () => (u(I, be) || S(I, be, new I()), u(I, be))); +let mt = I; +const Ne = mt.getInstance(); +var Ce, Y; +const se = class se { + constructor() { + v(this, Y, /* @__PURE__ */ new Map()); + N(this, "setVendor", (t, n) => u(this, Y).set(t, new Dt(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); + N(this, "getWidgetComponent", async (t) => { + 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/"), [, i] = t == null ? void 0 : t.split("@fsdpf/"); + try { + switch (!0) { + case (!!n && u(this, Y).has("pkg")): + return await u(this, Y).get("pkg").get(n); + case (!!s && u(this, Y).has("pkg")): + return await u(this, Y).get("pkg").get(s); + case (!!r && u(this, Y).has("pkg")): + return await u(this, Y).get("pkg").get(r); + case (!!i && u(this, Y).has("pkg")): + return await u(this, Y).get("pkg").get(i); + } + } catch (o) { + throw o; + } + }); + if (u(se, Ce)) + return u(se, Ce); + } +}; +Ce = new WeakMap(), Y = new WeakMap(), v(se, Ce, null), N(se, "getInstance", () => (u(se, Ce) || S(se, Ce, new se()), u(se, Ce))); +let yt = se; +const Q = yt.getInstance(), St = { + 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" +}; +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]] + ), + deepSome: (e, t = () => !1) => d.some(e, (n) => { + if (d.some(n, t)) + return !0; + if (!d.isEmpty(n) && (d.isPlainObject(n) || d.isArray(n))) + return d.deepSome(n, t); + }), + toPrimitive: (e, t) => { + let n = "string"; + Array.isArray(e) ? n = "array" : n = typeof e, d.isObject(e) && (n = "json"); + const s = `${n}2${t}`; + return Reflect.has(St, s) ? St[s](e) : e; + }, + 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), {}) +}); +let Ft = ""; +const L = { + init: (e, t, n) => { + je.defaults.baseURL = Ft = n, je.defaults.timeout = 15e3, Object.assign(L, new bt(e, t, je)); + } +}, sn = (e) => { + var t; + return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof C.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); +}, Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + AppGlobalParamsContext: $t, + get AppUrl() { + return Ft; + }, + cache: Dt, + configure: Ze, + core: Q, + default: Yn, + func: Ne, + http: L, + isReactComponent: sn, + route: ve +}, Symbol.toStringTag, { value: "Module" })), nr = () => L.get("/api/my-router").then((e) => [ + ...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" } +].map(({ uuid: t, ...n }) => [t, { uuid: t, ...n }])).then((e) => new Map(e)), sr = () => L.get("/api/my-menu"), rr = () => L.get("api/init-configure"), ir = () => L.get("/api/init-widget-operation-auth").then((e) => e.reduce((t, { uuid: n, auth: s }) => [...t, [n, s]], [])), or = (e) => L.get(`/api/user-wx-phone-number/${e}`); +export { + Ze as $, + Qt as A, + R as B, + qt as C, + ks as D, + kt as E, + w as F, + cs as G, + _t as H, + Ct as I, + Jt as J, + xe as K, + tn as L, + nn as M, + vs as N, + Fs as O, + Ls as P, + er as Q, + Xt as R, + Ee as S, + tr as T, + Tt as U, + Ft as V, + L as W, + sn as X, + Yn as Y, + $t as Z, + Dt as _, + As as a, + Ne as a0, + Q as a1, + ve as a2, + nr as a3, + sr as a4, + rr as a5, + ir as a6, + or as a7, + Kn as b, + Bn as c, + Js as d, + Wt as e, + Mn as f, + Rt as g, + ot as h, + Qs as i, + qs as j, + J as k, + Ms as l, + Ys as m, + Mt as n, + Nt as o, + as as p, + ls as q, + _n as r, + us as s, + gs as t, + jt as u, + ps as v, + en as w, + _s as x, + Kt as y, + Is as z +}; diff --git a/dist/common/main-v06hYH4g.js b/dist/common/main-v06hYH4g.js deleted file mode 100644 index 727d602..0000000 --- a/dist/common/main-v06hYH4g.js +++ /dev/null @@ -1,1644 +0,0 @@ -var Gt = Object.defineProperty; -var Tt = (e, t, n) => t in e ? Gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var N = (e, t, n) => (Tt(e, typeof t != "symbol" ? t + "" : t, n), n), st = (e, t, n) => { - if (!t.has(e)) - throw TypeError("Cannot " + n); -}; -var u = (e, t, n) => (st(e, t, "read from private field"), n ? n.call(e) : t.get(e)), v = (e, t, n) => { - 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); -}, E = (e, t, n, s) => (st(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); -var We = (e, t, n, s) => ({ - set _(r) { - E(e, t, r, n); - }, - get _() { - return u(e, t, s); - } -}); -import f from "lodash"; -import Ze from "axios"; -import b, { useMemo as ie, useEffect as R, useRef as j, useState as V, useCallback as me, useContext as ut, useId as Et } from "react"; -import Me from "ff-request"; -import Ot from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; -import { jsx as g, jsxs as S, Fragment as Pt } from "react/jsx-runtime"; -import { QuestionOutlined as Xt, LoadingOutlined as Ht, createFromIconfontCN as $t } from "@ant-design/icons"; -import $ from "classnames"; -import { notification as dt, Drawer as zt, Modal as St, Form as be, ConfigProvider as jt, Popconfirm as Ut, Tooltip as Dt, Button as Le, Popover as ft } from "antd"; -import { P as G } from "./vender-B-S-5jfg.js"; -import we, { Field as mt, FieldContext as Yt } from "rc-field-form"; -import { flushSync as Kt } from "react-dom"; -import { useParams as gt, generatePath as xt, createBrowserRouter as At } from "react-router-dom"; -const ht = ({ type: e, className: t, ...n }) => { - if (!(e != null && e.startsWith("icon-"))) - return /* @__PURE__ */ g(Xt, {}); - if (e === "icon-loading") - return /* @__PURE__ */ g(Ht, { className: t, ...n }); - const s = ie(() => $t({ scriptUrl: ge.get("Common.ICONFONT", []) }), [ge.get("Common.ICONFONT")]); - return /* @__PURE__ */ g(s, { type: e, className: $("iconfont", t), ...n }); -}, Bt = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => { - const [a, l] = dt.useNotification(); - return R(() => { - a[o || "open"]({ - className: e, - message: t, - description: n, - icon: s, - duration: i, - onClose: () => r(!1) - }); - }, [t, n, s]), l; -}, Jt = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => { - var c; - const i = j(), [a, l] = V(); - return R(() => (a > 0 && (i.current = setTimeout(() => { - a <= 1 ? r() : l((d) => d - 1); - }, 1e3)), () => clearTimeout(i.current)), [a]), R(() => { - l(Math.max(Math.ceil(o / 1e3), 0)); - }, [o]), /* @__PURE__ */ g("div", { className: $("ff-toast-confirm", e), onClick: (d) => d.mpEvent.currentTarget.id === d.mpEvent.target.id && r(), children: /* @__PURE__ */ S("div", { className: "ff-toast-confirm-container", children: [ - /* @__PURE__ */ g("div", { className: "ff-toast-confirm-title", children: t }), - /* @__PURE__ */ g("div", { className: "ff-toast-confirm-content", children: n }), - /* @__PURE__ */ S("div", { className: "ff-toast-confirm-operations", children: [ - /* @__PURE__ */ S("div", { className: "ff-toast-confirm-cancel", onClick: () => r(!1), children: [ - "取消 (", - a, - ")" - ] }), - b.isValidElement(s) ? b.cloneElement(s, { - onClick: () => r(!0), - className: $("ff-toast-confirm-ok", (c = s.props) == null ? void 0 : c.className) - }) : /* @__PURE__ */ g("div", { className: "ff-toast-confirm-ok", onClick: () => r(!0), children: s || "确定" }) - ] }) - ] }) }); -}, he = b.createContext({ - ele: {}, - mount: () => { - }, - unmount: () => { - } -}), A = ({ className: e, rootClassName: t, children: n, actions: s, title: r, subTitle: o, extras: i }) => { - const { mount: a, unmount: l } = b.useContext(he); - return R(() => (a("className", t), () => l("className")), [t]), s && A.Action({ children: s }), r && A.Title({ children: r }), o && A.SubTitle({ children: o }), i && A.Extra({ children: i }), /* @__PURE__ */ g("div", { className: $("ff-container", e), children: n }); -}, Ue = (e) => ({ children: t, className: n }) => { - const { mount: s, unmount: r } = b.useContext(he); - return R(() => (s(e, b.createElement("div", { - key: `ff-${e}`, - className: $(`ff-toast-${e}`, n) - }, t)), () => r(e)), [n, t]), null; -}; -A.Action = Ue("actions"); -A.Title = Ue("title"); -A.SubTitle = Ue("sub-title"); -A.Extra = Ue("extras"); -const es = ({ name: e }) => { - const { ele: t } = b.useContext(he); - return t == null ? void 0 : t[e]; -}; -A.propTypes = { - // root className - rootClassName: G.string, - // 容器 className - className: G.string, - // 标题占位符 - title: G.any, - // 副标题占位符 - subTitle: G.any, - // 操作按钮占位符 - actions: G.any, - // 扩展安装占位符 - extras: G.any -}; -const Mt = b.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = j(), [a, l] = V(!0), [c, d] = V({}), h = me((m, y) => d((C) => ({ ...C, [m]: y })), []), p = me((m) => d((y) => ({ ...y, [m]: void 0 })), []); - return b.useImperativeHandle(o, () => ({ - handleClose: (m) => { - i.current = m, l(!1); - } - })), /* @__PURE__ */ g(he.Provider, { value: { ele: c, mount: h, unmount: p }, children: /* @__PURE__ */ g( - zt, - { - ...r, - title: s || (c == null ? void 0 : c.title), - open: a, - onClose: () => l(!1), - afterOpenChange: (m) => !m && e(i.current), - className: $("ff-toast ff-toast-drawer", n, c == null ? void 0 : c.className), - extra: c == null ? void 0 : c["sub-title"], - classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, - footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(b.Fragment, { children: [ - (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-toast-extras" }), - (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-toast-actions" }) - ] }) : void 0, - children: t - } - ) }); -}), Qt = b.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { - const i = j(), [a, l] = V(!0), [c, d] = V({}), h = me((m, y) => d((C) => ({ ...C, [m]: y })), []), p = me((m) => d((y) => ({ ...y, [m]: void 0 })), []); - return b.useImperativeHandle(o, () => ({ - handleClose: (m) => { - i.current = m, l(!1); - } - })), /* @__PURE__ */ g(he.Provider, { value: { ele: c, mount: h, unmount: p }, children: /* @__PURE__ */ g( - St, - { - ...r, - title: /* @__PURE__ */ S(Pt, { children: [ - s || (c == null ? void 0 : c.title), - c == null ? void 0 : c["sub-title"] - ] }), - open: a, - onCancel: () => { - i.current = !1, l(!1); - }, - afterOpenChange: (m) => !m && e(i.current), - className: $("ff-toast ff-toast-modal", n, c == null ? void 0 : c.className), - keyboard: !0, - classNames: { header: "ff-toast-header", footer: "ff-toast-footer" }, - footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(b.Fragment, { children: [ - (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-toast-extras" }), - (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-toast-actions" }) - ] }) : void 0, - children: t - } - ) }); -}); -var Pe, ve, ee, Xe, He, $e, ze, Ce; -const ye = class ye extends b.Component { - constructor(n) { - super(n); - v(this, Pe, null); - v(this, ve, 0); - v(this, ee, /* @__PURE__ */ new Map()); - v(this, Xe, (n) => new Promise((s) => { - const r = We(this, ve)._++; - u(this, ee).set(r, b.createElement(Bt, { - ...n, - key: r, - $close: (o) => u(this, Ce).call(this, r, () => s(o)) - })), this.forceUpdate(); - })); - v(this, He, (n, s) => new Promise((r) => { - const o = We(this, ve)._++; - u(this, ee).set(o, b.createElement(Jt, { - ...s, - content: n, - key: o, - $close: (i) => u(this, Ce).call(this, o, () => r(i)) - })), this.forceUpdate(); - })); - v(this, $e, (n, s, { mode: r, ...o } = {}) => new Promise((i) => { - const a = We(this, ve)._++, l = { current: null }; - u(this, ee).set(a, b.createElement( - r == "drawer" ? Mt : Qt, - { - ref: l, - key: a, - maskClosable: !1, - ...o, - $close: (c) => u(this, Ce).call(this, a, () => i(c)) - }, - b.createElement(n, { - ...s, - $close: (c) => l.current.handleClose(c) - }) - )), this.forceUpdate(); - })); - v(this, ze, (n, s) => { - }); - v(this, Ce, (n, s) => { - u(this, ee).delete(n), this.forceUpdate(s); - }); - ye.modal = u(this, $e), ye.notification = u(this, Xe), ye.confirm = u(this, He), ye.form = u(this, ze); - } - componentWillUnmount() { - var n, s; - (s = (n = u(this, Pe)) == null ? void 0 : n[1]) == null || s.call(n); - } - render() { - const n = Array.from(u(this, ee)); - return /* @__PURE__ */ g(he.Provider, { value: {}, children: n.map(([s, r]) => r) }); - } -}; -Pe = new WeakMap(), ve = new WeakMap(), ee = new WeakMap(), Xe = new WeakMap(), He = new WeakMap(), $e = new WeakMap(), ze = new WeakMap(), Ce = new WeakMap(); -let Z = ye; -Z.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(dt[s || "open"]({ - ...r, - icon: n ? /* @__PURE__ */ g(ht, { type: n || "" }) : void 0, - message: e, - description: t -})); -Z.success = (e, t = {}) => Z.notification({ title: e, category: "success", ...t }); -Z.error = (e, t = {}) => Z.notification({ title: e, category: "error", ...t }); -Z.confirm = (e, t = {}) => Z.notification({ content: e, ...t }); -Z.form = (e = {}) => Z.notification(e); -Z.modal = (e = {}) => Z.notification(e); -const Ye = "mine", Qe = "token", qt = "web", _t = 60 * 60 * 24 * 30, qe = () => { - const e = window.localStorage.getItem(Qe); - if (!e) - return ""; - const t = e.split("."); - if (!Array.isArray(t) || t.length !== 3) - throw "登录令牌无效!"; - const { iat: n } = JSON.parse(window.atob(t[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > _t) - throw "登录令牌已过期, 请重新登录!"; - return e; -}, en = () => { - try { - return !!qe(); - } catch { - return !1; - } -}, ts = (e = !0) => { - var t; - try { - const n = qe(); - if (!n) - return Promise.resolve(null); - const { iat: s } = JSON.parse(window.atob((t = n == null ? void 0 : n.split(".")) == null ? void 0 : t[1])), { iat: r, ...o } = F.decode(window.localStorage.getItem(Ye) || "", {}); - return r === s ? Promise.resolve(o) : F.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(Ye, F.encode({ ...i, iat: s })), i)); - } catch (n) { - console.error(n), e && Z.error("请登录").then(tn); - } - return Promise.resolve(null); -}, ns = (e, t, n = {}) => F.post("/api/user-token", { - username: e, - passwd: Ot.hash(t), - platform: qt, - ...n -}).then(({ token: s }) => (window.localStorage.setItem(Qe, s), s)), tn = () => { - window.localStorage.removeItem(Ye), window.localStorage.removeItem(Qe); -}; -Ze.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - try { - const t = qe(); - e.headers.Authorization = t ? `Bearer ${t} ` : void 0; - } catch { - } - return e; -}, (e) => Promise.reject({ code: -1, msg: e })); -Ze.interceptors.response.use(({ data: e, headers: t }) => ({ ...e, res: t == null ? void 0 : t.res }), function(e) { - return Promise.reject(e.message); -}); -window.addEventListener("unhandledrejection", Me.onUnhandledRejection); -Me.onToast = (e, t) => Z[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && et.redirect(ge.get("Common.WEBSITE_LOGIN_PAGE"))); -const nn = b.createContext({ - user: {}, - initUser: () => { - }, - initUserComplete: !1 -}), pt = b.createContext({ - set: () => { - }, - get: () => { - }, - assign: () => { - }, - currentRoute: () => { - } -}); -var Ve, Ge, Fe, M, le, ue; -class yt { - constructor(t, n) { - v(this, Ve, /* @__PURE__ */ new Map()); - v(this, Ge, !0); - v(this, Fe, []); - v(this, M, void 0); - v(this, le, () => u(this, M)); - v(this, ue, () => Promise.resolve()); - N(this, "get", (...t) => new Promise((n, s) => { - const r = JSON.stringify(t); - if (u(this, Ve).has(r)) - return n(u(this, ue).call(this, u(this, M), ...t)); - if (u(this, M) === void 0) - u(this, Fe).push([t, n, s]), u(this, Ge) && (E(this, Ge, !1), Promise.resolve(typeof u(this, le) == "function" ? u(this, le).call(this) : u(this, le)).then((o) => E(this, M, o || null)).finally(() => { - u(this, Fe).forEach(([o, i, a]) => { - try { - const l = u(this, ue).call(this, u(this, M), ...o); - u(this, Ve).set(JSON.stringify(o), l), i(l); - } catch (l) { - a(l); - } - }), u(this, Fe).length = 0; - })); - else { - const o = u(this, ue).call(this, u(this, M), ...t); - u(this, Ve).set(r, o), n(o); - } - })); - E(this, ue, n), E(this, le, t); - } -} -Ve = new WeakMap(), Ge = new WeakMap(), Fe = new WeakMap(), M = new WeakMap(), le = new WeakMap(), ue = new WeakMap(); -var te, Te; -const U = class U { - constructor() { - v(this, Te, null); - N(this, "init", (t) => E(this, Te, t)); - N(this, "get", (t, n) => f.get(u(this, Te), t, n)); - if (u(U, te)) - return u(U, te); - } -}; -te = new WeakMap(), Te = new WeakMap(), v(U, te, null), N(U, "getInstance", () => (u(U, te) || E(U, te, new U()), u(U, te))); -let Ke = U; -const ge = Ke.getInstance(), pe = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), rt = { - getConfigure: (e) => ge.get(e), - modal: { - notification: (...e) => Z.notification(...e), - success: (...e) => Z.success(...e), - error: (...e) => Z.error(...e) - } -}; -var Se, Re, ne; -const W = class W { - constructor() { - N(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => { - const a = We(W, Se)._++; - u(W, Re).set(a, s), W.mQueue.set(a, [o, i]), pe.postMessage({ id: a, session: r, category: "eval", method: t, args: n }); - })); - N(this, "clear", (t) => pe.postMessage({ session: t, category: "clear" })); - if (u(W, ne)) - return u(W, ne); - Promise.resolve().then(() => Hn).then((t) => { - rt.http = t.http; - }), pe.addEventListener("message", ({ data: { id: t, task_id: n, method: s, args: r, category: o, data: i, error: a, session: l } }) => { - if (o === "eval" && W.mQueue.has(t)) - a !== null ? W.mQueue.get(t)[1](a) : W.mQueue.get(t)[0](i), u(W, Re).delete(t), W.mQueue.delete(t); - else if (o === "util") - try { - const c = f.get(rt, s.split("/")) || f.get(u(W, Re).get(n), s.split("/")); - if (!f.isFunction(c)) - throw `${s} not found`; - Promise.resolve(Reflect.apply(c, void 0, r)).then((d) => { - pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: d, error: null }); - }).catch((d) => { - pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: d }); - }); - } catch (c) { - pe.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: c }); - } - }, !1); - } -}; -Se = new WeakMap(), Re = new WeakMap(), ne = new WeakMap(), N(W, "mQueue", /* @__PURE__ */ new Map()), v(W, Se, 0), v(W, Re, /* @__PURE__ */ new Map()), v(W, ne, null), N(W, "getInstance", () => (u(W, ne) || E(W, ne, new W()), u(W, ne))); -let xe = W; -const ae = xe.getInstance(); -var se, x; -const D = class D { - constructor() { - v(this, x, /* @__PURE__ */ new Map()); - N(this, "setVendor", (t, n) => u(this, x).set(t, new yt(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); - N(this, "getWidgetComponent", async (t) => { - if (!t) - throw "getWidgetComponent widget is required"; - const [, n] = t == null ? void 0 : t.split("@app/"), [, s] = t == null ? void 0 : t.split("@pkg/"), [, r] = t == null ? void 0 : t.split("@fsdpf/"); - try { - switch (!0) { - case (!!n && u(this, x).has("pkg")): - return await u(this, x).get("pkg").get(n); - case (!!s && u(this, x).has("pkg")): - return await u(this, x).get("pkg").get(s); - case (!!r && u(this, x).has("pkg")): - return await u(this, x).get("pkg").get(r); - } - } catch (o) { - throw o; - } - }); - if (u(D, se)) - return u(D, se); - } -}; -se = new WeakMap(), x = new WeakMap(), v(D, se, null), N(D, "getInstance", () => (u(D, se) || E(D, se, new D()), u(D, se))); -let Ae = D; -const B = Ae.getInstance(), sn = () => "Table"; -var re, Q, de, je; -const Y = class Y { - constructor() { - v(this, Q, null); - v(this, de, /* @__PURE__ */ new Map()); - v(this, je, () => { - if (u(this, Q)) - return u(this, Q).port.postMessage({ command: "status", data: [] }); - E(this, Q, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, Q).port.onmessage = (t) => { - var n, s; - (n = t.data) != null && n.uuid ? u(this, de).forEach((r, o) => { - 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 && F.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { - u(this, Q).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(tt, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, u(this, Q).port.postMessage({ command: "status", data: [] }); - }); - N(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, de).set(t, n), u(this, de).size == 1 && u(this, je).call(this), () => this.unsubscribe(t))); - N(this, "unsubscribe", (t) => u(this, de).delete(t)); - if (u(Y, re)) - return u(Y, re); - } -}; -re = new WeakMap(), Q = new WeakMap(), de = new WeakMap(), je = new WeakMap(), v(Y, re, null), N(Y, "getInstance", () => (u(Y, re) || E(Y, re, new Y()), u(Y, re))); -let Be = Y; -const bt = Be.getInstance(), vt = () => { - const e = j(!0), [t, n] = V(0); - return R(() => () => e.current = !1, []), () => e.current && Kt(() => { - n(t + 1); - }); -}, ss = ({ value: e, defaultValue: t, onChange: n }) => { - const s = vt(), r = j(e !== void 0 ? e : t); - e !== void 0 && (r.current = e); - const o = me(f.debounce((i) => { - e === void 0 && (r.current = i, s()), n && n(i); - }, 380, { leading: !0, trailing: !1 }), [e]); - return [r.current, o]; -}, ot = (e) => { - const t = j(); - return R(() => { - t.current = e; - }), t.current; -}, rs = (e) => { - const t = j(), [n, s] = V(e); - return R(() => { - f.isFunction(t.current) && t.current(n); - }, [n]), [n, function(r, o) { - t.current = o, s(r); - }]; -}, De = (e = b.EffectCallback, t, n = f.isEqual) => { - const s = b.useRef(t); - (!s.current || !n(t, s.current)) && (s.current = t), b.useEffect(e, [s.current]); -}, Ct = (e, t = "string") => { - var n; - if (!Array.isArray(e)) - return e; - for (let s = 0; s < e.length; s++) - e[s].value = f.toPrimitive((n = e[s]) == null ? void 0 : n.value, t), e[s] && Reflect.has(e[s], "children") && (e[s].children = Ct(e[s].children, t)); - return e; -}, os = (e, t = "json", n = "string", s, r = null) => { - const [o] = we.useForm(s), [i, a] = V([{ label: "无", value: "", disabled: !0 }]), l = j([]), c = we.useWatch((d) => l.current.length === 0 ? null : f.pick(d, l.current), o) || null; - return R(() => { - Array.isArray(e) ? a(e) : t === "javascript" && e ? ae.exec(e, {}, { - getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), o.getFieldValue(d)), - getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), r ? r.getFieldValue(d) : o.getFieldValue(d)) - }).then((d) => { - a(f.toPrimitive(d, "array")); - }) : e && a(f.toPrimitive(e, "array")); - }, [e, t, c]), Ct(i, n); -}, is = (e) => { - const [t, n] = V(), s = { type: "GET" }; - if (typeof e == "string" ? s.url = e : f.isPlainObject(e) && Object.assign(s, e), !(s != null && s.url)) - throw "url is required"; - const r = (o) => F.request(s, !1).resp((i) => (console.log("useSubscribeRequest", o), n(i), i)); - return De(() => { - let o = null; - return r().then((i) => { - o = bt.subscribe(r, i.res); - }), () => o == null ? void 0 : o(); - }, s), t; -}, rn = (e) => { - const [t, n] = b.useState({ gridItems: [], hideItems: [] }); - return b.useEffect(() => { - e && F.get(`/api/_/${e}`).then(({ - pk: s, - uuid: r, - code: o, - resource: i, - align: a, - listenChangeFields: l, - listenChangeFieldsFunc: c, - fields: d - }) => ({ - pk: s, - uuid: r, - code: o, - resource: i, - align: a, - listenChangeFields: l, - listenChangeFieldsFunc: c, - ...d.reduce((h, p) => { - var m; - return (m = p == null ? void 0 : p.field) != null && m.hidden ? h.hides.push(p == null ? void 0 : p.field) : h.items.push(p), h; - }, { items: [], hides: [] }) - })).then(n); - }, [e]), t; -}, on = ({ - max: e = 0, - min: t = 0, - type: n = "", - message: s, - pattern: r, - required: o = !1, - validator: i -} = {}, a, l) => { - const [c, d] = V([]); - return R(() => { - const h = []; - if (o) { - let p = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - p = "boolean"; - break; - case "json": - p = "object"; - break; - } - h.push({ type: p, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (n) { - case "string": - h.push({ - type: n, - max: e, - min: t, - message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) - }); - break; - case "pattern": - h.push({ type: "string", pattern: r, message: s }); - break; - case "validator": - i && h.push(({ getFieldValue: p }) => ({ - validator: async (m, y) => { - const C = await ae.exec(i, { value: y, fieldName: a }, { getFieldValue: p }); - return f.isString(C) && C ? Promise.reject(C) : f.isBoolean(C) && !C ? Promise.reject(s) : Promise.resolve(); - } - })); - break; - } - d(h); - }, [e, t, n, s, r, o, i]), c; -}, an = (e, t, n) => { - const [s, r] = V(null); - return R(() => { - const { - initDataUri: o = `/api/${e}`, - initDataMethod: i = "GET" - } = n || {}; - F.request({ - method: i, - url: f.trimEnd(`${o}/${t}`, "/") - }).then((a) => { - r(a); - }); - }, [e, t, n]), s; -}, cn = (e, t, n, s = {}) => { - const r = vt(), o = j(!0), i = j([]), [a, l] = V(n), c = we.useWatch((d) => JSON.stringify(f.pick(d, i.current)), t) || "{}"; - return R(() => { - e && ae.exec(e, s, { - getFieldValue: f.wrap(t.getFieldValue, (d, h) => (i.current.some((p) => f.isEqual(p, h)) || (i.current.push(h), r()), d(h))), - isFieldTouched: t.isFieldTouched, - isFieldsTouched: t.isFieldsTouched - }).then((d) => o.current && l(d)); - }, [e, c, t, s]), R(() => () => o.current = !1, []), a; -}, ln = (e) => ({ - code: t, - layout: n, - name: s, - primaryKey: r = 0, - style: o = {}, - formProps: i = {}, - form: a, - isPreview: l = !1, - className: c, - onFinish: d, - onValuesChange: h = () => { - }, - ...p -}) => { - const { - align: m, - autoComplete: y, - resource: C, - items: w, - hides: X, - rowHeight: Ne, - marginX: L, - marginY: ce, - listenChangeFields: q, - listenChangeFieldsFunc: I, - pk: O, - uuid: J - } = rn(t), [T] = be.useForm(a), _ = ({ - changedValues: P, - allValues: H, - listenChangeFields: wt, - listenChangeFieldsFunc: nt, - onValuesChange: $n, - code: zn - }) => { - nt && Array.isArray(wt) && ae.exec( - nt, - { changedValues: P, allValues: H }, - { - getFieldValue: T.getFieldValue, - setFieldsValue: T.setFieldsValue, - isFieldTouched: T.isFieldTouched, - isFieldsTouched: T.isFieldsTouched - } - ); - }, Ie = ie(() => [ - { name: "__PK__", value: O }, - { name: "__PROPS__", value: i }, - { name: "__RESOURCE__", value: C }, - { name: "__LAYOUT_KEY__", value: t }, - { name: "__LAYOUT_UUID__", value: J }, - { name: "__PRIMARY_KEY__", value: r } - ], [O, t, J, C, r, i]); - return /* @__PURE__ */ S( - be, - { - className: c, - requiredMark: !0, - name: s || t, - layout: n || m, - fields: Ie, - form: T, - autoComplete: y, - style: { ...o, position: "relative" }, - onFinish: d, - onValuesChange: (P, H) => _( - { - changedValues: P, - allValues: H, - listenChangeFields: q, - listenChangeFieldsFunc: I, - onValuesChange: h, - code: t - } - ), - children: [ - /* @__PURE__ */ g( - e, - { - ...p, - form: T, - code: t, - fields: w, - rowHeight: Ne, - marginX: L, - marginY: ce - } - ), - X == null ? void 0 : X.map((P) => { - var H; - return /* @__PURE__ */ g(mt, { name: P.code, children: /* @__PURE__ */ g( - un, - { - form: T, - name: P.code, - type: P.type, - initialValue: P.initialValue, - initialValueLanguage: (H = P.extras) == null ? void 0 : H.initialValueLanguage - } - ) }, JSON.stringify(P.code)); - }) - ] - } - ); -}, un = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { - const o = cn( - n == "javascript" && t, - r, - n == "javascript" ? void 0 : t, - {} - ); - return R(() => { - n == "javascript" ? s(f.toPrimitive(o, e)) : s(f.toPrimitive(t, e)); - }, [e, t, o]), null; -}, dn = (e) => function({ code: n, data: s, ...r }) { - const [o, i] = V({ - resource: null, - cols: 12, - rowHeight: 21, - fields: [] - }); - return R(() => { - n && F.get(`/api/_/${n}`).then((a) => i(f.pick(a, ["resource", "cols", "rowHeight", "fields"]))); - }, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ g( - e, - { - ...r, - rowHeight: o.rowHeight, - cols: o.cols, - fields: o.fields, - data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {} - } - ); -}, fn = "RC_FORM_INTERNAL_HOOKS", Vt = (e, { - initialValue: t, - initialValueLanguage: n, - convertJs: s, - convertJsSetting: r, - type: o = "string" -}, i = null) => { - const a = j(!1), l = ut(Yt), [c, d] = V(), [h, p] = V(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: m } = l.getInternalHooks(fn) || {}; - return R(() => m == null ? void 0 : m((y, C, w) => { - if (!a.current) - return; - const X = f.get(C, e); - f.isEqual(X, h) || p(f.toPrimitive(X, o)); - }), [h]), R(() => { - n == "javascript" && t ? ae.exec(t, {}, { - getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), - getFieldValue: (y) => l.getFieldValue(y) - }).then((y) => p(f.toPrimitive(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => a.current = !0) : (t && p(f.toPrimitive(t || l.getFieldValue(e) || t, o)), a.current = !0); - }, [t, n]), De(() => { - a.current && s && B.getWidgetComponent(s).then(({ default: y }) => y({ value: h, record: l.getFieldsValue(!0), $setting: r })).then(d).catch((y) => console.error("布局数据转换错误: ", y, s)); - }, [h, s, r]), [c || h, h]; -}, mn = (e, t, n, s, r, o) => { - const i = { - "--grid-layout-h": `${s}`, - "--grid-layout-w": `${n}`, - "--grid-layout-x": `${e}`, - "--grid-layout-y": `${t}`, - "--grid-layout-row-height-offset": "0px" - }; - return r != null && r.autoHeight ? i.height = "fit-content" : i["--grid-layout-row"] = `${s}`, i["--grid-layout-box-margin"] = it(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"] = it(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; -}, it = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Ft = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: a, ...l }) => { - const [c] = we.useForm(), d = Rt(n, hn, "@pkg/grid-layouts"), h = ie(() => [ - { name: "__PROPS__", value: i } - ], [i]); - return De(() => { - c.setFieldsValue(s); - }, [s]), /* @__PURE__ */ g(we, { fields: h, form: c, component: !1, children: /* @__PURE__ */ g( - "div", - { - ...l, - className: $("ff-grid-layout", a), - 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: d - } - ) }); -}, Rt = (e, t, n = "@pkg/grid-layouts", s = null) => ie(() => { - var r; - return (r = f.sortBy(e, ["y", "x"])) == null ? void 0 : r.map( - ({ i: o, x: i, y: a, w: l, h: c, field: { boxStyle: d, widgetPrefix: h = n, widget: p, ...m } }, y) => /* @__PURE__ */ g( - "div", - { - className: "grid-layout-item", - style: mn(i, a, l, c, d, p === "Height" && (m == null ? void 0 : m.initialValue)), - children: /* @__PURE__ */ g( - gn, - { - ...m, - basicForm: s, - itemWidget: p != null && p.startsWith("@") ? p : `${h}/${p}`, - itemWidgetRender: t - } - ) - }, - o || y - ) - ); -}, [e]), gn = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { - const [r, o] = V(); - return R(() => { - B.getWidgetComponent(e).then(({ defaultProps: i, default: a }) => { - o(b.createElement(t(a, i, n), s)); - }).catch((i) => o(e)); - }, [e]), r; -}, hn = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: a, - initialValue: l, - initialValueLanguage: c, - convertJs: d, - convertJsSetting: h, - ...p - } = f.merge({}, t, s), [m, y] = Vt(a ? null : r, { - initialValue: l, - initialValueLanguage: c, - convertJs: d, - convertJsSetting: h, - type: (p == null ? void 0 : p.type) || "string" - }, n); - return /* @__PURE__ */ g(e, { ...p, value: m, rawValue: y, $setting: i || {} }); -}, as = dn(Ft), kt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => { - const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, l] = V(); - return R(() => { - i && B.getWidgetComponent(i).then(({ defaultProps: c, default: d }) => ({ - default: Nt(d, c, r) - })).catch((c) => ({ default: () => `${c}` })).then((c) => l(b.createElement(c.default, o))); - }, [i]), a && b.cloneElement(a, o); -}; -kt.defaultProps = { - widgetPrefix: "@pkg/grid-layout-forms", - widget: "Input" -}; -const Nt = (e, t, n = null) => (s) => { - const { - type: r, - code: o, - label: i, - noStyle: a, - placeholder: l, - extras: c, - validators: d, - help: h, - isVirtual: p, - initialValue: m, - initialValueLanguage: y, - convertJs: C, - convertJsSetting: w, - widgetPerfix: X, - boxStyle: Ne, - widgetDecorator: L, - subWidgets: ce, - ...q - } = { ...t, ...s }, I = on(d || {}, o, r), O = { - label: i, - noStyle: a, - colon: !1 - }, J = { - placeholder: l, - ...q - }; - return /* @__PURE__ */ g( - mt, - { - name: o, - rules: I, - normalize: (T) => T == null ? void 0 : f.toPrimitive(T, r), - children: (T, _, Ie) => { - var P; - return /* @__PURE__ */ g( - e, - { - type: r, - rcform: Ie, - itemProps: { - validateStatus: _.errors.length > 0 ? "error" : "success", - tooltip: h, - help: _.errors.length > 0 ? _.errors.join("、") : null, - required: ((P = I == null ? void 0 : I[0]) == null ? void 0 : P.required) || !1, - ...O - }, - fieldProps: { ...J, ...T }, - $setting: c || {} - } - ); - } - } - ); -}, _e = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { - const o = Rt(r, Nt, "@pkg/grid-layout-forms"); - return /* @__PURE__ */ g(jt, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ g("div", { className: "ff-grid-layout-form", style: { - "--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 }) }); -}; -_e.propTypes = { - fields: G.array.isRequired -}; -_e.defaultProps = { - fields: [] -}; -const pn = ln(_e), It = ({ children: e }) => { - const [t, n] = V({}), s = me((o, i) => n((a) => ({ ...a, [o]: i })), []), r = me((o) => n((i) => ({ ...i, [o]: void 0 })), []); - return /* @__PURE__ */ g(he.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); -}; -It.defaultProps = { - isDrawerRender: !1 -}; -It.propTypes = { - isDrawerRender: G.bool -}; -const yn = (e = {}, t = {}, n = {}, s = "") => f.deepSome(e, (r, o) => o === "type" && r === "code") ? Wt(e, t, n, s) : Lt(e, t, n, s), Wt = async (e = {}, t = {}, n = {}, s = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let o in e) - if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) { - const { type: i, value: a = "", default: l = s } = e[o]; - switch (i) { - case "code": - r[o] = await ae.exec(a, n, {}) || l; - break; - case "field": - r[o] = f.get(n, a, l); - break; - case "router": - r[o] = t[a] || l; - break; - case "query": - r[o] = f.get(t.$query, o) || l; - break; - case "string": - r[o] = a || l; - } - } else - r[o] = await Wt(e[o], t, n, s); - return r; -}, Lt = (e = {}, t = {}, n = {}, s = "") => Object.keys(e || {}).reduce((r, o) => { - if (f.isPlainObject(e[o])) - if (Reflect.has(e[o], "type") && ["field", "router", "query", "string"].includes(e[o].type)) { - const { type: i, value: a = "", default: l = s } = e[o]; - switch (i) { - case "field": - r[o] = f.get(n, a, l); - break; - case "router": - r[o] = t[a] || l; - break; - case "query": - r[o] = f.get(t.$query, o) || l; - break; - case "string": - r[o] = a || l; - } - } else - r[o] = Lt(e[o], t, n, s); - return r; -}, {}), bn = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => et.redirect(t, e, { replace: n }), at = (e, t, { status: { loading: n, disabled: s }, setStatus: r }) => { - const o = { - loading: (i) => i === void 0 ? n : r((a) => ({ ...a, loading: i })), - disabled: (i) => i === void 0 ? s : r((a) => ({ ...a, disabled: i })) - }; - return f.isFunction(t) ? t.call(null, { ...e, ...o }) : f.isString(t) && t ? ae.exec(t, e, o) : null; -}, ct = (e, t, n, s) => Z.modal( - t, - { ...e, $setting: n, code: t }, - s -), vn = (e, t, n, s) => Z.modal( - Nn, - { ...e, $setting: n, code: t }, - s -), Cn = ({ - widget: e, - widgetType: t, - widgetData: n, - widgetProps: s, - widgetSetting: r, - widgetContainerProps: o -}, { onAfterClick: i, onBeforeClick: a }) => { - let l = gt(); - ut(pt); - const [c, d] = V({ leading: !0, trailing: !1 }), h = ie(() => { - switch (t) { - case "redirect": - return f.partialRight(bn, e, r); - case "func": - return f.partialRight(at, (r == null ? void 0 : r.code) || e, { status: c, setStatus: d }); - case "fsdpf-component": - return f.partialRight(ct, e, r, o); - case "grid-layout-form": - return f.partialRight(vn, e, r, o); - default: - if (Zt(e)) - return f.partialRight(ct, e, r, o); - if (f.isFunction(e)) - return f.partialRight(at, (r == null ? void 0 : r.code) || e, { status: c, setStatus: d }); - } - return (...m) => console.error("useButton unknown widgetType", t, ...m); - }, [e, t]); - return [f.debounce((m) => (a == null || a(m), Promise.resolve(yn(s, l, m)).then((y) => h({ ...n, ...y })).then((y) => i == null ? void 0 : i(y))), 300, { leading: !0, trailing: !1 }), c]; -}, Oe = (e) => function({ - className: n, - children: s, - name: r, - icon: o, - type: i, - data: a, - noAuthType: l, - onAfterClick: c, - onBeforeClick: d, - loading: h, - disabled: p, - tooltip: m, - popConfirm: y, - widget: C, - widgetType: w, - widgetData: X, - widgetProps: Ne, - widgetSetting: L, - widgetContainerProps: ce, - ...q -}) { - const I = { - type: "primary", - className: $("ff-button", n) - }; - i === "danger" ? I.danger = !0 : i === "default" && (I.type = i), e === "link" || e === "dashed" ? (I.type = e, i === "default" && (I.className = $(I.className, "ff-default"))) : (e === "circle" || e === "round") && (I.shape = e), o && (I.icon = /* @__PURE__ */ g(ht, { type: o })); - const [O, J] = V(!1), [T, { disabled: _, loading: Ie }] = Cn({ widget: C, widgetType: w, widgetData: X, widgetProps: Ne, widgetSetting: L, widgetContainerProps: ce }, { onAfterClick: c, onBeforeClick: d }); - return /* @__PURE__ */ g( - Ut, - { - okText: "确定", - cancelText: "取消", - ...y || {}, - disabled: _ || p, - open: O, - onOpenChange: (H) => { - if (!H) - return J(H); - y ? J(H) : T(a); - }, - onConfirm: () => { - T(a); - }, - onClick: (H) => { - H.stopPropagation(); - }, - children: /* @__PURE__ */ g(Dt, { ...m, title: O ? null : m == null ? void 0 : m.title, trigger: ["hover", "click"], children: /* @__PURE__ */ g( - Le, - { - loading: Ie || h, - disabled: _ || p, - ...I, - ...q, - children: s || r - } - ) }) - } - ); -}, k = Oe("default"), Vn = Oe("link"), Fn = Oe("circle"), Rn = Oe("round"), kn = Oe("dashed"); -k.defaultProps = { - type: "default" -}; -k.propTypes = { - type: G.oneOf(["primary", "default", "danger"]), - name: G.string, - // 按钮名称 - icon: G.string, - // 图标 - data: G.any, - // onClick 数据源, 会受到 widgetProps 数据结构影响 - widget: G.any, - // 组件 - widgetType: G.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout"]), - // 组件类型 - widgetData: G.object, - // onClick缺省数据 - widgetProps: G.object, - // data 数据结构 - widgetSetting: G.object, - // $setting - widgetContainerProps: G.object - // 容器配置 -}; -k.Link = Vn; -k.Link.defaultProps = k.defaultProps; -k.Link.propTypes = k.propTypes; -k.Circle = Fn; -k.Circle.defaultProps = k.defaultProps; -k.Circle.propTypes = k.propTypes; -k.Round = Rn; -k.Round.defaultProps = k.defaultProps; -k.Round.propTypes = k.propTypes; -k.Dashed = kn; -k.Dashed.defaultProps = k.defaultProps; -k.Dashed.propTypes = k.propTypes; -const Nn = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => { - const [i] = be.useForm(), a = an(s, r, e); - R(() => { - a && i.setFieldsValue(a); - }, [a]); - const l = () => { - const c = i.getFieldValue("__RESOURCE__"), { - initDataUri: d = `/api/${s}` - } = e || {}; - i.validateFields(!0).then((h) => c ? f.pick(h, [c]) : h).then((h) => F.post(r ? `${d}/${r}` : `${d}`, h).msg(t)).catch(() => Toast.error("请先完善表单信息", { duration: 2e3 })); - }; - return /* @__PURE__ */ g( - A, - { - actions: /* @__PURE__ */ S(b.Fragment, { children: [ - /* @__PURE__ */ g(k, { name: "保存", type: "primary", widget: l }), - /* @__PURE__ */ g(k, { name: "取消", widget: () => t(!1) }) - ] }), - extras: n, - children: /* @__PURE__ */ g(pn, { form: i, code: s, primaryKey: r, ...o }) - } - ); -}, In = (e, t, n = "children") => { - if (f.isEmpty(e)) - return {}; - const s = f.find(e, ["value", t]); - if (!f.isEmpty(s)) - return s; - const r = e.length; - for (let o = 0; o < r; o++) { - const { [n]: i } = e[o], a = In(i, t, n); - if (!f.isEmpty(a)) - return a; - } - return {}; -}, Wn = ({ listCode: e, className: t, record: n, props: s, children: r, cb: o, ...i }) => { - var d, h; - const [a, l] = V(!1), c = () => { - }; - return s != null && s.editableByJs && (s != null && s.uuid) && ((d = c(s.uuid)) != null && d.auth) ? /* @__PURE__ */ g( - ft, - { - overlayClassName: "ff-data-list-editable-popover", - title: s != null && s.title ? `${s == null ? void 0 : s.title} - 编辑` : "编辑", - trigger: ["contextMenu"], - placement: (s == null ? void 0 : s.align) === "right" ? "topRight" : "topLeft", - arrowPointAtCenter: (s == null ? void 0 : s.align) === "center", - open: a, - onOpenChange: l, - overlayStyle: { width: ((h = s == null ? void 0 : s.editableByJsSetting) == null ? void 0 : h.width) || 260 }, - content: /* @__PURE__ */ g(Ln, { ...s, listCode: e, record: n, onCancel: () => { - l(!1); - }, cb: o }), - children: /* @__PURE__ */ g("td", { className: $(t, "ff-data-list-editable-cell"), children: r, ...i }) - } - ) : /* @__PURE__ */ g("td", { className: t, children: r, ...i }); -}, Ln = ({ dataIndex: e, record: t, onCancel: n, uuid: s, title: r, type: o, listCode: i, editableByJs: a, editableByJsSetting: l, cb: c }) => { - const [d] = be.useForm(), h = (l == null ? void 0 : l.primaryKey) || "", p = () => d.validateFields().then(({ value: y }) => { - const C = f.get(t, h.substring(h.indexOf(".") + 1)); - if (C) - F.put(`/api/${i}-storeBy-${s}/${C}`, { value: y }).msg(c).then(n); - else - throw "获取更新主键失败!"; - }).catch(console.warn), m = () => { - d.setFieldsValue({ - value: f.get(t, e), - __PROPS__: JSON.parse(JSON.stringify(t)) - }); - }; - return R(() => { - m(); - }, [JSON.stringify(t)]), /* @__PURE__ */ S(be, { form: d, layout: "vertical", children: [ - /* @__PURE__ */ g( - kt, - { - label: null, - code: ["value"], - widget: a, - placeholder: r, - ...f.omit(l, ["primaryKey", "width", "height"]) - } - ), - /* @__PURE__ */ g(be.Item, { noStyle: !0, name: ["__PROPS__"], children: /* @__PURE__ */ g("div", {}) }), - /* @__PURE__ */ S("div", { className: "fsdpf-editable-popover-footer", children: [ - /* @__PURE__ */ g(Le, { size: "small", onClick: m, children: "重置" }), - /* @__PURE__ */ S(Le.Group, { children: [ - /* @__PURE__ */ g(Le, { size: "small", onClick: n, children: "取消" }), - /* @__PURE__ */ g(Le, { size: "small", type: "primary", onClick: p, children: "确定" }) - ] }) - ] }) - ] }); -}, Zn = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { - const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = V(); - return R(() => { - r && B.getWidgetComponent(r).then(({ defaultProps: a, default: l }) => ({ - default: wn(l, a, n) - })).catch((a) => ({ default: () => `${a}` })).then((a) => i(b.createElement(a.default, s))); - }, [r]), o; -}, wn = (e, t, n = null) => (s) => { - const { - code: r, - label: o, - extras: i, - isVirtual: a, - initialValue: l, - initialValueLanguage: c, - convertJs: d, - convertJsSetting: h, - value: p, - ...m - } = f.merge({}, t, s), [y, C] = Vt(a ? null : r, { - initialValue: l, - initialValueLanguage: c, - convertJs: d, - convertJsSetting: h, - type: (m == null ? void 0 : m.type) || "string" - }, n); - return /* @__PURE__ */ g(e, { ...m, value: y, rawValue: C, $setting: i || {} }); -}; -Zn.defaultProps = { - widgetPrefix: "@pkg/grid-layouts" -}; -const Gn = ({ className: e, children: t, itemOperations: n, resource: s, $setting: r }) => /* @__PURE__ */ g("div", { className: $("ff-data-list-grid-layout-items", e), children: b.Children.map(t, (o) => /* @__PURE__ */ g( - Tn, - { - operations: n, - data: s ? { [s]: o.props.data } : o.props.data, - children: o - } -)) }), Tn = ({ operations: e, children: t, data: n }) => f.isEmpty(e) ? t : /* @__PURE__ */ g( - ft, - { - destroyTooltipOnHide: !0, - align: { offset: [0, -8] }, - zIndex: 100, - mouseLeaveDelay: 0.2, - placement: "topRight", - content: /* @__PURE__ */ g("div", { className: "ff-data-list-item-operations flex-grow-1", children: e == null ? void 0 : e.map(({ isRefresh: s, ...r }) => /* @__PURE__ */ g( - k, - { - ...r, - data: n, - onAfterClick: (o) => console.log("列表按钮回调", o, n) - }, - (r == null ? void 0 : r.uuid) || useId() - )) }), - children: t - } -), En = ({ - theme: e, - themeProps: t, - itemClassName: n, - className: s, - dataSource: r, - fields: o, - itemOperations: i, - itemOperationsAccess: a, - resource: l, - primaryKey: c, - ...d -}) => { - const h = Et(), p = ie(() => /* @__PURE__ */ g(Ft, { ...d, fields: o }), [o, d]), m = ie(() => r == null ? void 0 : r.map((w, X) => b.cloneElement(p, { key: `${h}-${(w == null ? void 0 : w[c]) || X}`, data: w })), [r, p]), y = ie(() => e ? b.lazy(() => B.getWidgetComponent(e).catch((w) => ({ default: () => `${w}` }))) : null, [e]), C = { - $setting: t, - resource: l, - primaryKey: c, - itemOperations: i, - itemOperationsAccess: a, - className: s, - itemClassName: n, - children: m - }; - return y ? /* @__PURE__ */ g(b.Suspense, { fallback: /* @__PURE__ */ g("div", { style: { width: "100%", height: "100%" } }), children: /* @__PURE__ */ g(y, { ...C }) }) : /* @__PURE__ */ g(Gn, { ...C }); -}, On = ({ listCode: e, base62params: t, className: n, itemClassName: s }) => { - const [r, o] = V(/* @__PURE__ */ new Map()), [i, a] = V([]), [{ - resource: l, - primaryKey: c, - cols: d, - rowHeight: h, - fields: p, - itemOperations: m = [], - marginX: y, - marginY: C, - themeConfig: w, - theme: X, - isItemGridLayout: Ne, - itemGridLayout: L - }, ce] = V({ isItemGridLayout: !1, itemGridLayout: {} }), q = () => F.list(e, t).then(({ operationsAccess: I, dataSource: O }) => { - o(new Map(I)), a(O); - }); - return R(() => { - let I = null; - return F.get(`/api/_/${e}`).resp(({ data: O, res: J }) => { - O != null && O.isDynamicRefresh && (I = bt.subscribe(q, J)), ce(O); - }).catch(() => ce({})), a([null]), () => I == null ? void 0 : I(); - }, [e]), R(() => { - q(); - }, [t]), /* @__PURE__ */ g( - En, - { - className: n, - itemClassName: s, - dataSource: i, - resource: l, - primaryKey: c, - itemOperations: m, - itemOperationsAccess: r, - theme: X, - themeProps: w, - cols: L == null ? void 0 : L.cols, - rowHeight: L == null ? void 0 : L.rowHeight, - fields: L == null ? void 0 : L.fields, - itemMargin: [L == null ? void 0 : L.marginX, L == null ? void 0 : L.marginY] - } - ); -}, Pn = (e, t, n, s, r) => { - const o = b.lazy(() => B.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` }))); - return /* @__PURE__ */ g(b.Suspense, { children: /* @__PURE__ */ g( - o, - { - value: t, - record: n, - $setting: s, - base62params: r - } - ) }, e); -}, cs = (e, t = {}) => (ot(e), ot(t), e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? { - ...o, - render: (a, l) => { - const c = Pn(s, a, l, r, t); - return f.isFunction(o == null ? void 0 : o.render) ? o.render(c, a, l) : c; - } -} : o)), ls = (e) => { - const [t, n] = V({}); - return R(() => { - let s = !1; - return e && F.get(`/api/_/${e}`).then((r) => f.pick(r, [ - "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; -}, us = (e, t = {}) => { - const [n, s] = V({ dataSource: [] }); - return De(() => { - let r = !1; - return e && F.get(`/api/${e}/${F.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0; - }, [e, t]), n; -}; -sn.EditableCell = Wn; -const Xn = ({ component: e }) => { - const { base62params: t } = gt(); - return /* @__PURE__ */ g( - On, - { - listCode: e, - base62params: F.decode(t) - } - ); -}; -var oe, z, ke, fe, Ee; -const K = class K { - constructor() { - v(this, z, /* @__PURE__ */ new Map()); - v(this, ke, {}); - v(this, fe, null); - N(this, "init", (t, n) => { - E(this, z, t), E(this, ke, n); - }); - N(this, "get", (t) => (u(this, z).has(t) || (t = Array.from(u(this, z).keys()).find((n) => u(this, z).get(n).uri === t)), u(this, z).get(t) || {})); - N(this, "redirect", (t, n, s = {}) => { - const { uri: r, type: o, widgetProps: i } = this.get(t); - let a = xt(r, o != "list" ? n : f.mapValues(n, (c) => F.encode(c))); - const l = new URLSearchParams(); - for (const c in i || {}) - (i == null ? void 0 : i.type) == "query" && l.append(c, n[c]); - return l.size > 0 && (a = `${a}?${l.toString()}`), u(this, fe).navigate(a, s); - }); - /** - * - * @param {*} category // user, system, navigator - * @returns - */ - N(this, "getMenus", (t) => { - var n; - return ((n = u(this, ke)) == null ? void 0 : n[t]) || []; - }); - N(this, "getCurrentMenu", () => { - var s, r; - const t = getCurrentPages(), n = Object.values(u(this, ke)).flat(); - for (let o = t.length - 1; o >= 0; o--) - if ((s = t[o].query) != null && s.c) - return u(this, Ee).call(this, (r = t[o].query) == null ? void 0 : r.c, n); - return null; - }); - N(this, "getCurrentRoute", (t = 0) => { - var s; - const n = (s = u(this, fe).state.matches[u(this, fe).state.matches.length - 1 - t]) == null ? void 0 : s.route; - if (!n) - return null; - for (let [r, o] of u(this, z)) - if (o.uri === n.path) - return o; - return null; - }); - v(this, Ee, (t, n) => { - var s; - for (const r of n) { - if (r.uuid == t || r.widget == t) - return r; - if ((s = r.children) != null && s.length) { - const o = u(this, Ee).call(this, t, r.children); - if (o) - return o; - } - } - return null; - }); - N(this, "createBrowserRouter", (t = {}) => { - if (u(this, z).size == 0) - return null; - const n = ge.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"); - ge.get(en() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"); - const s = { [n]: 0 }, r = Array.from(u(this, z).values()).reduce((o, { uuid: i, uri: a, name: l, type: c, component: d, isLogin: h, isLayout: p, extra: m }) => { - let y = {}, C = 0; - switch (c) { - case "list": - y.element = b.createElement(Xn, { component: d }); - break; - case "fsdpf-component": - y.lazy = () => B.getWidgetComponent(d).then((w) => ({ Component: w.default })); - break; - } - if (m != null && m.layout) - if (s[m == null ? void 0 : m.layout]) - C = s[m == null ? void 0 : m.layout]; - else - return s[m == null ? void 0 : m.layout] = o.length, [...o, { - path: "/", - lazy: () => B.getWidgetComponent(m == null ? void 0 : m.layout).then((w) => ({ Component: w.default })), - children: [{ path: a, ...y }] - }]; - return p && C > -1 ? (o[C].children.push({ path: a, ...y }), o) : [...o, { path: a, ...y }]; - }, [ - { - path: "/", - lazy: () => B.getWidgetComponent(n).then((o) => ({ Component: o.default })), - children: [] - } - ]); - return E(this, fe, At(r, t)); - }); - if (u(K, oe)) - return u(K, oe); - } -}; -oe = new WeakMap(), z = new WeakMap(), ke = new WeakMap(), fe = new WeakMap(), Ee = new WeakMap(), v(K, oe, null), N(K, "getInstance", () => (u(K, oe) || E(K, oe, new K()), u(K, oe))); -let Je = K; -const et = Je.getInstance(), lt = { - 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" -}; -f.mixin({ - toPairsDeep: (e, t) => f.flatMap( - f.toPairs(e), - ([n, s]) => f.isObjectLike(s) ? f.toPairsDeep(s, n) : [[`${f.isUndefined(t) ? "" : t + "."}${n}`, s]] - ), - deepSome: (e, t = () => !1) => f.some(e, (n) => { - if (f.some(n, t)) - return !0; - if (!f.isEmpty(n) && (f.isPlainObject(n) || f.isArray(n))) - return f.deepSome(n, t); - }), - toPrimitive: (e, t) => { - let n = "string"; - Array.isArray(e) ? n = "array" : n = typeof e, f.isObject(e) && (n = "json"); - const s = `${n}2${t}`; - return Reflect.has(lt, s) ? lt[s](e) : e; - }, - replaceKeys: (e, t) => !e || typeof e != "object" ? e : Array.isArray(e) ? e.map((n) => f.replaceKeys(n, t)) : Object.keys(e).reduce((n, s) => (t[s] ? n[t[s]] = f.replaceKeys(e[s], t) : n[s] = f.replaceKeys(e[s], t), n), {}) -}); -let tt = ""; -const F = { - init: (e, t, n) => { - Ze.defaults.baseURL = tt = n, Ze.defaults.timeout = 15e3, Object.assign(F, new Me(e, t, Ze)); - } -}, Zt = (e) => { - var t; - return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof b.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); -}, Hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - AppGlobalParamsContext: pt, - get AppUrl() { - return tt; - }, - cache: yt, - configure: ge, - core: B, - default: nn, - func: ae, - http: F, - isReactComponent: Zt, - route: et -}, Symbol.toStringTag, { value: "Module" })), ds = () => F.get("/api/my-router").then((e) => [ - ...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" } -].map(({ uuid: t, ...n }) => [t, { uuid: t, ...n }])).then((e) => new Map(e)), fs = () => F.get("/api/my-menu"), ms = () => F.get("api/init-configure"), gs = () => F.get("/api/init-widget-operation-auth"), hs = (e) => F.get(`/api/user-wx-phone-number/${e}`); -export { - cs as A, - k as B, - ls as C, - En as D, - us as E, - Z as F, - pn as G, - tt as H, - ht as I, - F as J, - Zt as K, - nn as L, - pt as M, - yt as N, - ge as O, - ae as P, - B as Q, - bt as R, - he as S, - sn as T, - et as U, - ds as V, - fs as W, - ms as X, - gs as Y, - hs as Z, - ts as a, - tn as b, - en as c, - ss as d, - ot as e, - rs as f, - qe as g, - De as h, - os as i, - is as j, - A as k, - ns as l, - es as m, - It as n, - Cn as o, - _e as p, - kt as q, - Nn as r, - cn as s, - In as t, - vt as u, - as as v, - Ft as w, - Zn as x, - On as y, - Pn as z -}; diff --git a/dist/components.js b/dist/components.js index 33e18c5..5508377 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { I as s, F as r } from "./common/main-v06hYH4g.js"; +import { I as s, F as r } from "./common/main-DF2XGSyn.js"; export { s as Icon, r as Toast diff --git a/dist/container.js b/dist/container.js index 1132ec4..ef4e590 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { S as s, n as t, F as n, m as o, k as r } from "./common/main-v06hYH4g.js"; +import { S as s, n as t, F as n, m as o, k as r } from "./common/main-DF2XGSyn.js"; export { s as Context, t as FFPageRender, diff --git a/dist/data-list.js b/dist/data-list.js index 5732317..d87b4f0 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,10 +1,19 @@ -import { D as e, y as t, T as u, z as r, A as d, E as i, C as l } from "./common/main-v06hYH4g.js"; +import { M as s, K as e, A as r, H as i, N as o, J as D, E as L, L as l, C as u, N as n, D as d, O as m, P as C, T as F, U as T, Q as b } from "./common/main-DF2XGSyn.js"; export { - e as DataList, - t as DataListHelper, - u as default, - r as loadDataListFieldWidget, - d as useColumnsRender, - i as useDataSource, - l as useStructure + s as DataListContent, + e as DataListContext, + r as DataListFilter, + i as DataListFooter, + o as DataListFramework, + D as DataListHelper, + L as DataListSider, + l as DataListTable, + u as DataListToolbar, + n as DataTableFramework, + d as default, + m as loadDataListFieldWidget, + C as useColumnsRender, + F as useDataSource, + T as useHasOperationColumn, + b as useStructure }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 1eff8cd..d618e05 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,9 +1,9 @@ -import { p as t, r as e, q as o, G as s, t as u, s as d } from "./common/main-v06hYH4g.js"; +import { o as r, q as e, p as t, G as s, s as u, r as d } from "./common/main-DF2XGSyn.js"; export { - t as GridLayoutForm, + r as GridLayoutForm, e as GridLayoutFormHelper, - o as GridLayoutFormWidget, + t as GridLayoutFormWidget, s as default, - u as getOptionsItemByValue, + u as getOptionItemByValue, d as useFnRun }; diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 785f976..e7ce079 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { w as d, x as o, v as r } from "./common/main-v06hYH4g.js"; +import { y as d, z as o, x as r } from "./common/main-DF2XGSyn.js"; export { d as GridLayout, o as GridLayoutWidget, diff --git a/dist/hooks.js b/dist/hooks.js index f641374..34443a7 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,13 +2,13 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-dom"; -import { h as p, i as r, e as i, d as m, f, j as l, u as b } from "./common/main-v06hYH4g.js"; +import { h as o, i as p, e as r, d as m, f, j as l, u as b } from "./common/main-DF2XGSyn.js"; export { - p as useDeepEqualEffect, - r as useOptions, - i as usePrevious, + o as useDeepEqualEffect, + p as useOptions, + r as usePrevious, m as usePropsValue, - f as useStateCallback, + f as useStateWithCallback, l as useSubscribeRequest, b as useUpdate }; diff --git a/dist/index.js b/dist/index.js index a6a4485..b810a59 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ import "lodash"; import "axios"; import "react"; -import { M as e, H as m, N as c, O as i, Q as n, L as f, P as l, J as u, K as h, U as x } from "./common/main-v06hYH4g.js"; +import { Z as e, V as m, _ as c, $ as i, a1 as n, Y as f, a0 as l, W as u, X as h, a2 as x } from "./common/main-DF2XGSyn.js"; import "ff-request"; export { e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js index 8776fe0..a86d44d 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-v06hYH4g.js"; +import { R as a } from "./common/main-DF2XGSyn.js"; export { a as default }; diff --git a/dist/service.js b/dist/service.js index dc535ac..3382a9d 100644 --- a/dist/service.js +++ b/dist/service.js @@ -1,8 +1,8 @@ -import { X as g, W as s, Z as a, V as o, Y as r } from "./common/main-v06hYH4g.js"; +import { a5 as t, a4 as g, a7 as s, a3 as o, a6 as r } from "./common/main-DF2XGSyn.js"; export { - g as getConfigure, - s as getMenus, - a as getPhoneNumber, + t as getConfigure, + g as getMenus, + s as getPhoneNumber, o as getRoutes, r as getWidgetOperationAuth }; diff --git a/dist/style.css b/dist/style.css index 7cbf841..75f100a 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -.ff-toast-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-toast-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-toast-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-toast-drawer .ant-drawer-body{padding:8px}.ff-toast-drawer .ant-drawer-footer{padding:0 8px;height:46px;align-items:center;display:flex}.ff-toast-drawer .ant-drawer-footer .ff-toast-extras,.ff-toast-drawer .ant-drawer-footer .ff-toast-actions{display:flex;gap:4px}.ff-toast-drawer .ant-drawer-footer .ff-toast-extras{flex:1}.ff-toast .ff-toast-footer{height:46px;align-items:center;display:flex}.ff-toast .ff-toast-footer .ff-toast-extras,.ff-toast .ff-toast-footer .ff-toast-actions{display:flex;gap:4px}.ff-toast .ff-toast-footer .ff-toast-extras{flex:1}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-toast-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-toast-notification .ff-toast-notification-container{color:#fff;border-radius:12rpx;background-color:#0009;height:fit-content;padding:28rpx;max-width:50%;max-height:50%;text-align:center}page-container .ff-toast-notification .ff-toast-notification-container .iconfont.ff-toast-notification-icon{font-size:62rpx}page-container .ff-toast-notification .ff-toast-notification-container .iconfont.ff-toast-notification-icon+view{margin-top:20rpx}page-container .ff-toast-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-toast-confirm .ff-toast-confirm-container{background-color:#fff;width:80%;min-height:240rpx;max-height:80%;border-radius:12rpx;padding:38rpx;display:flex;flex-direction:column;gap:18rpx}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-title{font-size:36rpx;text-align:center}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations{display:flex;gap:38rpx}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-ok,page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-toast .ff-toast-footer{height:46px;align-items:center;display:flex}page-container .ff-toast .ff-toast-footer .ff-toast-extras,page-container .ff-toast .ff-toast-footer .ff-toast-actions{display:flex;gap:4px}page-container .ff-toast .ff-toast-footer .ff-toast-extras{flex:1}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 8px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-button.ant-btn-text.ant-btn-icon-only{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ff-data-list-grid-layout-items{display:grid;gap:8px}.ff-data-list-grid-layout-items .ff-grid-layout{border-radius:4px;padding:8px;background-color:#fff}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}.ant-form-vertical .ant-form-item-label,.ant-form.ant-vertical .ant-form-item-label{padding-bottom:0;text-align:start}.ant-form-vertical .ant-form-item-row,.ant-form.ant-vertical .ant-form-item-row{flex-direction:column}.ant-form-item .ant-form-item-label>label{height:22px}.anticon.iconfont{transform:scale(1.14)}.fsdpf-component-modal-root .ant-modal-header{padding:16px}.fsdpf-component-modal-root .ant-modal-header .ant-modal-title{display:flex;justify-content:space-between}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-header+.ant-drawer-body>section.ant-layout.fsdpf-component-container,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-header+.ant-drawer-body>section.ant-layout.fsdpf-component-container{height:calc(100vh - 55px)}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container{display:flex;flex-direction:column;margin:0;padding:0;background:#fff;height:100vh}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>main.ant-layout-content,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>main.ant-layout-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--padding-xs);box-sizing:border-box}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer{margin-top:var(--padding-xs);height:46px;padding:0 var(--padding-xs);display:flex;align-items:center;justify-content:space-between}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn,.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-radio-group,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-radio-group{margin-right:var(--padding-xs)}.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn,.fsdpf-component-popup-root.ant-drawer-right .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-left .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn-group{margin-left:var(--padding-xs)}.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container{display:flex;flex-direction:column;margin:0;padding:0;background:#fff;height:100%}.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>main.ant-layout-content,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>main.ant-layout-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--padding-xs);box-sizing:border-box}.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer{margin-top:var(--padding-xs);height:46px;padding:0 var(--padding-xs);display:flex;align-items:center;justify-content:space-between}.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn,.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-radio-group,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-left>.ant-radio-group{margin-right:var(--padding-xs)}.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn,.fsdpf-component-popup-root.ant-drawer-top .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn-group,.fsdpf-component-popup-root.ant-drawer-bottom .ant-drawer-body>section.ant-layout.fsdpf-component-container>footer.ant-layout-footer .footer-right>.ant-btn-group{margin-left:var(--padding-xs)}.router-page.single-router-page{padding:var(--padding-xs);height:100%}.fsdpf-component-popup-root .ant-drawer-body{overflow:hidden}.fsdpf-component-popup-root .ant-drawer-title,.fsdpf-component-popup-root .ant-modal-title{display:flex}.fsdpf-component-popup-root .ant-drawer-title .fsdpf-popup-widget-title,.fsdpf-component-popup-root .ant-modal-title .fsdpf-popup-widget-title{flex:1}.fsdpf-component-popup-root .ant-drawer-title .fsdpf-popup-widget-title-operations,.fsdpf-component-popup-root .ant-modal-title .fsdpf-popup-widget-title-operations{color:#00000073;font-weight:700;font-size:16px}.fsdpf-component-popup-root .ant-drawer-title .fsdpf-popup-widget-title-operations>*:not(:last-child),.fsdpf-component-popup-root .ant-modal-title .fsdpf-popup-widget-title-operations>*:not(:last-child){margin-right:var(--padding-xs)}.fsdpf-component-popup-root .ant-drawer-title .fsdpf-popup-widget-title-operations>*:hover,.fsdpf-component-popup-root .ant-modal-title .fsdpf-popup-widget-title-operations>*:hover{color:#000c}.fsdpf-component-popup-root .ant-modal-footer,.fsdpf-component-popup-root .ant-drawer-footer{padding:0}.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root{display:flex;line-height:46px;align-items:center}.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-left>.ant-btn,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-left>.ant-btn,.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-left>.ant-btn-group,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-left>.ant-btn-group,.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-left>.ant-radio-group,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-left>.ant-radio-group{margin-left:var(--padding-xs)}.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-right,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-right{flex:1;text-align:right}.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-right>.ant-btn,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-right>.ant-btn,.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-right>.ant-btn-group,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-right>.ant-btn-group,.fsdpf-component-popup-root .ant-modal-footer .ant-popup-footer-root .footer-right>.ant-radio-group,.fsdpf-component-popup-root .ant-drawer-footer .ant-popup-footer-root .footer-right>.ant-radio-group{margin-right:var(--padding-xs)}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd;box-shadow:5px #555}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px} +.ff-container{padding:var(--ff-padding, 0px);background-color:var(--ff-bg-color, #fff)}.ff-toast-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-toast-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-toast-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-toast-drawer .ant-drawer-body{padding:8px}.ff-toast-drawer .ant-drawer-footer{padding:0 8px;height:46px;align-items:center;display:flex}.ff-toast-drawer .ant-drawer-footer .ff-toast-extras,.ff-toast-drawer .ant-drawer-footer .ff-toast-actions{display:flex;gap:4px}.ff-toast-drawer .ant-drawer-footer .ff-toast-extras{flex:1}.ff-toast-modal>div:not([aria-hidden]){height:inherit}.ff-toast-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}.ff-toast-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}.ff-toast-modal .ff-toast-footer{height:46px;align-items:center;display:flex}.ff-toast-modal .ff-toast-footer .ff-toast-extras,.ff-toast-modal .ff-toast-footer .ff-toast-actions{display:flex;gap:4px}.ff-toast-modal .ff-toast-footer .ff-toast-extras{flex:1}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-toast-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-toast-notification .ff-toast-notification-container{color:#fff;border-radius:12rpx;background-color:#0009;height:fit-content;padding:28rpx;max-width:50%;max-height:50%;text-align:center}page-container .ff-toast-notification .ff-toast-notification-container .iconfont.ff-toast-notification-icon{font-size:62rpx}page-container .ff-toast-notification .ff-toast-notification-container .iconfont.ff-toast-notification-icon+view{margin-top:20rpx}page-container .ff-toast-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-toast-confirm .ff-toast-confirm-container{background-color:#fff;width:80%;min-height:240rpx;max-height:80%;border-radius:12rpx;padding:38rpx;display:flex;flex-direction:column;gap:18rpx}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-title{font-size:36rpx;text-align:center}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations{display:flex;gap:38rpx}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-ok,page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-toast-confirm .ff-toast-confirm-container .ff-toast-confirm-operations .ff-toast-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-toast-modal>div:not([aria-hidden]){height:inherit}page-container .ff-toast-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}page-container .ff-toast-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}page-container .ff-toast-modal .ff-toast-footer{height:46px;align-items:center;display:flex}page-container .ff-toast-modal .ff-toast-footer .ff-toast-extras,page-container .ff-toast-modal .ff-toast-footer .ff-toast-actions{display:flex;gap:4px}page-container .ff-toast-modal .ff-toast-footer .ff-toast-extras{flex:1}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin)}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 8px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:8px}.ff-data-list-framework .ff-data-list-sider{width:var(--sider-width);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-framework .ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width))}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:8px;display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-container .ff-data-list-content{flex:1;overflow-y:auto;display:grid;gap:var(--gap);padding:calc(var(--gap) / 2);grid-template-columns:repeat(var(--col-num),1fr);grid-auto-rows:min-content}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:8px;border-radius:4px;background-color:#fff;box-shadow:0 0 8px #00000014}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .ff-grid-layout{padding:8px}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions{margin-top:8px;display:flex;justify-content:space-between;border-top:1px solid #f0f0f0}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .ff-data-list-container .ff-data-list-content .ff-data-list-framework-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;display:flex;flex-direction:column}.ff-data-table-framework .ff-data-table-toolbar{display:flex}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-filter{display:flex;justify-content:space-between}.ff-data-list-filter .ant-input-prefix{color:#00000073}.ff-data-list-filter .ff-data-list-filter-submit-button{margin-left:8px}.ff-data-list-filter .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ant-breadcrumb-link.active{color:#1677ff;font-weight:600}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}.ant-form-vertical .ant-form-item-label,.ant-form.ant-vertical .ant-form-item-label{padding-bottom:0;text-align:start}.ant-form-vertical .ant-form-item-row,.ant-form.ant-vertical .ant-form-item-row{flex-direction:column}.ant-form-item .ant-form-item-label>label{height:22px}.anticon.iconfont{transform:scale(1.14)}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px} diff --git a/dist/user.js b/dist/user.js index 7731627..8c1ea33 100644 --- a/dist/user.js +++ b/dist/user.js @@ -3,7 +3,7 @@ import "react/jsx-runtime"; import "react"; import "@ant-design/icons"; import "classnames"; -import { c as m, a as p, g, l as n, b as c } from "./common/main-v06hYH4g.js"; +import { c as m, a as p, g, l as n, b as c } from "./common/main-DF2XGSyn.js"; export { m as checkUserToken, p as getUserInfo, diff --git a/dist/utils.js b/dist/utils.js new file mode 100644 index 0000000..5c85cbb --- /dev/null +++ b/dist/utils.js @@ -0,0 +1,5 @@ +import "lodash"; +import { w as a } from "./common/main-DF2XGSyn.js"; +export { + a as getDefaultExpandRowKeys +}; diff --git a/package.json b/package.json index 1ab9bb6..b205d01 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.1.7", + "version": "0.1.9", "type": "module", "files": [ "dist/" @@ -10,6 +10,7 @@ "exports": { ".": "./dist/index.js", "./hooks": "./dist/hooks.js", + "./utils": "./dist/utils.js", "./res-ws": "./dist/res-ws.js", "./service": "./dist/service.js", "./user": "./dist/user.js", @@ -29,12 +30,14 @@ }, "dependencies": {}, "peerDependencies": { - "antd": "^5.16.0", + "antd": "^5.17.0", "axios": "^1.5.0", "classnames": "^2.5.1", "ff-request": "git+https://git.fsdpf.net/npm/ff-request-dist.git", "lodash": "^4.17.21", + "immutability-helper": "^3.1.1", "rc-field-form": "^1.44.0", + "rc-util": "^5.41.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.22.3"