@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
package/dist/pages.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { j as e, r as m,
|
|
2
|
-
import { c as
|
|
3
|
-
import { UserOutlined as H, LockOutlined as Z, AppstoreOutlined as ee, BookOutlined as te, ApiOutlined as ae, PlusOutlined as
|
|
1
|
+
import { j as e, r as m, C as ye, M as ge } from "./ComponentDoc-IVc3HvAO.js";
|
|
2
|
+
import { c as Ge } from "./ComponentDoc-IVc3HvAO.js";
|
|
3
|
+
import { UserOutlined as H, LockOutlined as Z, AppstoreOutlined as ee, BookOutlined as te, ApiOutlined as ae, PlusOutlined as q, EditOutlined as R, DeleteOutlined as K, HomeOutlined as fe, DashboardOutlined as Ie, ReadOutlined as be } from "@ant-design/icons";
|
|
4
4
|
import { useState as d, useEffect as _ } from "react";
|
|
5
5
|
import { useNavigate as ne } from "react-router-dom";
|
|
6
|
-
import { Card as D, Form as a, Input as l, Button as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { Card as D, Form as a, Input as l, Button as x, message as i, Row as se, Col as $, Statistic as J, Tag as ie, Select as I, Modal as U, Space as z, Popconfirm as B, Tabs as re, Typography as ke } from "antd";
|
|
7
|
+
import { ListTable as W } from "@yuku123/z-frontend-common/ui";
|
|
8
|
+
function Re() {
|
|
9
|
+
const j = ne(), [c, p] = d(!1), h = async (n) => {
|
|
10
|
+
p(!0);
|
|
10
11
|
try {
|
|
11
|
-
const
|
|
12
|
-
localStorage.setItem("token",
|
|
13
|
-
} catch (
|
|
14
|
-
|
|
12
|
+
const T = "mock-token-" + Date.now();
|
|
13
|
+
localStorage.setItem("token", T), localStorage.setItem("username", n.username), i.success("登录成功"), j("/z-meta/dashboard");
|
|
14
|
+
} catch (T) {
|
|
15
|
+
i.error(T.message || "登录失败");
|
|
15
16
|
} finally {
|
|
16
|
-
|
|
17
|
+
p(!1);
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
return /* @__PURE__ */ e.jsx("div", { className: "login-container", children: /* @__PURE__ */ e.jsx(D, { className: "login-card", title: "z-meta 元数据平台", bordered: !1, children: /* @__PURE__ */ e.jsxs(
|
|
20
21
|
a,
|
|
21
22
|
{
|
|
22
23
|
name: "login",
|
|
23
|
-
onFinish:
|
|
24
|
+
onFinish: h,
|
|
24
25
|
autoComplete: "off",
|
|
25
26
|
children: [
|
|
26
27
|
/* @__PURE__ */ e.jsx(
|
|
@@ -53,16 +54,16 @@ function Me() {
|
|
|
53
54
|
)
|
|
54
55
|
}
|
|
55
56
|
),
|
|
56
|
-
/* @__PURE__ */ e.jsx(a.Item, { children: /* @__PURE__ */ e.jsx(
|
|
57
|
+
/* @__PURE__ */ e.jsx(a.Item, { children: /* @__PURE__ */ e.jsx(x, { type: "primary", htmlType: "submit", loading: c, block: !0, size: "large", children: "登录" }) })
|
|
57
58
|
]
|
|
58
59
|
}
|
|
59
60
|
) }) });
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function we() {
|
|
62
63
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
63
64
|
/* @__PURE__ */ e.jsx("h1", { children: "欢迎使用 z-meta 元数据平台" }),
|
|
64
65
|
/* @__PURE__ */ e.jsxs(se, { gutter: 16, children: [
|
|
65
|
-
/* @__PURE__ */ e.jsx(
|
|
66
|
+
/* @__PURE__ */ e.jsx($, { span: 6, children: /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(
|
|
66
67
|
J,
|
|
67
68
|
{
|
|
68
69
|
title: "租户数量",
|
|
@@ -70,7 +71,7 @@ function be() {
|
|
|
70
71
|
prefix: /* @__PURE__ */ e.jsx(H, {})
|
|
71
72
|
}
|
|
72
73
|
) }) }),
|
|
73
|
-
/* @__PURE__ */ e.jsx(
|
|
74
|
+
/* @__PURE__ */ e.jsx($, { span: 6, children: /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(
|
|
74
75
|
J,
|
|
75
76
|
{
|
|
76
77
|
title: "应用数量",
|
|
@@ -78,7 +79,7 @@ function be() {
|
|
|
78
79
|
prefix: /* @__PURE__ */ e.jsx(ee, {})
|
|
79
80
|
}
|
|
80
81
|
) }) }),
|
|
81
|
-
/* @__PURE__ */ e.jsx(
|
|
82
|
+
/* @__PURE__ */ e.jsx($, { span: 6, children: /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(
|
|
82
83
|
J,
|
|
83
84
|
{
|
|
84
85
|
title: "字典类型",
|
|
@@ -86,7 +87,7 @@ function be() {
|
|
|
86
87
|
prefix: /* @__PURE__ */ e.jsx(te, {})
|
|
87
88
|
}
|
|
88
89
|
) }) }),
|
|
89
|
-
/* @__PURE__ */ e.jsx(
|
|
90
|
+
/* @__PURE__ */ e.jsx($, { span: 6, children: /* @__PURE__ */ e.jsx(D, { children: /* @__PURE__ */ e.jsx(
|
|
90
91
|
J,
|
|
91
92
|
{
|
|
92
93
|
title: "接口数量",
|
|
@@ -97,7 +98,7 @@ function be() {
|
|
|
97
98
|
] })
|
|
98
99
|
] });
|
|
99
100
|
}
|
|
100
|
-
const
|
|
101
|
+
const Te = {
|
|
101
102
|
active: "green",
|
|
102
103
|
1: "green",
|
|
103
104
|
true: "green",
|
|
@@ -114,52 +115,52 @@ const ke = {
|
|
|
114
115
|
false: "停用",
|
|
115
116
|
deleted: "已删除"
|
|
116
117
|
};
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
return /* @__PURE__ */ e.jsx(ie, { color:
|
|
118
|
+
function Ce({ status: j, tenantCode: c }) {
|
|
119
|
+
const p = String(j), h = Te[p] || "default", n = ve[p] || j;
|
|
120
|
+
return /* @__PURE__ */ e.jsx(ie, { color: h, children: c ? `${c} · ${n}` : n });
|
|
120
121
|
}
|
|
121
122
|
const { Option: M } = I;
|
|
122
|
-
function
|
|
123
|
-
const [j, c] = d([]), [
|
|
124
|
-
|
|
123
|
+
function De() {
|
|
124
|
+
const [j, c] = d([]), [p, h] = d(!1), [n, T] = d({ current: 1, pageSize: 10, total: 0 }), [S, u] = d(!1), [f, v] = d(null), [o] = a.useForm(), y = async (t = 1, r = 10) => {
|
|
125
|
+
h(!0);
|
|
125
126
|
try {
|
|
126
127
|
const b = await m.get("/tenant/list", {
|
|
127
128
|
params: { pageNum: t, pageSize: r }
|
|
128
129
|
});
|
|
129
|
-
c(b.data.records || []),
|
|
130
|
+
c(b.data.records || []), T({
|
|
130
131
|
current: t,
|
|
131
132
|
pageSize: r,
|
|
132
133
|
total: b.data.total || 0
|
|
133
134
|
});
|
|
134
135
|
} catch {
|
|
135
|
-
|
|
136
|
+
i.error("获取数据失败");
|
|
136
137
|
} finally {
|
|
137
|
-
|
|
138
|
+
h(!1);
|
|
138
139
|
}
|
|
139
140
|
};
|
|
140
141
|
_(() => {
|
|
141
142
|
y();
|
|
142
143
|
}, []);
|
|
143
|
-
const
|
|
144
|
+
const O = (t) => {
|
|
144
145
|
y(t.current, t.pageSize);
|
|
145
146
|
}, V = () => {
|
|
146
|
-
|
|
147
|
+
v(null), o.resetFields(), u(!0);
|
|
147
148
|
}, C = (t) => {
|
|
148
|
-
|
|
149
|
+
v(t), o.setFieldsValue(t), u(!0);
|
|
149
150
|
}, k = async (t) => {
|
|
150
151
|
try {
|
|
151
|
-
await m.delete(`/tenant/${t}`),
|
|
152
|
+
await m.delete(`/tenant/${t}`), i.success("删除成功"), y(n.current, n.pageSize);
|
|
152
153
|
} catch {
|
|
153
|
-
|
|
154
|
+
i.error("删除失败");
|
|
154
155
|
}
|
|
155
|
-
},
|
|
156
|
+
}, P = async () => {
|
|
156
157
|
try {
|
|
157
158
|
const t = await o.validateFields();
|
|
158
|
-
f ? (await m.put(`/tenant/${f.id}`, t),
|
|
159
|
+
f ? (await m.put(`/tenant/${f.id}`, t), i.success("更新成功")) : (await m.post("/tenant", t), i.success("创建成功")), u(!1), y(n.current, n.pageSize);
|
|
159
160
|
} catch {
|
|
160
|
-
|
|
161
|
+
i.error("操作失败");
|
|
161
162
|
}
|
|
162
|
-
},
|
|
163
|
+
}, E = [
|
|
163
164
|
{
|
|
164
165
|
title: "ID",
|
|
165
166
|
dataIndex: "id",
|
|
@@ -186,7 +187,7 @@ function Te() {
|
|
|
186
187
|
title: "状态",
|
|
187
188
|
dataIndex: "status",
|
|
188
189
|
key: "status",
|
|
189
|
-
render: (t) => /* @__PURE__ */ e.jsx(
|
|
190
|
+
render: (t) => /* @__PURE__ */ e.jsx(Ce, { status: t })
|
|
190
191
|
},
|
|
191
192
|
{
|
|
192
193
|
title: "描述",
|
|
@@ -201,32 +202,41 @@ function Te() {
|
|
|
201
202
|
{
|
|
202
203
|
title: "操作",
|
|
203
204
|
key: "action",
|
|
204
|
-
render: (t, r) => /* @__PURE__ */ e.jsxs(
|
|
205
|
-
/* @__PURE__ */ e.jsx(
|
|
206
|
-
/* @__PURE__ */ e.jsx(
|
|
205
|
+
render: (t, r) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
206
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", icon: /* @__PURE__ */ e.jsx(R, {}), onClick: () => C(r), children: "编辑" }),
|
|
207
|
+
/* @__PURE__ */ e.jsx(B, { title: "确定删除?", onConfirm: () => k(r.id), children: /* @__PURE__ */ e.jsx(x, { type: "link", danger: !0, icon: /* @__PURE__ */ e.jsx(K, {}), children: "删除" }) })
|
|
207
208
|
] })
|
|
208
209
|
}
|
|
209
210
|
];
|
|
210
211
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
211
|
-
/* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(p, { type: "primary", icon: /* @__PURE__ */ e.jsx($, {}), onClick: V, children: "新增租户" }) }),
|
|
212
212
|
/* @__PURE__ */ e.jsx(
|
|
213
|
-
|
|
213
|
+
W,
|
|
214
214
|
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
loading:
|
|
215
|
+
rows: j,
|
|
216
|
+
columns: E,
|
|
217
|
+
loading: p,
|
|
218
218
|
rowKey: "id",
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
searchKeys: "tenantCode,tenantName",
|
|
220
|
+
searchPlaceholder: "按租户编码 / 租户名称过滤",
|
|
221
|
+
cardExtra: /* @__PURE__ */ e.jsx(x, { type: "primary", icon: /* @__PURE__ */ e.jsx(q, {}), onClick: V, children: "新增租户" }),
|
|
222
|
+
pagination: {
|
|
223
|
+
...n,
|
|
224
|
+
showSizeChanger: !0,
|
|
225
|
+
pageSizeOptions: ["10", "20", "50", "100"],
|
|
226
|
+
showTotal: (t) => `共 ${t} 条`
|
|
227
|
+
},
|
|
228
|
+
onChange: O,
|
|
229
|
+
emptyTitle: "暂无租户",
|
|
230
|
+
emptyDescription: "当前没有租户,先点右上角「新增租户」建一个。"
|
|
221
231
|
}
|
|
222
232
|
),
|
|
223
233
|
/* @__PURE__ */ e.jsx(
|
|
224
|
-
|
|
234
|
+
U,
|
|
225
235
|
{
|
|
226
236
|
title: f ? "编辑租户" : "新增租户",
|
|
227
237
|
open: S,
|
|
228
|
-
onOk:
|
|
229
|
-
onCancel: () =>
|
|
238
|
+
onOk: P,
|
|
239
|
+
onCancel: () => u(!1),
|
|
230
240
|
width: 600,
|
|
231
241
|
children: /* @__PURE__ */ e.jsxs(a, { form: o, layout: "vertical", children: [
|
|
232
242
|
/* @__PURE__ */ e.jsx(
|
|
@@ -263,47 +273,47 @@ function Te() {
|
|
|
263
273
|
] });
|
|
264
274
|
}
|
|
265
275
|
const { Option: N } = I;
|
|
266
|
-
function
|
|
267
|
-
const [j, c] = d([]), [
|
|
268
|
-
|
|
276
|
+
function ze() {
|
|
277
|
+
const [j, c] = d([]), [p, h] = d(!1), [n, T] = d({ current: 1, pageSize: 10, total: 0 }), [S, u] = d(!1), [f, v] = d(null), [o] = a.useForm(), y = async (t = 1, r = 10) => {
|
|
278
|
+
h(!0);
|
|
269
279
|
try {
|
|
270
280
|
const b = await m.get("/app/list", {
|
|
271
281
|
params: { pageNum: t, pageSize: r }
|
|
272
282
|
});
|
|
273
|
-
c(b.data.records || []),
|
|
283
|
+
c(b.data.records || []), T({
|
|
274
284
|
current: t,
|
|
275
285
|
pageSize: r,
|
|
276
286
|
total: b.data.total || 0
|
|
277
287
|
});
|
|
278
288
|
} catch {
|
|
279
|
-
|
|
289
|
+
i.error("获取数据失败");
|
|
280
290
|
} finally {
|
|
281
|
-
|
|
291
|
+
h(!1);
|
|
282
292
|
}
|
|
283
293
|
};
|
|
284
294
|
_(() => {
|
|
285
295
|
y();
|
|
286
296
|
}, []);
|
|
287
|
-
const
|
|
297
|
+
const O = (t) => {
|
|
288
298
|
y(t.current, t.pageSize);
|
|
289
299
|
}, V = () => {
|
|
290
|
-
|
|
300
|
+
v(null), o.resetFields(), o.setFieldsValue({ status: 1, appType: "web" }), u(!0);
|
|
291
301
|
}, C = (t) => {
|
|
292
|
-
|
|
302
|
+
v(t), o.setFieldsValue(t), u(!0);
|
|
293
303
|
}, k = async (t) => {
|
|
294
304
|
try {
|
|
295
|
-
await m.delete(`/app/${t}`),
|
|
305
|
+
await m.delete(`/app/${t}`), i.success("删除成功"), y(n.current, n.pageSize);
|
|
296
306
|
} catch {
|
|
297
|
-
|
|
307
|
+
i.error("删除失败");
|
|
298
308
|
}
|
|
299
|
-
},
|
|
309
|
+
}, P = async () => {
|
|
300
310
|
try {
|
|
301
311
|
const t = await o.validateFields();
|
|
302
|
-
f ? (await m.put(`/app/${f.id}`, t),
|
|
312
|
+
f ? (await m.put(`/app/${f.id}`, t), i.success("更新成功")) : (await m.post("/app", t), i.success("创建成功")), u(!1), y(n.current, n.pageSize);
|
|
303
313
|
} catch {
|
|
304
|
-
|
|
314
|
+
i.error("操作失败");
|
|
305
315
|
}
|
|
306
|
-
},
|
|
316
|
+
}, E = [
|
|
307
317
|
{
|
|
308
318
|
title: "ID",
|
|
309
319
|
dataIndex: "id",
|
|
@@ -356,32 +366,41 @@ function Ce() {
|
|
|
356
366
|
{
|
|
357
367
|
title: "操作",
|
|
358
368
|
key: "action",
|
|
359
|
-
render: (t, r) => /* @__PURE__ */ e.jsxs(
|
|
360
|
-
/* @__PURE__ */ e.jsx(
|
|
361
|
-
/* @__PURE__ */ e.jsx(
|
|
369
|
+
render: (t, r) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
370
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", icon: /* @__PURE__ */ e.jsx(R, {}), onClick: () => C(r), children: "编辑" }),
|
|
371
|
+
/* @__PURE__ */ e.jsx(B, { title: "确定删除?", onConfirm: () => k(r.id), children: /* @__PURE__ */ e.jsx(x, { type: "link", danger: !0, icon: /* @__PURE__ */ e.jsx(K, {}), children: "删除" }) })
|
|
362
372
|
] })
|
|
363
373
|
}
|
|
364
374
|
];
|
|
365
375
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
366
|
-
/* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(p, { type: "primary", icon: /* @__PURE__ */ e.jsx($, {}), onClick: V, children: "新增应用" }) }),
|
|
367
376
|
/* @__PURE__ */ e.jsx(
|
|
368
|
-
|
|
377
|
+
W,
|
|
369
378
|
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
loading:
|
|
379
|
+
rows: j,
|
|
380
|
+
columns: E,
|
|
381
|
+
loading: p,
|
|
373
382
|
rowKey: "id",
|
|
374
|
-
|
|
375
|
-
|
|
383
|
+
searchKeys: "appCode,appName,appType",
|
|
384
|
+
searchPlaceholder: "按应用编码 / 名称 / 类型过滤",
|
|
385
|
+
cardExtra: /* @__PURE__ */ e.jsx(x, { type: "primary", icon: /* @__PURE__ */ e.jsx(q, {}), onClick: V, children: "新增应用" }),
|
|
386
|
+
pagination: {
|
|
387
|
+
...n,
|
|
388
|
+
showSizeChanger: !0,
|
|
389
|
+
pageSizeOptions: ["10", "20", "50", "100"],
|
|
390
|
+
showTotal: (t) => `共 ${t} 条`
|
|
391
|
+
},
|
|
392
|
+
onChange: O,
|
|
393
|
+
emptyTitle: "暂无应用",
|
|
394
|
+
emptyDescription: "当前没有应用,先点右上角「新增应用」建一个。"
|
|
376
395
|
}
|
|
377
396
|
),
|
|
378
397
|
/* @__PURE__ */ e.jsx(
|
|
379
|
-
|
|
398
|
+
U,
|
|
380
399
|
{
|
|
381
400
|
title: f ? "编辑应用" : "新增应用",
|
|
382
401
|
open: S,
|
|
383
|
-
onOk:
|
|
384
|
-
onCancel: () =>
|
|
402
|
+
onOk: P,
|
|
403
|
+
onCancel: () => u(!1),
|
|
385
404
|
width: 600,
|
|
386
405
|
children: /* @__PURE__ */ e.jsxs(a, { form: o, layout: "vertical", children: [
|
|
387
406
|
/* @__PURE__ */ e.jsx(
|
|
@@ -429,32 +448,32 @@ function Ce() {
|
|
|
429
448
|
)
|
|
430
449
|
] });
|
|
431
450
|
}
|
|
432
|
-
const { Option:
|
|
433
|
-
function
|
|
434
|
-
const [j, c] = d([]), [
|
|
435
|
-
|
|
451
|
+
const { Option: F } = I, { TabPane: Y } = re;
|
|
452
|
+
function Se() {
|
|
453
|
+
const [j, c] = d([]), [p, h] = d(!1), [n, T] = d({ current: 1, pageSize: 10, total: 0 }), [S, u] = d(!1), [f, v] = d(null), [o] = a.useForm(), [y, O] = d([]), [V, C] = d(!1), [k, P] = d(null), [E, t] = d(!1), [r, b] = d(null), [L] = a.useForm(), G = async (s = 1, g = 10) => {
|
|
454
|
+
h(!0);
|
|
436
455
|
try {
|
|
437
456
|
const X = await m.get("/dict/type/list", {
|
|
438
|
-
params: { pageNum:
|
|
457
|
+
params: { pageNum: s, pageSize: g }
|
|
439
458
|
});
|
|
440
|
-
c(X.data.records || []),
|
|
441
|
-
current:
|
|
459
|
+
c(X.data.records || []), T({
|
|
460
|
+
current: s,
|
|
442
461
|
pageSize: g,
|
|
443
462
|
total: X.data.total || 0
|
|
444
463
|
});
|
|
445
464
|
} catch {
|
|
446
|
-
|
|
465
|
+
i.error("获取字典类型失败");
|
|
447
466
|
} finally {
|
|
448
|
-
|
|
467
|
+
h(!1);
|
|
449
468
|
}
|
|
450
|
-
}, Q = async (
|
|
451
|
-
if (
|
|
452
|
-
C(!0),
|
|
469
|
+
}, Q = async (s) => {
|
|
470
|
+
if (s) {
|
|
471
|
+
C(!0), P(s);
|
|
453
472
|
try {
|
|
454
|
-
const g = await m.get(`/dict/item/${
|
|
455
|
-
|
|
473
|
+
const g = await m.get(`/dict/item/${s}`);
|
|
474
|
+
O(g.data || []);
|
|
456
475
|
} catch {
|
|
457
|
-
|
|
476
|
+
i.error("获取字典项失败");
|
|
458
477
|
} finally {
|
|
459
478
|
C(!1);
|
|
460
479
|
}
|
|
@@ -464,57 +483,57 @@ function De() {
|
|
|
464
483
|
G();
|
|
465
484
|
}, []);
|
|
466
485
|
const le = () => {
|
|
467
|
-
|
|
468
|
-
}, de = (
|
|
469
|
-
|
|
470
|
-
}, ce = async (
|
|
486
|
+
v(null), o.resetFields(), o.setFieldsValue({ status: 1, dictType: "custom" }), u(!0);
|
|
487
|
+
}, de = (s) => {
|
|
488
|
+
v(s), o.setFieldsValue(s), u(!0);
|
|
489
|
+
}, ce = async (s) => {
|
|
471
490
|
try {
|
|
472
|
-
await m.delete(`/dict/type/${
|
|
491
|
+
await m.delete(`/dict/type/${s}`), i.success("删除成功"), G(n.current, n.pageSize);
|
|
473
492
|
} catch {
|
|
474
|
-
|
|
493
|
+
i.error("删除失败");
|
|
475
494
|
}
|
|
476
495
|
}, oe = async () => {
|
|
477
496
|
try {
|
|
478
|
-
const
|
|
479
|
-
f ? (await m.put(`/dict/type/${f.id}`,
|
|
497
|
+
const s = await o.validateFields();
|
|
498
|
+
f ? (await m.put(`/dict/type/${f.id}`, s), i.success("更新成功")) : (await m.post("/dict/type", s), i.success("创建成功")), u(!1), G(n.current, n.pageSize);
|
|
480
499
|
} catch {
|
|
481
|
-
|
|
500
|
+
i.error("操作失败");
|
|
482
501
|
}
|
|
483
|
-
},
|
|
502
|
+
}, he = () => {
|
|
484
503
|
if (!k) {
|
|
485
|
-
|
|
504
|
+
i.warning("请先选择字典类型");
|
|
486
505
|
return;
|
|
487
506
|
}
|
|
488
507
|
b(null), L.resetFields(), L.setFieldsValue({ status: 1, dictId: k, sortOrder: 0 }), t(!0);
|
|
489
|
-
}, me = (
|
|
490
|
-
b(
|
|
491
|
-
},
|
|
508
|
+
}, me = (s) => {
|
|
509
|
+
b(s), L.setFieldsValue(s), t(!0);
|
|
510
|
+
}, ue = async (s) => {
|
|
492
511
|
try {
|
|
493
|
-
await m.delete(`/dict/item/${
|
|
512
|
+
await m.delete(`/dict/item/${s}`), i.success("删除成功"), Q(k);
|
|
494
513
|
} catch {
|
|
495
|
-
|
|
514
|
+
i.error("删除失败");
|
|
496
515
|
}
|
|
497
|
-
},
|
|
516
|
+
}, pe = async () => {
|
|
498
517
|
try {
|
|
499
|
-
const
|
|
500
|
-
r ? (await m.put(`/dict/item/${r.id}`,
|
|
518
|
+
const s = await L.validateFields();
|
|
519
|
+
r ? (await m.put(`/dict/item/${r.id}`, s), i.success("更新成功")) : (await m.post("/dict/item", s), i.success("创建成功")), t(!1), Q(k);
|
|
501
520
|
} catch {
|
|
502
|
-
|
|
521
|
+
i.error("操作失败");
|
|
503
522
|
}
|
|
504
|
-
},
|
|
523
|
+
}, xe = [
|
|
505
524
|
{ title: "ID", dataIndex: "id", key: "id", width: 60 },
|
|
506
525
|
{ title: "字典编码", dataIndex: "dictCode", key: "dictCode" },
|
|
507
526
|
{ title: "字典名称", dataIndex: "dictName", key: "dictName" },
|
|
508
|
-
{ title: "字典类型", dataIndex: "dictType", key: "dictType", render: (
|
|
509
|
-
{ title: "状态", dataIndex: "status", key: "status", render: (
|
|
527
|
+
{ title: "字典类型", dataIndex: "dictType", key: "dictType", render: (s) => s === "system" ? "系统" : "自定义" },
|
|
528
|
+
{ title: "状态", dataIndex: "status", key: "status", render: (s) => s === 1 ? "启用" : "禁用" },
|
|
510
529
|
{ title: "描述", dataIndex: "description", key: "description" },
|
|
511
530
|
{
|
|
512
531
|
title: "操作",
|
|
513
532
|
key: "action",
|
|
514
|
-
render: (
|
|
515
|
-
/* @__PURE__ */ e.jsx(
|
|
516
|
-
/* @__PURE__ */ e.jsx(
|
|
517
|
-
/* @__PURE__ */ e.jsx(
|
|
533
|
+
render: (s, g) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
534
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", onClick: () => Q(g.id), children: "查看项" }),
|
|
535
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", icon: /* @__PURE__ */ e.jsx(R, {}), onClick: () => de(g), children: "编辑" }),
|
|
536
|
+
/* @__PURE__ */ e.jsx(B, { title: "确定删除?", onConfirm: () => ce(g.id), children: /* @__PURE__ */ e.jsx(x, { type: "link", danger: !0, icon: /* @__PURE__ */ e.jsx(K, {}), children: "删除" }) })
|
|
518
537
|
] })
|
|
519
538
|
}
|
|
520
539
|
], je = [
|
|
@@ -523,83 +542,90 @@ function De() {
|
|
|
523
542
|
{ title: "字典项名称", dataIndex: "itemName", key: "itemName" },
|
|
524
543
|
{ title: "字典项值", dataIndex: "itemValue", key: "itemValue" },
|
|
525
544
|
{ title: "排序", dataIndex: "sortOrder", key: "sortOrder" },
|
|
526
|
-
{ title: "状态", dataIndex: "status", key: "status", render: (
|
|
545
|
+
{ title: "状态", dataIndex: "status", key: "status", render: (s) => s === 1 ? "启用" : "禁用" },
|
|
527
546
|
{
|
|
528
547
|
title: "操作",
|
|
529
548
|
key: "action",
|
|
530
|
-
render: (
|
|
531
|
-
/* @__PURE__ */ e.jsx(
|
|
532
|
-
/* @__PURE__ */ e.jsx(
|
|
549
|
+
render: (s, g) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
550
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", icon: /* @__PURE__ */ e.jsx(R, {}), onClick: () => me(g), children: "编辑" }),
|
|
551
|
+
/* @__PURE__ */ e.jsx(B, { title: "确定删除?", onConfirm: () => ue(g.id), children: /* @__PURE__ */ e.jsx(x, { type: "link", danger: !0, icon: /* @__PURE__ */ e.jsx(K, {}), children: "删除" }) })
|
|
533
552
|
] })
|
|
534
553
|
}
|
|
535
554
|
];
|
|
536
555
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
537
556
|
/* @__PURE__ */ e.jsxs(re, { defaultActiveKey: "1", children: [
|
|
538
|
-
/* @__PURE__ */ e.
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
557
|
+
/* @__PURE__ */ e.jsx(Y, { tab: "字典类型", children: /* @__PURE__ */ e.jsx(
|
|
558
|
+
W,
|
|
559
|
+
{
|
|
560
|
+
rows: j,
|
|
561
|
+
columns: xe,
|
|
562
|
+
loading: p,
|
|
563
|
+
rowKey: "id",
|
|
564
|
+
searchKeys: "dictCode,dictName",
|
|
565
|
+
searchPlaceholder: "按字典编码 / 名称过滤",
|
|
566
|
+
cardExtra: /* @__PURE__ */ e.jsx(x, { type: "primary", icon: /* @__PURE__ */ e.jsx(q, {}), onClick: le, children: "新增字典类型" }),
|
|
567
|
+
pagination: {
|
|
568
|
+
...n,
|
|
569
|
+
showSizeChanger: !0,
|
|
570
|
+
pageSizeOptions: ["10", "20", "50", "100"],
|
|
571
|
+
showTotal: (s) => `共 ${s} 条`,
|
|
572
|
+
onChange: (s, g) => G(s, g)
|
|
573
|
+
},
|
|
574
|
+
emptyTitle: "暂无字典类型",
|
|
575
|
+
emptyDescription: "当前没有字典类型,先点右上角「新增字典类型」建一个。"
|
|
576
|
+
}
|
|
577
|
+
) }, "1"),
|
|
578
|
+
/* @__PURE__ */ e.jsx(Y, { tab: "字典项", children: /* @__PURE__ */ e.jsx(
|
|
579
|
+
W,
|
|
580
|
+
{
|
|
581
|
+
rows: y,
|
|
582
|
+
columns: je,
|
|
583
|
+
loading: V,
|
|
584
|
+
rowKey: "id",
|
|
585
|
+
searchKeys: "itemCode,itemName,itemValue",
|
|
586
|
+
searchPlaceholder: "按字典项编码 / 名称 / 值过滤",
|
|
587
|
+
cardExtra: /* @__PURE__ */ e.jsxs(z, { children: [
|
|
588
|
+
/* @__PURE__ */ e.jsx(x, { type: "primary", icon: /* @__PURE__ */ e.jsx(q, {}), onClick: he, children: "新增字典项" }),
|
|
589
|
+
k && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
590
|
+
"当前字典ID: ",
|
|
591
|
+
k
|
|
592
|
+
] })
|
|
593
|
+
] }),
|
|
594
|
+
emptyTitle: "暂无字典项",
|
|
595
|
+
emptyDescription: "先在「字典类型」里选一个类型,再新增字典项。"
|
|
596
|
+
}
|
|
597
|
+
) }, "2")
|
|
572
598
|
] }),
|
|
573
599
|
/* @__PURE__ */ e.jsx(
|
|
574
|
-
|
|
600
|
+
U,
|
|
575
601
|
{
|
|
576
602
|
title: f ? "编辑字典类型" : "新增字典类型",
|
|
577
603
|
open: S,
|
|
578
604
|
onOk: oe,
|
|
579
|
-
onCancel: () =>
|
|
605
|
+
onCancel: () => u(!1),
|
|
580
606
|
width: 600,
|
|
581
607
|
children: /* @__PURE__ */ e.jsxs(a, { form: o, layout: "vertical", children: [
|
|
582
608
|
/* @__PURE__ */ e.jsx(a.Item, { name: "tenantId", label: "租户ID", initialValue: 1, children: /* @__PURE__ */ e.jsx(l, { type: "number", placeholder: "请输入租户ID" }) }),
|
|
583
609
|
/* @__PURE__ */ e.jsx(a.Item, { name: "dictCode", label: "字典编码", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(l, { placeholder: "请输入字典编码" }) }),
|
|
584
610
|
/* @__PURE__ */ e.jsx(a.Item, { name: "dictName", label: "字典名称", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(l, { placeholder: "请输入字典名称" }) }),
|
|
585
611
|
/* @__PURE__ */ e.jsx(a.Item, { name: "dictType", label: "字典类型", initialValue: "custom", children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
586
|
-
/* @__PURE__ */ e.jsx(
|
|
587
|
-
/* @__PURE__ */ e.jsx(
|
|
612
|
+
/* @__PURE__ */ e.jsx(F, { value: "system", children: "系统" }),
|
|
613
|
+
/* @__PURE__ */ e.jsx(F, { value: "custom", children: "自定义" })
|
|
588
614
|
] }) }),
|
|
589
615
|
/* @__PURE__ */ e.jsx(a.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(l.TextArea, { rows: 2, placeholder: "请输入描述" }) }),
|
|
590
616
|
/* @__PURE__ */ e.jsx(a.Item, { name: "status", label: "状态", initialValue: 1, children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
591
|
-
/* @__PURE__ */ e.jsx(
|
|
592
|
-
/* @__PURE__ */ e.jsx(
|
|
617
|
+
/* @__PURE__ */ e.jsx(F, { value: 1, children: "启用" }),
|
|
618
|
+
/* @__PURE__ */ e.jsx(F, { value: 0, children: "禁用" })
|
|
593
619
|
] }) })
|
|
594
620
|
] })
|
|
595
621
|
}
|
|
596
622
|
),
|
|
597
623
|
/* @__PURE__ */ e.jsx(
|
|
598
|
-
|
|
624
|
+
U,
|
|
599
625
|
{
|
|
600
626
|
title: r ? "编辑字典项" : "新增字典项",
|
|
601
|
-
open:
|
|
602
|
-
onOk:
|
|
627
|
+
open: E,
|
|
628
|
+
onOk: pe,
|
|
603
629
|
onCancel: () => t(!1),
|
|
604
630
|
width: 600,
|
|
605
631
|
children: /* @__PURE__ */ e.jsxs(a, { form: L, layout: "vertical", children: [
|
|
@@ -609,56 +635,56 @@ function De() {
|
|
|
609
635
|
/* @__PURE__ */ e.jsx(a.Item, { name: "itemValue", label: "字典项值", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(l, { placeholder: "请输入字典项值" }) }),
|
|
610
636
|
/* @__PURE__ */ e.jsx(a.Item, { name: "sortOrder", label: "排序", children: /* @__PURE__ */ e.jsx(l, { type: "number", placeholder: "请输入排序" }) }),
|
|
611
637
|
/* @__PURE__ */ e.jsx(a.Item, { name: "status", label: "状态", initialValue: 1, children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
612
|
-
/* @__PURE__ */ e.jsx(
|
|
613
|
-
/* @__PURE__ */ e.jsx(
|
|
638
|
+
/* @__PURE__ */ e.jsx(F, { value: 1, children: "启用" }),
|
|
639
|
+
/* @__PURE__ */ e.jsx(F, { value: 0, children: "禁用" })
|
|
614
640
|
] }) })
|
|
615
641
|
] })
|
|
616
642
|
}
|
|
617
643
|
)
|
|
618
644
|
] });
|
|
619
645
|
}
|
|
620
|
-
const { Option:
|
|
621
|
-
function
|
|
622
|
-
const [j, c] = d([]), [
|
|
623
|
-
|
|
646
|
+
const { Option: w } = I;
|
|
647
|
+
function Oe() {
|
|
648
|
+
const [j, c] = d([]), [p, h] = d(!1), [n, T] = d({ current: 1, pageSize: 10, total: 0 }), [S, u] = d(!1), [f, v] = d(null), [o] = a.useForm(), y = async (t = 1, r = 10) => {
|
|
649
|
+
h(!0);
|
|
624
650
|
try {
|
|
625
651
|
const b = await m.get("/interface/list", {
|
|
626
652
|
params: { pageNum: t, pageSize: r }
|
|
627
653
|
});
|
|
628
|
-
c(b.data.records || []),
|
|
654
|
+
c(b.data.records || []), T({
|
|
629
655
|
current: t,
|
|
630
656
|
pageSize: r,
|
|
631
657
|
total: b.data.total || 0
|
|
632
658
|
});
|
|
633
659
|
} catch {
|
|
634
|
-
|
|
660
|
+
i.error("获取数据失败");
|
|
635
661
|
} finally {
|
|
636
|
-
|
|
662
|
+
h(!1);
|
|
637
663
|
}
|
|
638
664
|
};
|
|
639
665
|
_(() => {
|
|
640
666
|
y();
|
|
641
667
|
}, []);
|
|
642
|
-
const
|
|
668
|
+
const O = (t) => {
|
|
643
669
|
y(t.current, t.pageSize);
|
|
644
670
|
}, V = () => {
|
|
645
|
-
|
|
671
|
+
v(null), o.resetFields(), o.setFieldsValue({ status: 1, deprecated: 0, apiMethod: "GET", apiVersion: "v1", authType: "bearer" }), u(!0);
|
|
646
672
|
}, C = (t) => {
|
|
647
|
-
|
|
673
|
+
v(t), o.setFieldsValue(t), u(!0);
|
|
648
674
|
}, k = async (t) => {
|
|
649
675
|
try {
|
|
650
|
-
await m.delete(`/interface/${t}`),
|
|
676
|
+
await m.delete(`/interface/${t}`), i.success("删除成功"), y(n.current, n.pageSize);
|
|
651
677
|
} catch {
|
|
652
|
-
|
|
678
|
+
i.error("删除失败");
|
|
653
679
|
}
|
|
654
|
-
},
|
|
680
|
+
}, P = async () => {
|
|
655
681
|
try {
|
|
656
682
|
const t = await o.validateFields();
|
|
657
|
-
f ? (await m.put(`/interface/${f.id}`, t),
|
|
683
|
+
f ? (await m.put(`/interface/${f.id}`, t), i.success("更新成功")) : (await m.post("/interface", t), i.success("创建成功")), u(!1), y(n.current, n.pageSize);
|
|
658
684
|
} catch {
|
|
659
|
-
|
|
685
|
+
i.error("操作失败");
|
|
660
686
|
}
|
|
661
|
-
},
|
|
687
|
+
}, E = [
|
|
662
688
|
{
|
|
663
689
|
title: "ID",
|
|
664
690
|
dataIndex: "id",
|
|
@@ -726,32 +752,41 @@ function Se() {
|
|
|
726
752
|
{
|
|
727
753
|
title: "操作",
|
|
728
754
|
key: "action",
|
|
729
|
-
render: (t, r) => /* @__PURE__ */ e.jsxs(
|
|
730
|
-
/* @__PURE__ */ e.jsx(
|
|
731
|
-
/* @__PURE__ */ e.jsx(
|
|
755
|
+
render: (t, r) => /* @__PURE__ */ e.jsxs(z, { children: [
|
|
756
|
+
/* @__PURE__ */ e.jsx(x, { type: "link", icon: /* @__PURE__ */ e.jsx(R, {}), onClick: () => C(r), children: "编辑" }),
|
|
757
|
+
/* @__PURE__ */ e.jsx(B, { title: "确定删除?", onConfirm: () => k(r.id), children: /* @__PURE__ */ e.jsx(x, { type: "link", danger: !0, icon: /* @__PURE__ */ e.jsx(K, {}), children: "删除" }) })
|
|
732
758
|
] })
|
|
733
759
|
}
|
|
734
760
|
];
|
|
735
761
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
736
|
-
/* @__PURE__ */ e.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ e.jsx(p, { type: "primary", icon: /* @__PURE__ */ e.jsx($, {}), onClick: V, children: "新增接口" }) }),
|
|
737
762
|
/* @__PURE__ */ e.jsx(
|
|
738
|
-
|
|
763
|
+
W,
|
|
739
764
|
{
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
loading:
|
|
765
|
+
rows: j,
|
|
766
|
+
columns: E,
|
|
767
|
+
loading: p,
|
|
743
768
|
rowKey: "id",
|
|
744
|
-
|
|
745
|
-
|
|
769
|
+
searchKeys: "apiName,apiPath,apiMethod",
|
|
770
|
+
searchPlaceholder: "按接口名称 / 路径 / 方法过滤",
|
|
771
|
+
cardExtra: /* @__PURE__ */ e.jsx(x, { type: "primary", icon: /* @__PURE__ */ e.jsx(q, {}), onClick: V, children: "新增接口" }),
|
|
772
|
+
pagination: {
|
|
773
|
+
...n,
|
|
774
|
+
showSizeChanger: !0,
|
|
775
|
+
pageSizeOptions: ["10", "20", "50", "100"],
|
|
776
|
+
showTotal: (t) => `共 ${t} 条`
|
|
777
|
+
},
|
|
778
|
+
onChange: O,
|
|
779
|
+
emptyTitle: "暂无接口",
|
|
780
|
+
emptyDescription: "当前没有接口定义,先点右上角「新增接口」建一个。"
|
|
746
781
|
}
|
|
747
782
|
),
|
|
748
783
|
/* @__PURE__ */ e.jsx(
|
|
749
|
-
|
|
784
|
+
U,
|
|
750
785
|
{
|
|
751
786
|
title: f ? "编辑接口" : "新增接口",
|
|
752
787
|
open: S,
|
|
753
|
-
onOk:
|
|
754
|
-
onCancel: () =>
|
|
788
|
+
onOk: P,
|
|
789
|
+
onCancel: () => u(!1),
|
|
755
790
|
width: 700,
|
|
756
791
|
children: /* @__PURE__ */ e.jsxs(a, { form: o, layout: "vertical", children: [
|
|
757
792
|
/* @__PURE__ */ e.jsx(
|
|
@@ -782,57 +817,57 @@ function Se() {
|
|
|
782
817
|
}
|
|
783
818
|
),
|
|
784
819
|
/* @__PURE__ */ e.jsx(a.Item, { name: "apiMethod", label: "请求方法", initialValue: "GET", children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
785
|
-
/* @__PURE__ */ e.jsx(
|
|
786
|
-
/* @__PURE__ */ e.jsx(
|
|
787
|
-
/* @__PURE__ */ e.jsx(
|
|
788
|
-
/* @__PURE__ */ e.jsx(
|
|
820
|
+
/* @__PURE__ */ e.jsx(w, { value: "GET", children: "GET" }),
|
|
821
|
+
/* @__PURE__ */ e.jsx(w, { value: "POST", children: "POST" }),
|
|
822
|
+
/* @__PURE__ */ e.jsx(w, { value: "PUT", children: "PUT" }),
|
|
823
|
+
/* @__PURE__ */ e.jsx(w, { value: "DELETE", children: "DELETE" })
|
|
789
824
|
] }) }),
|
|
790
825
|
/* @__PURE__ */ e.jsx(a.Item, { name: "apiVersion", label: "接口版本", initialValue: "v1", children: /* @__PURE__ */ e.jsx(l, { placeholder: "如: v1" }) }),
|
|
791
826
|
/* @__PURE__ */ e.jsx(a.Item, { name: "authType", label: "认证类型", initialValue: "bearer", children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
792
|
-
/* @__PURE__ */ e.jsx(
|
|
793
|
-
/* @__PURE__ */ e.jsx(
|
|
794
|
-
/* @__PURE__ */ e.jsx(
|
|
795
|
-
/* @__PURE__ */ e.jsx(
|
|
827
|
+
/* @__PURE__ */ e.jsx(w, { value: "none", children: "无" }),
|
|
828
|
+
/* @__PURE__ */ e.jsx(w, { value: "basic", children: "Basic" }),
|
|
829
|
+
/* @__PURE__ */ e.jsx(w, { value: "bearer", children: "Bearer" }),
|
|
830
|
+
/* @__PURE__ */ e.jsx(w, { value: "oauth2", children: "OAuth2" })
|
|
796
831
|
] }) }),
|
|
797
832
|
/* @__PURE__ */ e.jsx(a.Item, { name: "requestParams", label: "请求参数(JSON)", children: /* @__PURE__ */ e.jsx(l.TextArea, { rows: 3, placeholder: '如: {"name": "string", "age": "number"}' }) }),
|
|
798
833
|
/* @__PURE__ */ e.jsx(a.Item, { name: "responseParams", label: "响应参数(JSON)", children: /* @__PURE__ */ e.jsx(l.TextArea, { rows: 3, placeholder: '如: {"code": "number", "data": "object"}' }) }),
|
|
799
834
|
/* @__PURE__ */ e.jsx(a.Item, { name: "description", label: "描述", children: /* @__PURE__ */ e.jsx(l.TextArea, { rows: 2, placeholder: "请输入描述" }) }),
|
|
800
835
|
/* @__PURE__ */ e.jsx(a.Item, { name: "status", label: "状态", initialValue: 1, children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
801
|
-
/* @__PURE__ */ e.jsx(
|
|
802
|
-
/* @__PURE__ */ e.jsx(
|
|
836
|
+
/* @__PURE__ */ e.jsx(w, { value: 1, children: "启用" }),
|
|
837
|
+
/* @__PURE__ */ e.jsx(w, { value: 0, children: "禁用" })
|
|
803
838
|
] }) }),
|
|
804
839
|
/* @__PURE__ */ e.jsx(a.Item, { name: "deprecated", label: "是否废弃", initialValue: 0, children: /* @__PURE__ */ e.jsxs(I, { children: [
|
|
805
|
-
/* @__PURE__ */ e.jsx(
|
|
806
|
-
/* @__PURE__ */ e.jsx(
|
|
840
|
+
/* @__PURE__ */ e.jsx(w, { value: 0, children: "否" }),
|
|
841
|
+
/* @__PURE__ */ e.jsx(w, { value: 1, children: "是" })
|
|
807
842
|
] }) })
|
|
808
843
|
] })
|
|
809
844
|
}
|
|
810
845
|
)
|
|
811
846
|
] });
|
|
812
847
|
}
|
|
813
|
-
const { Title:
|
|
814
|
-
function
|
|
815
|
-
const j = ne(), [c,
|
|
848
|
+
const { Title: Ve, Paragraph: Pe } = ke;
|
|
849
|
+
function Ee() {
|
|
850
|
+
const j = ne(), [c, p] = d(null);
|
|
816
851
|
_(() => {
|
|
817
852
|
const n = localStorage.getItem("userInfo");
|
|
818
853
|
if (n)
|
|
819
854
|
try {
|
|
820
|
-
|
|
855
|
+
p(JSON.parse(n));
|
|
821
856
|
} catch {
|
|
822
|
-
|
|
857
|
+
p({ name: n });
|
|
823
858
|
}
|
|
824
859
|
}, []);
|
|
825
|
-
const
|
|
860
|
+
const h = Ne.filter((n) => n.key !== "/z-meta/home");
|
|
826
861
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
827
|
-
/* @__PURE__ */ e.jsx(D, { style: { marginBottom: 16, background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)", border: "none" }, children: /* @__PURE__ */ e.jsxs(
|
|
828
|
-
/* @__PURE__ */ e.jsxs(
|
|
862
|
+
/* @__PURE__ */ e.jsx(D, { style: { marginBottom: 16, background: "linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%)", border: "none" }, children: /* @__PURE__ */ e.jsxs(z, { direction: "vertical", size: 4, style: { color: "#fff" }, children: [
|
|
863
|
+
/* @__PURE__ */ e.jsxs(Ve, { level: 3, style: { color: "#fff", margin: 0 }, children: [
|
|
829
864
|
"欢迎",
|
|
830
865
|
c != null && c.name ? `,${c.name}` : ""
|
|
831
866
|
] }),
|
|
832
|
-
/* @__PURE__ */ e.jsx(
|
|
867
|
+
/* @__PURE__ */ e.jsx(Pe, { style: { color: "rgba(255,255,255,0.85)", margin: 0 }, children: "z-meta 元数据平台 管理台" }),
|
|
833
868
|
(c == null ? void 0 : c.role) && /* @__PURE__ */ e.jsx(ie, { style: { marginTop: 8, background: "rgba(255,255,255,0.2)", color: "#fff", border: "none" }, children: c.role })
|
|
834
869
|
] }) }),
|
|
835
|
-
/* @__PURE__ */ e.jsx(se, { gutter: [16, 16], children:
|
|
870
|
+
/* @__PURE__ */ e.jsx(se, { gutter: [16, 16], children: h.map((n) => /* @__PURE__ */ e.jsx($, { xs: 24, sm: 12, md: 12, lg: 8, children: /* @__PURE__ */ e.jsx(D, { hoverable: !0, onClick: () => j(n.key), style: { borderTop: "3px solid #7c3aed" }, children: /* @__PURE__ */ e.jsxs(z, { align: "start", size: 12, children: [
|
|
836
871
|
/* @__PURE__ */ e.jsx("div", { style: {
|
|
837
872
|
width: 44,
|
|
838
873
|
height: 44,
|
|
@@ -853,11 +888,11 @@ function Oe() {
|
|
|
853
888
|
] });
|
|
854
889
|
}
|
|
855
890
|
const A = { username: "admin", password: "123456", user: { name: "admin", role: "管理员" } };
|
|
856
|
-
function
|
|
857
|
-
const [j, c] = d(!1),
|
|
891
|
+
function Ke() {
|
|
892
|
+
const [j, c] = d(!1), p = async (h) => {
|
|
858
893
|
c(!0);
|
|
859
894
|
try {
|
|
860
|
-
|
|
895
|
+
h.username === A.username && h.password === A.password ? (localStorage.setItem("token", "mock-" + A.username), localStorage.setItem("userInfo", JSON.stringify(A.user)), i.success("登录成功(mock 模式,待 CTC/SSO 接入)"), window.location.href = "/z-meta/home") : i.error("用户名或密码错误(默认 admin/123456)");
|
|
861
896
|
} finally {
|
|
862
897
|
c(!1);
|
|
863
898
|
}
|
|
@@ -885,11 +920,11 @@ function qe() {
|
|
|
885
920
|
}, children: "z" }),
|
|
886
921
|
/* @__PURE__ */ e.jsx("div", { style: { fontSize: 18, fontWeight: 600, color: "#0f172a" }, children: "z-meta 管理台" })
|
|
887
922
|
] }),
|
|
888
|
-
/* @__PURE__ */ e.jsxs(a, { onFinish:
|
|
923
|
+
/* @__PURE__ */ e.jsxs(a, { onFinish: p, size: "large", children: [
|
|
889
924
|
/* @__PURE__ */ e.jsx(a.Item, { name: "username", rules: [{ required: !0, message: "请输入用户名" }], children: /* @__PURE__ */ e.jsx(l, { prefix: /* @__PURE__ */ e.jsx(H, {}), placeholder: "用户名" }) }),
|
|
890
925
|
/* @__PURE__ */ e.jsx(a.Item, { name: "password", rules: [{ required: !0, message: "请输入密码" }], children: /* @__PURE__ */ e.jsx(l.Password, { prefix: /* @__PURE__ */ e.jsx(Z, {}), placeholder: "密码" }) }),
|
|
891
926
|
/* @__PURE__ */ e.jsx(a.Item, { style: { marginBottom: 8 }, children: /* @__PURE__ */ e.jsx(
|
|
892
|
-
|
|
927
|
+
x,
|
|
893
928
|
{
|
|
894
929
|
type: "primary",
|
|
895
930
|
htmlType: "submit",
|
|
@@ -908,29 +943,32 @@ function qe() {
|
|
|
908
943
|
] })
|
|
909
944
|
] }) });
|
|
910
945
|
}
|
|
911
|
-
const
|
|
912
|
-
{ key: "/z-meta/home", label: "首页", icon: /* @__PURE__ */ e.jsx(
|
|
913
|
-
{ key: "/z-meta/dashboard", label: "首页", icon: /* @__PURE__ */ e.jsx(
|
|
946
|
+
const Ue = { title: "z-meta 元数据平台", short: "z-meta" }, Ne = [
|
|
947
|
+
{ key: "/z-meta/home", label: "首页", icon: /* @__PURE__ */ e.jsx(fe, {}) },
|
|
948
|
+
{ key: "/z-meta/dashboard", label: "首页", icon: /* @__PURE__ */ e.jsx(Ie, {}) },
|
|
914
949
|
{ key: "/z-meta/tenant", label: "租户管理", icon: /* @__PURE__ */ e.jsx(H, {}) },
|
|
915
950
|
{ key: "/z-meta/app", label: "应用管理", icon: /* @__PURE__ */ e.jsx(ee, {}) },
|
|
916
951
|
{ key: "/z-meta/dict", label: "字典管理", icon: /* @__PURE__ */ e.jsx(te, {}) },
|
|
917
|
-
{ key: "/z-meta/api", label: "接口管理", icon: /* @__PURE__ */ e.jsx(ae, {}) }
|
|
952
|
+
{ key: "/z-meta/api", label: "接口管理", icon: /* @__PURE__ */ e.jsx(ae, {}) },
|
|
953
|
+
{ key: "/z-meta/docs", label: "组件文档", icon: /* @__PURE__ */ e.jsx(be, {}) }
|
|
918
954
|
], Be = [
|
|
919
|
-
{ path: "/z-meta/home", Component:
|
|
920
|
-
{ path: "/z-meta/dashboard", Component:
|
|
921
|
-
{ path: "/z-meta/tenant", Component:
|
|
922
|
-
{ path: "/z-meta/app", Component:
|
|
923
|
-
{ path: "/z-meta/dict", Component:
|
|
924
|
-
{ path: "/z-meta/api", Component:
|
|
925
|
-
{ path: "/z-meta
|
|
955
|
+
{ path: "/z-meta/home", Component: Ee },
|
|
956
|
+
{ path: "/z-meta/dashboard", Component: we },
|
|
957
|
+
{ path: "/z-meta/tenant", Component: De },
|
|
958
|
+
{ path: "/z-meta/app", Component: ze },
|
|
959
|
+
{ path: "/z-meta/dict", Component: Se },
|
|
960
|
+
{ path: "/z-meta/api", Component: Oe },
|
|
961
|
+
{ path: "/z-meta/docs", Component: ye },
|
|
962
|
+
{ path: "/z-meta/:rest*", Component: ge }
|
|
926
963
|
];
|
|
927
964
|
export {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
965
|
+
ye as ComponentDocPage,
|
|
966
|
+
we as Dashboard,
|
|
967
|
+
Ee as HomePage,
|
|
968
|
+
Re as Login,
|
|
969
|
+
Ke as LoginPage,
|
|
970
|
+
Ue as appMeta,
|
|
971
|
+
Ge as configureMeta,
|
|
972
|
+
Ne as menuItems,
|
|
935
973
|
Be as routes
|
|
936
974
|
};
|