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