cd-personselector 1.3.2 → 1.3.4

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