cd-personselector 1.3.1 → 1.3.3
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/index.js +1 -1
- package/dist/index.mjs +432 -403
- package/dist/src/PersonSelector.vue.d.ts +16 -2
- package/dist/style.css +1 -1
- package/package.json +7 -6
- package/src/InputSelect.vue +4 -3
- package/src/PersonSelector.vue +87 -39
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as ge, ref as y, computed as A, watch as H, resolveComponent as x, openBlock as l, createBlock as E, withCtx as N, createElementVNode as p, createElementBlock as c, createVNode as S, Fragment as G, renderList as te, createCommentVNode as _, normalizeClass as ee, withModifiers as _e, toDisplayString as h, createTextVNode as oe, nextTick as Ne, normalizeStyle as Te } from "vue";
|
|
2
|
+
const ze = { class: "cd-ps-container" }, $e = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "cd-ps-search"
|
|
5
5
|
}, we = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "cd-ps-org-select"
|
|
8
|
-
},
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "cd-ps-search-results"
|
|
11
|
-
}, Oe = { class: "cd-ps-search-header" }, Re = {
|
|
8
|
+
}, Be = { class: "cd-ps-search-input" }, De = { class: "cd-ps-content" }, Oe = { class: "cd-ps-left" }, Pe = {
|
|
12
9
|
key: 0,
|
|
13
10
|
class: "cd-ps-loading"
|
|
14
|
-
},
|
|
11
|
+
}, Re = {
|
|
15
12
|
key: 1,
|
|
16
13
|
class: "cd-ps-empty"
|
|
17
|
-
},
|
|
14
|
+
}, We = {
|
|
18
15
|
key: 2,
|
|
19
16
|
class: "cd-ps-result-list"
|
|
20
|
-
},
|
|
17
|
+
}, Ee = ["onClick"], Le = { class: "cd-ps-info" }, Me = { class: "cd-ps-name" }, Ae = { class: "cd-ps-meta" }, je = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "cd-ps-type-tag"
|
|
20
|
+
}, Je = { key: 1 }, Fe = { key: 2 }, qe = { key: 3 }, Ge = { key: 4 }, He = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "cd-ps-tree"
|
|
23
|
+
}, Qe = { class: "cd-ps-node-name" }, Xe = {
|
|
21
24
|
key: 0,
|
|
22
25
|
class: "cd-ps-position"
|
|
23
26
|
}, Ye = {
|
|
@@ -32,7 +35,7 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
32
35
|
}, lt = {
|
|
33
36
|
key: 1,
|
|
34
37
|
class: "cd-ps-selected-list"
|
|
35
|
-
}, nt = { class: "cd-ps-item-info" }, ot = { class: "cd-ps-info" }, it = { class: "cd-ps-name" },
|
|
38
|
+
}, nt = { class: "cd-ps-item-info" }, ot = { class: "cd-ps-info" }, it = { class: "cd-ps-name" }, ct = { class: "cd-ps-meta" }, dt = { key: 0 }, ut = { key: 1 }, rt = { key: 2 }, pt = { key: 3 }, vt = /* @__PURE__ */ ge({
|
|
36
39
|
__name: "PersonSelector",
|
|
37
40
|
props: {
|
|
38
41
|
visible: { type: Boolean, default: !1 },
|
|
@@ -45,167 +48,202 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
45
48
|
showOrg: { type: Boolean, default: !0 },
|
|
46
49
|
multiple: { type: Boolean, default: !0 }
|
|
47
50
|
},
|
|
48
|
-
emits: ["update:visible", "update:modelValue", "confirm", "load-users", "search", "org-change"],
|
|
49
|
-
setup(
|
|
50
|
-
var
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
if (
|
|
51
|
+
emits: ["update:visible", "update:modelValue", "confirm", "load-users", "search", "org-change", "tab-change"],
|
|
52
|
+
setup(b, { expose: Q, emit: C }) {
|
|
53
|
+
var he, me;
|
|
54
|
+
const r = b, V = C, T = y(r.visible), U = y(((me = (he = r.tabs) == null ? void 0 : he[0]) == null ? void 0 : me.key) || ""), z = y(null), W = y(""), v = y([]), I = y(/* @__PURE__ */ new Map()), X = y({}), j = y(!1), F = y(!1), D = y({}), ie = A(() => r.tabs || []), ae = A(() => r.organizations || []);
|
|
55
|
+
A(() => r.tips || "");
|
|
56
|
+
const ce = A(() => r.showSearch), L = A(() => r.showOrg), de = A(() => r.dialogWidth), R = y({});
|
|
57
|
+
H(() => r.tabs, (t) => {
|
|
58
|
+
if (t && t.length > 0) {
|
|
56
59
|
const e = {};
|
|
57
|
-
|
|
58
|
-
e[
|
|
59
|
-
}),
|
|
60
|
+
t.forEach((s) => {
|
|
61
|
+
e[s.key] = JSON.parse(JSON.stringify(s.tree));
|
|
62
|
+
}), R.value = e, (!U.value || !t.find((s) => s.key === U.value)) && (U.value = t[0].key);
|
|
60
63
|
}
|
|
61
64
|
}, { immediate: !0, deep: !0 });
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
typeof
|
|
66
|
-
|
|
67
|
-
})) :
|
|
65
|
+
function se() {
|
|
66
|
+
if (r.modelValue && r.modelValue.length > 0) {
|
|
67
|
+
const t = r.modelValue[0];
|
|
68
|
+
typeof t == "object" && t !== null && "id" in t ? (v.value = r.modelValue.map((e) => e.id), I.value.clear(), r.modelValue.forEach((e) => {
|
|
69
|
+
I.value.set(e.id, e);
|
|
70
|
+
})) : v.value = [...r.modelValue];
|
|
68
71
|
} else
|
|
69
|
-
|
|
72
|
+
v.value = [], I.value.clear();
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
T.value &&
|
|
73
|
-
}, { deep: !0 }),
|
|
74
|
-
T.value =
|
|
75
|
-
}),
|
|
76
|
-
|
|
74
|
+
H(() => r.modelValue, (t) => {
|
|
75
|
+
T.value && t && se();
|
|
76
|
+
}, { deep: !0 }), H(() => r.visible, (t) => {
|
|
77
|
+
T.value = t, t && (se(), r.organizations.length > 0 && !z.value && (z.value = r.organizations[0].id));
|
|
78
|
+
}), H(T, (t) => {
|
|
79
|
+
V("update:visible", t);
|
|
77
80
|
});
|
|
78
|
-
function
|
|
79
|
-
e && (
|
|
81
|
+
function ue(t, e) {
|
|
82
|
+
e && (X.value[t] = e);
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
for (const
|
|
83
|
-
if (
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
84
|
+
function Y(t, e) {
|
|
85
|
+
for (const s of t) {
|
|
86
|
+
if (s.id === e) return s;
|
|
87
|
+
if (s.children) {
|
|
88
|
+
const u = Y(s.children, e);
|
|
89
|
+
if (u) return u;
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
return null;
|
|
90
93
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
+
const J = A(() => v.value.map((t) => I.value.get(t)).filter(Boolean));
|
|
95
|
+
function le(t, e) {
|
|
96
|
+
v.value.includes(t) || v.value.push(t), I.value.set(t, e);
|
|
94
97
|
}
|
|
95
|
-
function t
|
|
96
|
-
|
|
98
|
+
function a(t) {
|
|
99
|
+
v.value = v.value.filter((e) => e !== t), I.value.delete(t);
|
|
97
100
|
}
|
|
98
|
-
const i = () => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
const i = (t) => {
|
|
102
|
+
var s;
|
|
103
|
+
if (!j.value) return t.name;
|
|
104
|
+
const e = ((s = D.value[t.key]) == null ? void 0 : s.length) ?? 0;
|
|
105
|
+
return e > 0 ? `${t.name} (${e})` : t.name;
|
|
106
|
+
}, k = (t) => {
|
|
107
|
+
j.value || (W.value = "", V("tab-change", { tabKey: t }));
|
|
108
|
+
}, O = (t) => {
|
|
101
109
|
const e = {};
|
|
102
|
-
|
|
103
|
-
e[
|
|
104
|
-
}),
|
|
110
|
+
r.tabs.forEach((u) => {
|
|
111
|
+
e[u.key] = [];
|
|
112
|
+
}), R.value = e;
|
|
113
|
+
const s = () => {
|
|
114
|
+
};
|
|
115
|
+
V("org-change", { orgId: t, tabKey: U.value, callback: s });
|
|
105
116
|
};
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
|
|
117
|
+
let w = null;
|
|
118
|
+
const P = () => {
|
|
119
|
+
if (w && clearTimeout(w), !W.value.trim()) {
|
|
120
|
+
ne();
|
|
110
121
|
return;
|
|
111
122
|
}
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
D.value =
|
|
115
|
-
const
|
|
116
|
-
|
|
123
|
+
j.value = !0, F.value = !0, w = setTimeout(() => o(), 300);
|
|
124
|
+
}, o = () => {
|
|
125
|
+
D.value = {};
|
|
126
|
+
const t = (e) => {
|
|
127
|
+
const s = {};
|
|
128
|
+
e.forEach((u) => {
|
|
129
|
+
const m = { ...u, isUser: u.isUser !== !1 }, $ = u.nodeType || (u.isUser !== !1 ? "user" : "department");
|
|
130
|
+
s[$] || (s[$] = []), s[$].push(m);
|
|
131
|
+
}), D.value = s, F.value = !1;
|
|
117
132
|
};
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
133
|
+
V("search", { keyword: W.value, orgId: z.value || void 0, callback: t });
|
|
134
|
+
}, ne = () => {
|
|
135
|
+
w && (clearTimeout(w), w = null), j.value = !1, W.value = "", D.value = {}, F.value = !1;
|
|
136
|
+
}, be = (t) => {
|
|
137
|
+
if (v.value.indexOf(t.id) > -1)
|
|
138
|
+
a(t.id);
|
|
139
|
+
else {
|
|
140
|
+
r.multiple || (v.value = [], I.value.clear());
|
|
141
|
+
const s = t.isUser ? "搜索结果" : t.isPost ? "职位" : "部门";
|
|
142
|
+
le(t.id, { ...t, typeName: s, orgId: z.value }), r.multiple || re();
|
|
143
|
+
}
|
|
123
144
|
};
|
|
124
|
-
function Ce(
|
|
125
|
-
const e = [],
|
|
126
|
-
for (const
|
|
127
|
-
e.push(
|
|
145
|
+
function Ce(t) {
|
|
146
|
+
const e = [], s = (u) => {
|
|
147
|
+
for (const m of u)
|
|
148
|
+
e.push(m.id), m.children && s(m.children);
|
|
128
149
|
};
|
|
129
|
-
return
|
|
150
|
+
return s(t), e;
|
|
130
151
|
}
|
|
131
|
-
const Ve = (
|
|
132
|
-
var
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
152
|
+
const Ve = (t, e) => {
|
|
153
|
+
var B, g;
|
|
154
|
+
const s = e == null ? void 0 : e.node;
|
|
155
|
+
if (s) {
|
|
156
|
+
const f = s.value ?? ((B = s.data) == null ? void 0 : B.id);
|
|
157
|
+
if (f !== void 0) {
|
|
158
|
+
if (s.checked) {
|
|
159
|
+
r.multiple || (v.value = [], I.value.clear());
|
|
160
|
+
const q = r.tabs.find((K) => K.key === U.value), Z = q ? q.name.replace(/^按/, "") : "";
|
|
161
|
+
le(f, { ...s.data, typeName: Z, orgId: z.value }), !r.multiple && ((g = s.data) != null && g.isUser) && re();
|
|
141
162
|
} else
|
|
142
|
-
|
|
163
|
+
a(f);
|
|
143
164
|
return;
|
|
144
165
|
}
|
|
145
166
|
}
|
|
146
|
-
const
|
|
147
|
-
|
|
167
|
+
const u = R.value[U.value] || [], m = Ce(u), $ = v.value.filter((f) => !m.includes(f));
|
|
168
|
+
v.value = [...$, ...t];
|
|
148
169
|
};
|
|
149
|
-
function ve(
|
|
150
|
-
for (const
|
|
151
|
-
if (
|
|
152
|
-
return
|
|
153
|
-
if (
|
|
170
|
+
function ve(t, e, s) {
|
|
171
|
+
for (const u of t) {
|
|
172
|
+
if (u.id === e)
|
|
173
|
+
return u.children = u.children || [], u.children.push(...s), u.loaded = !0, !0;
|
|
174
|
+
if (u.children && ve(u.children, e, s))
|
|
154
175
|
return !0;
|
|
155
176
|
}
|
|
156
177
|
return !1;
|
|
157
178
|
}
|
|
158
|
-
async function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
179
|
+
async function Ue(t, e) {
|
|
180
|
+
var $;
|
|
181
|
+
const s = t.value, u = X.value[e];
|
|
182
|
+
if (t.data.loaded) {
|
|
183
|
+
const B = R.value[e];
|
|
184
|
+
if (B) {
|
|
185
|
+
const g = Y(B, s);
|
|
186
|
+
g && g.children && (g.children = g.children.filter((f) => !f.isUser));
|
|
187
|
+
}
|
|
188
|
+
u && ((($ = u.getItem(s)) == null ? void 0 : $.children) || []).filter((f) => {
|
|
189
|
+
var M;
|
|
190
|
+
return (M = f.data) == null ? void 0 : M.isUser;
|
|
191
|
+
}).forEach((f) => {
|
|
192
|
+
try {
|
|
193
|
+
u.remove(f.value);
|
|
194
|
+
} catch {
|
|
195
|
+
}
|
|
196
|
+
}), t.data.loaded = !1;
|
|
197
|
+
}
|
|
198
|
+
V("load-users", { tabKey: e, nodeId: s, node: t, callback: async (B) => {
|
|
199
|
+
if (B.length > 0) {
|
|
200
|
+
const g = B.map((M) => {
|
|
201
|
+
const { id: q, name: Z, ...K } = M;
|
|
202
|
+
return { ...K, id: q, name: M.displayName || Z, isUser: !0 };
|
|
203
|
+
}), f = R.value[e];
|
|
204
|
+
if (f && ve(f, s, g), u) {
|
|
205
|
+
u.appendTo(s, g), t.data.loaded = !0, await Ne();
|
|
168
206
|
try {
|
|
169
|
-
|
|
207
|
+
u.setItem(s, { expanded: !0 });
|
|
170
208
|
} catch {
|
|
171
209
|
}
|
|
172
210
|
}
|
|
173
211
|
} else {
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
|
|
212
|
+
t.data.loaded = !0;
|
|
213
|
+
const g = R.value[e];
|
|
214
|
+
if (g) {
|
|
215
|
+
const f = Y(g, s);
|
|
216
|
+
f && (f.loaded = !0);
|
|
179
217
|
}
|
|
180
218
|
}
|
|
181
219
|
} });
|
|
182
220
|
}
|
|
183
|
-
const
|
|
184
|
-
t
|
|
185
|
-
},
|
|
186
|
-
|
|
221
|
+
const Se = (t) => {
|
|
222
|
+
a(t);
|
|
223
|
+
}, fe = () => {
|
|
224
|
+
v.value = [], I.value.clear();
|
|
187
225
|
}, re = () => {
|
|
188
|
-
|
|
226
|
+
V("update:modelValue", v.value), V("confirm", J.value), T.value = !1;
|
|
189
227
|
}, Ie = () => {
|
|
190
228
|
T.value = !1;
|
|
191
229
|
};
|
|
192
|
-
return
|
|
193
|
-
clearSelection:
|
|
194
|
-
appendUsers: (
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
const { id:
|
|
199
|
-
return {
|
|
230
|
+
return Q({
|
|
231
|
+
clearSelection: fe,
|
|
232
|
+
appendUsers: (t, e, s) => {
|
|
233
|
+
const u = X.value[t];
|
|
234
|
+
if (u && s.length > 0) {
|
|
235
|
+
const m = s.map(($) => {
|
|
236
|
+
const { id: B, name: g, ...f } = $;
|
|
237
|
+
return { ...f, id: B, name: $.displayName || g, isUser: !0 };
|
|
200
238
|
});
|
|
201
|
-
|
|
239
|
+
u.appendTo(e, m);
|
|
202
240
|
}
|
|
203
241
|
}
|
|
204
|
-
}), (
|
|
205
|
-
const
|
|
206
|
-
return l(),
|
|
242
|
+
}), (t, e) => {
|
|
243
|
+
const s = x("t-option"), u = x("t-select"), m = x("t-icon"), $ = x("t-input"), B = x("t-loading"), g = x("t-checkbox"), f = x("t-button"), M = x("t-tree"), q = x("t-tab-panel"), Z = x("t-tabs"), K = x("t-dialog");
|
|
244
|
+
return l(), E(K, {
|
|
207
245
|
visible: T.value,
|
|
208
|
-
"onUpdate:visible": e[4] || (e[4] = (
|
|
246
|
+
"onUpdate:visible": e[4] || (e[4] = (n) => T.value = n),
|
|
209
247
|
header: "选择人员",
|
|
210
248
|
width: de.value,
|
|
211
249
|
footer: !0,
|
|
@@ -214,223 +252,213 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
214
252
|
onConfirm: re,
|
|
215
253
|
onClose: Ie
|
|
216
254
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
L.value &&
|
|
221
|
-
|
|
255
|
+
default: N(() => [
|
|
256
|
+
p("div", ze, [
|
|
257
|
+
ce.value ? (l(), c("div", $e, [
|
|
258
|
+
L.value && ae.value.length > 0 ? (l(), c("div", we, [
|
|
259
|
+
S(u, {
|
|
222
260
|
modelValue: z.value,
|
|
223
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
261
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => z.value = n),
|
|
224
262
|
placeholder: "选择组织",
|
|
225
263
|
style: { width: "200px" },
|
|
226
|
-
onChange:
|
|
264
|
+
onChange: O
|
|
227
265
|
}, {
|
|
228
|
-
default:
|
|
229
|
-
(l(!0),
|
|
230
|
-
key:
|
|
231
|
-
value:
|
|
232
|
-
label:
|
|
266
|
+
default: N(() => [
|
|
267
|
+
(l(!0), c(G, null, te(ae.value, (n) => (l(), E(s, {
|
|
268
|
+
key: n.id,
|
|
269
|
+
value: n.id,
|
|
270
|
+
label: n.displayName || n.name
|
|
233
271
|
}, null, 8, ["value", "label"]))), 128))
|
|
234
272
|
]),
|
|
235
273
|
_: 1
|
|
236
274
|
}, 8, ["modelValue"])
|
|
237
|
-
])) :
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
modelValue:
|
|
241
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
275
|
+
])) : _("", !0),
|
|
276
|
+
p("div", Be, [
|
|
277
|
+
S($, {
|
|
278
|
+
modelValue: W.value,
|
|
279
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => W.value = n),
|
|
242
280
|
placeholder: "输入手机号/工号/姓名/部门/职位搜索",
|
|
243
281
|
clearable: "",
|
|
244
|
-
|
|
245
|
-
|
|
282
|
+
inputProps: { autocomplete: "off" },
|
|
283
|
+
onInput: P,
|
|
284
|
+
onClear: ne
|
|
246
285
|
}, {
|
|
247
|
-
"prefix-icon":
|
|
248
|
-
|
|
286
|
+
"prefix-icon": N(() => [
|
|
287
|
+
S(m, { name: "search" })
|
|
249
288
|
]),
|
|
250
289
|
_: 1
|
|
251
290
|
}, 8, ["modelValue"])
|
|
252
291
|
])
|
|
253
|
-
])) :
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
size: "small",
|
|
261
|
-
variant: "text",
|
|
262
|
-
onClick: n
|
|
263
|
-
}, {
|
|
264
|
-
default: S(() => [...e[5] || (e[5] = [
|
|
265
|
-
Z("返回", -1)
|
|
266
|
-
])]),
|
|
267
|
-
_: 1
|
|
268
|
-
})
|
|
269
|
-
]),
|
|
270
|
-
J.value ? (l(), d("div", Re, [
|
|
271
|
-
g(w),
|
|
272
|
-
e[7] || (e[7] = u("span", null, "搜索中...", -1))
|
|
273
|
-
])) : D.value.length === 0 ? (l(), d("div", We, [
|
|
274
|
-
g(f, {
|
|
275
|
-
name: "search",
|
|
276
|
-
size: "48px",
|
|
277
|
-
style: { color: "#ddd" }
|
|
278
|
-
}),
|
|
279
|
-
e[8] || (e[8] = u("p", null, "未找到匹配的人员", -1))
|
|
280
|
-
])) : (l(), d("div", Le, [
|
|
281
|
-
(l(!0), d(X, null, Y(D.value, (s) => (l(), d("div", {
|
|
282
|
-
key: s.id,
|
|
283
|
-
class: ne(["cd-ps-result-item", { "cd-ps-selected": r.value.includes(s.id) }]),
|
|
284
|
-
onClick: (le) => ue(s)
|
|
285
|
-
}, [
|
|
286
|
-
g($, {
|
|
287
|
-
checked: r.value.includes(s.id),
|
|
288
|
-
onClick: e[2] || (e[2] = ge(() => {
|
|
289
|
-
}, ["stop"]))
|
|
290
|
-
}, null, 8, ["checked"]),
|
|
291
|
-
u("div", Ee, [
|
|
292
|
-
g(f, { name: "user" })
|
|
293
|
-
]),
|
|
294
|
-
u("div", Ae, [
|
|
295
|
-
u("div", Je, v(s.displayName || s.name), 1),
|
|
296
|
-
u("div", je, [
|
|
297
|
-
s.position ? (l(), d("span", Fe, v(s.position), 1)) : k("", !0),
|
|
298
|
-
s.department ? (l(), d("span", qe, v(s.department), 1)) : k("", !0),
|
|
299
|
-
s.phone ? (l(), d("span", Ge, v(s.phone), 1)) : k("", !0)
|
|
300
|
-
])
|
|
301
|
-
])
|
|
302
|
-
], 10, Me))), 128))
|
|
303
|
-
]))
|
|
304
|
-
])) : (l(), W(Q, {
|
|
305
|
-
key: 1,
|
|
306
|
-
modelValue: I.value,
|
|
307
|
-
"onUpdate:modelValue": e[3] || (e[3] = (s) => I.value = s),
|
|
308
|
-
onChange: i
|
|
292
|
+
])) : _("", !0),
|
|
293
|
+
p("div", De, [
|
|
294
|
+
p("div", Oe, [
|
|
295
|
+
S(Z, {
|
|
296
|
+
modelValue: U.value,
|
|
297
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => U.value = n),
|
|
298
|
+
onChange: k
|
|
309
299
|
}, {
|
|
310
|
-
default:
|
|
311
|
-
(l(!0),
|
|
312
|
-
key:
|
|
313
|
-
value:
|
|
314
|
-
label:
|
|
300
|
+
default: N(() => [
|
|
301
|
+
(l(!0), c(G, null, te(ie.value, (n) => (l(), E(q, {
|
|
302
|
+
key: n.key,
|
|
303
|
+
value: n.key,
|
|
304
|
+
label: i(n)
|
|
315
305
|
}, {
|
|
316
|
-
default:
|
|
317
|
-
var
|
|
306
|
+
default: N(() => {
|
|
307
|
+
var pe;
|
|
318
308
|
return [
|
|
319
|
-
|
|
320
|
-
|
|
309
|
+
j.value ? (l(), c(G, { key: 0 }, [
|
|
310
|
+
F.value ? (l(), c("div", Pe, [
|
|
311
|
+
S(B),
|
|
312
|
+
e[5] || (e[5] = p("span", null, "搜索中...", -1))
|
|
313
|
+
])) : !D.value[n.key] || D.value[n.key].length === 0 ? (l(), c("div", Re, [
|
|
314
|
+
S(m, {
|
|
315
|
+
name: "search",
|
|
316
|
+
size: "48px",
|
|
317
|
+
style: { color: "#ddd" }
|
|
318
|
+
}),
|
|
319
|
+
e[6] || (e[6] = p("p", null, "暂无结果", -1))
|
|
320
|
+
])) : (l(), c("div", We, [
|
|
321
|
+
(l(!0), c(G, null, te(D.value[n.key], (d) => (l(), c("div", {
|
|
322
|
+
key: d.id,
|
|
323
|
+
class: ee(["cd-ps-result-item", { "cd-ps-selected": v.value.includes(d.id), "cd-ps-dept-result": !d.isUser }]),
|
|
324
|
+
onClick: (xe) => be(d)
|
|
325
|
+
}, [
|
|
326
|
+
S(g, {
|
|
327
|
+
checked: v.value.includes(d.id),
|
|
328
|
+
onClick: e[2] || (e[2] = _e(() => {
|
|
329
|
+
}, ["stop"]))
|
|
330
|
+
}, null, 8, ["checked"]),
|
|
331
|
+
p("div", {
|
|
332
|
+
class: ee(["cd-ps-avatar", { "cd-ps-avatar-dept": !d.isUser }])
|
|
333
|
+
}, [
|
|
334
|
+
S(m, {
|
|
335
|
+
name: d.isUser ? "user" : d.isPost ? "assignment-checked" : "folder"
|
|
336
|
+
}, null, 8, ["name"])
|
|
337
|
+
], 2),
|
|
338
|
+
p("div", Le, [
|
|
339
|
+
p("div", Me, h(d.displayName || d.name), 1),
|
|
340
|
+
p("div", Ae, [
|
|
341
|
+
d.isUser ? _("", !0) : (l(), c("span", je, h(d.isPost ? "职位" : "部门"), 1)),
|
|
342
|
+
d.position ? (l(), c("span", Je, h(d.position), 1)) : _("", !0),
|
|
343
|
+
d.department ? (l(), c("span", Fe, h(d.department), 1)) : _("", !0),
|
|
344
|
+
d.phone ? (l(), c("span", qe, h(d.phone), 1)) : _("", !0),
|
|
345
|
+
d.userCount ? (l(), c("span", Ge, h(d.userCount) + "人", 1)) : _("", !0)
|
|
346
|
+
])
|
|
347
|
+
])
|
|
348
|
+
], 10, Ee))), 128))
|
|
349
|
+
]))
|
|
350
|
+
], 64)) : (l(), c("div", He, [
|
|
351
|
+
((pe = R.value[n.key]) == null ? void 0 : pe.length) > 0 ? (l(), E(M, {
|
|
321
352
|
key: 0,
|
|
322
353
|
ref_for: !0,
|
|
323
|
-
ref: (
|
|
324
|
-
data:
|
|
354
|
+
ref: (d) => ue(n.key, d),
|
|
355
|
+
data: R.value[n.key],
|
|
325
356
|
keys: { value: "id", label: "name", children: "children" },
|
|
326
357
|
hover: "",
|
|
327
358
|
checkable: "",
|
|
328
359
|
"expand-all": !1,
|
|
329
|
-
value:
|
|
360
|
+
value: v.value,
|
|
330
361
|
onChange: Ve
|
|
331
362
|
}, {
|
|
332
|
-
label:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
363
|
+
label: N(({ node: d }) => [
|
|
364
|
+
p("div", {
|
|
365
|
+
class: ee(["cd-ps-node", { "cd-ps-node-user": d.data.isUser }])
|
|
366
|
+
}, [
|
|
367
|
+
S(m, {
|
|
368
|
+
name: d.data.isUser ? "user" : n.icon || "folder"
|
|
369
|
+
}, null, 8, ["name"]),
|
|
370
|
+
p("span", Qe, [
|
|
371
|
+
oe(h(d.label) + " ", 1),
|
|
372
|
+
d.data.isUser && d.data.position ? (l(), c("span", Xe, h(d.data.position), 1)) : _("", !0)
|
|
373
|
+
]),
|
|
374
|
+
d.data.userCount && !d.data.isUser ? (l(), c("span", Ye, "(" + h(d.data.userCount) + ")", 1)) : _("", !0),
|
|
375
|
+
d.data.isUser ? _("", !0) : (l(), E(f, {
|
|
376
|
+
key: 1,
|
|
377
|
+
size: "small",
|
|
378
|
+
variant: "text",
|
|
379
|
+
class: "cd-ps-load-btn",
|
|
380
|
+
onClick: _e((xe) => Ue(d, n.key), ["stop"])
|
|
381
|
+
}, {
|
|
382
|
+
default: N(() => [
|
|
383
|
+
oe(h(d.data.loaded ? "刷新人员" : "显示人员"), 1)
|
|
344
384
|
]),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
variant: "text",
|
|
350
|
-
class: "cd-ps-load-btn",
|
|
351
|
-
onClick: ge((xt) => Se(V, s.key), ["stop"])
|
|
352
|
-
}, {
|
|
353
|
-
default: S(() => [...e[9] || (e[9] = [
|
|
354
|
-
Z("显示人员", -1)
|
|
355
|
-
])]),
|
|
356
|
-
_: 1
|
|
357
|
-
}, 8, ["onClick"])) : k("", !0)
|
|
358
|
-
], 2)
|
|
359
|
-
];
|
|
360
|
-
}),
|
|
385
|
+
_: 2
|
|
386
|
+
}, 1032, ["onClick"]))
|
|
387
|
+
], 2)
|
|
388
|
+
]),
|
|
361
389
|
_: 2
|
|
362
|
-
}, 1032, ["data", "value"])) : (l(),
|
|
363
|
-
|
|
364
|
-
name:
|
|
390
|
+
}, 1032, ["data", "value"])) : (l(), c("div", Ze, [
|
|
391
|
+
S(m, {
|
|
392
|
+
name: n.icon || "folder-open",
|
|
365
393
|
size: "48px",
|
|
366
394
|
style: { color: "#ddd" }
|
|
367
395
|
}, null, 8, ["name"]),
|
|
368
|
-
e[
|
|
396
|
+
e[7] || (e[7] = p("p", null, "暂无数据", -1))
|
|
369
397
|
]))
|
|
370
|
-
])
|
|
398
|
+
]))
|
|
371
399
|
];
|
|
372
400
|
}),
|
|
373
401
|
_: 2
|
|
374
402
|
}, 1032, ["value", "label"]))), 128))
|
|
375
403
|
]),
|
|
376
404
|
_: 1
|
|
377
|
-
}, 8, ["modelValue"])
|
|
405
|
+
}, 8, ["modelValue"])
|
|
378
406
|
]),
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
e[
|
|
382
|
-
|
|
383
|
-
|
|
407
|
+
p("div", Ke, [
|
|
408
|
+
p("div", et, [
|
|
409
|
+
e[9] || (e[9] = p("span", { class: "cd-ps-title" }, "已选择", -1)),
|
|
410
|
+
p("span", tt, h(J.value.length) + " 项", 1),
|
|
411
|
+
J.value.length > 0 ? (l(), E(f, {
|
|
384
412
|
key: 0,
|
|
385
413
|
size: "small",
|
|
386
414
|
variant: "text",
|
|
387
|
-
onClick:
|
|
415
|
+
onClick: fe
|
|
388
416
|
}, {
|
|
389
|
-
default:
|
|
390
|
-
|
|
417
|
+
default: N(() => [...e[8] || (e[8] = [
|
|
418
|
+
oe("清空", -1)
|
|
391
419
|
])]),
|
|
392
420
|
_: 1
|
|
393
|
-
})) :
|
|
421
|
+
})) : _("", !0)
|
|
394
422
|
]),
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
423
|
+
p("div", at, [
|
|
424
|
+
J.value.length === 0 ? (l(), c("div", st, [
|
|
425
|
+
S(m, {
|
|
398
426
|
name: "user-checked",
|
|
399
427
|
size: "64px",
|
|
400
428
|
style: { color: "#ddd" }
|
|
401
429
|
}),
|
|
402
|
-
e[
|
|
403
|
-
])) : (l(),
|
|
404
|
-
(l(!0),
|
|
405
|
-
key:
|
|
406
|
-
class:
|
|
430
|
+
e[10] || (e[10] = p("p", null, "暂无选择", -1))
|
|
431
|
+
])) : (l(), c("div", lt, [
|
|
432
|
+
(l(!0), c(G, null, te(J.value, (n) => (l(), c("div", {
|
|
433
|
+
key: n.id,
|
|
434
|
+
class: ee(["cd-ps-selected-item", { "cd-ps-dept-item": !n.isUser }])
|
|
407
435
|
}, [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
class:
|
|
436
|
+
p("div", nt, [
|
|
437
|
+
p("div", {
|
|
438
|
+
class: ee(["cd-ps-avatar", { "cd-ps-avatar-dept": !n.isUser }])
|
|
411
439
|
}, [
|
|
412
|
-
|
|
413
|
-
name:
|
|
440
|
+
S(m, {
|
|
441
|
+
name: n.isUser ? "user" : "folder"
|
|
414
442
|
}, null, 8, ["name"])
|
|
415
443
|
], 2),
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
!
|
|
444
|
+
p("div", ot, [
|
|
445
|
+
p("div", it, h(n.displayName || n.name), 1),
|
|
446
|
+
p("div", ct, [
|
|
447
|
+
n.isUser && n.position ? (l(), c("span", dt, h(n.position), 1)) : _("", !0),
|
|
448
|
+
n.isUser && n.department ? (l(), c("span", ut, h(n.department), 1)) : _("", !0),
|
|
449
|
+
n.isUser ? _("", !0) : (l(), c("span", rt, h(n.typeName || "部门"), 1)),
|
|
450
|
+
!n.isUser && n.userCount ? (l(), c("span", pt, h(n.userCount) + "人", 1)) : _("", !0)
|
|
423
451
|
])
|
|
424
452
|
])
|
|
425
453
|
]),
|
|
426
|
-
|
|
454
|
+
S(f, {
|
|
427
455
|
size: "small",
|
|
428
456
|
variant: "text",
|
|
429
457
|
shape: "circle",
|
|
430
|
-
onClick: (
|
|
458
|
+
onClick: (pe) => Se(n.id)
|
|
431
459
|
}, {
|
|
432
|
-
icon:
|
|
433
|
-
|
|
460
|
+
icon: N(() => [
|
|
461
|
+
S(m, { name: "close" })
|
|
434
462
|
]),
|
|
435
463
|
_: 1
|
|
436
464
|
}, 8, ["onClick"])
|
|
@@ -445,18 +473,18 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
445
473
|
}, 8, ["visible", "width"]);
|
|
446
474
|
};
|
|
447
475
|
}
|
|
448
|
-
}), ye = (
|
|
449
|
-
const
|
|
450
|
-
for (const [
|
|
451
|
-
|
|
452
|
-
return
|
|
453
|
-
},
|
|
476
|
+
}), ye = (b, Q) => {
|
|
477
|
+
const C = b.__vccOpts || b;
|
|
478
|
+
for (const [r, V] of Q)
|
|
479
|
+
C[r] = V;
|
|
480
|
+
return C;
|
|
481
|
+
}, ke = /* @__PURE__ */ ye(vt, [["__scopeId", "data-v-19347ac6"]]), ft = { class: "cd-input-select" }, ht = {
|
|
454
482
|
key: 0,
|
|
455
483
|
class: "cd-input-select__panel"
|
|
456
|
-
},
|
|
484
|
+
}, mt = { class: "cd-input-select__option-content" }, _t = {
|
|
457
485
|
key: 0,
|
|
458
486
|
class: "cd-input-select__option-avatar"
|
|
459
|
-
}, gt = ["src", "alt"],
|
|
487
|
+
}, gt = ["src", "alt"], yt = { class: "cd-input-select__option-info" }, kt = { class: "cd-input-select__option-name" }, bt = {
|
|
460
488
|
key: 0,
|
|
461
489
|
class: "cd-input-select__option-desc"
|
|
462
490
|
}, Ct = {
|
|
@@ -465,10 +493,10 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
465
493
|
}, Vt = {
|
|
466
494
|
key: 1,
|
|
467
495
|
class: "cd-input-select__loading"
|
|
468
|
-
},
|
|
496
|
+
}, Ut = {
|
|
469
497
|
key: 2,
|
|
470
498
|
class: "cd-input-select__empty"
|
|
471
|
-
},
|
|
499
|
+
}, St = /* @__PURE__ */ ge({
|
|
472
500
|
name: "CdInputPersonSelector",
|
|
473
501
|
__name: "InputSelect",
|
|
474
502
|
props: {
|
|
@@ -479,76 +507,76 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
479
507
|
organizations: {}
|
|
480
508
|
},
|
|
481
509
|
emits: ["update:modelValue", "search", "load-users"],
|
|
482
|
-
setup(
|
|
483
|
-
const
|
|
484
|
-
label:
|
|
485
|
-
value:
|
|
486
|
-
}))),
|
|
510
|
+
setup(b, { emit: Q }) {
|
|
511
|
+
const C = b, r = Q, V = y(!1), T = y([]), U = y(!1), z = y([]), W = y([]), v = y(!1), I = y(""), X = A(() => C.modelValue.map((a) => ({
|
|
512
|
+
label: a.name,
|
|
513
|
+
value: a.id
|
|
514
|
+
}))), j = (a) => a ? a.substring(0, 2).toUpperCase() : "", F = (a) => {
|
|
487
515
|
const i = ["#1890ff", "#52c41a", "#faad14", "#f5222d", "#722ed1", "#13c2c2", "#eb2f96", "#fa8c16"];
|
|
488
|
-
let
|
|
489
|
-
for (let
|
|
490
|
-
|
|
491
|
-
return i[Math.abs(
|
|
492
|
-
}, D = (
|
|
493
|
-
const i = String(
|
|
516
|
+
let k = 0;
|
|
517
|
+
for (let O = 0; O < a.length; O++)
|
|
518
|
+
k = a.charCodeAt(O) + ((k << 5) - k);
|
|
519
|
+
return i[Math.abs(k) % i.length];
|
|
520
|
+
}, D = (a) => String(a).startsWith("dept-"), ie = (a) => {
|
|
521
|
+
const i = String(a);
|
|
494
522
|
return i.startsWith("dept-") ? "warning" : i.startsWith("u-") ? "primary" : i.startsWith("pos-") ? "success" : i.startsWith("role-") ? "info" : "default";
|
|
495
|
-
},
|
|
496
|
-
id:
|
|
497
|
-
name:
|
|
498
|
-
avatar:
|
|
499
|
-
department:
|
|
500
|
-
position:
|
|
501
|
-
phone:
|
|
502
|
-
isUser:
|
|
503
|
-
}), L = (
|
|
504
|
-
|
|
505
|
-
}, de = (
|
|
506
|
-
|
|
507
|
-
},
|
|
508
|
-
|
|
509
|
-
},
|
|
510
|
-
const { trigger:
|
|
511
|
-
if ((
|
|
523
|
+
}, ae = (a) => C.modelValue.some((i) => i.id === a), ce = (a) => ({
|
|
524
|
+
id: a.id,
|
|
525
|
+
name: a.displayName || a.name || a.title || String(a.id),
|
|
526
|
+
avatar: a.avatar || "",
|
|
527
|
+
department: a.department || "",
|
|
528
|
+
position: a.position || "",
|
|
529
|
+
phone: a.phone || "",
|
|
530
|
+
isUser: a.isUser !== !1
|
|
531
|
+
}), L = (a) => {
|
|
532
|
+
r("update:modelValue", a), W.value = a;
|
|
533
|
+
}, de = (a) => {
|
|
534
|
+
a || (T.value = [], I.value = "");
|
|
535
|
+
}, R = (a, i) => {
|
|
536
|
+
a ? C.multiple ? L([...C.modelValue, i]) : (L([i]), v.value = !1) : L(C.modelValue.filter((k) => k.id !== i.id));
|
|
537
|
+
}, se = (a, i) => {
|
|
538
|
+
const { trigger: k, index: O } = i;
|
|
539
|
+
if ((k === "tag-remove" || k === "backspace") && (v.value = !1), k === "clear")
|
|
512
540
|
z.value = [], L([]);
|
|
513
|
-
else if (["tag-remove", "backspace"].includes(
|
|
514
|
-
const
|
|
515
|
-
z.value =
|
|
516
|
-
const
|
|
517
|
-
|
|
541
|
+
else if (["tag-remove", "backspace"].includes(k)) {
|
|
542
|
+
const w = a.map((o) => o.value || o);
|
|
543
|
+
z.value = w;
|
|
544
|
+
const P = [...C.modelValue];
|
|
545
|
+
P.splice(O, 1), L(P);
|
|
518
546
|
}
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
},
|
|
522
|
-
const i =
|
|
523
|
-
L(
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
|
|
547
|
+
}, ue = (a) => {
|
|
548
|
+
a.stopPropagation(), a.preventDefault(), v.value = !1, U.value = !0;
|
|
549
|
+
}, Y = (a) => {
|
|
550
|
+
const i = a.map(ce), k = new Set(C.modelValue.map((P) => P.id)), O = i.filter((P) => !k.has(P.id)), w = C.multiple ? [...C.modelValue, ...O] : i.slice(0, 1);
|
|
551
|
+
L(w), U.value = !1;
|
|
552
|
+
}, J = (a) => {
|
|
553
|
+
r("load-users", a);
|
|
554
|
+
}, le = (a) => {
|
|
555
|
+
r("search", { keyword: a.keyword, callback: a.callback });
|
|
528
556
|
};
|
|
529
|
-
return
|
|
530
|
-
z.value =
|
|
531
|
-
}, { immediate: !0, deep: !0 }),
|
|
532
|
-
if (!(
|
|
533
|
-
T.value = [],
|
|
557
|
+
return H(() => C.modelValue, (a) => {
|
|
558
|
+
z.value = a.map((i) => i.id), W.value = a;
|
|
559
|
+
}, { immediate: !0, deep: !0 }), H(I, (a) => {
|
|
560
|
+
if (!(a != null && a.trim())) {
|
|
561
|
+
T.value = [], V.value = !1;
|
|
534
562
|
return;
|
|
535
563
|
}
|
|
536
|
-
|
|
537
|
-
keyword:
|
|
564
|
+
V.value = !0, r("search", {
|
|
565
|
+
keyword: a,
|
|
538
566
|
callback: (i) => {
|
|
539
|
-
T.value = i,
|
|
567
|
+
T.value = i, V.value = !1, i.length > 0 && (v.value = !0);
|
|
540
568
|
}
|
|
541
569
|
});
|
|
542
|
-
}), (
|
|
543
|
-
var
|
|
544
|
-
const
|
|
545
|
-
return l(),
|
|
546
|
-
|
|
547
|
-
value:
|
|
548
|
-
inputValue:
|
|
549
|
-
"onUpdate:inputValue": i[0] || (i[0] = (
|
|
550
|
-
"popup-visible":
|
|
551
|
-
"onUpdate:popupVisible": i[1] || (i[1] = (
|
|
570
|
+
}), (a, i) => {
|
|
571
|
+
var P;
|
|
572
|
+
const k = x("t-checkbox"), O = x("t-tag"), w = x("t-select-input");
|
|
573
|
+
return l(), c("div", ft, [
|
|
574
|
+
S(w, {
|
|
575
|
+
value: X.value,
|
|
576
|
+
inputValue: I.value,
|
|
577
|
+
"onUpdate:inputValue": i[0] || (i[0] = (o) => I.value = o),
|
|
578
|
+
"popup-visible": v.value,
|
|
579
|
+
"onUpdate:popupVisible": i[1] || (i[1] = (o) => v.value = o),
|
|
552
580
|
"input-props": {
|
|
553
581
|
readonly: !1,
|
|
554
582
|
disabled: !1
|
|
@@ -560,98 +588,99 @@ const Te = { class: "cd-ps-container" }, ze = {
|
|
|
560
588
|
overlayInnerStyle: { padding: "6px" },
|
|
561
589
|
closeBtn: !0
|
|
562
590
|
},
|
|
563
|
-
placeholder:
|
|
564
|
-
loading:
|
|
591
|
+
placeholder: b.placeholder,
|
|
592
|
+
loading: V.value,
|
|
565
593
|
"allow-input": "",
|
|
566
594
|
clearable: "",
|
|
567
|
-
multiple:
|
|
595
|
+
multiple: b.multiple,
|
|
568
596
|
class: "cd-input-select__select",
|
|
569
597
|
onPopupVisibleChange: de,
|
|
570
|
-
onTagChange:
|
|
598
|
+
onTagChange: se
|
|
571
599
|
}, {
|
|
572
|
-
panel:
|
|
573
|
-
T.value.length > 0 ? (l(),
|
|
574
|
-
(l(!0),
|
|
575
|
-
key:
|
|
576
|
-
value:
|
|
577
|
-
checked:
|
|
600
|
+
panel: N(() => [
|
|
601
|
+
T.value.length > 0 ? (l(), c("div", ht, [
|
|
602
|
+
(l(!0), c(G, null, te(T.value, (o) => (l(), E(k, {
|
|
603
|
+
key: o.id,
|
|
604
|
+
value: o.id,
|
|
605
|
+
checked: ae(o.id),
|
|
578
606
|
class: "cd-input-select__option",
|
|
579
|
-
onChange: (
|
|
607
|
+
onChange: (ne) => R(ne, o)
|
|
580
608
|
}, {
|
|
581
|
-
default:
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
src:
|
|
586
|
-
alt:
|
|
609
|
+
default: N(() => [
|
|
610
|
+
p("div", mt, [
|
|
611
|
+
o.avatar ? (l(), c("div", _t, [
|
|
612
|
+
p("img", {
|
|
613
|
+
src: o.avatar,
|
|
614
|
+
alt: o.name
|
|
587
615
|
}, null, 8, gt)
|
|
588
|
-
])) : (l(),
|
|
616
|
+
])) : (l(), c("div", {
|
|
589
617
|
key: 1,
|
|
590
618
|
class: "cd-input-select__option-avatar cd-input-select__option-avatar--placeholder",
|
|
591
|
-
style:
|
|
592
|
-
backgroundColor: D(
|
|
593
|
-
color: D(
|
|
619
|
+
style: Te({
|
|
620
|
+
backgroundColor: D(o.id) ? "#e6f4ff" : F(o.name),
|
|
621
|
+
color: D(o.id) ? "#0052d9" : "#fff"
|
|
594
622
|
})
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
623
|
+
}, h(j(o.name)), 5)),
|
|
624
|
+
p("div", yt, [
|
|
625
|
+
p("div", kt, h(o.name), 1),
|
|
626
|
+
o.department || o.position ? (l(), c("div", bt, h(o.department) + h(o.department && o.position ? " · " : "") + h(o.position), 1)) : _("", !0)
|
|
599
627
|
]),
|
|
600
|
-
D(
|
|
628
|
+
D(o.id) ? (l(), c("i", Ct)) : _("", !0)
|
|
601
629
|
])
|
|
602
630
|
]),
|
|
603
631
|
_: 2
|
|
604
632
|
}, 1032, ["value", "checked", "onChange"]))), 128))
|
|
605
|
-
])) :
|
|
633
|
+
])) : V.value ? (l(), c("div", Vt, " 搜索中... ")) : (l(), c("div", Ut, " 暂无搜索结果 "))
|
|
606
634
|
]),
|
|
607
|
-
tag:
|
|
608
|
-
|
|
609
|
-
|
|
635
|
+
tag: N((o) => [
|
|
636
|
+
o && o.tag ? (l(), E(O, {
|
|
637
|
+
key: 0,
|
|
638
|
+
theme: ie(typeof o.tag == "object" ? o.tag.value : o.tag),
|
|
610
639
|
variant: "light",
|
|
611
640
|
closable: !0,
|
|
612
641
|
size: "medium"
|
|
613
642
|
}, {
|
|
614
|
-
default:
|
|
615
|
-
|
|
643
|
+
default: N(() => [
|
|
644
|
+
oe(h(typeof o.tag == "object" ? o.tag.label : o.tag), 1)
|
|
616
645
|
]),
|
|
617
646
|
_: 2
|
|
618
|
-
}, 1032, ["theme"])
|
|
647
|
+
}, 1032, ["theme"])) : _("", !0)
|
|
619
648
|
]),
|
|
620
|
-
suffixIcon:
|
|
621
|
-
|
|
649
|
+
suffixIcon: N(() => [
|
|
650
|
+
p("i", {
|
|
622
651
|
class: "ri-add-circle-line cd-input-select__add-icon",
|
|
623
|
-
onClick:
|
|
652
|
+
onClick: ue
|
|
624
653
|
})
|
|
625
654
|
]),
|
|
626
655
|
_: 1
|
|
627
656
|
}, 8, ["value", "inputValue", "popup-visible", "placeholder", "loading", "multiple"]),
|
|
628
|
-
(
|
|
657
|
+
(P = b.tabs) != null && P.length && U.value ? (l(), E(ke, {
|
|
629
658
|
key: 0,
|
|
630
|
-
visible:
|
|
631
|
-
"onUpdate:visible": i[2] || (i[2] = (
|
|
659
|
+
visible: U.value,
|
|
660
|
+
"onUpdate:visible": i[2] || (i[2] = (o) => U.value = o),
|
|
632
661
|
modelValue: z.value,
|
|
633
|
-
"onUpdate:modelValue": i[3] || (i[3] = (
|
|
634
|
-
tabs:
|
|
635
|
-
organizations:
|
|
662
|
+
"onUpdate:modelValue": i[3] || (i[3] = (o) => z.value = o),
|
|
663
|
+
tabs: b.tabs,
|
|
664
|
+
organizations: b.organizations || [],
|
|
636
665
|
"show-org": !1,
|
|
637
666
|
"show-search": !0,
|
|
638
|
-
multiple:
|
|
639
|
-
onConfirm:
|
|
640
|
-
onLoadUsers:
|
|
641
|
-
onSearch:
|
|
642
|
-
onClose: i[4] || (i[4] = (
|
|
643
|
-
}, null, 8, ["visible", "modelValue", "tabs", "organizations", "multiple"])) :
|
|
667
|
+
multiple: b.multiple,
|
|
668
|
+
onConfirm: Y,
|
|
669
|
+
onLoadUsers: J,
|
|
670
|
+
onSearch: le,
|
|
671
|
+
onClose: i[4] || (i[4] = (o) => U.value = !1)
|
|
672
|
+
}, null, 8, ["visible", "modelValue", "tabs", "organizations", "multiple"])) : _("", !0)
|
|
644
673
|
]);
|
|
645
674
|
};
|
|
646
675
|
}
|
|
647
|
-
}), It = /* @__PURE__ */ ye(
|
|
648
|
-
install(
|
|
649
|
-
|
|
676
|
+
}), It = /* @__PURE__ */ ye(St, [["__scopeId", "data-v-681cee2f"]]), Nt = {
|
|
677
|
+
install(b) {
|
|
678
|
+
b.component("PersonSelector", ke), b.component("CdInputPersonSelector", It);
|
|
650
679
|
}
|
|
651
680
|
};
|
|
652
681
|
export {
|
|
653
682
|
It as CdInputPersonSelector,
|
|
654
683
|
It as InputSelect,
|
|
655
|
-
|
|
656
|
-
|
|
684
|
+
ke as PersonSelector,
|
|
685
|
+
Nt as default
|
|
657
686
|
};
|