smart-admin-web 10.24.0 → 10.25.0
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/api/index.d.ts +20 -1
- package/dist/api/index.js +23 -8
- package/dist/api/index.js.map +1 -1
- package/dist/api/schema.d.ts +321 -2
- package/dist/components/OrgTreeSelect/index.vue.js +32 -20
- package/dist/components/OrgTreeSelect/index.vue.js.map +1 -1
- package/dist/components/RoleSelect/index.vue.js +12 -14
- package/dist/components/RoleSelect/index.vue.js.map +1 -1
- package/dist/components/UserPicker/index.vue.js +2 -2
- package/dist/components/UserPicker/index2.vue.js +179 -208
- package/dist/components/UserPicker/index2.vue.js.map +1 -1
- package/dist/components/UserSelect/index.vue.js +10 -10
- package/dist/components/UserSelect/index.vue.js.map +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/locales/en-US.d.ts +3 -2
- package/dist/locales/en-US.js +5 -3
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/zh-CN.d.ts +3 -2
- package/dist/locales/zh-CN.js +5 -3
- package/dist/locales/zh-CN.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/api.d.ts +22 -0
- package/dist/types/api.js.map +1 -1
- package/dist/views/system/user/index.vue.js +2 -2
- package/dist/views/system/user/index2.vue.js +266 -257
- package/dist/views/system/user/index2.vue.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,152 +1,156 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useStorage as
|
|
3
|
-
import { useRoute as
|
|
4
|
-
import { useMessage as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { SmartTable as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
1
|
+
import { defineComponent as Fe, ref as i, computed as p, watch as de, onMounted as De, h as d, resolveDirective as Le, openBlock as c, createElementBlock as W, Fragment as Ge, createVNode as n, unref as l, withCtx as u, createElementVNode as y, toDisplayString as b, createCommentVNode as N, createBlock as k, createTextVNode as I, normalizeClass as J, createSlots as $e, withDirectives as pe, isRef as Be } from "vue";
|
|
2
|
+
import { useStorage as Ke, createReusableTemplate as qe } from "@vueuse/core";
|
|
3
|
+
import { useRoute as He } from "vue-router";
|
|
4
|
+
import { useMessage as Ve, NAvatar as je, NTag as We, NSpace as Je, NButton as x, NPopconfirm as Qe, NDropdown as Xe, NTooltip as me, NInput as Ye, NSpin as Ze, NEmpty as er, NTree as rr } from "naive-ui";
|
|
5
|
+
import { useI18n as tr } from "vue-i18n";
|
|
6
|
+
import { SmartTable as or } from "smart-naive-table";
|
|
7
|
+
import f from "../../../components/AppIcon.vue.js";
|
|
8
|
+
import lr from "../../../components/StatusSwitch/index.vue.js";
|
|
9
|
+
import ar from "../../../components/DictTag/index.vue.js";
|
|
10
|
+
import sr from "../../../components/ImportWizard/index.vue.js";
|
|
11
|
+
import nr from "../../../components/ExportColumnsModal/index.vue.js";
|
|
12
|
+
import ir from "../../../components/SidePanelDrawer/index.vue.js";
|
|
13
13
|
/* empty css */
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { useConfirm as
|
|
19
|
-
import { useBatchDelete as
|
|
20
|
-
import { useSidePanel as
|
|
21
|
-
import { userApi as m, positionApi as
|
|
22
|
-
import { useAuthStore as
|
|
23
|
-
import { useUserStore as
|
|
24
|
-
import { translateError as
|
|
25
|
-
import { presetEqualFilter as
|
|
26
|
-
import { TABLE_TOOLBAR as
|
|
27
|
-
import
|
|
28
|
-
import { triggerBlobDownload as
|
|
29
|
-
import { buildTree as
|
|
30
|
-
const
|
|
14
|
+
import ur from "./components/UserFormModal.vue.js";
|
|
15
|
+
import dr from "./components/ResetPasswordModal.vue.js";
|
|
16
|
+
import pr from "./components/UserGrantMenuSheet.vue.js";
|
|
17
|
+
import mr from "./components/UserGrantOverviewDrawer2.vue.js";
|
|
18
|
+
import { useConfirm as cr } from "../../../composables/useConfirm.js";
|
|
19
|
+
import { useBatchDelete as fr } from "../../../composables/useBatchDelete.js";
|
|
20
|
+
import { useSidePanel as vr } from "../../../composables/useSidePanel.js";
|
|
21
|
+
import { userApi as m, positionApi as gr, roleApi as hr, orgApi as yr, mfaApi as wr } from "../../../api/index.js";
|
|
22
|
+
import { useAuthStore as br } from "../../../stores/auth.js";
|
|
23
|
+
import { useUserStore as kr } from "../../../stores/user.js";
|
|
24
|
+
import { translateError as ce } from "../../../utils/error.js";
|
|
25
|
+
import { presetEqualFilter as xr, SEARCH_ACTIONS as Q, deriveHeaderFilters as Sr, flatSearchOf as _r } from "../../../utils/tableFilter.js";
|
|
26
|
+
import { TABLE_TOOLBAR as Er, TABLE_MIN_ROW_HEIGHT as Or } from "../../../utils/tableToolbar.js";
|
|
27
|
+
import Pr from "../../../components/TableTotal/index.vue.js";
|
|
28
|
+
import { triggerBlobDownload as Tr } from "../../../utils/download.js";
|
|
29
|
+
import { buildTree as Nr, expandableIds as Ir, rootExpandableIds as Ar } from "../../../utils/tree.js";
|
|
30
|
+
const Cr = { class: "side-filter__head" }, Rr = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "side-filter__title"
|
|
33
|
-
},
|
|
33
|
+
}, zr = { class: "side-filter__actions" }, Mr = ["aria-label"], Ur = ["aria-label"], Fr = { class: "side-row__label" }, Dr = { class: "user-layout side-page" }, Lr = ["inert"], Gr = 15, ht = /* @__PURE__ */ Fe({
|
|
34
34
|
__name: "index",
|
|
35
|
-
setup(
|
|
36
|
-
const { t } =
|
|
35
|
+
setup($r) {
|
|
36
|
+
const { t } = tr(), A = Ve(), { run: fe, confirm: ve } = cr(), v = br(), g = i(), { checkedKeys: X, run: ge } = fr({
|
|
37
37
|
remove: m.batchRemove,
|
|
38
38
|
refresh: () => {
|
|
39
39
|
var e;
|
|
40
|
-
return (e =
|
|
40
|
+
return (e = g.value) == null ? void 0 : e.refresh();
|
|
41
41
|
},
|
|
42
42
|
successMsg: t("user.deleted")
|
|
43
|
-
}), U =
|
|
43
|
+
}), U = i(null), F = i(null), D = i(null), he = kr(), ye = p(() => {
|
|
44
44
|
var e;
|
|
45
|
-
return (e =
|
|
46
|
-
}),
|
|
47
|
-
async function
|
|
45
|
+
return (e = he.userInfo) == null ? void 0 : e.userId;
|
|
46
|
+
}), C = i(!1);
|
|
47
|
+
async function we(e) {
|
|
48
48
|
var r;
|
|
49
|
-
|
|
49
|
+
C.value = !0;
|
|
50
50
|
try {
|
|
51
|
-
await
|
|
51
|
+
await ve({
|
|
52
52
|
content: t("user.clearMfaConfirm", { name: e.name }),
|
|
53
|
-
action: () =>
|
|
53
|
+
action: () => wr.clear({ userId: e.id }),
|
|
54
54
|
successMsg: t("user.mfaCleared")
|
|
55
|
-
}) && ((r =
|
|
55
|
+
}) && ((r = g.value) == null || r.refresh());
|
|
56
56
|
} finally {
|
|
57
|
-
|
|
57
|
+
C.value = !1;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const Y =
|
|
61
|
-
() =>
|
|
60
|
+
const Y = i([]), L = i([]), Z = i([]), S = i([]), ee = i(!0), re = i(!1), G = p(() => Nr(S.value)), h = i(null), te = p(
|
|
61
|
+
() => h.value == null ? {} : { orgId: h.value }
|
|
62
62
|
);
|
|
63
|
-
function
|
|
64
|
-
|
|
63
|
+
function be(e) {
|
|
64
|
+
oe(e.length ? Number(e[0]) : null);
|
|
65
65
|
}
|
|
66
|
-
const { compact:
|
|
67
|
-
function
|
|
68
|
-
|
|
66
|
+
const { compact: _, drawerOpen: E } = vr(), O = Ke("sa-user-org-panel-hidden", !1);
|
|
67
|
+
function oe(e) {
|
|
68
|
+
h.value = e, E.value = !1;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
70
|
+
function ke() {
|
|
71
|
+
_.value ? E.value = !0 : O.value = !1;
|
|
72
72
|
}
|
|
73
|
-
const [
|
|
73
|
+
const [xe, le] = qe(), Se = p(
|
|
74
74
|
() => {
|
|
75
75
|
var e;
|
|
76
|
-
return ((e = S.value.find((r) => r.id ===
|
|
76
|
+
return ((e = S.value.find((r) => r.id === h.value)) == null ? void 0 : e.name) ?? t("user.orgFilter");
|
|
77
77
|
}
|
|
78
|
-
),
|
|
79
|
-
function
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const o = r;
|
|
83
|
-
return o.name.toLowerCase().includes(u) || (o.code ?? "").toLowerCase().includes(u);
|
|
78
|
+
), _e = p(() => S.value.length > Gr), $ = i(""), Ee = () => d(f, { icon: "ph:caret-right", size: 12 });
|
|
79
|
+
function Oe(e, r) {
|
|
80
|
+
const s = e.trim().toLowerCase();
|
|
81
|
+
return s ? r.name.toLowerCase().includes(s) : !0;
|
|
84
82
|
}
|
|
85
|
-
const w =
|
|
86
|
-
() =>
|
|
87
|
-
),
|
|
88
|
-
() =>
|
|
83
|
+
const w = i([]), R = p(() => Ir(G.value)), B = p(() => Ar(G.value)), K = p(
|
|
84
|
+
() => R.value.length > 0 && w.value.length >= R.value.length
|
|
85
|
+
), Pe = p(
|
|
86
|
+
() => R.value.length > B.value.length
|
|
89
87
|
), ae = p(
|
|
90
88
|
() => K.value ? t("user.collapseToFirstLevel") : t("common.expandAll")
|
|
91
89
|
);
|
|
92
|
-
function
|
|
93
|
-
w.value = K.value ? [...B.value] : [...
|
|
90
|
+
function Te() {
|
|
91
|
+
w.value = K.value ? [...B.value] : [...R.value];
|
|
94
92
|
}
|
|
95
|
-
|
|
96
|
-
var
|
|
93
|
+
de(h, (e) => {
|
|
94
|
+
var a;
|
|
97
95
|
if (e == null) return;
|
|
98
|
-
const r = new Map(S.value.map((
|
|
99
|
-
let o = ((
|
|
96
|
+
const r = new Map(S.value.map((T) => [T.id, T])), s = new Set(w.value);
|
|
97
|
+
let o = ((a = r.get(e)) == null ? void 0 : a.parentId) ?? 0;
|
|
100
98
|
for (; o && r.has(o); )
|
|
101
|
-
|
|
102
|
-
w.value = [...
|
|
99
|
+
s.add(o), o = r.get(o).parentId;
|
|
100
|
+
w.value = [...s];
|
|
103
101
|
}), De(async () => {
|
|
102
|
+
const e = [];
|
|
104
103
|
try {
|
|
105
|
-
const
|
|
106
|
-
Y.value =
|
|
104
|
+
const r = await gr.options();
|
|
105
|
+
Y.value = r.map((s) => ({ label: s.name, value: s.id }));
|
|
107
106
|
} catch {
|
|
107
|
+
e.push(t("user.position"));
|
|
108
108
|
}
|
|
109
109
|
try {
|
|
110
|
-
const
|
|
111
|
-
L.value =
|
|
110
|
+
const r = await hr.options();
|
|
111
|
+
L.value = r.map((s) => ({ label: s.name, value: s.id }));
|
|
112
112
|
} catch {
|
|
113
|
+
e.push(t("user.roles"));
|
|
113
114
|
}
|
|
114
115
|
try {
|
|
115
|
-
const { items:
|
|
116
|
-
Z.value =
|
|
116
|
+
const { items: r } = await m.options({ page: 1, pageSize: 200 });
|
|
117
|
+
Z.value = r.map((s) => ({ label: `${s.name}(${s.account})`, value: s.id }));
|
|
117
118
|
} catch {
|
|
119
|
+
e.push(t("user.director"));
|
|
118
120
|
}
|
|
121
|
+
e.length && A.warning(t("user.optionsLoadFailed", { names: e.join(" / ") }));
|
|
119
122
|
try {
|
|
120
|
-
S.value = await
|
|
123
|
+
S.value = await yr.options(), w.value = [...B.value];
|
|
121
124
|
} catch {
|
|
125
|
+
re.value = !0;
|
|
122
126
|
} finally {
|
|
123
127
|
ee.value = !1;
|
|
124
128
|
}
|
|
125
129
|
});
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
[
|
|
130
|
+
const se = He();
|
|
131
|
+
de(
|
|
132
|
+
[g, () => se.query.roleId],
|
|
129
133
|
([e, r]) => {
|
|
130
|
-
e &&
|
|
134
|
+
e && se.path === "/system/user" && xr(e, "roleId", r == null ? void 0 : Number(r));
|
|
131
135
|
},
|
|
132
136
|
{ immediate: !0 }
|
|
133
137
|
);
|
|
134
|
-
const
|
|
135
|
-
function
|
|
138
|
+
const ne = (e) => (e || "?").slice(0, 1), q = i(!1), z = i(!1), H = i(!1), M = i(!1), ie = i(null);
|
|
139
|
+
function Ne() {
|
|
136
140
|
var e, r;
|
|
137
|
-
(e =
|
|
141
|
+
(e = g.value) == null || e.refresh(), M.value && ((r = ie.value) == null || r.refresh());
|
|
138
142
|
}
|
|
139
|
-
const
|
|
143
|
+
const Ie = p(
|
|
140
144
|
() => [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
v.hasPerm("POST:/api/v1/sys/user/import/preview") ? { label: t("import.button"), key: "import" } : null,
|
|
146
|
+
v.hasPerm("GET:/api/v1/sys/user/export") ? { label: t("export.button"), key: "export" } : null,
|
|
147
|
+
v.hasPerm("GET:/api/v1/sys/user/menu-grants/page") ? { label: t("userGrant.overview"), key: "grantOverview" } : null
|
|
144
148
|
].filter((e) => e !== null)
|
|
145
|
-
),
|
|
146
|
-
function
|
|
147
|
-
e === "import" ? q.value = !0 : e === "export" ?
|
|
149
|
+
), Ae = p(() => ({ ...Er, more: Ie.value }));
|
|
150
|
+
function Ce(e) {
|
|
151
|
+
e === "import" ? q.value = !0 : e === "export" ? z.value = !0 : e === "grantOverview" && (M.value = !0);
|
|
148
152
|
}
|
|
149
|
-
const
|
|
153
|
+
const Re = [
|
|
150
154
|
{ key: "Account", title: t("userExport.account") },
|
|
151
155
|
{ key: "Name", title: t("userExport.name") },
|
|
152
156
|
{ key: "Nickname", title: t("userExport.nickname") },
|
|
@@ -159,39 +163,39 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
159
163
|
{ key: "Enabled", title: t("userExport.enabled") },
|
|
160
164
|
{ key: "IsSuperAdmin", title: t("userExport.superAdmin"), defaultSelected: !1 },
|
|
161
165
|
{ key: "CreateTime", title: t("userExport.createTime") }
|
|
162
|
-
],
|
|
166
|
+
], ze = {
|
|
163
167
|
downloadTemplate: () => m.importTemplate(),
|
|
164
168
|
preview: (e, r) => m.importPreview(e, r),
|
|
165
169
|
validate: (e) => m.importValidate(e),
|
|
166
170
|
commit: (e, r) => m.importCommit(e, r),
|
|
167
171
|
errorReport: (e) => m.importErrorReport(e)
|
|
168
|
-
}, V =
|
|
169
|
-
function
|
|
172
|
+
}, V = i(null);
|
|
173
|
+
function Me(e) {
|
|
170
174
|
const r = Array.isArray(e) ? e[0] : e;
|
|
171
175
|
V.value = r && r.order ? { field: String(r.columnKey), order: r.order === "ascend" ? "asc" : "desc" } : null;
|
|
172
176
|
}
|
|
173
|
-
async function
|
|
174
|
-
var
|
|
175
|
-
const r =
|
|
177
|
+
async function Ue(e) {
|
|
178
|
+
var s, o;
|
|
179
|
+
const r = _r(g.value);
|
|
176
180
|
H.value = !0;
|
|
177
181
|
try {
|
|
178
|
-
const
|
|
182
|
+
const a = await m.export({
|
|
179
183
|
account: r.account || void 0,
|
|
180
184
|
name: r.name || void 0,
|
|
181
|
-
orgId:
|
|
185
|
+
orgId: te.value.orgId,
|
|
182
186
|
roleId: r.roleId != null ? Number(r.roleId) : void 0,
|
|
183
|
-
sortField: (
|
|
187
|
+
sortField: (s = V.value) == null ? void 0 : s.field,
|
|
184
188
|
sortOrder: (o = V.value) == null ? void 0 : o.order,
|
|
185
189
|
columns: e.join(",")
|
|
186
190
|
});
|
|
187
|
-
|
|
188
|
-
} catch (
|
|
189
|
-
|
|
191
|
+
Tr(a, t("userExport.fileName")), z.value = !1, A.success(t("export.done"));
|
|
192
|
+
} catch (a) {
|
|
193
|
+
A.error(ce(a));
|
|
190
194
|
} finally {
|
|
191
195
|
H.value = !1;
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
|
-
const
|
|
198
|
+
const P = () => d("span", { class: "faint" }, "—"), j = (e) => () => d(f, { icon: e, size: 16 }), ue = [
|
|
195
199
|
{ type: "index", title: () => t("common.rowNo"), width: 64, align: "center" },
|
|
196
200
|
// 超管行禁勾:批量删除同样不可含超管(后端也会整体拒绝)
|
|
197
201
|
{ type: "selection", disabled: (e) => e.isSuperAdmin },
|
|
@@ -204,9 +208,9 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
204
208
|
card: !1,
|
|
205
209
|
// 窄档卡片的标题是姓名,头像不进卡片
|
|
206
210
|
render: (e) => d(
|
|
207
|
-
|
|
211
|
+
je,
|
|
208
212
|
{ round: !0, size: "small", src: e.avatar || void 0 },
|
|
209
|
-
e.avatar ? { fallback: () =>
|
|
213
|
+
e.avatar ? { fallback: () => ne(e.name) } : { default: () => ne(e.name) }
|
|
210
214
|
)
|
|
211
215
|
},
|
|
212
216
|
{
|
|
@@ -230,7 +234,7 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
230
234
|
ellipsis: { tooltip: !0 },
|
|
231
235
|
title: () => t("user.phone"),
|
|
232
236
|
sorter: !0,
|
|
233
|
-
render: (e) => e.phone ? d("span", { class: "num" }, e.phone) :
|
|
237
|
+
render: (e) => e.phone ? d("span", { class: "num" }, e.phone) : P()
|
|
234
238
|
},
|
|
235
239
|
{
|
|
236
240
|
key: "gender",
|
|
@@ -238,7 +242,7 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
238
242
|
width: 80,
|
|
239
243
|
hideInTable: !0,
|
|
240
244
|
// 次要列:默认隐藏收窄整表,列设置抽屉可打开
|
|
241
|
-
render: (e) => e.gender ? d(
|
|
245
|
+
render: (e) => e.gender ? d(ar, { typeCode: "gender", value: e.gender }) : P()
|
|
242
246
|
},
|
|
243
247
|
// 只作搜索项,不进表格也不进列设置。options 直接吃编辑表单已拉好的 roleOptions(SmartTable 支持 Ref 选项源),不额外发请求;
|
|
244
248
|
// 列上有 options,搜索控件自动是 select。
|
|
@@ -253,23 +257,23 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
253
257
|
key: "orgName",
|
|
254
258
|
ellipsis: { tooltip: !0 },
|
|
255
259
|
title: () => t("user.org"),
|
|
256
|
-
render: (e) => e.orgName ||
|
|
260
|
+
render: (e) => e.orgName || P()
|
|
257
261
|
},
|
|
258
262
|
{
|
|
259
263
|
key: "positionName",
|
|
260
264
|
title: () => t("user.position"),
|
|
261
265
|
hideInTable: !0,
|
|
262
|
-
render: (e) => e.positionName ||
|
|
266
|
+
render: (e) => e.positionName || P()
|
|
263
267
|
},
|
|
264
268
|
{
|
|
265
269
|
key: "enabled",
|
|
266
270
|
title: () => t("user.status"),
|
|
267
271
|
width: 90,
|
|
268
272
|
sorter: !0,
|
|
269
|
-
render: (e) => d(
|
|
273
|
+
render: (e) => d(lr, {
|
|
270
274
|
value: e.enabled,
|
|
271
275
|
// 超管不可停用(防自锁 —— 停了就没法从 UI 恢复;后端也保护);无启停权限亦置灰。
|
|
272
|
-
disabled: e.isSuperAdmin || !
|
|
276
|
+
disabled: e.isSuperAdmin || !v.hasPerm("PUT:/api/v1/sys/user/{id}/enabled"),
|
|
273
277
|
confirm: (r) => r ? null : t("user.disableConfirm", { name: e.name }),
|
|
274
278
|
request: (r) => m.setEnabled(e.id, r),
|
|
275
279
|
"onUpdate:value": (r) => {
|
|
@@ -281,7 +285,7 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
281
285
|
key: "isSuperAdmin",
|
|
282
286
|
title: () => t("user.superAdmin"),
|
|
283
287
|
width: 90,
|
|
284
|
-
render: (e) => e.isSuperAdmin ? d(
|
|
288
|
+
render: (e) => e.isSuperAdmin ? d(We, { type: "warning", size: "small", bordered: !1 }, () => t("user.superAdmin")) : P()
|
|
285
289
|
},
|
|
286
290
|
{
|
|
287
291
|
key: "createTime",
|
|
@@ -300,19 +304,19 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
300
304
|
// 钉右:横向滚动时操作列始终可见
|
|
301
305
|
hideInSetting: !0,
|
|
302
306
|
render: (e) => {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
e.totpEnabled &&
|
|
307
|
+
const s = [
|
|
308
|
+
v.hasPerm("PUT:/api/v1/sys/user/menu") && !e.isSuperAdmin && e.id !== ye.value ? { key: "grantMenus", label: t("userGrant.action"), icon: j("ph:list-checks") } : null,
|
|
309
|
+
v.hasPerm("PUT:/api/v1/sys/user/{id}/password") ? { key: "resetPassword", label: t("user.resetPassword"), icon: j("ph:key") } : null,
|
|
310
|
+
e.totpEnabled && v.hasPerm("POST:/api/v1/sys/mfa/clear") ? {
|
|
307
311
|
key: "clearMfa",
|
|
308
312
|
label: t("user.clearMfa"),
|
|
309
313
|
icon: j("ph:link-break"),
|
|
310
|
-
disabled:
|
|
314
|
+
disabled: C.value
|
|
311
315
|
} : null
|
|
312
316
|
].filter((o) => o !== null);
|
|
313
|
-
return d(
|
|
314
|
-
|
|
315
|
-
|
|
317
|
+
return d(Je, { size: 4, wrap: !1, wrapItem: !1 }, () => [
|
|
318
|
+
v.hasPerm("PUT:/api/v1/sys/user/{id}") ? d(
|
|
319
|
+
x,
|
|
316
320
|
{
|
|
317
321
|
size: "small",
|
|
318
322
|
quaternary: !0,
|
|
@@ -324,45 +328,45 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
324
328
|
},
|
|
325
329
|
() => t("common.edit")
|
|
326
330
|
) : null,
|
|
327
|
-
e.isSuperAdmin || !
|
|
328
|
-
|
|
331
|
+
e.isSuperAdmin || !v.hasPerm("DELETE:/api/v1/sys/user/{id}") ? null : d(
|
|
332
|
+
Qe,
|
|
329
333
|
{
|
|
330
|
-
onPositiveClick: () =>
|
|
331
|
-
var
|
|
332
|
-
o && ((
|
|
334
|
+
onPositiveClick: () => fe(() => m.remove(e.id), t("user.deleted")).then((o) => {
|
|
335
|
+
var a;
|
|
336
|
+
o && ((a = g.value) == null || a.refresh());
|
|
333
337
|
})
|
|
334
338
|
},
|
|
335
339
|
{
|
|
336
340
|
trigger: () => d(
|
|
337
|
-
|
|
341
|
+
x,
|
|
338
342
|
{ size: "small", quaternary: !0, type: "error" },
|
|
339
343
|
() => t("common.delete")
|
|
340
344
|
),
|
|
341
345
|
default: () => t("user.deleteConfirm", { name: e.name })
|
|
342
346
|
}
|
|
343
347
|
),
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
s.length ? d(
|
|
349
|
+
Xe,
|
|
346
350
|
{
|
|
347
351
|
trigger: "click",
|
|
348
|
-
options:
|
|
352
|
+
options: s,
|
|
349
353
|
onSelect: (o) => {
|
|
350
|
-
var
|
|
351
|
-
o === "resetPassword" ? (
|
|
354
|
+
var a, T;
|
|
355
|
+
o === "resetPassword" ? (a = F.value) == null || a.openReset(e) : o === "clearMfa" ? we(e) : o === "grantMenus" && ((T = D.value) == null || T.open({ id: e.id, name: e.name }));
|
|
352
356
|
}
|
|
353
357
|
},
|
|
354
358
|
() => d(
|
|
355
|
-
|
|
359
|
+
x,
|
|
356
360
|
{
|
|
357
361
|
size: "small",
|
|
358
362
|
quaternary: !0,
|
|
359
363
|
type: "primary",
|
|
360
364
|
iconPlacement: "right",
|
|
361
|
-
loading:
|
|
365
|
+
loading: C.value
|
|
362
366
|
},
|
|
363
367
|
{
|
|
364
368
|
default: () => t("common.more"),
|
|
365
|
-
icon: () => d(
|
|
369
|
+
icon: () => d(f, { icon: "ph:caret-down", size: 12 })
|
|
366
370
|
}
|
|
367
371
|
)
|
|
368
372
|
) : null
|
|
@@ -370,89 +374,94 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
370
374
|
}
|
|
371
375
|
}
|
|
372
376
|
];
|
|
373
|
-
return
|
|
374
|
-
const
|
|
375
|
-
return
|
|
376
|
-
|
|
377
|
-
default:
|
|
378
|
-
y("div",
|
|
379
|
-
o ?
|
|
380
|
-
y("div",
|
|
381
|
-
|
|
382
|
-
trigger:
|
|
377
|
+
return Sr(ue), (e, r) => {
|
|
378
|
+
const s = Le("auth");
|
|
379
|
+
return c(), W(Ge, null, [
|
|
380
|
+
n(l(xe), null, {
|
|
381
|
+
default: u(({ drawer: o }) => [
|
|
382
|
+
y("div", Cr, [
|
|
383
|
+
o ? N("", !0) : (c(), W("span", Rr, b(l(t)("user.orgFilter")), 1)),
|
|
384
|
+
y("div", zr, [
|
|
385
|
+
Pe.value ? (c(), k(l(me), { key: 0 }, {
|
|
386
|
+
trigger: u(() => [
|
|
383
387
|
y("button", {
|
|
384
388
|
type: "button",
|
|
385
389
|
class: J(["side-filter__btn side-filter__toggle", { "is-flipped": K.value }]),
|
|
386
390
|
"aria-label": ae.value,
|
|
387
|
-
onClick:
|
|
391
|
+
onClick: Te
|
|
388
392
|
}, [
|
|
389
|
-
|
|
393
|
+
n(f, {
|
|
390
394
|
icon: "ph:caret-double-down",
|
|
391
395
|
size: 14
|
|
392
396
|
})
|
|
393
|
-
], 10,
|
|
397
|
+
], 10, Mr)
|
|
394
398
|
]),
|
|
395
|
-
default:
|
|
399
|
+
default: u(() => [
|
|
396
400
|
I(" " + b(ae.value), 1)
|
|
397
401
|
]),
|
|
398
402
|
_: 1
|
|
399
|
-
})) :
|
|
400
|
-
o ?
|
|
401
|
-
trigger:
|
|
403
|
+
})) : N("", !0),
|
|
404
|
+
o ? N("", !0) : (c(), k(l(me), { key: 1 }, {
|
|
405
|
+
trigger: u(() => [
|
|
402
406
|
y("button", {
|
|
403
407
|
type: "button",
|
|
404
408
|
class: "side-filter__btn side-filter__hide",
|
|
405
|
-
"aria-label":
|
|
406
|
-
onClick: r[0] || (r[0] = (
|
|
409
|
+
"aria-label": l(t)("user.hideOrgPanel"),
|
|
410
|
+
onClick: r[0] || (r[0] = (a) => O.value = !0)
|
|
407
411
|
}, [
|
|
408
|
-
|
|
412
|
+
n(f, {
|
|
409
413
|
icon: "ph:sidebar-simple",
|
|
410
414
|
size: 16
|
|
411
415
|
})
|
|
412
|
-
], 8,
|
|
416
|
+
], 8, Ur)
|
|
413
417
|
]),
|
|
414
|
-
default:
|
|
415
|
-
I(" " + b(
|
|
418
|
+
default: u(() => [
|
|
419
|
+
I(" " + b(l(t)("user.hideOrgPanel")), 1)
|
|
416
420
|
]),
|
|
417
421
|
_: 1
|
|
418
422
|
}))
|
|
419
423
|
])
|
|
420
424
|
]),
|
|
421
|
-
|
|
425
|
+
_e.value ? (c(), k(l(Ye), {
|
|
422
426
|
key: 0,
|
|
423
427
|
value: $.value,
|
|
424
|
-
"onUpdate:value": r[1] || (r[1] = (
|
|
428
|
+
"onUpdate:value": r[1] || (r[1] = (a) => $.value = a),
|
|
425
429
|
size: "small",
|
|
426
430
|
clearable: "",
|
|
427
|
-
placeholder:
|
|
431
|
+
placeholder: l(t)("org.searchPlaceholder")
|
|
428
432
|
}, {
|
|
429
|
-
prefix:
|
|
430
|
-
|
|
433
|
+
prefix: u(() => [
|
|
434
|
+
n(f, {
|
|
431
435
|
icon: "ph:magnifying-glass",
|
|
432
436
|
size: 14
|
|
433
437
|
})
|
|
434
438
|
]),
|
|
435
439
|
_: 1
|
|
436
|
-
}, 8, ["value", "placeholder"])) :
|
|
440
|
+
}, 8, ["value", "placeholder"])) : N("", !0),
|
|
437
441
|
y("button", {
|
|
438
442
|
type: "button",
|
|
439
|
-
class: J(["side-row", { "is-active":
|
|
440
|
-
onClick: r[2] || (r[2] = (
|
|
443
|
+
class: J(["side-row", { "is-active": h.value === null }]),
|
|
444
|
+
onClick: r[2] || (r[2] = (a) => oe(null))
|
|
441
445
|
}, [
|
|
442
|
-
|
|
446
|
+
n(f, {
|
|
443
447
|
class: "side-row__icon",
|
|
444
448
|
icon: "ph:squares-four",
|
|
445
449
|
size: 15
|
|
446
450
|
}),
|
|
447
|
-
y("span",
|
|
451
|
+
y("span", Fr, b(l(t)("user.allOrgs")), 1)
|
|
448
452
|
], 2),
|
|
449
453
|
r[15] || (r[15] = y("div", { class: "side-filter__divider" }, null, -1)),
|
|
450
|
-
|
|
454
|
+
n(l(Ze), {
|
|
451
455
|
show: ee.value,
|
|
452
456
|
class: "fill-pass"
|
|
453
457
|
}, {
|
|
454
|
-
default:
|
|
455
|
-
|
|
458
|
+
default: u(() => [
|
|
459
|
+
re.value ? (c(), k(l(er), {
|
|
460
|
+
key: 0,
|
|
461
|
+
size: "small",
|
|
462
|
+
description: l(t)("common.loadFailed")
|
|
463
|
+
}, null, 8, ["description"])) : (c(), k(l(rr), {
|
|
464
|
+
key: 1,
|
|
456
465
|
class: "side-tree",
|
|
457
466
|
"block-line": "",
|
|
458
467
|
selectable: "",
|
|
@@ -462,109 +471,109 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
462
471
|
"children-field": "children",
|
|
463
472
|
data: G.value,
|
|
464
473
|
pattern: $.value,
|
|
465
|
-
filter:
|
|
474
|
+
filter: Oe,
|
|
466
475
|
"show-irrelevant-nodes": !1,
|
|
467
|
-
"selected-keys":
|
|
476
|
+
"selected-keys": h.value == null ? [] : [h.value],
|
|
468
477
|
"expanded-keys": w.value,
|
|
469
|
-
"render-switcher-icon":
|
|
470
|
-
"onUpdate:selectedKeys":
|
|
471
|
-
"onUpdate:expandedKeys": r[3] || (r[3] = (
|
|
472
|
-
}, null, 8, ["data", "pattern", "selected-keys", "expanded-keys"])
|
|
478
|
+
"render-switcher-icon": Ee,
|
|
479
|
+
"onUpdate:selectedKeys": be,
|
|
480
|
+
"onUpdate:expandedKeys": r[3] || (r[3] = (a) => w.value = a)
|
|
481
|
+
}, null, 8, ["data", "pattern", "selected-keys", "expanded-keys"]))
|
|
473
482
|
]),
|
|
474
483
|
_: 1
|
|
475
484
|
}, 8, ["show"])
|
|
476
485
|
]),
|
|
477
486
|
_: 1
|
|
478
487
|
}),
|
|
479
|
-
y("div",
|
|
480
|
-
|
|
488
|
+
y("div", Dr, [
|
|
489
|
+
l(_) ? N("", !0) : (c(), W("aside", {
|
|
481
490
|
key: 0,
|
|
482
|
-
class: J(["side-filter", { "is-hidden":
|
|
483
|
-
inert:
|
|
491
|
+
class: J(["side-filter", { "is-hidden": l(O) }]),
|
|
492
|
+
inert: l(O) || void 0
|
|
484
493
|
}, [
|
|
485
|
-
|
|
486
|
-
], 10,
|
|
487
|
-
|
|
494
|
+
n(l(le))
|
|
495
|
+
], 10, Lr)),
|
|
496
|
+
n(l(or), {
|
|
488
497
|
ref_key: "tableRef",
|
|
489
|
-
ref:
|
|
490
|
-
columns:
|
|
491
|
-
fetcher:
|
|
492
|
-
params:
|
|
498
|
+
ref: g,
|
|
499
|
+
columns: ue,
|
|
500
|
+
fetcher: l(m).page,
|
|
501
|
+
params: te.value,
|
|
493
502
|
search: { container: "table" },
|
|
494
|
-
toolbar:
|
|
503
|
+
toolbar: Ae.value,
|
|
495
504
|
"fill-height": "",
|
|
496
|
-
"min-row-height":
|
|
505
|
+
"min-row-height": l(Or),
|
|
497
506
|
"card-on-narrow": "",
|
|
498
507
|
"storage-key": "sys-user",
|
|
499
|
-
"checked-row-keys":
|
|
500
|
-
"onUpdate:sorter":
|
|
508
|
+
"checked-row-keys": l(X),
|
|
509
|
+
"onUpdate:sorter": Me,
|
|
501
510
|
"onUpdate:checkedRowKeys": r[5] || (r[5] = (o) => X.value = o),
|
|
502
|
-
onMoreSelect:
|
|
503
|
-
onError: r[6] || (r[6] = (o) =>
|
|
504
|
-
},
|
|
505
|
-
"pagination-prefix":
|
|
506
|
-
|
|
511
|
+
onMoreSelect: Ce,
|
|
512
|
+
onError: r[6] || (r[6] = (o) => l(A).error(l(ce)(o)))
|
|
513
|
+
}, $e({
|
|
514
|
+
"pagination-prefix": u(({ itemCount: o }) => [
|
|
515
|
+
n(Pr, { count: o }, null, 8, ["count"])
|
|
507
516
|
]),
|
|
508
|
-
"toolbar-right":
|
|
509
|
-
|
|
517
|
+
"toolbar-right": u(() => [
|
|
518
|
+
pe((c(), k(l(x), {
|
|
510
519
|
type: "primary",
|
|
511
520
|
onClick: r[4] || (r[4] = (o) => {
|
|
512
|
-
var
|
|
513
|
-
return (
|
|
521
|
+
var a;
|
|
522
|
+
return (a = U.value) == null ? void 0 : a.openAdd();
|
|
514
523
|
})
|
|
515
524
|
}, {
|
|
516
|
-
icon:
|
|
517
|
-
|
|
525
|
+
icon: u(() => [
|
|
526
|
+
n(f, {
|
|
518
527
|
icon: "ph:plus",
|
|
519
528
|
size: 16
|
|
520
529
|
})
|
|
521
530
|
]),
|
|
522
|
-
default:
|
|
523
|
-
I(" " + b(
|
|
531
|
+
default: u(() => [
|
|
532
|
+
I(" " + b(l(t)("common.add")), 1)
|
|
524
533
|
]),
|
|
525
534
|
_: 1
|
|
526
535
|
})), [
|
|
527
|
-
[
|
|
536
|
+
[s, "POST:/api/v1/sys/user"]
|
|
528
537
|
])
|
|
529
538
|
]),
|
|
530
|
-
batch:
|
|
531
|
-
|
|
539
|
+
batch: u(() => [
|
|
540
|
+
pe((c(), k(l(x), {
|
|
532
541
|
secondary: "",
|
|
533
542
|
type: "error",
|
|
534
|
-
onClick:
|
|
543
|
+
onClick: l(ge)
|
|
535
544
|
}, {
|
|
536
|
-
icon:
|
|
537
|
-
|
|
545
|
+
icon: u(() => [
|
|
546
|
+
n(f, {
|
|
538
547
|
icon: "ph:trash",
|
|
539
548
|
size: 16
|
|
540
549
|
})
|
|
541
550
|
]),
|
|
542
|
-
default:
|
|
543
|
-
I(" " + b(
|
|
551
|
+
default: u(() => [
|
|
552
|
+
I(" " + b(l(t)("common.batchDelete")), 1)
|
|
544
553
|
]),
|
|
545
554
|
_: 1
|
|
546
555
|
}, 8, ["onClick"])), [
|
|
547
|
-
[
|
|
556
|
+
[s, "POST:/api/v1/sys/user/batch-delete"]
|
|
548
557
|
])
|
|
549
558
|
]),
|
|
550
559
|
_: 2
|
|
551
560
|
}, [
|
|
552
|
-
|
|
561
|
+
l(_) || l(O) ? {
|
|
553
562
|
name: "toolbar",
|
|
554
|
-
fn:
|
|
555
|
-
|
|
563
|
+
fn: u(() => [
|
|
564
|
+
n(l(x), {
|
|
556
565
|
class: "org-trigger",
|
|
557
566
|
secondary: "",
|
|
558
|
-
title:
|
|
559
|
-
onClick:
|
|
567
|
+
title: l(_) ? void 0 : l(t)("user.showOrgPanel"),
|
|
568
|
+
onClick: ke
|
|
560
569
|
}, {
|
|
561
|
-
icon:
|
|
562
|
-
|
|
563
|
-
icon:
|
|
570
|
+
icon: u(() => [
|
|
571
|
+
n(f, {
|
|
572
|
+
icon: l(_) ? "ph:tree-structure" : "ph:sidebar-simple",
|
|
564
573
|
size: 16
|
|
565
574
|
}, null, 8, ["icon"])
|
|
566
575
|
]),
|
|
567
|
-
default:
|
|
576
|
+
default: u(() => [
|
|
568
577
|
I(" " + b(Se.value), 1)
|
|
569
578
|
]),
|
|
570
579
|
_: 1
|
|
@@ -574,17 +583,17 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
574
583
|
} : void 0
|
|
575
584
|
]), 1032, ["fetcher", "params", "toolbar", "min-row-height", "checked-row-keys"])
|
|
576
585
|
]),
|
|
577
|
-
|
|
578
|
-
show:
|
|
579
|
-
"onUpdate:show": r[7] || (r[7] = (o) =>
|
|
580
|
-
title:
|
|
586
|
+
n(ir, {
|
|
587
|
+
show: l(E),
|
|
588
|
+
"onUpdate:show": r[7] || (r[7] = (o) => Be(E) ? E.value = o : null),
|
|
589
|
+
title: l(t)("user.orgFilter")
|
|
581
590
|
}, {
|
|
582
|
-
default:
|
|
583
|
-
|
|
591
|
+
default: u(() => [
|
|
592
|
+
n(l(le), { drawer: !0 })
|
|
584
593
|
]),
|
|
585
594
|
_: 1
|
|
586
595
|
}, 8, ["show", "title"]),
|
|
587
|
-
|
|
596
|
+
n(ur, {
|
|
588
597
|
ref_key: "userFormRef",
|
|
589
598
|
ref: U,
|
|
590
599
|
"position-options": Y.value,
|
|
@@ -592,55 +601,55 @@ const Ir = { class: "side-filter__head" }, Ar = {
|
|
|
592
601
|
"director-options": Z.value,
|
|
593
602
|
onSaved: r[8] || (r[8] = () => {
|
|
594
603
|
var o;
|
|
595
|
-
return (o =
|
|
604
|
+
return (o = g.value) == null ? void 0 : o.refresh();
|
|
596
605
|
}),
|
|
597
606
|
onPasswordGenerated: r[9] || (r[9] = (o) => {
|
|
598
|
-
var
|
|
599
|
-
return (
|
|
607
|
+
var a;
|
|
608
|
+
return (a = F.value) == null ? void 0 : a.showResult(o, !0);
|
|
600
609
|
})
|
|
601
610
|
}, null, 8, ["position-options", "role-options", "director-options"]),
|
|
602
|
-
|
|
611
|
+
n(dr, {
|
|
603
612
|
ref_key: "resetModalRef",
|
|
604
|
-
ref:
|
|
613
|
+
ref: F
|
|
605
614
|
}, null, 512),
|
|
606
|
-
|
|
615
|
+
n(pr, {
|
|
607
616
|
ref_key: "grantSheetRef",
|
|
608
|
-
ref:
|
|
609
|
-
onSaved:
|
|
617
|
+
ref: D,
|
|
618
|
+
onSaved: Ne
|
|
610
619
|
}, null, 512),
|
|
611
|
-
|
|
620
|
+
n(mr, {
|
|
612
621
|
ref_key: "grantOverviewRef",
|
|
613
|
-
ref:
|
|
614
|
-
show:
|
|
615
|
-
"onUpdate:show": r[10] || (r[10] = (o) =>
|
|
622
|
+
ref: ie,
|
|
623
|
+
show: M.value,
|
|
624
|
+
"onUpdate:show": r[10] || (r[10] = (o) => M.value = o),
|
|
616
625
|
onAdjust: r[11] || (r[11] = (o) => {
|
|
617
|
-
var
|
|
618
|
-
return (
|
|
626
|
+
var a;
|
|
627
|
+
return (a = D.value) == null ? void 0 : a.open(o);
|
|
619
628
|
})
|
|
620
629
|
}, null, 8, ["show"]),
|
|
621
|
-
|
|
630
|
+
n(sr, {
|
|
622
631
|
show: q.value,
|
|
623
632
|
"onUpdate:show": r[12] || (r[12] = (o) => q.value = o),
|
|
624
|
-
api:
|
|
625
|
-
"template-file-name":
|
|
626
|
-
"error-report-file-name":
|
|
633
|
+
api: ze,
|
|
634
|
+
"template-file-name": l(t)("userExport.importTemplateName"),
|
|
635
|
+
"error-report-file-name": l(t)("userExport.errorReportName"),
|
|
627
636
|
onDone: r[13] || (r[13] = () => {
|
|
628
637
|
var o;
|
|
629
|
-
return (o =
|
|
638
|
+
return (o = g.value) == null ? void 0 : o.refresh();
|
|
630
639
|
})
|
|
631
640
|
}, null, 8, ["show", "template-file-name", "error-report-file-name"]),
|
|
632
|
-
|
|
633
|
-
show:
|
|
634
|
-
"onUpdate:show": r[14] || (r[14] = (o) =>
|
|
635
|
-
columns:
|
|
641
|
+
n(nr, {
|
|
642
|
+
show: z.value,
|
|
643
|
+
"onUpdate:show": r[14] || (r[14] = (o) => z.value = o),
|
|
644
|
+
columns: Re,
|
|
636
645
|
loading: H.value,
|
|
637
|
-
onConfirm:
|
|
646
|
+
onConfirm: Ue
|
|
638
647
|
}, null, 8, ["show", "loading"])
|
|
639
648
|
], 64);
|
|
640
649
|
};
|
|
641
650
|
}
|
|
642
651
|
});
|
|
643
652
|
export {
|
|
644
|
-
|
|
653
|
+
ht as default
|
|
645
654
|
};
|
|
646
655
|
//# sourceMappingURL=index2.vue.js.map
|