react-toolkits 0.6.4 → 0.6.5
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-BQWKjChr.chunk.js → index-6hfEAo8m.chunk.js} +3 -3
- package/lib/{index-HsF-BHyJ.chunk.js → index-DwxDIdPN.chunk.js} +27 -28
- package/lib/{index-C1zHJkhR.chunk.js → index-GbdPmQIm.chunk.js} +10 -10
- package/lib/{index-S1mUa9u-.chunk.js → index-HtxBCkWB.chunk.js} +2 -2
- package/lib/{index--jnz8Frg.chunk.js → index-M6uw3Hhg.chunk.js} +41 -42
- package/lib/{index-lhYimBU3.chunk.js → index-eczljdwB.chunk.js} +1 -1
- package/lib/index-jIaB0f6T.chunk.js +4803 -0
- package/lib/{index-ECP_ZutN.chunk.js → index-oFEpxp61.chunk.js} +1 -1
- package/lib/{index-88cv7ztg.chunk.js → index-sZjVIAIn.chunk.js} +25 -25
- package/lib/index.d.ts +20 -28
- package/lib/index.js +1 -1
- package/package.json +3 -3
- package/lib/index-iX5ff45w.chunk.js +0 -15902
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u as t, j as i } from "./index-
|
|
1
|
+
import { u as t, j as i } from "./index-jIaB0f6T.chunk.js";
|
|
2
2
|
import { Breadcrumb as m, Card as n, Skeleton as a, Descriptions as r } from "antd";
|
|
3
3
|
import { useParams as c, Link as p } from "react-router-dom";
|
|
4
|
-
import { P as u } from "./index-
|
|
5
|
-
import { u as x } from "./index-
|
|
4
|
+
import { P as u } from "./index-HtxBCkWB.chunk.js";
|
|
5
|
+
import { u as x } from "./index-sZjVIAIn.chunk.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
const k = () => {
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { A as T, _ as N, f as b, u as U, j as e, P as g, H as R, Q as z, h as I } from "./index-
|
|
2
|
-
import { App as f, Row as H, Col as E, Tag as L, Space as G, Card as
|
|
1
|
+
import { A as T, _ as N, f as b, u as U, j as e, P as g, H as R, Q as z, h as I } from "./index-jIaB0f6T.chunk.js";
|
|
2
|
+
import { App as f, Row as H, Col as E, Tag as L, Space as G, Card as P, Form as d, Input as j, Select as y } from "antd";
|
|
3
3
|
import { p as S } from "./immer-BLf7GM7E.chunk.js";
|
|
4
|
-
import { Link as
|
|
5
|
-
import { f as
|
|
6
|
-
import * as
|
|
4
|
+
import { Link as Q } from "react-router-dom";
|
|
5
|
+
import { f as _, g as $, h as k, i as q } from "./index-sZjVIAIn.chunk.js";
|
|
6
|
+
import * as O from "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
var
|
|
9
|
-
const
|
|
10
|
-
var
|
|
11
|
-
return /* @__PURE__ */
|
|
8
|
+
var B = { 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 D = B;
|
|
10
|
+
var v = function(c, r) {
|
|
11
|
+
return /* @__PURE__ */ O.createElement(T, N({}, c, {
|
|
12
12
|
ref: r,
|
|
13
|
-
icon:
|
|
13
|
+
icon: D
|
|
14
14
|
}));
|
|
15
15
|
};
|
|
16
|
-
process.env.NODE_ENV !== "production" && (
|
|
17
|
-
const
|
|
16
|
+
process.env.NODE_ENV !== "production" && (v.displayName = "UserAddOutlined");
|
|
17
|
+
const F = /* @__PURE__ */ O.forwardRef(v), { Option: V } = y, h = "/api/usystem/user/list";
|
|
18
18
|
function K() {
|
|
19
|
-
const { message:
|
|
19
|
+
const { message: m } = f.useApp(), c = $(), { data: r, isLoading: u } = k(), { setPayload: p } = b(), n = U();
|
|
20
20
|
return I({
|
|
21
21
|
title: n("UserList.createTitle"),
|
|
22
22
|
content: (l) => /* @__PURE__ */ e.jsxs(d, { form: l, labelCol: { flex: "80px" }, children: [
|
|
23
23
|
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(j, {}) }),
|
|
24
|
-
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(y, { allowClear: !0, mode: "multiple", loading:
|
|
24
|
+
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(y, { allowClear: !0, mode: "multiple", loading: u, children: (r ?? []).map((i) => /* @__PURE__ */ e.jsx(V, { value: i.name, children: i.name }, i.id)) }) })
|
|
25
25
|
] }),
|
|
26
26
|
async onConfirm(l) {
|
|
27
|
-
await c.trigger(l), p(h, { page: 1 }),
|
|
27
|
+
await c.trigger(l), p(h, { page: 1 }), m.success(n("UserList.createSuccessfully"));
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
function J() {
|
|
32
|
-
const { message:
|
|
32
|
+
const { message: m } = f.useApp(), c = q(), { data: r, isLoading: u } = k(), { mutate: p } = b(), n = U();
|
|
33
33
|
return I({
|
|
34
34
|
title: n("UserList.updateTitle"),
|
|
35
35
|
content: (l) => /* @__PURE__ */ e.jsxs(d, { form: l, labelCol: { flex: "80px" }, children: [
|
|
@@ -40,7 +40,7 @@ function J() {
|
|
|
40
40
|
{
|
|
41
41
|
allowClear: !0,
|
|
42
42
|
mode: "multiple",
|
|
43
|
-
loading:
|
|
43
|
+
loading: u,
|
|
44
44
|
options: r == null ? void 0 : r.map((i) => ({
|
|
45
45
|
label: i.name,
|
|
46
46
|
value: i.name
|
|
@@ -52,19 +52,18 @@ function J() {
|
|
|
52
52
|
async onConfirm(l) {
|
|
53
53
|
await c.trigger(l), p(
|
|
54
54
|
h,
|
|
55
|
-
void 0,
|
|
56
55
|
(i) => S(i, (s) => {
|
|
57
56
|
var t;
|
|
58
57
|
const x = (t = s == null ? void 0 : s.list) == null ? void 0 : t.find((o) => o.id === l.id);
|
|
59
58
|
x && (x.roles = l.roles);
|
|
60
59
|
}),
|
|
61
60
|
{ revalidate: !1 }
|
|
62
|
-
),
|
|
61
|
+
), m.success(n("UserList.updateSuccessfully"));
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
const te = () => {
|
|
67
|
-
const { modal:
|
|
66
|
+
const { modal: m, message: c } = f.useApp(), r = _(), { mutate: u } = b(), { show: p, contextHolder: n } = K(), { show: l, contextHolder: i } = J(), s = U(), x = [
|
|
68
67
|
{
|
|
69
68
|
title: s("global.name"),
|
|
70
69
|
dataIndex: "name",
|
|
@@ -81,7 +80,7 @@ const te = () => {
|
|
|
81
80
|
key: "roles",
|
|
82
81
|
width: "40%",
|
|
83
82
|
render(t) {
|
|
84
|
-
return /* @__PURE__ */ e.jsx(H, { gutter: [4, 4], children: (t || []).map((o) => /* @__PURE__ */ e.jsx(E, { children: o === "root" ? /* @__PURE__ */ e.jsx(L, { color: "#f50", children: o }) : /* @__PURE__ */ e.jsx(L, { color: "#ff5a00", children: /* @__PURE__ */ e.jsx(
|
|
83
|
+
return /* @__PURE__ */ e.jsx(H, { gutter: [4, 4], children: (t || []).map((o) => /* @__PURE__ */ e.jsx(E, { children: o === "root" ? /* @__PURE__ */ e.jsx(L, { color: "#f50", children: o }) : /* @__PURE__ */ e.jsx(L, { color: "#ff5a00", children: /* @__PURE__ */ e.jsx(Q, { to: `/permission/role/${o}`, children: o }) }) }, o)) });
|
|
85
84
|
}
|
|
86
85
|
},
|
|
87
86
|
{
|
|
@@ -122,14 +121,14 @@ const te = () => {
|
|
|
122
121
|
code: "100004",
|
|
123
122
|
type: "link",
|
|
124
123
|
onClick: () => {
|
|
125
|
-
|
|
124
|
+
m.confirm({
|
|
126
125
|
title: s("UserList.deleteTitle"),
|
|
127
126
|
content: /* @__PURE__ */ e.jsx(R, { texts: [t.name], children: s("UserList.deleteContent", { user: t.name }) }),
|
|
128
127
|
async onOk() {
|
|
129
128
|
await r.trigger({
|
|
130
129
|
id: t.id,
|
|
131
130
|
name: t.name
|
|
132
|
-
}),
|
|
131
|
+
}), u(h, (o) => S(o, (a) => {
|
|
133
132
|
var w, A;
|
|
134
133
|
const C = (w = a == null ? void 0 : a.list) == null ? void 0 : w.findIndex((M) => M.id === t.id);
|
|
135
134
|
C && ((A = a == null ? void 0 : a.list) == null || A.splice(C, 1));
|
|
@@ -144,7 +143,7 @@ const te = () => {
|
|
|
144
143
|
}
|
|
145
144
|
];
|
|
146
145
|
return /* @__PURE__ */ e.jsxs(
|
|
147
|
-
|
|
146
|
+
P,
|
|
148
147
|
{
|
|
149
148
|
title: s("global.user"),
|
|
150
149
|
extra: /* @__PURE__ */ e.jsx(
|
|
@@ -152,7 +151,7 @@ const te = () => {
|
|
|
152
151
|
{
|
|
153
152
|
isGlobalNS: !0,
|
|
154
153
|
type: "primary",
|
|
155
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
154
|
+
icon: /* @__PURE__ */ e.jsx(F, {}),
|
|
156
155
|
code: "100002",
|
|
157
156
|
onClick: () => {
|
|
158
157
|
p();
|
|
@@ -166,7 +165,7 @@ const te = () => {
|
|
|
166
165
|
{
|
|
167
166
|
isGlobalNS: !0,
|
|
168
167
|
code: "100001",
|
|
169
|
-
|
|
168
|
+
action: h,
|
|
170
169
|
rowKey: "id",
|
|
171
170
|
columns: x,
|
|
172
171
|
transformResponse: (t) => {
|
|
@@ -182,6 +181,6 @@ const te = () => {
|
|
|
182
181
|
);
|
|
183
182
|
};
|
|
184
183
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
h as action,
|
|
185
|
+
te as default
|
|
187
186
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as st, g as at, u as it, j as c, Q as ut } from "./index-
|
|
1
|
+
import { c as st, g as at, u as it, j as c, Q as ut } from "./index-jIaB0f6T.chunk.js";
|
|
2
2
|
import { Card as ot, Form as H, Row as ct, Col as E, Input as Z, Select as K, Typography as lt } from "antd";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -355,6 +355,14 @@ const ht = /* @__PURE__ */ at(dt), { Option: G } = K, { Paragraph: B } = lt, gt
|
|
|
355
355
|
ut,
|
|
356
356
|
{
|
|
357
357
|
tableLayout: "fixed",
|
|
358
|
+
rowKey: "id",
|
|
359
|
+
columns: z,
|
|
360
|
+
action: "/api/usystem/log/list",
|
|
361
|
+
transformArg: (f, w, L) => ({ ...L, page: f, size: w }),
|
|
362
|
+
transformResponse: (f) => ({
|
|
363
|
+
list: f.List,
|
|
364
|
+
total: f.Total
|
|
365
|
+
}),
|
|
358
366
|
renderForm: (f) => /* @__PURE__ */ c.jsx(H, { form: f, children: /* @__PURE__ */ c.jsxs(ct, { gutter: 10, children: [
|
|
359
367
|
/* @__PURE__ */ c.jsx(E, { span: 4, children: /* @__PURE__ */ c.jsx(H.Item, { label: p("global.username"), name: "uname", children: /* @__PURE__ */ c.jsx(Z, { allowClear: !0 }) }) }),
|
|
360
368
|
/* @__PURE__ */ c.jsx(E, { span: 4, children: /* @__PURE__ */ c.jsx(H.Item, { label: p("global.route"), name: "route", children: /* @__PURE__ */ c.jsx(Z, { allowClear: !0 }) }) }),
|
|
@@ -363,15 +371,7 @@ const ht = /* @__PURE__ */ at(dt), { Option: G } = K, { Paragraph: B } = lt, gt
|
|
|
363
371
|
/* @__PURE__ */ c.jsx(G, { value: "post", children: "POST" })
|
|
364
372
|
] }) }) }),
|
|
365
373
|
/* @__PURE__ */ c.jsx(E, { span: 4, children: /* @__PURE__ */ c.jsx(H.Item, { label: p("global.label"), name: "label", children: /* @__PURE__ */ c.jsx(Z, { allowClear: !0 }) }) })
|
|
366
|
-
] }) })
|
|
367
|
-
rowKey: "id",
|
|
368
|
-
columns: z,
|
|
369
|
-
url: "/api/usystem/log/list",
|
|
370
|
-
transformArg: (f, w, L) => ({ ...L, page: f, size: w }),
|
|
371
|
-
transformResponse: (f) => ({
|
|
372
|
-
list: f.List,
|
|
373
|
-
total: f.Total
|
|
374
|
-
})
|
|
374
|
+
] }) })
|
|
375
375
|
}
|
|
376
376
|
) });
|
|
377
377
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as S, j as e, b as $ } from "./index-
|
|
1
|
+
import { u as S, j as e, b as $ } from "./index-jIaB0f6T.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 { d as R, e as B } from "./index-
|
|
3
|
+
import { d as R, e as B } from "./index-sZjVIAIn.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: r, onChange: a } = x, [m, p] = P([]), [g, u] = P({}), [c, f] = P(r ?? []), C = S(), h = F((s) => {
|
|
@@ -1,64 +1,63 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { App as R, Space as H, Card as
|
|
3
|
-
import { p as
|
|
1
|
+
import { A as _, _ as M, e as N, b as T, f as b, u as f, j as e, P as j, r as z, H as P, Q as $, h as A } from "./index-jIaB0f6T.chunk.js";
|
|
2
|
+
import { App as R, Space as H, Card as G, Form as m, Input as k } from "antd";
|
|
3
|
+
import { p as S } from "./immer-BLf7GM7E.chunk.js";
|
|
4
4
|
import { Link as B } from "react-router-dom";
|
|
5
|
-
import { P as
|
|
6
|
-
import { a as E, b as V, c as q } from "./index-
|
|
7
|
-
import * as
|
|
5
|
+
import { P as I } from "./index-HtxBCkWB.chunk.js";
|
|
6
|
+
import { a as E, b as V, c as q } from "./index-sZjVIAIn.chunk.js";
|
|
7
|
+
import * as U from "react";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
var F = { 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
10
|
const Q = F;
|
|
11
|
-
var
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
var v = function(a, l) {
|
|
12
|
+
return /* @__PURE__ */ U.createElement(_, M({}, a, {
|
|
13
13
|
ref: l,
|
|
14
14
|
icon: Q
|
|
15
15
|
}));
|
|
16
16
|
};
|
|
17
|
-
process.env.NODE_ENV !== "production" && (
|
|
18
|
-
const D = /* @__PURE__ */
|
|
19
|
-
const { message: d } = R.useApp(), {
|
|
17
|
+
process.env.NODE_ENV !== "production" && (v.displayName = "UsergroupAddOutlined");
|
|
18
|
+
const D = /* @__PURE__ */ U.forwardRef(v), h = "/api/usystem/role/list", K = () => {
|
|
19
|
+
const { message: d } = R.useApp(), { setPayload: a } = b(), l = V(), n = f(), o = async (c) => {
|
|
20
20
|
await l.trigger({
|
|
21
21
|
name: `role_${c.name}`,
|
|
22
22
|
permissions: c.permissions
|
|
23
|
-
}), a(h, { page: 1 }), d.success(
|
|
23
|
+
}), a(h, { page: 1 }), d.success(n("RoleList.createSuccessfully"));
|
|
24
24
|
};
|
|
25
25
|
return A({
|
|
26
|
-
title:
|
|
26
|
+
title: n("RoleList.createTitle"),
|
|
27
27
|
width: "50vw",
|
|
28
28
|
content: (c) => /* @__PURE__ */ e.jsxs(m, { form: c, layout: "vertical", children: [
|
|
29
|
-
/* @__PURE__ */ e.jsx(m.Item, { label:
|
|
30
|
-
/* @__PURE__ */ e.jsx(m.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(
|
|
29
|
+
/* @__PURE__ */ e.jsx(m.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(k, { addonBefore: "role_" }) }),
|
|
30
|
+
/* @__PURE__ */ e.jsx(m.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(I, {}) })
|
|
31
31
|
] }),
|
|
32
|
-
onConfirm:
|
|
32
|
+
onConfirm: o
|
|
33
33
|
});
|
|
34
34
|
}, J = () => {
|
|
35
|
-
const { message: d } = R.useApp(), { mutate: a } = b(), l = q(),
|
|
35
|
+
const { message: d } = R.useApp(), { mutate: a } = b(), l = q(), n = f();
|
|
36
36
|
return A({
|
|
37
|
-
title:
|
|
37
|
+
title: n("RoleList.updateTitle"),
|
|
38
38
|
width: "50vw",
|
|
39
|
-
content: (
|
|
40
|
-
/* @__PURE__ */ e.jsx(m.Item, { label:
|
|
41
|
-
/* @__PURE__ */ e.jsx(m.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(
|
|
39
|
+
content: (o) => /* @__PURE__ */ e.jsxs(m, { form: o, children: [
|
|
40
|
+
/* @__PURE__ */ e.jsx(m.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(k, { readOnly: !0, addonBefore: "role_" }) }),
|
|
41
|
+
/* @__PURE__ */ e.jsx(m.Item, { name: "permissions", children: /* @__PURE__ */ e.jsx(I, {}) })
|
|
42
42
|
] }),
|
|
43
|
-
onConfirm: async (
|
|
43
|
+
onConfirm: async (o, c, p) => {
|
|
44
44
|
await l.trigger({
|
|
45
45
|
id: p.id,
|
|
46
|
-
name: `role_${
|
|
47
|
-
permissions:
|
|
46
|
+
name: `role_${o.name}`,
|
|
47
|
+
permissions: o.permissions
|
|
48
48
|
}), a(
|
|
49
49
|
h,
|
|
50
|
-
|
|
51
|
-
(x) => k(x, (u) => {
|
|
50
|
+
(x) => S(x, (u) => {
|
|
52
51
|
var s;
|
|
53
|
-
const g = (s = u == null ? void 0 : u.list) == null ? void 0 : s.find((
|
|
54
|
-
g && (g.permissions =
|
|
52
|
+
const g = (s = u == null ? void 0 : u.list) == null ? void 0 : s.find((y) => y.id === p.id);
|
|
53
|
+
g && (g.permissions = o.permissions);
|
|
55
54
|
}),
|
|
56
55
|
{ revalidate: !1 }
|
|
57
|
-
), d.success(
|
|
56
|
+
), d.success(n("RoleList.updateSuccessfully"));
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
59
|
}, ie = () => {
|
|
61
|
-
const { accessible: d } =
|
|
60
|
+
const { accessible: d } = N("200005", !0), { modal: a, message: l } = R.useApp(), { usePermissionApiV2: n } = T(), o = E(), { mutate: c } = b(), { show: p, contextHolder: x } = K(), { show: u, contextHolder: g } = J(), s = f(), y = [
|
|
62
61
|
{
|
|
63
62
|
title: s("global.name"),
|
|
64
63
|
key: "name",
|
|
@@ -82,7 +81,7 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
82
81
|
align: "center",
|
|
83
82
|
render: (i) => /* @__PURE__ */ e.jsxs(H, { size: "small", children: [
|
|
84
83
|
/* @__PURE__ */ e.jsx(
|
|
85
|
-
|
|
84
|
+
j,
|
|
86
85
|
{
|
|
87
86
|
isGlobalNS: !0,
|
|
88
87
|
code: "200003",
|
|
@@ -90,7 +89,7 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
90
89
|
type: "link",
|
|
91
90
|
onClick: async () => {
|
|
92
91
|
const { data: t } = await z(
|
|
93
|
-
`/api/usystem/role/info${
|
|
92
|
+
`/api/usystem/role/info${n ? "V2" : ""}?name=${i.name}`,
|
|
94
93
|
{ isGlobalNS: !0 }
|
|
95
94
|
);
|
|
96
95
|
u({
|
|
@@ -107,7 +106,7 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
107
106
|
}
|
|
108
107
|
),
|
|
109
108
|
/* @__PURE__ */ e.jsx(
|
|
110
|
-
|
|
109
|
+
j,
|
|
111
110
|
{
|
|
112
111
|
isGlobalNS: !0,
|
|
113
112
|
danger: !0,
|
|
@@ -117,14 +116,14 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
117
116
|
onClick: () => {
|
|
118
117
|
a.confirm({
|
|
119
118
|
title: s("RoleList.deleteTitle"),
|
|
120
|
-
content: /* @__PURE__ */ e.jsx(
|
|
119
|
+
content: /* @__PURE__ */ e.jsx(P, { texts: [i.name], children: s("RoleList.deleteContent", { role: i.name }) }),
|
|
121
120
|
async onOk() {
|
|
122
|
-
await
|
|
121
|
+
await o.trigger({
|
|
123
122
|
id: i.id,
|
|
124
123
|
name: i.name
|
|
125
|
-
}), c(h,
|
|
124
|
+
}), c(h, (t) => S(t, (r) => {
|
|
126
125
|
var C, L;
|
|
127
|
-
const w = (C = r == null ? void 0 : r.list) == null ? void 0 : C.findIndex((
|
|
126
|
+
const w = (C = r == null ? void 0 : r.list) == null ? void 0 : C.findIndex((O) => O.id === i.id);
|
|
128
127
|
w && ((L = r == null ? void 0 : r.list) == null || L.splice(w, 1));
|
|
129
128
|
})), l.success(s("RoleList.deleteSuccessfully"));
|
|
130
129
|
}
|
|
@@ -137,11 +136,11 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
137
136
|
}
|
|
138
137
|
];
|
|
139
138
|
return /* @__PURE__ */ e.jsxs(
|
|
140
|
-
|
|
139
|
+
G,
|
|
141
140
|
{
|
|
142
141
|
title: s("global.role"),
|
|
143
142
|
extra: /* @__PURE__ */ e.jsx(
|
|
144
|
-
|
|
143
|
+
j,
|
|
145
144
|
{
|
|
146
145
|
isGlobalNS: !0,
|
|
147
146
|
type: "primary",
|
|
@@ -155,13 +154,13 @@ const D = /* @__PURE__ */ I.forwardRef(U), h = "/api/usystem/role/list", K = ()
|
|
|
155
154
|
),
|
|
156
155
|
children: [
|
|
157
156
|
/* @__PURE__ */ e.jsx(
|
|
158
|
-
|
|
157
|
+
$,
|
|
159
158
|
{
|
|
160
159
|
isGlobalNS: !0,
|
|
161
160
|
rowKey: "name",
|
|
162
|
-
columns:
|
|
161
|
+
columns: y,
|
|
163
162
|
code: "200001",
|
|
164
|
-
|
|
163
|
+
action: h,
|
|
165
164
|
transformResponse: (i) => {
|
|
166
165
|
const { List: t, Total: r } = i;
|
|
167
166
|
return { list: t, total: r };
|