cd-personselector 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
- import { defineComponent as ye, ref as f, computed as z, watch as q, resolveComponent as _, createBlock as b, openBlock as a, withCtx as k, createElementVNode as n, createElementBlock as o, createCommentVNode as u, createVNode as r, toDisplayString as v, Fragment as E, renderList as L, createTextVNode as G, normalizeClass as W, withModifiers as te, nextTick as ge } from "vue";
2
- const Ce = { class: "person-selector" }, be = {
1
+ import { defineComponent as ge, ref as k, computed as w, watch as H, resolveComponent as f, createBlock as x, openBlock as n, withCtx as y, createElementVNode as o, createElementBlock as d, createCommentVNode as u, createVNode as i, toDisplayString as p, Fragment as E, renderList as L, createTextVNode as Q, normalizeClass as W, withModifiers as le, nextTick as Ce } from "vue";
2
+ const be = { class: "cd-ps-container" }, xe = {
3
3
  key: 0,
4
- class: "selector-tips"
5
- }, xe = {
4
+ class: "cd-ps-tips"
5
+ }, Ne = {
6
6
  key: 1,
7
- class: "search-area"
7
+ class: "cd-ps-search"
8
8
  }, Ue = {
9
9
  key: 0,
10
- class: "org-select"
11
- }, Ne = { class: "search-input" }, Se = { class: "content-area" }, Ve = { class: "left-panel tree-panel" }, Ie = {
10
+ class: "cd-ps-org-select"
11
+ }, Se = { class: "cd-ps-search-input" }, Ve = { class: "cd-ps-content" }, ze = { class: "cd-ps-left" }, Ie = {
12
12
  key: 0,
13
- class: "search-results"
14
- }, ze = { class: "search-results-header" }, Te = {
13
+ class: "cd-ps-search-results"
14
+ }, Te = { class: "cd-ps-search-header" }, we = {
15
15
  key: 0,
16
- class: "search-loading"
17
- }, we = {
16
+ class: "cd-ps-loading"
17
+ }, De = {
18
18
  key: 1,
19
- class: "empty-search"
19
+ class: "cd-ps-empty"
20
20
  }, Re = {
21
21
  key: 2,
22
- class: "search-result-list"
23
- }, Be = ["onClick"], Oe = { class: "user-avatar" }, De = { class: "user-details" }, Pe = { class: "user-name" }, Ee = { class: "user-meta" }, Le = { key: 0 }, We = { key: 1 }, $e = { key: 2 }, Je = { class: "tree-container" }, Me = {
22
+ class: "cd-ps-result-list"
23
+ }, Be = ["onClick"], Oe = { class: "cd-ps-avatar" }, Pe = { class: "cd-ps-info" }, Ee = { class: "cd-ps-name" }, Le = { class: "cd-ps-meta" }, We = { key: 0 }, $e = { key: 1 }, Je = { key: 2 }, Me = { class: "cd-ps-tree" }, Ae = {
24
24
  key: 0,
25
- class: "user-count"
26
- }, Ae = {
25
+ class: "cd-ps-count"
26
+ }, Fe = {
27
27
  key: 1,
28
- class: "empty-tree"
29
- }, Fe = { class: "right-panel" }, je = { class: "selected-header" }, qe = { class: "header-count" }, Ge = { class: "selected-list-container" }, He = {
28
+ class: "cd-ps-empty"
29
+ }, je = { class: "cd-ps-right" }, qe = { class: "cd-ps-right-header" }, Ge = { class: "cd-ps-num" }, He = { class: "cd-ps-right-list" }, Qe = {
30
30
  key: 0,
31
- class: "empty-selected"
32
- }, Ke = {
31
+ class: "cd-ps-empty"
32
+ }, Xe = {
33
33
  key: 1,
34
- class: "selected-user-list"
35
- }, Qe = { class: "user-info" }, Xe = { class: "user-details" }, Ye = { class: "user-name" }, Ze = { class: "user-meta" }, et = { key: 0 }, tt = { key: 1 }, st = { key: 2 }, lt = { key: 3 }, at = /* @__PURE__ */ ye({
34
+ class: "cd-ps-selected-list"
35
+ }, Ye = { class: "cd-ps-item-info" }, Ze = { class: "cd-ps-info" }, Ke = { class: "cd-ps-name" }, et = { class: "cd-ps-meta" }, tt = { key: 0 }, st = { key: 1 }, lt = { key: 2 }, nt = { key: 3 }, at = /* @__PURE__ */ ge({
36
36
  __name: "PersonSelector",
37
37
  props: {
38
38
  visible: { type: Boolean, default: !1 },
@@ -44,177 +44,168 @@ const Ce = { class: "person-selector" }, be = {
44
44
  showSearch: { type: Boolean, default: !0 }
45
45
  },
46
46
  emits: ["update:visible", "update:modelValue", "confirm", "load-users", "search"],
47
- setup(x, { expose: $, emit: O }) {
48
- var Y, Z;
49
- const d = x, C = O, U = f(d.visible), N = f(((Z = (Y = d.tabs) == null ? void 0 : Y[0]) == null ? void 0 : Z.key) || ""), T = f(null), S = f(""), c = f([]), J = f({}), M = f(!1), D = f(!1), V = f([]), se = z(() => d.tabs || []), H = z(() => d.organizations || []), K = z(() => d.tips || ""), le = z(() => d.showSearch), ae = z(() => d.dialogWidth), w = f({});
50
- q(
51
- () => d.tabs,
52
- (s) => {
53
- if (s && s.length > 0) {
54
- const e = {};
55
- s.forEach((l) => {
56
- e[l.key] = JSON.parse(JSON.stringify(l.tree));
57
- }), w.value = e, (!N.value || !s.find((l) => l.key === N.value)) && (N.value = s[0].key);
58
- }
59
- },
60
- { immediate: !0, deep: !0 }
61
- ), q(() => d.visible, (s) => {
62
- U.value = s, s && (c.value = d.modelValue ? [...d.modelValue] : [], d.organizations.length > 0 && !T.value && (T.value = d.organizations[0].id));
63
- }), q(U, (s) => {
64
- C("update:visible", s);
47
+ setup(N, { expose: $, emit: B }) {
48
+ var ee, te;
49
+ const c = N, C = B, U = k(c.visible), S = k(((te = (ee = c.tabs) == null ? void 0 : ee[0]) == null ? void 0 : te.key) || ""), D = k(null), V = k(""), r = k([]), J = k({}), M = k(!1), O = k(!1), z = k([]), ne = w(() => c.tabs || []), X = w(() => c.organizations || []), Y = w(() => c.tips || ""), ae = w(() => c.showSearch), oe = w(() => c.dialogWidth), b = k({});
50
+ H(() => c.tabs, (l) => {
51
+ if (l && l.length > 0) {
52
+ const e = {};
53
+ l.forEach((s) => {
54
+ e[s.key] = JSON.parse(JSON.stringify(s.tree));
55
+ }), b.value = e, (!S.value || !l.find((s) => s.key === S.value)) && (S.value = l[0].key);
56
+ }
57
+ }, { immediate: !0, deep: !0 }), H(() => c.visible, (l) => {
58
+ U.value = l, l && (r.value = c.modelValue ? [...c.modelValue] : [], c.organizations.length > 0 && !D.value && (D.value = c.organizations[0].id));
59
+ }), H(U, (l) => {
60
+ C("update:visible", l);
65
61
  });
66
- function ne(s, e) {
67
- e && (J.value[s] = e);
62
+ function de(l, e) {
63
+ e && (J.value[l] = e);
68
64
  }
69
- function Q(s, e) {
70
- for (const l of s) {
71
- if (l.id === e) return l;
72
- if (l.children) {
73
- const i = Q(l.children, e);
74
- if (i) return i;
65
+ function A(l, e) {
66
+ for (const s of l) {
67
+ if (s.id === e) return s;
68
+ if (s.children) {
69
+ const a = A(s.children, e);
70
+ if (a) return a;
75
71
  }
76
72
  }
77
73
  return null;
78
74
  }
79
- const R = z(() => {
80
- const s = [];
81
- return c.value.forEach((e) => {
82
- const l = V.value.find((i) => i.id === e);
83
- if (l) {
84
- s.push({ ...l, typeName: "搜索结果" });
75
+ const R = w(() => {
76
+ const l = [];
77
+ return r.value.forEach((e) => {
78
+ const s = z.value.find((a) => a.id === e);
79
+ if (s) {
80
+ l.push({ ...s, typeName: "搜索结果" });
85
81
  return;
86
82
  }
87
- for (const i of d.tabs) {
88
- const p = w.value[i.key] || [], m = Q(p, e);
83
+ for (const a of c.tabs) {
84
+ const v = b.value[a.key] || [], m = A(v, e);
89
85
  if (m) {
90
- s.push({
91
- ...m,
92
- typeName: i.name
93
- });
86
+ l.push({ ...m, typeName: a.name });
94
87
  break;
95
88
  }
96
89
  }
97
- }), s;
98
- }), oe = () => {
99
- S.value = "";
90
+ }), l;
91
+ }), ce = () => {
92
+ V.value = "";
100
93
  }, ie = () => {
101
94
  };
102
95
  let I = null;
103
- const de = () => {
104
- if (I && clearTimeout(I), !S.value.trim()) {
105
- A();
96
+ const re = () => {
97
+ if (I && clearTimeout(I), !V.value.trim()) {
98
+ F();
106
99
  return;
107
100
  }
108
- M.value = !0, D.value = !0, I = setTimeout(() => {
109
- re();
110
- }, 300);
111
- }, re = () => {
112
- V.value = [];
113
- const s = (e) => {
114
- V.value = e.map((l) => ({ ...l, isUser: !0 })), D.value = !1;
101
+ M.value = !0, O.value = !0, I = setTimeout(() => ue(), 300);
102
+ }, ue = () => {
103
+ z.value = [];
104
+ const l = (e) => {
105
+ z.value = e.map((s) => ({ ...s, isUser: !0 })), O.value = !1;
115
106
  };
116
- C("search", {
117
- keyword: S.value,
118
- orgId: T.value || void 0,
119
- callback: s
120
- });
121
- }, A = () => {
122
- I && (clearTimeout(I), I = null), M.value = !1, S.value = "", V.value = [], D.value = !1;
123
- }, ce = (s) => {
124
- const e = c.value.indexOf(s.id);
125
- e > -1 ? c.value.splice(e, 1) : c.value.push(s.id);
107
+ C("search", { keyword: V.value, orgId: D.value || void 0, callback: l });
108
+ }, F = () => {
109
+ I && (clearTimeout(I), I = null), M.value = !1, V.value = "", z.value = [], O.value = !1;
110
+ }, pe = (l) => {
111
+ const e = r.value.indexOf(l.id);
112
+ e > -1 ? r.value.splice(e, 1) : r.value.push(l.id);
126
113
  };
127
- function ue(s) {
128
- const e = [], l = (i) => {
129
- for (const p of i)
130
- e.push(p.id), p.children && l(p.children);
114
+ function ve(l) {
115
+ const e = [], s = (a) => {
116
+ for (const v of a)
117
+ e.push(v.id), v.children && s(v.children);
131
118
  };
132
- return l(s), e;
119
+ return s(l), e;
133
120
  }
134
- const ve = (s) => {
135
- const e = w.value[N.value] || [], l = ue(e), i = c.value.filter((p) => !l.includes(p));
136
- c.value = [...i, ...s];
121
+ const he = (l) => {
122
+ const e = b.value[S.value] || [], s = ve(e), a = r.value.filter((v) => !s.includes(v));
123
+ r.value = [...a, ...l];
137
124
  };
138
- async function pe(s, e) {
139
- const l = s.value, i = J.value[e];
140
- C("load-users", { tabKey: e, nodeId: l, node: s, callback: async (m) => {
125
+ function Z(l, e, s) {
126
+ for (const a of l) {
127
+ if (a.id === e)
128
+ return a.children = a.children || [], a.children.push(...s), a.loaded = !0, !0;
129
+ if (a.children && Z(a.children, e, s))
130
+ return !0;
131
+ }
132
+ return !1;
133
+ }
134
+ async function _e(l, e) {
135
+ const s = l.value, a = J.value[e];
136
+ C("load-users", { tabKey: e, nodeId: s, node: l, callback: async (m) => {
141
137
  if (m.length > 0) {
142
- const y = m.map((g) => {
143
- const { id: B, name: F, ...j } = g;
144
- return {
145
- ...j,
146
- id: B,
147
- name: g.displayName || F,
148
- isUser: !0
149
- };
150
- });
151
- if (i) {
152
- i.appendTo(l, y), s.data.loaded = !0, await ge();
138
+ const h = m.map((T) => {
139
+ const { id: j, name: q, ...G } = T;
140
+ return { ...G, id: j, name: T.displayName || q, isUser: !0 };
141
+ }), g = b.value[e];
142
+ if (g && Z(g, s, h), a) {
143
+ a.appendTo(s, h), l.data.loaded = !0, await Ce();
153
144
  try {
154
- i.setItem(l, { expanded: !0 });
155
- } catch (g) {
156
- console.log("展开节点失败", g);
145
+ a.setItem(s, { expanded: !0 });
146
+ } catch {
157
147
  }
158
148
  }
159
- } else
160
- s.data.loaded = !0;
149
+ } else {
150
+ l.data.loaded = !0;
151
+ const h = b.value[e];
152
+ if (h) {
153
+ const g = A(h, s);
154
+ g && (g.loaded = !0);
155
+ }
156
+ }
161
157
  } });
162
158
  }
163
- const he = (s) => {
164
- c.value = c.value.filter((e) => e !== s);
165
- }, X = () => {
166
- c.value = [];
167
- }, _e = () => {
168
- C("update:modelValue", c.value), C("confirm", R.value), U.value = !1;
159
+ const fe = (l) => {
160
+ r.value = r.value.filter((e) => e !== l);
161
+ }, K = () => {
162
+ r.value = [];
169
163
  }, me = () => {
164
+ C("update:modelValue", r.value), C("confirm", R.value), U.value = !1;
165
+ }, ke = () => {
170
166
  U.value = !1;
171
167
  };
172
168
  return $({
173
- clearSelection: X,
174
- appendUsers: (s, e, l) => {
175
- const i = J.value[s];
176
- if (i && l.length > 0) {
177
- const p = l.map((m) => {
178
- const { id: y, name: g, ...B } = m;
179
- return {
180
- ...B,
181
- id: y,
182
- name: m.displayName || g,
183
- isUser: !0
184
- };
169
+ clearSelection: K,
170
+ appendUsers: (l, e, s) => {
171
+ const a = J.value[l];
172
+ if (a && s.length > 0) {
173
+ const v = s.map((m) => {
174
+ const { id: h, name: g, ...T } = m;
175
+ return { ...T, id: h, name: m.displayName || g, isUser: !0 };
185
176
  });
186
- i.appendTo(e, p);
177
+ a.appendTo(e, v);
187
178
  }
188
179
  }
189
- }), (s, e) => {
190
- const l = _("t-icon"), i = _("t-option"), p = _("t-select"), m = _("t-input"), y = _("t-button"), g = _("t-loading"), B = _("t-checkbox"), F = _("t-tree"), j = _("t-tab-panel"), fe = _("t-tabs"), ke = _("t-dialog");
191
- return a(), b(ke, {
180
+ }), (l, e) => {
181
+ const s = f("t-icon"), a = f("t-option"), v = f("t-select"), m = f("t-input"), h = f("t-button"), g = f("t-loading"), T = f("t-checkbox"), j = f("t-tree"), q = f("t-tab-panel"), G = f("t-tabs"), ye = f("t-dialog");
182
+ return n(), x(ye, {
192
183
  visible: U.value,
193
184
  "onUpdate:visible": e[4] || (e[4] = (t) => U.value = t),
194
185
  header: "选择人员",
195
- width: ae.value,
186
+ width: oe.value,
196
187
  footer: !0,
197
188
  "destroy-on-close": "",
198
- onConfirm: _e,
199
- onClose: me
189
+ onConfirm: me,
190
+ onClose: ke
200
191
  }, {
201
- default: k(() => [
202
- n("div", Ce, [
203
- K.value ? (a(), o("div", be, [
204
- r(l, { name: "info-circle" }),
205
- n("span", null, v(K.value), 1)
192
+ default: y(() => [
193
+ o("div", be, [
194
+ Y.value ? (n(), d("div", xe, [
195
+ i(s, { name: "info-circle" }),
196
+ o("span", null, p(Y.value), 1)
206
197
  ])) : u("", !0),
207
- le.value ? (a(), o("div", xe, [
208
- H.value.length > 0 ? (a(), o("div", Ue, [
209
- r(p, {
210
- modelValue: T.value,
211
- "onUpdate:modelValue": e[0] || (e[0] = (t) => T.value = t),
198
+ ae.value ? (n(), d("div", Ne, [
199
+ X.value.length > 0 ? (n(), d("div", Ue, [
200
+ i(v, {
201
+ modelValue: D.value,
202
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => D.value = t),
212
203
  placeholder: "选择组织",
213
204
  style: { width: "200px" },
214
205
  onChange: ie
215
206
  }, {
216
- default: k(() => [
217
- (a(!0), o(E, null, L(H.value, (t) => (a(), b(i, {
207
+ default: y(() => [
208
+ (n(!0), d(E, null, L(X.value, (t) => (n(), x(a, {
218
209
  key: t.id,
219
210
  value: t.id,
220
211
  label: t.displayName || t.name
@@ -223,120 +214,120 @@ const Ce = { class: "person-selector" }, be = {
223
214
  _: 1
224
215
  }, 8, ["modelValue"])
225
216
  ])) : u("", !0),
226
- n("div", Ne, [
227
- r(m, {
228
- modelValue: S.value,
229
- "onUpdate:modelValue": e[1] || (e[1] = (t) => S.value = t),
217
+ o("div", Se, [
218
+ i(m, {
219
+ modelValue: V.value,
220
+ "onUpdate:modelValue": e[1] || (e[1] = (t) => V.value = t),
230
221
  placeholder: "搜索",
231
222
  clearable: "",
232
- onInput: de,
233
- onClear: A
223
+ onInput: re,
224
+ onClear: F
234
225
  }, {
235
- "prefix-icon": k(() => [
236
- r(l, { name: "search" })
226
+ "prefix-icon": y(() => [
227
+ i(s, { name: "search" })
237
228
  ]),
238
229
  _: 1
239
230
  }, 8, ["modelValue"])
240
231
  ])
241
232
  ])) : u("", !0),
242
- n("div", Se, [
243
- n("div", Ve, [
244
- M.value ? (a(), o("div", Ie, [
245
- n("div", ze, [
246
- e[6] || (e[6] = n("span", null, "搜索结果", -1)),
247
- r(y, {
233
+ o("div", Ve, [
234
+ o("div", ze, [
235
+ M.value ? (n(), d("div", Ie, [
236
+ o("div", Te, [
237
+ e[6] || (e[6] = o("span", null, "搜索结果", -1)),
238
+ i(h, {
248
239
  size: "small",
249
240
  variant: "text",
250
- onClick: A
241
+ onClick: F
251
242
  }, {
252
- default: k(() => [...e[5] || (e[5] = [
253
- G("返回", -1)
243
+ default: y(() => [...e[5] || (e[5] = [
244
+ Q("返回", -1)
254
245
  ])]),
255
246
  _: 1
256
247
  })
257
248
  ]),
258
- D.value ? (a(), o("div", Te, [
259
- r(g),
260
- e[7] || (e[7] = n("span", null, "搜索中...", -1))
261
- ])) : V.value.length === 0 ? (a(), o("div", we, [
262
- r(l, {
249
+ O.value ? (n(), d("div", we, [
250
+ i(g),
251
+ e[7] || (e[7] = o("span", null, "搜索中...", -1))
252
+ ])) : z.value.length === 0 ? (n(), d("div", De, [
253
+ i(s, {
263
254
  name: "search",
264
255
  size: "48px",
265
256
  style: { color: "#ddd" }
266
257
  }),
267
- e[8] || (e[8] = n("p", null, "未找到匹配的人员", -1))
268
- ])) : (a(), o("div", Re, [
269
- (a(!0), o(E, null, L(V.value, (t) => (a(), o("div", {
258
+ e[8] || (e[8] = o("p", null, "未找到匹配的人员", -1))
259
+ ])) : (n(), d("div", Re, [
260
+ (n(!0), d(E, null, L(z.value, (t) => (n(), d("div", {
270
261
  key: t.id,
271
- class: W(["search-result-item", { "is-selected": c.value.includes(t.id) }]),
272
- onClick: (P) => ce(t)
262
+ class: W(["cd-ps-result-item", { "cd-ps-selected": r.value.includes(t.id) }]),
263
+ onClick: (P) => pe(t)
273
264
  }, [
274
- r(B, {
275
- checked: c.value.includes(t.id),
276
- onClick: e[2] || (e[2] = te(() => {
265
+ i(T, {
266
+ checked: r.value.includes(t.id),
267
+ onClick: e[2] || (e[2] = le(() => {
277
268
  }, ["stop"]))
278
269
  }, null, 8, ["checked"]),
279
- n("div", Oe, [
280
- r(l, { name: "user" })
270
+ o("div", Oe, [
271
+ i(s, { name: "user" })
281
272
  ]),
282
- n("div", De, [
283
- n("div", Pe, v(t.displayName || t.name), 1),
284
- n("div", Ee, [
285
- t.position ? (a(), o("span", Le, v(t.position), 1)) : u("", !0),
286
- t.department ? (a(), o("span", We, v(t.department), 1)) : u("", !0),
287
- t.phone ? (a(), o("span", $e, v(t.phone), 1)) : u("", !0)
273
+ o("div", Pe, [
274
+ o("div", Ee, p(t.displayName || t.name), 1),
275
+ o("div", Le, [
276
+ t.position ? (n(), d("span", We, p(t.position), 1)) : u("", !0),
277
+ t.department ? (n(), d("span", $e, p(t.department), 1)) : u("", !0),
278
+ t.phone ? (n(), d("span", Je, p(t.phone), 1)) : u("", !0)
288
279
  ])
289
280
  ])
290
281
  ], 10, Be))), 128))
291
282
  ]))
292
- ])) : (a(), b(fe, {
283
+ ])) : (n(), x(G, {
293
284
  key: 1,
294
- modelValue: N.value,
295
- "onUpdate:modelValue": e[3] || (e[3] = (t) => N.value = t),
296
- onChange: oe
285
+ modelValue: S.value,
286
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => S.value = t),
287
+ onChange: ce
297
288
  }, {
298
- default: k(() => [
299
- (a(!0), o(E, null, L(se.value, (t) => (a(), b(j, {
289
+ default: y(() => [
290
+ (n(!0), d(E, null, L(ne.value, (t) => (n(), x(q, {
300
291
  key: t.key,
301
292
  value: t.key,
302
293
  label: t.name
303
294
  }, {
304
- default: k(() => {
295
+ default: y(() => {
305
296
  var P;
306
297
  return [
307
- n("div", Je, [
308
- ((P = w.value[t.key]) == null ? void 0 : P.length) > 0 ? (a(), b(F, {
298
+ o("div", Me, [
299
+ ((P = b.value[t.key]) == null ? void 0 : P.length) > 0 ? (n(), x(j, {
309
300
  key: 0,
310
301
  ref_for: !0,
311
- ref: (h) => ne(t.key, h),
312
- data: w.value[t.key],
302
+ ref: (_) => de(t.key, _),
303
+ data: b.value[t.key],
313
304
  keys: { value: "id", label: "name", children: "children" },
314
305
  hover: "",
315
306
  checkable: "",
316
307
  "expand-all": !1,
317
- value: c.value,
318
- onChange: ve
308
+ value: r.value,
309
+ onChange: he
319
310
  }, {
320
- label: k(({ node: h }) => {
321
- var ee;
311
+ label: y(({ node: _ }) => {
312
+ var se;
322
313
  return [
323
- n("div", {
324
- class: W(["tree-node-label", { "is-user": h.data.isUser }])
314
+ o("div", {
315
+ class: W(["cd-ps-node", { "cd-ps-node-user": _.data.isUser }])
325
316
  }, [
326
- r(l, {
327
- name: h.data.isUser ? "user" : t.icon || "folder"
317
+ i(s, {
318
+ name: _.data.isUser ? "user" : t.icon || "folder"
328
319
  }, null, 8, ["name"]),
329
- n("span", null, v(h.label), 1),
330
- h.data.userCount && !h.data.isUser ? (a(), o("span", Me, "(" + v(h.data.userCount) + ")", 1)) : u("", !0),
331
- !h.data.isUser && !((ee = h.data.children) != null && ee.length) && !h.data.loaded ? (a(), b(y, {
320
+ o("span", null, p(_.label), 1),
321
+ _.data.userCount && !_.data.isUser ? (n(), d("span", Ae, "(" + p(_.data.userCount) + ")", 1)) : u("", !0),
322
+ !_.data.isUser && !((se = _.data.children) != null && se.length) && !_.data.loaded ? (n(), x(h, {
332
323
  key: 1,
333
324
  size: "small",
334
325
  variant: "text",
335
- class: "load-users-btn",
336
- onClick: te((it) => pe(h, t.key), ["stop"])
326
+ class: "cd-ps-load-btn",
327
+ onClick: le((ct) => _e(_, t.key), ["stop"])
337
328
  }, {
338
- default: k(() => [...e[9] || (e[9] = [
339
- G(" 显示人员 ", -1)
329
+ default: y(() => [...e[9] || (e[9] = [
330
+ Q("显示人员", -1)
340
331
  ])]),
341
332
  _: 1
342
333
  }, 8, ["onClick"])) : u("", !0)
@@ -344,13 +335,13 @@ const Ce = { class: "person-selector" }, be = {
344
335
  ];
345
336
  }),
346
337
  _: 2
347
- }, 1032, ["data", "value"])) : (a(), o("div", Ae, [
348
- r(l, {
338
+ }, 1032, ["data", "value"])) : (n(), d("div", Fe, [
339
+ i(s, {
349
340
  name: t.icon || "folder-open",
350
341
  size: "48px",
351
342
  style: { color: "#ddd" }
352
343
  }, null, 8, ["name"]),
353
- e[10] || (e[10] = n("p", null, "暂无数据", -1))
344
+ e[10] || (e[10] = o("p", null, "暂无数据", -1))
354
345
  ]))
355
346
  ])
356
347
  ];
@@ -361,61 +352,61 @@ const Ce = { class: "person-selector" }, be = {
361
352
  _: 1
362
353
  }, 8, ["modelValue"]))
363
354
  ]),
364
- n("div", Fe, [
365
- n("div", je, [
366
- e[12] || (e[12] = n("span", { class: "header-title" }, "已选择", -1)),
367
- n("span", qe, v(R.value.length) + " 项", 1),
368
- R.value.length > 0 ? (a(), b(y, {
355
+ o("div", je, [
356
+ o("div", qe, [
357
+ e[12] || (e[12] = o("span", { class: "cd-ps-title" }, "已选择", -1)),
358
+ o("span", Ge, p(R.value.length) + " 项", 1),
359
+ R.value.length > 0 ? (n(), x(h, {
369
360
  key: 0,
370
361
  size: "small",
371
362
  variant: "text",
372
- onClick: X
363
+ onClick: K
373
364
  }, {
374
- default: k(() => [...e[11] || (e[11] = [
375
- G("清空", -1)
365
+ default: y(() => [...e[11] || (e[11] = [
366
+ Q("清空", -1)
376
367
  ])]),
377
368
  _: 1
378
369
  })) : u("", !0)
379
370
  ]),
380
- n("div", Ge, [
381
- R.value.length === 0 ? (a(), o("div", He, [
382
- r(l, {
371
+ o("div", He, [
372
+ R.value.length === 0 ? (n(), d("div", Qe, [
373
+ i(s, {
383
374
  name: "user-checked",
384
375
  size: "64px",
385
376
  style: { color: "#ddd" }
386
377
  }),
387
- e[13] || (e[13] = n("p", null, "暂无选择", -1))
388
- ])) : (a(), o("div", Ke, [
389
- (a(!0), o(E, null, L(R.value, (t) => (a(), o("div", {
378
+ e[13] || (e[13] = o("p", null, "暂无选择", -1))
379
+ ])) : (n(), d("div", Xe, [
380
+ (n(!0), d(E, null, L(R.value, (t) => (n(), d("div", {
390
381
  key: t.id,
391
- class: W(["selected-user-item", { "selected-dept-item": !t.isUser }])
382
+ class: W(["cd-ps-selected-item", { "cd-ps-dept-item": !t.isUser }])
392
383
  }, [
393
- n("div", Qe, [
394
- n("div", {
395
- class: W(["user-avatar", { "dept-avatar": !t.isUser }])
384
+ o("div", Ye, [
385
+ o("div", {
386
+ class: W(["cd-ps-avatar", { "cd-ps-avatar-dept": !t.isUser }])
396
387
  }, [
397
- r(l, {
388
+ i(s, {
398
389
  name: t.isUser ? "user" : "folder"
399
390
  }, null, 8, ["name"])
400
391
  ], 2),
401
- n("div", Xe, [
402
- n("div", Ye, v(t.displayName || t.name), 1),
403
- n("div", Ze, [
404
- t.isUser && t.position ? (a(), o("span", et, v(t.position), 1)) : u("", !0),
405
- t.isUser && t.department ? (a(), o("span", tt, v(t.department), 1)) : u("", !0),
406
- t.isUser ? u("", !0) : (a(), o("span", st, v(t.typeName || "部门"), 1)),
407
- !t.isUser && t.userCount ? (a(), o("span", lt, v(t.userCount) + "人", 1)) : u("", !0)
392
+ o("div", Ze, [
393
+ o("div", Ke, p(t.displayName || t.name), 1),
394
+ o("div", et, [
395
+ t.isUser && t.position ? (n(), d("span", tt, p(t.position), 1)) : u("", !0),
396
+ t.isUser && t.department ? (n(), d("span", st, p(t.department), 1)) : u("", !0),
397
+ t.isUser ? u("", !0) : (n(), d("span", lt, p(t.typeName || "部门"), 1)),
398
+ !t.isUser && t.userCount ? (n(), d("span", nt, p(t.userCount) + "人", 1)) : u("", !0)
408
399
  ])
409
400
  ])
410
401
  ]),
411
- r(y, {
402
+ i(h, {
412
403
  size: "small",
413
404
  variant: "text",
414
405
  shape: "circle",
415
- onClick: (P) => he(t.id)
406
+ onClick: (P) => fe(t.id)
416
407
  }, {
417
- icon: k(() => [
418
- r(l, { name: "close" })
408
+ icon: y(() => [
409
+ i(s, { name: "close" })
419
410
  ]),
420
411
  _: 1
421
412
  }, 8, ["onClick"])
@@ -430,17 +421,17 @@ const Ce = { class: "person-selector" }, be = {
430
421
  }, 8, ["visible", "width"]);
431
422
  };
432
423
  }
433
- }), nt = (x, $) => {
434
- const O = x.__vccOpts || x;
435
- for (const [d, C] of $)
436
- O[d] = C;
437
- return O;
438
- }, ot = /* @__PURE__ */ nt(at, [["__scopeId", "data-v-210902ae"]]), rt = {
439
- install(x) {
440
- x.component("PersonSelector", ot);
424
+ }), ot = (N, $) => {
425
+ const B = N.__vccOpts || N;
426
+ for (const [c, C] of $)
427
+ B[c] = C;
428
+ return B;
429
+ }, dt = /* @__PURE__ */ ot(at, [["__scopeId", "data-v-70933f0f"]]), rt = {
430
+ install(N) {
431
+ N.component("PersonSelector", dt);
441
432
  }
442
433
  };
443
434
  export {
444
- ot as PersonSelector,
435
+ dt as PersonSelector,
445
436
  rt as default
446
437
  };