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