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