smart-admin-web 10.20.1 → 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.
- package/dist/api/index.d.ts +19 -1
- package/dist/api/index.js +85 -66
- package/dist/api/index.js.map +1 -1
- package/dist/api/schema.d.ts +448 -1
- package/dist/assets/icons/ph-subset.json.js +1 -1
- package/dist/components/FormContainer/index.vue.js +87 -75
- package/dist/components/FormContainer/index.vue.js.map +1 -1
- package/dist/components/UserPicker/UserAvatar.vue.d.ts +8 -0
- package/dist/components/UserPicker/UserAvatar.vue.js +8 -0
- package/dist/components/UserPicker/UserAvatar.vue.js.map +1 -0
- package/dist/components/UserPicker/UserAvatar2.vue.js +38 -0
- package/dist/components/UserPicker/UserAvatar2.vue.js.map +1 -0
- package/dist/components/UserPicker/index.vue.js +1 -1
- package/dist/components/UserPicker/index2.vue.js +328 -186
- package/dist/components/UserPicker/index2.vue.js.map +1 -1
- package/dist/composables/authMenuRoute.d.ts +10 -0
- package/dist/composables/authMenuRoute.js +39 -23
- package/dist/composables/authMenuRoute.js.map +1 -1
- package/dist/composables/useModule.d.ts +3 -1
- package/dist/composables/useModule.js +44 -32
- package/dist/composables/useModule.js.map +1 -1
- package/dist/index.js +246 -242
- package/dist/layouts/components/SideNav.vue.js +2 -2
- package/dist/layouts/components/SideNav2.vue.js.map +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/watermark.d.ts +1 -1
- package/dist/locales/en-US.d.ts +68 -3
- package/dist/locales/en-US.js +74 -8
- package/dist/locales/en-US.js.map +1 -1
- package/dist/locales/kernelMenuTitles.js +1 -0
- package/dist/locales/kernelMenuTitles.js.map +1 -1
- package/dist/locales/zh-CN.d.ts +68 -3
- package/dist/locales/zh-CN.js +74 -8
- package/dist/locales/zh-CN.js.map +1 -1
- package/dist/router/viewRegistry.js +6 -6
- package/dist/router/viewRegistry.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/naive-theme.js +80 -77
- package/dist/theme/naive-theme.js.map +1 -1
- package/dist/types/api.d.ts +91 -0
- package/dist/types/api.js +17 -15
- package/dist/types/api.js.map +1 -1
- package/dist/utils/shake.d.ts +1 -0
- package/dist/utils/shake.js +30 -0
- package/dist/utils/shake.js.map +1 -0
- package/dist/utils/tree.d.ts +15 -0
- package/dist/utils/tree.js +43 -29
- package/dist/utils/tree.js.map +1 -1
- package/dist/utils/treeCard.d.ts +6 -0
- package/dist/utils/treeCard.js +9 -0
- package/dist/utils/treeCard.js.map +1 -0
- package/dist/views/error/404.vue.js +2 -2
- package/dist/views/error/4042.vue.js +81 -24
- package/dist/views/error/4042.vue.js.map +1 -1
- package/dist/views/login/LoginForm.vue.js +2 -2
- package/dist/views/login/LoginForm2.vue.js +135 -135
- package/dist/views/login/LoginForm2.vue.js.map +1 -1
- package/dist/views/login/components/LoginDesk.vue.js +2 -2
- package/dist/views/login/components/LoginDesk2.vue.js +59 -47
- package/dist/views/login/components/LoginDesk2.vue.js.map +1 -1
- package/dist/views/login/components/LoginHeroPanel.vue.js +2 -2
- package/dist/views/login/components/LoginHeroPanel2.vue.js.map +1 -1
- package/dist/views/personal/notice2.vue.js +1 -1
- package/dist/views/personal/notice2.vue.js.map +1 -1
- package/dist/views/personal/sessions.vue.js +2 -2
- package/dist/views/personal/sessions2.vue.js +41 -40
- package/dist/views/personal/sessions2.vue.js.map +1 -1
- package/dist/views/system/ai-usage/index.vue.js +3 -3
- package/dist/views/system/ai-usage/index2.vue.js +13 -12
- package/dist/views/system/ai-usage/index2.vue.js.map +1 -1
- package/dist/views/system/config/components/AdvancedSection.vue.js +3 -3
- package/dist/views/system/config/components/AdvancedSection2.vue.js +2 -1
- package/dist/views/system/config/components/AdvancedSection2.vue.js.map +1 -1
- package/dist/views/system/dict/index.vue.js +2 -2
- package/dist/views/system/dict/index2.vue.js +12 -1
- package/dist/views/system/dict/index2.vue.js.map +1 -1
- package/dist/views/system/file/index2.vue.js +1 -0
- package/dist/views/system/file/index2.vue.js.map +1 -1
- package/dist/views/system/job/index.vue.js +3 -3
- package/dist/views/system/job/index2.vue.js +182 -181
- package/dist/views/system/job/index2.vue.js.map +1 -1
- package/dist/views/system/job-log/components/AttemptTable2.vue.js +8 -3
- package/dist/views/system/job-log/components/AttemptTable2.vue.js.map +1 -1
- package/dist/views/system/job-log/index.vue.js +1 -1
- package/dist/views/system/job-log/index2.vue.js +5 -5
- package/dist/views/system/job-log/index2.vue.js.map +1 -1
- package/dist/views/system/job-monitor/index.vue.js +2 -2
- package/dist/views/system/job-monitor/index2.vue.js +46 -46
- package/dist/views/system/job-monitor/index2.vue.js.map +1 -1
- package/dist/views/system/log/exception/index.vue.js +2 -2
- package/dist/views/system/log/exception/index2.vue.js +8 -5
- package/dist/views/system/log/exception/index2.vue.js.map +1 -1
- package/dist/views/system/log/login/index2.vue.js +21 -12
- package/dist/views/system/log/login/index2.vue.js.map +1 -1
- package/dist/views/system/log/op/index.vue.js +2 -2
- package/dist/views/system/log/op/index2.vue.js +50 -40
- package/dist/views/system/log/op/index2.vue.js.map +1 -1
- package/dist/views/system/menu/components/ButtonManager.vue.js +2 -2
- package/dist/views/system/menu/components/ButtonManager2.vue.js +45 -36
- package/dist/views/system/menu/components/ButtonManager2.vue.js.map +1 -1
- package/dist/views/system/menu/index.vue.js +1 -1
- package/dist/views/system/menu/index2.vue.js +162 -151
- package/dist/views/system/menu/index2.vue.js.map +1 -1
- package/dist/views/system/module/index.vue.js +1 -1
- package/dist/views/system/module/index2.vue.js +171 -117
- package/dist/views/system/module/index2.vue.js.map +1 -1
- package/dist/views/system/notice/index.vue.js +3 -3
- package/dist/views/system/notice/index2.vue.js +1 -0
- package/dist/views/system/notice/index2.vue.js.map +1 -1
- package/dist/views/system/org/index.vue.js +2 -2
- package/dist/views/system/org/index2.vue.js +204 -195
- package/dist/views/system/org/index2.vue.js.map +1 -1
- package/dist/views/system/position/index.vue.js +2 -2
- package/dist/views/system/position/index2.vue.js +57 -48
- package/dist/views/system/position/index2.vue.js.map +1 -1
- package/dist/views/system/recycle/index.vue.js +1 -1
- package/dist/views/system/recycle/index2.vue.js +3 -1
- package/dist/views/system/recycle/index2.vue.js.map +1 -1
- package/dist/views/system/role/components/GrantMenuSheet.vue.d.ts +2 -0
- package/dist/views/system/role/components/GrantMenuSheet.vue.js +2 -2
- package/dist/views/system/role/components/GrantMenuSheet2.vue.js +54 -49
- package/dist/views/system/role/components/GrantMenuSheet2.vue.js.map +1 -1
- package/dist/views/system/role/components/GrantMenuTable.vue.js +1 -1
- package/dist/views/system/role/components/GrantMenuTable2.vue.js +159 -195
- package/dist/views/system/role/components/GrantMenuTable2.vue.js.map +1 -1
- package/dist/views/system/role/components/grantMenuGroups.d.ts +54 -0
- package/dist/views/system/role/components/grantMenuGroups.js +116 -76
- package/dist/views/system/role/components/grantMenuGroups.js.map +1 -1
- package/dist/views/system/role/index.vue.js +2 -2
- package/dist/views/system/role/index2.vue.js +152 -145
- package/dist/views/system/role/index2.vue.js.map +1 -1
- package/dist/views/system/session/index2.vue.js +39 -35
- package/dist/views/system/session/index2.vue.js.map +1 -1
- package/dist/views/system/user/components/UserGrantEffectiveTable.vue.d.ts +10 -0
- package/dist/views/system/user/components/UserGrantEffectiveTable.vue.js +5 -0
- package/dist/views/system/user/components/UserGrantEffectiveTable.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantEffectiveTable2.vue.js +96 -0
- package/dist/views/system/user/components/UserGrantEffectiveTable2.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantMenuSheet.vue.d.ts +13 -0
- package/dist/views/system/user/components/UserGrantMenuSheet.vue.js +8 -0
- package/dist/views/system/user/components/UserGrantMenuSheet.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantMenuSheet2.vue.js +216 -0
- package/dist/views/system/user/components/UserGrantMenuSheet2.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantMenuTable.vue.d.ts +13 -0
- package/dist/views/system/user/components/UserGrantMenuTable.vue.js +8 -0
- package/dist/views/system/user/components/UserGrantMenuTable.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantMenuTable2.vue.js +186 -0
- package/dist/views/system/user/components/UserGrantMenuTable2.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantNodeRow.vue.d.ts +31 -0
- package/dist/views/system/user/components/UserGrantNodeRow.vue.js +8 -0
- package/dist/views/system/user/components/UserGrantNodeRow.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantNodeRow2.vue.js +171 -0
- package/dist/views/system/user/components/UserGrantNodeRow2.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.d.ts +21 -0
- package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.js +5 -0
- package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.js.map +1 -0
- package/dist/views/system/user/components/UserGrantOverviewDrawer2.vue.js +178 -0
- package/dist/views/system/user/components/UserGrantOverviewDrawer2.vue.js.map +1 -0
- package/dist/views/system/user/components/userGrantState.d.ts +64 -0
- package/dist/views/system/user/components/userGrantState.js +117 -0
- package/dist/views/system/user/components/userGrantState.js.map +1 -0
- package/dist/views/system/user/index.vue.js +2 -2
- package/dist/views/system/user/index2.vue.js +369 -295
- package/dist/views/system/user/index2.vue.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,137 +1,141 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMessage as
|
|
3
|
-
import { SmartTable as
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useConfirm as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
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(
|
|
24
|
-
const { t: n } =
|
|
25
|
-
async function
|
|
26
|
-
|
|
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
|
-
|
|
32
|
+
ne.error(De(e));
|
|
31
33
|
} finally {
|
|
32
|
-
|
|
34
|
+
C.value = !1;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
async function
|
|
37
|
+
async function O() {
|
|
36
38
|
if (d.currentModuleId)
|
|
37
39
|
try {
|
|
38
|
-
await
|
|
40
|
+
await Re(d.currentModuleId);
|
|
39
41
|
} catch {
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
ge(async () => {
|
|
43
45
|
var e;
|
|
44
46
|
try {
|
|
45
|
-
g.value = await
|
|
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
|
-
|
|
51
|
+
N.value = await x.routes();
|
|
50
52
|
} catch {
|
|
51
53
|
}
|
|
52
54
|
});
|
|
53
|
-
const
|
|
54
|
-
() => g.value.map((e) => ({ label:
|
|
55
|
-
),
|
|
56
|
-
{ label: n("menu.moduleAll"), value:
|
|
57
|
-
...
|
|
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
|
|
61
|
-
return e.filter((t) => t.type !== k.Button).map((t) => ({ ...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
|
|
64
|
-
() =>
|
|
65
|
+
const F = c(
|
|
66
|
+
() => L(
|
|
65
67
|
y.value.filter(
|
|
66
|
-
(e) => a.value ===
|
|
68
|
+
(e) => a.value === te ? !0 : a.value === b ? e.moduleId == null : e.moduleId === a.value
|
|
67
69
|
)
|
|
68
70
|
)
|
|
69
|
-
),
|
|
71
|
+
), U = c(() => {
|
|
70
72
|
const e = /* @__PURE__ */ new Map(), t = (l) => {
|
|
71
|
-
for (const
|
|
72
|
-
const
|
|
73
|
-
e.set(
|
|
74
|
-
count:
|
|
75
|
-
perms:
|
|
76
|
-
}), t(
|
|
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
|
-
}),
|
|
82
|
+
}), $ = f(), _ = () => {
|
|
81
83
|
var e;
|
|
82
|
-
return (e =
|
|
83
|
-
},
|
|
84
|
+
return (e = $.value) == null ? void 0 : e.refresh();
|
|
85
|
+
}, H = {
|
|
84
86
|
// 英文界面下表里显示的是译名,搜索要两边都认(库里存的中文原文 + 当前语言的显示名)。
|
|
85
|
-
title: (e) => `${e.title} ${
|
|
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 =
|
|
91
|
+
return (t = U.value.get(e.id)) == null ? void 0 : t.perms;
|
|
90
92
|
}
|
|
91
|
-
},
|
|
92
|
-
await
|
|
93
|
-
const t =
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
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 =
|
|
100
|
-
t ?
|
|
103
|
+
const t = q.get(Te(e)) ?? !1;
|
|
104
|
+
t ? p.value = ee(e) : z && (p.value = []), z = t;
|
|
101
105
|
}
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
W(a, () => {
|
|
107
|
+
z || (p.value = []), _();
|
|
104
108
|
});
|
|
105
|
-
const
|
|
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
|
-
),
|
|
114
|
+
), T = f(null), V = f(null), pe = (e) => {
|
|
111
115
|
var t;
|
|
112
|
-
return (t =
|
|
113
|
-
},
|
|
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 &&
|
|
120
|
-
}),
|
|
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(
|
|
126
|
-
),
|
|
127
|
-
const e = /* @__PURE__ */ new Map(), t = (l,
|
|
128
|
-
l.forEach((
|
|
129
|
-
const
|
|
130
|
-
e.set(
|
|
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
|
-
}),
|
|
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 =
|
|
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,23 +161,26 @@ 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:
|
|
164
|
+
search: { actions: P.fuzzy },
|
|
159
165
|
align: "left",
|
|
160
166
|
// 树列左对齐,展开缩进才好读
|
|
161
167
|
// 展开箭头与每层 26px 缩进钉死在这一列。默认会落到「首个无 type 的列」= 序号列,
|
|
162
168
|
// 于是缩进把序号列里的数字一层层挤出可视区(展开后序号就看不见了);缩进也只有紧贴标题才读得通。
|
|
163
169
|
tree: !0,
|
|
164
|
-
|
|
170
|
+
width: 240,
|
|
165
171
|
// 让出让给缩进的宽度
|
|
166
172
|
fixed: "left",
|
|
167
173
|
// 横向滚动时不能丢失「这是哪一行」
|
|
168
174
|
render: (e) => (
|
|
169
175
|
// inline:必须行内 —— naive 的展开箭头是 inline-flex,默认块级 NSpace 会被挤到第二行。
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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(
|
|
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
|
-
|
|
192
|
-
{ size: "small", bordered: !1, type:
|
|
193
|
-
() =>
|
|
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) =>
|
|
206
|
-
search: { actions:
|
|
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:
|
|
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) =>
|
|
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 =
|
|
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: () =>
|
|
246
|
+
onClick: () => pe(e)
|
|
238
247
|
},
|
|
239
248
|
{
|
|
240
|
-
icon: () => o(
|
|
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(
|
|
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, { ...
|
|
271
|
+
request: (t) => x.update(e.id, { ...je(e), enabled: t }),
|
|
263
272
|
// 重拉而非往行对象上写:搜索态下的祖先行是 filterTree 的浅拷贝,写它不会回到源树(开关会弹回去)。
|
|
264
273
|
// StatusSwitch 是悲观更新(请求成功才 emit),重拉一次就是最终态。
|
|
265
274
|
"onUpdate:value": () => {
|
|
266
|
-
|
|
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(
|
|
278
|
-
const t = d.hasPerm("POST:/api/v1/sys/menu/add"), l = d.hasPerm("DELETE:/api/v1/sys/menu/{id}"),
|
|
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(
|
|
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(
|
|
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
|
|
302
|
-
return (
|
|
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
|
-
|
|
308
|
-
|
|
316
|
+
r.length ? o(
|
|
317
|
+
Ce,
|
|
309
318
|
{
|
|
310
319
|
trigger: "click",
|
|
311
|
-
options:
|
|
312
|
-
onSelect: (
|
|
320
|
+
options: r,
|
|
321
|
+
onSelect: (i) => {
|
|
313
322
|
var u;
|
|
314
|
-
return
|
|
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(
|
|
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
|
|
331
|
-
const l =
|
|
332
|
-
return
|
|
333
|
-
v(s(
|
|
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:
|
|
336
|
-
columns:
|
|
337
|
-
fetcher:
|
|
338
|
-
loading:
|
|
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(
|
|
351
|
+
toolbar: s(Ue),
|
|
343
352
|
"storage-key": "sys-menu",
|
|
344
353
|
indent: 26,
|
|
345
354
|
"fill-height": "",
|
|
346
|
-
"min-row-height": s(
|
|
347
|
-
"
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
|
|
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(
|
|
363
|
+
v(s(Ie), {
|
|
354
364
|
value: a.value,
|
|
355
|
-
"onUpdate:value": t[0] || (t[0] = (
|
|
356
|
-
options:
|
|
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
|
-
|
|
372
|
+
I.value ? be("", !0) : (E(), J(s(w), {
|
|
373
|
+
key: 0,
|
|
363
374
|
secondary: "",
|
|
364
|
-
onClick:
|
|
375
|
+
onClick: ce
|
|
365
376
|
}, {
|
|
366
377
|
icon: h(() => [
|
|
367
|
-
v(
|
|
368
|
-
icon:
|
|
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
|
-
|
|
384
|
+
Q(" " + X(S.value ? s(n)("common.collapseAll") : s(n)("common.expandAll")), 1)
|
|
374
385
|
]),
|
|
375
386
|
_: 1
|
|
376
|
-
}),
|
|
377
|
-
|
|
387
|
+
})),
|
|
388
|
+
_e((E(), J(s(w), {
|
|
378
389
|
type: "primary",
|
|
379
|
-
onClick: t[1] || (t[1] = (
|
|
380
|
-
var
|
|
381
|
-
return (
|
|
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(
|
|
396
|
+
v(m, {
|
|
386
397
|
icon: "ph:plus",
|
|
387
398
|
size: 16
|
|
388
399
|
})
|
|
389
400
|
]),
|
|
390
401
|
default: h(() => [
|
|
391
|
-
|
|
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(
|
|
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":
|
|
416
|
+
"filtered-tree": F.value,
|
|
406
417
|
"module-filter": a.value,
|
|
407
|
-
onSaved:
|
|
418
|
+
onSaved: A
|
|
408
419
|
}, null, 8, ["modules", "tree", "filtered-tree", "module-filter"]),
|
|
409
|
-
v(
|
|
420
|
+
v(Ae, {
|
|
410
421
|
ref_key: "buttonMgrRef",
|
|
411
|
-
ref:
|
|
422
|
+
ref: V,
|
|
412
423
|
tree: y.value,
|
|
413
|
-
routes:
|
|
414
|
-
"app-prefix":
|
|
415
|
-
onChanged:
|
|
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
|
-
|
|
433
|
+
gt as default
|
|
423
434
|
};
|
|
424
435
|
//# sourceMappingURL=index2.vue.js.map
|