@yuku123/z-meta-component 0.1.0 → 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.
@@ -1,865 +0,0 @@
1
- import pe, { useState as $, useCallback as me, useEffect as te } from "react";
2
- import { useNavigate as xe, Routes as ye, Route as E, Navigate as he } from "react-router-dom";
3
- import { Card as ge, Table as G, Button as U, Breadcrumb as _e, Tag as x, Alert as be, Tooltip as ke, Typography as je } from "antd";
4
- import { createRequest as ve } from "@yuku123/z-frontend-common";
5
- import { ReloadOutlined as re, ExclamationCircleOutlined as we, InboxOutlined as Te } from "@ant-design/icons";
6
- const b = ve({ baseURL: "/meta" });
7
- function Ue(t) {
8
- t && t.apiBase !== void 0 && (b.defaults.baseURL = t.apiBase);
9
- }
10
- var L = { exports: {} }, z = {};
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 Z;
21
- function Ee() {
22
- if (Z) return z;
23
- Z = 1;
24
- var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
25
- function o(c, s, f) {
26
- var y = null;
27
- if (f !== void 0 && (y = "" + f), s.key !== void 0 && (y = "" + s.key), "key" in s) {
28
- f = {};
29
- for (var i in s)
30
- i !== "key" && (f[i] = s[i]);
31
- } else f = s;
32
- return s = f.ref, {
33
- $$typeof: t,
34
- type: c,
35
- key: y,
36
- ref: s !== void 0 ? s : null,
37
- props: f
38
- };
39
- }
40
- return z.Fragment = a, z.jsx = o, z.jsxs = o, z;
41
- }
42
- var N = {};
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 Q;
53
- function Re() {
54
- return Q || (Q = 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 === ce ? null : e.displayName || e.name || null;
59
- if (typeof e == "string") return e;
60
- switch (e) {
61
- case S:
62
- return "Fragment";
63
- case C:
64
- return "Profiler";
65
- case h:
66
- return "StrictMode";
67
- case ie:
68
- return "Suspense";
69
- case le:
70
- return "SuspenseList";
71
- case se:
72
- return "Activity";
73
- case de:
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 I:
81
- return "Portal";
82
- case M:
83
- return e.displayName || "Context";
84
- case g:
85
- return (e._context.displayName || "Context") + ".Consumer";
86
- case ne:
87
- var n = e.render;
88
- return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
89
- case oe:
90
- return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
91
- case Y:
92
- n = e._payload, e = e._init;
93
- try {
94
- return t(e(n));
95
- } catch {
96
- }
97
- }
98
- return null;
99
- }
100
- function a(e) {
101
- return "" + e;
102
- }
103
- function o(e) {
104
- try {
105
- a(e);
106
- var n = !1;
107
- } catch {
108
- n = !0;
109
- }
110
- if (n) {
111
- n = console;
112
- var u = n.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
113
- return u.call(
114
- n,
115
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
116
- p
117
- ), a(e);
118
- }
119
- }
120
- function c(e) {
121
- if (e === S) return "<>";
122
- if (typeof e == "object" && e !== null && e.$$typeof === Y)
123
- return "<...>";
124
- try {
125
- var n = t(e);
126
- return n ? "<" + n + ">" : "<...>";
127
- } catch {
128
- return "<...>";
129
- }
130
- }
131
- function s() {
132
- var e = B.A;
133
- return e === null ? null : e.getOwner();
134
- }
135
- function f() {
136
- return Error("react-stack-top-frame");
137
- }
138
- function y(e) {
139
- if (q.call(e, "key")) {
140
- var n = Object.getOwnPropertyDescriptor(e, "key").get;
141
- if (n && n.isReactWarning) return !1;
142
- }
143
- return e.key !== void 0;
144
- }
145
- function i(e, n) {
146
- function u() {
147
- J || (J = !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
- n
150
- ));
151
- }
152
- u.isReactWarning = !0, Object.defineProperty(e, "key", {
153
- get: u,
154
- configurable: !0
155
- });
156
- }
157
- function d() {
158
- var e = t(this.type);
159
- return V[e] || (V[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 l(e, n, u, p, v, k) {
164
- var m = u.ref;
165
- return e = {
166
- $$typeof: O,
167
- type: e,
168
- key: n,
169
- props: u,
170
- _owner: p
171
- }, (m !== void 0 ? m : null) !== null ? Object.defineProperty(e, "ref", {
172
- enumerable: !1,
173
- get: d
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: v
189
- }), Object.defineProperty(e, "_debugTask", {
190
- configurable: !1,
191
- enumerable: !1,
192
- writable: !0,
193
- value: k
194
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
195
- }
196
- function _(e, n, u, p, v, k) {
197
- var m = n.children;
198
- if (m !== void 0)
199
- if (p)
200
- if (ue(m)) {
201
- for (p = 0; p < m.length; p++)
202
- j(m[p]);
203
- Object.freeze && Object.freeze(m);
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 j(m);
209
- if (q.call(n, "key")) {
210
- m = t(e);
211
- var A = Object.keys(n).filter(function(fe) {
212
- return fe !== "key";
213
- });
214
- p = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", K[m + p] || (A = 0 < A.length ? "{" + A.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
- p,
222
- m,
223
- A,
224
- m
225
- ), K[m + p] = !0);
226
- }
227
- if (m = null, u !== void 0 && (o(u), m = "" + u), y(n) && (o(n.key), m = "" + n.key), "key" in n) {
228
- u = {};
229
- for (var F in n)
230
- F !== "key" && (u[F] = n[F]);
231
- } else u = n;
232
- return m && i(
233
- u,
234
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
235
- ), l(
236
- e,
237
- m,
238
- u,
239
- s(),
240
- v,
241
- k
242
- );
243
- }
244
- function j(e) {
245
- w(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === Y && (e._payload.status === "fulfilled" ? w(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
246
- }
247
- function w(e) {
248
- return typeof e == "object" && e !== null && e.$$typeof === O;
249
- }
250
- var T = pe, O = Symbol.for("react.transitional.element"), I = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), M = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), ie = Symbol.for("react.suspense"), le = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), se = Symbol.for("react.activity"), de = Symbol.for("react.view_transition"), ce = Symbol.for("react.client.reference"), B = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, ue = Array.isArray, D = console.createTask ? console.createTask : function() {
251
- return null;
252
- };
253
- T = {
254
- react_stack_bottom_frame: function(e) {
255
- return e();
256
- }
257
- };
258
- var J, V = {}, H = T.react_stack_bottom_frame.bind(
259
- T,
260
- f
261
- )(), X = D(c(f)), K = {};
262
- N.Fragment = S, N.jsx = function(e, n, u) {
263
- var p = 1e4 > B.recentlyCreatedOwnerStacks++;
264
- if (p) {
265
- var v = Error.stackTraceLimit;
266
- Error.stackTraceLimit = 10;
267
- var k = Error("react-stack-top-frame");
268
- Error.stackTraceLimit = v;
269
- } else k = H;
270
- return _(
271
- e,
272
- n,
273
- u,
274
- !1,
275
- k,
276
- p ? D(c(e)) : X
277
- );
278
- }, N.jsxs = function(e, n, u) {
279
- var p = 1e4 > B.recentlyCreatedOwnerStacks++;
280
- if (p) {
281
- var v = Error.stackTraceLimit;
282
- Error.stackTraceLimit = 10;
283
- var k = Error("react-stack-top-frame");
284
- Error.stackTraceLimit = v;
285
- } else k = H;
286
- return _(
287
- e,
288
- n,
289
- u,
290
- !0,
291
- k,
292
- p ? D(c(e)) : X
293
- );
294
- };
295
- })()), N;
296
- }
297
- var ee;
298
- function Ie() {
299
- return ee || (ee = 1, process.env.NODE_ENV === "production" ? L.exports = Ee() : L.exports = Re()), L.exports;
300
- }
301
- var r = Ie();
302
- const R = {
303
- appPage: (t, a) => b.get("/meta-app/list", { params: { pageNum: t, pageSize: a } }),
304
- appGet: (t) => b.get("/meta-app/get", { params: { id: t } }),
305
- tenantPage: (t, a) => b.get("/meta-tenant/list", { params: { pageNum: t, pageSize: a } }),
306
- dictTypePage: (t, a, o) => b.get("/dict/type/list", { params: { pageNum: t, pageSize: a, dictName: o } }),
307
- dictItemsByCode: (t) => b.get("/dict/items/get", { params: { dictCode: t } }),
308
- dictItemsByTypeId: (t) => b.get("/dict/item/list", { params: { dictId: t } }),
309
- interfacePage: (t, a) => b.get("/interface/list", { params: { pageNum: t, pageSize: a } }),
310
- interfaceByApp: (t) => b.get("/interface/app/list", { params: { appId: t } }),
311
- privateConfigPage: (t, a) => b.get("/private-config/list", { params: { pageNum: t, pageSize: a } }),
312
- bizModels: () => b.get("/meta/models")
313
- }, W = {
314
- // 卡片表面
315
- surfaceAlt: "#fafbfc",
316
- // 次级表面 (表格 hover 等)
317
- border: "#e5e7eb",
318
- text: "#111827",
319
- // 主文本
320
- textMuted: "#6b7280"
321
- }, ae = {
322
- md: 12
323
- };
324
- function Se({
325
- icon: t,
326
- title: a = "暂无数据",
327
- description: o,
328
- actionText: c,
329
- onAction: s,
330
- size: f = "md",
331
- style: y
332
- }) {
333
- const i = { sm: 24, md: 40, lg: 64 }, d = { sm: 14, md: 16, lg: 20 };
334
- return /* @__PURE__ */ r.jsxs(
335
- "div",
336
- {
337
- role: "status",
338
- "aria-live": "polite",
339
- style: {
340
- padding: i[f] || i.md,
341
- textAlign: "center",
342
- background: "#ffffff",
343
- borderRadius: ae.md,
344
- border: "1px dashed #e5e7eb",
345
- ...y
346
- },
347
- children: [
348
- /* @__PURE__ */ r.jsx("div", { style: {
349
- display: "inline-flex",
350
- alignItems: "center",
351
- justifyContent: "center",
352
- width: 56,
353
- height: 56,
354
- borderRadius: "50%",
355
- background: W.surfaceAlt,
356
- marginBottom: 16,
357
- fontSize: 28,
358
- color: "#9ca3af"
359
- }, children: t || /* @__PURE__ */ r.jsx(Te, {}) }),
360
- /* @__PURE__ */ r.jsx("div", { style: {
361
- fontSize: d[f],
362
- fontWeight: 600,
363
- color: W.text,
364
- marginBottom: o ? 6 : 16
365
- }, children: a }),
366
- o && /* @__PURE__ */ r.jsx("div", { style: {
367
- fontSize: 13,
368
- color: W.textMuted,
369
- lineHeight: 1.6,
370
- maxWidth: 360,
371
- margin: "0 auto 16px"
372
- }, children: o }),
373
- c && s && /* @__PURE__ */ r.jsx(
374
- U,
375
- {
376
- type: "primary",
377
- onClick: s,
378
- style: {
379
- background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)",
380
- border: "none",
381
- minHeight: 36
382
- },
383
- children: c
384
- }
385
- )
386
- ]
387
- }
388
- );
389
- }
390
- function Ae({
391
- error: t,
392
- title: a = "加载失败",
393
- description: o,
394
- onRetry: c,
395
- retryText: s = "重新加载",
396
- variant: f = "inline",
397
- style: y
398
- }) {
399
- var i;
400
- const d = f === "full", l = (i = t == null ? void 0 : t.response) == null ? void 0 : i.data, _ = l && typeof l == "object" && (typeof l.message == "string" && l.message || typeof l.msg == "string" && l.msg) || null, j = _ || (typeof t == "string" ? t : (t == null ? void 0 : t.message) || (t == null ? void 0 : t.msg) || (t ? String(t) : null)), w = o || (_ ? `原因: ${_}` : j ? `原因: ${j}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
401
- return /* @__PURE__ */ r.jsxs(
402
- "div",
403
- {
404
- role: "alert",
405
- "aria-live": "assertive",
406
- style: {
407
- padding: d ? "48px 24px" : "20px 24px",
408
- background: d ? "#ffffff" : "#fef2f2",
409
- border: d ? `1px dashed ${W.border}` : "1px solid #fecaca",
410
- borderRadius: ae.md,
411
- textAlign: d ? "center" : "left",
412
- display: "flex",
413
- flexDirection: d ? "column" : "row",
414
- alignItems: d ? "center" : "flex-start",
415
- gap: d ? 12 : 16,
416
- ...y
417
- },
418
- children: [
419
- /* @__PURE__ */ r.jsx("div", { style: {
420
- display: "inline-flex",
421
- alignItems: "center",
422
- justifyContent: "center",
423
- width: d ? 56 : 36,
424
- height: d ? 56 : 36,
425
- borderRadius: "50%",
426
- background: d ? "#fef2f2" : "#ffffff",
427
- color: "#dc2626",
428
- fontSize: d ? 28 : 18,
429
- flexShrink: 0
430
- }, children: /* @__PURE__ */ r.jsx(we, {}) }),
431
- /* @__PURE__ */ r.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
432
- /* @__PURE__ */ r.jsx("div", { style: {
433
- fontSize: d ? 16 : 14,
434
- fontWeight: 600,
435
- color: "#991b1b",
436
- marginBottom: 4
437
- }, children: a }),
438
- /* @__PURE__ */ r.jsx("div", { style: {
439
- fontSize: 13,
440
- color: "#7f1d1d",
441
- lineHeight: 1.6,
442
- wordBreak: "break-word"
443
- }, children: w }),
444
- c && /* @__PURE__ */ r.jsx(
445
- U,
446
- {
447
- type: "primary",
448
- danger: !0,
449
- icon: /* @__PURE__ */ r.jsx(re, {}),
450
- onClick: c,
451
- size: d ? "middle" : "small",
452
- style: { marginTop: 12 },
453
- children: s
454
- }
455
- )
456
- ] })
457
- ]
458
- }
459
- );
460
- }
461
- function Pe({
462
- title: t,
463
- subtitle: a,
464
- breadcrumb: o,
465
- extra: c,
466
- back: s,
467
- onBack: f
468
- }) {
469
- const y = xe();
470
- return /* @__PURE__ */ r.jsx("div", { style: {
471
- marginBottom: 12,
472
- paddingBottom: 10,
473
- borderBottom: "1px solid #f1f5f9"
474
- }, children: /* @__PURE__ */ r.jsxs("div", { style: {
475
- display: "flex",
476
- alignItems: "center",
477
- justifyContent: "space-between",
478
- gap: 12,
479
- flexWrap: "wrap"
480
- }, children: [
481
- /* @__PURE__ */ r.jsxs("div", { style: {
482
- display: "flex",
483
- alignItems: "center",
484
- gap: 10,
485
- minWidth: 0,
486
- flexWrap: "wrap"
487
- }, children: [
488
- s && /* @__PURE__ */ r.jsx(
489
- "button",
490
- {
491
- onClick: () => {
492
- f ? f() : y(-1);
493
- },
494
- "aria-label": "返回上一页",
495
- style: {
496
- width: 28,
497
- height: 28,
498
- borderRadius: 6,
499
- border: "1px solid #e5e7eb",
500
- background: "#ffffff",
501
- color: "#6b7280",
502
- cursor: "pointer",
503
- display: "inline-flex",
504
- alignItems: "center",
505
- justifyContent: "center",
506
- fontSize: 13,
507
- transition: "all 150ms ease",
508
- flexShrink: 0
509
- },
510
- onMouseEnter: (i) => {
511
- i.currentTarget.style.background = "#f8fafc", i.currentTarget.style.color = "#111827", i.currentTarget.style.borderColor = "#7c3aed";
512
- },
513
- onMouseLeave: (i) => {
514
- i.currentTarget.style.background = "#ffffff", i.currentTarget.style.color = "#6b7280", i.currentTarget.style.borderColor = "#e5e7eb";
515
- },
516
- children: "←"
517
- }
518
- ),
519
- o && o.length > 0 ? /* @__PURE__ */ r.jsx(
520
- _e,
521
- {
522
- items: o.map((i, d) => {
523
- const l = d === o.length - 1;
524
- return {
525
- title: i.href && !l ? /* @__PURE__ */ r.jsx("a", { onClick: (_) => {
526
- _.preventDefault(), y(i.href);
527
- }, children: i.label }) : /* @__PURE__ */ r.jsx("span", { style: l ? {
528
- fontWeight: 600,
529
- color: "#111827"
530
- } : void 0, children: i.label })
531
- };
532
- })
533
- }
534
- ) : t && /* @__PURE__ */ r.jsx("span", { role: "heading", "aria-level": 1, style: {
535
- fontSize: 15,
536
- fontWeight: 600,
537
- color: "#111827",
538
- lineHeight: 1.4
539
- }, children: t }),
540
- a && /* @__PURE__ */ r.jsx("span", { title: a, style: {
541
- fontSize: 12,
542
- color: "#94a3b8",
543
- lineHeight: 1.4,
544
- whiteSpace: "nowrap",
545
- overflow: "hidden",
546
- textOverflow: "ellipsis",
547
- maxWidth: 360
548
- }, children: a })
549
- ] }),
550
- c && /* @__PURE__ */ r.jsx("div", { style: {
551
- display: "flex",
552
- gap: 8,
553
- flexShrink: 0
554
- }, children: c })
555
- ] }) });
556
- }
557
- function P({ title: t, description: a, load: o, columns: c, rowKey: s = "id", extra: f, expandable: y }) {
558
- const [i, d] = $([]), [l, _] = $({ current: 1, size: 10, total: null }), [j, w] = $(!1), [T, O] = $(null), I = me(async (h = l.current, C = l.size) => {
559
- w(!0), O(null);
560
- try {
561
- const g = await o(h, C);
562
- if (Array.isArray(g))
563
- d(g || []), _({ current: h, size: C, total: g.length });
564
- else {
565
- const M = (g == null ? void 0 : g.records) || [];
566
- d(M), _({ current: h, size: C, total: (g == null ? void 0 : g.total) == null ? null : Number(g.total) });
567
- }
568
- } catch (g) {
569
- d([]), O(g);
570
- } finally {
571
- w(!1);
572
- }
573
- }, [o, l.current, l.size]);
574
- te(() => {
575
- I(1);
576
- }, []);
577
- const S = l.total != null && l.total > 0;
578
- return /* @__PURE__ */ r.jsxs("div", { children: [
579
- /* @__PURE__ */ r.jsx(Pe, { title: t, subtitle: a }),
580
- /* @__PURE__ */ r.jsxs(
581
- ge,
582
- {
583
- extra: /* @__PURE__ */ r.jsx(
584
- U,
585
- {
586
- icon: /* @__PURE__ */ r.jsx(re, {}),
587
- loading: j,
588
- onClick: () => I(l.current, l.size),
589
- children: "刷新"
590
- }
591
- ),
592
- children: [
593
- f,
594
- T ? /* @__PURE__ */ r.jsx(Ae, { error: T, onRetry: () => I(l.current, l.size), type: "inline" }) : /* @__PURE__ */ r.jsx(
595
- G,
596
- {
597
- size: "small",
598
- columns: c,
599
- dataSource: i,
600
- loading: j,
601
- rowKey: (h) => (h == null ? void 0 : h[s]) ?? (h == null ? void 0 : h.key) ?? JSON.stringify(h).slice(0, 32),
602
- pagination: {
603
- current: l.current,
604
- pageSize: l.size,
605
- total: S ? l.total : i.length,
606
- showSizeChanger: !0,
607
- showTotal: () => S ? `共 ${l.total} 条` : `本页 ${i.length} 条(接口 total 未返回有效值)`
608
- },
609
- onChange: (h) => I(h.current, h.pageSize),
610
- expandable: y,
611
- locale: { emptyText: /* @__PURE__ */ r.jsx(Se, { title: "暂无数据", description: "接口返回空列表" }) }
612
- }
613
- )
614
- ]
615
- }
616
- )
617
- ] });
618
- }
619
- const Oe = (t) => t === 1 ? /* @__PURE__ */ r.jsx(x, { color: "success", children: "启用" }) : /* @__PURE__ */ r.jsx(x, { color: "default", children: "停用" });
620
- function Ce() {
621
- return /* @__PURE__ */ r.jsx(
622
- P,
623
- {
624
- title: "应用元数据",
625
- description: "z-meta 登记在册的应用(数据源 GET /api/meta-app/list)",
626
- load: (t, a) => R.appPage(t, a),
627
- columns: [
628
- { title: "应用编码", dataIndex: "app_code", key: "app_code", width: 180 },
629
- { title: "应用名称", dataIndex: "app_name", key: "app_name" },
630
- { title: "类型", dataIndex: "app_type", key: "app_type", width: 100, render: (t) => /* @__PURE__ */ r.jsx(x, { children: t }) },
631
- {
632
- title: "入口地址",
633
- dataIndex: "base_url",
634
- key: "base_url",
635
- ellipsis: !0,
636
- render: (t) => t || "-"
637
- },
638
- { title: "负责人", dataIndex: "owner", key: "owner", width: 110 },
639
- { title: "状态", dataIndex: "status", key: "status", width: 90, render: Oe },
640
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
641
- { title: "创建时间", dataIndex: "gmt_create", key: "gmt_create", width: 170 }
642
- ]
643
- }
644
- );
645
- }
646
- function ze() {
647
- return /* @__PURE__ */ r.jsx(
648
- P,
649
- {
650
- title: "租户管理",
651
- description: "z-meta 租户台账(数据源 GET /api/meta-tenant/list)",
652
- load: (t, a) => R.tenantPage(t, a),
653
- columns: [
654
- { title: "租户编码", dataIndex: "tenant_code", key: "tenant_code", width: 160 },
655
- { title: "租户名称", dataIndex: "tenant_name", key: "tenant_name" },
656
- {
657
- title: "类型",
658
- dataIndex: "tenant_type",
659
- key: "tenant_type",
660
- width: 110,
661
- render: (t) => t ? /* @__PURE__ */ r.jsx(x, { children: t }) : "-"
662
- },
663
- {
664
- title: "状态",
665
- dataIndex: "status",
666
- key: "status",
667
- width: 90,
668
- render: (t) => t === 1 ? /* @__PURE__ */ r.jsx(x, { color: "success", children: "正常" }) : /* @__PURE__ */ r.jsx(x, { children: "停用" })
669
- },
670
- { title: "到期时间", dataIndex: "expire_time", key: "expire_time", width: 170, render: (t) => t || "长期" },
671
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
672
- { title: "创建时间", dataIndex: "gmt_create", key: "gmt_create", width: 170 }
673
- ]
674
- }
675
- );
676
- }
677
- function Ne({ dictCode: t }) {
678
- const [a, o] = $({ loading: !0, rows: [], error: null });
679
- return te(() => {
680
- let c = !1;
681
- return o({ loading: !0, rows: [], error: null }), R.dictItemsByCode(t).then((s) => {
682
- c || o({ loading: !1, rows: s || [], error: null });
683
- }).catch((s) => {
684
- c || o({ loading: !1, rows: [], error: s });
685
- }), () => {
686
- c = !0;
687
- };
688
- }, [t]), a.error ? /* @__PURE__ */ r.jsx(
689
- be,
690
- {
691
- type: "error",
692
- showIcon: !0,
693
- message: `字典项加载失败:${a.error.message || a.error}`
694
- }
695
- ) : /* @__PURE__ */ r.jsx(
696
- G,
697
- {
698
- size: "small",
699
- rowKey: "id",
700
- loading: a.loading,
701
- dataSource: a.rows,
702
- pagination: !1,
703
- columns: [
704
- { title: "项编码", dataIndex: "item_code", key: "item_code", width: 180 },
705
- { title: "项名称", dataIndex: "item_name", key: "item_name" },
706
- { title: "值", dataIndex: "item_value", key: "item_value", width: 120 },
707
- { title: "排序", dataIndex: "sort_order", key: "sort_order", width: 80 },
708
- {
709
- title: "状态",
710
- dataIndex: "status",
711
- key: "status",
712
- width: 90,
713
- render: (c) => c === 1 ? /* @__PURE__ */ r.jsx(x, { color: "success", children: "启用" }) : /* @__PURE__ */ r.jsx(x, { children: "停用" })
714
- }
715
- ],
716
- locale: { emptyText: `字典 ${t} 下暂无字典项` }
717
- }
718
- );
719
- }
720
- function $e() {
721
- return /* @__PURE__ */ r.jsx(
722
- P,
723
- {
724
- title: "数据字典",
725
- description: "字典类型台账;展开行按 dict_code 实时拉取字典项(GET /api/dict/type/list + /api/dict/items/get)",
726
- load: (t, a) => R.dictTypePage(t, a),
727
- columns: [
728
- { title: "字典编码", dataIndex: "dict_code", key: "dict_code", width: 200 },
729
- { title: "字典名称", dataIndex: "dict_name", key: "dict_name" },
730
- {
731
- title: "值类型",
732
- dataIndex: "dict_type",
733
- key: "dict_type",
734
- width: 110,
735
- render: (t) => t ? /* @__PURE__ */ r.jsx(x, { children: t }) : "-"
736
- },
737
- {
738
- title: "状态",
739
- dataIndex: "status",
740
- key: "status",
741
- width: 90,
742
- render: (t) => t === 1 ? /* @__PURE__ */ r.jsx(x, { color: "success", children: "启用" }) : /* @__PURE__ */ r.jsx(x, { children: "停用" })
743
- },
744
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
745
- { title: "更新时间", dataIndex: "gmt_modified", key: "gmt_modified", width: 170 }
746
- ],
747
- expandable: {
748
- expandedRowRender: (t) => /* @__PURE__ */ r.jsx(Ne, { dictCode: t.dict_code }),
749
- rowExpandable: (t) => !!t.dict_code
750
- }
751
- }
752
- );
753
- }
754
- function Le() {
755
- return /* @__PURE__ */ r.jsx(
756
- P,
757
- {
758
- title: "接口台账",
759
- description: "z-meta 登记的业务接口清单(数据源 GET /api/interface/list)",
760
- load: (t, a) => R.interfacePage(t, a),
761
- columns: [
762
- { title: "接口名称", dataIndex: "api_name", key: "api_name" },
763
- { title: "方法", dataIndex: "api_method", key: "api_method", width: 90, render: (t) => /* @__PURE__ */ r.jsx(x, { children: t }) },
764
- { title: "路径", dataIndex: "api_path", key: "api_path", ellipsis: !0 },
765
- { title: "版本", dataIndex: "api_version", key: "api_version", width: 90 },
766
- { title: "鉴权", dataIndex: "auth_type", key: "auth_type", width: 120 },
767
- {
768
- title: "状态",
769
- key: "status",
770
- width: 120,
771
- render: (t, a) => a.deprecated === 1 ? /* @__PURE__ */ r.jsx(x, { color: "warning", children: "已废弃" }) : a.status === 1 ? /* @__PURE__ */ r.jsx(x, { color: "success", children: "启用" }) : /* @__PURE__ */ r.jsx(x, { children: "停用" })
772
- },
773
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 }
774
- ]
775
- }
776
- );
777
- }
778
- function We() {
779
- return /* @__PURE__ */ r.jsx(
780
- P,
781
- {
782
- title: "私有配置",
783
- description: "应用私有键值配置(数据源 GET /api/private-config/list)",
784
- load: (t, a) => R.privateConfigPage(t, a),
785
- columns: [
786
- { title: "配置键", dataIndex: "config_key", key: "config_key", width: 240 },
787
- {
788
- title: "配置值",
789
- dataIndex: "config_value",
790
- key: "config_value",
791
- ellipsis: !0,
792
- render: (t) => t ? /* @__PURE__ */ r.jsx(ke, { title: t, children: /* @__PURE__ */ r.jsx(je.Text, { code: !0, copyable: { text: t }, children: t }) }) : "-"
793
- },
794
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 },
795
- { title: "更新时间", dataIndex: "gmt_modified", key: "gmt_modified", width: 170 }
796
- ]
797
- }
798
- );
799
- }
800
- function Me() {
801
- return /* @__PURE__ */ r.jsx(
802
- P,
803
- {
804
- title: "业务模型",
805
- description: "z-meta 的结构化业务模型清单(数据源 GET /api/meta/models,字段随模型一次性返回)",
806
- load: () => R.bizModels(),
807
- rowKey: "code",
808
- columns: [
809
- { title: "模型编码", dataIndex: "code", key: "code", width: 200 },
810
- { title: "模型名称", dataIndex: "name", key: "name", width: 180 },
811
- {
812
- title: "所属模块",
813
- dataIndex: "module",
814
- key: "module",
815
- width: 160,
816
- render: (t) => /* @__PURE__ */ r.jsx(x, { color: "blue", children: t })
817
- },
818
- { title: "实体类", dataIndex: "class_name", key: "class_name", ellipsis: !0 },
819
- {
820
- title: "字段数",
821
- key: "fieldCount",
822
- width: 90,
823
- render: (t, a) => (a.fields || []).length
824
- },
825
- { title: "描述", dataIndex: "description", key: "description", ellipsis: !0 }
826
- ],
827
- expandable: {
828
- rowExpandable: (t) => (t.fields || []).length > 0,
829
- expandedRowRender: (t) => /* @__PURE__ */ r.jsx(
830
- G,
831
- {
832
- size: "small",
833
- rowKey: (a) => `${t.code}:${a.field_name}`,
834
- dataSource: t.fields || [],
835
- pagination: !1,
836
- columns: [
837
- { title: "字段名", dataIndex: "name", key: "name", width: 160 },
838
- { title: "属性", dataIndex: "field_name", key: "field_name", width: 200 },
839
- { title: "类型", dataIndex: "type", key: "type", width: 120, render: (a) => /* @__PURE__ */ r.jsx(x, { children: a }) },
840
- { title: "关联模型", dataIndex: "ref_model", key: "ref_model", render: (a) => a || "-" },
841
- { title: "字典", dataIndex: "dict_code", key: "dict_code", render: (a) => a || "-" }
842
- ]
843
- }
844
- )
845
- }
846
- }
847
- );
848
- }
849
- function qe() {
850
- return /* @__PURE__ */ r.jsxs(ye, { children: [
851
- /* @__PURE__ */ r.jsx(E, { index: !0, element: /* @__PURE__ */ r.jsx(he, { to: "app", replace: !0 }) }),
852
- /* @__PURE__ */ r.jsx(E, { path: "app", element: /* @__PURE__ */ r.jsx(Ce, {}) }),
853
- /* @__PURE__ */ r.jsx(E, { path: "tenant", element: /* @__PURE__ */ r.jsx(ze, {}) }),
854
- /* @__PURE__ */ r.jsx(E, { path: "dict", element: /* @__PURE__ */ r.jsx($e, {}) }),
855
- /* @__PURE__ */ r.jsx(E, { path: "interface", element: /* @__PURE__ */ r.jsx(Le, {}) }),
856
- /* @__PURE__ */ r.jsx(E, { path: "private-config", element: /* @__PURE__ */ r.jsx(We, {}) }),
857
- /* @__PURE__ */ r.jsx(E, { path: "models", element: /* @__PURE__ */ r.jsx(Me, {}) })
858
- ] });
859
- }
860
- export {
861
- qe as M,
862
- Ue as c,
863
- r as j,
864
- b as r
865
- };