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