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