react-toolkits 0.8.21 → 0.8.22

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,187 +0,0 @@
1
- import { A as M, _ as N, u as b, a as U, j as e, P as j, H as z, Q as H, b as A } from "./index-2I_COrHX.chunk.js";
2
- import { App as y, Row as R, Col as E, Tag as w, Space as G, Card as _, Form as u, Input as L, Select as C } from "antd";
3
- import { p as I } from "./immer-BLf7GM7E.chunk.js";
4
- import { Link as D } from "react-router-dom";
5
- import { u as P, a as Q, b as k, c as V } from "./index-EAawrEpf.chunk.js";
6
- import * as O 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 q = $;
10
- var v = function(c, a) {
11
- return /* @__PURE__ */ O.createElement(M, N({}, c, {
12
- ref: a,
13
- icon: q
14
- }));
15
- };
16
- process.env.NODE_ENV !== "production" && (v.displayName = "UserAddOutlined");
17
- const B = /* @__PURE__ */ O.forwardRef(v), { Option: F } = C, g = "/api/usystem/user/list";
18
- function K() {
19
- const { message: d } = y.useApp(), c = Q(), { data: a, isLoading: m } = k(), { setPayload: p } = b(), n = U();
20
- return A({
21
- title: n("UserList.createTitle"),
22
- content: (o) => /* @__PURE__ */ e.jsxs(u, { form: o, labelCol: { flex: "80px" }, children: [
23
- /* @__PURE__ */ e.jsx(u.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(L, {}) }),
24
- /* @__PURE__ */ e.jsx(u.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(C, { allowClear: !0, mode: "multiple", loading: m, children: (a ?? []).map((r) => /* @__PURE__ */ e.jsx(F, { value: r.name, children: r.name }, r.id)) }) })
25
- ] }),
26
- async onConfirm(o) {
27
- await c.trigger(o), p(g, { page: 1 }), d.success(n("UserList.createSuccessfully"));
28
- }
29
- });
30
- }
31
- function J() {
32
- const { message: d } = y.useApp(), c = V(), { data: a, isLoading: m } = k(), { mutate: p } = b(), n = U();
33
- return A({
34
- title: n("UserList.updateTitle"),
35
- content: (o) => /* @__PURE__ */ e.jsxs(u, { form: o, labelCol: { flex: "80px" }, children: [
36
- /* @__PURE__ */ e.jsx(u.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(L, { readOnly: !0 }) }),
37
- /* @__PURE__ */ e.jsx(u.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(
38
- C,
39
- {
40
- allowClear: !0,
41
- mode: "multiple",
42
- loading: m,
43
- options: a == null ? void 0 : a.map((r) => ({
44
- label: r.name,
45
- value: r.name
46
- })),
47
- dropdownStyle: { zIndex: 9999 }
48
- }
49
- ) })
50
- ] }),
51
- async onConfirm(o, r, s) {
52
- await c.trigger(o), p(
53
- g,
54
- (h) => I(h, (t) => {
55
- var l;
56
- if (t != null && t.dataSource) {
57
- const i = (l = t.dataSource) == null ? void 0 : l.findIndex((x) => x.id === s.id);
58
- i !== -1 && (t.dataSource[i].roles = o.roles);
59
- }
60
- }),
61
- { revalidate: !1 }
62
- ), d.success(n("UserList.updateSuccessfully"));
63
- }
64
- });
65
- }
66
- const se = () => {
67
- const { modal: d, message: c } = y.useApp(), a = P(), { mutate: m } = b(), { show: p, contextHolder: n } = K(), { show: o, contextHolder: r } = J(), s = U(), h = [
68
- {
69
- title: s("global.name"),
70
- dataIndex: "name",
71
- key: "name"
72
- },
73
- {
74
- title: "ID",
75
- dataIndex: "id",
76
- key: "id"
77
- },
78
- {
79
- title: s("global.role"),
80
- dataIndex: "roles",
81
- key: "roles",
82
- width: "40%",
83
- render(t) {
84
- return /* @__PURE__ */ e.jsx(R, { gutter: [4, 4], children: (t || []).map((l) => /* @__PURE__ */ e.jsx(E, { children: l === "root" ? /* @__PURE__ */ e.jsx(w, { color: "#f50", children: l }) : /* @__PURE__ */ e.jsx(w, { color: "#ff5a00", children: /* @__PURE__ */ e.jsx(D, { to: `/permission/role/${l}`, children: l }) }) }, l)) });
85
- }
86
- },
87
- {
88
- title: s("global.creationTime"),
89
- dataIndex: "Ctime",
90
- key: "ctime"
91
- },
92
- {
93
- title: s("global.operation"),
94
- width: 150,
95
- align: "center",
96
- render: (t) => /* @__PURE__ */ e.jsxs(G, { children: [
97
- /* @__PURE__ */ e.jsx(
98
- j,
99
- {
100
- isGlobalNS: !0,
101
- size: "small",
102
- type: "link",
103
- code: "100003",
104
- onClick: () => {
105
- o({
106
- initialValues: {
107
- name: t.name,
108
- roles: t.roles
109
- },
110
- extraValues: {
111
- id: t.id
112
- }
113
- });
114
- },
115
- children: s("global.update")
116
- }
117
- ),
118
- /* @__PURE__ */ e.jsx(
119
- j,
120
- {
121
- isGlobalNS: !0,
122
- danger: !0,
123
- size: "small",
124
- code: "100004",
125
- type: "link",
126
- onClick: () => {
127
- d.confirm({
128
- title: s("UserList.deleteTitle"),
129
- content: /* @__PURE__ */ e.jsx(z, { texts: [t.name], children: s("UserList.deleteContent", { user: t.name }) }),
130
- async onOk() {
131
- await a.trigger({
132
- id: t.id,
133
- name: t.name
134
- }), m(g, (l) => I(l, (i) => {
135
- var S, f;
136
- const x = (S = i == null ? void 0 : i.dataSource) == null ? void 0 : S.findIndex((T) => T.id === t.id);
137
- x && ((f = i == null ? void 0 : i.dataSource) == null || f.splice(x, 1));
138
- })), c.success(s("UserList.deleteSuccessfully"));
139
- }
140
- });
141
- },
142
- children: s("global.delete")
143
- }
144
- )
145
- ] })
146
- }
147
- ];
148
- return /* @__PURE__ */ e.jsxs(
149
- _,
150
- {
151
- title: s("global.user"),
152
- extra: /* @__PURE__ */ e.jsx(
153
- j,
154
- {
155
- isGlobalNS: !0,
156
- type: "primary",
157
- icon: /* @__PURE__ */ e.jsx(B, {}),
158
- code: "100002",
159
- onClick: () => {
160
- p();
161
- },
162
- children: s("UserList.createTitle")
163
- }
164
- ),
165
- children: [
166
- /* @__PURE__ */ e.jsx(
167
- H,
168
- {
169
- isGlobalNS: !0,
170
- code: "100001",
171
- action: g,
172
- rowKey: "id",
173
- columns: h,
174
- getTotal: (t) => t.Total,
175
- getDataSource: (t) => t.List
176
- }
177
- ),
178
- n,
179
- r
180
- ]
181
- }
182
- );
183
- };
184
- export {
185
- g as action,
186
- se as default
187
- };