smart-admin-web 10.20.1 → 10.21.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/index.js +248 -246
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/watermark.d.ts +1 -1
- package/dist/locales/en-US.d.ts +62 -3
- package/dist/locales/en-US.js +65 -6
- 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 +62 -3
- package/dist/locales/zh-CN.js +65 -6
- 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/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 +1 -1
- package/dist/views/login/components/LoginDesk2.vue.js +59 -47
- package/dist/views/login/components/LoginDesk2.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/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 +2 -2
- package/dist/views/system/menu/index2.vue.js +11 -11
- 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 +70 -67
- 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 +250 -207
- package/dist/views/system/user/index2.vue.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,89 +1,93 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMessage as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { SmartTable as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as ke, ref as d, shallowRef as I, onMounted as Se, h as f, reactive as X, computed as Y, resolveDirective as Ue, openBlock as w, createElementBlock as Z, Fragment as Te, createVNode as a, unref as o, withCtx as s, withDirectives as ee, createBlock as N, createTextVNode as le, toDisplayString as U, createCommentVNode as T, createElementVNode as Oe } from "vue";
|
|
2
|
+
import { useMessage as Ae, NSpace as Ce, NButton as O, NDropdown as De, NForm as te, NFormItem as v, NInput as E, NInputNumber as Ie, NSwitch as oe, NSelect as Ne } from "naive-ui";
|
|
3
|
+
import { useI18n as Re } from "vue-i18n";
|
|
4
|
+
import { SmartTable as _e } from "smart-naive-table";
|
|
5
|
+
import re from "../../../components/AppIcon.vue.js";
|
|
6
|
+
import ae from "../../../components/FormContainer/index.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
8
|
+
import Pe from "../../../components/StatusSwitch/index.vue.js";
|
|
9
|
+
import Me from "../../../components/OrgTreeSelect/index.vue.js";
|
|
10
|
+
import xe from "../../../components/UserPicker/index.vue.js";
|
|
11
|
+
import Ee from "./components/GrantMenuSheet.vue.js";
|
|
12
|
+
import { grantScopeForRole as Be, isBuiltinRole as ze } from "./components/grantMenuGroups.js";
|
|
13
|
+
import { useConfirm as qe } from "../../../composables/useConfirm.js";
|
|
14
|
+
import { useBatchDelete as Fe } from "../../../composables/useBatchDelete.js";
|
|
15
|
+
import { moduleApi as He, roleApi as m, menuApi as Ge, userApi as Le } from "../../../api/index.js";
|
|
16
|
+
import { useAuthStore as Ve } from "../../../stores/auth.js";
|
|
16
17
|
import { translateError as h } from "../../../utils/error.js";
|
|
17
|
-
import { SEARCH_ACTIONS as
|
|
18
|
-
import { TABLE_MIN_ROW_HEIGHT as
|
|
19
|
-
import
|
|
18
|
+
import { SEARCH_ACTIONS as $e, deriveHeaderFilters as We } from "../../../utils/tableFilter.js";
|
|
19
|
+
import { TABLE_MIN_ROW_HEIGHT as je, TABLE_TOOLBAR as Ke } from "../../../utils/tableToolbar.js";
|
|
20
|
+
import Je from "../../../components/TableTotal/index.vue.js";
|
|
20
21
|
import { DataScopeType as y } from "../../../types/api.js";
|
|
21
|
-
const
|
|
22
|
+
const Qe = { class: "form-hint" }, Xe = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "scope-who"
|
|
24
|
-
},
|
|
25
|
+
}, B = 0, wl = /* @__PURE__ */ ke({
|
|
25
26
|
__name: "index",
|
|
26
|
-
setup(
|
|
27
|
-
const { t } =
|
|
28
|
-
|
|
27
|
+
setup(Ye) {
|
|
28
|
+
const { t } = Re(), c = Ae(), { confirm: ne } = qe(), i = Ve(), A = d(), z = I([]);
|
|
29
|
+
Se(async () => {
|
|
29
30
|
try {
|
|
30
|
-
|
|
31
|
+
z.value = await He.list();
|
|
31
32
|
} catch {
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
async function
|
|
35
|
+
async function q(l) {
|
|
35
36
|
try {
|
|
36
|
-
const { total: e } = await
|
|
37
|
+
const { total: e } = await Le.page({ page: 1, pageSize: 1, roleId: l });
|
|
37
38
|
return e;
|
|
38
39
|
} catch {
|
|
39
40
|
return null;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
const { checkedKeys:
|
|
43
|
-
remove:
|
|
43
|
+
const { checkedKeys: F, run: se } = Fe({
|
|
44
|
+
remove: m.batchRemove,
|
|
44
45
|
refresh: () => {
|
|
45
46
|
var l;
|
|
46
|
-
return (l =
|
|
47
|
+
return (l = A.value) == null ? void 0 : l.refresh();
|
|
47
48
|
},
|
|
48
49
|
successMsg: t("role.deleted"),
|
|
49
50
|
content: async (l) => {
|
|
50
|
-
const e = await Promise.all(l.map(
|
|
51
|
+
const e = await Promise.all(l.map(q));
|
|
51
52
|
if (e.some((r) => r === null)) return t("common.batchDeleteConfirm", { count: l.length });
|
|
52
|
-
const n = e.reduce((r,
|
|
53
|
+
const n = e.reduce((r, g) => r + g, 0);
|
|
53
54
|
return n === 0 ? t("common.batchDeleteConfirm", { count: l.length }) : t("role.batchDeleteWithUsers", { count: l.length, users: n });
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
|
-
async function
|
|
57
|
-
var
|
|
58
|
-
const e = await
|
|
59
|
-
await
|
|
57
|
+
async function ue(l) {
|
|
58
|
+
var g;
|
|
59
|
+
const e = await q(l.id), n = e === null ? t("role.deleteConfirm", { name: l.name }) : e === 0 ? t("role.deleteConfirmNoUsers", { name: l.name }) : t("role.deleteConfirmWithUsers", { name: l.name, count: e });
|
|
60
|
+
await ne({
|
|
60
61
|
content: n,
|
|
61
62
|
type: "error",
|
|
62
|
-
action: () =>
|
|
63
|
+
action: () => m.remove(l.id),
|
|
63
64
|
successMsg: t("role.deleted")
|
|
64
|
-
}) && ((
|
|
65
|
+
}) && ((g = A.value) == null || g.refresh());
|
|
65
66
|
}
|
|
66
|
-
const
|
|
67
|
+
const H = (l) => ({
|
|
67
68
|
name: l.name,
|
|
68
69
|
code: l.code,
|
|
69
70
|
sort: l.sort,
|
|
70
71
|
enabled: l.enabled,
|
|
71
72
|
remark: l.remark ?? "",
|
|
72
73
|
isDelegatable: l.isDelegatable ?? !1
|
|
73
|
-
}),
|
|
74
|
+
}), G = [
|
|
74
75
|
{ type: "selection" },
|
|
75
76
|
{ type: "index", title: () => t("common.rowNo"), width: 64, align: "center" },
|
|
76
77
|
{
|
|
77
78
|
key: "code",
|
|
79
|
+
width: 180,
|
|
80
|
+
ellipsis: { tooltip: !0 },
|
|
78
81
|
title: () => t("role.code"),
|
|
79
82
|
render: (l) => f("span", { class: "mono muted" }, l.code)
|
|
80
83
|
},
|
|
81
84
|
{
|
|
82
85
|
key: "name",
|
|
86
|
+
ellipsis: { tooltip: !0 },
|
|
83
87
|
title: () => t("role.name"),
|
|
84
88
|
card: "title",
|
|
85
89
|
// 窄档卡片以角色名称为标题,编码作为字段
|
|
86
|
-
search: { actions:
|
|
90
|
+
search: { actions: $e.fuzzy }
|
|
87
91
|
},
|
|
88
92
|
{
|
|
89
93
|
key: "sort",
|
|
@@ -95,10 +99,10 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
95
99
|
key: "enabled",
|
|
96
100
|
title: () => t("common.status"),
|
|
97
101
|
width: 90,
|
|
98
|
-
render: (l) => f(
|
|
102
|
+
render: (l) => f(Pe, {
|
|
99
103
|
value: l.enabled,
|
|
100
104
|
disabled: !i.isSuperAdmin || !i.hasPerm("PUT:/api/v1/sys/role/{id}"),
|
|
101
|
-
request: (e) =>
|
|
105
|
+
request: (e) => m.update(l.id, { ...H(l), enabled: e }),
|
|
102
106
|
"onUpdate:value": (e) => {
|
|
103
107
|
l.enabled = e;
|
|
104
108
|
}
|
|
@@ -122,33 +126,33 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
122
126
|
i.isSuperAdmin && i.hasPerm("PUT:/api/v1/sys/role/datascope") ? { label: t("role.dataScope"), key: "scope" } : null,
|
|
123
127
|
i.hasPerm("PUT:/api/v1/sys/role/users") ? { label: t("role.grantUsers"), key: "users" } : null
|
|
124
128
|
].filter((n) => n !== null);
|
|
125
|
-
return f(
|
|
129
|
+
return f(Ce, { size: 4, wrapItem: !1 }, () => [
|
|
126
130
|
i.isSuperAdmin && i.hasPerm("PUT:/api/v1/sys/role/{id}") ? f(
|
|
127
|
-
|
|
128
|
-
{ size: "small", quaternary: !0, type: "primary", onClick: () =>
|
|
131
|
+
O,
|
|
132
|
+
{ size: "small", quaternary: !0, type: "primary", onClick: () => de(l) },
|
|
129
133
|
() => t("common.edit")
|
|
130
134
|
) : null,
|
|
131
135
|
i.isSuperAdmin && i.hasPerm("DELETE:/api/v1/sys/role/{id}") ? f(
|
|
132
|
-
|
|
133
|
-
{ size: "small", quaternary: !0, type: "error", onClick: () =>
|
|
136
|
+
O,
|
|
137
|
+
{ size: "small", quaternary: !0, type: "error", onClick: () => ue(l) },
|
|
134
138
|
() => t("common.delete")
|
|
135
139
|
) : null,
|
|
136
140
|
e.length ? f(
|
|
137
|
-
|
|
141
|
+
De,
|
|
138
142
|
{
|
|
139
143
|
options: e,
|
|
140
144
|
onSelect: (n) => {
|
|
141
|
-
n === "menus" ?
|
|
145
|
+
n === "menus" ? pe(l) : n === "scope" ? be(l) : ve(l);
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
|
-
() => f(
|
|
148
|
+
() => f(O, { size: "small", quaternary: !0 }, () => t("common.more"))
|
|
145
149
|
) : null
|
|
146
150
|
]);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
];
|
|
150
|
-
|
|
151
|
-
const
|
|
154
|
+
We(G);
|
|
155
|
+
const C = d(!1), L = d(null), b = d(null), ie = {
|
|
152
156
|
code: {
|
|
153
157
|
required: !0,
|
|
154
158
|
whitespace: !0,
|
|
@@ -161,175 +165,177 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
161
165
|
message: () => t("role.nameRequired"),
|
|
162
166
|
trigger: ["input", "blur"]
|
|
163
167
|
}
|
|
164
|
-
},
|
|
168
|
+
}, V = () => ({
|
|
165
169
|
name: "",
|
|
166
170
|
code: "",
|
|
167
171
|
sort: 0,
|
|
168
172
|
enabled: !0,
|
|
169
173
|
remark: "",
|
|
170
174
|
isDelegatable: !1
|
|
171
|
-
}), u =
|
|
172
|
-
function
|
|
173
|
-
b.value = null, Object.assign(u,
|
|
175
|
+
}), u = X(V());
|
|
176
|
+
function ce() {
|
|
177
|
+
b.value = null, Object.assign(u, V()), C.value = !0;
|
|
174
178
|
}
|
|
175
|
-
function
|
|
176
|
-
b.value = l.id, Object.assign(u,
|
|
179
|
+
function de(l) {
|
|
180
|
+
b.value = l.id, Object.assign(u, H(l)), C.value = !0;
|
|
177
181
|
}
|
|
178
|
-
async function
|
|
182
|
+
async function me() {
|
|
179
183
|
var l, e;
|
|
180
|
-
await ((l =
|
|
184
|
+
await ((l = L.value) == null ? void 0 : l.validate());
|
|
181
185
|
try {
|
|
182
|
-
b.value === null ? await
|
|
186
|
+
b.value === null ? await m.add({ ...u }) : await m.update(b.value, { ...u }), c.success(t("role.saved")), await ((e = A.value) == null ? void 0 : e.refresh());
|
|
183
187
|
} catch (n) {
|
|
184
188
|
return c.error(h(n)), !1;
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
|
-
const
|
|
188
|
-
async function
|
|
189
|
-
var e;
|
|
191
|
+
const R = d(!1), $ = I([]), W = I([]), k = d(null), j = d(B), S = I([]);
|
|
192
|
+
async function pe(l) {
|
|
193
|
+
var e, n;
|
|
190
194
|
try {
|
|
191
|
-
const [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
+
const [r, g] = await Promise.all([Ge.tree(), m.getMenus(l.id)]), x = Be(l, r, z.value, g);
|
|
196
|
+
k.value = l, $.value = x.tree, S.value = x.modules, W.value = x.granted;
|
|
197
|
+
const Q = i.currentModuleId ?? ((e = S.value[0]) == null ? void 0 : e.id) ?? B;
|
|
198
|
+
j.value = S.value.some((we) => we.id === Q) ? Q : ((n = S.value[0]) == null ? void 0 : n.id) ?? B, R.value = !0;
|
|
199
|
+
} catch (r) {
|
|
200
|
+
c.error(h(r));
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
|
-
async function
|
|
198
|
-
if (
|
|
203
|
+
async function fe(l) {
|
|
204
|
+
if (k.value !== null)
|
|
199
205
|
try {
|
|
200
|
-
await
|
|
206
|
+
await m.setMenus(k.value.id, l), c.success(t("role.grantSaved"));
|
|
201
207
|
} catch (e) {
|
|
202
208
|
return c.error(h(e)), !1;
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
|
-
const
|
|
206
|
-
async function
|
|
211
|
+
const K = d(null), _ = d(null);
|
|
212
|
+
async function ve(l) {
|
|
207
213
|
var e;
|
|
208
214
|
_.value = l.id;
|
|
209
215
|
try {
|
|
210
|
-
const n = await
|
|
211
|
-
(e =
|
|
216
|
+
const n = await m.getUsers(l.id);
|
|
217
|
+
(e = K.value) == null || e.open(n);
|
|
212
218
|
} catch (n) {
|
|
213
219
|
c.error(h(n));
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
|
-
async function
|
|
222
|
+
async function he(l) {
|
|
217
223
|
if (_.value !== null)
|
|
218
224
|
try {
|
|
219
|
-
await
|
|
225
|
+
await m.setUsers(_.value, l), c.success(t("role.grantUsersSaved"));
|
|
220
226
|
} catch (e) {
|
|
221
227
|
c.error(h(e));
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
|
-
const P =
|
|
230
|
+
const P = d(!1), M = d(null), D = d(null), p = X({
|
|
225
231
|
scopeType: y.Org,
|
|
226
232
|
customOrgIds: []
|
|
227
|
-
}),
|
|
233
|
+
}), J = Y(() => p.scopeType === y.Custom), ye = Y(() => [
|
|
228
234
|
{ label: t("role.scope.all"), value: y.All },
|
|
229
235
|
{ label: t("role.scope.org"), value: y.Org },
|
|
230
236
|
{ label: t("role.scope.orgAndChildren"), value: y.OrgAndChildren },
|
|
231
237
|
{ label: t("role.scope.self"), value: y.Self },
|
|
232
238
|
{ label: t("role.scope.custom"), value: y.Custom }
|
|
233
239
|
]);
|
|
234
|
-
async function
|
|
235
|
-
|
|
240
|
+
async function be(l) {
|
|
241
|
+
M.value = l.id, D.value = l;
|
|
236
242
|
try {
|
|
237
|
-
const e = await
|
|
243
|
+
const e = await m.getDataScope(l.id);
|
|
238
244
|
p.scopeType = (e == null ? void 0 : e.scopeType) ?? y.Org, p.customOrgIds = e != null && e.customOrgIds ? e.customOrgIds.split(",").filter(Boolean).map(Number) : [], P.value = !0;
|
|
239
245
|
} catch (e) {
|
|
240
246
|
c.error(h(e));
|
|
241
247
|
}
|
|
242
248
|
}
|
|
243
|
-
async function
|
|
244
|
-
if (
|
|
249
|
+
async function ge() {
|
|
250
|
+
if (M.value !== null)
|
|
245
251
|
try {
|
|
246
|
-
await
|
|
247
|
-
|
|
252
|
+
await m.setDataScope(
|
|
253
|
+
M.value,
|
|
248
254
|
p.scopeType,
|
|
249
|
-
|
|
255
|
+
J.value ? p.customOrgIds : void 0
|
|
250
256
|
), c.success(t("role.scopeSaved"));
|
|
251
257
|
} catch (l) {
|
|
252
258
|
return c.error(h(l)), !1;
|
|
253
259
|
}
|
|
254
260
|
}
|
|
255
261
|
return (l, e) => {
|
|
256
|
-
const n =
|
|
257
|
-
return
|
|
258
|
-
a(o(
|
|
259
|
-
toolbar: o(
|
|
262
|
+
const n = Ue("auth");
|
|
263
|
+
return w(), Z(Te, null, [
|
|
264
|
+
a(o(_e), {
|
|
265
|
+
toolbar: o(Ke),
|
|
260
266
|
ref_key: "tableRef",
|
|
261
|
-
ref:
|
|
262
|
-
columns:
|
|
263
|
-
fetcher: o(
|
|
267
|
+
ref: A,
|
|
268
|
+
columns: G,
|
|
269
|
+
fetcher: o(m).page,
|
|
264
270
|
search: { container: "table" },
|
|
265
271
|
"fill-height": "",
|
|
266
|
-
"min-row-height": o(
|
|
272
|
+
"min-row-height": o(je),
|
|
267
273
|
"card-on-narrow": "",
|
|
268
274
|
"storage-key": "sys-role",
|
|
269
|
-
"checked-row-keys": o(
|
|
270
|
-
"onUpdate:checkedRowKeys": e[0] || (e[0] = (r) =>
|
|
275
|
+
"checked-row-keys": o(F),
|
|
276
|
+
"onUpdate:checkedRowKeys": e[0] || (e[0] = (r) => F.value = r),
|
|
271
277
|
onError: e[1] || (e[1] = (r) => o(c).error(o(h)(r)))
|
|
272
278
|
}, {
|
|
273
279
|
"pagination-prefix": s(({ itemCount: r }) => [
|
|
274
|
-
a(
|
|
280
|
+
a(Je, { count: r }, null, 8, ["count"])
|
|
275
281
|
]),
|
|
276
282
|
"toolbar-right": s(() => [
|
|
277
|
-
o(i).isSuperAdmin ?
|
|
283
|
+
o(i).isSuperAdmin ? ee((w(), N(o(O), {
|
|
278
284
|
key: 0,
|
|
279
285
|
type: "primary",
|
|
280
|
-
onClick:
|
|
286
|
+
onClick: ce
|
|
281
287
|
}, {
|
|
282
288
|
icon: s(() => [
|
|
283
|
-
a(
|
|
289
|
+
a(re, {
|
|
284
290
|
icon: "ph:plus",
|
|
285
291
|
size: 16
|
|
286
292
|
})
|
|
287
293
|
]),
|
|
288
294
|
default: s(() => [
|
|
289
|
-
|
|
295
|
+
le(" " + U(o(t)("common.add")), 1)
|
|
290
296
|
]),
|
|
291
297
|
_: 1
|
|
292
298
|
})), [
|
|
293
299
|
[n, "POST:/api/v1/sys/role/add"]
|
|
294
|
-
]) :
|
|
300
|
+
]) : T("", !0)
|
|
295
301
|
]),
|
|
296
302
|
batch: s(() => [
|
|
297
|
-
o(i).isSuperAdmin ?
|
|
303
|
+
o(i).isSuperAdmin ? ee((w(), N(o(O), {
|
|
298
304
|
key: 0,
|
|
299
305
|
secondary: "",
|
|
300
306
|
type: "error",
|
|
301
|
-
onClick: o(
|
|
307
|
+
onClick: o(se)
|
|
302
308
|
}, {
|
|
303
309
|
icon: s(() => [
|
|
304
|
-
a(
|
|
310
|
+
a(re, {
|
|
305
311
|
icon: "ph:trash",
|
|
306
312
|
size: 16
|
|
307
313
|
})
|
|
308
314
|
]),
|
|
309
315
|
default: s(() => [
|
|
310
|
-
|
|
316
|
+
le(" " + U(o(t)("common.batchDelete")), 1)
|
|
311
317
|
]),
|
|
312
318
|
_: 1
|
|
313
319
|
}, 8, ["onClick"])), [
|
|
314
320
|
[n, "POST:/api/v1/sys/role/batch-delete"]
|
|
315
|
-
]) :
|
|
321
|
+
]) : T("", !0)
|
|
316
322
|
]),
|
|
317
323
|
_: 1
|
|
318
324
|
}, 8, ["toolbar", "fetcher", "min-row-height", "checked-row-keys"]),
|
|
319
|
-
a(
|
|
320
|
-
show:
|
|
321
|
-
"onUpdate:show": e[8] || (e[8] = (r) =>
|
|
325
|
+
a(ae, {
|
|
326
|
+
show: C.value,
|
|
327
|
+
"onUpdate:show": e[8] || (e[8] = (r) => C.value = r),
|
|
322
328
|
title: b.value === null ? o(t)("role.addTitle") : o(t)("role.editTitle"),
|
|
323
329
|
width: 480,
|
|
324
|
-
"on-confirm":
|
|
330
|
+
"on-confirm": me,
|
|
325
331
|
"confirm-text": o(t)("common.save")
|
|
326
332
|
}, {
|
|
327
333
|
default: s(() => [
|
|
328
|
-
a(o(
|
|
334
|
+
a(o(te), {
|
|
329
335
|
ref_key: "formRef",
|
|
330
|
-
ref:
|
|
336
|
+
ref: L,
|
|
331
337
|
model: u,
|
|
332
|
-
rules:
|
|
338
|
+
rules: ie,
|
|
333
339
|
"label-placement": "left",
|
|
334
340
|
"label-width": 80
|
|
335
341
|
}, {
|
|
@@ -339,7 +345,7 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
339
345
|
path: "code"
|
|
340
346
|
}, {
|
|
341
347
|
default: s(() => [
|
|
342
|
-
a(o(
|
|
348
|
+
a(o(E), {
|
|
343
349
|
value: u.code,
|
|
344
350
|
"onUpdate:value": e[2] || (e[2] = (r) => u.code = r),
|
|
345
351
|
placeholder: o(t)("role.code"),
|
|
@@ -353,7 +359,7 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
353
359
|
path: "name"
|
|
354
360
|
}, {
|
|
355
361
|
default: s(() => [
|
|
356
|
-
a(o(
|
|
362
|
+
a(o(E), {
|
|
357
363
|
value: u.name,
|
|
358
364
|
"onUpdate:value": e[3] || (e[3] = (r) => u.name = r),
|
|
359
365
|
placeholder: o(t)("role.name")
|
|
@@ -365,7 +371,7 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
365
371
|
label: o(t)("role.sort")
|
|
366
372
|
}, {
|
|
367
373
|
default: s(() => [
|
|
368
|
-
a(o(
|
|
374
|
+
a(o(Ie), {
|
|
369
375
|
value: u.sort,
|
|
370
376
|
"onUpdate:value": e[4] || (e[4] = (r) => u.sort = r),
|
|
371
377
|
min: 0,
|
|
@@ -378,7 +384,7 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
378
384
|
label: o(t)("role.remark")
|
|
379
385
|
}, {
|
|
380
386
|
default: s(() => [
|
|
381
|
-
a(o(
|
|
387
|
+
a(o(E), {
|
|
382
388
|
value: u.remark,
|
|
383
389
|
"onUpdate:value": e[5] || (e[5] = (r) => u.remark = r),
|
|
384
390
|
type: "textarea",
|
|
@@ -392,59 +398,60 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
392
398
|
label: o(t)("common.status")
|
|
393
399
|
}, {
|
|
394
400
|
default: s(() => [
|
|
395
|
-
a(o(
|
|
401
|
+
a(o(oe), {
|
|
396
402
|
value: u.enabled,
|
|
397
403
|
"onUpdate:value": e[6] || (e[6] = (r) => u.enabled = r)
|
|
398
404
|
}, null, 8, ["value"])
|
|
399
405
|
]),
|
|
400
406
|
_: 1
|
|
401
407
|
}, 8, ["label"]),
|
|
402
|
-
o(i).isSuperAdmin ? (
|
|
408
|
+
o(i).isSuperAdmin ? (w(), N(o(v), {
|
|
403
409
|
key: 0,
|
|
404
410
|
label: o(t)("role.isDelegatable")
|
|
405
411
|
}, {
|
|
406
412
|
feedback: s(() => [
|
|
407
|
-
|
|
413
|
+
Oe("span", Qe, U(o(t)("role.isDelegatableHint")), 1)
|
|
408
414
|
]),
|
|
409
415
|
default: s(() => [
|
|
410
|
-
a(o(
|
|
416
|
+
a(o(oe), {
|
|
411
417
|
value: u.isDelegatable,
|
|
412
418
|
"onUpdate:value": e[7] || (e[7] = (r) => u.isDelegatable = r)
|
|
413
419
|
}, null, 8, ["value"])
|
|
414
420
|
]),
|
|
415
421
|
_: 1
|
|
416
|
-
}, 8, ["label"])) :
|
|
422
|
+
}, 8, ["label"])) : T("", !0)
|
|
417
423
|
]),
|
|
418
424
|
_: 1
|
|
419
425
|
}, 8, ["model"])
|
|
420
426
|
]),
|
|
421
427
|
_: 1
|
|
422
428
|
}, 8, ["show", "title", "confirm-text"]),
|
|
423
|
-
a(
|
|
424
|
-
show:
|
|
425
|
-
"onUpdate:show": e[9] || (e[9] = (r) =>
|
|
426
|
-
tree:
|
|
427
|
-
granted:
|
|
428
|
-
modules:
|
|
429
|
-
"default-module-id":
|
|
430
|
-
"
|
|
431
|
-
|
|
432
|
-
|
|
429
|
+
a(Ee, {
|
|
430
|
+
show: R.value,
|
|
431
|
+
"onUpdate:show": e[9] || (e[9] = (r) => R.value = r),
|
|
432
|
+
tree: $.value,
|
|
433
|
+
granted: W.value,
|
|
434
|
+
modules: S.value,
|
|
435
|
+
"default-module-id": j.value,
|
|
436
|
+
hint: k.value && !o(ze)(k.value) ? o(t)("role.systemMenusBuiltinOnly") : void 0,
|
|
437
|
+
"on-save": fe
|
|
438
|
+
}, null, 8, ["show", "tree", "granted", "modules", "default-module-id", "hint"]),
|
|
439
|
+
a(xe, {
|
|
433
440
|
ref_key: "userPickerRef",
|
|
434
|
-
ref:
|
|
435
|
-
onConfirm:
|
|
441
|
+
ref: K,
|
|
442
|
+
onConfirm: he
|
|
436
443
|
}, null, 512),
|
|
437
|
-
a(
|
|
444
|
+
a(ae, {
|
|
438
445
|
show: P.value,
|
|
439
446
|
"onUpdate:show": e[12] || (e[12] = (r) => P.value = r),
|
|
440
447
|
title: o(t)("role.dataScope"),
|
|
441
448
|
width: 480,
|
|
442
|
-
"on-confirm":
|
|
449
|
+
"on-confirm": ge,
|
|
443
450
|
"confirm-text": o(t)("common.save")
|
|
444
451
|
}, {
|
|
445
452
|
default: s(() => [
|
|
446
|
-
|
|
447
|
-
a(o(
|
|
453
|
+
D.value ? (w(), Z("div", Xe, U(D.value.name) + " · " + U(D.value.code), 1)) : T("", !0),
|
|
454
|
+
a(o(te), {
|
|
448
455
|
model: p,
|
|
449
456
|
"label-placement": "left",
|
|
450
457
|
"label-width": 90
|
|
@@ -454,20 +461,20 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
454
461
|
label: o(t)("role.scopeType")
|
|
455
462
|
}, {
|
|
456
463
|
default: s(() => [
|
|
457
|
-
a(o(
|
|
464
|
+
a(o(Ne), {
|
|
458
465
|
value: p.scopeType,
|
|
459
466
|
"onUpdate:value": e[10] || (e[10] = (r) => p.scopeType = r),
|
|
460
|
-
options:
|
|
467
|
+
options: ye.value
|
|
461
468
|
}, null, 8, ["value", "options"])
|
|
462
469
|
]),
|
|
463
470
|
_: 1
|
|
464
471
|
}, 8, ["label"]),
|
|
465
|
-
|
|
472
|
+
J.value ? (w(), N(o(v), {
|
|
466
473
|
key: 0,
|
|
467
474
|
label: o(t)("role.customOrgs")
|
|
468
475
|
}, {
|
|
469
476
|
default: s(() => [
|
|
470
|
-
a(
|
|
477
|
+
a(Me, {
|
|
471
478
|
value: p.customOrgIds,
|
|
472
479
|
"onUpdate:value": e[11] || (e[11] = (r) => p.customOrgIds = r),
|
|
473
480
|
multiple: "",
|
|
@@ -475,7 +482,7 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
475
482
|
}, null, 8, ["value", "placeholder"])
|
|
476
483
|
]),
|
|
477
484
|
_: 1
|
|
478
|
-
}, 8, ["label"])) :
|
|
485
|
+
}, 8, ["label"])) : T("", !0)
|
|
479
486
|
]),
|
|
480
487
|
_: 1
|
|
481
488
|
}, 8, ["model"])
|
|
@@ -487,6 +494,6 @@ const Ve = { class: "form-hint" }, $e = {
|
|
|
487
494
|
}
|
|
488
495
|
});
|
|
489
496
|
export {
|
|
490
|
-
|
|
497
|
+
wl as default
|
|
491
498
|
};
|
|
492
499
|
//# sourceMappingURL=index2.vue.js.map
|