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