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