smart-admin-web 10.21.0 → 10.22.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 (44) hide show
  1. package/dist/assets/icons/ph-subset.json.js +1 -1
  2. package/dist/composables/authMenuRoute.d.ts +10 -0
  3. package/dist/composables/authMenuRoute.js +39 -23
  4. package/dist/composables/authMenuRoute.js.map +1 -1
  5. package/dist/composables/useModule.d.ts +3 -1
  6. package/dist/composables/useModule.js +44 -32
  7. package/dist/composables/useModule.js.map +1 -1
  8. package/dist/index.js +49 -47
  9. package/dist/layouts/components/SideNav.vue.js +2 -2
  10. package/dist/layouts/components/SideNav2.vue.js.map +1 -1
  11. package/dist/lib/runtime.js +1 -1
  12. package/dist/locales/en-US.d.ts +6 -0
  13. package/dist/locales/en-US.js +9 -2
  14. package/dist/locales/en-US.js.map +1 -1
  15. package/dist/locales/zh-CN.d.ts +6 -0
  16. package/dist/locales/zh-CN.js +9 -2
  17. package/dist/locales/zh-CN.js.map +1 -1
  18. package/dist/style.css +1 -1
  19. package/dist/utils/tree.d.ts +15 -0
  20. package/dist/utils/tree.js +43 -29
  21. package/dist/utils/tree.js.map +1 -1
  22. package/dist/utils/treeCard.d.ts +6 -0
  23. package/dist/utils/treeCard.js +9 -0
  24. package/dist/utils/treeCard.js.map +1 -0
  25. package/dist/views/error/404.vue.js +2 -2
  26. package/dist/views/error/4042.vue.js +81 -24
  27. package/dist/views/error/4042.vue.js.map +1 -1
  28. package/dist/views/login/components/LoginDesk.vue.js +2 -2
  29. package/dist/views/login/components/LoginDesk2.vue.js.map +1 -1
  30. package/dist/views/login/components/LoginHeroPanel.vue.js +2 -2
  31. package/dist/views/login/components/LoginHeroPanel2.vue.js.map +1 -1
  32. package/dist/views/system/job-monitor/index.vue.js +2 -2
  33. package/dist/views/system/job-monitor/index2.vue.js +46 -46
  34. package/dist/views/system/job-monitor/index2.vue.js.map +1 -1
  35. package/dist/views/system/menu/index.vue.js +2 -2
  36. package/dist/views/system/menu/index2.vue.js +161 -150
  37. package/dist/views/system/menu/index2.vue.js.map +1 -1
  38. package/dist/views/system/org/index.vue.js +2 -2
  39. package/dist/views/system/org/index2.vue.js +182 -176
  40. package/dist/views/system/org/index2.vue.js.map +1 -1
  41. package/dist/views/system/user/index.vue.js +2 -2
  42. package/dist/views/system/user/index2.vue.js +348 -317
  43. package/dist/views/system/user/index2.vue.js.map +1 -1
  44. package/package.json +3 -3
