@vef-framework-react/integration 2.10.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/code-set-api.cjs +1 -0
- package/dist/cjs/api/crud-api.cjs +1 -1
- package/dist/cjs/api/index.cjs +1 -1
- package/dist/cjs/api/ops-api.cjs +1 -1
- package/dist/cjs/components/script-doc/completions.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/pages/code-map-page/columns.cjs +1 -0
- package/dist/cjs/pages/code-map-page/entries-editor.cjs +1 -0
- package/dist/cjs/pages/code-map-page/form.cjs +1 -0
- package/dist/cjs/pages/code-map-page/helpers.cjs +1 -0
- package/dist/cjs/pages/code-map-page/index.cjs +1 -0
- package/dist/cjs/pages/code-map-page/model.cjs +1 -0
- package/dist/cjs/pages/code-map-page/search.cjs +1 -0
- package/dist/cjs/pages/index.cjs +1 -1
- package/dist/cjs/permissions.cjs +1 -1
- package/dist/cjs/types/enums.cjs +1 -1
- package/dist/cjs/types/index.cjs +1 -1
- package/dist/es/api/code-set-api.js +14 -0
- package/dist/es/api/crud-api.js +17 -7
- package/dist/es/api/index.js +7 -6
- package/dist/es/api/log-api.js +1 -1
- package/dist/es/api/ops-api.js +9 -3
- package/dist/es/api/query.js +1 -1
- package/dist/es/api/stats-api.js +1 -1
- package/dist/es/components/auth-params/index.js +1 -1
- package/dist/es/components/directory/index.js +1 -1
- package/dist/es/components/form-section/index.js +1 -1
- package/dist/es/components/format.js +1 -1
- package/dist/es/components/index.js +1 -1
- package/dist/es/components/json-view/index.js +1 -1
- package/dist/es/components/params-editor/index.js +1 -1
- package/dist/es/components/script-doc/completions.js +57 -30
- package/dist/es/components/script-doc/index.js +1 -1
- package/dist/es/components/status/colors.js +1 -1
- package/dist/es/components/status/index.js +1 -1
- package/dist/es/components/status/labels.js +1 -1
- package/dist/es/components/test-connection/index.js +1 -1
- package/dist/es/components/wire-trace/index.js +1 -1
- package/dist/es/index.js +28 -26
- package/dist/es/pages/adapter-page/columns.js +1 -1
- package/dist/es/pages/adapter-page/form.js +1 -1
- package/dist/es/pages/adapter-page/helpers.js +1 -1
- package/dist/es/pages/adapter-page/index.js +1 -1
- package/dist/es/pages/adapter-page/search.js +1 -1
- package/dist/es/pages/code-map-page/columns.js +63 -0
- package/dist/es/pages/code-map-page/entries-editor.js +92 -0
- package/dist/es/pages/code-map-page/form.js +192 -0
- package/dist/es/pages/code-map-page/helpers.js +17 -0
- package/dist/es/pages/code-map-page/index.js +117 -0
- package/dist/es/pages/code-map-page/model.js +91 -0
- package/dist/es/pages/code-map-page/search.js +38 -0
- package/dist/es/pages/console-page/diagnostics.js +1 -1
- package/dist/es/pages/console-page/dry-run.js +1 -1
- package/dist/es/pages/console-page/index.js +1 -1
- package/dist/es/pages/console-page/log.js +1 -1
- package/dist/es/pages/console-page/stats.js +1 -1
- package/dist/es/pages/contract-page/columns.js +1 -1
- package/dist/es/pages/contract-page/form.js +1 -1
- package/dist/es/pages/contract-page/helpers.js +1 -1
- package/dist/es/pages/contract-page/index.js +1 -1
- package/dist/es/pages/contract-page/json-schema-completions.js +1 -1
- package/dist/es/pages/contract-page/model.js +1 -1
- package/dist/es/pages/contract-page/search.js +1 -1
- package/dist/es/pages/index.js +7 -6
- package/dist/es/pages/route-page/columns.js +1 -1
- package/dist/es/pages/route-page/form.js +1 -1
- package/dist/es/pages/route-page/helpers.js +1 -1
- package/dist/es/pages/route-page/index.js +1 -1
- package/dist/es/pages/route-page/search.js +1 -1
- package/dist/es/pages/system-page/columns.js +1 -1
- package/dist/es/pages/system-page/form.js +1 -1
- package/dist/es/pages/system-page/helpers.js +1 -1
- package/dist/es/pages/system-page/index.js +1 -1
- package/dist/es/pages/system-page/model.js +1 -1
- package/dist/es/pages/system-page/search.js +1 -1
- package/dist/es/permissions.js +7 -1
- package/dist/es/types/enums.js +7 -3
- package/dist/es/types/index.js +3 -3
- package/dist/types/api/code-set-api.d.ts +17 -0
- package/dist/types/api/crud-api.d.ts +9 -3
- package/dist/types/api/index.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/pages/code-map-page/columns.d.ts +4 -0
- package/dist/types/pages/code-map-page/entries-editor.d.ts +6 -0
- package/dist/types/pages/code-map-page/form.d.ts +8 -0
- package/dist/types/pages/code-map-page/index.d.ts +6 -0
- package/dist/types/pages/code-map-page/model.d.ts +63 -0
- package/dist/types/pages/code-map-page/props.d.ts +16 -0
- package/dist/types/pages/code-map-page/search.d.ts +4 -0
- package/dist/types/pages/index.d.ts +2 -0
- package/dist/types/pages/system-page/model.d.ts +2 -2
- package/dist/types/permissions.d.ts +7 -0
- package/dist/types/types/code-map.d.ts +57 -0
- package/dist/types/types/code-set.d.ts +29 -0
- package/dist/types/types/enums.d.ts +8 -0
- package/dist/types/types/index.d.ts +2 -0
- package/package.json +4 -4
package/dist/es/index.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { API_PATH as e, splitQueryParams as t } from "./api/query.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
3
|
+
import { useCodeSetApi as n } from "./api/code-set-api.js";
|
|
4
|
+
import { createCrudApi as r, useAdapterApi as i, useCodeMapApi as a, useContractApi as o, useRouteApi as s, useSystemApi as c } from "./api/crud-api.js";
|
|
5
|
+
import { useLogApi as l } from "./api/log-api.js";
|
|
6
|
+
import { useOpsApi as u } from "./api/ops-api.js";
|
|
7
|
+
import { useStatsApi as d } from "./api/stats-api.js";
|
|
8
|
+
import { ParamsEditor as f } from "./components/params-editor/index.js";
|
|
9
|
+
import { AuthParamsFields as p, pruneAuthParams as m, resolveAuthParamsSpec as h } from "./components/auth-params/index.js";
|
|
10
|
+
import { useContractDirectory as g, useSystemDirectory as _ } from "./components/directory/index.js";
|
|
11
|
+
import { FormSection as v } from "./components/form-section/index.js";
|
|
12
|
+
import { formatTimestamp as y } from "./components/format.js";
|
|
13
|
+
import { JsonView as b } from "./components/json-view/index.js";
|
|
14
|
+
import { ScriptDocLabel as x } from "./components/script-doc/index.js";
|
|
15
|
+
import { ENVELOPE_REQUEST_SCRIPT_DOC as S, ENVELOPE_RESPONSE_SCRIPT_DOC as C, INBOUND_AUTH_SCRIPT_DOC as w, OUTBOUND_AUTH_SCRIPT_DOC as T, adapterScriptDoc as E } from "./components/script-doc/completions.js";
|
|
16
|
+
import { DIRECTION_COLORS as D, FAILURE_KIND_COLORS as O, ROUTE_FINDING_SEVERITY as k } from "./components/status/colors.js";
|
|
17
|
+
import { DATA_SOURCE_MODES as A, DIRECTIONS as j, FAILURE_KINDS as M, INBOUND_AUTH_SCHEMES as N, MASKED_SECRET as P, OUTBOUND_AUTH_SCHEMES as F, ROUTE_FINDING_KINDS as I, UNMAPPED_POLICIES as L } from "./types/enums.js";
|
|
18
|
+
import { DIRECTION_LABELS as R, DIRECTION_OPTIONS as z, FAILURE_KIND_LABELS as B, INBOUND_AUTH_SCHEME_LABELS as V, OUTBOUND_AUTH_SCHEME_LABELS as H, ROUTE_FINDING_KIND_LABELS as U } from "./components/status/labels.js";
|
|
19
|
+
import { DirectionTag as W, EnabledTag as G, FailureKindTag as K, FindingKindTag as q } from "./components/status/index.js";
|
|
20
|
+
import { TestConnectionDrawer as J } from "./components/test-connection/index.js";
|
|
21
|
+
import { WireTraceTimeline as Y } from "./components/wire-trace/index.js";
|
|
22
|
+
import { INTEGRATION_PERMISSIONS as X } from "./permissions.js";
|
|
23
|
+
import { IntegrationAdapterPage as Z } from "./pages/adapter-page/index.js";
|
|
24
|
+
import { IntegrationCodeMapPage as Q } from "./pages/code-map-page/index.js";
|
|
25
|
+
import { IntegrationConsolePage as $ } from "./pages/console-page/index.js";
|
|
26
|
+
import { IntegrationContractPage as ee } from "./pages/contract-page/index.js";
|
|
27
|
+
import { IntegrationRoutePage as te } from "./pages/route-page/index.js";
|
|
28
|
+
import { IntegrationSystemPage as ne } from "./pages/system-page/index.js";
|
|
29
|
+
export { e as API_PATH, p as AuthParamsFields, A as DATA_SOURCE_MODES, j as DIRECTIONS, D as DIRECTION_COLORS, R as DIRECTION_LABELS, z as DIRECTION_OPTIONS, W as DirectionTag, S as ENVELOPE_REQUEST_SCRIPT_DOC, C as ENVELOPE_RESPONSE_SCRIPT_DOC, G as EnabledTag, M as FAILURE_KINDS, O as FAILURE_KIND_COLORS, B as FAILURE_KIND_LABELS, K as FailureKindTag, q as FindingKindTag, v as FormSection, N as INBOUND_AUTH_SCHEMES, V as INBOUND_AUTH_SCHEME_LABELS, w as INBOUND_AUTH_SCRIPT_DOC, X as INTEGRATION_PERMISSIONS, Z as IntegrationAdapterPage, Q as IntegrationCodeMapPage, $ as IntegrationConsolePage, ee as IntegrationContractPage, te as IntegrationRoutePage, ne as IntegrationSystemPage, b as JsonView, P as MASKED_SECRET, F as OUTBOUND_AUTH_SCHEMES, H as OUTBOUND_AUTH_SCHEME_LABELS, T as OUTBOUND_AUTH_SCRIPT_DOC, f as ParamsEditor, I as ROUTE_FINDING_KINDS, U as ROUTE_FINDING_KIND_LABELS, k as ROUTE_FINDING_SEVERITY, x as ScriptDocLabel, J as TestConnectionDrawer, L as UNMAPPED_POLICIES, Y as WireTraceTimeline, E as adapterScriptDoc, r as createCrudApi, y as formatTimestamp, m as pruneAuthParams, h as resolveAuthParamsSpec, t as splitQueryParams, i as useAdapterApi, a as useCodeMapApi, n as useCodeSetApi, o as useContractApi, g as useContractDirectory, l as useLogApi, u as useOpsApi, s as useRouteApi, d as useStatsApi, c as useSystemApi, _ as useSystemDirectory };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { DirectionTag as e, EnabledTag as t } from "../../components/status/index.js";
|
|
3
3
|
import { Text as n, globalCssVars as r } from "@vef-framework-react/components";
|
|
4
4
|
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { useContractDirectory as e, useSystemDirectory as t } from "../../components/directory/index.js";
|
|
3
3
|
import { ScriptDocLabel as n } from "../../components/script-doc/index.js";
|
|
4
4
|
import { adapterScriptDoc as r } from "../../components/script-doc/completions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { createCrudKit as e } from "@vef-framework-react/components";
|
|
3
3
|
//#region src/pages/adapter-page/helpers.ts
|
|
4
4
|
var { OperationButtonGroup: t, ActionButtonGroup: n } = e();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { useAdapterApi as e } from "../../api/crud-api.js";
|
|
3
3
|
import { useContractDirectory as t, useSystemDirectory as n } from "../../components/directory/index.js";
|
|
4
4
|
import { INTEGRATION_PERMISSIONS as r } from "../../permissions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
2
|
import { useContractDirectory as e, useSystemDirectory as t } from "../../components/directory/index.js";
|
|
3
3
|
import { DIRECTION_OPTIONS as n } from "../../components/status/labels.js";
|
|
4
4
|
import { useFormContext as r } from "@vef-framework-react/components";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
|
+
import { formatTimestamp as e } from "../../components/format.js";
|
|
3
|
+
import { EnabledTag as t } from "../../components/status/index.js";
|
|
4
|
+
import { UNMAPPED_POLICY_LABELS as n } from "./model.js";
|
|
5
|
+
import { Tag as r, Text as i } from "@vef-framework-react/components";
|
|
6
|
+
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/pages/code-map-page/columns.tsx
|
|
8
|
+
var o = {
|
|
9
|
+
reject: "red",
|
|
10
|
+
passthrough: "blue",
|
|
11
|
+
fallback: "orange"
|
|
12
|
+
};
|
|
13
|
+
function s(s) {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
title: "码集",
|
|
17
|
+
dataIndex: "codeSet",
|
|
18
|
+
width: 180,
|
|
19
|
+
render: (e) => /* @__PURE__ */ a(i, { children: e })
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: "名称",
|
|
23
|
+
dataIndex: "name"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: "所属系统",
|
|
27
|
+
dataIndex: "systemId",
|
|
28
|
+
render: (e) => /* @__PURE__ */ a(i, { children: s.byId.get(e)?.name ?? e })
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: "条目数",
|
|
32
|
+
dataIndex: "entries",
|
|
33
|
+
width: 90,
|
|
34
|
+
align: "center",
|
|
35
|
+
render: (e) => /* @__PURE__ */ a(i, { children: e?.length ?? 0 })
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "未收录策略",
|
|
39
|
+
dataIndex: "onUnmapped",
|
|
40
|
+
width: 120,
|
|
41
|
+
align: "center",
|
|
42
|
+
render: (e) => /* @__PURE__ */ a(r, {
|
|
43
|
+
color: o[e] ?? "red",
|
|
44
|
+
children: n[e] ?? e
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "状态",
|
|
49
|
+
dataIndex: "isEnabled",
|
|
50
|
+
width: 90,
|
|
51
|
+
align: "center",
|
|
52
|
+
render: (e) => /* @__PURE__ */ a(t, { enabled: e })
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: "创建时间",
|
|
56
|
+
dataIndex: "createdAt",
|
|
57
|
+
width: 160,
|
|
58
|
+
render: e
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { s as buildCodeMapColumns };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
|
+
import { formatCodeValue as e, parseCodeValue as t } from "./model.js";
|
|
3
|
+
import { useMemo as n, useRef as r, useState as i } from "react";
|
|
4
|
+
import { EditableTable as a, createEditableColumn as o } from "@vef-framework-react/components";
|
|
5
|
+
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/pages/code-map-page/entries-editor.tsx
|
|
7
|
+
function c(t) {
|
|
8
|
+
return t.map((t, n) => ({
|
|
9
|
+
id: `row-${n}`,
|
|
10
|
+
canonical: e(t.canonical),
|
|
11
|
+
canonicalAliases: (t.canonicalAliases ?? []).map((t) => e(t)),
|
|
12
|
+
external: e(t.external),
|
|
13
|
+
externalAliases: (t.externalAliases ?? []).map((t) => e(t))
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
function l(e) {
|
|
17
|
+
let n = [];
|
|
18
|
+
for (let r of e) {
|
|
19
|
+
if (!r.canonical && !r.external && r.canonicalAliases.length === 0 && r.externalAliases.length === 0) continue;
|
|
20
|
+
let e = {
|
|
21
|
+
canonical: t(r.canonical),
|
|
22
|
+
external: t(r.external)
|
|
23
|
+
};
|
|
24
|
+
r.canonicalAliases.length > 0 && (e.canonicalAliases = r.canonicalAliases.map((e) => t(e))), r.externalAliases.length > 0 && (e.externalAliases = r.externalAliases.map((e) => t(e))), n.push(e);
|
|
25
|
+
}
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
var u = [];
|
|
29
|
+
function d(e, t) {
|
|
30
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
31
|
+
}
|
|
32
|
+
function f({ value: e, onChange: t }) {
|
|
33
|
+
let [f, p] = i(() => c(e ?? [])), m = r(0), h = r(e ?? u), g = n(() => [
|
|
34
|
+
o("canonical", {
|
|
35
|
+
title: "标准值",
|
|
36
|
+
width: 120,
|
|
37
|
+
renderEditor: (e) => /* @__PURE__ */ s(e.Input, {
|
|
38
|
+
noWrapper: !0,
|
|
39
|
+
placeholder: "如 1"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
o("canonicalAliases", {
|
|
43
|
+
title: "标准别名",
|
|
44
|
+
renderEditor: (e) => /* @__PURE__ */ s(e.Select, {
|
|
45
|
+
noWrapper: !0,
|
|
46
|
+
mode: "tags",
|
|
47
|
+
open: !1,
|
|
48
|
+
placeholder: "回车添加,仅参与匹配",
|
|
49
|
+
style: { width: "100%" }
|
|
50
|
+
})
|
|
51
|
+
}),
|
|
52
|
+
o("external", {
|
|
53
|
+
title: "外部值",
|
|
54
|
+
width: 120,
|
|
55
|
+
renderEditor: (e) => /* @__PURE__ */ s(e.Input, {
|
|
56
|
+
noWrapper: !0,
|
|
57
|
+
placeholder: "如 M"
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
o("externalAliases", {
|
|
61
|
+
title: "外部别名",
|
|
62
|
+
renderEditor: (e) => /* @__PURE__ */ s(e.Select, {
|
|
63
|
+
noWrapper: !0,
|
|
64
|
+
mode: "tags",
|
|
65
|
+
open: !1,
|
|
66
|
+
placeholder: "回车添加,仅参与匹配",
|
|
67
|
+
style: { width: "100%" }
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
], []), _ = e ?? u;
|
|
71
|
+
return _ !== h.current && !d(_, l(f)) && (h.current = _, p(c(_))), /* @__PURE__ */ s(a, {
|
|
72
|
+
canDelete: !0,
|
|
73
|
+
creatable: !0,
|
|
74
|
+
columns: g,
|
|
75
|
+
locale: { emptyText: "暂无映射条目" },
|
|
76
|
+
rowKey: "id",
|
|
77
|
+
size: "small",
|
|
78
|
+
value: f,
|
|
79
|
+
createRecord: () => ({
|
|
80
|
+
id: `new-${m.current++}`,
|
|
81
|
+
canonical: "",
|
|
82
|
+
canonicalAliases: [],
|
|
83
|
+
external: "",
|
|
84
|
+
externalAliases: []
|
|
85
|
+
}),
|
|
86
|
+
onChange: (e) => {
|
|
87
|
+
p(e), t?.(l(e));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { f as CodeMapEntriesEditor };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
|
+
import { useCodeSetApi as e } from "../../api/code-set-api.js";
|
|
3
|
+
import { useSystemDirectory as t } from "../../components/directory/index.js";
|
|
4
|
+
import { CODE_SET_PATTERN as n, validateCodeMapEntries as r } from "./model.js";
|
|
5
|
+
import { CodeMapEntriesEditor as i } from "./entries-editor.js";
|
|
6
|
+
import { useQuery as a } from "@vef-framework-react/core";
|
|
7
|
+
import { useMemo as o } from "react";
|
|
8
|
+
import { Grid as s, Labeled as c, Text as l, useFormContext as u } from "@vef-framework-react/components";
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { z as m } from "@vef-framework-react/shared";
|
|
11
|
+
//#region src/pages/code-map-page/form.tsx
|
|
12
|
+
var h = m.string("请选择所属系统").min(1, "请选择所属系统"), g = m.string("请输入码集标识").min(1, "请输入码集标识").max(128, "最多 128 个字符").regex(n, "以字母或数字开头结尾,中间可含 _ . -"), _ = m.string("请输入码表名称").min(1, "请输入码表名称").max(128, "最多 128 个字符");
|
|
13
|
+
function v({ value: e }) {
|
|
14
|
+
let t = r(e);
|
|
15
|
+
return t.length > 0 ? t.join(";") : void 0;
|
|
16
|
+
}
|
|
17
|
+
function y({ value: e }) {
|
|
18
|
+
return e.trim() ? void 0 : "兜底策略需要填写该值";
|
|
19
|
+
}
|
|
20
|
+
var b = [
|
|
21
|
+
{
|
|
22
|
+
label: "未收录报错(默认,缺映射即失败)",
|
|
23
|
+
value: "reject"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "透传原值",
|
|
27
|
+
value: "passthrough"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "返回兜底值",
|
|
31
|
+
value: "fallback"
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
function x({ codeSet: t, supported: n }) {
|
|
35
|
+
let r = e(), i = n && t.length > 0, { data: o } = a({
|
|
36
|
+
enabled: i,
|
|
37
|
+
queryFn: r.listCodes,
|
|
38
|
+
queryKey: [r.listCodes.key, { codeSet: t }]
|
|
39
|
+
});
|
|
40
|
+
return !i || !o?.supported || !o.codes?.length ? null : /* @__PURE__ */ p(l, {
|
|
41
|
+
type: "secondary",
|
|
42
|
+
children: ["标准值参考:", o.codes.map((e) => `${e.code} = ${e.label}`).join(",")]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function S({ scene: n }) {
|
|
46
|
+
let r = u(), { AppField: m } = r, S = t(), C = e(), { data: w, isError: T, isLoading: E } = a({
|
|
47
|
+
queryFn: C.listCodeSets,
|
|
48
|
+
queryKey: [C.listCodeSets.key, {}]
|
|
49
|
+
}), D = n === "create", O = w?.supported === !0, k = o(() => (w?.codeSets ?? []).map((e) => ({
|
|
50
|
+
label: `${e.name}(${e.codeSet})`,
|
|
51
|
+
value: e.codeSet
|
|
52
|
+
})), [w]);
|
|
53
|
+
return /* @__PURE__ */ p(s, {
|
|
54
|
+
columnGap: "small",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ f(s.Item, {
|
|
57
|
+
span: 24,
|
|
58
|
+
children: /* @__PURE__ */ f(m, {
|
|
59
|
+
name: "systemId",
|
|
60
|
+
validators: { onChange: h },
|
|
61
|
+
children: (e) => /* @__PURE__ */ f(e.Select, {
|
|
62
|
+
required: !0,
|
|
63
|
+
disabled: !D,
|
|
64
|
+
label: "所属系统",
|
|
65
|
+
loading: S.loading,
|
|
66
|
+
options: S.options,
|
|
67
|
+
placeholder: "选择外部系统"
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ f(s.Item, {
|
|
72
|
+
span: 12,
|
|
73
|
+
children: /* @__PURE__ */ f(m, {
|
|
74
|
+
name: "codeSet",
|
|
75
|
+
validators: { onChange: g },
|
|
76
|
+
children: (e) => !D || w?.supported === !1 ? /* @__PURE__ */ f(e.Input, {
|
|
77
|
+
required: !0,
|
|
78
|
+
disabled: !D,
|
|
79
|
+
extra: "适配器脚本以 codes.toExternal('<码集>', …) 引用",
|
|
80
|
+
label: "码集标识",
|
|
81
|
+
placeholder: "如 gender"
|
|
82
|
+
}) : /* @__PURE__ */ f(e.Select, {
|
|
83
|
+
required: !0,
|
|
84
|
+
disabled: E || T,
|
|
85
|
+
label: "标准码集",
|
|
86
|
+
loading: E,
|
|
87
|
+
options: k,
|
|
88
|
+
status: T ? "error" : void 0,
|
|
89
|
+
extra: T ? "标准码集加载失败,请稍后重试" : "从本系统已注册的标准码集中选择,自动填充码表名称",
|
|
90
|
+
placeholder: E ? "正在加载标准码集…" : T ? "标准码集加载失败" : k.length === 0 ? "暂无可用标准码集" : "选择标准码集",
|
|
91
|
+
onSelect: (e) => {
|
|
92
|
+
let t = w?.codeSets?.find((t) => t.codeSet === e);
|
|
93
|
+
t && r.setFieldValue("name", t.name);
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ f(s.Item, {
|
|
99
|
+
span: 12,
|
|
100
|
+
children: /* @__PURE__ */ f(m, {
|
|
101
|
+
name: "name",
|
|
102
|
+
validators: { onChange: _ },
|
|
103
|
+
children: (e) => /* @__PURE__ */ f(e.Input, {
|
|
104
|
+
required: !0,
|
|
105
|
+
label: "码表名称",
|
|
106
|
+
placeholder: "如 性别"
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ f(s.Item, {
|
|
111
|
+
span: 24,
|
|
112
|
+
children: /* @__PURE__ */ f(m, {
|
|
113
|
+
name: "entries",
|
|
114
|
+
validators: { onChange: v },
|
|
115
|
+
children: (e) => /* @__PURE__ */ p(c, {
|
|
116
|
+
hint: "别名仅参与匹配,转换输出始终为主值;数字与 true/false 按 JSON 类型存储,需存为字面量字符串时加英文引号(如 \"1\")",
|
|
117
|
+
label: "映射条目",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ f(i, {
|
|
120
|
+
value: e.state.value,
|
|
121
|
+
onChange: e.handleChange
|
|
122
|
+
}),
|
|
123
|
+
e.state.meta.errors.length > 0 && /* @__PURE__ */ f(l, {
|
|
124
|
+
type: "danger",
|
|
125
|
+
children: String(e.state.meta.errors[0])
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ f(r.Subscribe, {
|
|
128
|
+
selector: (e) => e.values.codeSet,
|
|
129
|
+
children: (e) => /* @__PURE__ */ f(x, {
|
|
130
|
+
codeSet: e,
|
|
131
|
+
supported: O
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ f(s.Item, {
|
|
139
|
+
span: 24,
|
|
140
|
+
children: /* @__PURE__ */ f(m, {
|
|
141
|
+
name: "onUnmapped",
|
|
142
|
+
children: (e) => /* @__PURE__ */ f(e.Select, {
|
|
143
|
+
required: !0,
|
|
144
|
+
extra: "脚本可通过 { fallback: … } / { passthrough: true } / { reject: true } 按调用覆盖",
|
|
145
|
+
label: "未收录策略",
|
|
146
|
+
options: b
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ f(r.Subscribe, {
|
|
151
|
+
selector: (e) => e.values.onUnmapped,
|
|
152
|
+
children: (e) => e === "fallback" ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s.Item, {
|
|
153
|
+
span: 12,
|
|
154
|
+
children: /* @__PURE__ */ f(m, {
|
|
155
|
+
name: "fallbackCanonical",
|
|
156
|
+
validators: { onChange: y },
|
|
157
|
+
children: (e) => /* @__PURE__ */ f(e.Input, {
|
|
158
|
+
required: !0,
|
|
159
|
+
extra: "toCanonical 未命中时返回的标准侧值",
|
|
160
|
+
label: "标准侧兜底值",
|
|
161
|
+
placeholder: "如 0"
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
}), /* @__PURE__ */ f(s.Item, {
|
|
165
|
+
span: 12,
|
|
166
|
+
children: /* @__PURE__ */ f(m, {
|
|
167
|
+
name: "fallbackExternal",
|
|
168
|
+
validators: { onChange: y },
|
|
169
|
+
children: (e) => /* @__PURE__ */ f(e.Input, {
|
|
170
|
+
required: !0,
|
|
171
|
+
extra: "toExternal 未命中时返回的外部侧值",
|
|
172
|
+
label: "外部侧兜底值",
|
|
173
|
+
placeholder: "如 U"
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
})] }) : null
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ f(s.Item, {
|
|
179
|
+
span: 24,
|
|
180
|
+
children: /* @__PURE__ */ f(m, {
|
|
181
|
+
name: "isEnabled",
|
|
182
|
+
children: (e) => /* @__PURE__ */ f(e.Bool, {
|
|
183
|
+
label: "启用",
|
|
184
|
+
variant: "switch"
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
export { S as CodeMapForm };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
|
+
import { API_PATH as e } from "../../api/query.js";
|
|
3
|
+
import { codeMapFormToParams as t } from "./model.js";
|
|
4
|
+
import { createApiRequest as n, useApiClient as r } from "@vef-framework-react/core";
|
|
5
|
+
import { useMemo as i } from "react";
|
|
6
|
+
import { createCrudKit as a } from "@vef-framework-react/components";
|
|
7
|
+
//#region src/pages/code-map-page/helpers.ts
|
|
8
|
+
var { OperationButtonGroup: o, ActionButtonGroup: s } = a();
|
|
9
|
+
function c() {
|
|
10
|
+
let a = r();
|
|
11
|
+
return i(() => ({
|
|
12
|
+
create: a.createMutationFn("integration_code_map_form_create", ({ post: r }) => (i) => r(e, { data: n("integration/code_map", "create", t(i)) })),
|
|
13
|
+
update: a.createMutationFn("integration_code_map_form_update", ({ post: r }) => (i) => r(e, { data: n("integration/code_map", "update", t(i)) }))
|
|
14
|
+
}), [a]);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { s as CodeMapActionButtonGroup, o as CodeMapOperationButtonGroup, c as useCodeMapFormMutations };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.1 made by Venus | 2026-07-28T11:21:37.446Z */
|
|
2
|
+
import { useCodeMapApi as e } from "../../api/crud-api.js";
|
|
3
|
+
import { useSystemDirectory as t } from "../../components/directory/index.js";
|
|
4
|
+
import { INTEGRATION_PERMISSIONS as n } from "../../permissions.js";
|
|
5
|
+
import { CODE_MAP_FORM_DEFAULTS as r, codeMapToFormValues as i } from "./model.js";
|
|
6
|
+
import { buildCodeMapColumns as a } from "./columns.js";
|
|
7
|
+
import { CodeMapForm as o } from "./form.js";
|
|
8
|
+
import { CodeMapActionButtonGroup as s, CodeMapOperationButtonGroup as c, useCodeMapFormMutations as l } from "./helpers.js";
|
|
9
|
+
import { CodeMapSearchFields as u } from "./search.js";
|
|
10
|
+
import { useMemo as d } from "react";
|
|
11
|
+
import { ActionButton as f, CrudPage as p, Icon as m, OperationButton as h, PermissionGate as g } from "@vef-framework-react/components";
|
|
12
|
+
import { Fragment as _, jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
13
|
+
import { EditIcon as b, PlusIcon as x, TrashIcon as S } from "lucide-react";
|
|
14
|
+
//#region src/pages/code-map-page/index.tsx
|
|
15
|
+
var C = {
|
|
16
|
+
xxs: "100vw",
|
|
17
|
+
md: 760
|
|
18
|
+
};
|
|
19
|
+
function w({ permissions: w, columnStorageKey: T = "integration.code_map", title: E }) {
|
|
20
|
+
let D = e(), O = l(), k = t(), A = {
|
|
21
|
+
...n.codeMap,
|
|
22
|
+
...w
|
|
23
|
+
}, j = d(() => a(k), [k]);
|
|
24
|
+
return /* @__PURE__ */ v(p, {
|
|
25
|
+
rowSelection: !0,
|
|
26
|
+
basicSearch: /* @__PURE__ */ v(u, {}),
|
|
27
|
+
columnSettings: { storageKey: T },
|
|
28
|
+
deleteManyMutationFn: D.removeMany,
|
|
29
|
+
deleteMutationFn: D.remove,
|
|
30
|
+
formLayout: { layout: "vertical" },
|
|
31
|
+
formMutationFns: O,
|
|
32
|
+
queryFn: D.findPage,
|
|
33
|
+
renderForm: (e) => /* @__PURE__ */ v(o, { scene: e }),
|
|
34
|
+
rowKey: "id",
|
|
35
|
+
sceneDefaultFormValues: { create: r },
|
|
36
|
+
tableColumns: j,
|
|
37
|
+
title: E,
|
|
38
|
+
operationColumn: {
|
|
39
|
+
width: 160,
|
|
40
|
+
render(e) {
|
|
41
|
+
return /* @__PURE__ */ v(c, {
|
|
42
|
+
selector: (e) => [
|
|
43
|
+
e.openForm,
|
|
44
|
+
e.delete,
|
|
45
|
+
e.refetchQuery
|
|
46
|
+
],
|
|
47
|
+
children: ([t, n, r]) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, {
|
|
48
|
+
color: "primary",
|
|
49
|
+
icon: /* @__PURE__ */ v(m, { component: b }),
|
|
50
|
+
requiredPermissions: A.update,
|
|
51
|
+
onClick: () => t({
|
|
52
|
+
scene: "update",
|
|
53
|
+
values: i(e),
|
|
54
|
+
title: "编辑码表",
|
|
55
|
+
mode: "drawer",
|
|
56
|
+
width: C
|
|
57
|
+
}),
|
|
58
|
+
children: "编辑"
|
|
59
|
+
}), /* @__PURE__ */ v(h, {
|
|
60
|
+
confirmable: !0,
|
|
61
|
+
color: "danger",
|
|
62
|
+
confirmDescription: "确定删除该码表?引用它的适配器脚本将按未配置处理",
|
|
63
|
+
icon: /* @__PURE__ */ v(m, { component: S }),
|
|
64
|
+
requiredPermissions: A.delete,
|
|
65
|
+
onClick: async () => {
|
|
66
|
+
try {
|
|
67
|
+
await n(e), r();
|
|
68
|
+
} catch {}
|
|
69
|
+
},
|
|
70
|
+
children: "删除"
|
|
71
|
+
})] })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
toolbarActions: /* @__PURE__ */ v(s, {
|
|
76
|
+
selector: (e) => [
|
|
77
|
+
e.openForm,
|
|
78
|
+
e.isQueryFetching,
|
|
79
|
+
e.selectedRows,
|
|
80
|
+
e.deleteMany,
|
|
81
|
+
e.refetchQuery
|
|
82
|
+
],
|
|
83
|
+
children: ([e, t, n, r, i]) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, {
|
|
84
|
+
requiredPermissions: A.create,
|
|
85
|
+
children: /* @__PURE__ */ v(f, {
|
|
86
|
+
icon: /* @__PURE__ */ v(m, { component: x }),
|
|
87
|
+
type: "primary",
|
|
88
|
+
onClick: () => e({
|
|
89
|
+
scene: "create",
|
|
90
|
+
title: "新增码表",
|
|
91
|
+
mode: "drawer",
|
|
92
|
+
width: C
|
|
93
|
+
}),
|
|
94
|
+
children: "新增码表"
|
|
95
|
+
})
|
|
96
|
+
}), /* @__PURE__ */ v(g, {
|
|
97
|
+
requiredPermissions: A.delete,
|
|
98
|
+
children: /* @__PURE__ */ v(f, {
|
|
99
|
+
confirmable: !0,
|
|
100
|
+
danger: !0,
|
|
101
|
+
confirmDescription: "确定批量删除选中的码表?",
|
|
102
|
+
confirmMode: "dialog",
|
|
103
|
+
disabled: t || n.length === 0,
|
|
104
|
+
icon: /* @__PURE__ */ v(m, { component: S }),
|
|
105
|
+
onClick: async () => {
|
|
106
|
+
try {
|
|
107
|
+
await r(n), i();
|
|
108
|
+
} catch {}
|
|
109
|
+
},
|
|
110
|
+
children: "批量删除"
|
|
111
|
+
})
|
|
112
|
+
})] })
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { w as IntegrationCodeMapPage };
|