@vef-framework-react/integration 2.10.0 → 2.13.0
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/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 +6 -2
- package/dist/es/api/index.js +7 -6
- package/dist/es/api/log-api.js +1 -1
- package/dist/es/api/ops-api.js +1 -1
- 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 +5 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
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 };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
|
+
//#region src/pages/code-map-page/model.ts
|
|
3
|
+
var e = /^[A-Z0-9](?:[\w.-]*[A-Z0-9])?$/i, t = {
|
|
4
|
+
reject: "未收录报错",
|
|
5
|
+
passthrough: "透传原值",
|
|
6
|
+
fallback: "返回兜底值"
|
|
7
|
+
}, n = /^-?\d+(?:\.\d+)?$/;
|
|
8
|
+
function r(e) {
|
|
9
|
+
let t = e.trim();
|
|
10
|
+
if (n.test(t)) return Number(t);
|
|
11
|
+
if (t === "true") return !0;
|
|
12
|
+
if (t === "false") return !1;
|
|
13
|
+
if (t.startsWith("\"") && t.endsWith("\"") && t.length >= 2) try {
|
|
14
|
+
let e = JSON.parse(t);
|
|
15
|
+
if (typeof e == "string") return e;
|
|
16
|
+
} catch {}
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
function i(e) {
|
|
20
|
+
return n.test(e) || e === "true" || e === "false" || e.startsWith("\"") || e !== e.trim();
|
|
21
|
+
}
|
|
22
|
+
function a(e) {
|
|
23
|
+
return e == null ? "" : typeof e == "string" ? i(e) ? JSON.stringify(e) : e : String(e);
|
|
24
|
+
}
|
|
25
|
+
function o(e) {
|
|
26
|
+
return typeof e == "string" ? e : String(e);
|
|
27
|
+
}
|
|
28
|
+
function s(e, t) {
|
|
29
|
+
return [e, ...t ?? []];
|
|
30
|
+
}
|
|
31
|
+
function c(e) {
|
|
32
|
+
let t = [], n = {
|
|
33
|
+
canonical: /* @__PURE__ */ new Map(),
|
|
34
|
+
external: /* @__PURE__ */ new Map()
|
|
35
|
+
};
|
|
36
|
+
for (let [r, i] of e.entries()) u("canonical", i, r, n.canonical, t), u("external", i, r, n.external, t);
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
var l = {
|
|
40
|
+
canonical: "标准侧",
|
|
41
|
+
external: "外部侧"
|
|
42
|
+
};
|
|
43
|
+
function u(e, t, n, r, i) {
|
|
44
|
+
let a = s(t[e], t[`${e}Aliases`]);
|
|
45
|
+
for (let t of a) {
|
|
46
|
+
if (t === "") {
|
|
47
|
+
i.push(`第 ${n + 1} 行${l[e]}存在空值`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
let a = o(t), s = r.get(a);
|
|
51
|
+
s === void 0 ? r.set(a, n) : s === n ? i.push(`第 ${n + 1} 行${l[e]}值「${a}」重复`) : i.push(`第 ${n + 1} 行${l[e]}值「${a}」与第 ${s + 1} 行重复`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var d = {
|
|
55
|
+
codeSet: "",
|
|
56
|
+
name: "",
|
|
57
|
+
entries: [],
|
|
58
|
+
onUnmapped: "reject",
|
|
59
|
+
fallbackCanonical: "",
|
|
60
|
+
fallbackExternal: "",
|
|
61
|
+
isEnabled: !0
|
|
62
|
+
};
|
|
63
|
+
function f(e) {
|
|
64
|
+
return {
|
|
65
|
+
id: e.id,
|
|
66
|
+
systemId: e.systemId,
|
|
67
|
+
codeSet: e.codeSet,
|
|
68
|
+
name: e.name,
|
|
69
|
+
entries: e.entries ?? [],
|
|
70
|
+
onUnmapped: e.onUnmapped || "reject",
|
|
71
|
+
fallbackCanonical: a(e.fallbackCanonical),
|
|
72
|
+
fallbackExternal: a(e.fallbackExternal),
|
|
73
|
+
isEnabled: e.isEnabled
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function p(e) {
|
|
77
|
+
let t = e.onUnmapped === "fallback";
|
|
78
|
+
return {
|
|
79
|
+
id: e.id,
|
|
80
|
+
systemId: e.systemId,
|
|
81
|
+
codeSet: e.codeSet,
|
|
82
|
+
name: e.name,
|
|
83
|
+
entries: e.entries,
|
|
84
|
+
onUnmapped: e.onUnmapped,
|
|
85
|
+
fallbackCanonical: t ? r(e.fallbackCanonical) : void 0,
|
|
86
|
+
fallbackExternal: t ? r(e.fallbackExternal) : void 0,
|
|
87
|
+
isEnabled: e.isEnabled
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { d as CODE_MAP_FORM_DEFAULTS, e as CODE_SET_PATTERN, t as UNMAPPED_POLICY_LABELS, p as codeMapFormToParams, f as codeMapToFormValues, a as formatCodeValue, o as normalizeCodeValue, r as parseCodeValue, c as validateCodeMapEntries };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
|
+
import { useSystemDirectory as e } from "../../components/directory/index.js";
|
|
3
|
+
import { useFormContext as t } from "@vef-framework-react/components";
|
|
4
|
+
import { Fragment as n, jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
|
|
5
|
+
//#region src/pages/code-map-page/search.tsx
|
|
6
|
+
function a() {
|
|
7
|
+
let { AppField: a } = t(), o = e();
|
|
8
|
+
return /* @__PURE__ */ i(n, { children: [
|
|
9
|
+
/* @__PURE__ */ r(a, {
|
|
10
|
+
name: "systemId",
|
|
11
|
+
children: (e) => /* @__PURE__ */ r(e.Select, {
|
|
12
|
+
allowClear: !0,
|
|
13
|
+
noWrapper: !0,
|
|
14
|
+
options: o.options,
|
|
15
|
+
placeholder: "所属系统",
|
|
16
|
+
style: { minWidth: 180 }
|
|
17
|
+
})
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ r(a, {
|
|
20
|
+
name: "codeSet",
|
|
21
|
+
children: (e) => /* @__PURE__ */ r(e.Input, {
|
|
22
|
+
allowClear: !0,
|
|
23
|
+
noWrapper: !0,
|
|
24
|
+
placeholder: "码集"
|
|
25
|
+
})
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ r(a, {
|
|
28
|
+
name: "name",
|
|
29
|
+
children: (e) => /* @__PURE__ */ r(e.Input, {
|
|
30
|
+
allowClear: !0,
|
|
31
|
+
noWrapper: !0,
|
|
32
|
+
placeholder: "名称"
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { a as CodeMapSearchFields };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
2
|
import { useOpsApi as e } from "../../api/ops-api.js";
|
|
3
3
|
import { FindingKindTag as t } from "../../components/status/index.js";
|
|
4
4
|
import { useMutation as n } from "@vef-framework-react/core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
2
|
import { useOpsApi as e } from "../../api/ops-api.js";
|
|
3
3
|
import { ParamsEditor as t } from "../../components/params-editor/index.js";
|
|
4
4
|
import { useContractDirectory as ee, useSystemDirectory as te } from "../../components/directory/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
2
|
import { INTEGRATION_PERMISSIONS as e } from "../../permissions.js";
|
|
3
3
|
import { DiagnosticsPanel as t } from "./diagnostics.js";
|
|
4
4
|
import { DryRunPanel as n } from "./dry-run.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
2
|
import { useLogApi as e } from "../../api/log-api.js";
|
|
3
3
|
import { useContractDirectory as t, useSystemDirectory as n } from "../../components/directory/index.js";
|
|
4
4
|
import { formatTimestamp as r } from "../../components/format.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/integration v2.
|
|
1
|
+
/*! @vef-framework-react/integration v2.13.0 made by Venus | 2026-07-21T07:15:48.580Z */
|
|
2
2
|
import { useStatsApi as e } from "../../api/stats-api.js";
|
|
3
3
|
import { FAILURE_KIND_COLORS as t } from "../../components/status/colors.js";
|
|
4
4
|
import { FAILURE_KINDS as n } from "../../types/enums.js";
|