From 1c7c490caa2998d50b5b1925408b75a15054ef95 Mon Sep 17 00:00:00 2001 From: what Date: Mon, 24 Jun 2024 15:44:25 +0800 Subject: [PATCH] [feat] v0.1.12 --- dist/button.js | 2 +- dist/common/main-CfQRKHVj.js | 2084 -------------------------------- dist/common/main-D7BIypEq.js | 2167 ++++++++++++++++++++++++++++++++++ dist/components.js | 6 +- dist/container.js | 10 +- dist/data-list.js | 2 +- dist/grid-layout-form.js | 2 +- dist/grid-layout.js | 2 +- dist/hooks.js | 2 +- dist/index.js | 2 +- dist/res-ws.js | 2 +- dist/service.js | 2 +- dist/style.css | 2 +- dist/user.js | 2 +- dist/utils.js | 2 +- package.json | 2 +- 16 files changed, 2187 insertions(+), 2104 deletions(-) delete mode 100644 dist/common/main-CfQRKHVj.js create mode 100644 dist/common/main-D7BIypEq.js diff --git a/dist/button.js b/dist/button.js index c7f1e4b..347db56 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { E as s, B as u, C as e } from "./common/main-CfQRKHVj.js"; +import { E as s, B as u, C as e } from "./common/main-D7BIypEq.js"; import "./common/vender-B-S-5jfg.js"; export { s as auth, diff --git a/dist/common/main-CfQRKHVj.js b/dist/common/main-CfQRKHVj.js deleted file mode 100644 index 9af9bb9..0000000 --- a/dist/common/main-CfQRKHVj.js +++ /dev/null @@ -1,2084 +0,0 @@ -var pn = Object.defineProperty; -var mn = (e, t, n) => t in e ? pn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var N = (e, t, n) => (mn(e, typeof t != "symbol" ? t + "" : t, n), n), Vt = (e, t, n) => { - if (!t.has(e)) - throw TypeError("Cannot " + n); -}; -var u = (e, t, n) => (Vt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), C = (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); -}, z = (e, t, n, s) => (Vt(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n); -var xe = (e, t, n, s) => ({ - set _(r) { - z(e, t, r, n); - }, - get _() { - return u(e, t, s); - } -}); -import d from "lodash"; -import Xe from "axios"; -import v, { useMemo as le, useEffect as L, useRef as X, useState as F, useCallback as ce, useContext as He, useLayoutEffect as yn, useId as bn } from "react"; -import bt from "ff-request"; -import vn from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; -import { jsx as g, jsxs as S, Fragment as Cn } from "react/jsx-runtime"; -import { QuestionOutlined as Rn, LoadingOutlined as Nn, createFromIconfontCN as kn } 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 Fn } from "rc-field-form"; -import { notification as Ot, Drawer as wn, Modal as Ln, Form as Ye, ConfigProvider as $t, Input as Vn, Breadcrumb as In, Tree as Wn, Pagination as Pn, Table as Zn, Empty as En, Popconfirm as Tn, Tooltip as Gn, Button as Sn } from "antd"; -import { flushSync as zn } from "react-dom"; -import It from "immutability-helper"; -import { useParams as On, generatePath as $n, createBrowserRouter as Dn } from "react-router-dom"; -const vt = ({ type: e, className: t, ...n }) => { - if (!(e != null && e.startsWith("icon-"))) - return /* @__PURE__ */ g(Rn, {}); - if (e === "icon-loading") - return /* @__PURE__ */ g(Nn, { className: t, ...n }); - const s = le(() => kn({ scriptUrl: Ze.get("Common.ICONFONT", []) }), [Ze.get("Common.ICONFONT")]); - return /* @__PURE__ */ g(s, { type: e, className: Z("iconfont", t), ...n }); -}, Un = ({ className: e, title: t, content: n, icon: s, $close: r, category: i, duration: o = 4.5 }) => { - const [a, l] = Ot.useNotification(); - return L(() => { - a[i || "open"]({ - className: e, - message: t, - description: n, - icon: s, - duration: o, - onClose: () => r(!1) - }); - }, [t, n, s]), l; -}, jn = ({ className: e, title: t, content: n, okText: s, $close: r, duration: i = 5e3 }) => { - var c; - const o = X(), [a, l] = F(); - return L(() => (a > 0 && (o.current = setTimeout(() => { - a <= 1 ? r() : l((f) => f - 1); - }, 1e3)), () => clearTimeout(o.current)), [a]), L(() => { - l(Math.max(Math.ceil(i / 1e3), 0)); - }, [i]), /* @__PURE__ */ g("div", { className: Z("ff-confirm", e), onClick: (f) => f.mpEvent.currentTarget.id === f.mpEvent.target.id && r(), children: /* @__PURE__ */ S("div", { className: "ff-confirm-container", children: [ - /* @__PURE__ */ g("div", { className: "ff-confirm-title", children: t }), - /* @__PURE__ */ g("div", { className: "ff-confirm-content", children: n }), - /* @__PURE__ */ S("div", { className: "ff-confirm-operations", children: [ - /* @__PURE__ */ S("div", { className: "ff-confirm-cancel", onClick: () => r(!1), children: [ - "取消 (", - a, - ")" - ] }), - v.isValidElement(s) ? v.cloneElement(s, { - onClick: () => r(!0), - className: Z("ff-confirm-ok", (c = s.props) == null ? void 0 : c.className) - }) : /* @__PURE__ */ g("div", { className: "ff-confirm-ok", onClick: () => r(!0), children: s || "确定" }) - ] }) - ] }) }); -}, Ee = v.createContext({ - ele: {}, - mount: () => { - }, - unmount: () => { - } -}), M = ({ className: e, rootClassName: t, children: n, actions: s, title: r, subTitle: i, extras: o }) => { - const { mount: a, unmount: l } = v.useContext(Ee); - return L(() => (a("className", t), () => l("className")), [t]), s && M.Action({ children: s }), r && M.Title({ children: r }), i && M.SubTitle({ children: i }), o && M.Extra({ children: o }), /* @__PURE__ */ g("div", { className: Z("ff-container", e), children: n }); -}, ot = (e) => ({ children: t, className: n }) => { - const { mount: s, unmount: r } = v.useContext(Ee); - return L(() => (s(e, v.createElement("div", { - key: `ff-${e}`, - className: Z(`ff-dialog-${e}`, n) - }, t)), () => r(e)), [n, t]), null; -}; -M.Action = ot("actions"); -M.Title = ot("title"); -M.SubTitle = ot("sub-title"); -M.Extra = ot("extras"); -const Ms = ({ name: e }) => { - const { ele: t } = v.useContext(Ee); - return t == null ? void 0 : t[e]; -}; -M.propTypes = { - // root className - rootClassName: G.string, - // 容器 className - className: G.string, - // 标题占位符 - title: G.any, - // 副标题占位符 - subTitle: G.any, - // 操作按钮占位符 - actions: G.any, - // 扩展安装占位符 - extras: G.any -}; -const xn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, i) => { - const o = X(), [a, l] = F(!0), [c, f] = F({}), p = ce((h, y) => f((b) => ({ ...b, [h]: y })), []), m = ce((h) => f((y) => ({ ...y, [h]: void 0 })), []); - return v.useImperativeHandle(i, () => ({ - handleClose: (h) => { - o.current = h, l(!1); - } - })), /* @__PURE__ */ g(Ee.Provider, { value: { ele: c, mount: p, unmount: m }, children: /* @__PURE__ */ g( - wn, - { - ...r, - title: s || (c == null ? void 0 : c.title), - open: a, - onClose: () => l(!1), - afterOpenChange: (h) => !h && e(o.current), - className: Z("ff-dialog ff-drawer", n, c == null ? void 0 : c.className), - extra: c == null ? void 0 : c["sub-title"], - classNames: { header: "ff-dialog-header", footer: "ff-dialog-footer" }, - footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(v.Fragment, { children: [ - (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-dialog-extras" }), - (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-dialog-actions" }) - ] }) : void 0, - children: t - } - ) }); -}), Xn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, i) => { - const o = X(), [a, l] = F(!0), [c, f] = F({}), p = ce((h, y) => f((b) => ({ ...b, [h]: y })), []), m = ce((h) => f((y) => ({ ...y, [h]: void 0 })), []); - return v.useImperativeHandle(i, () => ({ - handleClose: (h) => { - o.current = h, l(!1); - } - })), /* @__PURE__ */ g(Ee.Provider, { value: { ele: c, mount: p, unmount: m }, children: /* @__PURE__ */ g( - Ln, - { - ...r, - title: /* @__PURE__ */ S(Cn, { children: [ - s || (c == null ? void 0 : c.title), - c == null ? void 0 : c["sub-title"] - ] }), - open: a, - onCancel: () => { - o.current = Promise.reject(!1), l(!1); - }, - afterOpenChange: (h) => !h && e(o.current), - className: Z("ff-dialog ff-modal", n, c == null ? void 0 : c.className), - keyboard: !0, - classNames: { header: "ff-dialog-header", footer: "ff-dialog-footer" }, - footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ S(v.Fragment, { children: [ - (c == null ? void 0 : c.extras) || /* @__PURE__ */ g("div", { className: "ff-dialog-extras" }), - (c == null ? void 0 : c.actions) || /* @__PURE__ */ g("div", { className: "ff-dialog-actions" }) - ] }) : null, - children: t - } - ) }); -}); -var fe, oe, Ie, et; -const _ = class _ { - constructor() { - C(this, oe, null); - C(this, Ie, /* @__PURE__ */ new Map()); - C(this, et, () => { - if (u(this, oe)) - return u(this, oe).port.postMessage({ command: "status", data: [] }); - z(this, oe, new SharedWorker(new URL("data:text/plain;base64,Y29uc3QgcG9ydHMgPSBbXQpsZXQgd3MgPSBudWxsCgpmdW5jdGlvbiBpbml0V3ModXJsKSB7CiAgd3MgPSBuZXcgV2ViU29ja2V0KHVybCkKICB3cy5vbmNsb3NlID0gKGUpID0+IGNvbnNvbGUubG9nKCd3cyBjbG9zZWQnLCBlKQogIHdzLm9uZXJyb3IgPSAoZSkgPT4gY29uc29sZS5sb2coJ3dzIGVycm9yJywgZSkKICB3cy5vbm1lc3NhZ2UgPSAoeyBkYXRhIH0pID0+IHsKICAgIGNvbnN0IHZhbHVlID0gSlNPTi5wYXJzZShkYXRhKQogICAgcG9ydHMuZm9yRWFjaChwb3J0ID0+IHBvcnQucG9zdE1lc3NhZ2UodmFsdWUpKQogIH0KfQoKZnVuY3Rpb24gY2xvc2VXcygpIHsKICBpZiAoIXdzIHx8IHdzLnJlYWR5U3RhdGUgPT0gV2ViU29ja2V0Lk9QRU4pIHsKICAgIHdzLmNsb3NlKCkKICB9Cn0KCmZ1bmN0aW9uIHN0YXR1cygpIHsKICB0aGlzLnBvc3RNZXNzYWdlKHsgcmVhZHlTdGF0ZTogd3MgPyB3cy5yZWFkeVN0YXRlIDogV2ViU29ja2V0LkNMT1NFRCB9KQp9CgpzZWxmLm9uY29ubmVjdCA9IChlKSA9PiB7CiAgY29uc3QgcG9ydCA9IGUucG9ydHNbMF07CgogIHBvcnQub25tZXNzYWdlID0gKHsgZGF0YTogeyBjb21tYW5kLCBkYXRhIH0gfSkgPT4gewogICAgaWYgKGNvbW1hbmQgJiYgWydpbml0V3MnLCAnY2xvc2VXcycsICdzdGF0dXMnXS5pbmNsdWRlcyhjb21tYW5kKSkgUmVmbGVjdC5hcHBseShzZWxmPy5bY29tbWFuZF0sIHBvcnQsIGRhdGEgfHwgW10pCiAgfQoKICBwb3J0cy5wdXNoKHBvcnQpCn0K", self.location))), u(this, oe).port.onmessage = (t) => { - var n, s; - (n = t.data) != null && n.uuid ? u(this, Ie).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 && w.get("/api/user-api-token").then(({ token: r, expire_at: i }) => { - u(this, oe).port.postMessage({ command: "initWs", data: [`ws${d.trimStart(Ft, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, u(this, oe).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, Ie).set(t, n), u(this, Ie).size == 1 && u(this, et).call(this), () => this.unsubscribe(t))); - N(this, "unsubscribe", (t) => u(this, Ie).delete(t)); - if (u(_, fe)) - return u(_, fe); - } -}; -fe = new WeakMap(), oe = new WeakMap(), Ie = new WeakMap(), et = new WeakMap(), C(_, fe, null), N(_, "getInstance", () => (u(_, fe) || z(_, fe, new _()), u(_, fe))); -let dt = _; -const Dt = dt.getInstance(), Ut = () => { - const e = X(!0), [t, n] = F(0); - return L(() => () => e.current = !1, []), () => e.current && zn(() => { - n(t + 1); - }); -}, As = ({ value: e, defaultValue: t, onChange: n }) => { - const s = Ut(), r = X(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 = X(); - return L(() => { - t.current = e; - }), t.current; -}, Hn = (e) => { - const t = X(), [n, s] = F(e); - return L(() => { - d.isFunction(t.current) && t.current(n); - }, [n]), [n, function(r, i) { - t.current = i, s(r); - }]; -}, at = (e = v.EffectCallback, t, n = d.isEqual) => { - const s = v.useRef(t); - (!s.current || !n(t, s.current)) && (s.current = t), v.useEffect(e, [s.current]); -}, jt = (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 = jt(e[s].children, t)); - return e; -}, Js = (e, t = "json", n = "string", s, r = null) => { - const [i] = Be.useForm(s), [o, a] = F([{ label: "无", value: "", disabled: !0 }]), l = X([]), c = Be.useWatch((f) => l.current.length === 0 ? null : d.pick(f, l.current), i) || null; - return L(() => { - 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]), jt(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) => w.request(s, !1).resp((o) => (console.log("useSubscribeRequest", i), n(o), o)); - return at(() => { - let i = null; - return r().then((o) => { - i = Dt.subscribe(r, o.res); - }), () => i == null ? void 0 : i(); - }, s), t; -}, Bn = (e) => { - const [t, n] = v.useState({ gridItems: [], hideItems: [] }); - return v.useEffect(() => { - e && w.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 h; - return (h = m == null ? void 0 : m.field) != null && h.hidden ? p.hides.push(m == null ? void 0 : m.field) : p.items.push(m), p; - }, { items: [], hides: [] }) - })).then(n); - }, [e]), t; -}, Yn = ({ - max: e = 0, - min: t = 0, - type: n = "", - message: s, - pattern: r, - required: i = !1, - validator: o -} = {}, a, l) => { - const [c, f] = F([]); - return L(() => { - 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 (h, 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; -}, Kn = (e, t, n) => { - const [s, r] = F(null); - return L(() => { - const { - initDataUri: i = `/api/${e}`, - initDataMethod: o = "GET" - } = n || {}; - t && w.request({ - method: o, - url: d.trimEnd(`${i}/${t}`, "/") - }).then((a) => { - r(a); - }); - }, [e, t, n]), s; -}, Mn = (e, t, n, s = {}) => { - const r = Ut(), i = X(!0), o = X([]), [a, l] = F(n), c = Be.useWatch((f) => JSON.stringify(d.pick(f, o.current)), t) || "{}"; - return L(() => { - 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]), L(() => () => i.current = !1, []), a; -}, An = (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: h, - autoComplete: y, - resource: b, - items: O, - hides: E, - rowHeight: x, - marginX: A, - marginY: q, - listenChangeFields: H, - listenChangeFieldsFunc: W, - pk: k, - uuid: B - } = Bn(t), [P] = Ye.useForm(a), Y = ({ - changedValues: $, - allValues: T, - listenChangeFields: ke, - listenChangeFieldsFunc: _e, - onValuesChange: ct, - code: wt - }) => { - ct($, T), _e && Array.isArray(ke) && Ne.exec( - _e, - { changedValues: $, allValues: T }, - { - getFieldValue: P.getFieldValue, - setFieldsValue: P.setFieldsValue, - isFieldTouched: P.isFieldTouched, - isFieldsTouched: P.isFieldsTouched - } - ); - }, re = le(() => [ - { 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__ */ S( - Ye, - { - className: c, - requiredMark: !0, - name: s || t, - layout: n || h, - fields: re, - form: P, - autoComplete: y, - style: { ...i, position: "relative" }, - onFinish: f, - onValuesChange: ($, T) => Y( - { - changedValues: $, - allValues: T, - listenChangeFields: H, - listenChangeFieldsFunc: W, - onValuesChange: p, - code: t - } - ), - children: [ - /* @__PURE__ */ g( - e, - { - ...m, - form: P, - code: t, - fields: O, - rowHeight: x, - marginX: A, - marginY: q - } - ), - E == null ? void 0 : E.map(($) => { - var T; - return /* @__PURE__ */ g(zt, { name: $.code, children: /* @__PURE__ */ g( - Jn, - { - form: P, - name: $.code, - type: $.type, - initialValue: $.initialValue, - initialValueLanguage: (T = $.extras) == null ? void 0 : T.initialValueLanguage - } - ) }, JSON.stringify($.code)); - }) - ] - } - ); -}, Jn = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { - const i = Mn( - n == "javascript" && t, - r, - n == "javascript" ? void 0 : t, - {} - ); - return L(() => { - n == "javascript" ? s(d.toPrimitive(i, e)) : s(d.toPrimitive(t, e)); - }, [e, t, i]), null; -}, Qn = (e) => function({ code: n, data: s, ...r }) { - const [i, o] = F({ - resource: null, - cols: 12, - rowHeight: 21, - fields: [] - }); - return L(() => { - n && w.get(`/api/_/${n}`).then((a) => o(d.pick(a, ["resource", "cols", "rowHeight", "fields"]))); - }, [n]), (i == null ? void 0 : i.resource) && /* @__PURE__ */ g( - e, - { - ...r, - rowHeight: i.rowHeight, - cols: i.cols, - fields: i.fields, - data: i != null && i.resource ? { [i == null ? void 0 : i.resource]: s } : {} - } - ); -}, qn = "RC_FORM_INTERNAL_HOOKS", xt = (e, { - initialValue: t, - initialValueLanguage: n, - convertJs: s, - convertJsSetting: r, - type: i = "string" -}, o = null) => { - const a = X(!1), l = He(Fn), [c, f] = F(), [p, m] = F(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: h } = l.getInternalHooks(qn) || {}; - return L(() => h == null ? void 0 : h((y, b, O) => { - if (!a.current) - return; - const E = d.get(b, e); - d.isEqual(E, p) || m(d.toPrimitive(E, i)); - }), [p]), L(() => { - 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]), at(() => { - 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]; -}, _n = (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`, Xt = ({ 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 = Ht(n, ts, "@pkg/grid-layouts"), p = le(() => [ - { name: "__PROPS__", value: o } - ], [o]); - return at(() => { - c.setFieldsValue(s); - }, [s]), /* @__PURE__ */ g(Be, { fields: p, form: c, component: !1, children: /* @__PURE__ */ g( - "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 - } - ) }); -}, Ht = (e, t, n = "@pkg/grid-layouts", s = null) => le(() => { - 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, ...h } }, y) => /* @__PURE__ */ g( - "div", - { - className: "grid-layout-item", - style: _n(o, a, l, c, f, m === "Height" && (h == null ? void 0 : h.initialValue)), - children: /* @__PURE__ */ g( - es, - { - ...h, - basicForm: s, - itemWidget: m != null && m.startsWith("@") ? m : `${p}/${m}`, - itemWidgetRender: t - } - ) - }, - i || y - ) - ); -}, [e]), es = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { - const [r, i] = F(); - return L(() => { - Q.getWidgetComponent(e).then(({ defaultProps: o, default: a }) => { - i(v.createElement(t(a, o, n), s)); - }).catch((o) => i(e)); - }, [e]), r; -}, ts = (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), [h, y] = xt(a ? null : r, { - initialValue: l, - initialValueLanguage: c, - convertJs: f, - convertJsSetting: p, - type: (m == null ? void 0 : m.type) || "string" - }, n); - return /* @__PURE__ */ g(e, { ...m, value: h, rawValue: y, $setting: o || {} }); -}, qs = Qn(Xt), Bt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...i }) => { - const o = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, l] = F(); - return L(() => { - o && Q.getWidgetComponent(o).then(({ defaultProps: c, default: f }) => ({ - default: Yt(f, c, r) - })).catch((c) => ({ default: () => `${c}` })).then((c) => l(v.createElement(c.default, i))); - }, [o]), a && v.cloneElement(a, i); -}; -Bt.defaultProps = { - widgetPrefix: "@pkg/grid-layout-forms", - widget: "Input" -}; -const Yt = (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: h, - initialValueLanguage: y, - convertJs: b, - convertJsSetting: O, - widgetPerfix: E, - boxStyle: x, - widgetDecorator: A, - subWidgets: q, - ...H - } = { ...t, ...s }, W = Yn(f || {}, i, r), k = { - label: o, - noStyle: a, - colon: !1 - }, B = { - placeholder: l, - ...H - }, P = ce((Y) => Y == null ? void 0 : d.toPrimitive(Y, r), [r]); - return /* @__PURE__ */ g( - zt, - { - name: i, - rules: W, - initialValue: P(h), - normalize: P, - children: (Y, re, $) => { - var T; - return /* @__PURE__ */ g( - 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, ...Y }, - $setting: c || {} - } - ); - } - } - ); -}, Ct = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { - const i = Ht(r, Yt, "@pkg/grid-layout-forms"); - return /* @__PURE__ */ g($t, { 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: i }) }); -}; -Ct.propTypes = { - fields: G.array.isRequired -}; -Ct.defaultProps = { - fields: [] -}; -const ns = An(Ct), Kt = ({ 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__ */ g(Ee.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); -}; -Kt.defaultProps = { - isDrawerRender: !1 -}; -Kt.propTypes = { - isDrawerRender: G.bool -}; -const ss = (e = {}, t = {}, n = {}, s = "") => d.deepSome(e, (r, i) => i === "type" && r === "code") ? Mt(e, t, n, s) : At(e, t, s), Mt = 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 = Re.getPageParams(l); - break; - case "string": - o = l; - } - o ?? (o = c); - } else - o = await Mt(e[i], t, n, s); - d.set(r, i, o); - } - return r; -}, At = (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 = Re.getPageParams(a); - break; - case "string": - i = a; - break; - } - i ?? (i = l); - } else - i = At(e[r], t, n); - d.set(s, r, i); - } - return s; -}, {}), rs = ({ - 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: h, - $setting: y, - isTreeSider: b, - treeSiderConfig: O, - onClickCallback: E -}) => { - const { getBase62params: x } = He(je), { total: A, page: q } = x() || {}, H = ce((W, k, B) => /* @__PURE__ */ g( - is, - { - 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__ */ S("div", { className: Z("ff-data-list-framework", e), children: [ - /* @__PURE__ */ g(Rt, { isTreeSider: b, ...O }), - /* @__PURE__ */ S("div", { className: "ff-data-list-container", children: [ - /* @__PURE__ */ g(Qt, {}), - /* @__PURE__ */ g(qt, { title: m }), - /* @__PURE__ */ g("div", { className: "ff-data-list-content", style: { - "--col-num": (y == null ? void 0 : y.colNum) || 1 - }, children: /* @__PURE__ */ g(nn, { ...h, primaryKey: p, itemRender: H, dataSource: n }) }), - /* @__PURE__ */ g( - _t, - { - isPaginate: s, - isOperations: o, - operations: a, - total: A, - page: q, - pageSize: r - } - ) - ] }) - ] }); -}, is = ({ className: e, operations: t, children: n, data: s, onClickCallback: r }) => /* @__PURE__ */ S("div", { className: Z("data-list-grid-layout-item-container", e), children: [ - n, - !!(t != null && t.length) && /* @__PURE__ */ g("div", { className: "data-list-grid-layout-item-actions", children: t.map(({ isRefresh: i, ...o }) => /* @__PURE__ */ g("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ g( - 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())) }) -] }), os = ({ - 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: h, - isTreeSider: y, - treeSiderConfig: b, - ...O -}) => { - const { getBase62params: E, onClickCallback: x } = He(je), { total: A, page: q } = E(); - return /* @__PURE__ */ S("div", { className: Z("ff-data-table-framework", e), children: [ - /* @__PURE__ */ g(Rt, { isTreeSider: y, ...b }), - /* @__PURE__ */ S("div", { className: "ff-data-table-container", children: [ - /* @__PURE__ */ g(Qt, {}), - /* @__PURE__ */ g(qt, { title: p }), - /* @__PURE__ */ g( - tn, - { - ...O, - className: "ff-data-table-content", - columns: s, - dataSource: n, - operationRender: (H) => /* @__PURE__ */ g("div", { className: "ff-data-table-actions", children: a == null ? void 0 : a.reduce((W, k, B) => [ - ...W, - /* @__PURE__ */ g( - 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__ */ g( - _t, - { - isPaginate: m, - isOperations: i, - operations: o, - total: A, - page: q, - pageSize: h - } - ) - ] }) - ] }); -}, je = v.createContext({ - getBase62params: (e, t) => { - }, - onReload: () => { - }, - onClickCallback: () => { - }, - onConditonChange: () => { - }, - onTabChange: () => { - }, - onSiderChange: () => { - }, - onKeywordChange: () => { - }, - onPageChange: () => { - }, - onPageSizeChange: () => { - } -}), as = ({ - 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 [h, y] = F(); - return L(() => { - t ? Q.getWidgetComponent(t).then((b) => { - if (!b) - throw `${t} not found`; - return b; - }).catch((b) => ({ default: () => `${b}` })).then((b) => y(v.createElement(b.default, { ...m, $setting: n }))) : h || y(null); - }, [t, n]), /* @__PURE__ */ g(je.Provider, { value: { - onClickCallback: c, - onReload: f, - getBase62params: p, - onPageChange: s, - onPageSizeChange: r, - onTabChange: i, - onSiderChange: o, - onKeywordChange: a, - onConditonChange: l - }, children: h ? v.cloneElement(h, m) : e ? /* @__PURE__ */ g(rs, { ...m, $setting: n }) : /* @__PURE__ */ g(os, { ...m, $setting: n }) }); -}, cs = (e, t, n, s, r) => { - const i = v.lazy(() => Q.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` }))); - return /* @__PURE__ */ g(v.Suspense, { children: /* @__PURE__ */ g( - i, - { - value: t, - record: n, - $setting: s, - base62params: r - } - ) }, e); -}, ls = (e, t = {}) => (Wt(e), Wt(t), le(() => e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...i }, o) => s && !s.endsWith("/BasicShowFieldData") ? { - ...i, - render: (a, l) => { - const c = cs(s, a, l, r, t); - return d.isFunction(i == null ? void 0 : i.render) ? i.render(c, a, l) : c; - } -} : i), [e, t])), _s = (e) => { - const [t, n] = F({}); - return L(() => { - let s = !1; - return e && w.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; -}, er = (e, t = {}) => { - const [n, s] = F({ dataSource: [] }); - return at(() => { - let r = !1; - return e && w.get(`/api/${e}/${w.encode({ page: 1, ...t })}`).then((i) => !r && s(i)), () => r = !0; - }, [e, t]), n; -}, Zt = (e, t = null, n = null, s = "id") => le(() => { - if (d.isEmpty(e) || !e.every(({ uuid: i }) => bs.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: h, pageSize: y }, b] = Hn(t), [{ - resource: O, - primaryKey: E, - batchOperations: x = [], - itemOperations: A = [], - columns: q = [], - themeConfig: H, - theme: W, - isTreeSider: k, - treeSiderConfig: B, - isItemGridLayout: P, - itemGridLayout: Y, - title: re, - isPaginate: $ - }, T] = F({ isItemGridLayout: !1, itemGridLayout: {} }), ke = (D) => w.list(e, { tab: o, page: a, total: l, condition: c, sider: f, keyword: p, ...D }).then(({ - condition: U, - total: ue, - tab: Fe, - page: de, - pageSize: we, - operationsAccess: ie, - dataSource: j - }) => { - b({ - dataSource: j, - pageSize: we, - total: ue, - page: de, - tab: Fe, - condition: U, - sider: f, - keyword: p, - itemOperationsAccess: new Map(ie) - }); - }), _e = Zt(A, m, h, E), ct = Zt(x); - L(() => { - let D = null; - return e && w.get(`/api/_/${e}`).resp(({ data: U, res: ue }) => { - U != null && U.isDynamicRefresh && (D = Dt.subscribe(() => ke(), ue)), T(U); - }).catch(() => T({})), b((U) => ({ ...U, dataSource: [] })), () => D == null ? void 0 : D(); - }, [e]), L(() => { - e && ke(t); - }, [t]); - const wt = () => { - }, an = () => { - }, cn = () => { - }, ln = () => { - }, un = (D, U) => ke({ page: D, pageSize: U }), dn = (D) => ke({ pageSize: D, page: 1 }), fn = (D, U) => { - const ue = { tab: o, sider: f, keyword: p, page: a, pageSize: y, condition: c, total: l }; - return D ? d.get(ue, D, U) : ue; - }, lt = () => { - ke(); - }, gn = (D = 0, U = null) => { - if (D === 2) { - const ue = d.get(U, "__PARENT_ID__", ""), Fe = d.get(U, E, ""), de = d.findIndex(m, ["__PARENT_ID__", ue]), we = d.findIndex(de > -1 ? d.get(m, [de, "children"]) : m, [E, Fe]); - we > -1 ? (w.get(`/api/${e}/detail/${Fe}`).then((ie) => { - b((j) => { - const Le = d.get(j.dataSource, de > -1 ? [de, "children", we, "children"] : [we, "children"]); - return { - ...j, - dataSource: de > -1 ? It(j.dataSource, { [de]: { children: { $splice: [[we, 1, { ...ie, children: Le }]] } } }) : It(j.dataSource, { $splice: [[we, 1, { ...ie, children: Le }]] }) - }; - }); - }), w.post(`/api/${e}/list-operations-access`, { ids: Fe }).then((ie) => new Map(ie)).then((ie) => { - b((j) => (j.itemOperationsAccess.forEach((Le, Ve) => { - var Lt; - (Lt = ie.get(Ve)) != null && Lt.some((ut) => ut == Fe) || j.itemOperationsAccess.set(Ve, Le.filter((ut) => ut !== Fe)); - }), ie.forEach((Le, Ve) => { - j.itemOperationsAccess.has(Ve) ? j.itemOperationsAccess.set(Ve, d.uniq([...j.itemOperationsAccess.get(Ve) || [], ...Le])) : j.itemOperationsAccess.set(Ve, Le); - }), { ...j })); - })) : lt(); - } else - D === 1 && lt(); - }, hn = { - title: re, - itemClassName: s, - resource: O, - primaryKey: E, - theme: r || W, - themeProps: i || H, - isPaginate: $, - pageSize: y, - page: a, - isTreeSider: k, - treeSiderConfig: B, - isItemOperations: _e, - isBatchOperations: ct, - batchOperations: x, - itemOperations: A, - itemOperationsAccess: h, - dataSource: m, - isItemGridLayout: P, - columns: q, - itemGridLayout: Y - }; - return /* @__PURE__ */ g(M, { className: Z("ff-data-list-helper", n), children: /* @__PURE__ */ g( - as, - { - ...hn, - getBase62params: fn, - onReload: lt, - onClickCallback: gn, - onConditonChange: wt, - onTabChange: an, - onSiderChange: cn, - onKeywordChange: ln, - onPageChange: un, - onPageSizeChange: dn - } - ) }); -}, Qt = ({ className: e }) => (v.useContext(je), /* @__PURE__ */ S("div", { className: Z("ff-data-list-filter", e), children: [ - /* @__PURE__ */ g( - Vn, - { - placeholder: "关键字", - style: { width: "30%", maxWidth: 300 }, - prefix: /* @__PURE__ */ g(vt, { type: "icon-search" }) - } - ), - /* @__PURE__ */ S("div", { className: "ff-data-list-actions", children: [ - /* @__PURE__ */ g(R, { children: "重置" }), - /* @__PURE__ */ g(R, { type: "primary", children: "查询" }), - /* @__PURE__ */ g( - R.Link, - { - className: "ff-data-list-filter-submit-button", - type: "primary", - name: "展开", - icon: "icon-down", - iconPosition: "end" - } - ) - ] }) -] })), us = [ - { title: "全部", className: "active" }, - { title: "运行中" }, - { title: "已上线" } -], qt = ({ className: e, title: t }) => /* @__PURE__ */ S("div", { className: Z("ff-data-list-toolbar", e), children: [ - /* @__PURE__ */ g("div", { className: "ff-data-list-title", children: t }), - /* @__PURE__ */ g(In, { className: "ff-data-list-tabs", items: us }), - /* @__PURE__ */ S("div", { className: "ff-data-list-actions", children: [ - /* @__PURE__ */ g(R.Link, { icon: "icon-reload" }), - /* @__PURE__ */ g(R.Link, { icon: "icon-setting" }) - ] }) -] }), ds = [ - { - 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__ */ g( - "span", - { - style: { - color: "#1677ff" - }, - children: "sss" - } - ), - key: "0-0-1-0" - } - ] - } - ] - } -], Rt = ({ className: e, width: t, isTreeSider: n }) => n ? /* @__PURE__ */ g( - Wn.DirectoryTree, - { - className: Z("ff-data-list-sider", e), - style: { "--sider-width": t }, - showLine: !0, - showIcon: !1, - treeData: ds - } -) : null; -Rt.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 } = v.useContext(je); - return n && !d.isEmpty(t) || s ? /* @__PURE__ */ S("div", { className: Z("ff-data-list-footer", e), children: [ - /* @__PURE__ */ g("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((f, p) => /* @__PURE__ */ g( - 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 == null ? void 0 : c(f.isRefresh, null) - }, - f.uuid || p - )) }), - s && /* @__PURE__ */ g( - Pn, - { - 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 = X(null), l = X(null), [c, f] = F([]), [p, m] = F({ width: 0, height: 0 }); - L(() => { - f(en(s, t)); - }, [s, t]), yn(() => { - 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 h = ls(n); - return /* @__PURE__ */ g("div", { ref: l, className: Z("ff-data-list-table", e), children: p.height ? /* @__PURE__ */ g( - Zn, - { - ...o, - ref: a, - rowKey: (y, b) => (y == null ? void 0 : y[t]) ?? b, - columns: h == null ? void 0 : h.concat(r ? [{ - title: "操作", - align: "center", - fixed: "right", - width: `${Math.ceil(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 fs = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { - const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [i, o] = F(); - return L(() => { - r && Q.getWidgetComponent(r).then(({ defaultProps: a, default: l }) => ({ - default: gs(l, a, n) - })).catch((a) => ({ default: () => `${a}` })).then((a) => o(v.createElement(a.default, s))); - }, [r]), i; -}, gs = (e, t, n = null) => (s) => { - const { - code: r, - label: i, - extras: o, - isVirtual: a, - initialValue: l, - initialValueLanguage: c, - convertJs: f, - convertJsSetting: p, - value: m, - ...h - } = d.merge({}, t, s), [y, b] = xt(a ? null : r, { - initialValue: l, - initialValueLanguage: c, - convertJs: f, - convertJsSetting: p, - type: (h == null ? void 0 : h.type) || "string" - }, n); - return /* @__PURE__ */ g(e, { ...h, value: y, rawValue: b, $setting: o || {} }); -}; -fs.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 = bn(), f = le(() => /* @__PURE__ */ g( - Xt, - { - 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__ */ g(v.Fragment, { children: i(v.cloneElement(f, { data: p }), p, m) }, `${c}-${(p == null ? void 0 : p[r]) || m}`)); -}; -nn.defaultProps = { - itemRender: (e, t, n) => e, - empty: /* @__PURE__ */ g(En, { description: null }) -}; -const hs = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => Re.redirect(t, e, { replace: n }), Et = (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; -}, Tt = (e, t, n, s) => d.isString(t) && t ? Q.getWidgetComponent(t).then(({ default: r }) => { - V.open( - r, - { ...e, $setting: n, code: t }, - s - ); -}).catch((r) => { - V.error(t, { content: r.toString() }); -}) : V.open( - t, - { ...e, $setting: n, code: t }, - s -), ps = (e, t, n, s) => V.open( - ks, - { ...e, $setting: n, code: t }, - s -), ms = (e, t, n, s) => V.open( - Jt, - { base62params: e, $setting: n, listCode: t }, - s -), ys = ({ - widget: e, - widgetType: t, - widgetData: n, - widgetProps: s, - widgetSetting: r, - widgetContainerProps: i -}, { onAfterClick: o, onBeforeClick: a }) => { - const l = He(je); - He(sn); - const [c, f] = F({ leading: !0, trailing: !1 }), p = le(() => { - switch (t) { - case "redirect": - return d.partialRight(hs, e, r); - case "func": - return d.partialRight(Et, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: f }); - case "fsdpf-component": - return d.partialRight(Tt, e, r, i); - case "grid-layout-form": - return d.partialRight(ps, e, r, i); - case "data-list": - return d.partialRight(ms, e, r, i); - default: - if (on(e)) - return d.partialRight(Tt, e, r, i); - if (d.isFunction(e)) - return d.partialRight(Et, (r == null ? void 0 : r.code) || e, { status: c, setStatus: f }); - } - return (...h) => console.error("useButton unknown widgetType", t, ...h); - }, [e, t]); - return [d.debounce((h) => (a == null || a(h), Promise.resolve(ss(s, h, { 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, Se; -const ee = class ee { - constructor() { - C(this, Se, null); - N(this, "init", (t) => z(this, Se, new Map(t))); - N(this, "check", (t) => !u(this, Se).has(t) || u(this, Se).get(t)); - if (u(ee, ge)) - return u(ee, ge); - } -}; -ge = new WeakMap(), Se = new WeakMap(), C(ee, ge, null), N(ee, "getInstance", () => (u(ee, ge) || z(ee, ge, new ee()), u(ee, ge))); -let ft = ee; -const bs = ft.getInstance(), qe = (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: h, - 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__ */ g(vt, { type: i })); - const [k, B] = F(!1), [P, { disabled: Y, loading: re }] = ys({ widget: b, widgetType: O, widgetData: E, widgetProps: x, widgetSetting: A, widgetContainerProps: q }, { onAfterClick: c, onBeforeClick: f }); - return /* @__PURE__ */ g( - Tn, - { - okText: "确定", - cancelText: "取消", - ...y || {}, - disabled: Y || m, - open: k, - onOpenChange: (T) => { - if (!T) - return B(T); - y ? B(T) : P(a); - }, - onConfirm: () => { - P(a); - }, - onClick: (T) => { - T.stopPropagation(); - }, - children: /* @__PURE__ */ g(Gn, { ...h, title: k ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: /* @__PURE__ */ g( - Sn, - { - loading: re || p, - disabled: Y || m, - ...W, - ...H, - children: s || r - } - ) }) - } - ); -}, R = qe("default"), vs = qe("link"), Cs = qe("circle"), Rs = qe("round"), Ns = qe("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 = vs; -R.Link.defaultProps = R.defaultProps; -R.Link.propTypes = R.propTypes; -R.Circle = Cs; -R.Circle.defaultProps = R.defaultProps; -R.Circle.propTypes = R.propTypes; -R.Round = Rs; -R.Round.defaultProps = R.defaultProps; -R.Round.propTypes = R.propTypes; -R.Dashed = Ns; -R.Dashed.defaultProps = R.defaultProps; -R.Dashed.propTypes = R.propTypes; -const ks = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...i }) => { - const [o] = Ye.useForm(), a = Kn(s, r, e); - L(() => { - 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) => w.post(r ? `${f}/${r}` : `${f}`, p).msg(t)).catch(() => V.error("请先完善表单信息", { duration: 2e3 })); - }; - return /* @__PURE__ */ g( - M, - { - actions: /* @__PURE__ */ S(v.Fragment, { children: [ - /* @__PURE__ */ g(R, { name: "保存", type: "primary", widget: l }), - /* @__PURE__ */ g(R, { name: "取消", widget: () => t(!1) }) - ] }), - extras: n, - children: /* @__PURE__ */ g(ns, { form: o, code: s, primaryKey: r, ...i }) - } - ); -}, Fs = (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 = Fs(o, t, n); - if (!d.isEmpty(a)) - return a; - } - return {}; -}, ws = ({ fields: e, formProps: t, $close: n }) => { - const [s] = Ye.useForm(), r = () => s.validateFields(!0).then(n), i = le(() => [ - { name: "__PROPS__", value: t } - ], [t]); - return /* @__PURE__ */ g(M, { actions: /* @__PURE__ */ S(v.Fragment, { children: [ - /* @__PURE__ */ g(R, { name: "取消", widget: () => n(Promise.reject(!1)) }), - /* @__PURE__ */ g(R, { name: "确定", type: "primary", widget: () => r() }) - ] }), children: /* @__PURE__ */ g($t, { theme: { components: { Form: { itemMarginBottom: 6 } } }, children: /* @__PURE__ */ g(Ye, { fields: i, layout: "vertical", form: s, children: e == null ? void 0 : e.map(({ code: o, ...a }) => /* @__PURE__ */ g(Bt, { code: o, ...a }, o)) }) }) }); -}; -var tt, ze, he, nt, st, Ke, rt, Oe; -const Ge = class Ge extends v.Component { - constructor(n) { - super(n); - C(this, tt, null); - C(this, ze, 0); - C(this, he, /* @__PURE__ */ new Map()); - C(this, nt, (n) => new Promise((s) => { - const r = xe(this, ze)._++; - u(this, he).set(r, v.createElement(Un, { - ...n, - key: r, - $close: (i) => u(this, Oe).call(this, r, () => s(i)) - })), this.forceUpdate(); - })); - C(this, st, (n, s) => new Promise((r) => { - const i = xe(this, ze)._++; - u(this, he).set(i, v.createElement(jn, { - ...s, - content: n, - key: i, - $close: (o) => u(this, Oe).call(this, i, () => r(o)) - })), this.forceUpdate(); - })); - C(this, Ke, (n, s, { mode: r, ...i } = {}) => new Promise((o) => { - const a = xe(this, ze)._++, l = { current: null }; - u(this, he).set(a, v.createElement( - r == "drawer" ? xn : Xn, - { - ref: l, - key: a, - maskClosable: !1, - ...i, - $close: (c) => u(this, Oe).call(this, a, () => o(c)) - }, - v.createElement(n, { - ...s, - $close: (c) => l.current.handleClose(c) - }) - )), this.forceUpdate(); - })); - C(this, rt, (n, s = {}, r = {}) => u(this, Ke).call(this, ws, { formProps: r, fields: n }, s)); - C(this, Oe, (n, s) => { - u(this, he).delete(n), this.forceUpdate(s); - }); - Ge.open = u(this, Ke), Ge.notification = u(this, nt), Ge.confirm = u(this, st), Ge.form = u(this, rt); - } - componentWillUnmount() { - var n, s; - (s = (n = u(this, tt)) == null ? void 0 : n[1]) == null || s.call(n); - } - render() { - const n = Array.from(u(this, he)); - return /* @__PURE__ */ g(Ee.Provider, { value: {}, children: n.map(([s, r]) => r) }); - } -}; -tt = new WeakMap(), ze = new WeakMap(), he = new WeakMap(), nt = new WeakMap(), st = new WeakMap(), Ke = new WeakMap(), rt = new WeakMap(), Oe = new WeakMap(); -let V = Ge; -V.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(Ot[s || "open"]({ - ...r, - icon: n ? /* @__PURE__ */ g(vt, { type: n || "" }) : void 0, - message: e, - description: t -})); -V.success = (e, t = {}) => V.notification({ title: e, category: "success", ...t }); -V.error = (e, t = {}) => V.notification({ title: e, category: "error", ...t }); -V.confirm = (e, t = {}) => V.notification({ content: e, ...t }); -V.form = (e, t = {}) => V.notification({ title: e, ...t }); -V.open = (e = {}) => V.notification(e); -const gt = "mine", Nt = "token", Ls = "web", Vs = 60 * 60 * 24 * 30, kt = () => { - const e = window.localStorage.getItem(Nt); - 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 > Vs) - throw "登录令牌已过期, 请重新登录!"; - return e; -}, Is = () => { - try { - return !!kt(); - } catch { - return !1; - } -}, tr = (e = !0) => { - var t; - try { - const n = kt(); - 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 } = w.decode(window.localStorage.getItem(gt) || "", {}); - return r === s ? Promise.resolve(i) : w.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(gt, w.encode({ ...o, iat: s })), o)); - } catch (n) { - console.error(n), e && V.error("请登录").then(Ws); - } - return Promise.resolve(null); -}, nr = (e, t, n = {}) => w.post("/api/user-token", { - username: e, - passwd: vn.hash(t), - platform: Ls, - ...n -}).then(({ token: s }) => (window.localStorage.setItem(Nt, s), s)), Ws = () => { - window.localStorage.removeItem(gt), window.localStorage.removeItem(Nt); -}; -Xe.interceptors.request.use((e) => { - e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); - try { - const t = kt(); - e.headers.Authorization = t ? `Bearer ${t} ` : void 0; - } catch { - } - return e; -}, (e) => Promise.reject({ code: -1, msg: e })); -Xe.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.onMsg = (e, t) => V[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Re.redirect(Ze.get("Common.WEBSITE_LOGIN_PAGE"))); -const Ps = v.createContext({ - user: {}, - initUser: () => { - }, - initUserComplete: !1 -}), sn = v.createContext({ - set: () => { - }, - get: () => { - }, - assign: () => { - }, - currentRoute: () => { - } -}); -var $e, Me, De, ae, We, Pe; -class rn { - constructor(t, n) { - C(this, $e, /* @__PURE__ */ new Map()); - C(this, Me, !0); - C(this, De, []); - C(this, ae, void 0); - C(this, We, () => u(this, ae)); - C(this, Pe, () => Promise.resolve()); - N(this, "get", (...t) => new Promise((n, s) => { - const r = JSON.stringify(t); - if (u(this, $e).has(r)) - return n(u(this, Pe).call(this, u(this, ae), ...t)); - if (u(this, ae) === void 0) - u(this, De).push([t, n, s]), u(this, Me) && (z(this, Me, !1), Promise.resolve(typeof u(this, We) == "function" ? u(this, We).call(this) : u(this, We)).then((i) => z(this, ae, i || null)).finally(() => { - u(this, De).forEach(([i, o, a]) => { - try { - const l = u(this, Pe).call(this, u(this, ae), ...i); - u(this, $e).set(JSON.stringify(i), l), o(l); - } catch (l) { - a(l); - } - }), u(this, De).length = 0; - })); - else { - const i = u(this, Pe).call(this, u(this, ae), ...t); - u(this, $e).set(r, i), n(i); - } - })); - z(this, Pe, n), z(this, We, t); - } -} -$e = new WeakMap(), Me = new WeakMap(), De = new WeakMap(), ae = new WeakMap(), We = new WeakMap(), Pe = new WeakMap(); -var pe, Ae; -const te = class te { - constructor() { - C(this, Ae, null); - N(this, "init", (t) => z(this, Ae, t)); - N(this, "get", (t, n) => d.get(u(this, Ae), t, n)); - if (u(te, pe)) - return u(te, pe); - } -}; -pe = new WeakMap(), Ae = new WeakMap(), C(te, pe, null), N(te, "getInstance", () => (u(te, pe) || z(te, pe, new te()), u(te, pe))); -let ht = te; -const Ze = ht.getInstance(), Zs = ({ component: e }) => { - const { base62params: t } = On(); - return /* @__PURE__ */ g( - Jt, - { - listCode: e, - base62params: w.decode(t) - } - ); -}; -var me, J, ye, be, Je, Qe; -const ne = class ne { - constructor() { - C(this, J, /* @__PURE__ */ new Map()); - C(this, ye, {}); - C(this, be, null); - N(this, "init", (t, n) => { - z(this, J, t), z(this, ye, n); - }); - N(this, "get", (t) => (u(this, J).has(t) || (t = Array.from(u(this, J).keys()).find((n) => u(this, J).get(n).uri === t)), u(this, J).get(t) || {})); - N(this, "redirect", (t, n, s = {}) => { - const { uri: r, type: i, widgetProps: o } = this.get(t) || {}; - let a = $n(r || t, i != "list" ? n : d.mapValues(n, (c) => w.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, be).navigate(a, s); - }); - /** - * - * @param {*} category // user, system, navigator - * @returns - */ - N(this, "getMenus", (t) => { - var n; - return ((n = u(this, ye)) == null ? void 0 : n[t]) || []; - }); - N(this, "findMenuPathByUuid", (t) => { - let n = []; - for (const s in u(this, ye)) - if (n = u(this, Je).call(this, u(this, ye)[s], t, [s]), n.length > 1) - return n; - return n; - }); - N(this, "getMenusByRouteUuid", (t) => u(this, Qe).call(this, t, Object.values(u(this, ye)).flat())); - C(this, Je, (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, Je).call(this, i, n)); - } - return s; - }); - C(this, Qe, (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, Qe).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, be).state.matches[u(this, be).state.matches.length - 1 - t]) == null ? void 0 : s.route; - if (!n) - return null; - for (let [r, i] of u(this, J)) - if (i.uri === n.path) - return i; - return null; - }); - N(this, "getPageParams", (t) => { - var i; - const { location: n, matches: s } = u(this, be).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, J).size == 0) - return null; - const n = Ze.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"); - Ze.get(Is() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"); - const s = { [n]: 0 }, r = Array.from(u(this, J).values()).reduce((i, { uuid: o, uri: a, name: l, type: c, component: f, isLogin: p, isLayout: m, extra: h }) => { - let y = {}, b = 0; - switch (c) { - case "list": - y.element = v.createElement(Zs, { component: f }); - break; - case "fsdpf-component": - y.lazy = () => Q.getWidgetComponent(f).then((O) => ({ Component: O.default })); - break; - } - if (h != null && h.layout) - if (s[h == null ? void 0 : h.layout]) - b = s[h == null ? void 0 : h.layout]; - else - return s[h == null ? void 0 : h.layout] = i.length, [...i, { - path: "/", - lazy: () => Q.getWidgetComponent(h == null ? void 0 : h.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 z(this, be, Dn(r, t)); - }); - if (u(ne, me)) - return u(ne, me); - } -}; -me = new WeakMap(), J = new WeakMap(), ye = new WeakMap(), be = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), C(ne, me, null), N(ne, "getInstance", () => (u(ne, me) || z(ne, me, new ne()), u(ne, me))); -let pt = ne; -const Re = 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) => Re.redirect(...e), - getPageParams: (...e) => Re.getPageParams(...e), - getCurrentRoute: () => Re.getCurrentRoute() - }, - modal: { - notification: (...e) => V.notification(...e), - success: (...e) => V.success(...e), - error: (...e) => V.error(...e), - form: (...e) => V.form(...e) - } -}; -var it, Ue, ve; -const I = class I { - constructor() { - N(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((i, o) => { - const a = xe(I, it)._++; - 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, ve)) - return u(I, ve); - Promise.resolve().then(() => Es).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); - } -}; -it = new WeakMap(), Ue = new WeakMap(), ve = new WeakMap(), N(I, "mQueue", /* @__PURE__ */ new Map()), C(I, it, 0), C(I, Ue, /* @__PURE__ */ new Map()), C(I, ve, null), N(I, "getInstance", () => (u(I, ve) || z(I, ve, new I()), u(I, ve))); -let mt = I; -const Ne = mt.getInstance(); -var Ce, K; -const se = class se { - constructor() { - C(this, K, /* @__PURE__ */ new Map()); - N(this, "setVendor", (t, n) => u(this, K).set(t, new rn(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, K).has("pkg")): - return await u(this, K).get("pkg").get(n); - case (!!s && u(this, K).has("pkg")): - return await u(this, K).get("pkg").get(s); - case (!!r && u(this, K).has("pkg")): - return await u(this, K).get("pkg").get(r); - case (!!i && u(this, K).has("pkg")): - return await u(this, K).get("pkg").get(i); - } - } catch (o) { - throw o; - } - }); - if (u(se, Ce)) - return u(se, Ce); - } -}; -Ce = new WeakMap(), K = new WeakMap(), C(se, Ce, null), N(se, "getInstance", () => (u(se, Ce) || z(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 w = { - init: (e, t, n) => { - Xe.defaults.baseURL = Ft = n, Xe.defaults.timeout = 15e3, Object.assign(w, new bt(e, t, Xe)); - } -}, on = (e) => { - var t; - return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof v.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); -}, Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ - __proto__: null, - AppGlobalParamsContext: sn, - get AppUrl() { - return Ft; - }, - cache: rn, - configure: Ze, - core: Q, - default: Ps, - func: Ne, - http: w, - isReactComponent: on, - route: Re -}, Symbol.toStringTag, { value: "Module" })), sr = () => w.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)), rr = () => w.get("/api/my-menu"), ir = () => w.get("api/init-configure"), or = () => w.get("/api/init-widget-operation-auth").then((e) => e.reduce((t, { uuid: n, auth: s }) => [...t, [n, s]], [])), ar = (e) => w.get(`/api/user-wx-phone-number/${e}`); -export { - Ze as $, - Zt as A, - R as B, - ys as C, - as as D, - bs as E, - M as F, - qs as G, - ns as H, - Ct as I, - Bt as J, - ks as K, - Mn as L, - Fs as M, - vt as N, - kt as O, - Is as P, - tr as Q, - Dt as R, - Ee as S, - nr as T, - Ws as U, - Ft as V, - w as W, - on as X, - Ps as Y, - sn as Z, - rn as _, - As as a, - Ne as a0, - Q as a1, - Re as a2, - sr as a3, - rr as a4, - ir as a5, - or as a6, - ar as a7, - Wt as b, - Hn as c, - at as d, - Js as e, - Qs as f, - Ms as g, - Kt as h, - V as i, - en as j, - Xt as k, - fs as l, - Qt as m, - qt as n, - Rt as o, - _t as p, - Jt as q, - je as r, - tn as s, - nn as t, - Ut as u, - rs as v, - cs as w, - ls as x, - _s as y, - er as z -}; diff --git a/dist/common/main-D7BIypEq.js b/dist/common/main-D7BIypEq.js new file mode 100644 index 0000000..7f5097d --- /dev/null +++ b/dist/common/main-D7BIypEq.js @@ -0,0 +1,2167 @@ +var vn = Object.defineProperty; +var Cn = (e, t, n) => t in e ? vn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var V = (e, t, n) => (Cn(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)), R = (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); +}, x = (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) { + x(e, t, r, n); + }, + get _() { + return u(e, t, s); + } +}); +import f from "lodash"; +import He from "axios"; +import v, { useMemo as le, useEffect as N, useRef as K, useState as k, useCallback as _, useContext as De, useLayoutEffect as Rn, useId as kn } from "react"; +import bt from "ff-request"; +import Fn from "https://assets.fsdpf.net/js/esm/spark-md5@3_0_2.min.js?url"; +import { jsx as d, jsxs as w, Fragment as Vn } from "react/jsx-runtime"; +import { QuestionOutlined as Ln, LoadingOutlined as Nn, createFromIconfontCN as In } from "@ant-design/icons"; +import Z from "classnames"; +import { P as S } from "./vender-B-S-5jfg.js"; +import Be, { Field as xt, FieldContext as En } from "rc-field-form"; +import { notification as Ut, Drawer as Pn, Modal as Wn, Form as Ye, ConfigProvider as Dt, Input as wn, Breadcrumb as Zn, Tree as Tn, Pagination as Gn, Table as Sn, Empty as $n, Popconfirm as zn, Tooltip as On, Button as xn, Popover as Un } from "antd"; +import { flushSync as Dn } from "react-dom"; +import wt from "immutability-helper"; +import { useParams as jn, generatePath as Xn, Navigate as Hn, createBrowserRouter as Bn } from "react-router-dom"; +const vt = ({ type: e, className: t, ...n }) => { + if (!(e != null && e.startsWith("icon-"))) + return /* @__PURE__ */ d(Ln, {}); + if (e === "icon-loading") + return /* @__PURE__ */ d(Nn, { className: t, ...n }); + const s = le(() => In({ scriptUrl: we.get("Common.ICONFONT", []) }), [we.get("Common.ICONFONT")]); + return /* @__PURE__ */ d(s, { type: e, className: Z("iconfont", t), ...n }); +}, Yn = ({ className: e, title: t, content: n, icon: s, $close: r, category: o, duration: i = 4.5 }) => { + const [a, l] = Ut.useNotification(); + return N(() => { + a[o || "open"]({ + className: e, + message: t, + description: n, + icon: s, + duration: i, + onClose: () => r(!1) + }); + }, [t, n, s]), l; +}, Kn = ({ className: e, title: t, content: n, okText: s, $close: r, duration: o = 5e3 }) => { + var c; + const i = K(), [a, l] = k(); + return N(() => (a > 0 && (i.current = setTimeout(() => { + a <= 1 ? r() : l((p) => p - 1); + }, 1e3)), () => clearTimeout(i.current)), [a]), N(() => { + l(Math.max(Math.ceil(o / 1e3), 0)); + }, [o]), /* @__PURE__ */ d("div", { className: Z("ff-confirm", e), onClick: (p) => p.mpEvent.currentTarget.id === p.mpEvent.target.id && r(), children: /* @__PURE__ */ w("div", { className: "ff-confirm-container", children: [ + /* @__PURE__ */ d("div", { className: "ff-confirm-title", children: t }), + /* @__PURE__ */ d("div", { className: "ff-confirm-content", children: n }), + /* @__PURE__ */ w("div", { className: "ff-confirm-operations", children: [ + /* @__PURE__ */ w("div", { className: "ff-confirm-cancel", onClick: () => r(!1), children: [ + "取消 (", + a, + ")" + ] }), + v.isValidElement(s) ? v.cloneElement(s, { + onClick: () => r(!0), + className: Z("ff-confirm-ok", (c = s.props) == null ? void 0 : c.className) + }) : /* @__PURE__ */ d("div", { className: "ff-confirm-ok", onClick: () => r(!0), children: s || "确定" }) + ] }) + ] }) }); +}, je = v.createContext({ + ele: {}, + mount: () => { + }, + unmount: () => { + } +}), Y = ({ className: e, children: t, actions: n, title: s, subTitle: r, extras: o, style: i }) => (n && Y.Action({ children: n }), s && Y.Title({ children: s }), r && Y.SubTitle({ children: r }), o && Y.Extra({ children: o }), /* @__PURE__ */ d("div", { className: Z("ff-container", e), style: i, children: t })), it = (e) => ({ children: t, className: n }) => { + const { mount: s, unmount: r } = v.useContext(je); + return N(() => (s(e, v.createElement("div", { + key: `ff-${e}`, + className: Z(`ff-popup-${e}`, n) + }, t)), () => r(e)), [n, t]), null; +}; +Y.Action = it("actions"); +Y.Title = it("title"); +Y.SubTitle = it("sub-title"); +Y.Extra = it("extras"); +const er = ({ name: e }) => { + const { ele: t } = v.useContext(je); + return t == null ? void 0 : t[e]; +}; +Y.propTypes = { + // 容器 className + className: S.string, + // 容器样式 + style: S.object, + // 标题占位符 + title: S.any, + // 副标题占位符 + subTitle: S.any, + // 操作按钮占位符 + actions: S.any, + // 扩展安装占位符 + extras: S.any +}; +Y.defaultProps = { + style: {} +}; +const Mn = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { + const i = K(), [a, l] = k(!0), [c, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []); + return v.useImperativeHandle(o, () => ({ + handleClose: (h) => { + i.current = h, l(!1); + } + })), /* @__PURE__ */ d(je.Provider, { value: { ele: c, mount: g, unmount: m }, children: /* @__PURE__ */ d( + Pn, + { + ...r, + title: s || (c == null ? void 0 : c.title), + open: a, + onClose: () => l(!1), + afterOpenChange: (h) => !h && e(i.current), + className: Z("ff-popup ff-drawer", n, c == null ? void 0 : c.className), + extra: c == null ? void 0 : c["sub-title"], + classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ w(v.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ d("div", { className: "ff-popup-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ d("div", { className: "ff-popup-actions" }) + ] }) : void 0, + children: t + } + ) }); +}), An = v.forwardRef(({ $close: e, children: t, className: n, title: s, ...r }, o) => { + const i = K(), [a, l] = k(!0), [c, p] = k({}), g = _((h, y) => p((b) => ({ ...b, [h]: y })), []), m = _((h) => p((y) => ({ ...y, [h]: void 0 })), []); + return v.useImperativeHandle(o, () => ({ + handleClose: (h) => { + i.current = h, l(!1); + } + })), /* @__PURE__ */ d(je.Provider, { value: { ele: c, mount: g, unmount: m }, children: /* @__PURE__ */ d( + Wn, + { + ...r, + title: /* @__PURE__ */ w(Vn, { children: [ + s || (c == null ? void 0 : c.title), + c == null ? void 0 : c["sub-title"] + ] }), + open: a, + onCancel: () => { + i.current = Promise.reject(!1), l(!1); + }, + afterOpenChange: (h) => !h && e(i.current), + className: Z("ff-popup ff-modal", n, c == null ? void 0 : c.className), + keyboard: !0, + classNames: { header: "ff-popup-header", footer: "ff-popup-footer" }, + footer: c != null && c.extras || c != null && c.actions ? /* @__PURE__ */ w(v.Fragment, { children: [ + (c == null ? void 0 : c.extras) || /* @__PURE__ */ d("div", { className: "ff-popup-extras" }), + (c == null ? void 0 : c.actions) || /* @__PURE__ */ d("div", { className: "ff-popup-actions" }) + ] }) : null, + children: t + } + ) }); +}); +var pe, ae, Ee, et; +const ee = class ee { + constructor() { + R(this, ae, null); + R(this, Ee, /* @__PURE__ */ new Map()); + R(this, et, () => { + if (u(this, ae)) + return u(this, ae).port.postMessage({ command: "status", data: [] }); + x(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, Ee).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 && I.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { + u(this, ae).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(Nt, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, u(this, ae).port.postMessage({ command: "status", data: [] }); + }); + V(this, "subscribe", (t, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", u(this, Ee).set(t, n), u(this, Ee).size == 1 && u(this, et).call(this), () => this.unsubscribe(t))); + V(this, "unsubscribe", (t) => u(this, Ee).delete(t)); + if (u(ee, pe)) + return u(ee, pe); + } +}; +pe = new WeakMap(), ae = new WeakMap(), Ee = new WeakMap(), et = new WeakMap(), R(ee, pe, null), V(ee, "getInstance", () => (u(ee, pe) || x(ee, pe, new ee()), u(ee, pe))); +let dt = ee; +const jt = dt.getInstance(), Xt = () => { + const e = K(!0), [t, n] = k(0); + return N(() => () => e.current = !1, []), () => e.current && Dn(() => { + n(t + 1); + }); +}, tr = ({ value: e, defaultValue: t, onChange: n }) => { + const s = Xt(), r = K(e !== void 0 ? e : t); + e !== void 0 && (r.current = e); + const o = _(f.debounce((i) => { + e === void 0 && (r.current = i, s()), n && n(i); + }, 380, { leading: !0, trailing: !1 }), [e]); + return [r.current, o]; +}, Zt = (e) => { + const t = K(); + return N(() => { + t.current = e; + }), t.current; +}, Jn = (e) => { + const t = K(), [n, s] = k(e); + return N(() => { + f.isFunction(t.current) && t.current(n); + }, [n]), [n, function(r, o) { + t.current = o, s(r); + }]; +}, at = (e = v.EffectCallback, t, n = f.isEqual) => { + const s = v.useRef(t); + (!s.current || !n(t, s.current)) && (s.current = t), v.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 = f.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; +}, nr = (e, t = "json", n = "string", s, r = null) => { + const [o] = Be.useForm(s), [i, a] = k([{ label: "无", value: "", disabled: !0 }]), l = K([]), c = Be.useWatch((p) => l.current.length === 0 ? null : f.pick(p, l.current), o) || null; + return N(() => { + Array.isArray(e) ? a(e) : t === "javascript" && e ? Fe.exec(e, {}, { + getFieldValue: (p) => (l.current.includes(p) || l.current.push(p), o.getFieldValue(p)), + getFieldValueForBasicForm: (p) => (l.current.includes(p) || l.current.push(p), r ? r.getFieldValue(p) : o.getFieldValue(p)) + }).then((p) => { + a(f.toPrimitive(p, "array")); + }) : e && a(f.toPrimitive(e, "array")); + }, [e, t, c]), Ht(i, n); +}, sr = (e) => { + const [t, n] = k(), 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) => I.request(s, !1).resp((i) => (console.log("useSubscribeRequest", o), n(i), i)); + return at(() => { + let o = null; + return r().then((i) => { + o = jt.subscribe(f.throttle(r, 180, { leading: !1, trailing: !0 }), i.res); + }), () => o == null ? void 0 : o(); + }, s), t; +}, Qn = (e) => { + const [t, n] = v.useState({ gridItems: [], hideItems: [] }); + return v.useEffect(() => { + e && I.get(`/api/_/${e}`).then(({ + pk: s, + uuid: r, + code: o, + resource: i, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + fields: p + }) => ({ + pk: s, + uuid: r, + code: o, + resource: i, + align: a, + listenChangeFields: l, + listenChangeFieldsFunc: c, + ...p.reduce((g, m) => { + var h; + return (h = m == null ? void 0 : m.field) != null && h.hidden ? g.hides.push(m == null ? void 0 : m.field) : g.items.push(m), g; + }, { items: [], hides: [] }) + })).then(n); + }, [e]), t; +}, qn = ({ + max: e = 0, + min: t = 0, + type: n = "", + message: s, + pattern: r, + required: o = !1, + validator: i +} = {}, a, l) => { + const [c, p] = k([]); + return N(() => { + const g = []; + if (o) { + let m = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + m = "boolean"; + break; + case "json": + m = "object"; + break; + } + g.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + g.push({ + type: n, + max: e, + min: t, + message: s || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) + }); + break; + case "pattern": + g.push({ type: "string", pattern: r, message: s }); + break; + case "validator": + i && g.push(({ getFieldValue: m }) => ({ + validator: async (h, y) => { + const b = await Fe.exec(i, { value: y, fieldName: a }, { getFieldValue: m }); + return f.isString(b) && b ? Promise.reject(b) : f.isBoolean(b) && !b ? Promise.reject(s) : Promise.resolve(); + } + })); + break; + } + p(g); + }, [e, t, n, s, r, o, i]), c; +}, _n = (e, t, n) => { + const [s, r] = k(null); + return N(() => { + const { + initDataUri: o = `/api/${e}`, + initDataMethod: i = "GET" + } = n || {}; + t && I.request({ + method: i, + url: f.trimEnd(`${o}/${t}`, "/") + }).then((a) => { + r(a); + }); + }, [e, t, n]), s; +}, es = (e, t, n, s = {}) => { + const r = Xt(), o = K(!0), i = K([]), [a, l] = k(n), c = Be.useWatch((p) => JSON.stringify(f.pick(p, i.current)), t) || "{}"; + return N(() => { + e && Fe.exec(e, s, { + getFieldValue: f.wrap(t.getFieldValue, (p, g) => (i.current.some((m) => f.isEqual(m, g)) || (i.current.push(g), r()), p(g))), + isFieldTouched: t.isFieldTouched, + isFieldsTouched: t.isFieldsTouched + }).then((p) => o.current && l(p)); + }, [e, c, t, s]), N(() => () => o.current = !1, []), a; +}, ts = (e) => ({ + code: t, + layout: n, + name: s, + primaryKey: r = 0, + style: o = {}, + formProps: i = {}, + form: a, + isPreview: l = !1, + className: c, + onFinish: p, + onValuesChange: g = () => { + }, + ...m +}) => { + const { + align: h, + autoComplete: y, + resource: b, + items: F, + hides: E, + rowHeight: T, + marginX: $, + marginY: Q, + listenChangeFields: M, + listenChangeFieldsFunc: G, + pk: P, + uuid: z + } = Qn(t), [U] = Ye.useForm(a), D = ({ + changedValues: j, + allValues: O, + listenChangeFields: _e, + listenChangeFieldsFunc: ue, + onValuesChange: ct, + code: Et + }) => { + ct(j, O), ue && Array.isArray(_e) && Fe.exec( + ue, + { changedValues: j, allValues: O }, + { + getFieldValue: U.getFieldValue, + setFieldsValue: U.setFieldsValue, + isFieldTouched: U.isFieldTouched, + isFieldsTouched: U.isFieldsTouched + } + ); + }, oe = le(() => [ + { name: "__PK__", value: P }, + { name: "__PROPS__", value: i }, + { name: "__RESOURCE__", value: b }, + { name: "__LAYOUT_KEY__", value: t }, + { name: "__LAYOUT_UUID__", value: z }, + { name: "__PRIMARY_KEY__", value: r } + ], [P, t, z, b, r, i]); + return /* @__PURE__ */ w( + Ye, + { + className: c, + requiredMark: !0, + name: s || t, + layout: n || h, + fields: oe, + form: U, + autoComplete: y, + style: { ...o, position: "relative" }, + onFinish: p, + onValuesChange: (j, O) => D( + { + changedValues: j, + allValues: O, + listenChangeFields: M, + listenChangeFieldsFunc: G, + onValuesChange: g, + code: t + } + ), + children: [ + /* @__PURE__ */ d( + e, + { + ...m, + form: U, + code: t, + fields: F, + rowHeight: T, + marginX: $, + marginY: Q + } + ), + E == null ? void 0 : E.map((j) => { + var O; + return /* @__PURE__ */ d(xt, { name: j.code, children: /* @__PURE__ */ d( + ns, + { + form: U, + name: j.code, + type: j.type, + initialValue: j.initialValue, + initialValueLanguage: (O = j.extras) == null ? void 0 : O.initialValueLanguage + } + ) }, JSON.stringify(j.code)); + }) + ] + } + ); +}, ns = ({ type: e, initialValue: t, initialValueLanguage: n, onChange: s, form: r }) => { + const o = es( + n == "javascript" && t, + r, + n == "javascript" ? void 0 : t, + {} + ); + return N(() => { + n == "javascript" ? s(f.toPrimitive(o, e)) : s(f.toPrimitive(t, e)); + }, [e, t, o]), null; +}, ss = (e) => function({ code: n, data: s, ...r }) { + const [o, i] = k({ + resource: null, + cols: 12, + rowHeight: 21, + fields: [] + }); + return N(() => { + n && I.get(`/api/_/${n}`).then((a) => i(f.pick(a, ["resource", "cols", "rowHeight", "fields"]))); + }, [n]), (o == null ? void 0 : o.resource) && /* @__PURE__ */ d( + e, + { + ...r, + rowHeight: o.rowHeight, + cols: o.cols, + fields: o.fields, + data: o != null && o.resource ? { [o == null ? void 0 : o.resource]: s } : {} + } + ); +}, rs = "RC_FORM_INTERNAL_HOOKS", Bt = (e, { + initialValue: t, + initialValueLanguage: n, + convertJs: s, + convertJsSetting: r, + type: o = "string" +}, i = null) => { + const a = K(!1), l = De(En), [c, p] = k(), [g, m] = k(n == "javascript" || !e ? void 0 : l.getFieldValue(e)), { registerWatch: h } = l.getInternalHooks(rs) || {}; + return N(() => h == null ? void 0 : h((y, b, F) => { + if (!a.current) + return; + const E = f.get(b, e); + f.isEqual(E, g) || m(f.toPrimitive(E, o)); + }), [g]), N(() => { + n == "javascript" && t ? Fe.exec(t, {}, { + getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : l.getFieldValue(y), + getFieldValue: (y) => l.getFieldValue(y) + }).then((y) => m(f.toPrimitive(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => a.current = !0) : (t && m(f.toPrimitive(t ?? l.getFieldValue(e), o)), a.current = !0); + }, [t, n]), at(() => { + a.current && s && J.getWidgetComponent(s).then(({ default: y }) => y({ value: g, record: l.getFieldsValue(!0), $setting: r })).then(p).catch((y) => console.error("布局数据转换错误: ", y, s)); + }, [g, s, r]), [c || g, g]; +}, os = (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"] = Tt(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"] = Tt(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; +}, Tt = (e, t, n, s) => `${e || 0}px ${t || 0}px ${n || 0}px ${s || 0}px`, Yt = ({ cols: e, rowHeight: t, fields: n, data: s, containerPadding: r = [0, 0], itemMargin: o = [4, 0], formProps: i = {}, className: a, ...l }) => { + const [c] = Be.useForm(), p = Kt(n, as, "@pkg/grid-layouts"), g = le(() => [ + { name: "__PROPS__", value: i } + ], [i]); + return at(() => { + c.setFieldsValue(s); + }, [s]), /* @__PURE__ */ d(Be, { fields: g, form: c, component: !1, children: /* @__PURE__ */ d( + "div", + { + ...l, + className: Z("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: p + } + ) }); +}, Kt = (e, t, n = "@pkg/grid-layouts", s = null) => le(() => { + 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: p, widgetPrefix: g = n, widget: m, ...h } }, y) => /* @__PURE__ */ d( + "div", + { + className: "grid-layout-item", + style: os(i, a, l, c, p, m === "Height" && (h == null ? void 0 : h.initialValue)), + children: /* @__PURE__ */ d( + is, + { + ...h, + basicForm: s, + itemWidget: m != null && m.startsWith("@") ? m : `${g}/${m}`, + itemWidgetRender: t + } + ) + }, + o || y + ) + ); +}, [e]), is = ({ itemWidget: e, itemWidgetRender: t, basicForm: n, ...s }) => { + const [r, o] = k(); + return N(() => { + J.getWidgetComponent(e).then(({ defaultProps: i, default: a }) => { + o(v.createElement(t(a, i, n), s)); + }).catch((i) => o(e)); + }, [e]), r; +}, as = (e, t, n = null) => (s) => { + const { + code: r, + label: o, + extras: i, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: p, + convertJsSetting: g, + ...m + } = f.merge({}, t, s), [h, y] = Bt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: p, + convertJsSetting: g, + type: (m == null ? void 0 : m.type) || "string" + }, n); + return /* @__PURE__ */ d(e, { ...m, value: h, rawValue: y, $setting: i || {} }); +}, rr = ss(Yt), Mt = ({ widget: e, widgetPrefix: t, widgetDecorator: n, subWidgets: s, basicForm: r, ...o }) => { + const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [a, l] = k(); + return N(() => { + i && J.getWidgetComponent(i).then(({ defaultProps: c, default: p }) => ({ + default: At(p, c, r) + })).catch((c) => ({ default: () => `${c}` })).then((c) => l(v.createElement(c.default, o))); + }, [i]), a && v.cloneElement(a, o); +}; +Mt.defaultProps = { + widgetPrefix: "@pkg/grid-layout-forms", + widget: "Input" +}; +const At = (e, t, n = null) => (s) => { + const { + type: r, + code: o, + label: i, + noStyle: a, + placeholder: l, + extras: c, + validators: p, + help: g, + isVirtual: m, + initialValue: h, + initialValueLanguage: y, + convertJs: b, + convertJsSetting: F, + widgetPerfix: E, + boxStyle: T, + widgetDecorator: $, + subWidgets: Q, + ...M + } = { ...t, ...s }, G = qn(p || {}, o, r), P = { + label: i, + noStyle: a, + colon: !1 + }, z = { + placeholder: l, + ...M + }, U = _((D) => D == null ? void 0 : f.toPrimitive(D, r), [r]); + return /* @__PURE__ */ d( + xt, + { + name: o, + rules: G, + initialValue: U(h), + normalize: U, + children: (D, oe, j) => { + var O; + return /* @__PURE__ */ d( + e, + { + type: r, + rcform: j, + itemProps: { + validateStatus: oe.errors.length > 0 ? "error" : "success", + tooltip: g, + help: oe.errors.length > 0 ? oe.errors.join("、") : null, + required: ((O = G == null ? void 0 : G[0]) == null ? void 0 : O.required) || !1, + ...P + }, + fieldProps: { ...z, ...D }, + $setting: c || {} + } + ); + } + } + ); +}, Ct = ({ cols: e, rowHeight: t, itemMargin: n = [8, 8], containerPadding: s = [0, 0], fields: r }) => { + const o = Kt(r, At, "@pkg/grid-layout-forms"); + return /* @__PURE__ */ d(Dt, { theme: { components: { Form: { itemMarginBottom: 0 } } }, children: /* @__PURE__ */ d("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 }) }); +}; +Ct.propTypes = { + fields: S.array.isRequired +}; +Ct.defaultProps = { + fields: [] +}; +const cs = ts(Ct), Jt = ({ children: e }) => { + const [t, n] = k({}), s = _((o, i) => n((a) => ({ ...a, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []); + return /* @__PURE__ */ d(je.Provider, { value: { ele: t, mount: s, unmount: r }, children: e }); +}; +Jt.defaultProps = { + isDrawerRender: !1 +}; +Jt.propTypes = { + isDrawerRender: S.bool +}; +const Qt = (e = {}, t = {}, n = {}, s = "") => f.deepSome(e, (r, o) => o === "type" && r === "code") ? qt(e, t, n, s) : _t(e, t, s), qt = async (e = {}, t = {}, n = {}, s = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let o in e) { + let i; + if (Reflect.has(e[o], "type") && ["code", "field", "router", "query", "string"].includes(e[o].type)) { + const { type: a, value: l = "", default: c = s } = e[o]; + switch (a) { + case "code": + i = await Fe.exec(l, t, n); + break; + case "field": + i = f.get(t, l) ?? f.get(t, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + i = ke.getPageParams(l); + break; + case "string": + i = l; + } + i ?? (i = c); + } else + i = await qt(e[o], t, n, s); + f.set(r, o, i); + } + return r; +}, _t = (e = {}, t = {}, n = "") => Object.keys(e || {}).reduce((s, r) => { + if (f.isPlainObject(e[r])) { + let o; + if (Reflect.has(e[r], "type") && ["field", "router", "query", "string"].includes(e[r].type)) { + const { type: i, value: a = "", default: l = n } = e[r]; + switch (i) { + case "field": + o = f.get(t, a) ?? f.get(t, a.substring(a.indexOf(".") + 1)); + break; + case "router": + case "query": + o = ke.getPageParams(a); + break; + case "string": + o = a; + break; + } + o ?? (o = l); + } else + o = _t(e[r], t, n); + f.set(s, r, o); + } + return s; +}, {}), ls = ({ + className: e, + itemClassName: t, + classNames: n, + dataSource: s, + isPaginate: r, + pageSize: o, + isItemOperations: i, + isBatchOperations: a, + batchOperations: l, + itemOperations: c, + itemOperationsAccess: p, + resource: g, + primaryKey: m, + title: h, + itemGridLayout: y, + $setting: b, + isTreeSider: F, + treeSiderConfig: E, + onClickCallback: T +}) => { + const { getBase62params: $ } = De(Ze), { total: Q, page: M } = $() || {}, G = _((P, z, U) => /* @__PURE__ */ d( + us, + { + className: Z("ff-data-list-framework-item", t), + operations: i && z ? c == null ? void 0 : c.filter((D) => !m || !D.uuid || !p.has(D.uuid) ? !0 : p.get(D.uuid).includes(z == null ? void 0 : z[m])) : [], + data: g ? { [g]: z } : z, + children: P, + onClickCallback: T + } + ), [g, m, i, T, c, p]); + return /* @__PURE__ */ w("div", { className: Z("ff-data-list-framework", e), children: [ + /* @__PURE__ */ d(kt, { className: n == null ? void 0 : n.sider, isTreeSider: F, ...E }), + /* @__PURE__ */ w("div", { className: Z("ff-data-list-container", n == null ? void 0 : n.container), children: [ + /* @__PURE__ */ d(tn, { className: n == null ? void 0 : n.filter }), + /* @__PURE__ */ d(nn, { title: h, className: n == null ? void 0 : n.toolbar }), + /* @__PURE__ */ d( + an, + { + ...y, + className: n == null ? void 0 : n.content, + style: { "--col-num": (b == null ? void 0 : b.colNum) || 1 }, + primaryKey: m, + itemRender: G, + dataSource: s + } + ), + /* @__PURE__ */ d( + sn, + { + className: n == null ? void 0 : n.footer, + isPaginate: r, + isOperations: a, + operations: l, + total: Q, + page: M, + pageSize: o + } + ) + ] }) + ] }); +}, us = ({ className: e, operations: t, children: n, data: s, onClickCallback: r }) => /* @__PURE__ */ w("div", { className: Z("data-list-grid-layout-item-container", e), children: [ + n, + !!(t != null && t.length) && /* @__PURE__ */ d("div", { className: "data-list-grid-layout-item-actions", children: t.map(({ isRefresh: o, ...i }) => /* @__PURE__ */ d("span", { className: "data-list-grid-layout-item-action", children: /* @__PURE__ */ d( + C.Link, + { + uuid: i.uuid, + type: i.type, + name: i.name, + widget: i.widget, + widgetType: i.widgetType, + widgetProps: i.widgetProps, + widgetSetting: i.widgetSetting, + widgetContainerProps: i.widgetContainerSetting, + data: s, + onAfterClick: (a) => r == null ? void 0 : r(i.isRefresh, s) + }, + i.uuid || useId() + ) }, (i == null ? void 0 : i.uuid) || useId())) }) +] }), ds = ({ + className: e, + itemClassName: t, + dataSource: n, + columns: s, + isItemOperations: r, + isBatchOperations: o, + batchOperations: i, + itemOperations: a, + itemOperationsAccess: l, + resource: c, + primaryKey: p, + title: g, + isPaginate: m, + pageSize: h, + isTreeSider: y, + treeSiderConfig: b, + ...F +}) => { + const { getBase62params: E, onClickCallback: T } = De(Ze), { total: $, page: Q } = E() || {}; + return /* @__PURE__ */ w("div", { className: Z("ff-data-table-framework", e), children: [ + /* @__PURE__ */ d(kt, { isTreeSider: y, ...b }), + /* @__PURE__ */ w("div", { className: "ff-data-table-container", children: [ + /* @__PURE__ */ d(tn, {}), + /* @__PURE__ */ d(nn, { title: g }), + /* @__PURE__ */ d( + on, + { + ...F, + className: "ff-data-table-content", + columns: s, + dataSource: n, + operationRender: (M) => /* @__PURE__ */ d("div", { className: "ff-data-table-actions", children: a == null ? void 0 : a.reduce((G, P, z) => [ + ...G, + /* @__PURE__ */ d( + C.Link, + { + size: "small", + uuid: P.uuid, + type: P.type, + name: P.name, + widget: P.widget, + widgetType: P.widgetType, + widgetProps: P.widgetProps, + widgetSetting: P.widgetSetting, + widgetContainerProps: P.widgetContainerSetting, + data: M, + onAfterClick: (U) => T == null ? void 0 : T(P.isRefresh, M) + }, + P.uuid || z + ) + ], []) }) + } + ), + /* @__PURE__ */ d( + sn, + { + isPaginate: m, + isOperations: o, + operations: i, + total: $, + page: Q, + pageSize: h + } + ) + ] }) + ] }); +}, Ze = v.createContext({ + getBase62params: (e, t) => { + }, + onReload: () => { + }, + onClickCallback: () => { + }, + onConditonChange: () => { + }, + onTabChange: () => { + }, + onSiderChange: () => { + }, + onKeywordChange: () => { + }, + onPageChange: () => { + }, + onPageSizeChange: () => { + } +}), en = ({ + isItemGridLayout: e, + theme: t, + themeProps: n, + onClickCallback: s, + onReload: r, + getBase62params: o, + onPageChange: i, + onPageSizeChange: a, + onTabChange: l, + onSiderChange: c, + onKeywordChange: p, + onConditonChange: g, + ...m +}) => { + const [h, y] = k(); + return N(() => { + t ? J.getWidgetComponent(t).then((b) => { + if (!b) + throw `${t} not found`; + return b; + }).catch((b) => ({ default: () => `${b}` })).then((b) => y(v.createElement(b.default, { ...m, $setting: n }))) : h || y(null); + }, [t, n]), /* @__PURE__ */ d(Ze.Provider, { value: { + onClickCallback: s, + onReload: r, + getBase62params: o, + onPageChange: i, + onPageSizeChange: a, + onTabChange: l, + onSiderChange: c, + onKeywordChange: p, + onConditonChange: g + }, children: h ? v.cloneElement(h, { ...m, $setting: n }) : e ? /* @__PURE__ */ d(ls, { ...m, $setting: n }) : /* @__PURE__ */ d(ds, { ...m, $setting: n }) }); +}; +en.defaultProps = { + onReload: () => { + }, + getBase62params: () => { + } +}; +const fs = (e, t, n, s, r) => { + const o = v.lazy(() => J.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` }))); + return /* @__PURE__ */ d(v.Suspense, { children: /* @__PURE__ */ d( + o, + { + value: t, + record: n, + $setting: s, + base62params: r + } + ) }, e); +}, ps = (e, t = {}) => (Zt(e), Zt(t), le(() => e == null ? void 0 : e.map(({ widgetByJs: s, widgetByJsSetting: r, ...o }, i) => s && !s.endsWith("/BasicShowFieldData") ? { + ...o, + render: (a, l) => { + const c = fs(s, a, l, r, t); + return f.isFunction(o == null ? void 0 : o.render) ? o.render(c, a, l) : c; + } +} : o), [e, t])), or = (e) => { + const [t, n] = k({}); + return N(() => { + let s = !1; + return e && I.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; +}, ir = (e, t = {}) => { + const [n, s] = k({ dataSource: [] }); + return at(() => { + let r = !1; + return e && I.get(`/api/${e}/${I.encode({ page: 1, ...t })}`).then((o) => !r && s(o)), () => r = !0; + }, [e, t]), n; +}, Gt = (e, t = null, n = null, s = "id") => le(() => { + if (f.isEmpty(e) || !e.every(({ uuid: o }) => ks.check(o))) + return !1; + if (f.isEmpty(n) || f.isEmpty(t)) + return !0; + const r = t.map((o) => o == null ? void 0 : o[s]); + return e.some(({ uuid: o }) => !o || !n.has(o) ? !0 : n.get(o).some((i) => r.includes(i))); +}, [e, t, n, s]), Rt = ({ listCode: e, base62params: t, className: n, itemClassName: s, theme: r, themeProps: o, classNames: i }) => { + const [{ tab: a, page: l, total: c, condition: p, sider: g, keyword: m, dataSource: h, itemOperationsAccess: y, pageSize: b }, F] = Jn(t), [{ + resource: E, + primaryKey: T, + batchOperations: $ = [], + itemOperations: Q = [], + columns: M = [], + themeConfig: G, + theme: P, + isTreeSider: z, + treeSiderConfig: U, + isItemGridLayout: D, + itemGridLayout: oe, + title: j, + isPaginate: O + }, _e] = k({ isItemGridLayout: !1, itemGridLayout: {} }), ue = (X) => I.list(e, { tab: a, page: l, total: c, condition: p, sider: g, keyword: m, ...X }).then(({ + condition: H, + total: de, + tab: Ve, + page: fe, + pageSize: Le, + operationsAccess: ie, + dataSource: B + }) => { + F({ + dataSource: B, + pageSize: Le, + total: de, + page: fe, + tab: Ve, + condition: H, + sider: g, + keyword: m, + itemOperationsAccess: new Map(ie) + }); + }), ct = Gt(Q, h, y, T), Et = Gt($); + N(() => { + let X = null; + return e && I.get(`/api/_/${e}`).resp(({ data: H, res: de }) => { + H != null && H.isDynamicRefresh && (X = jt.subscribe(() => ue(), de)), _e(H); + }).catch(() => _e({})), F((H) => ({ ...H, dataSource: [] })), () => X == null ? void 0 : X(); + }, [e]), N(() => { + e && ue(t); + }, [t]); + const dn = () => { + }, fn = () => { + }, pn = () => { + }, hn = () => { + }, gn = (X, H) => ue({ page: X, pageSize: H }), mn = (X) => ue({ pageSize: X, page: 1 }), yn = (X, H) => { + const de = { tab: a, sider: g, keyword: m, page: l, pageSize: b, condition: p, total: c }; + return X ? f.get(de, X, H) : de; + }, lt = () => { + ue(); + }, bn = (X = 0, H = null) => { + if (X === 2) { + const de = f.get(H, "__PARENT_ID__", ""), Ve = f.get(H, T, ""), fe = f.findIndex(h, ["__PARENT_ID__", de]), Le = f.findIndex(fe > -1 ? f.get(h, [fe, "children"]) : h, [T, Ve]); + Le > -1 ? (I.get(`/api/${e}/detail/${Ve}`).then((ie) => { + F((B) => { + const Ne = f.get(B.dataSource, fe > -1 ? [fe, "children", Le, "children"] : [Le, "children"]); + return { + ...B, + dataSource: fe > -1 ? wt(B.dataSource, { [fe]: { children: { $splice: [[Le, 1, { ...ie, children: Ne }]] } } }) : wt(B.dataSource, { $splice: [[Le, 1, { ...ie, children: Ne }]] }) + }; + }); + }), I.post(`/api/${e}/list-operations-access`, { ids: Ve }).then((ie) => new Map(ie)).then((ie) => { + F((B) => (B.itemOperationsAccess.forEach((Ne, Ie) => { + var Pt; + (Pt = ie.get(Ie)) != null && Pt.some((ut) => ut == Ve) || B.itemOperationsAccess.set(Ie, Ne.filter((ut) => ut !== Ve)); + }), ie.forEach((Ne, Ie) => { + B.itemOperationsAccess.has(Ie) ? B.itemOperationsAccess.set(Ie, f.uniq([...B.itemOperationsAccess.get(Ie) || [], ...Ne])) : B.itemOperationsAccess.set(Ie, Ne); + }), { ...B })); + })) : lt(); + } else + X === 1 && lt(); + }; + return /* @__PURE__ */ d( + en, + { + ...{ + title: j, + itemClassName: s, + classNames: i, + resource: E, + primaryKey: T, + theme: r || P, + themeProps: o || G, + isPaginate: O, + pageSize: b, + page: l, + isTreeSider: z, + treeSiderConfig: U, + isItemOperations: ct, + isBatchOperations: Et, + batchOperations: $, + itemOperations: Q, + itemOperationsAccess: y, + dataSource: h, + isItemGridLayout: D, + columns: M, + itemGridLayout: oe + }, + className: Z("ff-data-list-helper", n), + getBase62params: yn, + onReload: lt, + onClickCallback: bn, + onConditonChange: dn, + onTabChange: fn, + onSiderChange: pn, + onKeywordChange: hn, + onPageChange: gn, + onPageSizeChange: mn + } + ); +}, tn = ({ className: e }) => (v.useContext(Ze), /* @__PURE__ */ w("div", { className: Z("ff-data-list-filter", e), children: [ + /* @__PURE__ */ d( + wn, + { + placeholder: "关键字", + style: { width: "30%", maxWidth: 300 }, + prefix: /* @__PURE__ */ d(vt, { type: "icon-search" }) + } + ), + /* @__PURE__ */ w("div", { className: "ff-data-list-actions", children: [ + /* @__PURE__ */ d(C, { children: "重置" }), + /* @__PURE__ */ d(C, { type: "primary", children: "查询" }), + /* @__PURE__ */ d( + C.Link, + { + className: "ff-data-list-filter-submit-button", + type: "primary", + name: "展开", + icon: "icon-down", + iconPosition: "end" + } + ) + ] }) +] })), hs = [ + { title: "全部", className: "active" }, + { title: "运行中" }, + { title: "已上线" } +], nn = ({ className: e, title: t }) => /* @__PURE__ */ w("div", { className: Z("ff-data-list-toolbar", e), children: [ + /* @__PURE__ */ d("div", { className: "ff-data-list-title", children: t }), + /* @__PURE__ */ d(Zn, { className: "ff-data-list-tabs", items: hs }), + /* @__PURE__ */ w("div", { className: "ff-data-list-actions", children: [ + /* @__PURE__ */ d(C.Link, { icon: "icon-reload" }), + /* @__PURE__ */ d(C.Link, { icon: "icon-setting" }) + ] }) +] }), gs = [ + { + 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__ */ d( + "span", + { + style: { + color: "#1677ff" + }, + children: "sss" + } + ), + key: "0-0-1-0" + } + ] + } + ] + } +], kt = ({ className: e, width: t, isTreeSider: n }) => n ? /* @__PURE__ */ d( + Tn.DirectoryTree, + { + className: Z("ff-data-list-sider", e), + style: { "--sider-width": t }, + showLine: !0, + showIcon: !1, + treeData: gs + } +) : null; +kt.defaultProps = { + width: 280 +}; +const sn = ({ className: e, operations: t, isOperations: n, isPaginate: s, total: r, page: o, pageSize: i }) => { + const { onPageChange: a, onPageSizeChange: l, onClickCallback: c } = v.useContext(Ze); + return n && !f.isEmpty(t) || s ? /* @__PURE__ */ w("div", { className: Z("ff-data-list-footer", e), children: [ + /* @__PURE__ */ d("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((p, g) => /* @__PURE__ */ d( + C, + { + uuid: p.uuid, + type: p.type, + name: p.name, + widget: p.widget, + widgetType: p.widgetType, + widgetProps: p.widgetProps, + widgetSetting: p.widgetSetting, + widgetContainerProps: p.widgetContainerSetting, + onAfterClick: (m) => c == null ? void 0 : c(p.isRefresh, null) + }, + p.uuid || g + )) }), + s && /* @__PURE__ */ d( + Gn, + { + size: "small", + total: r, + pageSize: i, + showSizeChanger: !1, + showTotal: (p) => `第 ${o} 页 / 总共 ${p} 条`, + onChange: a, + onShowSizeChange: l + } + ) + ] }) : null; +}, rn = (e, t, n = !0) => n !== !0 && n-- <= 0 ? [] : f.isArray(e) && !f.isEmpty(e) ? e.reduce((s, r) => (Reflect.has(r, t) && Reflect.has(r, "children") && s.push(r[t]), Reflect.has(r, "children") && !f.isEmpty(r.children) ? s.concat(rn(r.children, t, n)) : s), []) : [], on = ({ + className: e, + primaryKey: t, + columns: n, + dataSource: s, + operationRender: r, + operationWidth: o, + ...i +}) => { + const a = K(null), l = K(null), [c, p] = k([]), [g, m] = k({ width: 0, height: 0 }); + N(() => { + p(rn(s, t)); + }, [s, t]), Rn(() => { + 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 h = ps(n); + return /* @__PURE__ */ d("div", { ref: l, className: Z("ff-data-list-table", e), children: g.height ? /* @__PURE__ */ d( + Sn, + { + ...i, + ref: a, + rowKey: (y, b) => (y == null ? void 0 : y[t]) ?? b, + columns: h == null ? void 0 : h.concat(r ? [{ + title: "操作", + align: "center", + fixed: "right", + width: `${Math.ceil(o / g.width * 100).toFixed(2)}%`, + render: (y, b, F) => r(b, F) + }] : []), + dataSource: s, + size: "middle", + scroll: { x: "max-content", y: g.height - 47 }, + pagination: !1, + expandable: { + defaultExpandAllRows: !0, + expandRowByClick: !0, + onExpandedRowsChange: p, + expandedRowKeys: c + } + } + ) : null }); +}; +on.defaultProps = { + operationWidth: 180, + columns: [], + dataSource: [] +}; +const ms = ({ widget: e, widgetPrefix: t, basicForm: n, ...s }) => { + const r = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, i] = k(); + return N(() => { + r && J.getWidgetComponent(r).then(({ defaultProps: a, default: l }) => ({ + default: ys(l, a, n) + })).catch((a) => ({ default: () => `${a}` })).then((a) => i(v.createElement(a.default, s))); + }, [r]), o; +}, ys = (e, t, n = null) => (s) => { + const { + code: r, + label: o, + extras: i, + isVirtual: a, + initialValue: l, + initialValueLanguage: c, + convertJs: p, + convertJsSetting: g, + value: m, + ...h + } = f.merge({}, t, s), [y, b] = Bt(a ? null : r, { + initialValue: l, + initialValueLanguage: c, + convertJs: p, + convertJsSetting: g, + type: (h == null ? void 0 : h.type) || "string" + }, n); + return /* @__PURE__ */ d(e, { ...h, value: y, rawValue: b, $setting: i || {} }); +}; +ms.defaultProps = { + widgetPrefix: "@pkg/grid-layouts" +}; +const an = ({ + cols: e, + rowHeight: t, + itemMargin: n, + fields: s, + primaryKey: r, + itemRender: o, + dataSource: i, + itemClassName: a, + empty: l, + className: c, + style: p +}) => { + const g = kn(), m = le(() => /* @__PURE__ */ d( + Yt, + { + cols: e, + rowHeight: t, + itemMargin: n, + fields: s, + className: a + } + ), [s, e, t, n]); + return /* @__PURE__ */ d("div", { className: Z("ff-data-list-content", c), style: p, children: f.isEmpty(i) ? l : i == null ? void 0 : i.map((h, y) => /* @__PURE__ */ d(v.Fragment, { children: o(v.cloneElement(m, { data: h }), h, y) }, `${g}-${(h == null ? void 0 : h[r]) || y}`)) }); +}; +an.defaultProps = { + itemRender: (e, t, n) => e, + empty: /* @__PURE__ */ d($n, { description: null }), + style: {} +}; +const bs = (e, t, { isReplaceRouteHistory: n = !1 } = {}) => ke.redirect(t, e, { replace: n }), St = (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 ? Fe.exec(t, e, o) : null; +}, $t = (e, t, n, s) => f.isString(t) && t ? J.getWidgetComponent(t).then(({ default: r }) => { + L.modal( + r, + { ...e, $setting: n, code: t }, + s + ); +}).catch((r) => { + L.error(t, { content: r.toString() }); +}) : L.modal( + t, + { ...e, $setting: n, code: t }, + s +), vs = (e, t, n, s) => L.modal( + cn, + { ...e, $setting: n, code: t }, + s +), Cs = (e, t, n, s) => L.modal( + Rt, + { base62params: e, $setting: n, listCode: t }, + s +), Rs = ({ + widget: e, + widgetType: t, + widgetData: n, + widgetProps: s, + widgetSetting: r, + widgetContainerProps: o +}, { onAfterClick: i, onBeforeClick: a }) => { + const l = De(Ze); + De(ln); + const [c, p] = k({ leading: !0, trailing: !1 }), g = le(() => { + switch (t) { + case "redirect": + return f.partialRight(bs, e, r); + case "func": + return f.partialRight(St, (r == null ? void 0 : r.code) ?? e, { status: c, setStatus: p }); + case "fsdpf-component": + return f.partialRight($t, e, r, o); + case "grid-layout-form": + return f.partialRight(vs, e, r, o); + case "data-list": + return f.partialRight(Cs, e, r, o); + default: + if (It(e)) + return f.partialRight($t, e, r, o); + if (f.isFunction(e)) + return f.partialRight(St, (r == null ? void 0 : r.code) || e, { status: c, setStatus: p }); + } + return (...h) => console.error("useButton unknown widgetType", t, ...h); + }, [e, t]); + return [f.debounce((h) => (a == null || a(h), Promise.resolve(Qt(s, h, { list: l })).then((y) => g({ ...n, ...y })).then((y) => i == null ? void 0 : i(y)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; +}; +var he, Se; +const te = class te { + constructor() { + R(this, Se, null); + V(this, "init", (t) => x(this, Se, new Map(t))); + V(this, "check", (t) => !u(this, Se).has(t) || u(this, Se).get(t)); + if (u(te, he)) + return u(te, he); + } +}; +he = new WeakMap(), Se = new WeakMap(), R(te, he, null), V(te, "getInstance", () => (u(te, he) || x(te, he, new te()), u(te, he))); +let ft = te; +const ks = ft.getInstance(), qe = (e) => function({ + className: n, + children: s, + name: r, + icon: o, + type: i, + data: a, + noAuthType: l, + onAfterClick: c, + onBeforeClick: p, + loading: g, + disabled: m, + tooltip: h, + popConfirm: y, + widget: b, + widgetType: F, + widgetData: E, + widgetProps: T, + widgetSetting: $, + widgetContainerProps: Q, + ...M +}) { + const G = { + type: "primary", + className: Z("ff-button", n) + }; + i === "danger" ? G.danger = !0 : i === "default" && (G.type = i), e === "link" || e === "dashed" ? (G.type = e, i === "default" && (G.className = Z(G.className, "ff-default"))) : (e === "circle" || e === "round") && (G.shape = e), o && (G.icon = /* @__PURE__ */ d(vt, { type: o })); + const [P, z] = k(!1), [U, { disabled: D, loading: oe }] = Rs({ widget: b, widgetType: F, widgetData: E, widgetProps: T, widgetSetting: $, widgetContainerProps: Q }, { onAfterClick: c, onBeforeClick: p }); + return /* @__PURE__ */ d( + zn, + { + okText: "确定", + cancelText: "取消", + ...y || {}, + disabled: D || m, + open: P, + onOpenChange: (O) => { + if (!O) + return z(O); + y ? z(O) : U(a); + }, + onConfirm: () => { + U(a); + }, + onClick: (O) => { + O.stopPropagation(); + }, + children: /* @__PURE__ */ d(On, { ...h, title: P ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: /* @__PURE__ */ d( + xn, + { + loading: oe || g, + disabled: D || m, + ...G, + ...M, + children: s || r + } + ) }) + } + ); +}, C = qe("default"), Fs = qe("link"), Vs = qe("circle"), Ls = qe("round"), Ns = qe("dashed"), Ft = ({ data: e, widget: t, widgetType: n, children: s, widgetData: r, widgetProps: o, widgetSetting: i, widgetContainerProps: a }) => { + const l = De(Ze), [c, p] = k(!1), [g, m] = k("hover"), [h, y] = k({}), [b, F] = k(); + N(() => { + n == "grid-layout-form" ? F(v.createElement(cn, { ...r, $setting: i, code: t })) : n == "data-list" ? F(v.createElement(Rt, { base62params: e, $setting: i, listCode: t })) : f.isString(t) ? J.getWidgetComponent(t).then(({ default: $ }) => { + F(v.createElement($, { ...r, $setting: i })); + }).catch(($) => F($.toString())) : It(t) ? F(v.createElement(t, { ...r, $setting: i })) : v.isValidElement(t) && F(v.cloneElement(t, { ...r, $setting: i })); + }, [n, r]), N(() => { + Promise.resolve(Qt(o, e, { list: l })).then(y); + }, [o, e]); + const E = ($) => { + p($), !$ && m("hover"); + }, T = () => { + p(!0), m("click"); + }; + return /* @__PURE__ */ d( + Un, + { + ...a, + onPopupClick: T, + onClick: T, + open: c, + trigger: g, + content: /* @__PURE__ */ d(Is, { children: b && v.cloneElement(b, { ...h, $close: () => E(!1) }) }), + children: s, + onOpenChange: E, + overlayClassName: "ff-popup ff-popover" + } + ); +}, Is = ({ children: e }) => { + const [t, n] = k({}), s = _((o, i) => n((a) => ({ ...a, [o]: i })), []), r = _((o) => n((i) => ({ ...i, [o]: void 0 })), []); + return /* @__PURE__ */ w(je.Provider, { value: { ele: t, mount: s, unmount: r }, children: [ + t != null && t.title || t != null && t["sub-title"] ? /* @__PURE__ */ w("div", { className: "ff-popup-header", children: [ + (t == null ? void 0 : t.title) || /* @__PURE__ */ d("div", { className: "ff-popup-title" }), + (t == null ? void 0 : t["sub-title"]) || /* @__PURE__ */ d("div", { className: "ff-popup-sub-title" }) + ] }) : null, + e, + t != null && t.extras || t != null && t.actions ? /* @__PURE__ */ w("div", { className: "ff-popup-footer", children: [ + (t == null ? void 0 : t.extras) || /* @__PURE__ */ d("div", { className: "ff-popup-extras" }), + (t == null ? void 0 : t.actions) || /* @__PURE__ */ d("div", { className: "ff-popup-actions" }) + ] }) : null + ] }); +}; +Ft.defaultProps = { + widgetType: "fsdpf-component" +}; +Ft.propTypes = { + widgetType: S.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) +}; +C.defaultProps = { + type: "default", + iconPosition: "start" +}; +C.propTypes = { + type: S.oneOf(["primary", "default", "danger", ""]), + name: S.string, + // 按钮名称 + icon: S.string, + // 图标 + iconPosition: S.oneOf(["start", "end"]), + // 图标位置 + data: S.any, + // onClick 数据源, 会受到 widgetProps 数据结构影响 + widget: S.any, + // 组件 + widgetType: S.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), + // 组件类型 + widgetData: S.object, + // onClick缺省数据 + widgetProps: S.object, + // data 数据结构 + widgetSetting: S.object, + // $setting + widgetContainerProps: S.object + // 容器配置 +}; +C.Link = Fs; +C.Link.defaultProps = C.defaultProps; +C.Link.propTypes = C.propTypes; +C.Circle = Vs; +C.Circle.defaultProps = C.defaultProps; +C.Circle.propTypes = C.propTypes; +C.Round = Ls; +C.Round.defaultProps = C.defaultProps; +C.Round.propTypes = C.propTypes; +C.Dashed = Ns; +C.Dashed.defaultProps = C.defaultProps; +C.Dashed.propTypes = C.propTypes; +C.Popover = Ft; +const cn = ({ $setting: e, $close: t, extras: n, code: s, primaryKey: r, ...o }) => { + const [i] = Ye.useForm(), a = _n(s, r, e); + N(() => { + a && i.setFieldsValue(a); + }, [a]); + const l = () => { + const c = i.getFieldValue("__RESOURCE__"), { + initDataUri: p = `/api/${s}` + } = e || {}; + i.validateFields(!0).then((g) => c ? f.pick(g, [c]) : g).then((g) => I.post(r ? `${p}/${r}` : `${p}`, g).msg(t)).catch(() => L.error("请先完善表单信息", { duration: 2e3 })); + }; + return /* @__PURE__ */ d( + Y, + { + actions: /* @__PURE__ */ w(v.Fragment, { children: [ + /* @__PURE__ */ d(C, { name: "保存", type: "primary", widget: l }), + /* @__PURE__ */ d(C, { name: "取消", widget: () => t(!1) }) + ] }), + extras: n, + children: /* @__PURE__ */ d(cs, { form: i, code: s, primaryKey: r, ...o }) + } + ); +}, Es = (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 = Es(i, t, n); + if (!f.isEmpty(a)) + return a; + } + return {}; +}, Ps = ({ fields: e, formProps: t, $close: n }) => { + const [s] = Ye.useForm(), r = () => s.validateFields(!0).then(n), o = le(() => [ + { name: "__PROPS__", value: t } + ], [t]); + return /* @__PURE__ */ d(Y, { actions: /* @__PURE__ */ w(v.Fragment, { children: [ + /* @__PURE__ */ d(C, { name: "取消", widget: () => n(Promise.reject(!1)) }), + /* @__PURE__ */ d(C, { name: "确定", type: "primary", widget: () => r() }) + ] }), children: /* @__PURE__ */ d(Dt, { theme: { components: { Form: { itemMarginBottom: 6 } } }, children: /* @__PURE__ */ d(Ye, { fields: o, layout: "vertical", form: s, children: e == null ? void 0 : e.map(({ code: i, ...a }) => /* @__PURE__ */ d(Mt, { code: i, ...a }, i)) }) }) }); +}; +var tt, $e, ge, nt, st, Ke, rt, ze; +const Ge = class Ge extends v.Component { + constructor(n) { + super(n); + R(this, tt, null); + R(this, $e, 0); + R(this, ge, /* @__PURE__ */ new Map()); + R(this, nt, (n) => new Promise((s) => { + const r = Xe(this, $e)._++; + u(this, ge).set(r, v.createElement(Yn, { + ...n, + key: r, + $close: (o) => u(this, ze).call(this, r, () => s(o)) + })), this.forceUpdate(); + })); + R(this, st, (n, s) => new Promise((r) => { + const o = Xe(this, $e)._++; + u(this, ge).set(o, v.createElement(Kn, { + ...s, + content: n, + key: o, + $close: (i) => u(this, ze).call(this, o, () => r(i)) + })), this.forceUpdate(); + })); + R(this, Ke, (n, s, { mode: r, ...o } = {}) => new Promise((i) => { + const a = Xe(this, $e)._++, l = { current: null }; + u(this, ge).set(a, v.createElement( + r == "drawer" ? Mn : An, + { + ref: l, + key: a, + maskClosable: !1, + ...o, + $close: (c) => u(this, ze).call(this, a, () => i(c)) + }, + v.createElement(n, { + ...s, + $close: (c) => l.current.handleClose(c) + }) + )), this.forceUpdate(); + })); + R(this, rt, (n, s = {}, r = {}) => u(this, Ke).call(this, Ps, { formProps: r, fields: n }, s)); + R(this, ze, (n, s) => { + u(this, ge).delete(n), this.forceUpdate(s); + }); + Ge.modal = u(this, Ke), Ge.notification = u(this, nt), Ge.confirm = u(this, st), Ge.form = u(this, rt); + } + componentWillUnmount() { + var n, s; + (s = (n = u(this, tt)) == null ? void 0 : n[1]) == null || s.call(n); + } + render() { + const n = Array.from(u(this, ge)); + return /* @__PURE__ */ d(v.Fragment, { children: n.map(([s, r]) => r) }); + } +}; +tt = new WeakMap(), $e = new WeakMap(), ge = new WeakMap(), nt = new WeakMap(), st = new WeakMap(), Ke = new WeakMap(), rt = new WeakMap(), ze = new WeakMap(); +let L = Ge; +L.notification = ({ title: e, content: t, icon: n, category: s, ...r }) => Promise.resolve(Ut[s || "open"]({ + ...r, + icon: n ? /* @__PURE__ */ d(vt, { type: n || "" }) : void 0, + message: e, + description: t +})); +L.success = (e, t = {}) => L.notification({ title: e, category: "success", ...t }); +L.error = (e, t = {}) => L.notification({ title: e, category: "error", ...t }); +L.confirm = (e, t = {}) => L.notification({ content: e, ...t }); +L.form = (e, t = {}) => L.notification({ title: e, ...t }); +L.modal = (e = {}) => L.notification(e); +const pt = "mine", Vt = "token", Ws = "web", ws = 60 * 60 * 24 * 30, Lt = () => { + 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 > ws) + throw "登录令牌已过期, 请重新登录!"; + return e; +}, Zs = () => { + try { + return !!Lt(); + } catch { + return !1; + } +}, ar = (e = !0) => { + var t; + try { + const n = Lt(); + 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 } = I.decode(window.localStorage.getItem(pt) || "", {}); + return r === s ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: i = null }) => (window.localStorage.setItem(pt, I.encode({ ...i, iat: s })), i)); + } catch (n) { + console.error(n), e && L.error("请登录").then(Ts); + } + return Promise.resolve(null); +}, cr = (e, t, n = {}) => I.post("/api/user-token", { + username: e, + passwd: Fn.hash(t), + platform: Ws, + ...n +}).then(({ token: s }) => (window.localStorage.setItem(Vt, s), s)), Ts = () => { + window.localStorage.removeItem(pt), window.localStorage.removeItem(Vt); +}; +He.interceptors.request.use((e) => { + e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS"); + try { + const t = Lt(); + e.headers.Authorization = t ? `Bearer ${t} ` : void 0; + } catch { + } + return e; +}, (e) => Promise.reject({ code: -1, msg: e })); +He.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.onMsg = (e, t) => L[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && ke.redirect(we.get("Common.WEBSITE_LOGIN_PAGE"))); +const Gs = v.createContext({ + user: {}, + initUser: () => { + }, + initUserComplete: !1 +}), ln = v.createContext({ + set: () => { + }, + get: () => { + }, + assign: () => { + }, + currentRoute: () => { + } +}); +var Oe, Me, xe, ce, Pe, We; +class un { + constructor(t, n) { + R(this, Oe, /* @__PURE__ */ new Map()); + R(this, Me, !0); + R(this, xe, []); + R(this, ce, void 0); + R(this, Pe, () => u(this, ce)); + R(this, We, () => Promise.resolve()); + V(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, ce), ...t)); + if (u(this, ce) === void 0) + u(this, xe).push([t, n, s]), u(this, Me) && (x(this, Me, !1), Promise.resolve(typeof u(this, Pe) == "function" ? u(this, Pe).call(this) : u(this, Pe)).then((o) => x(this, ce, o || null)).finally(() => { + u(this, xe).forEach(([o, i, a]) => { + try { + const l = u(this, We).call(this, u(this, ce), ...o); + u(this, Oe).set(JSON.stringify(o), l), i(l); + } catch (l) { + a(l); + } + }), u(this, xe).length = 0; + })); + else { + const o = u(this, We).call(this, u(this, ce), ...t); + u(this, Oe).set(r, o), n(o); + } + })); + x(this, We, n), x(this, Pe, t); + } +} +Oe = new WeakMap(), Me = new WeakMap(), xe = new WeakMap(), ce = new WeakMap(), Pe = new WeakMap(), We = new WeakMap(); +var me, Ae; +const ne = class ne { + constructor() { + R(this, Ae, null); + V(this, "init", (t) => x(this, Ae, t)); + V(this, "get", (t, n) => f.get(u(this, Ae), t, n)); + if (u(ne, me)) + return u(ne, me); + } +}; +me = new WeakMap(), Ae = new WeakMap(), R(ne, me, null), V(ne, "getInstance", () => (u(ne, me) || x(ne, me, new ne()), u(ne, me))); +let ht = ne; +const we = ht.getInstance(), Ss = ({ component: e }) => { + const { base62params: t } = jn(); + return /* @__PURE__ */ d(Y, { children: /* @__PURE__ */ d( + Rt, + { + listCode: e, + base62params: I.decode(t) + } + ) }); +}, $s = ({ component: e, $setting: t }) => { + const [n, s] = k(); + N(() => { + if (!e) + return s(/* @__PURE__ */ d(Empty, { description: null })); + J.getWidgetComponent(e).catch((o) => ({ default: () => `${o}` })).then((o) => v.createElement(o.default, { $setting: t })).then(s); + }, [e]); + const r = {}; + return n ? v.cloneElement(n, r) : null; +}; +var ye, q, be, ve, Je, Qe; +const se = class se { + constructor() { + R(this, q, /* @__PURE__ */ new Map()); + R(this, be, {}); + R(this, ve, null); + V(this, "init", (t, n) => { + x(this, q, t), x(this, be, n); + }); + V(this, "get", (t) => (u(this, q).has(t) || (t = Array.from(u(this, q).keys()).find((n) => u(this, q).get(n).uri === t)), u(this, q).get(t) || {})); + V(this, "redirect", (t, n, s = {}) => { + const { uri: r, type: o, widgetProps: i } = this.get(t) || {}; + let a = Xn(r || t, o != "list" ? n : f.mapValues(n, (c) => I.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, ve).navigate(a, s); + }); + /** + * + * @param {*} category // user, system, navigator + * @returns + */ + V(this, "getMenus", (t) => { + var n; + return ((n = u(this, be)) == null ? void 0 : n[t]) || []; + }); + V(this, "findMenuPathByUuid", (t) => { + let n = []; + for (const s in u(this, be)) + if (n = u(this, Je).call(this, u(this, be)[s], t, [s]), n.length > 1) + return n; + return n; + }); + V(this, "getMenusByRouteUuid", (t) => u(this, Qe).call(this, t, Object.values(u(this, be)).flat())); + R(this, Je, (t, n, s = []) => { + if (f.isEmpty(t)) + return s; + for (const { uuid: r, children: o } of t) { + if (r == n) + return s.concat(r); + if (!f.isEmpty(o)) + return s.concat(r, u(this, Je).call(this, o, n)); + } + return s; + }); + R(this, Qe, (t, n) => { + var r; + let s = []; + for (const o of n) + o.widgetType == "redirect" && (o.uuid == t || o.widget == t ? s.push(o) : (r = o.children) != null && r.length && (s = s.concat(u(this, Qe).call(this, t, o.children)))); + return s; + }); + V(this, "getCurrentMenu", () => { + const { uuid: t } = this.getCurrentRoute() || {}; + if (!t) + return; + const n = this.getMenusByRouteUuid(t); + if (!f.isEmpty(n)) + return n[0]; + }); + V(this, "getCurrentRoute", (t = 0) => { + var s; + const n = (s = u(this, ve).state.matches[u(this, ve).state.matches.length - 1 - t]) == null ? void 0 : s.route; + if (!n) + return null; + for (let [r, o] of u(this, q)) + if (o.uri === n.path) + return o; + return null; + }); + V(this, "getPageParams", (t) => { + var o; + const { location: n, matches: s } = u(this, ve).state, r = ((o = s[s.length - 1]) == null ? void 0 : o.params) || {}; + return n.search && new URLSearchParams(n.search).forEach((i, a) => { + r[a] = i; + }), t ? f.get(r, t) : r; + }); + V(this, "createBrowserRouter", (t = {}) => { + if (u(this, q).size == 0) + return null; + const n = we.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), s = we.get(Zs() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = Array.from(u(this, q).values()).reduce((i, { uuid: a, uri: l, name: c, type: p, component: g, widgetSetting: m, isLogin: h, isLayout: y, extra: b }) => { + let F = {}, E = 0; + switch (p) { + case "list": + F.element = v.createElement(Ss, { component: g }); + break; + case "fsdpf-component": + F.element = v.createElement($s, { key: g, component: g, $setting: m }); + break; + } + if (b != null && b.layout) + if (r[b == null ? void 0 : b.layout]) + E = r[b == null ? void 0 : b.layout]; + else + return r[b == null ? void 0 : b.layout] = i.length, [...i, { + path: "/", + lazy: () => J.getWidgetComponent(b == null ? void 0 : b.layout).then((T) => ({ Component: T.default })), + children: [{ path: l, ...F }] + }]; + return y && E > -1 ? (i[E].children.push({ path: l, ...F }), i) : [...i, { path: l, ...F }]; + }, [ + { + path: "/", + lazy: () => J.getWidgetComponent(n).then((i) => ({ Component: i.default })), + children: [] + } + ]); + return o.push({ index: !0, element: v.createElement(Hn, { to: s, replace: !0 }) }), x(this, ve, Bn(o, t)); + }); + if (u(se, ye)) + return u(se, ye); + } +}; +ye = new WeakMap(), q = new WeakMap(), be = new WeakMap(), ve = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), R(se, ye, null), V(se, "getInstance", () => (u(se, ye) || x(se, ye, new se()), u(se, ye))); +let gt = se; +const ke = gt.getInstance(), Te = new Worker(new URL("data:text/plain;base64,KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2ltcG9ydFNjcmlwdHMoImh0dHBzOi8vYXNzZXRzLmZzZHBmLm5ldC9qcy91bWQvbG9kYXNoQDRfMTdfMjEubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9sb2Rhc2gubWl4aW4uanMiKSxpbXBvcnRTY3JpcHRzKCJodHRwczovL2Fzc2V0cy5mc2RwZi5uZXQvanMvdW1kL21vbWVudEAyXzI5XzQubWluLmpzIiwiaHR0cHM6Ly9hc3NldHMuZnNkcGYubmV0L2pzL3VtZC9tb21lbnQubG9jYWxlLnpoLWNuLmpzIiksbW9tZW50LmxvY2FsZSgiemgtY24iKTtjb25zdCBVdGlsPShlLHMpPT57Y29uc3QgdD1VdGlsLm1zZ19pZCsrO3JldHVybiBuZXcgUHJveHkoKCk9Pnt9LHtnZXQoe3Jvb3Q6YX0sbil7Y29uc3Qgbz1hP2Ake2F9LyR7bn1gOm47cmV0dXJuIGZ1bmN0aW9uKC4uLmkpe3JldHVybiBuZXcgUHJvbWlzZSgocixsKT0+e1V0aWwubVF1ZXVlLnNldCh0LFtyLGxdKSxzZWxmLnBvc3RNZXNzYWdlKHtpZDp0LHRhc2tfaWQ6ZSxzZXNzaW9uOnMsY2F0ZWdvcnk6InV0aWwiLG1ldGhvZDpvLGFyZ3M6aX0pfSl9fSxhcHBseShhLG4sbyl7cmV0dXJuIG5ldyBQcm94eShPYmplY3QuY3JlYXRlKHtyb290Om9bMF18fG51bGx9KSx7Z2V0OnRoaXMuZ2V0fSl9fSl9O1V0aWwubXNnX2lkPTAsVXRpbC5tUXVldWU9bmV3IE1hcCxVdGlsLm1NZXRob2RXb3Jrc3BhY2U9bmV3IE1hcCxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uKHtkYXRhOntpZDplLGRhdGE6cyxlcnJvcjp0LGNhdGVnb3J5OmF9fSl7YT09PSJ1dGlsIiYmKHQhPT1udWxsP1V0aWwubVF1ZXVlLmdldChlKVsxXSh0KTpVdGlsLm1RdWV1ZS5nZXQoZSlbMF0ocyksVXRpbC5tUXVldWUuZ2V0KGUpLFV0aWwubVF1ZXVlLmRlbGV0ZShlKSl9LCExKSxzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLCh7ZGF0YTp7aWQsbWV0aG9kLGFyZ3MsY2F0ZWdvcnksc2Vzc2lvbixzb3VyY2VVUkx9fSk9PntpZihjYXRlZ29yeSE9PSJldmFsIilyZXR1cm47c2Vzc2lvbiYmIVV0aWwubU1ldGhvZFdvcmtzcGFjZS5oYXMoc2Vzc2lvbikmJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5zZXQoc2Vzc2lvbix7fSk7Y29uc3QgZXZhbERhdGFTb3VyY2VVUkw9c291cmNlVVJMP2AKLy8jIHNvdXJjZVVSTD1mZjovLy8uLyR7c291cmNlVVJMfWA6IiIsZXZhbERhdGE9ZXZhbChgKGFzeW5jIGZ1bmN0aW9uKHske09iamVjdC5rZXlzKGFyZ3MpLmpvaW4oIiwgIil9fSwgVXRpbCl7JHttZXRob2R9Cn0pJHtldmFsRGF0YVNvdXJjZVVSTH1gKS5jYWxsKHNlc3Npb24/VXRpbC5tTWV0aG9kV29ya3NwYWNlLmdldChzZXNzaW9uKTp7fSxhcmdzLFV0aWwoaWQsc2Vzc2lvbikpO3JldHVybiBQcm9taXNlLnJlc29sdmUoZXZhbERhdGEpLnRoZW4oZT0+e3NlbGYucG9zdE1lc3NhZ2Uoe2lkLHNlc3Npb24sY2F0ZWdvcnksZGF0YTplLGVycm9yOm51bGx9KX0pLmNhdGNoKGU9PntzZWxmLnBvc3RNZXNzYWdlKHtpZCxzZXNzaW9uLGNhdGVnb3J5LGRhdGE6bnVsbCxlcnJvcjplIGluc3RhbmNlb2YgRE9NRXhjZXB0aW9uJiZlLm5hbWU9PT0iRGF0YUNsb25lRXJyb3IiPyJEYXRhQ2xvbmVFcnJvciDov5Tlm57nu5Pmnpzlj6rog73kuLrnroDljZXmlbDmja7moLzlvI8iOmV9KX0pfSksc2VsZi5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIiwoe2RhdGE6e2NhdGVnb3J5OmUsc2Vzc2lvbjpzfX0pPT57ZT09PSJjbGVhciImJlV0aWwubU1ldGhvZFdvcmtzcGFjZS5kZWxldGUocyl9LCExKX0pKCk7Cg==", self.location)), zt = { + getConfigure: (e) => we.get(e), + route: { + redirect: (...e) => ke.redirect(...e), + getPageParams: (...e) => ke.getPageParams(...e), + getCurrentRoute: () => ke.getCurrentRoute() + }, + modal: { + notification: (...e) => L.notification(...e), + success: (...e) => L.success(...e), + error: (...e) => L.error(...e), + form: (...e) => L.form(...e) + }, + popup: { + notification: (...e) => L.notification(...e), + success: (...e) => L.success(...e), + error: (...e) => L.error(...e), + form: (...e) => L.form(...e) + } +}; +var ot, Ue, Ce; +const W = class W { + constructor() { + V(this, "exec", (t, n = {}, s = {}, r = "") => new Promise((o, i) => { + const a = Xe(W, ot)._++; + u(W, Ue).set(a, s), W.mQueue.set(a, [o, i]), Te.postMessage({ id: a, session: r, category: "eval", method: t, args: n }); + })); + V(this, "clear", (t) => Te.postMessage({ session: t, category: "clear" })); + if (u(W, Ce)) + return u(W, Ce); + Promise.resolve().then(() => zs).then((t) => { + zt.http = t.http; + }), Te.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, Ue).delete(t), W.mQueue.delete(t); + else if (o === "util") + try { + const c = f.get(zt, s.split("/")) || f.get(u(W, Ue).get(n), s.split("/")); + if (!f.isFunction(c)) + throw `${s} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((p) => { + Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: p, error: null }); + }).catch((p) => { + Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: p }); + }); + } catch (c) { + Te.postMessage({ id: t, task_id: n, category: o, method: s, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +ot = new WeakMap(), Ue = new WeakMap(), Ce = new WeakMap(), V(W, "mQueue", /* @__PURE__ */ new Map()), R(W, ot, 0), R(W, Ue, /* @__PURE__ */ new Map()), R(W, Ce, null), V(W, "getInstance", () => (u(W, Ce) || x(W, Ce, new W()), u(W, Ce))); +let mt = W; +const Fe = mt.getInstance(); +var Re, A; +const re = class re { + constructor() { + R(this, A, /* @__PURE__ */ new Map()); + V(this, "setVendor", (t, n) => u(this, A).set(t, new un(n, (s, r) => s.dynamicRequireFsdpfComponent(r)))); + V(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/"), [, o] = t == null ? void 0 : t.split("@fsdpf/"); + try { + switch (!0) { + case (!!n && u(this, A).has("pkg")): + return await u(this, A).get("pkg").get(n); + case (!!s && u(this, A).has("pkg")): + return await u(this, A).get("pkg").get(s); + case (!!r && u(this, A).has("pkg")): + return await u(this, A).get("pkg").get(r); + case (!!o && u(this, A).has("pkg")): + return await u(this, A).get("pkg").get(o); + } + } catch (i) { + throw i; + } + }); + if (u(re, Re)) + return u(re, Re); + } +}; +Re = new WeakMap(), A = new WeakMap(), R(re, Re, null), V(re, "getInstance", () => (u(re, Re) || x(re, Re, new re()), u(re, Re))); +let yt = re; +const J = yt.getInstance(), Ot = { + 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(Ot, s) ? Ot[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 Nt = ""; +const I = { + init: (e, t, n) => { + He.defaults.baseURL = Nt = n, He.defaults.timeout = 15e3, Object.assign(I, new bt(e, t, He)); + } +}, It = (e) => { + var t; + return e && (e == null ? void 0 : e.name) && ((e == null ? void 0 : e.prototype) instanceof v.Component || (e == null ? void 0 : e.name.substr(0, 1)) === ((t = e.name.substr(0, 1)) == null ? void 0 : t.toUpperCase())); +}, zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + AppGlobalParamsContext: ln, + get AppUrl() { + return Nt; + }, + cache: un, + configure: we, + core: J, + default: Gs, + func: Fe, + http: I, + isReactComponent: It, + route: ke +}, Symbol.toStringTag, { value: "Module" })), lr = () => I.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)), ur = () => I.get("/api/my-menu"), dr = () => I.get("api/init-configure"), fr = () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((t, { uuid: n, auth: s }) => [...t, [n, s]], [])), pr = (e) => I.get(`/api/user-wx-phone-number/${e}`); +export { + we as $, + Gt as A, + C as B, + Rs as C, + en as D, + ks as E, + Y as F, + rr as G, + cs as H, + Ct as I, + Mt as J, + cn as K, + es as L, + Es as M, + vt as N, + Lt as O, + Zs as P, + ar as Q, + jt as R, + je as S, + cr as T, + Ts as U, + Nt as V, + I as W, + It as X, + Gs as Y, + ln as Z, + un as _, + tr as a, + Fe as a0, + J as a1, + ke as a2, + lr as a3, + ur as a4, + dr as a5, + fr as a6, + pr as a7, + Zt as b, + Jn as c, + at as d, + nr as e, + sr as f, + er as g, + Jt as h, + L as i, + rn as j, + Yt as k, + ms as l, + tn as m, + nn as n, + kt as o, + sn as p, + Rt as q, + Ze as r, + on as s, + an as t, + Xt as u, + ls as v, + fs as w, + ps as x, + or as y, + ir as z +}; diff --git a/dist/components.js b/dist/components.js index dd8baf8..fbf7701 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,5 +1,5 @@ -import { N as r, i as s } from "./common/main-CfQRKHVj.js"; +import { N as a, i as r } from "./common/main-D7BIypEq.js"; export { - r as Icon, - s as Modal + a as Icon, + r as Popup }; diff --git a/dist/container.js b/dist/container.js index 28321d3..3a7c862 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,8 +1,8 @@ -import { S as d, i as o, h as r, g as s, F as t } from "./common/main-CfQRKHVj.js"; +import { S as o, h as r, i as s, g as t, F } from "./common/main-D7BIypEq.js"; export { - d as Context, - o as FFModalRender, + o as Context, r as FFPageRender, - s as SlotRender, - t as default + s as FFPopupRender, + t as SlotRender, + F as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 0484578..8235861 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { t as s, r as e, m as r, p as o, v as i, q as D, o as l, s as u, n as L, v as n, D as d, w as m, x as F, z as p, A as C, y as b } from "./common/main-CfQRKHVj.js"; +import { t as s, r as e, m as r, p as o, v as i, q as D, o as l, s as u, n as L, v as n, D as d, w as m, x as F, z as p, A as C, y as b } from "./common/main-D7BIypEq.js"; export { s as DataListContent, e as DataListContext, diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 9e6af8a..f61cba8 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { I as o, K as r, J as t, H as s, M as u, L as d } from "./common/main-CfQRKHVj.js"; +import { I as o, K as r, J as t, H as s, M as u, L as d } from "./common/main-D7BIypEq.js"; export { o as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 692427c..95f0db0 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { k as d, l as o, G as r } from "./common/main-CfQRKHVj.js"; +import { k as d, l as o, G as r } from "./common/main-D7BIypEq.js"; export { d as GridLayout, o as GridLayoutWidget, diff --git a/dist/hooks.js b/dist/hooks.js index 393d409..a38f9f2 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,7 +2,7 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-dom"; -import { d as p, e as r, b as i, a as m, c as b, f as c, u as f } from "./common/main-CfQRKHVj.js"; +import { d as p, e as r, b as i, a as m, c as b, f as c, u as f } from "./common/main-D7BIypEq.js"; export { p as useDeepEqualEffect, r as useOptions, diff --git a/dist/index.js b/dist/index.js index c81b9a8..dbaed1d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ import "lodash"; import "axios"; import "react"; -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-CfQRKHVj.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-D7BIypEq.js"; import "ff-request"; export { e as AppGlobalParamsContext, diff --git a/dist/res-ws.js b/dist/res-ws.js index a7985d8..7e285a1 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-CfQRKHVj.js"; +import { R as a } from "./common/main-D7BIypEq.js"; export { a as default }; diff --git a/dist/service.js b/dist/service.js index 47328cc..e57c218 100644 --- a/dist/service.js +++ b/dist/service.js @@ -1,4 +1,4 @@ -import { a5 as t, a4 as g, a7 as s, a3 as o, a6 as r } from "./common/main-CfQRKHVj.js"; +import { a5 as t, a4 as g, a7 as s, a3 as o, a6 as r } from "./common/main-D7BIypEq.js"; export { t as getConfigure, g as getMenus, diff --git a/dist/style.css b/dist/style.css index 7507fbd..e031e4e 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -.ff-container{padding:var(--ff-padding, 0px);background-color:var(--ff-bg-color, #fff)}.ff-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-drawer .ant-drawer-body{padding:8px}.ff-drawer .ant-dialog-footer{padding:0 8px;height:46px;align-items:center;display:flex}.ff-drawer .ant-dialog-footer .ff-dialog-extras,.ff-drawer .ant-dialog-footer .ff-dialog-actions{display:flex;gap:4px}.ff-drawer .ant-dialog-footer .ff-dialog-extras{flex:1}.ff-modal>div:not([aria-hidden]){height:inherit}.ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}.ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}.ff-modal .ff-dialog-footer{height:46px;align-items:center;display:flex}.ff-modal .ff-dialog-footer .ff-dialog-extras,.ff-modal .ff-dialog-footer .ff-dialog-actions{display:flex;gap:4px}.ff-modal .ff-dialog-footer .ff-dialog-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-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}.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}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-notification .ff-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-notification .ff-notification-container .iconfont.ff-notification-icon{font-size:62rpx}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon+view{margin-top:20rpx}page-container .ff-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-confirm .ff-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-confirm .ff-confirm-container .ff-confirm-title{font-size:36rpx;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations{display:flex;gap:38rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok,page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-modal>div:not([aria-hidden]){height:inherit}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}page-container .ff-modal .ff-dialog-footer{height:46px;align-items:center;display:flex}page-container .ff-modal .ff-dialog-footer .ff-dialog-extras,page-container .ff-modal .ff-dialog-footer .ff-dialog-actions{display:flex;gap:4px}page-container .ff-modal .ff-dialog-footer .ff-dialog-extras{flex: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)}.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} +.ff-container{height:100%;padding:var(--ff-padding, 0px);background-color:var(--ff-bg-color, #fff)}.ff-drawer .ant-drawer-header{padding:0 8px 0 0}.ff-drawer .ant-drawer-header .ant-drawer-title{height:50px;line-height:50px}.ff-drawer .ant-drawer-header .ant-drawer-close{margin-inline-end:0}.ff-drawer .ant-drawer-body{padding:8px}.ff-drawer .ant-popup-footer{padding:0 8px;height:46px;align-items:center;display:flex}.ff-drawer .ant-popup-footer .ff-popup-extras,.ff-drawer .ant-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-drawer .ant-popup-footer .ff-popup-extras{flex:1}.ff-modal>div:not([aria-hidden]){height:inherit}.ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}.ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}.ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}.ff-modal .ff-popup-footer .ff-popup-extras,.ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}.ff-modal .ff-popup-footer .ff-popup-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-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}.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-popover .ff-popup-footer{display:flex;justify-content:space-between;margin-top:var(--margin-xs)}page-container{--bg-color: #fff;--mask-bg-color: rgba(0, 0, 0, .6)}page-container .ff-notification{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center}page-container .ff-notification .ff-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-notification .ff-notification-container .iconfont.ff-notification-icon{font-size:62rpx}page-container .ff-notification .ff-notification-container .iconfont.ff-notification-icon+view{margin-top:20rpx}page-container .ff-confirm{display:flex;align-items:center;justify-content:center;color:var(--text-color, #737373);background-color:#0006}page-container .ff-confirm .ff-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-confirm .ff-confirm-container .ff-confirm-title{font-size:36rpx;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-content{flex:1;overflow-y:auto;min-height:1.8em;max-height:70vh}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations{display:flex;gap:38rpx}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok,page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{flex:1;border-radius:32rpx;padding:10rpx 0;text-align:center}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-cancel{box-shadow:0 0 3rpx var(--text-color, #737373);border:1rpx solid var(--text-color, #737373)}page-container .ff-confirm .ff-confirm-container .ff-confirm-operations .ff-confirm-ok{color:#fff;background-color:var(--primary-color, #1890ff)}page-container .ff-modal>div:not([aria-hidden]){height:inherit}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content{height:inherit;display:flex;flex-direction:column}page-container .ff-modal>div:not([aria-hidden])>.ant-modal-content>.ant-modal-body{flex:1;overflow-y:overlay}page-container .ff-modal .ff-popup-footer{height:46px;align-items:center;display:flex}page-container .ff-modal .ff-popup-footer .ff-popup-extras,page-container .ff-modal .ff-popup-footer .ff-popup-actions{display:flex;gap:4px}page-container .ff-modal .ff-popup-footer .ff-popup-extras{flex: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)}.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 79ae0c4..a03e019 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 { P as p, Q as a, O as g, T as n, U } from "./common/main-CfQRKHVj.js"; +import { P as p, Q as a, O as g, T as n, U } from "./common/main-D7BIypEq.js"; export { p as checkUserToken, a as getUserInfo, diff --git a/dist/utils.js b/dist/utils.js index 9d08546..e87cad5 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { j as a } from "./common/main-CfQRKHVj.js"; +import { j as a } from "./common/main-D7BIypEq.js"; export { a as getDefaultExpandRowKeys }; diff --git a/package.json b/package.json index 16b5fd4..dc0da29 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.1.11", + "version": "0.1.12", "type": "module", "files": [ "dist/"