@pangu-backend-ui/user-core 0.0.11 → 0.0.13
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/index.js +128 -124
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/types/components/UserDetail/UserDetailDialog.vue.d.ts +1 -1
- package/types/views/list.vue.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as U, ref as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { PgTable as
|
|
1
|
+
import { defineComponent as U, ref as w, inject as S, resolveComponent as p, openBlock as m, createElementBlock as V, Fragment as I, createTextVNode as _, toDisplayString as h, createBlock as b, withCtx as t, createVNode as e, createCommentVNode as k, watch as $, computed as E, resolveDirective as z, withDirectives as O, renderList as A, KeepAlive as B, resolveDynamicComponent as F, createElementVNode as x, unref as H, pushScopeId as Y, popScopeId as j } from "vue";
|
|
2
|
+
import { defineStore as G } from "pinia";
|
|
3
|
+
import { PgTable as K } from "@pangu-backend-ui/common";
|
|
4
4
|
const W = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "container"
|
|
@@ -17,7 +17,7 @@ const W = {
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
setup(a) {
|
|
20
|
-
const o = a, l =
|
|
20
|
+
const o = a, l = w({
|
|
21
21
|
plainMobile: null,
|
|
22
22
|
loading: !1
|
|
23
23
|
}), r = S("http");
|
|
@@ -29,29 +29,29 @@ const W = {
|
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
31
|
return (s, c) => {
|
|
32
|
-
const
|
|
33
|
-
return o.maskMobile != null ? (
|
|
34
|
-
l.value.plainMobile == null ? (
|
|
35
|
-
|
|
36
|
-
], 64)) : (
|
|
37
|
-
|
|
32
|
+
const d = p("View"), f = p("el-icon"), D = p("Loading");
|
|
33
|
+
return o.maskMobile != null ? (m(), V("div", W, [
|
|
34
|
+
l.value.plainMobile == null ? (m(), V(I, { key: 0 }, [
|
|
35
|
+
_(h(o.maskMobile), 1)
|
|
36
|
+
], 64)) : (m(), V(I, { key: 1 }, [
|
|
37
|
+
_(h(l.value.plainMobile), 1)
|
|
38
38
|
], 64)),
|
|
39
|
-
l.value.plainMobile == null && !l.value.loading && o.userId != null ? (
|
|
39
|
+
l.value.plainMobile == null && !l.value.loading && o.userId != null ? (m(), b(f, {
|
|
40
40
|
key: 2,
|
|
41
41
|
class: "view-icon",
|
|
42
42
|
onClick: v
|
|
43
43
|
}, {
|
|
44
44
|
default: t(() => [
|
|
45
|
-
e(
|
|
45
|
+
e(d)
|
|
46
46
|
]),
|
|
47
47
|
_: 1
|
|
48
48
|
})) : k("", !0),
|
|
49
|
-
l.value.loading ? (
|
|
49
|
+
l.value.loading ? (m(), b(f, {
|
|
50
50
|
key: 3,
|
|
51
51
|
class: "is-loading view-icon"
|
|
52
52
|
}, {
|
|
53
53
|
default: t(() => [
|
|
54
|
-
e(
|
|
54
|
+
e(D)
|
|
55
55
|
]),
|
|
56
56
|
_: 1
|
|
57
57
|
})) : k("", !0)
|
|
@@ -69,7 +69,7 @@ const M = (a, o) => {
|
|
|
69
69
|
a.component("PgUserMobile", C);
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
function
|
|
72
|
+
function Q() {
|
|
73
73
|
const a = S("http");
|
|
74
74
|
function o(l) {
|
|
75
75
|
return a == null ? void 0 : a.get(`/api/user/${l}`);
|
|
@@ -78,50 +78,50 @@ function K() {
|
|
|
78
78
|
getUserDetail: o
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const X = /* @__PURE__ */ U({
|
|
82
82
|
__name: "LoginHistory",
|
|
83
83
|
props: ["userId"],
|
|
84
84
|
setup(a) {
|
|
85
|
-
const l =
|
|
85
|
+
const l = w({
|
|
86
86
|
userId: a.userId,
|
|
87
87
|
loginTimeStart: null,
|
|
88
88
|
loginTimeEnd: null
|
|
89
|
-
}), r =
|
|
90
|
-
|
|
89
|
+
}), r = w([]);
|
|
90
|
+
$(r, (c) => {
|
|
91
91
|
c ? (l.value.loginTimeStart = c[0], l.value.loginTimeEnd = c[1]) : (l.value.loginTimeStart = null, l.value.loginTimeEnd = null);
|
|
92
92
|
});
|
|
93
|
-
const v =
|
|
93
|
+
const v = w();
|
|
94
94
|
function s() {
|
|
95
95
|
v.value.search();
|
|
96
96
|
}
|
|
97
|
-
return (c,
|
|
98
|
-
const
|
|
99
|
-
return
|
|
100
|
-
e(
|
|
97
|
+
return (c, d) => {
|
|
98
|
+
const f = p("el-date-picker"), D = p("el-button"), g = p("el-space"), i = p("el-table-column"), u = p("el-tag"), T = p("pg-table");
|
|
99
|
+
return m(), V(I, null, [
|
|
100
|
+
e(g, null, {
|
|
101
101
|
default: t(() => [
|
|
102
|
-
e(
|
|
102
|
+
e(f, {
|
|
103
103
|
modelValue: r.value,
|
|
104
|
-
"onUpdate:modelValue":
|
|
104
|
+
"onUpdate:modelValue": d[0] || (d[0] = (n) => r.value = n),
|
|
105
105
|
type: "datetimerange",
|
|
106
106
|
"range-separator": "-",
|
|
107
107
|
"start-placeholder": "登录开始时间",
|
|
108
108
|
"end-placeholder": "登录结束时间",
|
|
109
109
|
clearable: ""
|
|
110
110
|
}, null, 8, ["modelValue"]),
|
|
111
|
-
e(
|
|
111
|
+
e(D, {
|
|
112
112
|
type: "primary",
|
|
113
113
|
icon: "search",
|
|
114
114
|
onClick: s
|
|
115
115
|
}, {
|
|
116
116
|
default: t(() => [
|
|
117
|
-
|
|
117
|
+
_("搜索")
|
|
118
118
|
]),
|
|
119
119
|
_: 1
|
|
120
120
|
})
|
|
121
121
|
]),
|
|
122
122
|
_: 1
|
|
123
123
|
}),
|
|
124
|
-
e(
|
|
124
|
+
e(T, {
|
|
125
125
|
ref_key: "historiesTable",
|
|
126
126
|
ref: v,
|
|
127
127
|
style: { "margin-top": "10px" },
|
|
@@ -153,43 +153,43 @@ const Q = /* @__PURE__ */ U({
|
|
|
153
153
|
"show-overflow-tooltip": ""
|
|
154
154
|
}, {
|
|
155
155
|
default: t(({ row: n }) => [
|
|
156
|
-
n.method === "SMS" ? (
|
|
156
|
+
n.method === "SMS" ? (m(), b(u, {
|
|
157
157
|
key: 0,
|
|
158
158
|
type: "primary",
|
|
159
159
|
size: "small"
|
|
160
160
|
}, {
|
|
161
161
|
default: t(() => [
|
|
162
|
-
|
|
162
|
+
_("短信登录")
|
|
163
163
|
]),
|
|
164
164
|
_: 1
|
|
165
165
|
})) : k("", !0),
|
|
166
|
-
n.method === "THIRD_PLATFORM" ? (
|
|
166
|
+
n.method === "THIRD_PLATFORM" ? (m(), b(u, {
|
|
167
167
|
key: 1,
|
|
168
168
|
type: "primary",
|
|
169
169
|
size: "small"
|
|
170
170
|
}, {
|
|
171
171
|
default: t(() => [
|
|
172
|
-
|
|
172
|
+
_("第三方平台")
|
|
173
173
|
]),
|
|
174
174
|
_: 1
|
|
175
175
|
})) : k("", !0),
|
|
176
|
-
n.method === "UNIVERIFY" ? (
|
|
176
|
+
n.method === "UNIVERIFY" ? (m(), b(u, {
|
|
177
177
|
key: 2,
|
|
178
178
|
type: "primary",
|
|
179
179
|
size: "small"
|
|
180
180
|
}, {
|
|
181
181
|
default: t(() => [
|
|
182
|
-
|
|
182
|
+
_("一键登录")
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
185
|
})) : k("", !0),
|
|
186
|
-
n.method === "PASSWORD" ? (
|
|
186
|
+
n.method === "PASSWORD" ? (m(), b(u, {
|
|
187
187
|
key: 3,
|
|
188
188
|
type: "primary",
|
|
189
189
|
size: "small"
|
|
190
190
|
}, {
|
|
191
191
|
default: t(() => [
|
|
192
|
-
|
|
192
|
+
_("帐号密码")
|
|
193
193
|
]),
|
|
194
194
|
_: 1
|
|
195
195
|
})) : k("", !0)
|
|
@@ -220,56 +220,56 @@ const Q = /* @__PURE__ */ U({
|
|
|
220
220
|
], 64);
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
}), N =
|
|
223
|
+
}), N = G("pg-user-core-config-store", () => {
|
|
224
224
|
const a = [];
|
|
225
225
|
return a.push({
|
|
226
226
|
name: "登录历史",
|
|
227
227
|
code: "LOGIN_HISTORY",
|
|
228
|
-
component:
|
|
228
|
+
component: X
|
|
229
229
|
}), {
|
|
230
|
-
userDetailDialogTabs:
|
|
230
|
+
userDetailDialogTabs: E(() => a)
|
|
231
231
|
};
|
|
232
232
|
}), L = /* @__PURE__ */ U({
|
|
233
233
|
__name: "UserDetailDialog",
|
|
234
234
|
setup(a, { expose: o }) {
|
|
235
|
-
const { getUserDetail: l } =
|
|
235
|
+
const { getUserDetail: l } = Q(), r = N(), v = w(!1), s = w(), c = w({
|
|
236
236
|
activeName: r.userDetailDialogTabs[0].code,
|
|
237
237
|
tabs: []
|
|
238
|
-
}),
|
|
239
|
-
function
|
|
240
|
-
var
|
|
241
|
-
|
|
242
|
-
s.value =
|
|
238
|
+
}), d = w(!1);
|
|
239
|
+
function f(D, g, i) {
|
|
240
|
+
var u;
|
|
241
|
+
d.value = !0, (u = l(D)) == null || u.then((T) => {
|
|
242
|
+
s.value = T.data, d.value = !1, v.value = !0, g && (c.value.activeName = g), c.value.tabs.length = 0, c.value.tabs = c.value.tabs.concat(r.userDetailDialogTabs), i && (c.value.tabs = c.value.tabs.concat(i));
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
return o({
|
|
246
|
-
show:
|
|
247
|
-
}), (
|
|
248
|
-
const i = p("el-descriptions-item"),
|
|
249
|
-
return O((
|
|
246
|
+
show: f
|
|
247
|
+
}), (D, g) => {
|
|
248
|
+
const i = p("el-descriptions-item"), u = p("el-descriptions"), T = p("el-tab-pane"), n = p("el-tabs"), P = p("el-dialog"), R = z("loading");
|
|
249
|
+
return O((m(), b(P, {
|
|
250
250
|
modelValue: v.value,
|
|
251
|
-
"onUpdate:modelValue":
|
|
251
|
+
"onUpdate:modelValue": g[1] || (g[1] = (y) => v.value = y),
|
|
252
252
|
title: "用户详情",
|
|
253
253
|
width: "1300"
|
|
254
254
|
}, {
|
|
255
255
|
default: t(() => [
|
|
256
|
-
e(
|
|
256
|
+
e(u, { border: "" }, {
|
|
257
257
|
default: t(() => [
|
|
258
258
|
e(i, { label: "用户编号" }, {
|
|
259
259
|
default: t(() => [
|
|
260
|
-
|
|
260
|
+
_(h(s.value.id), 1)
|
|
261
261
|
]),
|
|
262
262
|
_: 1
|
|
263
263
|
}),
|
|
264
264
|
e(i, { label: "用户昵称" }, {
|
|
265
265
|
default: t(() => [
|
|
266
|
-
|
|
266
|
+
_(h(s.value.nickname), 1)
|
|
267
267
|
]),
|
|
268
268
|
_: 1
|
|
269
269
|
}),
|
|
270
270
|
e(i, { label: "手机号码" }, {
|
|
271
271
|
default: t(() => [
|
|
272
|
-
(
|
|
272
|
+
(m(), b(C, {
|
|
273
273
|
"mask-mobile": s.value.mobile,
|
|
274
274
|
"user-id": s.value.id,
|
|
275
275
|
key: s.value.id
|
|
@@ -279,152 +279,156 @@ const Q = /* @__PURE__ */ U({
|
|
|
279
279
|
}),
|
|
280
280
|
e(i, { label: "邀请编码" }, {
|
|
281
281
|
default: t(() => [
|
|
282
|
-
|
|
282
|
+
_(h(s.value.inviteCode), 1)
|
|
283
283
|
]),
|
|
284
284
|
_: 1
|
|
285
285
|
}),
|
|
286
286
|
e(i, { label: "活动时间" }, {
|
|
287
287
|
default: t(() => [
|
|
288
|
-
|
|
288
|
+
_(h(s.value.touchTime), 1)
|
|
289
289
|
]),
|
|
290
290
|
_: 1
|
|
291
291
|
}),
|
|
292
292
|
e(i, { label: "注册时间" }, {
|
|
293
293
|
default: t(() => [
|
|
294
|
-
|
|
294
|
+
_(h(s.value.createdTime), 1)
|
|
295
295
|
]),
|
|
296
296
|
_: 1
|
|
297
297
|
}),
|
|
298
298
|
e(i, { label: "最后登陆" }, {
|
|
299
299
|
default: t(() => [
|
|
300
|
-
|
|
300
|
+
_(h(s.value.lastLoginTime), 1)
|
|
301
301
|
]),
|
|
302
302
|
_: 1
|
|
303
303
|
}),
|
|
304
304
|
e(i, { label: "最后更新" }, {
|
|
305
305
|
default: t(() => [
|
|
306
|
-
|
|
306
|
+
_(h(s.value.updatedTime), 1)
|
|
307
307
|
]),
|
|
308
308
|
_: 1
|
|
309
309
|
}),
|
|
310
310
|
e(i, { label: "上级用户" }, {
|
|
311
311
|
default: t(() => [
|
|
312
|
-
|
|
312
|
+
_(h(s.value.parentId), 1)
|
|
313
313
|
]),
|
|
314
314
|
_: 1
|
|
315
315
|
}),
|
|
316
316
|
e(i, { label: "邀请关系" }, {
|
|
317
317
|
default: t(() => [
|
|
318
|
-
|
|
318
|
+
_(h(s.value.relationPath), 1)
|
|
319
319
|
]),
|
|
320
320
|
_: 1
|
|
321
321
|
})
|
|
322
322
|
]),
|
|
323
323
|
_: 1
|
|
324
324
|
}),
|
|
325
|
-
|
|
325
|
+
(m(), b(n, {
|
|
326
326
|
modelValue: c.value.activeName,
|
|
327
|
-
"onUpdate:modelValue":
|
|
327
|
+
"onUpdate:modelValue": g[0] || (g[0] = (y) => c.value.activeName = y),
|
|
328
|
+
key: `usr_tab_${s.value.id}`,
|
|
328
329
|
style: { "margin-top": "10px" },
|
|
329
330
|
type: "border-card"
|
|
330
331
|
}, {
|
|
331
332
|
default: t(() => [
|
|
332
|
-
(
|
|
333
|
-
label:
|
|
334
|
-
name:
|
|
335
|
-
key: `user_detail_dialog_${
|
|
333
|
+
(m(!0), V(I, null, A(c.value.tabs, (y, ue) => (m(), b(T, {
|
|
334
|
+
label: y.name,
|
|
335
|
+
name: y.code,
|
|
336
|
+
key: `user_detail_dialog_${y.code}`
|
|
336
337
|
}, {
|
|
337
338
|
default: t(() => [
|
|
338
|
-
(
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
(m(), b(B, null, [
|
|
340
|
+
c.value.activeName == y.code ? (m(), b(F(y.component), {
|
|
341
|
+
key: `ud_tab_${y.code}`,
|
|
342
|
+
userId: s.value.id
|
|
343
|
+
}, null, 8, ["userId"])) : k("", !0)
|
|
344
|
+
], 1024))
|
|
341
345
|
]),
|
|
342
346
|
_: 2
|
|
343
347
|
}, 1032, ["label", "name"]))), 128))
|
|
344
348
|
]),
|
|
345
349
|
_: 1
|
|
346
|
-
}, 8, ["modelValue"])
|
|
350
|
+
}, 8, ["modelValue"]))
|
|
347
351
|
]),
|
|
348
352
|
_: 1
|
|
349
353
|
}, 8, ["modelValue"])), [
|
|
350
|
-
[R,
|
|
354
|
+
[R, d.value]
|
|
351
355
|
]);
|
|
352
356
|
};
|
|
353
357
|
}
|
|
354
|
-
}),
|
|
358
|
+
}), Z = {
|
|
355
359
|
install: (a) => {
|
|
356
360
|
a.component("PgUserDetailDialog", L);
|
|
357
361
|
}
|
|
358
|
-
},
|
|
362
|
+
}, ee = [
|
|
359
363
|
J,
|
|
360
|
-
|
|
361
|
-
],
|
|
364
|
+
Z
|
|
365
|
+
], le = (a) => (Y("data-v-391c43be"), a = a(), j(), a), te = { class: "page-layout" }, oe = { style: { "margin-top": "10px" } }, ae = /* @__PURE__ */ le(() => /* @__PURE__ */ x("template", { "slot-scope": "{row}" }, null, -1)), ne = /* @__PURE__ */ U({
|
|
362
366
|
__name: "list",
|
|
363
367
|
setup(a) {
|
|
364
|
-
const o =
|
|
368
|
+
const o = w({
|
|
365
369
|
id: null,
|
|
366
370
|
parentId: null,
|
|
367
371
|
phone: null,
|
|
368
372
|
nicekname: null,
|
|
369
373
|
inviteCode: null
|
|
370
|
-
}), l =
|
|
374
|
+
}), l = w(null);
|
|
371
375
|
function r() {
|
|
372
376
|
l.value.search();
|
|
373
377
|
}
|
|
374
|
-
const v =
|
|
378
|
+
const v = w();
|
|
375
379
|
function s(c) {
|
|
376
380
|
v.value.show(c.id);
|
|
377
381
|
}
|
|
378
|
-
return (c,
|
|
379
|
-
const
|
|
380
|
-
return
|
|
381
|
-
x("div",
|
|
382
|
+
return (c, d) => {
|
|
383
|
+
const f = p("el-input"), D = p("el-button"), g = p("el-space"), i = p("el-card"), u = p("el-table-column"), T = p("el-image");
|
|
384
|
+
return m(), V(I, null, [
|
|
385
|
+
x("div", te, [
|
|
382
386
|
e(i, null, {
|
|
383
387
|
default: t(() => [
|
|
384
|
-
e(
|
|
388
|
+
e(g, null, {
|
|
385
389
|
default: t(() => [
|
|
386
|
-
e(
|
|
390
|
+
e(f, {
|
|
387
391
|
modelValue: o.value.id,
|
|
388
|
-
"onUpdate:modelValue":
|
|
392
|
+
"onUpdate:modelValue": d[0] || (d[0] = (n) => o.value.id = n),
|
|
389
393
|
placeholder: "ID",
|
|
390
394
|
style: { width: "100px" },
|
|
391
395
|
clearable: ""
|
|
392
396
|
}, null, 8, ["modelValue"]),
|
|
393
|
-
e(
|
|
397
|
+
e(f, {
|
|
394
398
|
modelValue: o.value.parentId,
|
|
395
|
-
"onUpdate:modelValue":
|
|
399
|
+
"onUpdate:modelValue": d[1] || (d[1] = (n) => o.value.parentId = n),
|
|
396
400
|
placeholder: "父用户ID",
|
|
397
401
|
style: { width: "100px" },
|
|
398
402
|
clearable: ""
|
|
399
403
|
}, null, 8, ["modelValue"]),
|
|
400
|
-
e(
|
|
404
|
+
e(f, {
|
|
401
405
|
modelValue: o.value.phone,
|
|
402
|
-
"onUpdate:modelValue":
|
|
406
|
+
"onUpdate:modelValue": d[2] || (d[2] = (n) => o.value.phone = n),
|
|
403
407
|
placeholder: "手机号",
|
|
404
408
|
style: { width: "120px" },
|
|
405
409
|
clearable: ""
|
|
406
410
|
}, null, 8, ["modelValue"]),
|
|
407
|
-
e(
|
|
411
|
+
e(f, {
|
|
408
412
|
modelValue: o.value.nicekname,
|
|
409
|
-
"onUpdate:modelValue":
|
|
413
|
+
"onUpdate:modelValue": d[3] || (d[3] = (n) => o.value.nicekname = n),
|
|
410
414
|
placeholder: "昵称",
|
|
411
415
|
style: { width: "150px" },
|
|
412
416
|
clearable: ""
|
|
413
417
|
}, null, 8, ["modelValue"]),
|
|
414
|
-
e(
|
|
418
|
+
e(f, {
|
|
415
419
|
modelValue: o.value.inviteCode,
|
|
416
|
-
"onUpdate:modelValue":
|
|
420
|
+
"onUpdate:modelValue": d[4] || (d[4] = (n) => o.value.inviteCode = n),
|
|
417
421
|
placeholder: "邀请码",
|
|
418
422
|
style: { width: "100px" },
|
|
419
423
|
clearable: ""
|
|
420
424
|
}, null, 8, ["modelValue"]),
|
|
421
|
-
e(
|
|
425
|
+
e(D, {
|
|
422
426
|
type: "primary",
|
|
423
427
|
icon: "search",
|
|
424
428
|
onClick: r
|
|
425
429
|
}, {
|
|
426
430
|
default: t(() => [
|
|
427
|
-
|
|
431
|
+
_("搜索")
|
|
428
432
|
]),
|
|
429
433
|
_: 1
|
|
430
434
|
})
|
|
@@ -434,22 +438,22 @@ const Q = /* @__PURE__ */ U({
|
|
|
434
438
|
]),
|
|
435
439
|
_: 1
|
|
436
440
|
}),
|
|
437
|
-
x("div",
|
|
438
|
-
e(H(
|
|
441
|
+
x("div", oe, [
|
|
442
|
+
e(H(K), {
|
|
439
443
|
ref_key: "userTable",
|
|
440
444
|
ref: l,
|
|
441
445
|
"data-url": "/api/user/page",
|
|
442
446
|
condition: o.value,
|
|
443
|
-
onRowDbClick:
|
|
447
|
+
onRowDbClick: d[5] || (d[5] = (n) => s(n))
|
|
444
448
|
}, {
|
|
445
449
|
columns: t(() => [
|
|
446
|
-
e(
|
|
450
|
+
e(u, {
|
|
447
451
|
prop: "id",
|
|
448
452
|
label: "UID",
|
|
449
453
|
width: "80",
|
|
450
454
|
align: "center"
|
|
451
455
|
}),
|
|
452
|
-
e(
|
|
456
|
+
e(u, {
|
|
453
457
|
prop: "mobile",
|
|
454
458
|
label: "手机",
|
|
455
459
|
width: "115",
|
|
@@ -457,7 +461,7 @@ const Q = /* @__PURE__ */ U({
|
|
|
457
461
|
"show-overflow-tooltip": ""
|
|
458
462
|
}, {
|
|
459
463
|
default: t((n) => [
|
|
460
|
-
(
|
|
464
|
+
(m(), b(C, {
|
|
461
465
|
"mask-mobile": n.row.mobile,
|
|
462
466
|
"user-id": n.row.id,
|
|
463
467
|
key: n.row.id
|
|
@@ -465,28 +469,28 @@ const Q = /* @__PURE__ */ U({
|
|
|
465
469
|
]),
|
|
466
470
|
_: 1
|
|
467
471
|
}),
|
|
468
|
-
e(
|
|
472
|
+
e(u, {
|
|
469
473
|
prop: "username",
|
|
470
474
|
label: "用户名",
|
|
471
475
|
width: "110",
|
|
472
476
|
align: "left",
|
|
473
477
|
"show-overflow-tooltip": ""
|
|
474
478
|
}),
|
|
475
|
-
e(
|
|
479
|
+
e(u, {
|
|
476
480
|
prop: "nickname",
|
|
477
481
|
label: "昵称",
|
|
478
482
|
width: "110",
|
|
479
483
|
align: "left",
|
|
480
484
|
"show-overflow-tooltip": ""
|
|
481
485
|
}),
|
|
482
|
-
e(
|
|
486
|
+
e(u, {
|
|
483
487
|
prop: "inviteCode",
|
|
484
488
|
label: "邀请码",
|
|
485
489
|
width: "90",
|
|
486
490
|
align: "center",
|
|
487
491
|
"show-overflow-tooltip": ""
|
|
488
492
|
}),
|
|
489
|
-
e(
|
|
493
|
+
e(u, {
|
|
490
494
|
prop: "avatar",
|
|
491
495
|
label: "头像",
|
|
492
496
|
width: "60",
|
|
@@ -494,7 +498,7 @@ const Q = /* @__PURE__ */ U({
|
|
|
494
498
|
"show-overflow-tooltip": ""
|
|
495
499
|
}, {
|
|
496
500
|
default: t((n) => [
|
|
497
|
-
e(
|
|
501
|
+
e(T, {
|
|
498
502
|
fit: "cover",
|
|
499
503
|
size: 30,
|
|
500
504
|
src: n.row.avatar,
|
|
@@ -504,48 +508,48 @@ const Q = /* @__PURE__ */ U({
|
|
|
504
508
|
]),
|
|
505
509
|
_: 1
|
|
506
510
|
}),
|
|
507
|
-
e(
|
|
511
|
+
e(u, {
|
|
508
512
|
prop: "parentId",
|
|
509
513
|
label: "上级ID",
|
|
510
514
|
width: "80",
|
|
511
515
|
align: "left",
|
|
512
516
|
"show-overflow-tooltip": ""
|
|
513
517
|
}),
|
|
514
|
-
e(
|
|
518
|
+
e(u, {
|
|
515
519
|
prop: "relationPath",
|
|
516
520
|
label: "邀请关系",
|
|
517
521
|
"min-width": "150",
|
|
518
522
|
align: "left",
|
|
519
523
|
"show-overflow-tooltip": ""
|
|
520
524
|
}),
|
|
521
|
-
e(
|
|
525
|
+
e(u, {
|
|
522
526
|
prop: "blackUnlockTime",
|
|
523
527
|
label: "黑名单解锁",
|
|
524
528
|
width: "145",
|
|
525
529
|
align: "left",
|
|
526
530
|
"show-overflow-tooltip": ""
|
|
527
531
|
}),
|
|
528
|
-
e(
|
|
532
|
+
e(u, {
|
|
529
533
|
prop: "lastLoginTime",
|
|
530
534
|
label: "最后登录时间",
|
|
531
535
|
width: "145",
|
|
532
536
|
align: "center",
|
|
533
537
|
"show-overflow-tooltip": ""
|
|
534
538
|
}),
|
|
535
|
-
e(
|
|
539
|
+
e(u, {
|
|
536
540
|
prop: "createdTime",
|
|
537
541
|
label: "创建时间",
|
|
538
542
|
width: "145",
|
|
539
543
|
align: "center",
|
|
540
544
|
"show-overflow-tooltip": ""
|
|
541
545
|
}),
|
|
542
|
-
e(
|
|
546
|
+
e(u, {
|
|
543
547
|
label: "操作",
|
|
544
548
|
width: "220",
|
|
545
549
|
fixed: "right"
|
|
546
550
|
}, {
|
|
547
551
|
default: t(() => [
|
|
548
|
-
|
|
552
|
+
ae
|
|
549
553
|
]),
|
|
550
554
|
_: 1
|
|
551
555
|
})
|
|
@@ -562,7 +566,7 @@ const Q = /* @__PURE__ */ U({
|
|
|
562
566
|
};
|
|
563
567
|
}
|
|
564
568
|
});
|
|
565
|
-
const
|
|
569
|
+
const ie = /* @__PURE__ */ M(ne, [["__scopeId", "data-v-391c43be"]]), re = {
|
|
566
570
|
install: (a, o) => {
|
|
567
571
|
let l = o.router, r = l.getRoutes().find((v) => v.path == "/");
|
|
568
572
|
r && r.meta && l.addRoute({
|
|
@@ -573,23 +577,23 @@ const ne = /* @__PURE__ */ M(ae, [["__scopeId", "data-v-391c43be"]]), ie = {
|
|
|
573
577
|
children: [{
|
|
574
578
|
path: "list",
|
|
575
579
|
name: "UserList",
|
|
576
|
-
component:
|
|
580
|
+
component: ie
|
|
577
581
|
}]
|
|
578
582
|
});
|
|
579
583
|
}
|
|
580
|
-
},
|
|
584
|
+
}, se = (a, o) => {
|
|
581
585
|
const l = N();
|
|
582
586
|
if (o.userDetailDialogTabs && o.userDetailDialogTabs.length)
|
|
583
587
|
for (let r of o.userDetailDialogTabs)
|
|
584
588
|
l.userDetailDialogTabs.push(r);
|
|
585
|
-
|
|
586
|
-
},
|
|
587
|
-
install:
|
|
589
|
+
ee.forEach((r) => a.use(r)), a.use(re, o);
|
|
590
|
+
}, me = {
|
|
591
|
+
install: se
|
|
588
592
|
};
|
|
589
593
|
export {
|
|
590
|
-
|
|
594
|
+
Z as UserDetailDialog,
|
|
591
595
|
J as UserMobileComp,
|
|
592
|
-
|
|
593
|
-
|
|
596
|
+
me as default,
|
|
597
|
+
se as install,
|
|
594
598
|
N as useUserCoreConfigStore
|
|
595
599
|
};
|
package/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("@pangu-backend-ui/common")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","@pangu-backend-ui/common"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m["pg-user-core"]={},m.Vue,m.pinia,m.common))})(this,function(m,e,y,D){"use strict";const T={key:0,class:"container"},B=e.defineComponent({__name:"UserMobileComponent",props:{userId:{type:Number,default:null},maskMobile:{type:String,default:null}},setup(l){const t=l,o=e.ref({plainMobile:null,loading:!1}),i=e.inject("http");function p(){o.value.plainMobile==null&&(o.value.loading=!0,i==null||i.get(`/api/user/${t.userId}/plainmobile`).then(r=>{o.value.plainMobile=r.data,o.value.loading=!1}).finally(()=>{o.value.loading=!1}))}return(r,d)=>{const c=e.resolveComponent("View"),_=e.resolveComponent("el-icon"),g=e.resolveComponent("Loading");return t.maskMobile!=null?(e.openBlock(),e.createElementBlock("div",T,[o.value.plainMobile==null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.maskMobile),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.value.plainMobile),1)],64)),o.value.plainMobile==null&&!o.value.loading&&t.userId!=null?(e.openBlock(),e.createBlock(_,{key:2,class:"view-icon",onClick:p},{default:e.withCtx(()=>[e.createVNode(c)]),_:1})):e.createCommentVNode("",!0),o.value.loading?(e.openBlock(),e.createBlock(_,{key:3,class:"is-loading view-icon"},{default:e.withCtx(()=>[e.createVNode(g)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),q="",N=(l,t)=>{const o=l.__vccOpts||l;for(const[i,p]of t)o[i]=p;return o},V=N(B,[["__scopeId","data-v-76c9c9ae"]]),u={install:l=>{l.component("PgUserMobile",V)}};function S(){const l=e.inject("http");function t(o){return l==null?void 0:l.get(`/api/user/${o}`)}return{getUserDetail:t}}const U=e.defineComponent({__name:"LoginHistory",props:["userId"],setup(l){const t=l,o=e.ref({userId:t.userId,loginTimeStart:null,loginTimeEnd:null}),i=e.ref([]);e.watch(i,d=>{d?(o.value.loginTimeStart=d[0],o.value.loginTimeEnd=d[1]):(o.value.loginTimeStart=null,o.value.loginTimeEnd=null)});const p=e.ref();function r(){p.value.search()}return(d,c)=>{const _=e.resolveComponent("el-date-picker"),g=e.resolveComponent("el-button"),f=e.resolveComponent("el-space"),n=e.resolveComponent("el-table-column"),s=e.resolveComponent("el-tag"),h=e.resolveComponent("pg-table");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=a=>i.value=a),type:"datetimerange","range-separator":"-","start-placeholder":"登录开始时间","end-placeholder":"登录结束时间",clearable:""},null,8,["modelValue"]),e.createVNode(g,{type:"primary",icon:"search",onClick:r},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1})]),_:1}),e.createVNode(h,{ref_key:"historiesTable",ref:p,style:{"margin-top":"10px"},"data-url":"/api/user/login-history",condition:o.value},{columns:e.withCtx(()=>[e.createVNode(n,{prop:"createdTime",label:"登录时间",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"ip",label:"登录IP",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"runtimeName",label:"运行容器",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{label:"登录方式",align:"center","show-overflow-tooltip":""},{default:e.withCtx(({row:a})=>[a.method==="SMS"?(e.openBlock(),e.createBlock(s,{key:0,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("短信登录")]),_:1})):e.createCommentVNode("",!0),a.method==="THIRD_PLATFORM"?(e.openBlock(),e.createBlock(s,{key:1,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("第三方平台")]),_:1})):e.createCommentVNode("",!0),a.method==="UNIVERIFY"?(e.openBlock(),e.createBlock(s,{key:2,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("一键登录")]),_:1})):e.createCommentVNode("",!0),a.method==="PASSWORD"?(e.openBlock(),e.createBlock(s,{key:3,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("帐号密码")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{prop:"thirdPlatformName",label:"第三方登录",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"versionCode",label:"版本代码",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"versionName",label:"版本名称",align:"center","show-overflow-tooltip":""})]),_:1},8,["condition"])],64)}}}),w=y.defineStore("pg-user-core-config-store",()=>{const l=[];return l.push({name:"登录历史",code:"LOGIN_HISTORY",component:U}),{userDetailDialogTabs:e.computed(()=>l)}}),C=e.defineComponent({__name:"UserDetailDialog",setup(l,{expose:t}){const{getUserDetail:o}=S(),i=w(),p=e.ref(!1),r=e.ref(),d=e.ref({activeName:i.userDetailDialogTabs[0].code,tabs:[]}),c=e.ref(!1);function _(g,f){var n;c.value=!0,(n=o(g))==null||n.then(s=>{r.value=s.data,c.value=!1,p.value=!0,d.value.tabs.length=0,d.value.tabs=d.value.tabs.concat(i.userDetailDialogTabs),f&&(d.value.tabs=d.value.tabs.concat(f))})}return t({show:_}),(g,f)=>{const n=e.resolveComponent("el-descriptions-item"),s=e.resolveComponent("el-descriptions"),h=e.resolveComponent("el-tab-pane"),a=e.resolveComponent("el-tabs"),z=e.resolveComponent("el-dialog"),j=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(z,{modelValue:p.value,"onUpdate:modelValue":f[1]||(f[1]=b=>p.value=b),title:"用户详情",width:"1300"},{default:e.withCtx(()=>[e.createVNode(s,{border:""},{default:e.withCtx(()=>[e.createVNode(n,{label:"用户编号"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.id),1)]),_:1}),e.createVNode(n,{label:"用户昵称"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.nickname),1)]),_:1}),e.createVNode(n,{label:"手机号码"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(V,{"mask-mobile":r.value.mobile,"user-id":r.value.id,key:r.value.id},null,8,["mask-mobile","user-id"]))]),_:1}),e.createVNode(n,{label:"邀请编码"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.inviteCode),1)]),_:1}),e.createVNode(n,{label:"活动时间"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.touchTime),1)]),_:1}),e.createVNode(n,{label:"注册时间"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.createdTime),1)]),_:1}),e.createVNode(n,{label:"最后登陆"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.lastLoginTime),1)]),_:1}),e.createVNode(n,{label:"最后更新"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.updatedTime),1)]),_:1}),e.createVNode(n,{label:"上级用户"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.parentId),1)]),_:1}),e.createVNode(n,{label:"邀请关系"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.relationPath),1)]),_:1})]),_:1}),e.createVNode(a,{modelValue:d.value.activeName,"onUpdate:modelValue":f[0]||(f[0]=b=>d.value.activeName=b),style:{"margin-top":"10px"},type:"border-card"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tabs,(b,A)=>(e.openBlock(),e.createBlock(h,{label:b.name,name:b.code,key:`user_detail_dialog_${b.code}`},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b.component),{userId:r.value.id},null,8,["userId"]))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])),[[j,c.value]])}}}),k={install:l=>{l.component("PgUserDetailDialog",C)}},I=[u,k],M=l=>(e.pushScopeId("data-v-391c43be"),l=l(),e.popScopeId(),l),E={class:"page-layout"},L={style:{"margin-top":"10px"}},P=M(()=>e.createElementVNode("template",{"slot-scope":"{row}"},null,-1)),R=e.defineComponent({__name:"list",setup(l){const t=e.ref({id:null,parentId:null,phone:null,nicekname:null,inviteCode:null}),o=e.ref(null);function i(){o.value.search()}const p=e.ref();function r(d){p.value.show(d.id)}return(d,c)=>{const _=e.resolveComponent("el-input"),g=e.resolveComponent("el-button"),f=e.resolveComponent("el-space"),n=e.resolveComponent("el-card"),s=e.resolveComponent("el-table-column"),h=e.resolveComponent("el-image");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",E,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:t.value.id,"onUpdate:modelValue":c[0]||(c[0]=a=>t.value.id=a),placeholder:"ID",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.parentId,"onUpdate:modelValue":c[1]||(c[1]=a=>t.value.parentId=a),placeholder:"父用户ID",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.phone,"onUpdate:modelValue":c[2]||(c[2]=a=>t.value.phone=a),placeholder:"手机号",style:{width:"120px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.nicekname,"onUpdate:modelValue":c[3]||(c[3]=a=>t.value.nicekname=a),placeholder:"昵称",style:{width:"150px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.inviteCode,"onUpdate:modelValue":c[4]||(c[4]=a=>t.value.inviteCode=a),placeholder:"邀请码",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(g,{type:"primary",icon:"search",onClick:i},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1})]),_:1})]),_:1}),e.createElementVNode("div",L,[e.createVNode(e.unref(D.PgTable),{ref_key:"userTable",ref:o,"data-url":"/api/user/page",condition:t.value,onRowDbClick:c[5]||(c[5]=a=>r(a))},{columns:e.withCtx(()=>[e.createVNode(s,{prop:"id",label:"UID",width:"80",align:"center"}),e.createVNode(s,{prop:"mobile",label:"手机",width:"115",align:"left","show-overflow-tooltip":""},{default:e.withCtx(a=>[(e.openBlock(),e.createBlock(V,{"mask-mobile":a.row.mobile,"user-id":a.row.id,key:a.row.id},null,8,["mask-mobile","user-id"]))]),_:1}),e.createVNode(s,{prop:"username",label:"用户名",width:"110",align:"left","show-overflow-tooltip":""}),e.createVNode(s,{prop:"nickname",label:"昵称",width:"110",align:"left","show-overflow-tooltip":""}),e.createVNode(s,{prop:"inviteCode",label:"邀请码",width:"90",align:"center","show-overflow-tooltip":""}),e.createVNode(s,{prop:"avatar",label:"头像",width:"60",align:"center","show-overflow-tooltip":""},{default:e.withCtx(a=>[e.createVNode(h,{fit:"cover",size:30,src:a.row.avatar,"preview-teleported":"","preview-src-list":[a.row.avatar]},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(s,{prop:"parentId",label:"上级ID",width:"80",align:"left","show-overflow-tooltip":""}),e.createVNode(s,{prop:"relationPath",label:"邀请关系","min-width":"150",align:"left","show-overflow-tooltip":""}),e.createVNode(s,{prop:"blackUnlockTime",label:"黑名单解锁",width:"145",align:"left","show-overflow-tooltip":""}),e.createVNode(s,{prop:"lastLoginTime",label:"最后登录时间",width:"145",align:"center","show-overflow-tooltip":""}),e.createVNode(s,{prop:"createdTime",label:"创建时间",width:"145",align:"center","show-overflow-tooltip":""}),e.createVNode(s,{label:"操作",width:"220",fixed:"right"},{default:e.withCtx(()=>[P]),_:1})]),_:1},8,["condition"])])]),e.createVNode(C,{ref_key:"userDetailDialog",ref:p},null,512)],64)}}}),H="",F=N(R,[["__scopeId","data-v-391c43be"]]),$={install:(l,t)=>{let o=t.router,i=o.getRoutes().find(p=>p.path=="/");i&&i.meta&&o.addRoute({path:"/user",name:"User",redirect:"/user/list",component:i.meta.commonLayout,children:[{path:"list",name:"UserList",component:F}]})}},x=(l,t)=>{const o=w();if(t.userDetailDialogTabs&&t.userDetailDialogTabs.length)for(let i of t.userDetailDialogTabs)o.userDetailDialogTabs.push(i);I.forEach(i=>l.use(i)),l.use($,t)},O={install:x};m.UserDetailDialog=k,m.UserMobileComp=u,m.default=O,m.install=x,m.useUserCoreConfigStore=w,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("@pangu-backend-ui/common")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","@pangu-backend-ui/common"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m["pg-user-core"]={},m.Vue,m.pinia,m.common))})(this,function(m,e,x,D){"use strict";const T={key:0,class:"container"},B=e.defineComponent({__name:"UserMobileComponent",props:{userId:{type:Number,default:null},maskMobile:{type:String,default:null}},setup(l){const t=l,o=e.ref({plainMobile:null,loading:!1}),r=e.inject("http");function p(){o.value.plainMobile==null&&(o.value.loading=!0,r==null||r.get(`/api/user/${t.userId}/plainmobile`).then(i=>{o.value.plainMobile=i.data,o.value.loading=!1}).finally(()=>{o.value.loading=!1}))}return(i,d)=>{const s=e.resolveComponent("View"),_=e.resolveComponent("el-icon"),b=e.resolveComponent("Loading");return t.maskMobile!=null?(e.openBlock(),e.createElementBlock("div",T,[o.value.plainMobile==null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.maskMobile),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.value.plainMobile),1)],64)),o.value.plainMobile==null&&!o.value.loading&&t.userId!=null?(e.openBlock(),e.createBlock(_,{key:2,class:"view-icon",onClick:p},{default:e.withCtx(()=>[e.createVNode(s)]),_:1})):e.createCommentVNode("",!0),o.value.loading?(e.openBlock(),e.createBlock(_,{key:3,class:"is-loading view-icon"},{default:e.withCtx(()=>[e.createVNode(b)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),q="",N=(l,t)=>{const o=l.__vccOpts||l;for(const[r,p]of t)o[r]=p;return o},V=N(B,[["__scopeId","data-v-76c9c9ae"]]),u={install:l=>{l.component("PgUserMobile",V)}};function S(){const l=e.inject("http");function t(o){return l==null?void 0:l.get(`/api/user/${o}`)}return{getUserDetail:t}}const U=e.defineComponent({__name:"LoginHistory",props:["userId"],setup(l){const t=l,o=e.ref({userId:t.userId,loginTimeStart:null,loginTimeEnd:null}),r=e.ref([]);e.watch(r,d=>{d?(o.value.loginTimeStart=d[0],o.value.loginTimeEnd=d[1]):(o.value.loginTimeStart=null,o.value.loginTimeEnd=null)});const p=e.ref();function i(){p.value.search()}return(d,s)=>{const _=e.resolveComponent("el-date-picker"),b=e.resolveComponent("el-button"),f=e.resolveComponent("el-space"),n=e.resolveComponent("el-table-column"),c=e.resolveComponent("el-tag"),h=e.resolveComponent("pg-table");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=a=>r.value=a),type:"datetimerange","range-separator":"-","start-placeholder":"登录开始时间","end-placeholder":"登录结束时间",clearable:""},null,8,["modelValue"]),e.createVNode(b,{type:"primary",icon:"search",onClick:i},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1})]),_:1}),e.createVNode(h,{ref_key:"historiesTable",ref:p,style:{"margin-top":"10px"},"data-url":"/api/user/login-history",condition:o.value},{columns:e.withCtx(()=>[e.createVNode(n,{prop:"createdTime",label:"登录时间",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"ip",label:"登录IP",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"runtimeName",label:"运行容器",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{label:"登录方式",align:"center","show-overflow-tooltip":""},{default:e.withCtx(({row:a})=>[a.method==="SMS"?(e.openBlock(),e.createBlock(c,{key:0,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("短信登录")]),_:1})):e.createCommentVNode("",!0),a.method==="THIRD_PLATFORM"?(e.openBlock(),e.createBlock(c,{key:1,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("第三方平台")]),_:1})):e.createCommentVNode("",!0),a.method==="UNIVERIFY"?(e.openBlock(),e.createBlock(c,{key:2,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("一键登录")]),_:1})):e.createCommentVNode("",!0),a.method==="PASSWORD"?(e.openBlock(),e.createBlock(c,{key:3,type:"primary",size:"small"},{default:e.withCtx(()=>[e.createTextVNode("帐号密码")]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(n,{prop:"thirdPlatformName",label:"第三方登录",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"versionCode",label:"版本代码",align:"center","show-overflow-tooltip":""}),e.createVNode(n,{prop:"versionName",label:"版本名称",align:"center","show-overflow-tooltip":""})]),_:1},8,["condition"])],64)}}}),w=x.defineStore("pg-user-core-config-store",()=>{const l=[];return l.push({name:"登录历史",code:"LOGIN_HISTORY",component:U}),{userDetailDialogTabs:e.computed(()=>l)}}),C=e.defineComponent({__name:"UserDetailDialog",setup(l,{expose:t}){const{getUserDetail:o}=S(),r=w(),p=e.ref(!1),i=e.ref(),d=e.ref({activeName:r.userDetailDialogTabs[0].code,tabs:[]}),s=e.ref(!1);function _(b,f,n){var c;s.value=!0,(c=o(b))==null||c.then(h=>{i.value=h.data,s.value=!1,p.value=!0,f&&(d.value.activeName=f),d.value.tabs.length=0,d.value.tabs=d.value.tabs.concat(r.userDetailDialogTabs),n&&(d.value.tabs=d.value.tabs.concat(n))})}return t({show:_}),(b,f)=>{const n=e.resolveComponent("el-descriptions-item"),c=e.resolveComponent("el-descriptions"),h=e.resolveComponent("el-tab-pane"),a=e.resolveComponent("el-tabs"),z=e.resolveComponent("el-dialog"),j=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(z,{modelValue:p.value,"onUpdate:modelValue":f[1]||(f[1]=g=>p.value=g),title:"用户详情",width:"1300"},{default:e.withCtx(()=>[e.createVNode(c,{border:""},{default:e.withCtx(()=>[e.createVNode(n,{label:"用户编号"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.id),1)]),_:1}),e.createVNode(n,{label:"用户昵称"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.nickname),1)]),_:1}),e.createVNode(n,{label:"手机号码"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(V,{"mask-mobile":i.value.mobile,"user-id":i.value.id,key:i.value.id},null,8,["mask-mobile","user-id"]))]),_:1}),e.createVNode(n,{label:"邀请编码"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.inviteCode),1)]),_:1}),e.createVNode(n,{label:"活动时间"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.touchTime),1)]),_:1}),e.createVNode(n,{label:"注册时间"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.createdTime),1)]),_:1}),e.createVNode(n,{label:"最后登陆"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.lastLoginTime),1)]),_:1}),e.createVNode(n,{label:"最后更新"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.updatedTime),1)]),_:1}),e.createVNode(n,{label:"上级用户"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.parentId),1)]),_:1}),e.createVNode(n,{label:"邀请关系"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value.relationPath),1)]),_:1})]),_:1}),(e.openBlock(),e.createBlock(a,{modelValue:d.value.activeName,"onUpdate:modelValue":f[0]||(f[0]=g=>d.value.activeName=g),key:`usr_tab_${i.value.id}`,style:{"margin-top":"10px"},type:"border-card"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.tabs,(g,H)=>(e.openBlock(),e.createBlock(h,{label:g.name,name:g.code,key:`user_detail_dialog_${g.code}`},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[d.value.activeName==g.code?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.component),{key:`ud_tab_${g.code}`,userId:i.value.id},null,8,["userId"])):e.createCommentVNode("",!0)],1024))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"]))]),_:1},8,["modelValue"])),[[j,s.value]])}}}),k={install:l=>{l.component("PgUserDetailDialog",C)}},I=[u,k],M=l=>(e.pushScopeId("data-v-391c43be"),l=l(),e.popScopeId(),l),E={class:"page-layout"},L={style:{"margin-top":"10px"}},P=M(()=>e.createElementVNode("template",{"slot-scope":"{row}"},null,-1)),R=e.defineComponent({__name:"list",setup(l){const t=e.ref({id:null,parentId:null,phone:null,nicekname:null,inviteCode:null}),o=e.ref(null);function r(){o.value.search()}const p=e.ref();function i(d){p.value.show(d.id)}return(d,s)=>{const _=e.resolveComponent("el-input"),b=e.resolveComponent("el-button"),f=e.resolveComponent("el-space"),n=e.resolveComponent("el-card"),c=e.resolveComponent("el-table-column"),h=e.resolveComponent("el-image");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",E,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:t.value.id,"onUpdate:modelValue":s[0]||(s[0]=a=>t.value.id=a),placeholder:"ID",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.parentId,"onUpdate:modelValue":s[1]||(s[1]=a=>t.value.parentId=a),placeholder:"父用户ID",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.phone,"onUpdate:modelValue":s[2]||(s[2]=a=>t.value.phone=a),placeholder:"手机号",style:{width:"120px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.nicekname,"onUpdate:modelValue":s[3]||(s[3]=a=>t.value.nicekname=a),placeholder:"昵称",style:{width:"150px"},clearable:""},null,8,["modelValue"]),e.createVNode(_,{modelValue:t.value.inviteCode,"onUpdate:modelValue":s[4]||(s[4]=a=>t.value.inviteCode=a),placeholder:"邀请码",style:{width:"100px"},clearable:""},null,8,["modelValue"]),e.createVNode(b,{type:"primary",icon:"search",onClick:r},{default:e.withCtx(()=>[e.createTextVNode("搜索")]),_:1})]),_:1})]),_:1}),e.createElementVNode("div",L,[e.createVNode(e.unref(D.PgTable),{ref_key:"userTable",ref:o,"data-url":"/api/user/page",condition:t.value,onRowDbClick:s[5]||(s[5]=a=>i(a))},{columns:e.withCtx(()=>[e.createVNode(c,{prop:"id",label:"UID",width:"80",align:"center"}),e.createVNode(c,{prop:"mobile",label:"手机",width:"115",align:"left","show-overflow-tooltip":""},{default:e.withCtx(a=>[(e.openBlock(),e.createBlock(V,{"mask-mobile":a.row.mobile,"user-id":a.row.id,key:a.row.id},null,8,["mask-mobile","user-id"]))]),_:1}),e.createVNode(c,{prop:"username",label:"用户名",width:"110",align:"left","show-overflow-tooltip":""}),e.createVNode(c,{prop:"nickname",label:"昵称",width:"110",align:"left","show-overflow-tooltip":""}),e.createVNode(c,{prop:"inviteCode",label:"邀请码",width:"90",align:"center","show-overflow-tooltip":""}),e.createVNode(c,{prop:"avatar",label:"头像",width:"60",align:"center","show-overflow-tooltip":""},{default:e.withCtx(a=>[e.createVNode(h,{fit:"cover",size:30,src:a.row.avatar,"preview-teleported":"","preview-src-list":[a.row.avatar]},null,8,["src","preview-src-list"])]),_:1}),e.createVNode(c,{prop:"parentId",label:"上级ID",width:"80",align:"left","show-overflow-tooltip":""}),e.createVNode(c,{prop:"relationPath",label:"邀请关系","min-width":"150",align:"left","show-overflow-tooltip":""}),e.createVNode(c,{prop:"blackUnlockTime",label:"黑名单解锁",width:"145",align:"left","show-overflow-tooltip":""}),e.createVNode(c,{prop:"lastLoginTime",label:"最后登录时间",width:"145",align:"center","show-overflow-tooltip":""}),e.createVNode(c,{prop:"createdTime",label:"创建时间",width:"145",align:"center","show-overflow-tooltip":""}),e.createVNode(c,{label:"操作",width:"220",fixed:"right"},{default:e.withCtx(()=>[P]),_:1})]),_:1},8,["condition"])])]),e.createVNode(C,{ref_key:"userDetailDialog",ref:p},null,512)],64)}}}),A="",$=N(R,[["__scopeId","data-v-391c43be"]]),F={install:(l,t)=>{let o=t.router,r=o.getRoutes().find(p=>p.path=="/");r&&r.meta&&o.addRoute({path:"/user",name:"User",redirect:"/user/list",component:r.meta.commonLayout,children:[{path:"list",name:"UserList",component:$}]})}},y=(l,t)=>{const o=w();if(t.userDetailDialogTabs&&t.userDetailDialogTabs.length)for(let r of t.userDetailDialogTabs)o.userDetailDialogTabs.push(r);I.forEach(r=>l.use(r)),l.use(F,t)},O={install:y};m.UserDetailDialog=k,m.UserMobileComp=u,m.default=O,m.install=y,m.useUserCoreConfigStore=w,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -139,7 +139,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
139
139
|
}[];
|
|
140
140
|
}>;
|
|
141
141
|
loading: import("vue").Ref<boolean>;
|
|
142
|
-
show: (userId: number, tabs?: UserDetailDialogTabConfig[]) => void;
|
|
142
|
+
show: (userId: number, activeTab?: string, tabs?: UserDetailDialogTabConfig[]) => void;
|
|
143
143
|
UserMobile: import("vue").DefineComponent<{
|
|
144
144
|
userId: {
|
|
145
145
|
type: NumberConstructor;
|
|
@@ -266,7 +266,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
266
266
|
}[];
|
|
267
267
|
}>;
|
|
268
268
|
loading: import("vue").Ref<boolean>;
|
|
269
|
-
show: (userId: number, tabs?: import("../types/UserDetailDialogTabConfig").default[] | undefined) => void;
|
|
269
|
+
show: (userId: number, activeTab?: string | undefined, tabs?: import("../types/UserDetailDialogTabConfig").default[] | undefined) => void;
|
|
270
270
|
UserMobile: import("vue").DefineComponent<{
|
|
271
271
|
userId: {
|
|
272
272
|
type: NumberConstructor;
|