@@ -1,137 +1,141 @@
1
- import { defineComponent as pe, ref as p, shallowRef as A, onMounted as fe, computed as f, watch as ve, h as o, resolveDirective as he, openBlock as K, createElementBlock as ye, createVNode as v, unref as s, withCtx as h, createTextVNode as V, toDisplayString as W, withDirectives as ge, createBlock as we, toRaw as ke } from "vue";
2
- import { useMessage as be, NSpace as J, NTag as Q, NButton as w, NDropdown as _e, NSelect as xe } from "naive-ui";
3
- import { SmartTable as Te } from "smart-naive-table";
4
- import { useI18n as Ie } from "vue-i18n";
5
- import c from "../../../components/AppIcon.vue.js";
6
- import Me from "../../../components/StatusSwitch/index.vue.js";
7
- import Ce from "./components/ButtonManager.vue.js";
8
- import ze from "./components/MenuFormModal.vue.js";
9
- import { useConfirm as Se } from "../../../composables/useConfirm.js";
10
- import { buildRoutesForModule as Ae } from "../../../composables/useAuthMenu.js";
11
- import { useAuthStore as Ee } from "../../../stores/auth.js";
12
- import { moduleApi as Pe, menuApi as x } from "../../../api/index.js";
13
- import { translateError as Be } from "../../../utils/error.js";
14
- import { SEARCH_ACTIONS as E, deriveHeaderFilters as Re } from "../../../utils/tableFilter.js";
15
- import { TABLE_MIN_ROW_HEIGHT as Ne, TABLE_TOOLBAR as Oe } from "../../../utils/tableToolbar.js";
16
- import { expandableIds as X } from "../../../utils/tree.js";
17
- import { filterTreeByParams as De, hasTreeCondition as Le } from "../../../utils/treeFilter.js";
18
- import { toMenuInput as Fe, MenuType as k, splitPermission as Ue } from "../../../types/menu.js";
19
- import { lineIcon as $e } from "../../../utils/menuIcon.js";
20
- import { translateMenuTitle as P } from "../../../locales/menuTitle.js";
21
- const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
1
+ import { defineComponent as ye, ref as f, shallowRef as B, onMounted as ge, computed as c, watch as W, h as o, resolveDirective as we, openBlock as E, createElementBlock as ke, createVNode as v, unref as s, withCtx as h, createBlock as J, createTextVNode as Q, toDisplayString as X, createCommentVNode as be, withDirectives as _e, toRaw as Te } from "vue";
2
+ import { useMessage as xe, NSpace as Y, NTag as Z, NButton as w, NDropdown as Ce, NSelect as Ie } from "naive-ui";
3
+ import { SmartTable as Me } from "smart-naive-table";
4
+ import { useI18n as ze } from "vue-i18n";
5
+ import m from "../../../components/AppIcon.vue.js";
6
+ import Se from "../../../components/StatusSwitch/index.vue.js";
7
+ import Ae from "./components/ButtonManager.vue.js";
8
+ import Be from "./components/MenuFormModal.vue.js";
9
+ import { useConfirm as Ee } from "../../../composables/useConfirm.js";
10
+ import { useShellBreakpoint as Pe } from "../../../composables/useShellBreakpoint.js";
11
+ import { buildRoutesForModule as Re } from "../../../composables/useAuthMenu.js";
12
+ import { useAuthStore as Ne } from "../../../stores/auth.js";
13
+ import { moduleApi as Oe, menuApi as x } from "../../../api/index.js";
14
+ import { translateError as De } from "../../../utils/error.js";
15
+ import { SEARCH_ACTIONS as P, deriveHeaderFilters as Le } from "../../../utils/tableFilter.js";
16
+ import { TABLE_MIN_ROW_HEIGHT as Fe, TABLE_TOOLBAR as Ue } from "../../../utils/tableToolbar.js";
17
+ import { flattenTree as $e, expandableIds as ee } from "../../../utils/tree.js";
18
+ import { indentByDepth as He } from "../../../utils/treeCard.js";
19
+ import { filterTreeByParams as qe, hasTreeCondition as Ve } from "../../../utils/treeFilter.js";
20
+ import { toMenuInput as je, MenuType as k, splitPermission as Ge } from "../../../types/menu.js";
21
+ import { lineIcon as Ke } from "../../../utils/menuIcon.js";
22
+ import { translateMenuTitle as R } from "../../../locales/menuTitle.js";
23
+ const We = { class: "view fill-page" }, b = 0, te = -1, gt = /* @__PURE__ */ ye({
22
24
  __name: "index",
23
- setup(qe) {
24
- const { t: n } = Ie(), Z = be(), { confirm: ee } = Se(), d = Ee(), T = p(!1), y = A([]), g = A([]), a = p(d.currentModuleId ?? b), B = p([]);
25
- async function te() {
26
- T.value = !0;
25
+ setup(Je) {
26
+ const { t: n } = ze(), ne = xe(), { confirm: oe } = Ee(), d = Ne(), C = f(!1), y = B([]), g = B([]), a = f(d.currentModuleId ?? b), N = f([]);
27
+ async function le() {
28
+ C.value = !0;
27
29
  try {
28
30
  y.value = await x.tree();
29
31
  } catch (e) {
30
- Z.error(Be(e));
32
+ ne.error(De(e));
31
33
  } finally {
32
- T.value = !1;
34
+ C.value = !1;
33
35
  }
34
36
  }
35
- async function R() {
37
+ async function O() {
36
38
  if (d.currentModuleId)
37
39
  try {
38
- await Ae(d.currentModuleId);
40
+ await Re(d.currentModuleId);
39
41
  } catch {
40
42
  }
41
43
  }
42
- fe(async () => {
44
+ ge(async () => {
43
45
  var e;
44
46
  try {
45
- g.value = await Pe.list(), N.value.some((t) => t.value === a.value) || (a.value = ((e = g.value[0]) == null ? void 0 : e.id) ?? b);
47
+ g.value = await Oe.list(), D.value.some((t) => t.value === a.value) || (a.value = ((e = g.value[0]) == null ? void 0 : e.id) ?? b);
46
48
  } catch {
47
49
  }
48
50
  try {
49
- B.value = await x.routes();
51
+ N.value = await x.routes();
50
52
  } catch {
51
53
  }
52
54
  });
53
- const ne = (e) => e === k.Catalog ? n("menu.typeCatalog") : e === k.Menu ? n("menu.typeMenu") : n("menu.typeButton"), oe = (e) => e === k.Catalog ? "info" : "success", le = f(
54
- () => g.value.map((e) => ({ label: P(e.title), value: e.id }))
55
- ), N = f(() => [
56
- { label: n("menu.moduleAll"), value: Y },
57
- ...le.value,
55
+ const re = (e) => e === k.Catalog ? n("menu.typeCatalog") : e === k.Menu ? n("menu.typeMenu") : n("menu.typeButton"), ie = (e) => e === k.Catalog ? "info" : "success", ae = c(
56
+ () => g.value.map((e) => ({ label: R(e.title), value: e.id }))
57
+ ), D = c(() => [
58
+ { label: n("menu.moduleAll"), value: te },
59
+ ...ae.value,
58
60
  { label: n("menu.moduleUnassigned"), value: b }
59
61
  ]);
60
- function O(e) {
61
- return e.filter((t) => t.type !== k.Button).map((t) => ({ ...t, children: O(t.children) }));
62
+ function L(e) {
63
+ return e.filter((t) => t.type !== k.Button).map((t) => ({ ...t, children: L(t.children) }));
62
64
  }
63
- const D = f(
64
- () => O(
65
+ const F = c(
66
+ () => L(
65
67
  y.value.filter(
66
- (e) => a.value === Y ? !0 : a.value === b ? e.moduleId == null : e.moduleId === a.value
68
+ (e) => a.value === te ? !0 : a.value === b ? e.moduleId == null : e.moduleId === a.value
67
69
  )
68
70
  )
69
- ), L = f(() => {
71
+ ), U = c(() => {
70
72
  const e = /* @__PURE__ */ new Map(), t = (l) => {
71
- for (const i of l) {
72
- const r = i.children.filter((u) => u.type === k.Button);
73
- e.set(i.id, {
74
- count: r.length,
75
- perms: r.flatMap((u) => Ue(u.permission)).join(" ").toLowerCase()
76
- }), t(i.children);
73
+ for (const r of l) {
74
+ const i = r.children.filter((u) => u.type === k.Button);
75
+ e.set(r.id, {
76
+ count: i.length,
77
+ perms: i.flatMap((u) => Ge(u.permission)).join(" ").toLowerCase()
78
+ }), t(r.children);
77
79
  }
78
80
  };
79
81
  return t(y.value), e;
80
- }), F = p(), I = () => {
82
+ }), $ = f(), _ = () => {
81
83
  var e;
82
- return (e = F.value) == null ? void 0 : e.refresh();
83
- }, U = {
84
+ return (e = $.value) == null ? void 0 : e.refresh();
85
+ }, H = {
84
86
  // 英文界面下表里显示的是译名,搜索要两边都认(库里存的中文原文 + 当前语言的显示名)。
85
- title: (e) => `${e.title} ${P(e.title, e.path || void 0)}`,
87
+ title: (e) => `${e.title} ${R(e.title, e.path || void 0)}`,
86
88
  path: (e) => e.path,
87
89
  permission: (e) => {
88
90
  var t;
89
- return (t = L.value.get(e.id)) == null ? void 0 : t.perms;
91
+ return (t = U.value.get(e.id)) == null ? void 0 : t.perms;
90
92
  }
91
- }, $ = /* @__PURE__ */ new WeakMap(), ie = async (e) => {
92
- await te();
93
- const t = De(D.value, e, U);
94
- return $.set(t, Le(e, U)), { items: t, total: t.length };
95
- }, m = p([]), M = A([]);
96
- let C = !1;
97
- function re(e) {
93
+ }, q = /* @__PURE__ */ new WeakMap(), { bp: se } = Pe(), I = c(() => se.value === "narrow"), ue = async (e) => {
94
+ await le();
95
+ const t = qe(F.value, e, H), l = I.value ? $e(t) : t;
96
+ return q.set(l, Ve(e, H)), { items: l, total: l.length };
97
+ };
98
+ W(I, () => _());
99
+ const p = f([]), M = B([]);
100
+ let z = !1;
101
+ function de(e) {
98
102
  M.value = e;
99
- const t = $.get(ke(e)) ?? !1;
100
- t ? m.value = X(e) : C && (m.value = []), C = t;
103
+ const t = q.get(Te(e)) ?? !1;
104
+ t ? p.value = ee(e) : z && (p.value = []), z = t;
101
105
  }
102
- ve(a, () => {
103
- C || (m.value = []), I();
106
+ W(a, () => {
107
+ z || (p.value = []), _();
104
108
  });
105
- const z = f(() => m.value.length > 0), ae = () => m.value = z.value ? [] : X(M.value), se = f(
109
+ const S = c(() => p.value.length > 0), ce = () => p.value = S.value ? [] : ee(M.value), me = c(
106
110
  () => {
107
111
  var e;
108
112
  return a.value === b ? void 0 : ((e = g.value.find((t) => t.id === a.value)) == null ? void 0 : e.apiPrefix) ?? void 0;
109
113
  }
110
- ), _ = p(null), H = p(null), ue = (e) => {
114
+ ), T = f(null), V = f(null), pe = (e) => {
111
115
  var t;
112
- return (t = H.value) == null ? void 0 : t.open({ id: e.id, title: e.title });
113
- }, S = () => Promise.all([I(), R()]), de = (e) => ee({
116
+ return (t = V.value) == null ? void 0 : t.open({ id: e.id, title: e.title });
117
+ }, A = () => Promise.all([_(), O()]), fe = (e) => oe({
114
118
  content: n("menu.deleteConfirm", { title: e.title }),
115
119
  type: "error",
116
120
  action: () => x.remove(e.id),
117
121
  successMsg: n("menu.deleted")
118
122
  }).then((t) => {
119
- t && S();
120
- }), ce = ({ expanded: e }) => o(
123
+ t && A();
124
+ }), ve = ({ expanded: e }) => o(
121
125
  "span",
122
126
  {
123
127
  style: `display:inline-flex;transition:transform .2s var(--ease);transform:rotate(${e ? 90 : 0}deg)`
124
128
  },
125
- o(c, { icon: "ph:caret-right", size: 14 })
126
- ), me = f(() => {
127
- const e = /* @__PURE__ */ new Map(), t = (l, i) => {
128
- l.forEach((r, u) => {
129
- const G = i ? `${i}.${u + 1}` : String(u + 1);
130
- e.set(r.id, G), t(r.children, G);
129
+ o(m, { icon: "ph:caret-right", size: 14 })
130
+ ), he = c(() => {
131
+ const e = /* @__PURE__ */ new Map(), t = (l, r) => {
132
+ l.forEach((i, u) => {
133
+ const K = r ? `${r}.${u + 1}` : String(u + 1);
134
+ e.set(i.id, K), t(i.children, K);
131
135
  });
132
136
  };
133
137
  return t(M.value, ""), e;
134
- }), q = (e) => e ? o("span", { class: "mono muted" }, e) : o("span", { class: "faint" }, "—"), j = [
138
+ }), j = (e) => e ? o("span", { class: "mono muted" }, e) : o("span", { class: "faint" }, "—"), G = [
135
139
  // 序号列是渲染 rowNoById 层级号的普通数据列,fixed:'left' 与标题列同锚 ——
136
140
  // 不锚定的话,横向滚动时会滑到 fixed 的标题列底下,「这是哪一行」照样丢。
137
141
  {
@@ -142,8 +146,10 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
142
146
  fixed: "left",
143
147
  hideInSetting: !0,
144
148
  // 结构性列,不进列设置
149
+ card: !1,
150
+ // 窄档卡片以标题为首,层级号不进卡片(默认会顶替标题成为卡片首行)
145
151
  render: (e) => {
146
- const t = me.value.get(e.id);
152
+ const t = he.value.get(e.id);
147
153
  if (!t) return null;
148
154
  const l = t.lastIndexOf(".") + 1;
149
155
  return o("span", { class: "row-no" }, [
@@ -155,7 +161,7 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
155
161
  {
156
162
  title: () => n("menu.title"),
157
163
  key: "title",
158
- search: { actions: E.fuzzy },
164
+ search: { actions: P.fuzzy },
159
165
  align: "left",
160
166
  // 树列左对齐,展开缩进才好读
161
167
  // 展开箭头与每层 26px 缩进钉死在这一列。默认会落到「首个无 type 的列」= 序号列,
@@ -167,11 +173,14 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
167
173
  // 横向滚动时不能丢失「这是哪一行」
168
174
  render: (e) => (
169
175
  // inline:必须行内 —— naive 的展开箭头是 inline-flex,默认块级 NSpace 会被挤到第二行。
170
- o(J, { inline: !0, align: "center", size: 6, wrapItem: !1 }, () => [
171
- P(e.title, e.path || void 0),
172
- // 「隐藏」是罕见状态(种子里的目录/页面全是显示),只在为真时才占视觉 —— 省掉一整列同一个词。
173
- e.visible ? null : o(Q, { size: "tiny", bordered: !1, type: "warning" }, () => n("common.hidden"))
174
- ])
176
+ He(
177
+ e,
178
+ o(Y, { inline: !0, align: "center", size: 6, wrapItem: !1 }, () => [
179
+ R(e.title, e.path || void 0),
180
+ // 「隐藏」是罕见状态(种子里的目录/页面全是显示),只在为真时才占视觉 —— 省掉一整列同一个词。
181
+ e.visible ? null : o(Z, { size: "tiny", bordered: !1, type: "warning" }, () => n("common.hidden"))
182
+ ])
183
+ )
175
184
  )
176
185
  },
177
186
  // 图标独占一列:留在标题列会和树形展开箭头 + 缩进挤在一起撑破首列换行。
@@ -180,7 +189,7 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
180
189
  key: "icon",
181
190
  width: 64,
182
191
  align: "center",
183
- render: (e) => e.icon ? o(c, { icon: $e(e.icon), size: 18 }) : null
192
+ render: (e) => e.icon ? o(m, { icon: Ke(e.icon), size: 18 }) : null
184
193
  },
185
194
  // 类型独占一列,不塞在标题里。按类型着色,目录/页面一眼可辨。
186
195
  {
@@ -188,9 +197,9 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
188
197
  key: "type",
189
198
  width: 90,
190
199
  render: (e) => o(
191
- Q,
192
- { size: "small", bordered: !1, type: oe(e.type) },
193
- () => ne(e.type)
200
+ Z,
201
+ { size: "small", bordered: !1, type: ie(e.type) },
202
+ () => re(e.type)
194
203
  )
195
204
  },
196
205
  // 路由/组件路径:管理员核对菜单时真正要看的东西,直接列出,不必点开编辑弹窗。
@@ -202,8 +211,8 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
202
211
  align: "left",
203
212
  width: 160,
204
213
  ellipsis: { tooltip: !0 },
205
- render: (e) => q(e.path),
206
- search: { actions: E.fuzzy }
214
+ render: (e) => j(e.path),
215
+ search: { actions: P.fuzzy }
207
216
  },
208
217
  // 权限码只作搜索项:表格里不设这一列(见上),但「这个权限码归哪个页面」得能搜到 ——
209
218
  // 取值与匹配见 SEARCH_FIELDS.permission(查该节点按钮子节点的码)。
@@ -211,7 +220,7 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
211
220
  key: "permission",
212
221
  title: () => n("menu.permission"),
213
222
  hideInTable: !0,
214
- search: { actions: E.fuzzy }
223
+ search: { actions: P.fuzzy }
215
224
  },
216
225
  {
217
226
  title: () => n("menu.component"),
@@ -219,7 +228,7 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
219
228
  align: "left",
220
229
  width: 180,
221
230
  ellipsis: { tooltip: !0 },
222
- render: (e) => q(e.component)
231
+ render: (e) => j(e.component)
223
232
  },
224
233
  {
225
234
  title: () => n("menu.buttons"),
@@ -227,17 +236,17 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
227
236
  width: 140,
228
237
  render: (e) => {
229
238
  var l;
230
- const t = ((l = L.value.get(e.id)) == null ? void 0 : l.count) ?? 0;
239
+ const t = ((l = U.value.get(e.id)) == null ? void 0 : l.count) ?? 0;
231
240
  return d.hasPerm("POST:/api/v1/sys/menu/add") ? o(
232
241
  w,
233
242
  {
234
243
  size: "small",
235
244
  quaternary: !0,
236
245
  type: t > 0 ? "primary" : void 0,
237
- onClick: () => ue(e)
246
+ onClick: () => pe(e)
238
247
  },
239
248
  {
240
- icon: () => o(c, { icon: "ph:shield-check", size: 15 }),
249
+ icon: () => o(m, { icon: "ph:shield-check", size: 15 }),
241
250
  default: () => n("menu.configPerms", { n: t })
242
251
  }
243
252
  ) : null;
@@ -253,17 +262,17 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
253
262
  title: () => n("common.status"),
254
263
  key: "enabled",
255
264
  width: 84,
256
- render: (e) => o(Me, {
265
+ render: (e) => o(Se, {
257
266
  value: e.enabled,
258
267
  disabled: !d.hasPerm("PUT:/api/v1/sys/menu/{id}"),
259
268
  // 启停走全量 update,无更新权限则置灰
260
269
  // 停用是一键隐藏整棵子树的重操作,先确认;启用无副作用,跳过确认(返回 null)。
261
270
  confirm: (t) => t ? null : n("menu.disableConfirm", { title: e.title }),
262
- request: (t) => x.update(e.id, { ...Fe(e), enabled: t }),
271
+ request: (t) => x.update(e.id, { ...je(e), enabled: t }),
263
272
  // 重拉而非往行对象上写:搜索态下的祖先行是 filterTree 的浅拷贝,写它不会回到源树(开关会弹回去)。
264
273
  // StatusSwitch 是悲观更新(请求成功才 emit),重拉一次就是最终态。
265
274
  "onUpdate:value": () => {
266
- I(), R();
275
+ _(), O();
267
276
  }
268
277
  })
269
278
  },
@@ -274,19 +283,19 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
274
283
  key: "op",
275
284
  width: 150,
276
285
  fixed: "right",
277
- render: (e) => o(J, { size: 2, wrapItem: !1, justify: "center" }, () => {
278
- const t = d.hasPerm("POST:/api/v1/sys/menu/add"), l = d.hasPerm("DELETE:/api/v1/sys/menu/{id}"), i = [
286
+ render: (e) => o(Y, { size: 2, wrapItem: !1, justify: "center" }, () => {
287
+ const t = d.hasPerm("POST:/api/v1/sys/menu/add"), l = d.hasPerm("DELETE:/api/v1/sys/menu/{id}"), r = [
279
288
  t && {
280
289
  key: "addChild",
281
290
  label: n("menu.addChild"),
282
- icon: () => o(c, { icon: "ph:plus", size: 16 })
291
+ icon: () => o(m, { icon: "ph:plus", size: 16 })
283
292
  },
284
293
  // 新增与删除之间一条分隔线;只剩一项时不画
285
294
  t && l && { type: "divider", key: "divider" },
286
295
  l && {
287
296
  key: "delete",
288
297
  label: n("common.delete"),
289
- icon: () => o(c, { icon: "ph:trash", size: 16 }),
298
+ icon: () => o(m, { icon: "ph:trash", size: 16 }),
290
299
  props: { style: "color: var(--err)" }
291
300
  }
292
301
  ].filter(Boolean);
@@ -298,20 +307,20 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
298
307
  quaternary: !0,
299
308
  type: "primary",
300
309
  onClick: () => {
301
- var r;
302
- return (r = _.value) == null ? void 0 : r.openEdit(e);
310
+ var i;
311
+ return (i = T.value) == null ? void 0 : i.openEdit(e);
303
312
  }
304
313
  },
305
314
  () => n("common.edit")
306
315
  ) : null,
307
- i.length ? o(
308
- _e,
316
+ r.length ? o(
317
+ Ce,
309
318
  {
310
319
  trigger: "click",
311
- options: i,
312
- onSelect: (r) => {
320
+ options: r,
321
+ onSelect: (i) => {
313
322
  var u;
314
- return r === "addChild" ? (u = _.value) == null ? void 0 : u.openAdd(e.id) : de(e);
323
+ return i === "addChild" ? (u = T.value) == null ? void 0 : u.openAdd(e.id) : fe(e);
315
324
  }
316
325
  },
317
326
  () => o(
@@ -319,7 +328,7 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
319
328
  { size: "small", quaternary: !0, type: "primary", iconPlacement: "right" },
320
329
  {
321
330
  default: () => n("common.more"),
322
- icon: () => o(c, { icon: "ph:caret-down", size: 12 })
331
+ icon: () => o(m, { icon: "ph:caret-down", size: 12 })
323
332
  }
324
333
  )
325
334
  ) : null
@@ -327,68 +336,70 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
327
336
  })
328
337
  }
329
338
  ];
330
- return Re(j), (e, t) => {
331
- const l = he("auth");
332
- return K(), ye("div", He, [
333
- v(s(Te), {
339
+ return Le(G), (e, t) => {
340
+ const l = we("auth");
341
+ return E(), ke("div", We, [
342
+ v(s(Me), {
334
343
  ref_key: "tableRef",
335
- ref: F,
336
- columns: j,
337
- fetcher: ie,
338
- loading: T.value,
344
+ ref: $,
345
+ columns: G,
346
+ fetcher: ue,
347
+ loading: C.value,
339
348
  "row-key": "id",
340
349
  pagination: !1,
341
350
  search: { container: "table" },
342
- toolbar: s(Oe),
351
+ toolbar: s(Ue),
343
352
  "storage-key": "sys-menu",
344
353
  indent: 26,
345
354
  "fill-height": "",
346
- "min-row-height": s(Ne),
347
- "render-expand-icon": ce,
348
- "expanded-row-keys": m.value,
349
- "onUpdate:expandedRowKeys": t[2] || (t[2] = (i) => m.value = i),
350
- onLoaded: re
355
+ "min-row-height": s(Fe),
356
+ "card-on-narrow": "",
357
+ "render-expand-icon": ve,
358
+ "expanded-row-keys": p.value,
359
+ "onUpdate:expandedRowKeys": t[2] || (t[2] = (r) => p.value = r),
360
+ onLoaded: de
351
361
  }, {
352
362
  toolbar: h(() => [
353
- v(s(xe), {
363
+ v(s(Ie), {
354
364
  value: a.value,
355
- "onUpdate:value": t[0] || (t[0] = (i) => a.value = i),
356
- options: N.value,
365
+ "onUpdate:value": t[0] || (t[0] = (r) => a.value = r),
366
+ options: D.value,
357
367
  style: { width: "200px" },
358
368
  placeholder: s(n)("menu.module")
359
369
  }, null, 8, ["value", "options", "placeholder"])
360
370
  ]),
361
371
  "toolbar-right": h(() => [
362
- v(s(w), {
372
+ I.value ? be("", !0) : (E(), J(s(w), {
373
+ key: 0,
363
374
  secondary: "",
364
- onClick: ae
375
+ onClick: ce
365
376
  }, {
366
377
  icon: h(() => [
367
- v(c, {
368
- icon: z.value ? "ph:arrows-in-line-vertical" : "ph:arrows-out-line-vertical",
378
+ v(m, {
379
+ icon: S.value ? "ph:arrows-in-line-vertical" : "ph:arrows-out-line-vertical",
369
380
  size: 16
370
381
  }, null, 8, ["icon"])
371
382
  ]),
372
383
  default: h(() => [
373
- V(" " + W(z.value ? s(n)("common.collapseAll") : s(n)("common.expandAll")), 1)
384
+ Q(" " + X(S.value ? s(n)("common.collapseAll") : s(n)("common.expandAll")), 1)
374
385
  ]),
375
386
  _: 1
376
- }),
377
- ge((K(), we(s(w), {
387
+ })),
388
+ _e((E(), J(s(w), {
378
389
  type: "primary",
379
- onClick: t[1] || (t[1] = (i) => {
380
- var r;
381
- return (r = _.value) == null ? void 0 : r.openAdd(0);
390
+ onClick: t[1] || (t[1] = (r) => {
391
+ var i;
392
+ return (i = T.value) == null ? void 0 : i.openAdd(0);
382
393
  })
383
394
  }, {
384
395
  icon: h(() => [
385
- v(c, {
396
+ v(m, {
386
397
  icon: "ph:plus",
387
398
  size: 16
388
399
  })
389
400
  ]),
390
401
  default: h(() => [
391
- V(" " + W(s(n)("common.add")), 1)
402
+ Q(" " + X(s(n)("common.add")), 1)
392
403
  ]),
393
404
  _: 1
394
405
  })), [
@@ -397,28 +408,28 @@ const He = { class: "view fill-page" }, b = 0, Y = -1, dt = /* @__PURE__ */ pe({
397
408
  ]),
398
409
  _: 1
399
410
  }, 8, ["loading", "toolbar", "min-row-height", "expanded-row-keys"]),
400
- v(ze, {
411
+ v(Be, {
401
412
  ref_key: "menuFormRef",
402
- ref: _,
413
+ ref: T,
403
414
  modules: g.value,
404
415
  tree: y.value,
405
- "filtered-tree": D.value,
416
+ "filtered-tree": F.value,
406
417
  "module-filter": a.value,
407
- onSaved: S
418
+ onSaved: A
408
419
  }, null, 8, ["modules", "tree", "filtered-tree", "module-filter"]),
409
- v(Ce, {
420
+ v(Ae, {
410
421
  ref_key: "buttonMgrRef",
411
- ref: H,
422
+ ref: V,
412
423
  tree: y.value,
413
- routes: B.value,
414
- "app-prefix": se.value,
415
- onChanged: S
424
+ routes: N.value,
425
+ "app-prefix": me.value,
426
+ onChanged: A
416
427
  }, null, 8, ["tree", "routes", "app-prefix"])
417
428
  ]);
418
429
  };
419
430
  }
420
431
  });
421
432
  export {
422
- dt as default
433
+ gt as default
423
434
  };
424
435
  //# sourceMappingURL=index2.vue.js.map