@rzyuan/hrbac-share 0.1.1 → 0.1.2
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/index.js
CHANGED
|
@@ -1,608 +1,758 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as De, ref as n, computed as j, watch as ie, resolveComponent as h, resolveDirective as Ue, openBlock as i, createBlock as E, withCtx as t, withDirectives as We, createElementBlock as w, createCommentVNode as B, createElementVNode as s, toDisplayString as y, createVNode as d, Fragment as P, renderList as x, createTextVNode as m, normalizeClass as ue, unref as J } from "vue";
|
|
2
|
+
import { ElMessage as T } from "element-plus";
|
|
3
|
+
import { Search as xe, Close as ee } from "@element-plus/icons-vue";
|
|
4
|
+
const ce = {
|
|
5
5
|
USER: 1,
|
|
6
6
|
LINE: 2,
|
|
7
7
|
SPACE: 3
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
return `${
|
|
9
|
+
function Y(r) {
|
|
10
|
+
return `${r.subjectType}:${r.subjectId}`;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return
|
|
12
|
+
function Le(r, p) {
|
|
13
|
+
const l = new Set(p.map(Y));
|
|
14
|
+
return r.filter((_) => !l.has(Y(_)));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return [...
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
return
|
|
16
|
+
function ve(r) {
|
|
17
|
+
return [...r].sort((p, l) => {
|
|
18
|
+
if (p.role === "OWNER" && l.role !== "OWNER") return -1;
|
|
19
|
+
if (p.role !== "OWNER" && l.role === "OWNER") return 1;
|
|
20
|
+
const _ = ce[p.subjectType] - ce[l.subjectType];
|
|
21
|
+
return _ !== 0 ? _ : p.subjectName.localeCompare(l.subjectName, "zh-CN");
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const ze = { class: "code-repository-share__header" }, Me = { class: "code-repository-share__header-main" }, $e = { class: "code-repository-share__header-title" }, Be = { class: "code-repository-share__header-subtitle" }, Ke = { class: "code-repository-share" }, Ge = { class: "code-repository-share__section" }, He = { class: "code-repository-share__section-head" }, Fe = { class: "code-repository-share__section-label" }, Je = { class: "code-repository-share__add-row" }, Ye = { class: "code-repository-share__compound-field" }, qe = { class: "code-repository-share__compound-left" }, Qe = { class: "code-repository-share__empty" }, Xe = { class: "code-repository-share__candidate-name" }, Ze = {
|
|
25
25
|
key: 0,
|
|
26
|
-
class: "
|
|
27
|
-
},
|
|
28
|
-
key:
|
|
29
|
-
class: "
|
|
30
|
-
},
|
|
31
|
-
key: 0,
|
|
32
|
-
class: "hrbac-share-drawer__row-desc"
|
|
33
|
-
}, Qe = { class: "hrbac-share-drawer__dialog-text" }, Xe = {
|
|
34
|
-
key: 0,
|
|
35
|
-
class: "hrbac-share-drawer__dialog-target"
|
|
36
|
-
}, Ze = { class: "hrbac-share-drawer__dialog-text" }, ea = {
|
|
37
|
-
key: 0,
|
|
38
|
-
class: "hrbac-share-drawer__dialog-target"
|
|
39
|
-
}, aa = "__remove__", la = "__transfer__", ra = /* @__PURE__ */ Se({
|
|
26
|
+
class: "code-repository-share__candidate-status"
|
|
27
|
+
}, ea = { class: "code-repository-share__compound-right" }, aa = { class: "code-repository-share__collaborator-section" }, oa = { class: "code-repository-share__collaborator-title" }, la = { class: "code-repository-share__collaborator-list" }, sa = { class: "code-repository-share__collaborator-list-inner" }, ta = { class: "code-repository-share__collaborator-info" }, ra = { class: "code-repository-share__collaborator-name-line" }, da = { class: "code-repository-share__collaborator-name" }, na = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "code-repository-share__empty-state"
|
|
30
|
+
}, ia = { class: "code-repository-share__dialog-header" }, ua = { class: "code-repository-share__dialog-header-main" }, ca = { class: "code-repository-share__dialog-title" }, va = { class: "code-repository-share__dialog-description" }, _a = { class: "code-repository-share__dialog-footer" }, pa = { class: "code-repository-share__dialog-header" }, ya = { class: "code-repository-share__dialog-header-main" }, fa = { class: "code-repository-share__dialog-title" }, ba = { class: "code-repository-share__dialog-description" }, ha = { class: "code-repository-share__dialog-description-target" }, ma = { class: "code-repository-share__transfer-content" }, ga = { class: "code-repository-share__transfer-option" }, wa = { class: "code-repository-share__transfer-option" }, ja = { class: "code-repository-share__dialog-footer" }, Ea = "__remove__", Ta = "__transfer__", Ra = "__divider__", Ia = /* @__PURE__ */ De({
|
|
40
31
|
__name: "HrbacShareDrawer",
|
|
41
32
|
props: {
|
|
42
33
|
modelValue: { type: Boolean },
|
|
43
34
|
resource: {},
|
|
44
35
|
adapter: {},
|
|
45
36
|
readonly: { type: Boolean, default: !1 },
|
|
46
|
-
drawerSize: { default:
|
|
37
|
+
drawerSize: { default: "760px" },
|
|
47
38
|
labels: {},
|
|
48
39
|
subjectTypeOptions: {},
|
|
49
40
|
roleOptions: {},
|
|
50
41
|
allowTransferOwner: { type: Boolean, default: !0 }
|
|
51
42
|
},
|
|
52
43
|
emits: ["update:modelValue", "saved"],
|
|
53
|
-
setup(
|
|
54
|
-
const
|
|
44
|
+
setup(r, { emit: p }) {
|
|
45
|
+
const l = r, _ = p, S = {
|
|
55
46
|
title: "分享设置",
|
|
56
|
-
addSectionTitle: "
|
|
57
|
-
collaboratorTitle: "
|
|
47
|
+
addSectionTitle: "添加方式",
|
|
48
|
+
collaboratorTitle: "管理协作者",
|
|
58
49
|
readonlyTip: "当前仅可查看协作者,暂无修改分享设置权限",
|
|
59
50
|
emptyCollaborators: "暂无协作者",
|
|
60
51
|
removeTitle: "确认移除协作者?",
|
|
61
52
|
removeDescription: "移除后,该对象将无法继续访问资源:",
|
|
62
53
|
transferTitle: "转移所有权",
|
|
63
54
|
transferDescription: "转移后,新的所有者为:"
|
|
64
|
-
},
|
|
55
|
+
}, A = [
|
|
65
56
|
{ label: "按用户", value: "USER" },
|
|
66
57
|
{ label: "按条线", value: "LINE" },
|
|
67
58
|
{ label: "按空间", value: "SPACE" }
|
|
68
|
-
],
|
|
59
|
+
], K = [
|
|
69
60
|
{ label: "可管理", value: "MANAGER" },
|
|
70
61
|
{ label: "可编辑", value: "EDITOR" },
|
|
71
62
|
{ label: "可查看", value: "VIEWER" }
|
|
72
|
-
],
|
|
73
|
-
var e;
|
|
74
|
-
return (e = r.subjectTypeOptions) != null && e.length ? r.subjectTypeOptions : N;
|
|
75
|
-
}), J = T(() => {
|
|
76
|
-
var e;
|
|
77
|
-
return (e = r.roleOptions) != null && e.length ? r.roleOptions : M;
|
|
78
|
-
}), Y = T(() => J.value.filter((e) => e.value !== "OWNER")), q = T(() => te(B.value)), se = T(() => re(G.value, B.value)), oe = T(() => m.value === "USER" ? "搜索用户" : m.value === "LINE" ? "搜索条线" : "搜索空间"), Q = T(() => {
|
|
79
|
-
const e = $.value.trim().toLowerCase();
|
|
80
|
-
return e ? q.value.filter((a) => {
|
|
81
|
-
var w;
|
|
82
|
-
return a.subjectName.toLowerCase().includes(e) || a.subjectId.toLowerCase().includes(e) || ((w = a.description) == null ? void 0 : w.toLowerCase().includes(e));
|
|
83
|
-
}) : q.value;
|
|
84
|
-
});
|
|
85
|
-
Z(() => r.modelValue, (e) => {
|
|
86
|
-
e && (k(), P(""));
|
|
87
|
-
}), Z(F, (e) => {
|
|
63
|
+
], R = n(!1), u = n(!1), L = n(!1), g = n("USER"), f = n([]), V = n("VIEWER"), z = n([]), G = n([]), M = n(""), I = n(!1), v = n(!1), c = n(null), H = n("MANAGER"), $ = n("KEEP"), N = j(() => ({ ...S, ...l.labels })), q = j(() => {
|
|
88
64
|
var a;
|
|
89
|
-
|
|
65
|
+
return (a = l.subjectTypeOptions) != null && a.length ? l.subjectTypeOptions : A;
|
|
66
|
+
}), ae = j(() => {
|
|
67
|
+
var a;
|
|
68
|
+
return (a = l.roleOptions) != null && a.length ? l.roleOptions : K;
|
|
69
|
+
}), oe = j(() => ae.value.filter((a) => a.value !== "OWNER")), le = j(() => ve(z.value)), _e = j(() => new Set(z.value.map(Y))), pe = j(() => G.value.map((a) => ({
|
|
70
|
+
...a,
|
|
71
|
+
disabled: a.disabled || _e.value.has(Y(a))
|
|
72
|
+
}))), ye = j(() => g.value === "USER" ? "搜索用户" : g.value === "LINE" ? "搜索条线" : "搜索空间"), Q = j(() => {
|
|
73
|
+
const a = M.value.trim().toLowerCase();
|
|
74
|
+
return a ? le.value.filter((e) => {
|
|
75
|
+
var b;
|
|
76
|
+
return e.subjectName.toLowerCase().includes(a) || e.subjectId.toLowerCase().includes(a) || ((b = e.description) == null ? void 0 : b.toLowerCase().includes(a));
|
|
77
|
+
}) : le.value;
|
|
78
|
+
});
|
|
79
|
+
ie(() => l.modelValue, (a) => {
|
|
80
|
+
a && (D(), U(""));
|
|
81
|
+
}), ie(q, (a) => {
|
|
82
|
+
var e;
|
|
83
|
+
a.some((b) => b.value === g.value) || (g.value = ((e = a[0]) == null ? void 0 : e.value) || "USER");
|
|
90
84
|
}, { immediate: !0 });
|
|
91
|
-
function
|
|
92
|
-
|
|
85
|
+
function se() {
|
|
86
|
+
_("update:modelValue", !1);
|
|
93
87
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
88
|
+
function fe() {
|
|
89
|
+
D(), U("");
|
|
96
90
|
}
|
|
97
|
-
async function
|
|
98
|
-
|
|
91
|
+
async function D() {
|
|
92
|
+
R.value = !0;
|
|
99
93
|
try {
|
|
100
|
-
|
|
101
|
-
} catch (
|
|
102
|
-
|
|
94
|
+
z.value = await l.adapter.listPermissions(l.resource.id);
|
|
95
|
+
} catch (a) {
|
|
96
|
+
T.error(W(a, "协作者加载失败"));
|
|
103
97
|
} finally {
|
|
104
|
-
|
|
98
|
+
R.value = !1;
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
|
-
async function
|
|
101
|
+
async function U(a) {
|
|
108
102
|
L.value = !0;
|
|
109
103
|
try {
|
|
110
|
-
G.value = await
|
|
111
|
-
subjectType:
|
|
112
|
-
keyword:
|
|
113
|
-
resourceId:
|
|
104
|
+
G.value = await l.adapter.searchSubjects({
|
|
105
|
+
subjectType: g.value,
|
|
106
|
+
keyword: a,
|
|
107
|
+
resourceId: l.resource.id
|
|
114
108
|
});
|
|
115
|
-
} catch (
|
|
116
|
-
|
|
109
|
+
} catch (e) {
|
|
110
|
+
T.error(W(e, "候选对象加载失败"));
|
|
117
111
|
} finally {
|
|
118
112
|
L.value = !1;
|
|
119
113
|
}
|
|
120
114
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
115
|
+
function be() {
|
|
116
|
+
f.value = [], U("");
|
|
123
117
|
}
|
|
124
|
-
async function
|
|
125
|
-
if (
|
|
118
|
+
async function he() {
|
|
119
|
+
if (f.value.length) {
|
|
126
120
|
u.value = !0;
|
|
127
121
|
try {
|
|
128
|
-
await Promise.all(
|
|
129
|
-
resourceId:
|
|
130
|
-
subjectType:
|
|
131
|
-
subjectId:
|
|
122
|
+
await Promise.all(f.value.map((a) => l.adapter.grantPermission({
|
|
123
|
+
resourceId: l.resource.id,
|
|
124
|
+
subjectType: g.value,
|
|
125
|
+
subjectId: a,
|
|
132
126
|
role: V.value
|
|
133
|
-
}))),
|
|
134
|
-
} catch (
|
|
135
|
-
|
|
127
|
+
}))), f.value = [], T.success("协作者已添加"), _("saved"), await D(), await U("");
|
|
128
|
+
} catch (a) {
|
|
129
|
+
T.error(W(a, "协作者添加失败"));
|
|
136
130
|
} finally {
|
|
137
131
|
u.value = !1;
|
|
138
132
|
}
|
|
139
133
|
}
|
|
140
134
|
}
|
|
141
|
-
async function
|
|
142
|
-
if (
|
|
143
|
-
|
|
135
|
+
async function me(a, e) {
|
|
136
|
+
if (e === Ea) {
|
|
137
|
+
c.value = a, I.value = !0;
|
|
144
138
|
return;
|
|
145
139
|
}
|
|
146
|
-
if (
|
|
147
|
-
|
|
140
|
+
if (e === Ta) {
|
|
141
|
+
c.value = a, $.value = "KEEP", H.value = "MANAGER", v.value = !0;
|
|
148
142
|
return;
|
|
149
143
|
}
|
|
150
|
-
if (!(
|
|
144
|
+
if (e !== Ra && !(e === "OWNER" || e === a.role)) {
|
|
151
145
|
u.value = !0;
|
|
152
146
|
try {
|
|
153
|
-
await
|
|
154
|
-
resourceId:
|
|
155
|
-
subjectType:
|
|
156
|
-
subjectId:
|
|
157
|
-
role:
|
|
158
|
-
}),
|
|
159
|
-
} catch (
|
|
160
|
-
|
|
147
|
+
await l.adapter.updatePermissionRole({
|
|
148
|
+
resourceId: l.resource.id,
|
|
149
|
+
subjectType: a.subjectType,
|
|
150
|
+
subjectId: a.subjectId,
|
|
151
|
+
role: e
|
|
152
|
+
}), T.success("权限已更新"), _("saved"), await D();
|
|
153
|
+
} catch (b) {
|
|
154
|
+
T.error(W(b, "权限更新失败"));
|
|
161
155
|
} finally {
|
|
162
156
|
u.value = !1;
|
|
163
157
|
}
|
|
164
158
|
}
|
|
165
159
|
}
|
|
166
|
-
function
|
|
167
|
-
typeof
|
|
160
|
+
function ge(a, e) {
|
|
161
|
+
typeof e == "string" && me(a, e);
|
|
168
162
|
}
|
|
169
|
-
async function
|
|
170
|
-
if (
|
|
163
|
+
async function we() {
|
|
164
|
+
if (c.value) {
|
|
171
165
|
u.value = !0;
|
|
172
166
|
try {
|
|
173
|
-
await
|
|
174
|
-
resourceId:
|
|
175
|
-
subjectType:
|
|
176
|
-
subjectId:
|
|
177
|
-
}),
|
|
178
|
-
} catch (
|
|
179
|
-
|
|
167
|
+
await l.adapter.revokePermission({
|
|
168
|
+
resourceId: l.resource.id,
|
|
169
|
+
subjectType: c.value.subjectType,
|
|
170
|
+
subjectId: c.value.subjectId
|
|
171
|
+
}), I.value = !1, c.value = null, T.success("协作者已移除"), _("saved"), await D(), await U("");
|
|
172
|
+
} catch (a) {
|
|
173
|
+
T.error(W(a, "协作者移除失败"));
|
|
180
174
|
} finally {
|
|
181
175
|
u.value = !1;
|
|
182
176
|
}
|
|
183
177
|
}
|
|
184
178
|
}
|
|
185
|
-
async function
|
|
186
|
-
if (!(!
|
|
179
|
+
async function je() {
|
|
180
|
+
if (!(!c.value || !l.adapter.transferOwner)) {
|
|
187
181
|
u.value = !0;
|
|
188
182
|
try {
|
|
189
|
-
await
|
|
190
|
-
resourceId:
|
|
191
|
-
subjectType:
|
|
192
|
-
subjectId:
|
|
193
|
-
previousOwnerRole:
|
|
194
|
-
}), v.value = !1,
|
|
195
|
-
} catch (
|
|
196
|
-
|
|
183
|
+
await l.adapter.transferOwner({
|
|
184
|
+
resourceId: l.resource.id,
|
|
185
|
+
subjectType: c.value.subjectType,
|
|
186
|
+
subjectId: c.value.subjectId,
|
|
187
|
+
previousOwnerRole: $.value === "REMOVE" ? void 0 : H.value
|
|
188
|
+
}), v.value = !1, c.value = null, T.success("所有权已转移"), _("saved"), await D();
|
|
189
|
+
} catch (a) {
|
|
190
|
+
T.error(W(a, "所有权转移失败"));
|
|
197
191
|
} finally {
|
|
198
192
|
u.value = !1;
|
|
199
193
|
}
|
|
200
194
|
}
|
|
201
195
|
}
|
|
202
|
-
function
|
|
203
|
-
var
|
|
204
|
-
return ((
|
|
196
|
+
function te(a) {
|
|
197
|
+
var e;
|
|
198
|
+
return ((e = q.value.find((b) => b.value === a)) == null ? void 0 : e.label.replace(/^按/, "")) || a;
|
|
199
|
+
}
|
|
200
|
+
function Ee(a) {
|
|
201
|
+
return a.role === "OWNER" ? [{ label: "所有者", value: "OWNER", disabled: !0 }] : ae.value.filter((e) => e.value !== "OWNER");
|
|
202
|
+
}
|
|
203
|
+
function Te(a) {
|
|
204
|
+
return l.readonly || u.value || a.readonly === !0 || a.role === "OWNER";
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
206
|
+
function Re(a) {
|
|
207
|
+
return Te(a) && !X(a) && !Z(a);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
209
|
+
function X(a) {
|
|
210
|
+
return !l.readonly && !a.readonly && a.role !== "OWNER";
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return !
|
|
212
|
+
function Z(a) {
|
|
213
|
+
return l.allowTransferOwner && !!l.adapter.transferOwner && !l.readonly && !a.readonly && a.subjectType === "USER" && a.role !== "OWNER";
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
215
|
+
function Ie(a) {
|
|
216
|
+
return X(a) || Z(a);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
return
|
|
218
|
+
function Oe(a) {
|
|
219
|
+
return a === "USER" ? "code-repository-share__type-tag--user" : a === "SPACE" ? "code-repository-share__type-tag--space" : "code-repository-share__type-tag--line";
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
221
|
+
function W(a, e) {
|
|
222
|
+
return a instanceof Error && a.message ? a.message : e;
|
|
223
|
+
}
|
|
224
|
+
return (a, e) => {
|
|
225
|
+
const b = h("el-icon"), O = h("el-button"), Ce = h("el-alert"), Se = h("el-radio-button"), re = h("el-radio-group"), Ve = h("el-tooltip"), k = h("el-option"), F = h("el-select"), Ne = h("el-input"), ke = h("el-empty"), de = h("el-dialog"), ne = h("el-radio"), Pe = h("el-drawer"), Ae = Ue("loading");
|
|
226
|
+
return i(), E(Pe, {
|
|
227
|
+
"model-value": r.modelValue,
|
|
228
|
+
size: r.drawerSize,
|
|
229
|
+
class: "code-repository-share-drawer",
|
|
230
|
+
"destroy-on-close": "",
|
|
231
|
+
"show-close": !1,
|
|
232
|
+
onClose: se,
|
|
233
|
+
onOpen: fe
|
|
230
234
|
}, {
|
|
231
|
-
header:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
header: t(() => [
|
|
236
|
+
s("div", ze, [
|
|
237
|
+
s("div", Me, [
|
|
238
|
+
s("div", $e, y(N.value.title), 1),
|
|
239
|
+
s("div", Be, [
|
|
240
|
+
e[12] || (e[12] = m(" 正在分享:", -1)),
|
|
241
|
+
s("span", null, y(r.resource.name || "--"), 1)
|
|
242
|
+
])
|
|
243
|
+
]),
|
|
244
|
+
d(O, {
|
|
245
|
+
link: "",
|
|
246
|
+
class: "code-repository-share__close-button",
|
|
247
|
+
"aria-label": "关闭分享抽屉",
|
|
248
|
+
onClick: se
|
|
249
|
+
}, {
|
|
250
|
+
default: t(() => [
|
|
251
|
+
d(b, { size: 16 }, {
|
|
252
|
+
default: t(() => [
|
|
253
|
+
d(J(ee))
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
})
|
|
257
|
+
]),
|
|
258
|
+
_: 1
|
|
259
|
+
})
|
|
237
260
|
])
|
|
238
261
|
]),
|
|
239
|
-
default:
|
|
240
|
-
|
|
241
|
-
|
|
262
|
+
default: t(() => [
|
|
263
|
+
We((i(), w("div", Ke, [
|
|
264
|
+
r.readonly ? (i(), E(Ce, {
|
|
242
265
|
key: 0,
|
|
243
|
-
title:
|
|
266
|
+
title: N.value.readonlyTip,
|
|
244
267
|
type: "info",
|
|
245
268
|
"show-icon": "",
|
|
246
269
|
closable: !1,
|
|
247
|
-
class: "
|
|
248
|
-
}, null, 8, ["title"])) :
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue":
|
|
255
|
-
|
|
256
|
-
disabled:
|
|
257
|
-
onChange:
|
|
270
|
+
class: "code-repository-share__alert"
|
|
271
|
+
}, null, 8, ["title"])) : B("", !0),
|
|
272
|
+
s("section", Ge, [
|
|
273
|
+
s("div", He, [
|
|
274
|
+
s("span", Fe, y(N.value.addSectionTitle), 1),
|
|
275
|
+
d(re, {
|
|
276
|
+
modelValue: g.value,
|
|
277
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => g.value = o),
|
|
278
|
+
class: "code-repository-share__method-radio",
|
|
279
|
+
disabled: r.readonly || u.value,
|
|
280
|
+
onChange: be
|
|
258
281
|
}, {
|
|
259
|
-
default:
|
|
260
|
-
(
|
|
261
|
-
key:
|
|
262
|
-
|
|
282
|
+
default: t(() => [
|
|
283
|
+
(i(!0), w(P, null, x(q.value, (o) => (i(), E(Se, {
|
|
284
|
+
key: o.value,
|
|
285
|
+
value: o.value
|
|
263
286
|
}, {
|
|
264
|
-
default:
|
|
265
|
-
|
|
287
|
+
default: t(() => [
|
|
288
|
+
m(y(o.label), 1)
|
|
266
289
|
]),
|
|
267
290
|
_: 2
|
|
268
|
-
}, 1032, ["
|
|
291
|
+
}, 1032, ["value"]))), 128))
|
|
269
292
|
]),
|
|
270
293
|
_: 1
|
|
271
294
|
}, 8, ["modelValue", "disabled"])
|
|
272
295
|
]),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
value: l.subjectId,
|
|
292
|
-
disabled: l.disabled
|
|
296
|
+
s("div", Je, [
|
|
297
|
+
s("div", Ye, [
|
|
298
|
+
s("div", qe, [
|
|
299
|
+
d(F, {
|
|
300
|
+
modelValue: f.value,
|
|
301
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => f.value = o),
|
|
302
|
+
multiple: "",
|
|
303
|
+
filterable: "",
|
|
304
|
+
remote: "",
|
|
305
|
+
clearable: "",
|
|
306
|
+
"collapse-tags": "",
|
|
307
|
+
"collapse-tags-tooltip": "",
|
|
308
|
+
"remote-method": U,
|
|
309
|
+
loading: L.value,
|
|
310
|
+
disabled: r.readonly || u.value,
|
|
311
|
+
placeholder: ye.value,
|
|
312
|
+
"reserve-keyword": !1,
|
|
313
|
+
class: "code-repository-share__candidate-select"
|
|
293
314
|
}, {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
c("span", null, _(l.subjectName), 1),
|
|
297
|
-
l.description ? (s(), h("span", Me, _(l.description), 1)) : C("", !0)
|
|
298
|
-
])
|
|
315
|
+
empty: t(() => [
|
|
316
|
+
s("div", Qe, "暂无匹配" + y(te(g.value)), 1)
|
|
299
317
|
]),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
+
default: t(() => [
|
|
319
|
+
(i(!0), w(P, null, x(pe.value, (o) => (i(), E(k, {
|
|
320
|
+
key: `${o.subjectType}:${o.subjectId}`,
|
|
321
|
+
label: o.subjectName,
|
|
322
|
+
value: o.subjectId,
|
|
323
|
+
disabled: o.disabled
|
|
324
|
+
}, {
|
|
325
|
+
default: t(() => [
|
|
326
|
+
d(Ve, {
|
|
327
|
+
disabled: !o.disabled,
|
|
328
|
+
content: "已添加为协作者",
|
|
329
|
+
placement: "right"
|
|
330
|
+
}, {
|
|
331
|
+
default: t(() => [
|
|
332
|
+
s("div", {
|
|
333
|
+
class: ue(["code-repository-share__candidate-option", { "is-added": o.disabled }])
|
|
334
|
+
}, [
|
|
335
|
+
s("span", Xe, y(o.subjectName), 1),
|
|
336
|
+
o.disabled ? (i(), w("span", Ze, " 已添加 ")) : B("", !0)
|
|
337
|
+
], 2)
|
|
338
|
+
]),
|
|
339
|
+
_: 2
|
|
340
|
+
}, 1032, ["disabled"])
|
|
341
|
+
]),
|
|
342
|
+
_: 2
|
|
343
|
+
}, 1032, ["label", "value", "disabled"]))), 128))
|
|
344
|
+
]),
|
|
345
|
+
_: 1
|
|
346
|
+
}, 8, ["modelValue", "loading", "disabled", "placeholder"])
|
|
318
347
|
]),
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
348
|
+
s("div", ea, [
|
|
349
|
+
d(F, {
|
|
350
|
+
modelValue: V.value,
|
|
351
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => V.value = o),
|
|
352
|
+
disabled: r.readonly || u.value,
|
|
353
|
+
class: "code-repository-share__add-role-select"
|
|
354
|
+
}, {
|
|
355
|
+
default: t(() => [
|
|
356
|
+
(i(!0), w(P, null, x(oe.value, (o) => (i(), E(k, {
|
|
357
|
+
key: o.value,
|
|
358
|
+
label: o.label,
|
|
359
|
+
value: o.value,
|
|
360
|
+
disabled: o.disabled
|
|
361
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["modelValue", "disabled"])
|
|
365
|
+
])
|
|
366
|
+
]),
|
|
367
|
+
d(O, {
|
|
322
368
|
type: "primary",
|
|
323
|
-
|
|
369
|
+
class: "code-repository-share__add-button",
|
|
324
370
|
loading: u.value,
|
|
325
|
-
disabled:
|
|
326
|
-
onClick:
|
|
371
|
+
disabled: r.readonly || !f.value.length,
|
|
372
|
+
onClick: he
|
|
327
373
|
}, {
|
|
328
|
-
default:
|
|
329
|
-
|
|
374
|
+
default: t(() => [...e[13] || (e[13] = [
|
|
375
|
+
m(" 添加 ", -1)
|
|
330
376
|
])]),
|
|
331
377
|
_: 1
|
|
332
|
-
}, 8, ["
|
|
378
|
+
}, 8, ["loading", "disabled"])
|
|
333
379
|
])
|
|
334
380
|
]),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
modelValue: $.value,
|
|
340
|
-
"onUpdate:modelValue": a[3] || (a[3] = (l) => $.value = l),
|
|
341
|
-
"prefix-icon": ee(Pe),
|
|
342
|
-
clearable: "",
|
|
343
|
-
placeholder: "搜索协作者",
|
|
344
|
-
class: "hrbac-share-drawer__search"
|
|
345
|
-
}, null, 8, ["modelValue", "prefix-icon"])
|
|
381
|
+
s("section", aa, [
|
|
382
|
+
s("div", oa, [
|
|
383
|
+
m(y(N.value.collaboratorTitle) + " ", 1),
|
|
384
|
+
s("span", null, "(" + y(Q.value.length) + ")", 1)
|
|
346
385
|
]),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
386
|
+
d(Ne, {
|
|
387
|
+
modelValue: M.value,
|
|
388
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => M.value = o),
|
|
389
|
+
modelModifiers: { trim: !0 },
|
|
390
|
+
clearable: "",
|
|
391
|
+
class: "code-repository-share__collaborator-search",
|
|
392
|
+
placeholder: "搜索空间名称、条线名称、用户姓名或账号"
|
|
393
|
+
}, {
|
|
394
|
+
prefix: t(() => [
|
|
395
|
+
d(b, null, {
|
|
396
|
+
default: t(() => [
|
|
397
|
+
d(J(xe))
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
})
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
}, 8, ["modelValue"]),
|
|
404
|
+
s("div", la, [
|
|
405
|
+
Q.value.length ? (i(), w(P, { key: 0 }, [
|
|
406
|
+
s("div", sa, [
|
|
407
|
+
(i(!0), w(P, null, x(Q.value, (o) => (i(), w("div", {
|
|
408
|
+
key: `${o.subjectType}:${o.subjectId}`,
|
|
409
|
+
class: "code-repository-share__collaborator-row"
|
|
410
|
+
}, [
|
|
411
|
+
s("div", ta, [
|
|
412
|
+
s("div", ra, [
|
|
413
|
+
s("span", {
|
|
414
|
+
class: ue(["code-repository-share__type-tag", Oe(o.subjectType)])
|
|
415
|
+
}, y(te(o.subjectType) || "--"), 3),
|
|
416
|
+
s("span", da, y(o.subjectName || "--"), 1)
|
|
417
|
+
])
|
|
359
418
|
]),
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
419
|
+
d(F, {
|
|
420
|
+
"model-value": o.role,
|
|
421
|
+
size: "small",
|
|
422
|
+
class: "code-repository-share__row-role-select",
|
|
423
|
+
"popper-class": "code-repository-share__role-dropdown",
|
|
424
|
+
disabled: Re(o),
|
|
425
|
+
onChange: (C) => ge(o, C)
|
|
426
|
+
}, {
|
|
427
|
+
default: t(() => [
|
|
428
|
+
(i(!0), w(P, null, x(Ee(o), (C) => (i(), E(k, {
|
|
429
|
+
key: C.value,
|
|
430
|
+
label: C.label,
|
|
431
|
+
value: C.value,
|
|
432
|
+
disabled: C.disabled
|
|
433
|
+
}, null, 8, ["label", "value", "disabled"]))), 128)),
|
|
434
|
+
Ie(o) ? (i(), E(k, {
|
|
435
|
+
key: 0,
|
|
436
|
+
disabled: "",
|
|
437
|
+
value: "__divider__"
|
|
438
|
+
}, {
|
|
439
|
+
default: t(() => [...e[14] || (e[14] = [
|
|
440
|
+
s("div", { class: "code-repository-share__role-divider" }, null, -1)
|
|
441
|
+
])]),
|
|
442
|
+
_: 1
|
|
443
|
+
})) : B("", !0),
|
|
444
|
+
Z(o) ? (i(), E(k, {
|
|
445
|
+
key: 1,
|
|
446
|
+
label: "转移所有权",
|
|
447
|
+
value: "__transfer__"
|
|
448
|
+
})) : B("", !0),
|
|
449
|
+
X(o) ? (i(), E(k, {
|
|
450
|
+
key: 2,
|
|
451
|
+
label: "移除",
|
|
452
|
+
value: "__remove__"
|
|
453
|
+
}, {
|
|
454
|
+
default: t(() => [...e[15] || (e[15] = [
|
|
455
|
+
s("span", { class: "code-repository-share__danger-option" }, "移除", -1)
|
|
456
|
+
])]),
|
|
457
|
+
_: 1
|
|
458
|
+
})) : B("", !0)
|
|
459
|
+
]),
|
|
460
|
+
_: 2
|
|
461
|
+
}, 1032, ["model-value", "disabled", "onChange"])
|
|
462
|
+
]))), 128))
|
|
366
463
|
]),
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
key: W.value,
|
|
376
|
-
label: W.label,
|
|
377
|
-
value: W.value,
|
|
378
|
-
disabled: W.disabled
|
|
379
|
-
}, null, 8, ["label", "value", "disabled"]))), 128)),
|
|
380
|
-
me(l) ? (s(), j(x, {
|
|
381
|
-
key: 0,
|
|
382
|
-
label: "转移所有权",
|
|
383
|
-
value: "__transfer__"
|
|
384
|
-
})) : C("", !0),
|
|
385
|
-
he(l) ? (s(), j(x, {
|
|
386
|
-
key: 1,
|
|
387
|
-
label: "移除",
|
|
388
|
-
value: "__remove__"
|
|
389
|
-
})) : C("", !0)
|
|
390
|
-
]),
|
|
391
|
-
_: 2
|
|
392
|
-
}, 1032, ["model-value", "disabled", "onChange"])
|
|
393
|
-
]))), 128))
|
|
394
|
-
])) : (s(), j(Re, {
|
|
395
|
-
key: 1,
|
|
396
|
-
description: R.value.emptyCollaborators,
|
|
397
|
-
class: "hrbac-share-drawer__empty"
|
|
398
|
-
}, null, 8, ["description"]))
|
|
464
|
+
e[16] || (e[16] = s("div", { class: "code-repository-share__collaborator-footer" }, "已显示全部协作者", -1))
|
|
465
|
+
], 64)) : (i(), w("div", na, [
|
|
466
|
+
d(ke, {
|
|
467
|
+
description: N.value.emptyCollaborators,
|
|
468
|
+
"image-size": 72
|
|
469
|
+
}, null, 8, ["description"])
|
|
470
|
+
]))
|
|
471
|
+
])
|
|
399
472
|
])
|
|
400
473
|
])), [
|
|
401
|
-
[
|
|
474
|
+
[Ae, R.value]
|
|
402
475
|
]),
|
|
403
|
-
|
|
404
|
-
modelValue:
|
|
405
|
-
"onUpdate:modelValue":
|
|
406
|
-
|
|
407
|
-
|
|
476
|
+
d(de, {
|
|
477
|
+
modelValue: I.value,
|
|
478
|
+
"onUpdate:modelValue": e[6] || (e[6] = (o) => I.value = o),
|
|
479
|
+
width: "460px",
|
|
480
|
+
class: "code-repository-share__remove-dialog",
|
|
481
|
+
"destroy-on-close": "",
|
|
482
|
+
"show-close": !1,
|
|
408
483
|
"append-to-body": ""
|
|
409
484
|
}, {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
485
|
+
header: t(() => {
|
|
486
|
+
var o;
|
|
487
|
+
return [
|
|
488
|
+
s("div", ia, [
|
|
489
|
+
s("div", ua, [
|
|
490
|
+
s("div", ca, y(N.value.removeTitle), 1),
|
|
491
|
+
s("div", va, " 移除后," + y(((o = c.value) == null ? void 0 : o.subjectName) || "--") + " 将失去当前资源的协作权限。 ", 1)
|
|
492
|
+
]),
|
|
493
|
+
d(O, {
|
|
494
|
+
link: "",
|
|
495
|
+
class: "code-repository-share__close-button",
|
|
496
|
+
"aria-label": "关闭移除确认",
|
|
497
|
+
onClick: e[4] || (e[4] = (C) => I.value = !1)
|
|
498
|
+
}, {
|
|
499
|
+
default: t(() => [
|
|
500
|
+
d(b, { size: 16 }, {
|
|
501
|
+
default: t(() => [
|
|
502
|
+
d(J(ee))
|
|
503
|
+
]),
|
|
504
|
+
_: 1
|
|
505
|
+
})
|
|
506
|
+
]),
|
|
507
|
+
_: 1
|
|
508
|
+
})
|
|
509
|
+
])
|
|
510
|
+
];
|
|
511
|
+
}),
|
|
512
|
+
footer: t(() => [
|
|
513
|
+
s("div", _a, [
|
|
514
|
+
d(O, {
|
|
515
|
+
onClick: e[5] || (e[5] = (o) => I.value = !1)
|
|
516
|
+
}, {
|
|
517
|
+
default: t(() => [...e[17] || (e[17] = [
|
|
518
|
+
m("取消", -1)
|
|
519
|
+
])]),
|
|
520
|
+
_: 1
|
|
521
|
+
}),
|
|
522
|
+
d(O, {
|
|
523
|
+
type: "primary",
|
|
524
|
+
class: "code-repository-share__danger-button",
|
|
525
|
+
disabled: !c.value,
|
|
526
|
+
loading: u.value,
|
|
527
|
+
onClick: we
|
|
528
|
+
}, {
|
|
529
|
+
default: t(() => [...e[18] || (e[18] = [
|
|
530
|
+
m(" 移除 ", -1)
|
|
531
|
+
])]),
|
|
532
|
+
_: 1
|
|
533
|
+
}, 8, ["disabled", "loading"])
|
|
434
534
|
])
|
|
435
535
|
]),
|
|
436
536
|
_: 1
|
|
437
|
-
}, 8, ["modelValue"
|
|
438
|
-
|
|
537
|
+
}, 8, ["modelValue"]),
|
|
538
|
+
d(de, {
|
|
439
539
|
modelValue: v.value,
|
|
440
|
-
"onUpdate:modelValue":
|
|
441
|
-
|
|
442
|
-
|
|
540
|
+
"onUpdate:modelValue": e[11] || (e[11] = (o) => v.value = o),
|
|
541
|
+
width: "600px",
|
|
542
|
+
class: "code-repository-share__transfer-dialog",
|
|
543
|
+
"destroy-on-close": "",
|
|
544
|
+
"show-close": !1,
|
|
443
545
|
"append-to-body": ""
|
|
444
546
|
}, {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
547
|
+
header: t(() => {
|
|
548
|
+
var o;
|
|
549
|
+
return [
|
|
550
|
+
s("div", pa, [
|
|
551
|
+
s("div", ya, [
|
|
552
|
+
s("div", fa, y(N.value.transferTitle), 1),
|
|
553
|
+
s("div", ba, [
|
|
554
|
+
e[19] || (e[19] = m(" 你将把所有权转移给 ", -1)),
|
|
555
|
+
s("span", ha, y(((o = c.value) == null ? void 0 : o.subjectName) || "--"), 1),
|
|
556
|
+
e[20] || (e[20] = m(" ,转移后你将不再是此资源的所有者。 ", -1))
|
|
557
|
+
])
|
|
558
|
+
]),
|
|
559
|
+
d(O, {
|
|
560
|
+
link: "",
|
|
561
|
+
class: "code-repository-share__close-button",
|
|
562
|
+
"aria-label": "关闭所有权转移确认",
|
|
563
|
+
onClick: e[7] || (e[7] = (C) => v.value = !1)
|
|
564
|
+
}, {
|
|
565
|
+
default: t(() => [
|
|
566
|
+
d(b, { size: 16 }, {
|
|
567
|
+
default: t(() => [
|
|
568
|
+
d(J(ee))
|
|
569
|
+
]),
|
|
570
|
+
_: 1
|
|
571
|
+
})
|
|
572
|
+
]),
|
|
573
|
+
_: 1
|
|
574
|
+
})
|
|
575
|
+
])
|
|
576
|
+
];
|
|
577
|
+
}),
|
|
578
|
+
footer: t(() => [
|
|
579
|
+
s("div", ja, [
|
|
580
|
+
d(O, {
|
|
581
|
+
onClick: e[10] || (e[10] = (o) => v.value = !1)
|
|
582
|
+
}, {
|
|
583
|
+
default: t(() => [...e[25] || (e[25] = [
|
|
584
|
+
m("取消", -1)
|
|
585
|
+
])]),
|
|
586
|
+
_: 1
|
|
587
|
+
}),
|
|
588
|
+
d(O, {
|
|
589
|
+
type: "primary",
|
|
590
|
+
disabled: !c.value,
|
|
591
|
+
loading: u.value,
|
|
592
|
+
onClick: je
|
|
593
|
+
}, {
|
|
594
|
+
default: t(() => [...e[26] || (e[26] = [
|
|
595
|
+
m(" 转移 ", -1)
|
|
596
|
+
])]),
|
|
597
|
+
_: 1
|
|
598
|
+
}, 8, ["disabled", "loading"])
|
|
599
|
+
])
|
|
464
600
|
]),
|
|
465
|
-
default:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
d
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
601
|
+
default: t(() => [
|
|
602
|
+
s("div", ma, [
|
|
603
|
+
e[24] || (e[24] = s("div", { class: "code-repository-share__transfer-label" }, "转移后", -1)),
|
|
604
|
+
d(re, {
|
|
605
|
+
modelValue: $.value,
|
|
606
|
+
"onUpdate:modelValue": e[9] || (e[9] = (o) => $.value = o),
|
|
607
|
+
class: "code-repository-share__transfer-group"
|
|
608
|
+
}, {
|
|
609
|
+
default: t(() => [
|
|
610
|
+
s("label", ga, [
|
|
611
|
+
d(ne, { value: "KEEP" }, {
|
|
612
|
+
default: t(() => [...e[21] || (e[21] = [
|
|
613
|
+
m("保留我的", -1)
|
|
614
|
+
])]),
|
|
615
|
+
_: 1
|
|
616
|
+
}),
|
|
617
|
+
d(F, {
|
|
618
|
+
modelValue: H.value,
|
|
619
|
+
"onUpdate:modelValue": e[8] || (e[8] = (o) => H.value = o),
|
|
620
|
+
class: "code-repository-share__transfer-select",
|
|
621
|
+
disabled: $.value !== "KEEP"
|
|
480
622
|
}, {
|
|
481
|
-
default:
|
|
482
|
-
(
|
|
483
|
-
key:
|
|
484
|
-
label:
|
|
485
|
-
value:
|
|
486
|
-
disabled:
|
|
623
|
+
default: t(() => [
|
|
624
|
+
(i(!0), w(P, null, x(oe.value, (o) => (i(), E(k, {
|
|
625
|
+
key: o.value,
|
|
626
|
+
label: o.label,
|
|
627
|
+
value: o.value,
|
|
628
|
+
disabled: o.disabled
|
|
487
629
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
488
630
|
]),
|
|
489
631
|
_: 1
|
|
490
|
-
}, 8, ["modelValue"])
|
|
632
|
+
}, 8, ["modelValue", "disabled"]),
|
|
633
|
+
e[22] || (e[22] = s("span", null, "权限", -1))
|
|
491
634
|
]),
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
635
|
+
s("label", wa, [
|
|
636
|
+
d(ne, { value: "REMOVE" }, {
|
|
637
|
+
default: t(() => [...e[23] || (e[23] = [
|
|
638
|
+
m("不保留我的协作权限", -1)
|
|
639
|
+
])]),
|
|
640
|
+
_: 1
|
|
641
|
+
})
|
|
642
|
+
])
|
|
643
|
+
]),
|
|
644
|
+
_: 1
|
|
645
|
+
}, 8, ["modelValue"])
|
|
646
|
+
])
|
|
497
647
|
]),
|
|
498
648
|
_: 1
|
|
499
|
-
}, 8, ["modelValue"
|
|
649
|
+
}, 8, ["modelValue"])
|
|
500
650
|
]),
|
|
501
651
|
_: 1
|
|
502
652
|
}, 8, ["model-value", "size"]);
|
|
503
653
|
};
|
|
504
654
|
}
|
|
505
|
-
}),
|
|
506
|
-
const
|
|
507
|
-
for (const [
|
|
508
|
-
|
|
509
|
-
return
|
|
510
|
-
},
|
|
511
|
-
function
|
|
512
|
-
const
|
|
513
|
-
async function
|
|
514
|
-
|
|
655
|
+
}), Oa = (r, p) => {
|
|
656
|
+
const l = r.__vccOpts || r;
|
|
657
|
+
for (const [_, S] of p)
|
|
658
|
+
l[_] = S;
|
|
659
|
+
return l;
|
|
660
|
+
}, Na = /* @__PURE__ */ Oa(Ia, [["__scopeId", "data-v-cdf7bf3e"]]);
|
|
661
|
+
function ka(r) {
|
|
662
|
+
const p = n(!1), l = n(!1), _ = n(""), S = n("USER"), A = n([]), K = n("VIEWER"), R = n([]), u = n([]), L = j(() => ve(R.value)), g = j(() => Le(u.value, R.value));
|
|
663
|
+
async function f() {
|
|
664
|
+
p.value = !0;
|
|
515
665
|
try {
|
|
516
|
-
|
|
666
|
+
R.value = await r.adapter.listPermissions(r.resourceId);
|
|
517
667
|
} finally {
|
|
518
|
-
|
|
668
|
+
p.value = !1;
|
|
519
669
|
}
|
|
520
670
|
}
|
|
521
671
|
async function V() {
|
|
522
|
-
u.value = await
|
|
523
|
-
subjectType:
|
|
524
|
-
keyword:
|
|
525
|
-
resourceId:
|
|
672
|
+
u.value = await r.adapter.searchSubjects({
|
|
673
|
+
subjectType: S.value,
|
|
674
|
+
keyword: _.value,
|
|
675
|
+
resourceId: r.resourceId
|
|
526
676
|
});
|
|
527
677
|
}
|
|
528
|
-
async function
|
|
529
|
-
if (
|
|
530
|
-
|
|
678
|
+
async function z() {
|
|
679
|
+
if (A.value.length) {
|
|
680
|
+
l.value = !0;
|
|
531
681
|
try {
|
|
532
|
-
await Promise.all(
|
|
533
|
-
resourceId:
|
|
534
|
-
subjectType:
|
|
682
|
+
await Promise.all(A.value.map((v) => r.adapter.grantPermission({
|
|
683
|
+
resourceId: r.resourceId,
|
|
684
|
+
subjectType: S.value,
|
|
535
685
|
subjectId: v,
|
|
536
|
-
role:
|
|
537
|
-
}))),
|
|
686
|
+
role: K.value
|
|
687
|
+
}))), A.value = [], _.value = "", await f(), await V();
|
|
538
688
|
} finally {
|
|
539
|
-
|
|
689
|
+
l.value = !1;
|
|
540
690
|
}
|
|
541
691
|
}
|
|
542
692
|
}
|
|
543
|
-
async function G(v,
|
|
544
|
-
|
|
693
|
+
async function G(v, c) {
|
|
694
|
+
l.value = !0;
|
|
545
695
|
try {
|
|
546
|
-
await
|
|
547
|
-
resourceId:
|
|
696
|
+
await r.adapter.updatePermissionRole({
|
|
697
|
+
resourceId: r.resourceId,
|
|
548
698
|
subjectType: v.subjectType,
|
|
549
699
|
subjectId: v.subjectId,
|
|
550
|
-
role:
|
|
551
|
-
}), await
|
|
700
|
+
role: c
|
|
701
|
+
}), await f();
|
|
552
702
|
} finally {
|
|
553
|
-
|
|
703
|
+
l.value = !1;
|
|
554
704
|
}
|
|
555
705
|
}
|
|
556
|
-
async function
|
|
557
|
-
|
|
706
|
+
async function M(v) {
|
|
707
|
+
l.value = !0;
|
|
558
708
|
try {
|
|
559
|
-
await
|
|
560
|
-
resourceId:
|
|
709
|
+
await r.adapter.revokePermission({
|
|
710
|
+
resourceId: r.resourceId,
|
|
561
711
|
subjectType: v.subjectType,
|
|
562
712
|
subjectId: v.subjectId
|
|
563
|
-
}), await
|
|
713
|
+
}), await f(), await V();
|
|
564
714
|
} finally {
|
|
565
|
-
|
|
715
|
+
l.value = !1;
|
|
566
716
|
}
|
|
567
717
|
}
|
|
568
|
-
async function
|
|
569
|
-
if (
|
|
570
|
-
|
|
718
|
+
async function I(v, c = "MANAGER") {
|
|
719
|
+
if (r.adapter.transferOwner) {
|
|
720
|
+
l.value = !0;
|
|
571
721
|
try {
|
|
572
|
-
await
|
|
573
|
-
resourceId:
|
|
722
|
+
await r.adapter.transferOwner({
|
|
723
|
+
resourceId: r.resourceId,
|
|
574
724
|
subjectType: v.subjectType,
|
|
575
725
|
subjectId: v.subjectId,
|
|
576
|
-
previousOwnerRole:
|
|
577
|
-
}), await
|
|
726
|
+
previousOwnerRole: c
|
|
727
|
+
}), await f();
|
|
578
728
|
} finally {
|
|
579
|
-
|
|
729
|
+
l.value = !1;
|
|
580
730
|
}
|
|
581
731
|
}
|
|
582
732
|
}
|
|
583
733
|
return {
|
|
584
|
-
loading:
|
|
585
|
-
saving:
|
|
586
|
-
keyword:
|
|
587
|
-
subjectType:
|
|
588
|
-
selectedSubjectIds:
|
|
589
|
-
selectedRole:
|
|
590
|
-
permissions:
|
|
734
|
+
loading: p,
|
|
735
|
+
saving: l,
|
|
736
|
+
keyword: _,
|
|
737
|
+
subjectType: S,
|
|
738
|
+
selectedSubjectIds: A,
|
|
739
|
+
selectedRole: K,
|
|
740
|
+
permissions: R,
|
|
591
741
|
candidates: u,
|
|
592
742
|
sortedPermissions: L,
|
|
593
|
-
availableCandidates:
|
|
594
|
-
loadPermissions:
|
|
743
|
+
availableCandidates: g,
|
|
744
|
+
loadPermissions: f,
|
|
595
745
|
searchCandidates: V,
|
|
596
|
-
grantSelected:
|
|
746
|
+
grantSelected: z,
|
|
597
747
|
updateRole: G,
|
|
598
|
-
revoke:
|
|
599
|
-
transferOwner:
|
|
748
|
+
revoke: M,
|
|
749
|
+
transferOwner: I
|
|
600
750
|
};
|
|
601
751
|
}
|
|
602
752
|
export {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
753
|
+
Na as HrbacShareDrawer,
|
|
754
|
+
Y as buildSubjectKey,
|
|
755
|
+
Le as excludeExistingSubjects,
|
|
756
|
+
ve as sortSharePermissions,
|
|
757
|
+
ka as useHrbacShare
|
|
608
758
|
};
|