@mingminghahayu/profession-select-dialog-vue3 1.0.2 → 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.
@@ -1,11 +1,11 @@
1
- import { defineComponent as x, openBlock as _, createElementBlock as B, createElementVNode as u, computed as L, ref as w, watch as K, resolveComponent as b, resolveDirective as Q, createBlock as j, withCtx as m, createVNode as c, createTextVNode as I, unref as T, withDirectives as W, toDisplayString as X, createCommentVNode as Y, nextTick as P } from "vue";
2
- import { ElMessageBox as Z, ElMessage as V } from "element-plus";
1
+ import { defineComponent as P, openBlock as _, createElementBlock as A, createElementVNode as u, computed as V, ref as w, watch as G, resolveComponent as b, resolveDirective as J, createBlock as j, withCtx as m, createVNode as c, createTextVNode as I, unref as E, withDirectives as K, toDisplayString as Q, createCommentVNode as W, nextTick as L } from "vue";
2
+ import { ElMessageBox as X, ElMessage as T } from "element-plus";
3
3
  /*! Element Plus Icons Vue v2.3.2 */
4
- var ee = /* @__PURE__ */ x({
4
+ var Y = /* @__PURE__ */ P({
5
5
  name: "Check",
6
6
  __name: "check",
7
7
  setup(p) {
8
- return (v, i) => (_(), B("svg", {
8
+ return (g, l) => (_(), A("svg", {
9
9
  xmlns: "http://www.w3.org/2000/svg",
10
10
  viewBox: "0 0 1024 1024"
11
11
  }, [
@@ -15,11 +15,11 @@ var ee = /* @__PURE__ */ x({
15
15
  })
16
16
  ]));
17
17
  }
18
- }), te = ee, se = /* @__PURE__ */ x({
18
+ }), Z = Y, ee = /* @__PURE__ */ P({
19
19
  name: "Delete",
20
20
  __name: "delete",
21
21
  setup(p) {
22
- return (v, i) => (_(), B("svg", {
22
+ return (g, l) => (_(), A("svg", {
23
23
  xmlns: "http://www.w3.org/2000/svg",
24
24
  viewBox: "0 0 1024 1024"
25
25
  }, [
@@ -29,13 +29,13 @@ var ee = /* @__PURE__ */ x({
29
29
  })
30
30
  ]));
31
31
  }
32
- }), A = se;
33
- const ae = (p, v) => {
34
- const i = p.__vccOpts || p;
35
- for (const [h, S] of v)
36
- i[h] = S;
37
- return i;
38
- }, oe = { class: "dialog-body" }, ne = { class: "left-panel" }, le = { class: "select-all-btn-wrap" }, ie = { class: "right-panel" }, re = { class: "selected-header" }, de = {
32
+ }), te = ee;
33
+ const se = (p, g) => {
34
+ const l = p.__vccOpts || p;
35
+ for (const [v, y] of g)
36
+ l[v] = y;
37
+ return l;
38
+ }, ae = { class: "dialog-body" }, oe = { class: "left-panel" }, le = { class: "select-all-btn-wrap" }, ne = { class: "right-panel" }, ie = { class: "selected-header" }, re = {
39
39
  __name: "ProfessionSelectDialog",
40
40
  props: {
41
41
  modelValue: { type: Boolean, default: !1 },
@@ -47,55 +47,55 @@ const ae = (p, v) => {
47
47
  disabledItems: { type: Array, default: () => [] }
48
48
  },
49
49
  emits: ["update:modelValue", "confirm"],
50
- setup(p, { emit: v }) {
51
- const i = p, h = v, S = L({
52
- get: () => i.modelValue,
53
- set: (s) => h("update:modelValue", s)
54
- }), y = w(!1), f = w([]), l = w([]), g = w(), D = L(() => i.multiple ? i.multipleLimit > 0 && l.value.length > i.multipleLimit ? !1 : l.value.length > 0 : l.value.length === 1);
50
+ setup(p, { emit: g }) {
51
+ const l = p, v = g, y = V({
52
+ get: () => l.modelValue,
53
+ set: (s) => v("update:modelValue", s)
54
+ }), N = w(!1), f = w([]), n = w([]), h = w(), x = V(() => l.multiple ? l.multipleLimit > 0 && n.value.length > l.multipleLimit ? !1 : n.value.length > 0 : n.value.length === 1);
55
55
  function k(s) {
56
- return l.value.some((e) => String(e.professionId) === String(s));
56
+ return n.value.some((e) => String(e.professionId) === String(s));
57
57
  }
58
- function z(s) {
59
- return i.disabledItems.some((e) => String(e.id) === String(s));
58
+ function B(s) {
59
+ return l.disabledItems.some((e) => String(e.id) === String(s));
60
60
  }
61
- function $(s) {
62
- const e = s.users || s.userList || s.members || s.children || [], o = (Array.isArray(e) ? e : []).map((t) => {
63
- var n, r;
61
+ function D(s) {
62
+ const e = s.users || s.userList || s.members || s.children || [], a = (Array.isArray(e) ? e : []).map((t) => {
63
+ var o, r;
64
64
  return {
65
- id: (r = (n = t.id) != null ? n : t.userId) != null ? r : t.value,
65
+ id: (r = (o = t.id) != null ? o : t.userId) != null ? r : t.value,
66
66
  userName: t.userName || t.username || "-",
67
67
  nickName: t.nickName || t.name || t.label || "-",
68
68
  userType: t.userType || "",
69
69
  majorCode: t.majorCode || ""
70
70
  };
71
- }), a = o.map((t) => t.nickName).filter(Boolean).join("\u3001");
71
+ }), i = a.map((t) => t.nickName).filter(Boolean).join("\u3001");
72
72
  return {
73
73
  id: s.id,
74
74
  profession: s.profession || s.departmentName || s.name || "-",
75
75
  majorName: s.majorName || s.profession || s.name || "-",
76
76
  majorCode: s.majorCode || "",
77
- users: o,
78
- userNames: a
77
+ users: a,
78
+ userNames: i
79
79
  };
80
80
  }
81
- function N(s) {
82
- const e = s.id, o = s.profession, a = s.majorName || o, t = s.majorCode || "", n = s.users || [];
83
- return n.length === 0 ? [{
81
+ function S(s) {
82
+ const e = s.id, a = s.profession, i = s.majorName || a, t = s.majorCode || "", o = s.users || [];
83
+ return o.length === 0 ? [{
84
84
  id: `p_${e}`,
85
85
  professionId: e,
86
- profession: o,
87
- majorName: a,
86
+ profession: a,
87
+ majorName: i,
88
88
  majorCode: t,
89
89
  userType: "",
90
90
  userId: "",
91
91
  userName: "-",
92
92
  username: "-",
93
93
  nickName: "-"
94
- }] : n.map((r) => ({
94
+ }] : o.map((r) => ({
95
95
  id: `p_${e}_u_${r.id}`,
96
96
  professionId: e,
97
- profession: o,
98
- majorName: a,
97
+ profession: a,
98
+ majorName: i,
99
99
  majorCode: r.majorCode || t,
100
100
  userType: r.userType || "",
101
101
  userId: r.id,
@@ -104,30 +104,20 @@ const ae = (p, v) => {
104
104
  nickName: r.nickName || "-"
105
105
  }));
106
106
  }
107
- function H(s) {
108
- const e = s.professionId;
109
- if (l.value = l.value.filter((a) => String(a.id) !== String(s.id)), !l.value.some((a) => String(a.professionId) === String(e))) {
110
- const a = g.value;
111
- if (a) {
112
- const t = f.value.find((n) => String(n.id) === String(e));
113
- t && a.toggleRowSelection(t, !1);
114
- }
115
- }
116
- }
117
- function M() {
118
- Z.confirm("\u786E\u5B9A\u8981\u6E05\u7A7A\u6240\u6709\u5DF2\u9009\u4E2D\u7684\u4E13\u4E1A\u5417\uFF1F", "\u63D0\u793A", {
107
+ function z() {
108
+ X.confirm("\u786E\u5B9A\u8981\u6E05\u7A7A\u6240\u6709\u5DF2\u9009\u4E2D\u7684\u4E13\u4E1A\u5417\uFF1F", "\u63D0\u793A", {
119
109
  confirmButtonText: "\u786E\u5B9A",
120
110
  cancelButtonText: "\u53D6\u6D88",
121
111
  type: "warning"
122
112
  }).then(() => {
123
- l.value = [], g.value && g.value.clearSelection(), V.success("\u5DF2\u6E05\u7A7A\u6240\u6709\u9009\u4E2D\u4E13\u4E1A");
113
+ n.value = [], h.value && h.value.clearSelection(), T.success("\u5DF2\u6E05\u7A7A\u6240\u6709\u9009\u4E2D\u4E13\u4E1A");
124
114
  }).catch(() => {
125
115
  });
126
116
  }
127
- async function R() {
128
- const s = i.api.getUserPageList || i.api.getUserList;
117
+ async function $() {
118
+ const s = l.api.getUserPageList || l.api.getUserList;
129
119
  if (!!s) {
130
- y.value = !0;
120
+ N.value = !0;
131
121
  try {
132
122
  let e;
133
123
  try {
@@ -135,109 +125,109 @@ const ae = (p, v) => {
135
125
  } catch {
136
126
  e = await s({ page: 1, pageSize: 99999 }, { page: 1, pageSize: 99999 });
137
127
  }
138
- let o = Array.isArray(e) ? e : e || (e == null ? void 0 : e.data) || (e == null ? void 0 : e.content) || [];
139
- Array.isArray(o) || (o = []), f.value = o.map((a) => $(a));
128
+ let a = Array.isArray(e) ? e : e || (e == null ? void 0 : e.data) || (e == null ? void 0 : e.content) || [];
129
+ Array.isArray(a) || (a = []), f.value = a.map((i) => D(i));
140
130
  } catch (e) {
141
- console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:", e), V.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25");
131
+ console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:", e), T.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25");
142
132
  } finally {
143
- y.value = !1, P(() => {
144
- U();
133
+ N.value = !1, L(() => {
134
+ M();
145
135
  });
146
136
  }
147
137
  }
148
138
  }
149
- function U() {
150
- const s = g.value;
139
+ function M() {
140
+ const s = h.value;
151
141
  if (!s)
152
142
  return;
153
143
  const e = new Set(
154
- l.value.map((o) => String(o.professionId))
144
+ n.value.map((a) => String(a.professionId))
155
145
  );
156
- f.value.forEach((o) => {
157
- e.has(String(o.id)) && s.toggleRowSelection(o, !0);
146
+ f.value.forEach((a) => {
147
+ e.has(String(a.id)) && s.toggleRowSelection(a, !0);
158
148
  });
159
149
  }
160
- function O() {
161
- const s = new Set(i.disabledItems.map((t) => String(t.id))), e = new Set(l.value.map((t) => String(t.professionId))), o = f.value.filter((t) => {
162
- const n = String(t.id);
163
- return !e.has(n) && !s.has(n);
150
+ function R() {
151
+ const s = new Set(l.disabledItems.map((t) => String(t.id))), e = new Set(n.value.map((t) => String(t.professionId))), a = f.value.filter((t) => {
152
+ const o = String(t.id);
153
+ return !e.has(o) && !s.has(o);
164
154
  });
165
- let a = [];
166
- if (o.forEach((t) => {
167
- a = a.concat(N(t));
168
- }), i.multiple) {
169
- if (i.multipleLimit > 0) {
170
- const t = i.multipleLimit - l.value.length;
171
- a.slice(0, t).forEach((n) => {
172
- l.value.push(n);
155
+ let i = [];
156
+ if (a.forEach((t) => {
157
+ i = i.concat(S(t));
158
+ }), l.multiple) {
159
+ if (l.multipleLimit > 0) {
160
+ const t = l.multipleLimit - n.value.length;
161
+ i.slice(0, t).forEach((o) => {
162
+ n.value.push(o);
173
163
  });
174
164
  } else
175
- a.forEach((t) => {
176
- l.value.push(t);
165
+ i.forEach((t) => {
166
+ n.value.push(t);
177
167
  });
178
- V.success(`\u5DF2\u9009\u4E2D ${o.length} \u4E2A\u4E13\u4E1A\uFF0C\u5171 ${a.length} \u6761\u8BB0\u5F55`);
168
+ T.success(`\u5DF2\u9009\u4E2D ${a.length} \u4E2A\u4E13\u4E1A\uFF0C\u5171 ${i.length} \u6761\u8BB0\u5F55`);
179
169
  }
180
- P(() => {
181
- const t = g.value;
182
- t && o.forEach((n) => {
183
- t.toggleRowSelection(n, !0);
170
+ L(() => {
171
+ const t = h.value;
172
+ t && a.forEach((o) => {
173
+ t.toggleRowSelection(o, !0);
184
174
  });
185
175
  });
186
176
  }
187
- function q(s) {
177
+ function U(s) {
188
178
  if (s.length > 0) {
189
- const e = new Set(l.value.map((t) => String(t.professionId))), o = new Set(i.disabledItems.map((t) => String(t.id))), a = s.filter((t) => {
190
- const n = String(t.id);
191
- return !e.has(n) && !o.has(n);
179
+ const e = new Set(n.value.map((t) => String(t.professionId))), a = new Set(l.disabledItems.map((t) => String(t.id))), i = s.filter((t) => {
180
+ const o = String(t.id);
181
+ return !e.has(o) && !a.has(o);
192
182
  });
193
- if (i.multiple) {
183
+ if (l.multiple) {
194
184
  let t = [];
195
- if (a.forEach((n) => {
196
- t = t.concat(N(n));
197
- }), i.multipleLimit > 0) {
198
- const n = i.multipleLimit - l.value.length;
199
- t.slice(0, n).forEach((r) => {
200
- l.value.push(r);
185
+ if (i.forEach((o) => {
186
+ t = t.concat(S(o));
187
+ }), l.multipleLimit > 0) {
188
+ const o = l.multipleLimit - n.value.length;
189
+ t.slice(0, o).forEach((r) => {
190
+ n.value.push(r);
201
191
  });
202
192
  } else
203
- t.forEach((n) => {
204
- l.value.push(n);
193
+ t.forEach((o) => {
194
+ n.value.push(o);
205
195
  });
206
196
  }
207
197
  }
208
198
  }
209
- function F(s) {
210
- const e = new Set(s.map((t) => String(t.id))), o = new Set(i.disabledItems.map((t) => String(t.id)));
199
+ function H(s) {
200
+ const e = new Set(s.map((t) => String(t.id))), a = new Set(l.disabledItems.map((t) => String(t.id)));
211
201
  s.forEach((t) => {
212
- const n = String(t.id);
213
- if (!k(t.id) && !o.has(n))
214
- if (i.multiple) {
215
- const r = N(t);
216
- if (i.multipleLimit > 0) {
217
- const d = i.multipleLimit - l.value.length;
202
+ const o = String(t.id);
203
+ if (!k(t.id) && !a.has(o))
204
+ if (l.multiple) {
205
+ const r = S(t);
206
+ if (l.multipleLimit > 0) {
207
+ const d = l.multipleLimit - n.value.length;
218
208
  if (d <= 0)
219
209
  return;
220
- r.slice(0, d).forEach((E) => {
221
- l.value.push(E);
210
+ r.slice(0, d).forEach((F) => {
211
+ n.value.push(F);
222
212
  });
223
213
  } else
224
214
  r.forEach((d) => {
225
- l.value.push(d);
215
+ n.value.push(d);
226
216
  });
227
217
  } else
228
- l.value = N(t);
218
+ n.value = S(t);
229
219
  });
230
- const a = new Set(f.value.map((t) => String(t.id)));
231
- l.value = l.value.filter((t) => {
232
- const n = String(t.professionId);
233
- return !(a.has(n) && !e.has(n));
220
+ const i = new Set(f.value.map((t) => String(t.id)));
221
+ n.value = n.value.filter((t) => {
222
+ const o = String(t.professionId);
223
+ return !(i.has(o) && !e.has(o));
234
224
  });
235
225
  }
236
- function G(s) {
237
- return !i.multiple && l.value.length >= 1 ? k(s.id) : k(s.id) ? !0 : !z(s.id);
226
+ function O(s) {
227
+ return !l.multiple && n.value.length >= 1 ? k(s.id) : k(s.id) ? !0 : !B(s.id);
238
228
  }
239
- function J() {
240
- let s = l.value.map((e) => ({
229
+ function q() {
230
+ let s = n.value.map((e) => ({
241
231
  id: e.userId || e.id,
242
232
  professionId: e.professionId,
243
233
  profession: e.profession,
@@ -249,23 +239,23 @@ const ae = (p, v) => {
249
239
  username: e.userName,
250
240
  nickName: e.nickName
251
241
  }));
252
- h("confirm", s), C();
242
+ v("confirm", s), C();
253
243
  }
254
244
  function C() {
255
- f.value = [], h("update:modelValue", !1);
245
+ f.value = [], v("update:modelValue", !1);
256
246
  }
257
- return K(
258
- () => i.modelValue,
247
+ return G(
248
+ () => l.modelValue,
259
249
  (s) => {
260
- s && (l.value = i.selectedItems.flatMap((e) => {
261
- var o;
262
- if (console.log("nickname", i.selectedItems), e.users && e.users.length > 0) {
263
- const a = e.id, t = e.profession || e.departmentName, n = e.majorName || t, r = e.majorCode || "";
250
+ s && (n.value = l.selectedItems.flatMap((e) => {
251
+ var a;
252
+ if (console.log("nickname", l.selectedItems), e.users && e.users.length > 0) {
253
+ const i = e.id, t = e.profession || e.departmentName, o = e.majorName || t, r = e.majorCode || "";
264
254
  return e.users.map((d) => ({
265
- id: `p_${a}_u_${d.id}`,
266
- professionId: a,
255
+ id: `p_${i}_u_${d.id}`,
256
+ professionId: i,
267
257
  profession: t,
268
- majorName: n,
258
+ majorName: o,
269
259
  majorCode: r,
270
260
  userType: d.userType || e.userType || "",
271
261
  userId: d.id,
@@ -276,7 +266,7 @@ const ae = (p, v) => {
276
266
  }
277
267
  return [{
278
268
  id: e.id,
279
- professionId: (o = e.professionId) != null ? o : e.id,
269
+ professionId: (a = e.professionId) != null ? a : e.id,
280
270
  profession: e.profession || e.departmentName,
281
271
  majorName: e.majorName || e.profession || e.departmentName,
282
272
  majorCode: e.majorCode || "",
@@ -286,32 +276,32 @@ const ae = (p, v) => {
286
276
  username: e.userName || e.username || "-",
287
277
  nickName: e.nickName || e.name || e.userNames || "-"
288
278
  }];
289
- }), R());
279
+ }), $());
290
280
  },
291
281
  { immediate: !0 }
292
282
  ), (s, e) => {
293
- const o = b("el-button"), a = b("el-table-column"), t = b("el-table"), n = b("el-dialog"), r = Q("loading");
294
- return _(), j(n, {
283
+ const a = b("el-button"), i = b("el-table-column"), t = b("el-table"), o = b("el-dialog"), r = J("loading");
284
+ return _(), j(o, {
295
285
  title: p.dialogTitle,
296
- modelValue: S.value,
297
- "onUpdate:modelValue": e[0] || (e[0] = (d) => S.value = d),
286
+ modelValue: y.value,
287
+ "onUpdate:modelValue": e[0] || (e[0] = (d) => y.value = d),
298
288
  width: "960px",
299
289
  "before-close": C,
300
290
  "append-to-body": "",
301
291
  class: "profession-select-dialog"
302
292
  }, {
303
293
  footer: m(() => [
304
- c(o, {
294
+ c(a, {
305
295
  type: "primary",
306
- disabled: !D.value,
307
- onClick: J
296
+ disabled: !x.value,
297
+ onClick: q
308
298
  }, {
309
299
  default: m(() => [...e[3] || (e[3] = [
310
300
  I("\u786E\u5B9A", -1)
311
301
  ])]),
312
302
  _: 1
313
303
  }, 8, ["disabled"]),
314
- c(o, { onClick: C }, {
304
+ c(a, { onClick: C }, {
315
305
  default: m(() => [...e[4] || (e[4] = [
316
306
  I("\u53D6\u6D88", -1)
317
307
  ])]),
@@ -319,15 +309,15 @@ const ae = (p, v) => {
319
309
  })
320
310
  ]),
321
311
  default: m(() => [
322
- u("div", oe, [
323
- u("div", ne, [
312
+ u("div", ae, [
313
+ u("div", oe, [
324
314
  u("div", le, [
325
- c(o, {
315
+ c(a, {
326
316
  type: "primary",
327
317
  size: "default",
328
- icon: T(te),
329
- disabled: y.value,
330
- onClick: O
318
+ icon: E(Z),
319
+ disabled: N.value,
320
+ onClick: R
331
321
  }, {
332
322
  default: m(() => [...e[1] || (e[1] = [
333
323
  I("\u5168\u90E8\u9009\u4E2D", -1)
@@ -335,24 +325,24 @@ const ae = (p, v) => {
335
325
  _: 1
336
326
  }, 8, ["icon", "disabled"])
337
327
  ]),
338
- W((_(), j(t, {
328
+ K((_(), j(t, {
339
329
  ref_key: "professionTable",
340
- ref: g,
330
+ ref: h,
341
331
  data: f.value,
342
332
  height: "540",
343
333
  "row-key": "id",
344
334
  class: "profession-table",
345
- onSelectAll: q,
346
- onSelectionChange: F
335
+ onSelectAll: U,
336
+ onSelectionChange: H
347
337
  }, {
348
338
  default: m(() => [
349
- c(a, {
339
+ c(i, {
350
340
  type: "selection",
351
341
  width: "50",
352
342
  align: "center",
353
- selectable: G
343
+ selectable: O
354
344
  }),
355
- c(a, {
345
+ c(i, {
356
346
  label: "\u4E13\u4E1A",
357
347
  prop: "majorName",
358
348
  "show-overflow-tooltip": !0
@@ -360,61 +350,46 @@ const ae = (p, v) => {
360
350
  ]),
361
351
  _: 1
362
352
  }, 8, ["data"])), [
363
- [r, y.value]
353
+ [r, N.value]
364
354
  ])
365
355
  ]),
366
- u("div", ie, [
367
- u("div", re, [
368
- u("div", null, "\u5DF2\u9009\u4E2D\u5217\u8868 (" + X(l.value.length) + ")", 1),
369
- l.value.length > 0 ? (_(), j(o, {
356
+ u("div", ne, [
357
+ u("div", ie, [
358
+ u("div", null, "\u5DF2\u9009\u4E2D\u5217\u8868 (" + Q(n.value.length) + ")", 1),
359
+ n.value.length > 0 ? (_(), j(a, {
370
360
  key: 0,
371
361
  type: "text",
372
362
  size: "default",
373
- icon: T(A),
374
- onClick: M,
363
+ icon: E(te),
364
+ onClick: z,
375
365
  class: "clear-btn"
376
366
  }, {
377
367
  default: m(() => [...e[2] || (e[2] = [
378
368
  I("\u6E05\u7A7A", -1)
379
369
  ])]),
380
370
  _: 1
381
- }, 8, ["icon"])) : Y("", !0)
371
+ }, 8, ["icon"])) : W("", !0)
382
372
  ]),
383
373
  c(t, {
384
- data: l.value,
374
+ data: n.value,
385
375
  height: "540",
386
376
  "row-key": "id",
387
377
  class: "selected-table"
388
378
  }, {
389
379
  default: m(() => [
390
- c(a, {
391
- align: "center",
392
- width: "60",
393
- label: "\u64CD\u4F5C"
394
- }, {
395
- default: m(({ row: d }) => [
396
- c(o, {
397
- type: "primary",
398
- link: "",
399
- icon: T(A),
400
- onClick: (E) => H(d)
401
- }, null, 8, ["icon", "onClick"])
402
- ]),
403
- _: 1
404
- }),
405
- c(a, {
380
+ c(i, {
406
381
  label: "\u4E13\u4E1A",
407
382
  prop: "profession",
408
383
  "show-overflow-tooltip": !0,
409
384
  "min-width": "120"
410
385
  }),
411
- c(a, {
386
+ c(i, {
412
387
  label: "\u7528\u6237\u7C7B\u578B",
413
388
  prop: "userType",
414
389
  width: "100",
415
390
  "show-overflow-tooltip": !0
416
391
  }),
417
- c(a, {
392
+ c(i, {
418
393
  label: "\u7528\u6237\u540D\u79F0",
419
394
  prop: "nickName",
420
395
  "min-width": "140",
@@ -430,8 +405,8 @@ const ae = (p, v) => {
430
405
  }, 8, ["title", "modelValue"]);
431
406
  };
432
407
  }
433
- }, ue = /* @__PURE__ */ ae(de, [["__scopeId", "data-v-144912f0"]]);
408
+ }, me = /* @__PURE__ */ se(re, [["__scopeId", "data-v-dc7b7eac"]]);
434
409
  export {
435
- ue as ProfessionSelectDialog,
436
- ue as default
410
+ me as ProfessionSelectDialog,
411
+ me as default
437
412
  };
@@ -1 +1 @@
1
- (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m.ProfessionSelectVue3={},m.Vue,m.ElementPlus))})(this,function(m,t,_){"use strict";/*! Element Plus Icons Vue v2.3.2 */var V=t.defineComponent({name:"Check",__name:"check",setup(p){return(g,r)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),v=V,j=t.defineComponent({name:"Delete",__name:"delete",setup(p){return(g,r)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),C=j;const J="",K="",T=(p,g)=>{const r=p.__vccOpts||p;for(const[h,N]of g)r[h]=N;return r},E={class:"dialog-body"},x={class:"left-panel"},B={class:"select-all-btn-wrap"},L={class:"right-panel"},P={class:"selected-header"},I=T({__name:"ProfessionSelectDialog",props:{modelValue:{type:Boolean,default:!1},dialogTitle:{type:String,default:"\u9009\u62E9\u4E13\u4E1A"},selectedItems:{type:Array,default:()=>[]},api:{type:Object,required:!0},multiple:{type:Boolean,default:!0},multipleLimit:{type:Number,default:0},disabledItems:{type:Array,default:()=>[]}},emits:["update:modelValue","confirm"],setup(p,{emit:g}){const r=p,h=g,N=t.computed({get:()=>r.modelValue,set:a=>h("update:modelValue",a)}),S=t.ref(!1),f=t.ref([]),i=t.ref([]),u=t.ref(),A=t.computed(()=>r.multiple?r.multipleLimit>0&&i.value.length>r.multipleLimit?!1:i.value.length>0:i.value.length===1);function w(a){return i.value.some(e=>String(e.professionId)===String(a))}function D(a){return r.disabledItems.some(e=>String(e.id)===String(a))}function M(a){const e=a.users||a.userList||a.members||a.children||[],n=(Array.isArray(e)?e:[]).map(o=>{var l,d;return{id:(d=(l=o.id)!=null?l:o.userId)!=null?d:o.value,userName:o.userName||o.username||"-",nickName:o.nickName||o.name||o.label||"-",userType:o.userType||"",majorCode:o.majorCode||""}}),s=n.map(o=>o.nickName).filter(Boolean).join("\u3001");return{id:a.id,profession:a.profession||a.departmentName||a.name||"-",majorName:a.majorName||a.profession||a.name||"-",majorCode:a.majorCode||"",users:n,userNames:s}}function y(a){const e=a.id,n=a.profession,s=a.majorName||n,o=a.majorCode||"",l=a.users||[];return l.length===0?[{id:`p_${e}`,professionId:e,profession:n,majorName:s,majorCode:o,userType:"",userId:"",userName:"-",username:"-",nickName:"-"}]:l.map(d=>({id:`p_${e}_u_${d.id}`,professionId:e,profession:n,majorName:s,majorCode:d.majorCode||o,userType:d.userType||"",userId:d.id,userName:d.userName||"-",username:d.userName||"-",nickName:d.nickName||"-"}))}function z(a){const e=a.professionId;if(i.value=i.value.filter(s=>String(s.id)!==String(a.id)),!i.value.some(s=>String(s.professionId)===String(e))){const s=u.value;if(s){const o=f.value.find(l=>String(l.id)===String(e));o&&s.toggleRowSelection(o,!1)}}}function $(){_.ElMessageBox.confirm("\u786E\u5B9A\u8981\u6E05\u7A7A\u6240\u6709\u5DF2\u9009\u4E2D\u7684\u4E13\u4E1A\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{i.value=[],u.value&&u.value.clearSelection(),_.ElMessage.success("\u5DF2\u6E05\u7A7A\u6240\u6709\u9009\u4E2D\u4E13\u4E1A")}).catch(()=>{})}async function H(){const a=r.api.getUserPageList||r.api.getUserList;if(!!a){S.value=!0;try{let e;try{e=await a()}catch{e=await a({page:1,pageSize:99999},{page:1,pageSize:99999})}let n=Array.isArray(e)?e:e||(e==null?void 0:e.data)||(e==null?void 0:e.content)||[];Array.isArray(n)||(n=[]),f.value=n.map(s=>M(s))}catch(e){console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:",e),_.ElMessage.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25")}finally{S.value=!1,t.nextTick(()=>{R()})}}}function R(){const a=u.value;if(!a)return;const e=new Set(i.value.map(n=>String(n.professionId)));f.value.forEach(n=>{e.has(String(n.id))&&a.toggleRowSelection(n,!0)})}function U(){const a=new Set(r.disabledItems.map(o=>String(o.id))),e=new Set(i.value.map(o=>String(o.professionId))),n=f.value.filter(o=>{const l=String(o.id);return!e.has(l)&&!a.has(l)});let s=[];if(n.forEach(o=>{s=s.concat(y(o))}),r.multiple){if(r.multipleLimit>0){const o=r.multipleLimit-i.value.length;s.slice(0,o).forEach(l=>{i.value.push(l)})}else s.forEach(o=>{i.value.push(o)});_.ElMessage.success(`\u5DF2\u9009\u4E2D ${n.length} \u4E2A\u4E13\u4E1A\uFF0C\u5171 ${s.length} \u6761\u8BB0\u5F55`)}t.nextTick(()=>{const o=u.value;o&&n.forEach(l=>{o.toggleRowSelection(l,!0)})})}function q(a){if(a.length>0){const e=new Set(i.value.map(o=>String(o.professionId))),n=new Set(r.disabledItems.map(o=>String(o.id))),s=a.filter(o=>{const l=String(o.id);return!e.has(l)&&!n.has(l)});if(r.multiple){let o=[];if(s.forEach(l=>{o=o.concat(y(l))}),r.multipleLimit>0){const l=r.multipleLimit-i.value.length;o.slice(0,l).forEach(d=>{i.value.push(d)})}else o.forEach(l=>{i.value.push(l)})}}}function O(a){const e=new Set(a.map(o=>String(o.id))),n=new Set(r.disabledItems.map(o=>String(o.id)));a.forEach(o=>{const l=String(o.id);if(!w(o.id)&&!n.has(l))if(r.multiple){const d=y(o);if(r.multipleLimit>0){const c=r.multipleLimit-i.value.length;if(c<=0)return;d.slice(0,c).forEach(k=>{i.value.push(k)})}else d.forEach(c=>{i.value.push(c)})}else i.value=y(o)});const s=new Set(f.value.map(o=>String(o.id)));i.value=i.value.filter(o=>{const l=String(o.professionId);return!(s.has(l)&&!e.has(l))})}function F(a){return!r.multiple&&i.value.length>=1?w(a.id):w(a.id)?!0:!D(a.id)}function G(){let a=i.value.map(e=>({id:e.userId||e.id,professionId:e.professionId,profession:e.profession,majorName:e.majorName,majorCode:e.majorCode,userType:e.userType,userId:e.userId,userName:e.userName,username:e.userName,nickName:e.nickName}));h("confirm",a),b()}function b(){f.value=[],h("update:modelValue",!1)}return t.watch(()=>r.modelValue,a=>{a&&(i.value=r.selectedItems.flatMap(e=>{var n;if(console.log("nickname",r.selectedItems),e.users&&e.users.length>0){const s=e.id,o=e.profession||e.departmentName,l=e.majorName||o,d=e.majorCode||"";return e.users.map(c=>({id:`p_${s}_u_${c.id}`,professionId:s,profession:o,majorName:l,majorCode:d,userType:c.userType||e.userType||"",userId:c.id,userName:c.userName||c.username||"-",username:c.userName||c.username||"-",nickName:c.nickName||c.name||c.label||"-"}))}return[{id:e.id,professionId:(n=e.professionId)!=null?n:e.id,profession:e.profession||e.departmentName,majorName:e.majorName||e.profession||e.departmentName,majorCode:e.majorCode||"",userType:e.userType||"",userId:e.userId||"",userName:e.userName||e.username||"-",username:e.userName||e.username||"-",nickName:e.nickName||e.name||e.userNames||"-"}]}),H())},{immediate:!0}),(a,e)=>{const n=t.resolveComponent("el-button"),s=t.resolveComponent("el-table-column"),o=t.resolveComponent("el-table"),l=t.resolveComponent("el-dialog"),d=t.resolveDirective("loading");return t.openBlock(),t.createBlock(l,{title:p.dialogTitle,modelValue:N.value,"onUpdate:modelValue":e[0]||(e[0]=c=>N.value=c),width:"960px","before-close":b,"append-to-body":"",class:"profession-select-dialog"},{footer:t.withCtx(()=>[t.createVNode(n,{type:"primary",disabled:!A.value,onClick:G},{default:t.withCtx(()=>[...e[3]||(e[3]=[t.createTextVNode("\u786E\u5B9A",-1)])]),_:1},8,["disabled"]),t.createVNode(n,{onClick:b},{default:t.withCtx(()=>[...e[4]||(e[4]=[t.createTextVNode("\u53D6\u6D88",-1)])]),_:1})]),default:t.withCtx(()=>[t.createElementVNode("div",E,[t.createElementVNode("div",x,[t.createElementVNode("div",B,[t.createVNode(n,{type:"primary",size:"default",icon:t.unref(v),disabled:S.value,onClick:U},{default:t.withCtx(()=>[...e[1]||(e[1]=[t.createTextVNode("\u5168\u90E8\u9009\u4E2D",-1)])]),_:1},8,["icon","disabled"])]),t.withDirectives((t.openBlock(),t.createBlock(o,{ref_key:"professionTable",ref:u,data:f.value,height:"540","row-key":"id",class:"profession-table",onSelectAll:q,onSelectionChange:O},{default:t.withCtx(()=>[t.createVNode(s,{type:"selection",width:"50",align:"center",selectable:F}),t.createVNode(s,{label:"\u4E13\u4E1A",prop:"majorName","show-overflow-tooltip":!0})]),_:1},8,["data"])),[[d,S.value]])]),t.createElementVNode("div",L,[t.createElementVNode("div",P,[t.createElementVNode("div",null,"\u5DF2\u9009\u4E2D\u5217\u8868 ("+t.toDisplayString(i.value.length)+")",1),i.value.length>0?(t.openBlock(),t.createBlock(n,{key:0,type:"text",size:"default",icon:t.unref(C),onClick:$,class:"clear-btn"},{default:t.withCtx(()=>[...e[2]||(e[2]=[t.createTextVNode("\u6E05\u7A7A",-1)])]),_:1},8,["icon"])):t.createCommentVNode("",!0)]),t.createVNode(o,{data:i.value,height:"540","row-key":"id",class:"selected-table"},{default:t.withCtx(()=>[t.createVNode(s,{align:"center",width:"60",label:"\u64CD\u4F5C"},{default:t.withCtx(({row:c})=>[t.createVNode(n,{type:"primary",link:"",icon:t.unref(C),onClick:k=>z(c)},null,8,["icon","onClick"])]),_:1}),t.createVNode(s,{label:"\u4E13\u4E1A",prop:"profession","show-overflow-tooltip":!0,"min-width":"120"}),t.createVNode(s,{label:"\u7528\u6237\u7C7B\u578B",prop:"userType",width:"100","show-overflow-tooltip":!0}),t.createVNode(s,{label:"\u7528\u6237\u540D\u79F0",prop:"nickName","min-width":"140","show-overflow-tooltip":!0})]),_:1},8,["data"])])])]),_:1},8,["title","modelValue"])}}},[["__scopeId","data-v-144912f0"]]);m.ProfessionSelectDialog=I,m.default=I,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m.ProfessionSelectVue3={},m.Vue,m.ElementPlus))})(this,function(m,t,_){"use strict";/*! Element Plus Icons Vue v2.3.2 */var I=t.defineComponent({name:"Check",__name:"check",setup(p){return(u,l)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),k=I,V=t.defineComponent({name:"Delete",__name:"delete",setup(p){return(u,l)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[t.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),j=V;const G="",J="",v=(p,u)=>{const l=p.__vccOpts||p;for(const[g,N]of u)l[g]=N;return l},T={class:"dialog-body"},E={class:"left-panel"},x={class:"select-all-btn-wrap"},B={class:"right-panel"},L={class:"selected-header"},C=v({__name:"ProfessionSelectDialog",props:{modelValue:{type:Boolean,default:!1},dialogTitle:{type:String,default:"\u9009\u62E9\u4E13\u4E1A"},selectedItems:{type:Array,default:()=>[]},api:{type:Object,required:!0},multiple:{type:Boolean,default:!0},multipleLimit:{type:Number,default:0},disabledItems:{type:Array,default:()=>[]}},emits:["update:modelValue","confirm"],setup(p,{emit:u}){const l=p,g=u,N=t.computed({get:()=>l.modelValue,set:a=>g("update:modelValue",a)}),y=t.ref(!1),f=t.ref([]),r=t.ref([]),h=t.ref(),P=t.computed(()=>l.multiple?l.multipleLimit>0&&r.value.length>l.multipleLimit?!1:r.value.length>0:r.value.length===1);function S(a){return r.value.some(e=>String(e.professionId)===String(a))}function A(a){return l.disabledItems.some(e=>String(e.id)===String(a))}function D(a){const e=a.users||a.userList||a.members||a.children||[],s=(Array.isArray(e)?e:[]).map(o=>{var n,d;return{id:(d=(n=o.id)!=null?n:o.userId)!=null?d:o.value,userName:o.userName||o.username||"-",nickName:o.nickName||o.name||o.label||"-",userType:o.userType||"",majorCode:o.majorCode||""}}),i=s.map(o=>o.nickName).filter(Boolean).join("\u3001");return{id:a.id,profession:a.profession||a.departmentName||a.name||"-",majorName:a.majorName||a.profession||a.name||"-",majorCode:a.majorCode||"",users:s,userNames:i}}function w(a){const e=a.id,s=a.profession,i=a.majorName||s,o=a.majorCode||"",n=a.users||[];return n.length===0?[{id:`p_${e}`,professionId:e,profession:s,majorName:i,majorCode:o,userType:"",userId:"",userName:"-",username:"-",nickName:"-"}]:n.map(d=>({id:`p_${e}_u_${d.id}`,professionId:e,profession:s,majorName:i,majorCode:d.majorCode||o,userType:d.userType||"",userId:d.id,userName:d.userName||"-",username:d.userName||"-",nickName:d.nickName||"-"}))}function M(){_.ElMessageBox.confirm("\u786E\u5B9A\u8981\u6E05\u7A7A\u6240\u6709\u5DF2\u9009\u4E2D\u7684\u4E13\u4E1A\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{r.value=[],h.value&&h.value.clearSelection(),_.ElMessage.success("\u5DF2\u6E05\u7A7A\u6240\u6709\u9009\u4E2D\u4E13\u4E1A")}).catch(()=>{})}async function z(){const a=l.api.getUserPageList||l.api.getUserList;if(!!a){y.value=!0;try{let e;try{e=await a()}catch{e=await a({page:1,pageSize:99999},{page:1,pageSize:99999})}let s=Array.isArray(e)?e:e||(e==null?void 0:e.data)||(e==null?void 0:e.content)||[];Array.isArray(s)||(s=[]),f.value=s.map(i=>D(i))}catch(e){console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:",e),_.ElMessage.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25")}finally{y.value=!1,t.nextTick(()=>{$()})}}}function $(){const a=h.value;if(!a)return;const e=new Set(r.value.map(s=>String(s.professionId)));f.value.forEach(s=>{e.has(String(s.id))&&a.toggleRowSelection(s,!0)})}function R(){const a=new Set(l.disabledItems.map(o=>String(o.id))),e=new Set(r.value.map(o=>String(o.professionId))),s=f.value.filter(o=>{const n=String(o.id);return!e.has(n)&&!a.has(n)});let i=[];if(s.forEach(o=>{i=i.concat(w(o))}),l.multiple){if(l.multipleLimit>0){const o=l.multipleLimit-r.value.length;i.slice(0,o).forEach(n=>{r.value.push(n)})}else i.forEach(o=>{r.value.push(o)});_.ElMessage.success(`\u5DF2\u9009\u4E2D ${s.length} \u4E2A\u4E13\u4E1A\uFF0C\u5171 ${i.length} \u6761\u8BB0\u5F55`)}t.nextTick(()=>{const o=h.value;o&&s.forEach(n=>{o.toggleRowSelection(n,!0)})})}function U(a){if(a.length>0){const e=new Set(r.value.map(o=>String(o.professionId))),s=new Set(l.disabledItems.map(o=>String(o.id))),i=a.filter(o=>{const n=String(o.id);return!e.has(n)&&!s.has(n)});if(l.multiple){let o=[];if(i.forEach(n=>{o=o.concat(w(n))}),l.multipleLimit>0){const n=l.multipleLimit-r.value.length;o.slice(0,n).forEach(d=>{r.value.push(d)})}else o.forEach(n=>{r.value.push(n)})}}}function H(a){const e=new Set(a.map(o=>String(o.id))),s=new Set(l.disabledItems.map(o=>String(o.id)));a.forEach(o=>{const n=String(o.id);if(!S(o.id)&&!s.has(n))if(l.multiple){const d=w(o);if(l.multipleLimit>0){const c=l.multipleLimit-r.value.length;if(c<=0)return;d.slice(0,c).forEach(F=>{r.value.push(F)})}else d.forEach(c=>{r.value.push(c)})}else r.value=w(o)});const i=new Set(f.value.map(o=>String(o.id)));r.value=r.value.filter(o=>{const n=String(o.professionId);return!(i.has(n)&&!e.has(n))})}function q(a){return!l.multiple&&r.value.length>=1?S(a.id):S(a.id)?!0:!A(a.id)}function O(){let a=r.value.map(e=>({id:e.userId||e.id,professionId:e.professionId,profession:e.profession,majorName:e.majorName,majorCode:e.majorCode,userType:e.userType,userId:e.userId,userName:e.userName,username:e.userName,nickName:e.nickName}));g("confirm",a),b()}function b(){f.value=[],g("update:modelValue",!1)}return t.watch(()=>l.modelValue,a=>{a&&(r.value=l.selectedItems.flatMap(e=>{var s;if(console.log("nickname",l.selectedItems),e.users&&e.users.length>0){const i=e.id,o=e.profession||e.departmentName,n=e.majorName||o,d=e.majorCode||"";return e.users.map(c=>({id:`p_${i}_u_${c.id}`,professionId:i,profession:o,majorName:n,majorCode:d,userType:c.userType||e.userType||"",userId:c.id,userName:c.userName||c.username||"-",username:c.userName||c.username||"-",nickName:c.nickName||c.name||c.label||"-"}))}return[{id:e.id,professionId:(s=e.professionId)!=null?s:e.id,profession:e.profession||e.departmentName,majorName:e.majorName||e.profession||e.departmentName,majorCode:e.majorCode||"",userType:e.userType||"",userId:e.userId||"",userName:e.userName||e.username||"-",username:e.userName||e.username||"-",nickName:e.nickName||e.name||e.userNames||"-"}]}),z())},{immediate:!0}),(a,e)=>{const s=t.resolveComponent("el-button"),i=t.resolveComponent("el-table-column"),o=t.resolveComponent("el-table"),n=t.resolveComponent("el-dialog"),d=t.resolveDirective("loading");return t.openBlock(),t.createBlock(n,{title:p.dialogTitle,modelValue:N.value,"onUpdate:modelValue":e[0]||(e[0]=c=>N.value=c),width:"960px","before-close":b,"append-to-body":"",class:"profession-select-dialog"},{footer:t.withCtx(()=>[t.createVNode(s,{type:"primary",disabled:!P.value,onClick:O},{default:t.withCtx(()=>[...e[3]||(e[3]=[t.createTextVNode("\u786E\u5B9A",-1)])]),_:1},8,["disabled"]),t.createVNode(s,{onClick:b},{default:t.withCtx(()=>[...e[4]||(e[4]=[t.createTextVNode("\u53D6\u6D88",-1)])]),_:1})]),default:t.withCtx(()=>[t.createElementVNode("div",T,[t.createElementVNode("div",E,[t.createElementVNode("div",x,[t.createVNode(s,{type:"primary",size:"default",icon:t.unref(k),disabled:y.value,onClick:R},{default:t.withCtx(()=>[...e[1]||(e[1]=[t.createTextVNode("\u5168\u90E8\u9009\u4E2D",-1)])]),_:1},8,["icon","disabled"])]),t.withDirectives((t.openBlock(),t.createBlock(o,{ref_key:"professionTable",ref:h,data:f.value,height:"540","row-key":"id",class:"profession-table",onSelectAll:U,onSelectionChange:H},{default:t.withCtx(()=>[t.createVNode(i,{type:"selection",width:"50",align:"center",selectable:q}),t.createVNode(i,{label:"\u4E13\u4E1A",prop:"majorName","show-overflow-tooltip":!0})]),_:1},8,["data"])),[[d,y.value]])]),t.createElementVNode("div",B,[t.createElementVNode("div",L,[t.createElementVNode("div",null,"\u5DF2\u9009\u4E2D\u5217\u8868 ("+t.toDisplayString(r.value.length)+")",1),r.value.length>0?(t.openBlock(),t.createBlock(s,{key:0,type:"text",size:"default",icon:t.unref(j),onClick:M,class:"clear-btn"},{default:t.withCtx(()=>[...e[2]||(e[2]=[t.createTextVNode("\u6E05\u7A7A",-1)])]),_:1},8,["icon"])):t.createCommentVNode("",!0)]),t.createVNode(o,{data:r.value,height:"540","row-key":"id",class:"selected-table"},{default:t.withCtx(()=>[t.createVNode(i,{label:"\u4E13\u4E1A",prop:"profession","show-overflow-tooltip":!0,"min-width":"120"}),t.createVNode(i,{label:"\u7528\u6237\u7C7B\u578B",prop:"userType",width:"100","show-overflow-tooltip":!0}),t.createVNode(i,{label:"\u7528\u6237\u540D\u79F0",prop:"nickName","min-width":"140","show-overflow-tooltip":!0})]),_:1},8,["data"])])])]),_:1},8,["title","modelValue"])}}},[["__scopeId","data-v-dc7b7eac"]]);m.ProfessionSelectDialog=C,m.default=C,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .dialog-body[data-v-144912f0]{display:flex;gap:16px;min-height:580px}.left-panel[data-v-144912f0]{flex:1;min-width:0;display:flex;flex-direction:column}.select-all-btn-wrap[data-v-144912f0]{margin-bottom:10px}.right-panel[data-v-144912f0]{width:460px;flex-shrink:0;border:1px solid #ebeef5;border-radius:4px;overflow:hidden}.selected-header[data-v-144912f0]{padding:6px 12px;background:#ecf5ff;color:#409eff;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:space-between;height:40px;box-sizing:border-box;white-space:nowrap}.clear-btn[data-v-144912f0]{color:#f56c6c;padding:0;margin-left:10px}.clear-btn[data-v-144912f0]:hover{color:#ef4444}.profession-table[data-v-144912f0],.selected-table[data-v-144912f0]{flex:1}.selected-table[data-v-144912f0] .el-table__cell{padding:6px 0}.row-type-select[data-v-144912f0]{width:100%}.profession-select-dialog .el-dialog__body{padding:20px}
1
+ .dialog-body[data-v-dc7b7eac]{display:flex;gap:16px;min-height:580px}.left-panel[data-v-dc7b7eac]{flex:1;min-width:0;display:flex;flex-direction:column}.select-all-btn-wrap[data-v-dc7b7eac]{margin-bottom:10px}.right-panel[data-v-dc7b7eac]{width:460px;flex-shrink:0;border:1px solid #ebeef5;border-radius:4px;overflow:hidden}.selected-header[data-v-dc7b7eac]{padding:6px 12px;background:#ecf5ff;color:#409eff;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:space-between;height:40px;box-sizing:border-box;white-space:nowrap}.clear-btn[data-v-dc7b7eac]{color:#f56c6c;padding:0;margin-left:10px}.clear-btn[data-v-dc7b7eac]:hover{color:#ef4444}.profession-table[data-v-dc7b7eac],.selected-table[data-v-dc7b7eac]{flex:1}.selected-table[data-v-dc7b7eac] .el-table__cell{padding:6px 0}.row-type-select[data-v-dc7b7eac]{width:100%}.profession-select-dialog .el-dialog__body{padding:20px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingminghahayu/profession-select-dialog-vue3",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Vue 3 Element Plus Profession Select Dialog Component",
5
5
  "main": "./dist/profession-select-vue3.umd.js",
6
6
  "module": "./dist/profession-select-vue3.es.js",
@@ -47,11 +47,11 @@
47
47
  >清空</el-button>
48
48
  </div>
49
49
  <el-table :data="multiSelect" height="540" row-key="id" class="selected-table">
50
- <el-table-column align="center" width="60" label="操作">
50
+ <!-- <el-table-column align="center" width="60" label="操作">
51
51
  <template #default="{ row }">
52
52
  <el-button type="primary" link :icon="Delete" @click="removeFromSelected(row)" />
53
53
  </template>
54
- </el-table-column>
54
+ </el-table-column> -->
55
55
  <el-table-column label="专业" prop="profession" :show-overflow-tooltip="true" min-width="120" />
56
56
  <el-table-column label="用户类型" prop="userType" width="100" :show-overflow-tooltip="true" />
57
57
  <el-table-column label="用户名称" prop="nickName" min-width="140" :show-overflow-tooltip="true" />