cd-personselector 1.3.4 → 1.3.6

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