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