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