@yuku123/z-meta-component 0.1.1 → 0.1.2
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/ComponentDoc-IVc3HvAO.js +564 -0
- package/dist/index.js +4 -3
- package/dist/pages.js +283 -245
- package/package.json +2 -2
- package/dist/MetaApp-DCN9NQdA.js +0 -559
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
import { Routes as oe, Route as g, Navigate as de } from "react-router-dom";
|
|
2
|
+
import { Tag as d, Alert as le, Table as F, Tooltip as ce, Typography as pe } from "antd";
|
|
3
|
+
import { createRequest as ue } from "@yuku123/z-frontend-common";
|
|
4
|
+
import { PagedTable as T, ComponentDoc as me } from "@yuku123/z-frontend-common/ui";
|
|
5
|
+
import fe, { useState as xe, useEffect as ge } from "react";
|
|
6
|
+
const u = ue({ baseURL: "/meta" });
|
|
7
|
+
function Ce(t) {
|
|
8
|
+
t && t.apiBase !== void 0 && (u.defaults.baseURL = t.apiBase);
|
|
9
|
+
}
|
|
10
|
+
var w = { exports: {} }, k = {};
|
|
11
|
+
/**
|
|
12
|
+
* @license React
|
|
13
|
+
* react-jsx-runtime.production.js
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
var Y;
|
|
21
|
+
function _e() {
|
|
22
|
+
if (Y) return k;
|
|
23
|
+
Y = 1;
|
|
24
|
+
var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
|
|
25
|
+
function c(p, l, m) {
|
|
26
|
+
var E = null;
|
|
27
|
+
if (m !== void 0 && (E = "" + m), l.key !== void 0 && (E = "" + l.key), "key" in l) {
|
|
28
|
+
m = {};
|
|
29
|
+
for (var j in l)
|
|
30
|
+
j !== "key" && (m[j] = l[j]);
|
|
31
|
+
} else m = l;
|
|
32
|
+
return l = m.ref, {
|
|
33
|
+
$$typeof: t,
|
|
34
|
+
type: p,
|
|
35
|
+
key: E,
|
|
36
|
+
ref: l !== void 0 ? l : null,
|
|
37
|
+
props: m
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return k.Fragment = a, k.jsx = c, k.jsxs = c, k;
|
|
41
|
+
}
|
|
42
|
+
var h = {};
|
|
43
|
+
/**
|
|
44
|
+
* @license React
|
|
45
|
+
* react-jsx-runtime.development.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/
|
|
52
|
+
var $;
|
|
53
|
+
function ye() {
|
|
54
|
+
return $ || ($ = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
55
|
+
function t(e) {
|
|
56
|
+
if (e == null) return null;
|
|
57
|
+
if (typeof e == "function")
|
|
58
|
+
return e.$$typeof === re ? null : e.displayName || e.name || null;
|
|
59
|
+
if (typeof e == "string") return e;
|
|
60
|
+
switch (e) {
|
|
61
|
+
case R:
|
|
62
|
+
return "Fragment";
|
|
63
|
+
case H:
|
|
64
|
+
return "Profiler";
|
|
65
|
+
case V:
|
|
66
|
+
return "StrictMode";
|
|
67
|
+
case Q:
|
|
68
|
+
return "Suspense";
|
|
69
|
+
case ee:
|
|
70
|
+
return "SuspenseList";
|
|
71
|
+
case ne:
|
|
72
|
+
return "Activity";
|
|
73
|
+
case ae:
|
|
74
|
+
return "ViewTransition";
|
|
75
|
+
}
|
|
76
|
+
if (typeof e == "object")
|
|
77
|
+
switch (typeof e.tag == "number" && console.error(
|
|
78
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
79
|
+
), e.$$typeof) {
|
|
80
|
+
case J:
|
|
81
|
+
return "Portal";
|
|
82
|
+
case Z:
|
|
83
|
+
return e.displayName || "Context";
|
|
84
|
+
case X:
|
|
85
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
86
|
+
case K:
|
|
87
|
+
var r = e.render;
|
|
88
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
89
|
+
case te:
|
|
90
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
91
|
+
case v:
|
|
92
|
+
r = e._payload, e = e._init;
|
|
93
|
+
try {
|
|
94
|
+
return t(e(r));
|
|
95
|
+
} catch {
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function a(e) {
|
|
101
|
+
return "" + e;
|
|
102
|
+
}
|
|
103
|
+
function c(e) {
|
|
104
|
+
try {
|
|
105
|
+
a(e);
|
|
106
|
+
var r = !1;
|
|
107
|
+
} catch {
|
|
108
|
+
r = !0;
|
|
109
|
+
}
|
|
110
|
+
if (r) {
|
|
111
|
+
r = console;
|
|
112
|
+
var i = r.error, s = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
113
|
+
return i.call(
|
|
114
|
+
r,
|
|
115
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
116
|
+
s
|
|
117
|
+
), a(e);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function p(e) {
|
|
121
|
+
if (e === R) return "<>";
|
|
122
|
+
if (typeof e == "object" && e !== null && e.$$typeof === v)
|
|
123
|
+
return "<...>";
|
|
124
|
+
try {
|
|
125
|
+
var r = t(e);
|
|
126
|
+
return r ? "<" + r + ">" : "<...>";
|
|
127
|
+
} catch {
|
|
128
|
+
return "<...>";
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function l() {
|
|
132
|
+
var e = P.A;
|
|
133
|
+
return e === null ? null : e.getOwner();
|
|
134
|
+
}
|
|
135
|
+
function m() {
|
|
136
|
+
return Error("react-stack-top-frame");
|
|
137
|
+
}
|
|
138
|
+
function E(e) {
|
|
139
|
+
if (z.call(e, "key")) {
|
|
140
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
141
|
+
if (r && r.isReactWarning) return !1;
|
|
142
|
+
}
|
|
143
|
+
return e.key !== void 0;
|
|
144
|
+
}
|
|
145
|
+
function j(e, r) {
|
|
146
|
+
function i() {
|
|
147
|
+
N || (N = !0, console.error(
|
|
148
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
149
|
+
r
|
|
150
|
+
));
|
|
151
|
+
}
|
|
152
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
153
|
+
get: i,
|
|
154
|
+
configurable: !0
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function B() {
|
|
158
|
+
var e = t(this.type);
|
|
159
|
+
return D[e] || (D[e] = !0, console.error(
|
|
160
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
161
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
162
|
+
}
|
|
163
|
+
function W(e, r, i, s, x, f) {
|
|
164
|
+
var o = i.ref;
|
|
165
|
+
return e = {
|
|
166
|
+
$$typeof: C,
|
|
167
|
+
type: e,
|
|
168
|
+
key: r,
|
|
169
|
+
props: i,
|
|
170
|
+
_owner: s
|
|
171
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
172
|
+
enumerable: !1,
|
|
173
|
+
get: B
|
|
174
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: 0
|
|
179
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: null
|
|
184
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
185
|
+
configurable: !1,
|
|
186
|
+
enumerable: !1,
|
|
187
|
+
writable: !0,
|
|
188
|
+
value: x
|
|
189
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
190
|
+
configurable: !1,
|
|
191
|
+
enumerable: !1,
|
|
192
|
+
writable: !0,
|
|
193
|
+
value: f
|
|
194
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
195
|
+
}
|
|
196
|
+
function L(e, r, i, s, x, f) {
|
|
197
|
+
var o = r.children;
|
|
198
|
+
if (o !== void 0)
|
|
199
|
+
if (s)
|
|
200
|
+
if (ie(o)) {
|
|
201
|
+
for (s = 0; s < o.length; s++)
|
|
202
|
+
O(o[s]);
|
|
203
|
+
Object.freeze && Object.freeze(o);
|
|
204
|
+
} else
|
|
205
|
+
console.error(
|
|
206
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
207
|
+
);
|
|
208
|
+
else O(o);
|
|
209
|
+
if (z.call(r, "key")) {
|
|
210
|
+
o = t(e);
|
|
211
|
+
var y = Object.keys(r).filter(function(se) {
|
|
212
|
+
return se !== "key";
|
|
213
|
+
});
|
|
214
|
+
s = 0 < y.length ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}", U[o + s] || (y = 0 < y.length ? "{" + y.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
215
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
216
|
+
let props = %s;
|
|
217
|
+
<%s {...props} />
|
|
218
|
+
React keys must be passed directly to JSX without using spread:
|
|
219
|
+
let props = %s;
|
|
220
|
+
<%s key={someKey} {...props} />`,
|
|
221
|
+
s,
|
|
222
|
+
o,
|
|
223
|
+
y,
|
|
224
|
+
o
|
|
225
|
+
), U[o + s] = !0);
|
|
226
|
+
}
|
|
227
|
+
if (o = null, i !== void 0 && (c(i), o = "" + i), E(r) && (c(r.key), o = "" + r.key), "key" in r) {
|
|
228
|
+
i = {};
|
|
229
|
+
for (var A in r)
|
|
230
|
+
A !== "key" && (i[A] = r[A]);
|
|
231
|
+
} else i = r;
|
|
232
|
+
return o && j(
|
|
233
|
+
i,
|
|
234
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
235
|
+
), W(
|
|
236
|
+
e,
|
|
237
|
+
o,
|
|
238
|
+
i,
|
|
239
|
+
l(),
|
|
240
|
+
x,
|
|
241
|
+
f
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
function O(e) {
|
|
245
|
+
S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === v && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
246
|
+
}
|
|
247
|
+
function S(e) {
|
|
248
|
+
return typeof e == "object" && e !== null && e.$$typeof === C;
|
|
249
|
+
}
|
|
250
|
+
var b = fe, C = Symbol.for("react.transitional.element"), J = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), Q = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), te = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), ne = Symbol.for("react.activity"), ae = Symbol.for("react.view_transition"), re = Symbol.for("react.client.reference"), P = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, ie = Array.isArray, I = console.createTask ? console.createTask : function() {
|
|
251
|
+
return null;
|
|
252
|
+
};
|
|
253
|
+
b = {
|
|
254
|
+
react_stack_bottom_frame: function(e) {
|
|
255
|
+
return e();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
var N, D = {}, G = b.react_stack_bottom_frame.bind(
|
|
259
|
+
b,
|
|
260
|
+
m
|
|
261
|
+
)(), M = I(p(m)), U = {};
|
|
262
|
+
h.Fragment = R, h.jsx = function(e, r, i) {
|
|
263
|
+
var s = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
264
|
+
if (s) {
|
|
265
|
+
var x = Error.stackTraceLimit;
|
|
266
|
+
Error.stackTraceLimit = 10;
|
|
267
|
+
var f = Error("react-stack-top-frame");
|
|
268
|
+
Error.stackTraceLimit = x;
|
|
269
|
+
} else f = G;
|
|
270
|
+
return L(
|
|
271
|
+
e,
|
|
272
|
+
r,
|
|
273
|
+
i,
|
|
274
|
+
!1,
|
|
275
|
+
f,
|
|
276
|
+
s ? I(p(e)) : M
|
|
277
|
+
);
|
|
278
|
+
}, h.jsxs = function(e, r, i) {
|
|
279
|
+
var s = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
280
|
+
if (s) {
|
|
281
|
+
var x = Error.stackTraceLimit;
|
|
282
|
+
Error.stackTraceLimit = 10;
|
|
283
|
+
var f = Error("react-stack-top-frame");
|
|
284
|
+
Error.stackTraceLimit = x;
|
|
285
|
+
} else f = G;
|
|
286
|
+
return L(
|
|
287
|
+
e,
|
|
288
|
+
r,
|
|
289
|
+
i,
|
|
290
|
+
!0,
|
|
291
|
+
f,
|
|
292
|
+
s ? I(p(e)) : M
|
|
293
|
+
);
|
|
294
|
+
};
|
|
295
|
+
})()), h;
|
|
296
|
+
}
|
|
297
|
+
var q;
|
|
298
|
+
function Te() {
|
|
299
|
+
return q || (q = 1, process.env.NODE_ENV === "production" ? w.exports = _e() : w.exports = ye()), w.exports;
|
|
300
|
+
}
|
|
301
|
+
var n = Te();
|
|
302
|
+
const _ = {
|
|
303
|
+
appPage: (t, a) => u.get("/meta-app/list", { params: { pageNum: t, pageSize: a } }),
|
|
304
|
+
appGet: (t) => u.get("/meta-app/get", { params: { id: t } }),
|
|
305
|
+
tenantPage: (t, a) => u.get("/meta-tenant/list", { params: { pageNum: t, pageSize: a } }),
|
|
306
|
+
dictTypePage: (t, a, c) => u.get("/dict/type/list", { params: { pageNum: t, pageSize: a, dictName: c } }),
|
|
307
|
+
dictItemsByCode: (t) => u.get("/dict/items/get", { params: { dictCode: t } }),
|
|
308
|
+
dictItemsByTypeId: (t) => u.get("/dict/item/list", { params: { dictId: t } }),
|
|
309
|
+
interfacePage: (t, a) => u.get("/interface/list", { params: { pageNum: t, pageSize: a } }),
|
|
310
|
+
interfaceByApp: (t) => u.get("/interface/app/list", { params: { appId: t } }),
|
|
311
|
+
privateConfigPage: (t, a) => u.get("/private-config/list", { params: { pageNum: t, pageSize: a } }),
|
|
312
|
+
bizModels: () => u.get("/meta/models")
|
|
313
|
+
}, Ee = (t) => t === 1 ? /* @__PURE__ */ n.jsx(d, { color: "success", children: "启用" }) : /* @__PURE__ */ n.jsx(d, { color: "default", children: "停用" });
|
|
314
|
+
function je() {
|
|
315
|
+
return /* @__PURE__ */ n.jsx(
|
|
316
|
+
T,
|
|
317
|
+
{
|
|
318
|
+
title: "应用元数据",
|
|
319
|
+
description: "z-meta 登记在册的应用(数据源 GET /api/meta-app/list)",
|
|
320
|
+
load: (t, a) => _.appPage(t, a),
|
|
321
|
+
columns: [
|
|
322
|
+
{ title: "应用编码", dataIndex: "app_code", key: "app_code", width: 180 },
|
|
323
|
+
{ title: "应用名称", dataIndex: "app_name", key: "app_name" },
|
|
324
|
+
{ title: "类型", dataIndex: "app_type", key: "app_type", width: 100, render: (t) => /* @__PURE__ */ n.jsx(d, { children: t }) },
|
|
325
|
+
{
|
|
326
|
+
title: "入口地址",
|
|
327
|
+
dataIndex: "base_url",
|
|
328
|
+
key: "base_url",
|
|
329
|
+
ellipsis: !0,
|
|
330
|
+
render: (t) => t || "-"
|
|
331
|
+
},
|
|
332
|
+
{ title: "负责人", dataIndex: "owner", key: "owner", width: 110 },
|
|
333
|
+
{ title: "状态", dataIndex: "status", key: "status", width: 90, render: Ee },
|
|
334
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
|
|
335
|
+
{ title: "创建时间", dataIndex: "gmt_create", key: "gmt_create", width: 170 }
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
function ke() {
|
|
341
|
+
return /* @__PURE__ */ n.jsx(
|
|
342
|
+
T,
|
|
343
|
+
{
|
|
344
|
+
title: "租户管理",
|
|
345
|
+
description: "z-meta 租户台账(数据源 GET /api/meta-tenant/list)",
|
|
346
|
+
load: (t, a) => _.tenantPage(t, a),
|
|
347
|
+
columns: [
|
|
348
|
+
{ title: "租户编码", dataIndex: "tenant_code", key: "tenant_code", width: 160 },
|
|
349
|
+
{ title: "租户名称", dataIndex: "tenant_name", key: "tenant_name" },
|
|
350
|
+
{
|
|
351
|
+
title: "类型",
|
|
352
|
+
dataIndex: "tenant_type",
|
|
353
|
+
key: "tenant_type",
|
|
354
|
+
width: 110,
|
|
355
|
+
render: (t) => t ? /* @__PURE__ */ n.jsx(d, { children: t }) : "-"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
title: "状态",
|
|
359
|
+
dataIndex: "status",
|
|
360
|
+
key: "status",
|
|
361
|
+
width: 90,
|
|
362
|
+
render: (t) => t === 1 ? /* @__PURE__ */ n.jsx(d, { color: "success", children: "正常" }) : /* @__PURE__ */ n.jsx(d, { children: "停用" })
|
|
363
|
+
},
|
|
364
|
+
{ title: "到期时间", dataIndex: "expire_time", key: "expire_time", width: 170, render: (t) => t || "长期" },
|
|
365
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
|
|
366
|
+
{ title: "创建时间", dataIndex: "gmt_create", key: "gmt_create", width: 170 }
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
function he({ dictCode: t }) {
|
|
372
|
+
const [a, c] = xe({ loading: !0, rows: [], error: null });
|
|
373
|
+
return ge(() => {
|
|
374
|
+
let p = !1;
|
|
375
|
+
return c({ loading: !0, rows: [], error: null }), _.dictItemsByCode(t).then((l) => {
|
|
376
|
+
p || c({ loading: !1, rows: l || [], error: null });
|
|
377
|
+
}).catch((l) => {
|
|
378
|
+
p || c({ loading: !1, rows: [], error: l });
|
|
379
|
+
}), () => {
|
|
380
|
+
p = !0;
|
|
381
|
+
};
|
|
382
|
+
}, [t]), a.error ? /* @__PURE__ */ n.jsx(
|
|
383
|
+
le,
|
|
384
|
+
{
|
|
385
|
+
type: "error",
|
|
386
|
+
showIcon: !0,
|
|
387
|
+
message: `字典项加载失败:${a.error.message || a.error}`
|
|
388
|
+
}
|
|
389
|
+
) : /* @__PURE__ */ n.jsx(
|
|
390
|
+
F,
|
|
391
|
+
{
|
|
392
|
+
size: "small",
|
|
393
|
+
rowKey: "id",
|
|
394
|
+
loading: a.loading,
|
|
395
|
+
dataSource: a.rows,
|
|
396
|
+
pagination: !1,
|
|
397
|
+
columns: [
|
|
398
|
+
{ title: "项编码", dataIndex: "item_code", key: "item_code", width: 180 },
|
|
399
|
+
{ title: "项名称", dataIndex: "item_name", key: "item_name" },
|
|
400
|
+
{ title: "值", dataIndex: "item_value", key: "item_value", width: 120 },
|
|
401
|
+
{ title: "排序", dataIndex: "sort_order", key: "sort_order", width: 80 },
|
|
402
|
+
{
|
|
403
|
+
title: "状态",
|
|
404
|
+
dataIndex: "status",
|
|
405
|
+
key: "status",
|
|
406
|
+
width: 90,
|
|
407
|
+
render: (p) => p === 1 ? /* @__PURE__ */ n.jsx(d, { color: "success", children: "启用" }) : /* @__PURE__ */ n.jsx(d, { children: "停用" })
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
locale: { emptyText: `字典 ${t} 下暂无字典项` }
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
function be() {
|
|
415
|
+
return /* @__PURE__ */ n.jsx(
|
|
416
|
+
T,
|
|
417
|
+
{
|
|
418
|
+
title: "数据字典",
|
|
419
|
+
description: "字典类型台账;展开行按 dict_code 实时拉取字典项(GET /api/dict/type/list + /api/dict/items/get)",
|
|
420
|
+
load: (t, a) => _.dictTypePage(t, a),
|
|
421
|
+
columns: [
|
|
422
|
+
{ title: "字典编码", dataIndex: "dict_code", key: "dict_code", width: 200 },
|
|
423
|
+
{ title: "字典名称", dataIndex: "dict_name", key: "dict_name" },
|
|
424
|
+
{
|
|
425
|
+
title: "值类型",
|
|
426
|
+
dataIndex: "dict_type",
|
|
427
|
+
key: "dict_type",
|
|
428
|
+
width: 110,
|
|
429
|
+
render: (t) => t ? /* @__PURE__ */ n.jsx(d, { children: t }) : "-"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
title: "状态",
|
|
433
|
+
dataIndex: "status",
|
|
434
|
+
key: "status",
|
|
435
|
+
width: 90,
|
|
436
|
+
render: (t) => t === 1 ? /* @__PURE__ */ n.jsx(d, { color: "success", children: "启用" }) : /* @__PURE__ */ n.jsx(d, { children: "停用" })
|
|
437
|
+
},
|
|
438
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
|
|
439
|
+
{ title: "更新时间", dataIndex: "gmt_modified", key: "gmt_modified", width: 170 }
|
|
440
|
+
],
|
|
441
|
+
expandable: {
|
|
442
|
+
expandedRowRender: (t) => /* @__PURE__ */ n.jsx(he, { dictCode: t.dict_code }),
|
|
443
|
+
rowExpandable: (t) => !!t.dict_code
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function we() {
|
|
449
|
+
return /* @__PURE__ */ n.jsx(
|
|
450
|
+
T,
|
|
451
|
+
{
|
|
452
|
+
title: "接口台账",
|
|
453
|
+
description: "z-meta 登记的业务接口清单(数据源 GET /api/interface/list)",
|
|
454
|
+
load: (t, a) => _.interfacePage(t, a),
|
|
455
|
+
columns: [
|
|
456
|
+
{ title: "接口名称", dataIndex: "api_name", key: "api_name" },
|
|
457
|
+
{ title: "方法", dataIndex: "api_method", key: "api_method", width: 90, render: (t) => /* @__PURE__ */ n.jsx(d, { children: t }) },
|
|
458
|
+
{ title: "路径", dataIndex: "api_path", key: "api_path", ellipsis: !0 },
|
|
459
|
+
{ title: "版本", dataIndex: "api_version", key: "api_version", width: 90 },
|
|
460
|
+
{ title: "鉴权", dataIndex: "auth_type", key: "auth_type", width: 120 },
|
|
461
|
+
{
|
|
462
|
+
title: "状态",
|
|
463
|
+
key: "status",
|
|
464
|
+
width: 120,
|
|
465
|
+
render: (t, a) => a.deprecated === 1 ? /* @__PURE__ */ n.jsx(d, { color: "warning", children: "已废弃" }) : a.status === 1 ? /* @__PURE__ */ n.jsx(d, { color: "success", children: "启用" }) : /* @__PURE__ */ n.jsx(d, { children: "停用" })
|
|
466
|
+
},
|
|
467
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 }
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function Re() {
|
|
473
|
+
return /* @__PURE__ */ n.jsx(
|
|
474
|
+
T,
|
|
475
|
+
{
|
|
476
|
+
title: "私有配置",
|
|
477
|
+
description: "应用私有键值配置(数据源 GET /api/private-config/list)",
|
|
478
|
+
load: (t, a) => _.privateConfigPage(t, a),
|
|
479
|
+
columns: [
|
|
480
|
+
{ title: "配置键", dataIndex: "config_key", key: "config_key", width: 240 },
|
|
481
|
+
{
|
|
482
|
+
title: "配置值",
|
|
483
|
+
dataIndex: "config_value",
|
|
484
|
+
key: "config_value",
|
|
485
|
+
ellipsis: !0,
|
|
486
|
+
render: (t) => t ? /* @__PURE__ */ n.jsx(ce, { title: t, children: /* @__PURE__ */ n.jsx(pe.Text, { code: !0, copyable: { text: t }, children: t }) }) : "-"
|
|
487
|
+
},
|
|
488
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
|
|
489
|
+
{ title: "更新时间", dataIndex: "gmt_modified", key: "gmt_modified", width: 170 }
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
function ve() {
|
|
495
|
+
return /* @__PURE__ */ n.jsx(
|
|
496
|
+
T,
|
|
497
|
+
{
|
|
498
|
+
title: "业务模型",
|
|
499
|
+
description: "z-meta 的结构化业务模型清单(数据源 GET /api/meta/models,字段随模型一次性返回)",
|
|
500
|
+
load: () => _.bizModels(),
|
|
501
|
+
rowKey: "code",
|
|
502
|
+
columns: [
|
|
503
|
+
{ title: "模型编码", dataIndex: "code", key: "code", width: 200 },
|
|
504
|
+
{ title: "模型名称", dataIndex: "name", key: "name", width: 180 },
|
|
505
|
+
{
|
|
506
|
+
title: "所属模块",
|
|
507
|
+
dataIndex: "module",
|
|
508
|
+
key: "module",
|
|
509
|
+
width: 160,
|
|
510
|
+
render: (t) => /* @__PURE__ */ n.jsx(d, { color: "blue", children: t })
|
|
511
|
+
},
|
|
512
|
+
{ title: "实体类", dataIndex: "class_name", key: "class_name", ellipsis: !0 },
|
|
513
|
+
{
|
|
514
|
+
title: "字段数",
|
|
515
|
+
key: "fieldCount",
|
|
516
|
+
width: 90,
|
|
517
|
+
render: (t, a) => (a.fields || []).length
|
|
518
|
+
},
|
|
519
|
+
{ title: "描述", dataIndex: "description", key: "description", ellipsis: !0 }
|
|
520
|
+
],
|
|
521
|
+
expandable: {
|
|
522
|
+
rowExpandable: (t) => (t.fields || []).length > 0,
|
|
523
|
+
expandedRowRender: (t) => /* @__PURE__ */ n.jsx(
|
|
524
|
+
F,
|
|
525
|
+
{
|
|
526
|
+
size: "small",
|
|
527
|
+
rowKey: (a) => `${t.code}:${a.field_name}`,
|
|
528
|
+
dataSource: t.fields || [],
|
|
529
|
+
pagination: !1,
|
|
530
|
+
columns: [
|
|
531
|
+
{ title: "字段名", dataIndex: "name", key: "name", width: 160 },
|
|
532
|
+
{ title: "属性", dataIndex: "field_name", key: "field_name", width: 200 },
|
|
533
|
+
{ title: "类型", dataIndex: "type", key: "type", width: 120, render: (a) => /* @__PURE__ */ n.jsx(d, { children: a }) },
|
|
534
|
+
{ title: "关联模型", dataIndex: "ref_model", key: "ref_model", render: (a) => a || "-" },
|
|
535
|
+
{ title: "字典", dataIndex: "dict_code", key: "dict_code", render: (a) => a || "-" }
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
function ze() {
|
|
544
|
+
return /* @__PURE__ */ n.jsxs(oe, { children: [
|
|
545
|
+
/* @__PURE__ */ n.jsx(g, { index: !0, element: /* @__PURE__ */ n.jsx(de, { to: "app", replace: !0 }) }),
|
|
546
|
+
/* @__PURE__ */ n.jsx(g, { path: "app", element: /* @__PURE__ */ n.jsx(je, {}) }),
|
|
547
|
+
/* @__PURE__ */ n.jsx(g, { path: "tenant", element: /* @__PURE__ */ n.jsx(ke, {}) }),
|
|
548
|
+
/* @__PURE__ */ n.jsx(g, { path: "dict", element: /* @__PURE__ */ n.jsx(be, {}) }),
|
|
549
|
+
/* @__PURE__ */ n.jsx(g, { path: "interface", element: /* @__PURE__ */ n.jsx(we, {}) }),
|
|
550
|
+
/* @__PURE__ */ n.jsx(g, { path: "private-config", element: /* @__PURE__ */ n.jsx(Re, {}) }),
|
|
551
|
+
/* @__PURE__ */ n.jsx(g, { path: "models", element: /* @__PURE__ */ n.jsx(ve, {}) })
|
|
552
|
+
] });
|
|
553
|
+
}
|
|
554
|
+
const Pe = "# z-meta-component\n\nz-meta(元数据中心)跨仓唯一前端面:把「租户 / 应用 / 数据字典 / 接口台账 / 私有配置 / 业务模型」\n这一整套元数据页面收敛成一个可复用的 React 组件包。\n\n- **npm 包名**:`@yuku123/z-meta-component`\n- **宿主接入**:`@yuku123/z-meta-component/pages`(manifest + API),主壳可只取 `ComponentDocPage`\n- **后端**:z-opc 主进程 8888 的元数据接口,请求实例 `baseURL='/meta'`,前缀由 `configureMeta` 注入\n- **技术栈**:React 19 + antd 6 + react-router-dom 7 + vite(library mode,双入口 `.` / `./pages`)\n\n---\n\n## 一、能力概览\n\n路由前缀 `/z-meta`,菜单与路由在 `src/pages-manifest.jsx` 里声明。\n\n| 页面 | 路由(相对 `/z-meta/*`) | 源文件 | 能力 |\n|------|--------------------------|--------|------|\n| 登录 | `login` | `pages/login/Login.jsx` | 用户名密码登录(suit 侧单独挂这条路由) |\n| 首页 | `home` | `pages/HomePage.jsx` | 入口卡片页 |\n| 概览 | `dashboard` | `pages/Dashboard.jsx` | 租户 / 应用 / 字典 / 接口四张统计卡(当前为静态占位值) |\n| 租户管理 | `tenant` | `pages/tenant/TenantList.jsx` | 租户台账的增删改查 |\n| 应用管理 | `app` | `pages/application/AppList.jsx` | 应用台账的增删改查 |\n| 字典管理 | `dict` | `pages/dict/DictList.jsx` | 字典类型 + 字典项两级增删改查 |\n| 接口管理 | `api` | `pages/api/ApiList.jsx` | 接口台账的增删改查 |\n| 应用元数据(只读台账) | `*/app` | `pages/AppList.jsx` | 只读应用列表(基座 `PagedTable`) |\n| 租户管理(只读台账) | `*/tenant` | `pages/TenantList.jsx` | 只读租户列表(基座 `PagedTable`) |\n| 数据字典(只读台账) | `*/dict` | `pages/DictList.jsx` | 只读字典类型列表,展开行按 `dict_code` 实时拉字典项 |\n| 接口台账 | `*/interface` | `pages/InterfaceList.jsx` | 只读业务接口清单(基座 `PagedTable`) |\n| 私有配置 | `*/private-config` | `pages/PrivateConfigList.jsx` | 只读应用私有键值配置(基座 `PagedTable`) |\n| 业务模型 | `*/models` | `pages/BizModels.jsx` | 只读结构化业务模型清单(含字段数) |\n| 组件文档 | `docs` | `pages/ComponentDoc.jsx` | 本文件渲染页(左侧 240px TOC + 右侧正文) |\n\n`src/pages/MetaApp.jsx` 是只读台账一组的子路由挂载点(`app` / `tenant` / `dict` / `interface` /\n`private-config` / `models`),被 `routes` 里的 `/z-meta/:rest*` 承接,同时从包根具名导出。\n\n> ⚠ **两套同名页面并存**:manifest 里 `/z-meta/tenant`、`/z-meta/app`、`/z-meta/dict`、`/z-meta/api`\n> 挂的是 `pages/{tenant,application,dict,api}/` 下的**可写 CRUD 版**;`MetaApp` 里的\n> `app` / `tenant` / `dict` 挂的是 `pages/` 根目录下的**只读台账版**。路由不同、行为不同,别混。\n\n## 二、导出面\n\n```js\n// 主入口(. 桶)\nimport {configureMeta, MetaApp, ComponentDocPage} from '@yuku123/z-meta-component'\n\n// 宿主组装面(./pages 桶)\nimport {menuItems, routes, HomePage, LoginPage, Dashboard} from '@yuku123/z-meta-component/pages'\n```\n\n`./pages` 桶 = `export * from './pages-manifest.jsx'` 的整份转发 + `configureMeta` 再导出。\n**不要再手挑名字** —— 之前手挑过一次,manifest 新增的 `HomePage` / `LoginPage` 没被转发,\nrollup 直接报 `LoginPage is not exported by dist/pages.js`。\n\n## 三、API 端点\n\n`src/services/api.js` 的 `metaApi`(下表是代码里写的路径,请求实例 `baseURL='/meta'`):\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/meta-app/list` | 应用列表(query `pageNum` / `pageSize`) |\n| GET | `/meta-app/get` | 应用详情(query `id`) |\n| GET | `/meta-tenant/list` | 租户列表(query `pageNum` / `pageSize`) |\n| GET | `/dict/type/list` | 字典类型列表(query `pageNum` / `pageSize` / `dictName`) |\n| GET | `/dict/items/get` | 按 `dict_code` 取字典项(query `dictCode`) |\n| GET | `/dict/item/list` | 按字典类型 id 取字典项(query `dictId`) |\n| GET | `/interface/list` | 接口台账列表 |\n| GET | `/interface/app/list` | 按应用查接口(query `appId`) |\n| GET | `/private-config/list` | 私有配置列表 |\n| GET | `/meta/models` | 业务模型清单 |\n\n可写 CRUD 版页面(`pages/{tenant,application,dict,api}/`)不走 `metaApi`,而是直接用\n`services/request.js` 的实例,路径如下:\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/tenant/list` | 租户列表 |\n| POST | `/tenant` | 新建租户 |\n| PUT | `/tenant/{id}` | 修改租户 |\n| DELETE | `/tenant/{id}` | 删除租户 |\n| GET | `/app/list` | 应用列表 |\n| POST | `/app` | 新建应用 |\n| PUT | `/app/{id}` | 修改应用 |\n| DELETE | `/app/{id}` | 删除应用 |\n| GET | `/interface/list` | 接口列表 |\n| POST | `/interface` | 新建接口 |\n| PUT | `/interface/{id}` | 修改接口 |\n| DELETE | `/interface/{id}` | 删除接口 |\n| GET | `/dict/type/list` | 字典类型列表 |\n| POST | `/dict/type` | 新建字典类型 |\n| PUT | `/dict/type/{id}` | 修改字典类型 |\n| DELETE | `/dict/type/{id}` | 删除字典类型 |\n| GET | `/dict/item/list` | 字典项列表 |\n| POST | `/dict/item` | 新建字典项 |\n| PUT | `/dict/item/{id}` | 修改字典项 |\n| DELETE | `/dict/item/{id}` | 删除字典项 |\n\n## 四、页面说明\n\n### 4.1 概览\n\n四张统计卡(租户数量 / 应用数量 / 字典数量 / 接口数量)。⚠ 当前卡里的数值是**写死的占位值**\n(租户 1、其余 0),不接后端 —— 展示真实数值的页面是 `MetaApp` 下的只读台账。\n\n### 4.2 租户 / 应用 / 接口管理(可写)\n\n标准台账页:列表 + 新建 / 编辑弹窗 + 删除(`Popconfirm` 二次确认)。列表统一用基座 `ListTable`。\n\n### 4.3 字典管理(可写)\n\n两级结构:字典类型为父行,字典项按类型展开。类型与字典项各自支持增删改查。\n\n### 4.4 只读台账一组\n\n`pages/AppList.jsx` / `TenantList.jsx` / `InterfaceList.jsx` / `PrivateConfigList.jsx` /\n`BizModels.jsx` 都是基座 `PagedTable` 的薄用法:给 `title` / `description` / `load` / `columns` 即可。\n`description` 里写明了各自的数据源端点,方便排查。\n\n### 4.5 数据字典(只读台账)\n\n字典类型列表,展开行按 `dict_code` 实时拉字典项(`GET /dict/type/list` + `GET /dict/items/get`)。\n\n### 4.6 业务模型\n\n结构化业务模型清单,`fields` 一次性返回,表格里用 `(r.fields || []).length` 显示字段数。\n\n### 4.7 组件文档\n\n本文件。内容以 `?raw` 在编译期内联,零额外请求;左侧 240px TOC 随滚动联动。\n\n## 五、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| `configureMeta({apiBase})` | `'/meta'` | 改写请求实例的 `baseURL`,宿主换挂载前缀时用 |\n| token 存储键 | `token` | 基座默认键,token 注入与 401 处理统一走共享拦截器 |\n| 鉴权头 | `Authorization: Bearer` | 基座拦截器自动附加 |\n\n## 六、已知限制\n\n- **同名两套页面**(可写 CRUD 版 vs 只读台账版)并存,改动前先确认改的是哪一套,路由前缀不同。\n- 概览页的统计数字是写死的占位值,不是实时数据。\n- `api.js` 里 `metaApi` 的路径带了 `meta-` 段(如 `/meta-app/list`),叠加请求实例的 `baseURL='/meta'`\n 后实际请求路径是 `/meta/meta-app/list`;而 CRUD 页直连的路径是 `/meta/app/list`。\n 两套路径口径不同,**与后端真实路由的对应关系建议实测核对一次**(`api.js` 顶注称这些路径\n 已在 2026-09-24 用 `/actuator/mappings` 核对过)。\n- `metaApi` 里没有删除 / 更新方法,写操作全在页面里直连 request —— 收口 API 层时要一并搬。\n- `api/ApiList.jsx` 仍用 antd 静态 `message`(antd 6 会告警),未迁到 `App.useApp()`。\n- 组件包必须 external 基座;`vite.config.js` 的 `external` 是**精确字符串匹配**,\n `@yuku123/z-frontend-common/ui` 与 `/ui/echarts` 两个子路径必须逐个列出,漏一个基座就会被复制进 dist。\n\n## 七、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 0.1.1 | 新增组件文档页 `ComponentDocPage`(lead 008 §7):`src/DOC.md` + 基座 `ComponentDoc` 薄包装 |\n| 0.1.0 | 首版:元数据中心页面集 + manifest + 自洽 request |\n";
|
|
555
|
+
function Ne() {
|
|
556
|
+
return /* @__PURE__ */ n.jsx(me, { markdown: Pe, title: "组件文档 — z-meta" });
|
|
557
|
+
}
|
|
558
|
+
export {
|
|
559
|
+
Ne as C,
|
|
560
|
+
ze as M,
|
|
561
|
+
Ce as c,
|
|
562
|
+
n as j,
|
|
563
|
+
u as r
|
|
564
|
+
};
|
package/dist/index.js
CHANGED