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.js +1 -1
- package/dist/index.mjs +244 -253
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/PersonSelector.vue +156 -576
package/dist/index.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
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: "
|
|
5
|
-
},
|
|
4
|
+
class: "cd-ps-tips"
|
|
5
|
+
}, Ne = {
|
|
6
6
|
key: 1,
|
|
7
|
-
class: "search
|
|
7
|
+
class: "cd-ps-search"
|
|
8
8
|
}, Ue = {
|
|
9
9
|
key: 0,
|
|
10
|
-
class: "org-select"
|
|
11
|
-
},
|
|
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
|
-
},
|
|
13
|
+
class: "cd-ps-search-results"
|
|
14
|
+
}, Te = { class: "cd-ps-search-header" }, we = {
|
|
15
15
|
key: 0,
|
|
16
|
-
class: "
|
|
17
|
-
},
|
|
16
|
+
class: "cd-ps-loading"
|
|
17
|
+
}, De = {
|
|
18
18
|
key: 1,
|
|
19
|
-
class: "empty
|
|
19
|
+
class: "cd-ps-empty"
|
|
20
20
|
}, Re = {
|
|
21
21
|
key: 2,
|
|
22
|
-
class: "
|
|
23
|
-
}, Be = ["onClick"], Oe = { class: "
|
|
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: "
|
|
26
|
-
},
|
|
25
|
+
class: "cd-ps-count"
|
|
26
|
+
}, Fe = {
|
|
27
27
|
key: 1,
|
|
28
|
-
class: "empty
|
|
29
|
-
},
|
|
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
|
|
32
|
-
},
|
|
31
|
+
class: "cd-ps-empty"
|
|
32
|
+
}, Xe = {
|
|
33
33
|
key: 1,
|
|
34
|
-
class: "selected-
|
|
35
|
-
},
|
|
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(
|
|
48
|
-
var
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
67
|
-
e && (J.value[
|
|
62
|
+
function de(l, e) {
|
|
63
|
+
e && (J.value[l] = e);
|
|
68
64
|
}
|
|
69
|
-
function
|
|
70
|
-
for (const
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
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 =
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
|
|
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
|
|
88
|
-
const
|
|
83
|
+
for (const a of c.tabs) {
|
|
84
|
+
const v = b.value[a.key] || [], m = A(v, e);
|
|
89
85
|
if (m) {
|
|
90
|
-
|
|
91
|
-
...m,
|
|
92
|
-
typeName: i.name
|
|
93
|
-
});
|
|
86
|
+
l.push({ ...m, typeName: a.name });
|
|
94
87
|
break;
|
|
95
88
|
}
|
|
96
89
|
}
|
|
97
|
-
}),
|
|
98
|
-
}),
|
|
99
|
-
|
|
90
|
+
}), l;
|
|
91
|
+
}), ce = () => {
|
|
92
|
+
V.value = "";
|
|
100
93
|
}, ie = () => {
|
|
101
94
|
};
|
|
102
95
|
let I = null;
|
|
103
|
-
const
|
|
104
|
-
if (I && clearTimeout(I), !
|
|
105
|
-
|
|
96
|
+
const re = () => {
|
|
97
|
+
if (I && clearTimeout(I), !V.value.trim()) {
|
|
98
|
+
F();
|
|
106
99
|
return;
|
|
107
100
|
}
|
|
108
|
-
M.value = !0,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
|
128
|
-
const e = [],
|
|
129
|
-
for (const
|
|
130
|
-
e.push(
|
|
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
|
|
119
|
+
return s(l), e;
|
|
133
120
|
}
|
|
134
|
-
const
|
|
135
|
-
const e =
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
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
|
|
143
|
-
const { id:
|
|
144
|
-
return {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
155
|
-
} catch
|
|
156
|
-
console.log("展开节点失败", g);
|
|
145
|
+
a.setItem(s, { expanded: !0 });
|
|
146
|
+
} catch {
|
|
157
147
|
}
|
|
158
148
|
}
|
|
159
|
-
} else
|
|
160
|
-
|
|
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
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
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:
|
|
174
|
-
appendUsers: (
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
const
|
|
178
|
-
const { id:
|
|
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
|
-
|
|
177
|
+
a.appendTo(e, v);
|
|
187
178
|
}
|
|
188
179
|
}
|
|
189
|
-
}), (
|
|
190
|
-
const
|
|
191
|
-
return
|
|
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:
|
|
186
|
+
width: oe.value,
|
|
196
187
|
footer: !0,
|
|
197
188
|
"destroy-on-close": "",
|
|
198
|
-
onConfirm:
|
|
199
|
-
onClose:
|
|
189
|
+
onConfirm: me,
|
|
190
|
+
onClose: ke
|
|
200
191
|
}, {
|
|
201
|
-
default:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
modelValue:
|
|
211
|
-
"onUpdate:modelValue": e[0] || (e[0] = (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:
|
|
217
|
-
(
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
modelValue:
|
|
229
|
-
"onUpdate:modelValue": e[1] || (e[1] = (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:
|
|
233
|
-
onClear:
|
|
223
|
+
onInput: re,
|
|
224
|
+
onClear: F
|
|
234
225
|
}, {
|
|
235
|
-
"prefix-icon":
|
|
236
|
-
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
M.value ? (
|
|
245
|
-
|
|
246
|
-
e[6] || (e[6] =
|
|
247
|
-
|
|
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:
|
|
241
|
+
onClick: F
|
|
251
242
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
|
|
243
|
+
default: y(() => [...e[5] || (e[5] = [
|
|
244
|
+
Q("返回", -1)
|
|
254
245
|
])]),
|
|
255
246
|
_: 1
|
|
256
247
|
})
|
|
257
248
|
]),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
e[7] || (e[7] =
|
|
261
|
-
])) :
|
|
262
|
-
|
|
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] =
|
|
268
|
-
])) : (
|
|
269
|
-
(
|
|
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(["
|
|
272
|
-
onClick: (P) =>
|
|
262
|
+
class: W(["cd-ps-result-item", { "cd-ps-selected": r.value.includes(t.id) }]),
|
|
263
|
+
onClick: (P) => pe(t)
|
|
273
264
|
}, [
|
|
274
|
-
|
|
275
|
-
checked:
|
|
276
|
-
onClick: e[2] || (e[2] =
|
|
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
|
-
|
|
280
|
-
|
|
270
|
+
o("div", Oe, [
|
|
271
|
+
i(s, { name: "user" })
|
|
281
272
|
]),
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
t.position ? (
|
|
286
|
-
t.department ? (
|
|
287
|
-
t.phone ? (
|
|
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
|
-
])) : (
|
|
283
|
+
])) : (n(), x(G, {
|
|
293
284
|
key: 1,
|
|
294
|
-
modelValue:
|
|
295
|
-
"onUpdate:modelValue": e[3] || (e[3] = (t) =>
|
|
296
|
-
onChange:
|
|
285
|
+
modelValue: S.value,
|
|
286
|
+
"onUpdate:modelValue": e[3] || (e[3] = (t) => S.value = t),
|
|
287
|
+
onChange: ce
|
|
297
288
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
(
|
|
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:
|
|
295
|
+
default: y(() => {
|
|
305
296
|
var P;
|
|
306
297
|
return [
|
|
307
|
-
|
|
308
|
-
((P =
|
|
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: (
|
|
312
|
-
data:
|
|
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:
|
|
318
|
-
onChange:
|
|
308
|
+
value: r.value,
|
|
309
|
+
onChange: he
|
|
319
310
|
}, {
|
|
320
|
-
label:
|
|
321
|
-
var
|
|
311
|
+
label: y(({ node: _ }) => {
|
|
312
|
+
var se;
|
|
322
313
|
return [
|
|
323
|
-
|
|
324
|
-
class: W(["
|
|
314
|
+
o("div", {
|
|
315
|
+
class: W(["cd-ps-node", { "cd-ps-node-user": _.data.isUser }])
|
|
325
316
|
}, [
|
|
326
|
-
|
|
327
|
-
name:
|
|
317
|
+
i(s, {
|
|
318
|
+
name: _.data.isUser ? "user" : t.icon || "folder"
|
|
328
319
|
}, null, 8, ["name"]),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
!
|
|
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-
|
|
336
|
-
onClick:
|
|
326
|
+
class: "cd-ps-load-btn",
|
|
327
|
+
onClick: le((ct) => _e(_, t.key), ["stop"])
|
|
337
328
|
}, {
|
|
338
|
-
default:
|
|
339
|
-
|
|
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"])) : (
|
|
348
|
-
|
|
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] =
|
|
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
|
-
|
|
365
|
-
|
|
366
|
-
e[12] || (e[12] =
|
|
367
|
-
|
|
368
|
-
R.value.length > 0 ? (
|
|
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:
|
|
363
|
+
onClick: K
|
|
373
364
|
}, {
|
|
374
|
-
default:
|
|
375
|
-
|
|
365
|
+
default: y(() => [...e[11] || (e[11] = [
|
|
366
|
+
Q("清空", -1)
|
|
376
367
|
])]),
|
|
377
368
|
_: 1
|
|
378
369
|
})) : u("", !0)
|
|
379
370
|
]),
|
|
380
|
-
|
|
381
|
-
R.value.length === 0 ? (
|
|
382
|
-
|
|
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] =
|
|
388
|
-
])) : (
|
|
389
|
-
(
|
|
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-
|
|
382
|
+
class: W(["cd-ps-selected-item", { "cd-ps-dept-item": !t.isUser }])
|
|
392
383
|
}, [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
class: W(["
|
|
384
|
+
o("div", Ye, [
|
|
385
|
+
o("div", {
|
|
386
|
+
class: W(["cd-ps-avatar", { "cd-ps-avatar-dept": !t.isUser }])
|
|
396
387
|
}, [
|
|
397
|
-
|
|
388
|
+
i(s, {
|
|
398
389
|
name: t.isUser ? "user" : "folder"
|
|
399
390
|
}, null, 8, ["name"])
|
|
400
391
|
], 2),
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
t.isUser && t.position ? (
|
|
405
|
-
t.isUser && t.department ? (
|
|
406
|
-
t.isUser ? u("", !0) : (
|
|
407
|
-
!t.isUser && t.userCount ? (
|
|
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
|
-
|
|
402
|
+
i(h, {
|
|
412
403
|
size: "small",
|
|
413
404
|
variant: "text",
|
|
414
405
|
shape: "circle",
|
|
415
|
-
onClick: (P) =>
|
|
406
|
+
onClick: (P) => fe(t.id)
|
|
416
407
|
}, {
|
|
417
|
-
icon:
|
|
418
|
-
|
|
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
|
-
}),
|
|
434
|
-
const
|
|
435
|
-
for (const [
|
|
436
|
-
|
|
437
|
-
return
|
|
438
|
-
},
|
|
439
|
-
install(
|
|
440
|
-
|
|
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
|
-
|
|
435
|
+
dt as PersonSelector,
|
|
445
436
|
rt as default
|
|
446
437
|
};
|