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