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