react-toolkits 0.8.50 → 0.8.51
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/CHANGELOG.md +6 -0
- package/lib/{index-j-_vPBvt.chunk.js → index-3oZMUF8w.chunk.js} +338 -333
- package/lib/index-JpU3-169.chunk.js +190 -0
- package/lib/{index-8eu00YF4.chunk.js → index-P7ZUoQmd.chunk.js} +1 -1
- package/lib/{index-otQCfOM4.chunk.js → index-qxaMW71h.chunk.js} +2 -2
- package/lib/{index-KpWVXj-d.chunk.js → index-ub3elrtb.chunk.js} +3 -3
- package/lib/{index-OIBogbyi.chunk.js → index-wC24P0Ed.chunk.js} +57 -59
- package/lib/index.d.ts +5 -7
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/lib/index-F3faSCo8.chunk.js +0 -192
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { A as S, _ as v, u as j, a as b, j as e, P as h, H as T, Q as R, b as A } from "./index-3oZMUF8w.chunk.js";
|
|
2
|
+
import { App as f, Row as z, Col as F, Tag as C, Space as P, Card as E, Form as x, Input as w, Select as U } from "antd";
|
|
3
|
+
import { p as L } from "./immer-BLf7GM7E.chunk.js";
|
|
4
|
+
import { Link as G } from "react-router-dom";
|
|
5
|
+
import { u as D, a as N, b as I, c as Q } from "./index-P7ZUoQmd.chunk.js";
|
|
6
|
+
import * as k from "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
var _ = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z" } }] }, name: "user-add", theme: "outlined" };
|
|
9
|
+
const $ = _;
|
|
10
|
+
var M = function(r, o) {
|
|
11
|
+
return /* @__PURE__ */ k.createElement(S, v({}, r, {
|
|
12
|
+
ref: o,
|
|
13
|
+
icon: $
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
process.env.NODE_ENV !== "production" && (M.displayName = "UserAddOutlined");
|
|
17
|
+
const q = /* @__PURE__ */ k.forwardRef(M), { Option: B } = U, g = "/api/usystem/user/list";
|
|
18
|
+
function H() {
|
|
19
|
+
const { message: i } = f.useApp(), r = N(), { data: o, isLoading: d } = I(), { setPayload: m } = j(), n = b();
|
|
20
|
+
return A({
|
|
21
|
+
title: n("UserList.createTitle"),
|
|
22
|
+
formProps: {
|
|
23
|
+
labelCol: { flex: "80px" }
|
|
24
|
+
},
|
|
25
|
+
content: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ e.jsx(x.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, {}) }),
|
|
27
|
+
/* @__PURE__ */ e.jsx(x.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(U, { allowClear: !0, mode: "multiple", loading: d, children: (o ?? []).map((t) => /* @__PURE__ */ e.jsx(B, { value: t.name, children: t.name }, t.id)) }) })
|
|
28
|
+
] }),
|
|
29
|
+
async onConfirm(t) {
|
|
30
|
+
await r.trigger(t), m(g, { page: 1 }), i.success(n("UserList.createSuccessfully"));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function K() {
|
|
35
|
+
const { message: i } = f.useApp(), r = Q(), { data: o, isLoading: d } = I(), { mutate: m } = j(), n = b();
|
|
36
|
+
return A({
|
|
37
|
+
title: n("UserList.updateTitle"),
|
|
38
|
+
formProps: {
|
|
39
|
+
labelCol: { flex: "80px" }
|
|
40
|
+
},
|
|
41
|
+
content: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ e.jsx(x.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(w, { readOnly: !0 }) }),
|
|
43
|
+
/* @__PURE__ */ e.jsx(x.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(
|
|
44
|
+
U,
|
|
45
|
+
{
|
|
46
|
+
allowClear: !0,
|
|
47
|
+
mode: "multiple",
|
|
48
|
+
loading: d,
|
|
49
|
+
options: o == null ? void 0 : o.map((t) => ({
|
|
50
|
+
label: t.name,
|
|
51
|
+
value: t.name
|
|
52
|
+
}))
|
|
53
|
+
}
|
|
54
|
+
) })
|
|
55
|
+
] }),
|
|
56
|
+
async onConfirm(t, u) {
|
|
57
|
+
await r.trigger(t), m(
|
|
58
|
+
g,
|
|
59
|
+
(l) => L(l, (p) => {
|
|
60
|
+
if (p) {
|
|
61
|
+
const s = p.findIndex((a) => a.id === (u == null ? void 0 : u.id));
|
|
62
|
+
s !== -1 && (p[s].roles = t.roles);
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
{ revalidate: !1 }
|
|
66
|
+
), i.success(n("UserList.updateSuccessfully"));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const ee = () => {
|
|
71
|
+
const { modal: i, message: r } = f.useApp(), o = D(), { mutate: d } = j(), { show: m, modal: n } = H(), { show: t, modal: u } = K(), l = b(), p = [
|
|
72
|
+
{
|
|
73
|
+
title: l("global.name"),
|
|
74
|
+
dataIndex: "name",
|
|
75
|
+
key: "name"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: "ID",
|
|
79
|
+
dataIndex: "id",
|
|
80
|
+
key: "id"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: l("global.role"),
|
|
84
|
+
dataIndex: "roles",
|
|
85
|
+
key: "roles",
|
|
86
|
+
width: "40%",
|
|
87
|
+
render(s) {
|
|
88
|
+
return /* @__PURE__ */ e.jsx(z, { gutter: [4, 4], children: (s || []).map((a) => /* @__PURE__ */ e.jsx(F, { children: a === "root" ? /* @__PURE__ */ e.jsx(C, { color: "#f50", children: a }) : /* @__PURE__ */ e.jsx(C, { color: "#ff5a00", children: /* @__PURE__ */ e.jsx(G, { to: `/permission/role/${a}`, children: a }) }) }, a)) });
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: l("global.creationTime"),
|
|
93
|
+
dataIndex: "Ctime",
|
|
94
|
+
key: "ctime"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
title: l("global.operation"),
|
|
98
|
+
width: 150,
|
|
99
|
+
align: "center",
|
|
100
|
+
render: (s) => /* @__PURE__ */ e.jsxs(P, { children: [
|
|
101
|
+
/* @__PURE__ */ e.jsx(
|
|
102
|
+
h,
|
|
103
|
+
{
|
|
104
|
+
isGlobal: !0,
|
|
105
|
+
size: "small",
|
|
106
|
+
type: "link",
|
|
107
|
+
code: "100003",
|
|
108
|
+
onClick: () => {
|
|
109
|
+
t({
|
|
110
|
+
initialValues: {
|
|
111
|
+
name: s.name,
|
|
112
|
+
roles: s.roles
|
|
113
|
+
},
|
|
114
|
+
extraValues: {
|
|
115
|
+
id: s.id
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
children: l("global.update")
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ e.jsx(
|
|
123
|
+
h,
|
|
124
|
+
{
|
|
125
|
+
isGlobal: !0,
|
|
126
|
+
danger: !0,
|
|
127
|
+
size: "small",
|
|
128
|
+
code: "100004",
|
|
129
|
+
type: "link",
|
|
130
|
+
onClick: () => {
|
|
131
|
+
i.confirm({
|
|
132
|
+
title: l("UserList.deleteTitle"),
|
|
133
|
+
content: /* @__PURE__ */ e.jsx(T, { texts: [s.name], children: l("UserList.deleteContent", { user: s.name }) }),
|
|
134
|
+
async onOk() {
|
|
135
|
+
await o.trigger({
|
|
136
|
+
id: s.id,
|
|
137
|
+
name: s.name
|
|
138
|
+
}), d(g, (a) => L(a, (c) => {
|
|
139
|
+
const y = c == null ? void 0 : c.findIndex((O) => O.id === s.id);
|
|
140
|
+
y && (c == null || c.splice(y, 1));
|
|
141
|
+
})), r.success(l("UserList.deleteSuccessfully"));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
children: l("global.delete")
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
] })
|
|
149
|
+
}
|
|
150
|
+
];
|
|
151
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
152
|
+
/* @__PURE__ */ e.jsx(
|
|
153
|
+
E,
|
|
154
|
+
{
|
|
155
|
+
title: l("global.user"),
|
|
156
|
+
extra: /* @__PURE__ */ e.jsx(
|
|
157
|
+
h,
|
|
158
|
+
{
|
|
159
|
+
isGlobal: !0,
|
|
160
|
+
type: "primary",
|
|
161
|
+
icon: /* @__PURE__ */ e.jsx(q, {}),
|
|
162
|
+
code: "100002",
|
|
163
|
+
onClick: () => {
|
|
164
|
+
m();
|
|
165
|
+
},
|
|
166
|
+
children: l("UserList.createTitle")
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
children: /* @__PURE__ */ e.jsx(
|
|
170
|
+
R,
|
|
171
|
+
{
|
|
172
|
+
isGlobal: !0,
|
|
173
|
+
code: "100001",
|
|
174
|
+
action: g,
|
|
175
|
+
rowKey: "id",
|
|
176
|
+
columns: p,
|
|
177
|
+
getTotal: (s) => s.Total,
|
|
178
|
+
getDataSource: (s) => s.List
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
n,
|
|
184
|
+
u
|
|
185
|
+
] });
|
|
186
|
+
};
|
|
187
|
+
export {
|
|
188
|
+
g as action,
|
|
189
|
+
ee as default
|
|
190
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as W, w as x, e as h, f as z, s as K, m as G, g as P, U as R, h as v, d as S, r as n, c as L } from "./index-
|
|
1
|
+
import { I as W, w as x, e as h, f as z, s as K, m as G, g as P, U as R, h as v, d as S, r as n, c as L } from "./index-3oZMUF8w.chunk.js";
|
|
2
2
|
import N, { useRef as o, useCallback as M, useState as $ } from "react";
|
|
3
3
|
const U = W ? (e) => {
|
|
4
4
|
e();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as S, j as e, d as $ } from "./index-
|
|
1
|
+
import { a as S, j as e, d as $ } from "./index-3oZMUF8w.chunk.js";
|
|
2
2
|
import { Collapse as D, Checkbox as k, Row as G, Col as _, Skeleton as T, Typography as A, Divider as w, Card as K, Space as M, Select as E, Button as N, Empty as O } from "antd";
|
|
3
|
-
import { h as R, i as B } from "./index-
|
|
3
|
+
import { h as R, i as B } from "./index-P7ZUoQmd.chunk.js";
|
|
4
4
|
import { useState as P, useCallback as F, useEffect as b } from "react";
|
|
5
5
|
const q = (x) => {
|
|
6
6
|
const { permissions: l, readonly: t, expand: d, value: a, onChange: r } = x, [m, p] = P([]), [g, u] = P({}), [c, f] = P(a ?? []), C = S(), h = F((s) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as t, j as i } from "./index-
|
|
1
|
+
import { a as t, j as i } from "./index-3oZMUF8w.chunk.js";
|
|
2
2
|
import { Breadcrumb as m, Card as n, Skeleton as a, Descriptions as l } from "antd";
|
|
3
3
|
import { useParams as c, Link as x } from "react-router-dom";
|
|
4
|
-
import { P as j } from "./index-
|
|
5
|
-
import { g as p } from "./index-
|
|
4
|
+
import { P as j } from "./index-qxaMW71h.chunk.js";
|
|
5
|
+
import { g as p } from "./index-P7ZUoQmd.chunk.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
const k = () => {
|
|
@@ -1,71 +1,70 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { App as f, Space as
|
|
3
|
-
import { p as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { P as
|
|
6
|
-
import { d as
|
|
7
|
-
import * as
|
|
1
|
+
import { A as O, _ as T, c as U, d as P, u as y, a as b, j as e, P as j, r as _, H as z, Q as S, b as R } from "./index-3oZMUF8w.chunk.js";
|
|
2
|
+
import { App as f, Space as $, Card as F, Form as p, Input as C } from "antd";
|
|
3
|
+
import { p as L } from "./immer-BLf7GM7E.chunk.js";
|
|
4
|
+
import { Link as G } from "react-router-dom";
|
|
5
|
+
import { P as A } from "./index-qxaMW71h.chunk.js";
|
|
6
|
+
import { d as B, e as E, f as q } from "./index-P7ZUoQmd.chunk.js";
|
|
7
|
+
import * as k from "react";
|
|
8
8
|
import "react-dom";
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
return /* @__PURE__ */
|
|
9
|
+
var D = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M892 772h-80v-80c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v80h-80c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h80v80c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-80h80c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM373.5 498.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.8-1.7-203.2 89.2-203.2 200 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.8-1.1 6.4-4.8 5.9-8.8zM824 472c0-109.4-87.9-198.3-196.9-200C516.3 270.3 424 361.2 424 472c0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C357 742.6 326 814.8 324 891.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5C505.8 695.7 563 672 624 672c110.4 0 200-89.5 200-200zm-109.5 90.5C690.3 586.7 658.2 600 624 600s-66.3-13.3-90.5-37.5a127.26 127.26 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4-.1 34.2-13.4 66.3-37.6 90.5z" } }] }, name: "usergroup-add", theme: "outlined" };
|
|
10
|
+
const N = D;
|
|
11
|
+
var v = function(r, a) {
|
|
12
|
+
return /* @__PURE__ */ k.createElement(O, T({}, r, {
|
|
13
13
|
ref: a,
|
|
14
|
-
icon:
|
|
14
|
+
icon: N
|
|
15
15
|
}));
|
|
16
16
|
};
|
|
17
|
-
process.env.NODE_ENV !== "production" && (
|
|
18
|
-
const
|
|
19
|
-
const { message: c } = f.useApp(), { setPayload: r } = y(), a =
|
|
17
|
+
process.env.NODE_ENV !== "production" && (v.displayName = "UsergroupAddOutlined");
|
|
18
|
+
const Q = /* @__PURE__ */ k.forwardRef(v), g = "/api/usystem/role/list", H = () => {
|
|
19
|
+
const { message: c } = f.useApp(), { setPayload: r } = y(), a = E(), n = b(), l = async (t) => {
|
|
20
20
|
await a.trigger({
|
|
21
|
-
name: `role_${
|
|
22
|
-
permissions:
|
|
23
|
-
}), r(
|
|
21
|
+
name: `role_${t.name}`,
|
|
22
|
+
permissions: t.permissions
|
|
23
|
+
}), r(g, { page: 1 }), c.success(n("RoleList.createSuccessfully"));
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return R({
|
|
26
26
|
title: n("RoleList.createTitle"),
|
|
27
27
|
width: "50vw",
|
|
28
28
|
formProps: {
|
|
29
29
|
layout: "vertical"
|
|
30
30
|
},
|
|
31
31
|
content: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
32
|
-
/* @__PURE__ */ e.jsx(
|
|
33
|
-
/* @__PURE__ */ e.jsx(
|
|
32
|
+
/* @__PURE__ */ e.jsx(p.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(C, { addonBefore: "role_" }) }),
|
|
33
|
+
/* @__PURE__ */ e.jsx(p.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(A, {}) })
|
|
34
34
|
] }),
|
|
35
35
|
onConfirm: l
|
|
36
36
|
});
|
|
37
|
-
},
|
|
38
|
-
const { message: c } = f.useApp(), { mutate: r } = y(), a =
|
|
39
|
-
return
|
|
37
|
+
}, K = () => {
|
|
38
|
+
const { message: c } = f.useApp(), { mutate: r } = y(), a = q(), n = b();
|
|
39
|
+
return R({
|
|
40
40
|
title: n("RoleList.updateTitle"),
|
|
41
41
|
width: "50vw",
|
|
42
42
|
content: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ e.jsx(
|
|
44
|
-
/* @__PURE__ */ e.jsx(
|
|
43
|
+
/* @__PURE__ */ e.jsx(p.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(C, { readOnly: !0, addonBefore: "role_" }) }),
|
|
44
|
+
/* @__PURE__ */ e.jsx(p.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(A, {}) })
|
|
45
45
|
] }),
|
|
46
|
-
onConfirm: async (l,
|
|
46
|
+
onConfirm: async (l, t) => {
|
|
47
47
|
await a.trigger({
|
|
48
|
-
id:
|
|
48
|
+
id: t == null ? void 0 : t.id,
|
|
49
49
|
name: `role_${l.name}`,
|
|
50
50
|
permissions: l.permissions
|
|
51
51
|
}), r(
|
|
52
|
-
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
const u = (p = m == null ? void 0 : m.dataSource) == null ? void 0 : p.find((t) => t.id === (o == null ? void 0 : o.id));
|
|
52
|
+
g,
|
|
53
|
+
(h) => L(h, (m) => {
|
|
54
|
+
const u = m == null ? void 0 : m.find((x) => x.id === (t == null ? void 0 : t.id));
|
|
56
55
|
u && (u.permissions = l.permissions);
|
|
57
56
|
}),
|
|
58
57
|
{ revalidate: !1 }
|
|
59
58
|
), c.success(n("RoleList.updateSuccessfully"));
|
|
60
59
|
}
|
|
61
60
|
});
|
|
62
|
-
},
|
|
63
|
-
const { accessible: c } =
|
|
61
|
+
}, se = () => {
|
|
62
|
+
const { accessible: c } = U("200005", !0), { modal: r, message: a } = f.useApp(), { usePermissionApiV2: n } = P(), l = B(), { mutate: t } = y(), { show: h, modal: m } = H(), { show: u, modal: x } = K(), o = b(), I = [
|
|
64
63
|
{
|
|
65
|
-
title:
|
|
64
|
+
title: o("global.name"),
|
|
66
65
|
key: "name",
|
|
67
66
|
render(s) {
|
|
68
|
-
return c ? /* @__PURE__ */ e.jsx(
|
|
67
|
+
return c ? /* @__PURE__ */ e.jsx(G, { to: `${s.name}`, relative: "path", children: s.name }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: s.name });
|
|
69
68
|
}
|
|
70
69
|
},
|
|
71
70
|
{
|
|
@@ -74,15 +73,15 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
74
73
|
key: "id"
|
|
75
74
|
},
|
|
76
75
|
{
|
|
77
|
-
title:
|
|
76
|
+
title: o("global.creationTime"),
|
|
78
77
|
dataIndex: "ctime",
|
|
79
78
|
key: "ctime"
|
|
80
79
|
},
|
|
81
80
|
{
|
|
82
|
-
title:
|
|
81
|
+
title: o("global.operation"),
|
|
83
82
|
width: 150,
|
|
84
83
|
align: "center",
|
|
85
|
-
render: (s) => /* @__PURE__ */ e.jsxs(
|
|
84
|
+
render: (s) => /* @__PURE__ */ e.jsxs($, { size: "small", children: [
|
|
86
85
|
/* @__PURE__ */ e.jsx(
|
|
87
86
|
j,
|
|
88
87
|
{
|
|
@@ -91,7 +90,7 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
91
90
|
size: "small",
|
|
92
91
|
type: "link",
|
|
93
92
|
onClick: async () => {
|
|
94
|
-
const { data: i } = await
|
|
93
|
+
const { data: i } = await _(
|
|
95
94
|
`/api/usystem/role/info${n ? "V2" : ""}?name=${s.name}`,
|
|
96
95
|
{ isGlobal: !0 }
|
|
97
96
|
);
|
|
@@ -105,7 +104,7 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
},
|
|
108
|
-
children:
|
|
107
|
+
children: o("global.edit")
|
|
109
108
|
}
|
|
110
109
|
),
|
|
111
110
|
/* @__PURE__ */ e.jsx(
|
|
@@ -118,21 +117,20 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
118
117
|
type: "link",
|
|
119
118
|
onClick: () => {
|
|
120
119
|
r.confirm({
|
|
121
|
-
title:
|
|
122
|
-
content: /* @__PURE__ */ e.jsx(
|
|
120
|
+
title: o("RoleList.deleteTitle"),
|
|
121
|
+
content: /* @__PURE__ */ e.jsx(z, { texts: [s.name], children: o("RoleList.deleteContent", { role: s.name }) }),
|
|
123
122
|
async onOk() {
|
|
124
123
|
await l.trigger({
|
|
125
124
|
id: s.id,
|
|
126
125
|
name: s.name
|
|
127
|
-
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
})), a.success(t("RoleList.deleteSuccessfully"));
|
|
126
|
+
}), t(g, (i) => L(i, (d) => {
|
|
127
|
+
const w = d == null ? void 0 : d.findIndex((M) => M.id === s.id);
|
|
128
|
+
w && (d == null || d.splice(w, 1));
|
|
129
|
+
})), a.success(o("RoleList.deleteSuccessfully"));
|
|
132
130
|
}
|
|
133
131
|
});
|
|
134
132
|
},
|
|
135
|
-
children:
|
|
133
|
+
children: o("global.delete")
|
|
136
134
|
}
|
|
137
135
|
)
|
|
138
136
|
] })
|
|
@@ -140,30 +138,30 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
140
138
|
];
|
|
141
139
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
142
140
|
/* @__PURE__ */ e.jsx(
|
|
143
|
-
|
|
141
|
+
F,
|
|
144
142
|
{
|
|
145
|
-
title:
|
|
143
|
+
title: o("global.role"),
|
|
146
144
|
extra: /* @__PURE__ */ e.jsx(
|
|
147
145
|
j,
|
|
148
146
|
{
|
|
149
147
|
isGlobal: !0,
|
|
150
148
|
type: "primary",
|
|
151
149
|
code: "200002",
|
|
152
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
150
|
+
icon: /* @__PURE__ */ e.jsx(Q, {}),
|
|
153
151
|
onClick: () => {
|
|
154
|
-
|
|
152
|
+
h();
|
|
155
153
|
},
|
|
156
|
-
children:
|
|
154
|
+
children: o("RoleList.createTitle")
|
|
157
155
|
}
|
|
158
156
|
),
|
|
159
157
|
children: /* @__PURE__ */ e.jsx(
|
|
160
|
-
|
|
158
|
+
S,
|
|
161
159
|
{
|
|
162
160
|
isGlobal: !0,
|
|
163
161
|
rowKey: "name",
|
|
164
|
-
columns:
|
|
162
|
+
columns: I,
|
|
165
163
|
code: "200001",
|
|
166
|
-
action:
|
|
164
|
+
action: g,
|
|
167
165
|
getTotal: (s) => s.Total,
|
|
168
166
|
getDataSource: (s) => s.List
|
|
169
167
|
}
|
|
@@ -171,9 +169,9 @@ const K = /* @__PURE__ */ I.forwardRef(M), h = "/api/usystem/role/list", J = ()
|
|
|
171
169
|
}
|
|
172
170
|
),
|
|
173
171
|
m,
|
|
174
|
-
|
|
172
|
+
x
|
|
175
173
|
] });
|
|
176
174
|
};
|
|
177
175
|
export {
|
|
178
|
-
|
|
176
|
+
se as default
|
|
179
177
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -274,14 +274,11 @@ export declare enum QueryListAction {
|
|
|
274
274
|
Init = "init"
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
declare interface QueryListDataType<Item
|
|
277
|
+
declare interface QueryListDataType<Item = any> {
|
|
278
278
|
dataSource: Item[];
|
|
279
279
|
total: number;
|
|
280
|
-
originalData: Response;
|
|
281
280
|
}
|
|
282
281
|
|
|
283
|
-
declare type QueryListMutator = <Item = any, Response = any>(action: string, data?: QueryListDataType<Item, Response> | Promise<QueryListDataType<Item, Response>> | MutatorCallback<QueryListDataType<Item, Response>>, opts?: MutatorOptions<QueryListDataType<Item, Response>>) => void;
|
|
284
|
-
|
|
285
282
|
declare interface QueryListPayload<FormValues = any> {
|
|
286
283
|
page?: number;
|
|
287
284
|
size?: number;
|
|
@@ -302,14 +299,15 @@ export declare interface QueryListProps<Item = any, Values = any, Response = any
|
|
|
302
299
|
renderForm?: (form: FormInstance<Values>) => ReactNode;
|
|
303
300
|
extra?: (form: FormInstance<Values>) => ReactNode;
|
|
304
301
|
onTableChange?: TableProps<Item>['onChange'];
|
|
305
|
-
afterSuccess?: (action: QueryListAction, data: QueryListDataType<Item
|
|
302
|
+
afterSuccess?: (action: QueryListAction, data: QueryListDataType<Item>) => void;
|
|
306
303
|
getTotal?: (response: Response) => number;
|
|
307
304
|
getDataSource?: (response: Response) => Item[];
|
|
308
305
|
}
|
|
309
306
|
|
|
310
307
|
export declare interface QueryListRef<Item = any, Values = any, Response = any> {
|
|
311
|
-
data: QueryListDataType<Item
|
|
308
|
+
data: QueryListDataType<Item>;
|
|
312
309
|
form: FormInstance<Values>;
|
|
310
|
+
originalData: Response | undefined;
|
|
313
311
|
}
|
|
314
312
|
|
|
315
313
|
declare interface QueryListState {
|
|
@@ -318,7 +316,7 @@ declare interface QueryListState {
|
|
|
318
316
|
propsMap: Map<string, QueryListProps>;
|
|
319
317
|
setPayload(action: string, payload: QueryListPayload): void;
|
|
320
318
|
setSwrKey(action: string, key?: string | null): void;
|
|
321
|
-
mutate:
|
|
319
|
+
mutate: <Item = any>(action: string, data?: Item[] | Promise<Item[]> | MutatorCallback<Item[]>, opts?: MutatorOptions<Item[]>) => void;
|
|
322
320
|
remove(action: string): void;
|
|
323
321
|
}
|
|
324
322
|
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as r, D as u, F as n, G as m, H as d, i as l, L as p, N as L, k as S, O as g, l as y, P, n as x, Q as c, o as F, R as G, p as M, S as T, q as h, t as k, v as q, r as Q, b as R, x as v, y as B, z as C, c as N, B as f, u as w, E as D, J as E, d as H, a as I, K as O, M as W } from "./index-
|
|
1
|
+
import { C as r, D as u, F as n, G as m, H as d, i as l, L as p, N as L, k as S, O as g, l as y, P, n as x, Q as c, o as F, R as G, p as M, S as T, q as h, t as k, v as q, r as Q, b as R, x as v, y as B, z as C, c as N, B as f, u as w, E as D, J as E, d as H, a as I, K as O, M as W } from "./index-3oZMUF8w.chunk.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "antd";
|
|
4
4
|
import "react-dom";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-toolkits",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.51",
|
|
4
4
|
"packageManager": "^pnpm@8.7.5",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"vite": "^5.0.10",
|
|
71
71
|
"vite-plugin-dts": "^3.6.4",
|
|
72
72
|
"@flow97/eslint-config-mono": "0.0.4",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
73
|
+
"tailwind-config": "0.1.1",
|
|
74
|
+
"tsconfig": "0.0.5"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"antd": "^5.12.2",
|