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