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