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