@mingminghahayu/profession-select-dialog-vue3 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.
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessageBox as
|
|
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
|
|
4
|
+
var Y = /* @__PURE__ */ P({
|
|
5
5
|
name: "Check",
|
|
6
6
|
__name: "check",
|
|
7
7
|
setup(p) {
|
|
8
|
-
return (
|
|
8
|
+
return (g, l) => (_(), A("svg", {
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
viewBox: "0 0 1024 1024"
|
|
11
11
|
}, [
|
|
12
|
-
|
|
12
|
+
u("path", {
|
|
13
13
|
fill: "currentColor",
|
|
14
14
|
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"
|
|
15
15
|
})
|
|
16
16
|
]));
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
18
|
+
}), Z = Y, ee = /* @__PURE__ */ P({
|
|
19
19
|
name: "Delete",
|
|
20
20
|
__name: "delete",
|
|
21
21
|
setup(p) {
|
|
22
|
-
return (
|
|
22
|
+
return (g, l) => (_(), A("svg", {
|
|
23
23
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
24
|
viewBox: "0 0 1024 1024"
|
|
25
25
|
}, [
|
|
26
|
-
|
|
26
|
+
u("path", {
|
|
27
27
|
fill: "currentColor",
|
|
28
28
|
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"
|
|
29
29
|
})
|
|
30
30
|
]));
|
|
31
31
|
}
|
|
32
|
-
}),
|
|
33
|
-
const se = (p,
|
|
34
|
-
const
|
|
35
|
-
for (const [
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
}, ae = { class: "dialog-body" },
|
|
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,192 +47,187 @@ const se = (p, v) => {
|
|
|
47
47
|
disabledItems: { type: Array, default: () => [] }
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:modelValue", "confirm"],
|
|
50
|
-
setup(p, { emit:
|
|
51
|
-
const
|
|
52
|
-
get: () =>
|
|
53
|
-
set: (
|
|
54
|
-
}),
|
|
55
|
-
function
|
|
56
|
-
return n.value.some((e) => String(e.professionId) === String(
|
|
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
|
+
function k(s) {
|
|
56
|
+
return n.value.some((e) => String(e.professionId) === String(s));
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function B(s) {
|
|
59
|
+
return l.disabledItems.some((e) => String(e.id) === String(s));
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
const e =
|
|
63
|
-
var
|
|
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 = (
|
|
66
|
-
|
|
65
|
+
id: (r = (o = t.id) != null ? o : t.userId) != null ? r : t.value,
|
|
66
|
+
userName: t.userName || t.username || "-",
|
|
67
|
+
nickName: t.nickName || t.name || t.label || "-",
|
|
67
68
|
userType: t.userType || "",
|
|
68
69
|
majorCode: t.majorCode || ""
|
|
69
70
|
};
|
|
70
|
-
}),
|
|
71
|
+
}), i = a.map((t) => t.nickName).filter(Boolean).join("\u3001");
|
|
71
72
|
return {
|
|
72
|
-
id:
|
|
73
|
-
profession:
|
|
74
|
-
majorName:
|
|
75
|
-
majorCode:
|
|
73
|
+
id: s.id,
|
|
74
|
+
profession: s.profession || s.departmentName || s.name || "-",
|
|
75
|
+
majorName: s.majorName || s.profession || s.name || "-",
|
|
76
|
+
majorCode: s.majorCode || "",
|
|
76
77
|
users: a,
|
|
77
|
-
userNames:
|
|
78
|
+
userNames: i
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
const e =
|
|
82
|
-
return
|
|
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 ? [{
|
|
83
84
|
id: `p_${e}`,
|
|
84
85
|
professionId: e,
|
|
85
86
|
profession: a,
|
|
86
|
-
majorName:
|
|
87
|
+
majorName: i,
|
|
87
88
|
majorCode: t,
|
|
88
89
|
userType: "",
|
|
89
90
|
userId: "",
|
|
90
|
-
userName: "-"
|
|
91
|
-
|
|
91
|
+
userName: "-",
|
|
92
|
+
username: "-",
|
|
93
|
+
nickName: "-"
|
|
94
|
+
}] : o.map((r) => ({
|
|
92
95
|
id: `p_${e}_u_${r.id}`,
|
|
93
96
|
professionId: e,
|
|
94
97
|
profession: a,
|
|
95
|
-
majorName:
|
|
98
|
+
majorName: i,
|
|
96
99
|
majorCode: r.majorCode || t,
|
|
97
100
|
userType: r.userType || "",
|
|
98
101
|
userId: r.id,
|
|
99
|
-
userName: r.
|
|
102
|
+
userName: r.userName || "-",
|
|
103
|
+
username: r.userName || "-",
|
|
104
|
+
nickName: r.nickName || "-"
|
|
100
105
|
}));
|
|
101
106
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
if (n.value = n.value.filter((s) => String(s.id) !== String(o.id)), !n.value.some((s) => String(s.professionId) === String(e))) {
|
|
105
|
-
const s = g.value;
|
|
106
|
-
if (s) {
|
|
107
|
-
const t = f.value.find((l) => String(l.id) === String(e));
|
|
108
|
-
t && s.toggleRowSelection(t, !1);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function M() {
|
|
113
|
-
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", {
|
|
114
109
|
confirmButtonText: "\u786E\u5B9A",
|
|
115
110
|
cancelButtonText: "\u53D6\u6D88",
|
|
116
111
|
type: "warning"
|
|
117
112
|
}).then(() => {
|
|
118
|
-
n.value = [],
|
|
113
|
+
n.value = [], h.value && h.value.clearSelection(), T.success("\u5DF2\u6E05\u7A7A\u6240\u6709\u9009\u4E2D\u4E13\u4E1A");
|
|
119
114
|
}).catch(() => {
|
|
120
115
|
});
|
|
121
116
|
}
|
|
122
|
-
async function
|
|
123
|
-
const
|
|
124
|
-
if (!!
|
|
125
|
-
|
|
117
|
+
async function $() {
|
|
118
|
+
const s = l.api.getUserPageList || l.api.getUserList;
|
|
119
|
+
if (!!s) {
|
|
120
|
+
N.value = !0;
|
|
126
121
|
try {
|
|
127
122
|
let e;
|
|
128
123
|
try {
|
|
129
|
-
e = await
|
|
124
|
+
e = await s();
|
|
130
125
|
} catch {
|
|
131
|
-
e = await
|
|
126
|
+
e = await s({ page: 1, pageSize: 99999 }, { page: 1, pageSize: 99999 });
|
|
132
127
|
}
|
|
133
128
|
let a = Array.isArray(e) ? e : e || (e == null ? void 0 : e.data) || (e == null ? void 0 : e.content) || [];
|
|
134
|
-
Array.isArray(a) || (a = []), f.value = a.map((
|
|
129
|
+
Array.isArray(a) || (a = []), f.value = a.map((i) => D(i));
|
|
135
130
|
} catch (e) {
|
|
136
|
-
console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:", e),
|
|
131
|
+
console.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25:", e), T.error("\u83B7\u53D6\u4E13\u4E1A\u5931\u8D25");
|
|
137
132
|
} finally {
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
N.value = !1, L(() => {
|
|
134
|
+
M();
|
|
140
135
|
});
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
138
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
139
|
+
function M() {
|
|
140
|
+
const s = h.value;
|
|
141
|
+
if (!s)
|
|
147
142
|
return;
|
|
148
143
|
const e = new Set(
|
|
149
144
|
n.value.map((a) => String(a.professionId))
|
|
150
145
|
);
|
|
151
146
|
f.value.forEach((a) => {
|
|
152
|
-
e.has(String(a.id)) &&
|
|
147
|
+
e.has(String(a.id)) && s.toggleRowSelection(a, !0);
|
|
153
148
|
});
|
|
154
149
|
}
|
|
155
|
-
function
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
return !e.has(
|
|
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);
|
|
159
154
|
});
|
|
160
|
-
let
|
|
155
|
+
let i = [];
|
|
161
156
|
if (a.forEach((t) => {
|
|
162
|
-
|
|
163
|
-
}),
|
|
164
|
-
if (
|
|
165
|
-
const t =
|
|
166
|
-
|
|
167
|
-
n.value.push(
|
|
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);
|
|
168
163
|
});
|
|
169
164
|
} else
|
|
170
|
-
|
|
165
|
+
i.forEach((t) => {
|
|
171
166
|
n.value.push(t);
|
|
172
167
|
});
|
|
173
|
-
|
|
168
|
+
T.success(`\u5DF2\u9009\u4E2D ${a.length} \u4E2A\u4E13\u4E1A\uFF0C\u5171 ${i.length} \u6761\u8BB0\u5F55`);
|
|
174
169
|
}
|
|
175
170
|
L(() => {
|
|
176
|
-
const t =
|
|
177
|
-
t && a.forEach((
|
|
178
|
-
t.toggleRowSelection(
|
|
171
|
+
const t = h.value;
|
|
172
|
+
t && a.forEach((o) => {
|
|
173
|
+
t.toggleRowSelection(o, !0);
|
|
179
174
|
});
|
|
180
175
|
});
|
|
181
176
|
}
|
|
182
|
-
function
|
|
183
|
-
if (
|
|
184
|
-
const e = new Set(n.value.map((t) => String(t.professionId))), a = new Set(
|
|
185
|
-
const
|
|
186
|
-
return !e.has(
|
|
177
|
+
function U(s) {
|
|
178
|
+
if (s.length > 0) {
|
|
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);
|
|
187
182
|
});
|
|
188
|
-
if (
|
|
183
|
+
if (l.multiple) {
|
|
189
184
|
let t = [];
|
|
190
|
-
if (
|
|
191
|
-
t = t.concat(
|
|
192
|
-
}),
|
|
193
|
-
const
|
|
194
|
-
t.slice(0,
|
|
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) => {
|
|
195
190
|
n.value.push(r);
|
|
196
191
|
});
|
|
197
192
|
} else
|
|
198
|
-
t.forEach((
|
|
199
|
-
n.value.push(
|
|
193
|
+
t.forEach((o) => {
|
|
194
|
+
n.value.push(o);
|
|
200
195
|
});
|
|
201
196
|
}
|
|
202
197
|
}
|
|
203
198
|
}
|
|
204
|
-
function
|
|
205
|
-
const e = new Set(
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
if (!
|
|
209
|
-
if (
|
|
210
|
-
const r =
|
|
211
|
-
if (
|
|
212
|
-
const d =
|
|
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)));
|
|
201
|
+
s.forEach((t) => {
|
|
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;
|
|
213
208
|
if (d <= 0)
|
|
214
209
|
return;
|
|
215
|
-
r.slice(0, d).forEach((
|
|
216
|
-
n.value.push(
|
|
210
|
+
r.slice(0, d).forEach((F) => {
|
|
211
|
+
n.value.push(F);
|
|
217
212
|
});
|
|
218
213
|
} else
|
|
219
214
|
r.forEach((d) => {
|
|
220
215
|
n.value.push(d);
|
|
221
216
|
});
|
|
222
217
|
} else
|
|
223
|
-
n.value =
|
|
218
|
+
n.value = S(t);
|
|
224
219
|
});
|
|
225
|
-
const
|
|
220
|
+
const i = new Set(f.value.map((t) => String(t.id)));
|
|
226
221
|
n.value = n.value.filter((t) => {
|
|
227
|
-
const
|
|
228
|
-
return !(
|
|
222
|
+
const o = String(t.professionId);
|
|
223
|
+
return !(i.has(o) && !e.has(o));
|
|
229
224
|
});
|
|
230
225
|
}
|
|
231
|
-
function
|
|
232
|
-
return !
|
|
226
|
+
function O(s) {
|
|
227
|
+
return !l.multiple && n.value.length >= 1 ? k(s.id) : k(s.id) ? !0 : !B(s.id);
|
|
233
228
|
}
|
|
234
|
-
function
|
|
235
|
-
let
|
|
229
|
+
function q() {
|
|
230
|
+
let s = n.value.map((e) => ({
|
|
236
231
|
id: e.userId || e.id,
|
|
237
232
|
professionId: e.professionId,
|
|
238
233
|
profession: e.profession,
|
|
@@ -240,29 +235,33 @@ const se = (p, v) => {
|
|
|
240
235
|
majorCode: e.majorCode,
|
|
241
236
|
userType: e.userType,
|
|
242
237
|
userId: e.userId,
|
|
243
|
-
userName: e.userName
|
|
238
|
+
userName: e.userName,
|
|
239
|
+
username: e.userName,
|
|
240
|
+
nickName: e.nickName
|
|
244
241
|
}));
|
|
245
|
-
|
|
242
|
+
v("confirm", s), C();
|
|
246
243
|
}
|
|
247
|
-
function
|
|
248
|
-
f.value = [],
|
|
244
|
+
function C() {
|
|
245
|
+
f.value = [], v("update:modelValue", !1);
|
|
249
246
|
}
|
|
250
|
-
return
|
|
251
|
-
() =>
|
|
252
|
-
(
|
|
253
|
-
|
|
247
|
+
return G(
|
|
248
|
+
() => l.modelValue,
|
|
249
|
+
(s) => {
|
|
250
|
+
s && (n.value = l.selectedItems.flatMap((e) => {
|
|
254
251
|
var a;
|
|
255
|
-
if (e.users && e.users.length > 0) {
|
|
256
|
-
const
|
|
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 || "";
|
|
257
254
|
return e.users.map((d) => ({
|
|
258
|
-
id: `p_${
|
|
259
|
-
professionId:
|
|
255
|
+
id: `p_${i}_u_${d.id}`,
|
|
256
|
+
professionId: i,
|
|
260
257
|
profession: t,
|
|
261
|
-
majorName:
|
|
258
|
+
majorName: o,
|
|
262
259
|
majorCode: r,
|
|
263
260
|
userType: d.userType || e.userType || "",
|
|
264
261
|
userId: d.id,
|
|
265
|
-
userName: d.
|
|
262
|
+
userName: d.userName || d.username || "-",
|
|
263
|
+
username: d.userName || d.username || "-",
|
|
264
|
+
nickName: d.nickName || d.name || d.label || "-"
|
|
266
265
|
}));
|
|
267
266
|
}
|
|
268
267
|
return [{
|
|
@@ -273,75 +272,77 @@ const se = (p, v) => {
|
|
|
273
272
|
majorCode: e.majorCode || "",
|
|
274
273
|
userType: e.userType || "",
|
|
275
274
|
userId: e.userId || "",
|
|
276
|
-
userName: e.userName || e.
|
|
275
|
+
userName: e.userName || e.username || "-",
|
|
276
|
+
username: e.userName || e.username || "-",
|
|
277
|
+
nickName: e.nickName || e.name || e.userNames || "-"
|
|
277
278
|
}];
|
|
278
|
-
}),
|
|
279
|
+
}), $());
|
|
279
280
|
},
|
|
280
281
|
{ immediate: !0 }
|
|
281
|
-
), (
|
|
282
|
-
const a =
|
|
283
|
-
return _(),
|
|
282
|
+
), (s, e) => {
|
|
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, {
|
|
284
285
|
title: p.dialogTitle,
|
|
285
|
-
modelValue:
|
|
286
|
-
"onUpdate:modelValue": e[0] || (e[0] = (d) =>
|
|
286
|
+
modelValue: y.value,
|
|
287
|
+
"onUpdate:modelValue": e[0] || (e[0] = (d) => y.value = d),
|
|
287
288
|
width: "960px",
|
|
288
|
-
"before-close":
|
|
289
|
+
"before-close": C,
|
|
289
290
|
"append-to-body": "",
|
|
290
291
|
class: "profession-select-dialog"
|
|
291
292
|
}, {
|
|
292
|
-
footer:
|
|
293
|
+
footer: m(() => [
|
|
293
294
|
c(a, {
|
|
294
295
|
type: "primary",
|
|
295
|
-
disabled: !
|
|
296
|
-
onClick:
|
|
296
|
+
disabled: !x.value,
|
|
297
|
+
onClick: q
|
|
297
298
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
|
|
299
|
+
default: m(() => [...e[3] || (e[3] = [
|
|
300
|
+
I("\u786E\u5B9A", -1)
|
|
300
301
|
])]),
|
|
301
302
|
_: 1
|
|
302
303
|
}, 8, ["disabled"]),
|
|
303
|
-
c(a, { onClick:
|
|
304
|
-
default:
|
|
305
|
-
|
|
304
|
+
c(a, { onClick: C }, {
|
|
305
|
+
default: m(() => [...e[4] || (e[4] = [
|
|
306
|
+
I("\u53D6\u6D88", -1)
|
|
306
307
|
])]),
|
|
307
308
|
_: 1
|
|
308
309
|
})
|
|
309
310
|
]),
|
|
310
|
-
default:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
default: m(() => [
|
|
312
|
+
u("div", ae, [
|
|
313
|
+
u("div", oe, [
|
|
314
|
+
u("div", le, [
|
|
314
315
|
c(a, {
|
|
315
316
|
type: "primary",
|
|
316
317
|
size: "default",
|
|
317
|
-
icon:
|
|
318
|
-
disabled:
|
|
319
|
-
onClick:
|
|
318
|
+
icon: E(Z),
|
|
319
|
+
disabled: N.value,
|
|
320
|
+
onClick: R
|
|
320
321
|
}, {
|
|
321
|
-
default:
|
|
322
|
-
|
|
322
|
+
default: m(() => [...e[1] || (e[1] = [
|
|
323
|
+
I("\u5168\u90E8\u9009\u4E2D", -1)
|
|
323
324
|
])]),
|
|
324
325
|
_: 1
|
|
325
326
|
}, 8, ["icon", "disabled"])
|
|
326
327
|
]),
|
|
327
|
-
|
|
328
|
+
K((_(), j(t, {
|
|
328
329
|
ref_key: "professionTable",
|
|
329
|
-
ref:
|
|
330
|
+
ref: h,
|
|
330
331
|
data: f.value,
|
|
331
332
|
height: "540",
|
|
332
333
|
"row-key": "id",
|
|
333
334
|
class: "profession-table",
|
|
334
|
-
onSelectAll:
|
|
335
|
-
onSelectionChange:
|
|
335
|
+
onSelectAll: U,
|
|
336
|
+
onSelectionChange: H
|
|
336
337
|
}, {
|
|
337
|
-
default:
|
|
338
|
-
c(
|
|
338
|
+
default: m(() => [
|
|
339
|
+
c(i, {
|
|
339
340
|
type: "selection",
|
|
340
341
|
width: "50",
|
|
341
342
|
align: "center",
|
|
342
|
-
selectable:
|
|
343
|
+
selectable: O
|
|
343
344
|
}),
|
|
344
|
-
c(
|
|
345
|
+
c(i, {
|
|
345
346
|
label: "\u4E13\u4E1A",
|
|
346
347
|
prop: "majorName",
|
|
347
348
|
"show-overflow-tooltip": !0
|
|
@@ -349,25 +350,25 @@ const se = (p, v) => {
|
|
|
349
350
|
]),
|
|
350
351
|
_: 1
|
|
351
352
|
}, 8, ["data"])), [
|
|
352
|
-
[r,
|
|
353
|
+
[r, N.value]
|
|
353
354
|
])
|
|
354
355
|
]),
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
n.value.length > 0 ? (_(),
|
|
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, {
|
|
359
360
|
key: 0,
|
|
360
361
|
type: "text",
|
|
361
362
|
size: "default",
|
|
362
|
-
icon:
|
|
363
|
-
onClick:
|
|
363
|
+
icon: E(te),
|
|
364
|
+
onClick: z,
|
|
364
365
|
class: "clear-btn"
|
|
365
366
|
}, {
|
|
366
|
-
default:
|
|
367
|
-
|
|
367
|
+
default: m(() => [...e[2] || (e[2] = [
|
|
368
|
+
I("\u6E05\u7A7A", -1)
|
|
368
369
|
])]),
|
|
369
370
|
_: 1
|
|
370
|
-
}, 8, ["icon"])) :
|
|
371
|
+
}, 8, ["icon"])) : W("", !0)
|
|
371
372
|
]),
|
|
372
373
|
c(t, {
|
|
373
374
|
data: n.value,
|
|
@@ -375,37 +376,22 @@ const se = (p, v) => {
|
|
|
375
376
|
"row-key": "id",
|
|
376
377
|
class: "selected-table"
|
|
377
378
|
}, {
|
|
378
|
-
default:
|
|
379
|
-
c(
|
|
380
|
-
align: "center",
|
|
381
|
-
width: "60",
|
|
382
|
-
label: "\u64CD\u4F5C"
|
|
383
|
-
}, {
|
|
384
|
-
default: u(({ row: d }) => [
|
|
385
|
-
c(a, {
|
|
386
|
-
type: "primary",
|
|
387
|
-
link: "",
|
|
388
|
-
icon: k(P),
|
|
389
|
-
onClick: (x) => H(d)
|
|
390
|
-
}, null, 8, ["icon", "onClick"])
|
|
391
|
-
]),
|
|
392
|
-
_: 1
|
|
393
|
-
}),
|
|
394
|
-
c(s, {
|
|
379
|
+
default: m(() => [
|
|
380
|
+
c(i, {
|
|
395
381
|
label: "\u4E13\u4E1A",
|
|
396
382
|
prop: "profession",
|
|
397
383
|
"show-overflow-tooltip": !0,
|
|
398
384
|
"min-width": "120"
|
|
399
385
|
}),
|
|
400
|
-
c(
|
|
386
|
+
c(i, {
|
|
401
387
|
label: "\u7528\u6237\u7C7B\u578B",
|
|
402
388
|
prop: "userType",
|
|
403
389
|
width: "100",
|
|
404
390
|
"show-overflow-tooltip": !0
|
|
405
391
|
}),
|
|
406
|
-
c(
|
|
392
|
+
c(i, {
|
|
407
393
|
label: "\u7528\u6237\u540D\u79F0",
|
|
408
|
-
prop: "
|
|
394
|
+
prop: "nickName",
|
|
409
395
|
"min-width": "140",
|
|
410
396
|
"show-overflow-tooltip": !0
|
|
411
397
|
})
|
|
@@ -419,7 +405,7 @@ const se = (p, v) => {
|
|
|
419
405
|
}, 8, ["title", "modelValue"]);
|
|
420
406
|
};
|
|
421
407
|
}
|
|
422
|
-
}, me = /* @__PURE__ */ se(
|
|
408
|
+
}, me = /* @__PURE__ */ se(re, [["__scopeId", "data-v-dc7b7eac"]]);
|
|
423
409
|
export {
|
|
424
410
|
me as ProfessionSelectDialog,
|
|
425
411
|
me as default
|
|
@@ -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
|
|
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-
|
|
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.
|
|
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,14 +47,14 @@
|
|
|
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
|
-
<el-table-column label="用户名称" prop="
|
|
57
|
+
<el-table-column label="用户名称" prop="nickName" min-width="140" :show-overflow-tooltip="true" />
|
|
58
58
|
</el-table>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
@@ -117,11 +117,13 @@ function formatProfessionItem(item) {
|
|
|
117
117
|
const rawUsers = item.users || item.userList || item.members || item.children || []
|
|
118
118
|
const users = (Array.isArray(rawUsers) ? rawUsers : []).map(u => ({
|
|
119
119
|
id: u.id ?? u.userId ?? u.value,
|
|
120
|
-
|
|
120
|
+
// userName / username 都是工号,nickName 才是用户名称
|
|
121
|
+
userName: u.userName || u.username || '-',
|
|
122
|
+
nickName: u.nickName || u.name || u.label || '-',
|
|
121
123
|
userType: u.userType || '',
|
|
122
124
|
majorCode: u.majorCode || ''
|
|
123
125
|
}))
|
|
124
|
-
const userNames = users.map(u => u.
|
|
126
|
+
const userNames = users.map(u => u.nickName).filter(Boolean).join('、')
|
|
125
127
|
return {
|
|
126
128
|
id: item.id,
|
|
127
129
|
profession: item.profession || item.departmentName || item.name || '-',
|
|
@@ -149,7 +151,9 @@ function expandProfessionToRows(prof) {
|
|
|
149
151
|
majorCode,
|
|
150
152
|
userType: '',
|
|
151
153
|
userId: '',
|
|
152
|
-
userName: '-'
|
|
154
|
+
userName: '-',
|
|
155
|
+
username: '-',
|
|
156
|
+
nickName: '-'
|
|
153
157
|
}]
|
|
154
158
|
}
|
|
155
159
|
return users.map(u => ({
|
|
@@ -160,7 +164,9 @@ function expandProfessionToRows(prof) {
|
|
|
160
164
|
majorCode: u.majorCode || majorCode,
|
|
161
165
|
userType: u.userType || '',
|
|
162
166
|
userId: u.id,
|
|
163
|
-
userName: u.
|
|
167
|
+
userName: u.userName || '-',
|
|
168
|
+
username: u.userName || '-',
|
|
169
|
+
nickName: u.nickName || '-'
|
|
164
170
|
}))
|
|
165
171
|
}
|
|
166
172
|
|
|
@@ -371,7 +377,9 @@ function saveDialog() {
|
|
|
371
377
|
majorCode: u.majorCode,
|
|
372
378
|
userType: u.userType,
|
|
373
379
|
userId: u.userId,
|
|
374
|
-
userName: u.userName
|
|
380
|
+
userName: u.userName,
|
|
381
|
+
username: u.userName,
|
|
382
|
+
nickName: u.nickName
|
|
375
383
|
}))
|
|
376
384
|
emit('confirm', list)
|
|
377
385
|
handleClose()
|
|
@@ -388,6 +396,7 @@ watch(
|
|
|
388
396
|
if (visible) {
|
|
389
397
|
// 把外部传入的已选数据按用户展开为多条记录
|
|
390
398
|
multiSelect.value = props.selectedItems.flatMap(u => {
|
|
399
|
+
console.log('nickname',props.selectedItems)
|
|
391
400
|
// 兼容两种数据结构:
|
|
392
401
|
// 1. 已经是按用户展开的记录(含 professionId 和 userName)
|
|
393
402
|
// 2. 按专业展开的记录(含 users 数组)
|
|
@@ -404,7 +413,9 @@ watch(
|
|
|
404
413
|
majorCode,
|
|
405
414
|
userType: x.userType || u.userType || '',
|
|
406
415
|
userId: x.id,
|
|
407
|
-
userName: x.
|
|
416
|
+
userName: x.userName || x.username || '-',
|
|
417
|
+
username: x.userName || x.username || '-',
|
|
418
|
+
nickName: x.nickName || x.name || x.label || '-'
|
|
408
419
|
}))
|
|
409
420
|
}
|
|
410
421
|
// 已是单条用户记录
|
|
@@ -416,7 +427,9 @@ watch(
|
|
|
416
427
|
majorCode: u.majorCode || '',
|
|
417
428
|
userType: u.userType || '',
|
|
418
429
|
userId: u.userId || '',
|
|
419
|
-
userName: u.userName || u.
|
|
430
|
+
userName: u.userName || u.username || '-',
|
|
431
|
+
username: u.userName || u.username || '-',
|
|
432
|
+
nickName: u.nickName || u.name || u.userNames || '-'
|
|
420
433
|
}]
|
|
421
434
|
})
|
|
422
435
|
getPageList()
|