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