@pangu-backend-ui/user-core 0.0.19 → 0.0.21

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 CHANGED
@@ -1,10 +1,11 @@
1
- import { defineComponent as P, ref as k, inject as R, resolveComponent as s, openBlock as p, createElementBlock as T, Fragment as M, createTextVNode as c, toDisplayString as h, createBlock as I, withCtx as l, createVNode as e, createCommentVNode as C, watch as j, shallowRef as Z, computed as ee, renderSlot as J, renderList as q, resolveDirective as F, createSlots as le, withDirectives as K, KeepAlive as te, resolveDynamicComponent as oe, onMounted as ae, createElementVNode as Y, unref as ne, pushScopeId as ie, popScopeId as se } from "vue";
2
- import { defineStore as ue } from "pinia";
1
+ import { defineComponent as M, ref as v, inject as N, resolveComponent as n, openBlock as c, createElementBlock as S, Fragment as $, createTextVNode as p, toDisplayString as D, createBlock as k, withCtx as l, createVNode as e, createCommentVNode as I, watch as j, shallowRef as Q, computed as X, renderList as O, createElementVNode as R, nextTick as Z, resolveDirective as H, createSlots as ee, withDirectives as q, KeepAlive as le, resolveDynamicComponent as oe, onMounted as te, renderSlot as ae, unref as ne, pushScopeId as ie, popScopeId as ue } from "vue";
2
+ import { defineStore as se } from "pinia";
3
+ import { ElMessage as Y } from "element-plus";
3
4
  import { PgTable as re } from "@pangu-backend-ui/common";
4
5
  const de = {
5
6
  key: 0,
6
7
  class: "container"
7
- }, ce = /* @__PURE__ */ P({
8
+ }, ce = /* @__PURE__ */ M({
8
9
  __name: "UserMobileComponent",
9
10
  props: {
10
11
  userId: {
@@ -16,189 +17,189 @@ const de = {
16
17
  default: null
17
18
  }
18
19
  },
19
- setup(m) {
20
- const d = m, i = k({
20
+ setup(d) {
21
+ const u = d, i = v({
21
22
  plainMobile: null,
22
23
  loading: !1
23
- }), u = R("http");
24
- function _() {
25
- i.value.plainMobile == null && (i.value.loading = !0, u == null || u.get(`/api/user/${d.userId}/plainmobile`).then((n) => {
26
- i.value.plainMobile = n.data, i.value.loading = !1;
24
+ }), a = N("http");
25
+ function r() {
26
+ i.value.plainMobile == null && (i.value.loading = !0, a == null || a.get(`/api/user/${u.userId}/plainmobile`).then((o) => {
27
+ i.value.plainMobile = o.data, i.value.loading = !1;
27
28
  }).finally(() => {
28
29
  i.value.loading = !1;
29
30
  }));
30
31
  }
31
- return (n, v) => {
32
- const r = s("View"), D = s("el-icon"), w = s("Loading");
33
- return d.maskMobile != null ? (p(), T("div", de, [
34
- i.value.plainMobile == null ? (p(), T(M, { key: 0 }, [
35
- c(h(d.maskMobile), 1)
36
- ], 64)) : (p(), T(M, { key: 1 }, [
37
- c(h(i.value.plainMobile), 1)
32
+ return (o, b) => {
33
+ const m = n("View"), V = n("el-icon"), g = n("Loading");
34
+ return u.maskMobile != null ? (c(), S("div", de, [
35
+ i.value.plainMobile == null ? (c(), S($, { key: 0 }, [
36
+ p(D(u.maskMobile), 1)
37
+ ], 64)) : (c(), S($, { key: 1 }, [
38
+ p(D(i.value.plainMobile), 1)
38
39
  ], 64)),
39
- i.value.plainMobile == null && !i.value.loading && d.userId != null && n.$hasPer("DECRYPT_MOBILE") ? (p(), I(D, {
40
+ i.value.plainMobile == null && !i.value.loading && u.userId != null && o.$hasPer("DECRYPT_MOBILE") ? (c(), k(V, {
40
41
  key: 2,
41
42
  class: "view-icon",
42
- onClick: _
43
+ onClick: r
43
44
  }, {
44
45
  default: l(() => [
45
- e(r)
46
+ e(m)
46
47
  ]),
47
48
  _: 1
48
- })) : C("", !0),
49
- i.value.loading ? (p(), I(D, {
49
+ })) : I("", !0),
50
+ i.value.loading ? (c(), k(V, {
50
51
  key: 3,
51
52
  class: "is-loading view-icon"
52
53
  }, {
53
54
  default: l(() => [
54
- e(w)
55
+ e(g)
55
56
  ]),
56
57
  _: 1
57
- })) : C("", !0)
58
- ])) : C("", !0);
58
+ })) : I("", !0)
59
+ ])) : I("", !0);
59
60
  };
60
61
  }
61
62
  });
62
- const G = (m, d) => {
63
- const i = m.__vccOpts || m;
64
- for (const [u, _] of d)
65
- i[u] = _;
63
+ const G = (d, u) => {
64
+ const i = d.__vccOpts || d;
65
+ for (const [a, r] of u)
66
+ i[a] = r;
66
67
  return i;
67
- }, E = /* @__PURE__ */ G(ce, [["__scopeId", "data-v-dd075891"]]), pe = {
68
- install: (m) => {
69
- m.component("PgUserMobile", E);
68
+ }, A = /* @__PURE__ */ G(ce, [["__scopeId", "data-v-dd075891"]]), pe = {
69
+ install: (d) => {
70
+ d.component("PgUserMobile", A);
70
71
  }
71
- }, me = /* @__PURE__ */ P({
72
+ }, me = /* @__PURE__ */ M({
72
73
  __name: "LoginHistory",
73
74
  props: ["userId"],
74
- setup(m) {
75
- const i = k({
76
- userId: m.userId,
75
+ setup(d) {
76
+ const i = v({
77
+ userId: d.userId,
77
78
  loginTimeStart: null,
78
79
  loginTimeEnd: null
79
- }), u = k([]);
80
- j(u, (v) => {
81
- v ? (i.value.loginTimeStart = v[0], i.value.loginTimeEnd = v[1]) : (i.value.loginTimeStart = null, i.value.loginTimeEnd = null);
80
+ }), a = v([]);
81
+ j(a, (b) => {
82
+ b ? (i.value.loginTimeStart = b[0], i.value.loginTimeEnd = b[1]) : (i.value.loginTimeStart = null, i.value.loginTimeEnd = null);
82
83
  });
83
- const _ = k();
84
- function n() {
85
- _.value.search();
84
+ const r = v();
85
+ function o() {
86
+ r.value.search();
86
87
  }
87
- return (v, r) => {
88
- const D = s("el-date-picker"), w = s("el-button"), b = s("el-space"), g = s("el-table-column"), f = s("el-tag"), S = s("pg-table");
89
- return p(), T(M, null, [
90
- e(b, null, {
88
+ return (b, m) => {
89
+ const V = n("el-date-picker"), g = n("el-button"), h = n("el-space"), _ = n("el-table-column"), y = n("el-tag"), f = n("pg-table");
90
+ return c(), S($, null, [
91
+ e(h, null, {
91
92
  default: l(() => [
92
- e(D, {
93
- modelValue: u.value,
94
- "onUpdate:modelValue": r[0] || (r[0] = (a) => u.value = a),
93
+ e(V, {
94
+ modelValue: a.value,
95
+ "onUpdate:modelValue": m[0] || (m[0] = (t) => a.value = t),
95
96
  type: "datetimerange",
96
97
  "range-separator": "-",
97
98
  "start-placeholder": "登录开始时间",
98
99
  "end-placeholder": "登录结束时间",
99
100
  clearable: ""
100
101
  }, null, 8, ["modelValue"]),
101
- e(w, {
102
+ e(g, {
102
103
  type: "primary",
103
104
  icon: "search",
104
- onClick: n
105
+ onClick: o
105
106
  }, {
106
107
  default: l(() => [
107
- c("搜索")
108
+ p("搜索")
108
109
  ]),
109
110
  _: 1
110
111
  })
111
112
  ]),
112
113
  _: 1
113
114
  }),
114
- e(S, {
115
+ e(f, {
115
116
  ref_key: "historiesTable",
116
- ref: _,
117
+ ref: r,
117
118
  style: { "margin-top": "10px" },
118
119
  "data-url": "/api/user/login-history",
119
120
  condition: i.value
120
121
  }, {
121
122
  columns: l(() => [
122
- e(g, {
123
+ e(_, {
123
124
  prop: "createdTime",
124
125
  label: "登录时间",
125
126
  align: "center",
126
127
  "show-overflow-tooltip": ""
127
128
  }),
128
- e(g, {
129
+ e(_, {
129
130
  prop: "ip",
130
131
  label: "登录IP",
131
132
  align: "center",
132
133
  "show-overflow-tooltip": ""
133
134
  }),
134
- e(g, {
135
+ e(_, {
135
136
  prop: "runtimeName",
136
137
  label: "运行容器",
137
138
  align: "center",
138
139
  "show-overflow-tooltip": ""
139
140
  }),
140
- e(g, {
141
+ e(_, {
141
142
  label: "登录方式",
142
143
  align: "center",
143
144
  "show-overflow-tooltip": ""
144
145
  }, {
145
- default: l(({ row: a }) => [
146
- a.method === "SMS" ? (p(), I(f, {
146
+ default: l(({ row: t }) => [
147
+ t.method === "SMS" ? (c(), k(y, {
147
148
  key: 0,
148
149
  type: "primary",
149
150
  size: "small"
150
151
  }, {
151
152
  default: l(() => [
152
- c("短信登录")
153
+ p("短信登录")
153
154
  ]),
154
155
  _: 1
155
- })) : C("", !0),
156
- a.method === "THIRD_PLATFORM" ? (p(), I(f, {
156
+ })) : I("", !0),
157
+ t.method === "THIRD_PLATFORM" ? (c(), k(y, {
157
158
  key: 1,
158
159
  type: "primary",
159
160
  size: "small"
160
161
  }, {
161
162
  default: l(() => [
162
- c("第三方平台")
163
+ p("第三方平台")
163
164
  ]),
164
165
  _: 1
165
- })) : C("", !0),
166
- a.method === "UNIVERIFY" ? (p(), I(f, {
166
+ })) : I("", !0),
167
+ t.method === "UNIVERIFY" ? (c(), k(y, {
167
168
  key: 2,
168
169
  type: "primary",
169
170
  size: "small"
170
171
  }, {
171
172
  default: l(() => [
172
- c("一键登录")
173
+ p("一键登录")
173
174
  ]),
174
175
  _: 1
175
- })) : C("", !0),
176
- a.method === "PASSWORD" ? (p(), I(f, {
176
+ })) : I("", !0),
177
+ t.method === "PASSWORD" ? (c(), k(y, {
177
178
  key: 3,
178
179
  type: "primary",
179
180
  size: "small"
180
181
  }, {
181
182
  default: l(() => [
182
- c("帐号密码")
183
+ p("帐号密码")
183
184
  ]),
184
185
  _: 1
185
- })) : C("", !0)
186
+ })) : I("", !0)
186
187
  ]),
187
188
  _: 1
188
189
  }),
189
- e(g, {
190
+ e(_, {
190
191
  prop: "thirdPlatformName",
191
192
  label: "第三方登录",
192
193
  align: "center",
193
194
  "show-overflow-tooltip": ""
194
195
  }),
195
- e(g, {
196
+ e(_, {
196
197
  prop: "versionCode",
197
198
  label: "版本代码",
198
199
  align: "center",
199
200
  "show-overflow-tooltip": ""
200
201
  }),
201
- e(g, {
202
+ e(_, {
202
203
  prop: "versionName",
203
204
  label: "版本名称",
204
205
  align: "center",
@@ -210,400 +211,459 @@ const G = (m, d) => {
210
211
  ], 64);
211
212
  };
212
213
  }
213
- }), W = ue("pg-user-core-config-store", () => {
214
- const m = [];
215
- return m.push({
214
+ }), J = se("pg-user-core-config-store", () => {
215
+ const d = [];
216
+ return d.push({
216
217
  name: "登录历史",
217
218
  code: "LOGIN_HISTORY",
218
- component: Z(me)
219
+ component: Q(me)
219
220
  }), {
220
- userDetailDialogTabs: ee(() => m)
221
+ userDetailDialogTabs: X(() => d)
221
222
  };
222
- }), Q = /* @__PURE__ */ P({
223
- __name: "AddBlacklistComp",
224
- props: {
225
- hiddenEntranceSlot: {
226
- type: Boolean,
227
- default: !1
228
- },
229
- userId: {
230
- type: Number,
231
- required: !1
232
- }
233
- },
223
+ }), _e = { style: { width: "100%", position: "relative", display: "flex", "flex-direction": "column", gap: "5px" } }, fe = /* @__PURE__ */ M({
224
+ __name: "AddFunctionDisableDialog",
234
225
  emits: ["success"],
235
- setup(m, { expose: d, emit: i }) {
236
- const u = m, _ = R("http"), n = k(!1);
237
- let v = k(null);
238
- function r(t) {
239
- n.value = !0;
240
- const o = t ?? u.userId;
241
- if (!o)
242
- throw Error("未设置用户ID");
243
- v.value = o, g(v.value);
226
+ setup(d, { expose: u, emit: i }) {
227
+ const a = v(!1), r = N("http"), o = v({
228
+ functionCode: null,
229
+ expiry: null,
230
+ remark: null,
231
+ disableForever: !0
232
+ }), b = {
233
+ functionCode: [{ required: !0, message: "请选择禁用功能" }],
234
+ expiry: [{
235
+ validator: (f, t, T) => {
236
+ o.value.disableForever && (t == null && T(new Error("请选择结束时间")), new Date(t).getTime() <= new Date().getTime() && T(new Error("结束时间不能小于当前时间"))), T();
237
+ }
238
+ }]
239
+ }, m = v({});
240
+ async function V() {
241
+ const f = await (r == null ? void 0 : r.get("/api/user/function-disable/functions"));
242
+ m.value = f == null ? void 0 : f.data;
244
243
  }
245
- const D = k({
246
- description: [{ required: !0, message: "请输入加入黑名单的说明" }],
247
- unlockTime: [
248
- { required: !0, message: "解锁时间不能为空" }
249
- ]
250
- }), w = k({
251
- userId: null,
252
- unlockTime: null,
253
- permissions: [],
254
- description: null
255
- }), b = k();
256
- function g(t) {
257
- _ == null || _.get(`/api/user/${t}/blacklist-and-all-permission-codes`).then((o) => {
258
- var x, $, L, B, N;
259
- (x = o.data) != null && x.info && (($ = o.data) != null && $.info.allowPermissionCodes && (w.value.permissions = JSON.parse((L = o.data) == null ? void 0 : L.info.allowPermissionCodes)), w.value.userId = (B = o.data) == null ? void 0 : B.info.userId, w.value.unlockTime = o.data.info.unlockTime, w.value.description = o.data.info.description), b.value = (N = o.data) == null ? void 0 : N.permissionCodes;
244
+ const g = v();
245
+ function h() {
246
+ g.value.validate(async (f) => {
247
+ f && (await (r == null ? void 0 : r.post(`/api/user/${_}/function-disable`, o.value)), Y.success("添加成功"), a.value = !1, o.value.functionCode = null, o.value.expiry = null, o.value.remark = null, o.value.disableForever = !0, i("success"));
260
248
  });
261
249
  }
262
- const f = k();
263
- function S() {
264
- var t;
265
- (t = f.value) == null || t.resetFields();
266
- }
267
- function a() {
268
- var t;
269
- (t = f.value) == null || t.validate((o, x) => {
270
- o && (_ == null || _.post(`/api/user/${v.value}/blacklist`, w.value).then(($) => {
271
- n.value = !1, i("success");
272
- }));
273
- });
250
+ let _ = null;
251
+ function y(f) {
252
+ a.value = !0, _ = f, V();
274
253
  }
275
- const U = [
276
- {
277
- text: "三天",
278
- value: () => {
279
- const t = new Date();
280
- return t.setDate(t.getDate() + 3), t;
281
- }
282
- },
283
- {
284
- text: "七天",
285
- value: () => {
286
- const t = new Date();
287
- return t.setDate(t.getDate() + 7), t;
288
- }
289
- },
290
- {
291
- text: "十五天",
292
- value: () => {
293
- const t = new Date();
294
- return t.setDate(t.getDate() + 15), t;
295
- }
296
- },
297
- {
298
- text: "一个月",
299
- value: () => {
300
- const t = new Date();
301
- return t.setMonth(t.getMonth() + 1), t;
302
- }
303
- },
304
- {
305
- text: "三个月",
306
- value: () => {
307
- const t = new Date();
308
- return t.setMonth(t.getMonth() + 3), t;
309
- }
310
- },
311
- {
312
- text: "六个月",
313
- value: () => {
314
- const t = new Date();
315
- return t.setMonth(t.getMonth() + 6), t;
316
- }
317
- },
318
- {
319
- text: "永久",
320
- value: () => {
321
- const t = new Date();
322
- return t.setFullYear(t.getFullYear() + 100), t;
323
- }
324
- }
325
- ];
326
- return d({
327
- show: r
328
- }), (t, o) => {
329
- const x = s("el-button"), $ = s("el-date-picker"), L = s("el-form-item"), B = s("el-checkbox"), N = s("el-checkbox-group"), V = s("el-input"), A = s("el-form"), O = s("el-dialog");
330
- return p(), T(M, null, [
331
- u.hiddenEntranceSlot ? C("", !0) : J(t.$slots, "default", { key: 0 }, () => [
332
- e(x, {
333
- icon: "lock",
334
- type: "warning",
335
- onClick: o[0] || (o[0] = (y) => r())
254
+ return u({
255
+ show: y
256
+ }), (f, t) => {
257
+ const T = n("el-option"), s = n("el-select"), w = n("el-form-item"), x = n("el-checkbox"), C = n("el-date-picker"), P = n("el-input"), L = n("el-form"), E = n("el-button"), z = n("el-dialog");
258
+ return c(), k(z, {
259
+ modelValue: a.value,
260
+ "onUpdate:modelValue": t[4] || (t[4] = (U) => a.value = U),
261
+ title: "添加功能禁用",
262
+ width: "500px",
263
+ "append-to-body": ""
264
+ }, {
265
+ footer: l(() => [
266
+ e(E, {
267
+ type: "primary",
268
+ size: "mini",
269
+ onClick: h
336
270
  }, {
337
271
  default: l(() => [
338
- c("加入黑名单")
272
+ p("提交")
339
273
  ]),
340
274
  _: 1
341
275
  })
342
276
  ]),
343
- e(O, {
344
- modelValue: n.value,
345
- "onUpdate:modelValue": o[4] || (o[4] = (y) => n.value = y),
346
- onClosed: S,
347
- title: "黑名单管理",
348
- width: "500"
277
+ default: l(() => [
278
+ e(L, {
279
+ ref_key: "addDisabledFunctionForm",
280
+ ref: g,
281
+ model: o.value,
282
+ rules: b,
283
+ "label-position": "top"
284
+ }, {
285
+ default: l(() => [
286
+ e(w, {
287
+ label: "禁用功能",
288
+ prop: "functionCode"
289
+ }, {
290
+ default: l(() => [
291
+ e(s, {
292
+ modelValue: o.value.functionCode,
293
+ "onUpdate:modelValue": t[0] || (t[0] = (U) => o.value.functionCode = U),
294
+ placeholder: "请选择禁用功能"
295
+ }, {
296
+ default: l(() => [
297
+ (c(!0), S($, null, O(m.value, (U, B) => (c(), k(T, {
298
+ value: B,
299
+ label: U
300
+ }, null, 8, ["value", "label"]))), 256))
301
+ ]),
302
+ _: 1
303
+ }, 8, ["modelValue"])
304
+ ]),
305
+ _: 1
306
+ }),
307
+ e(w, {
308
+ label: "结束时间",
309
+ prop: "endDateTime"
310
+ }, {
311
+ default: l(() => [
312
+ R("div", _e, [
313
+ e(x, {
314
+ modelValue: o.value.disableForever,
315
+ "onUpdate:modelValue": t[1] || (t[1] = (U) => o.value.disableForever = U),
316
+ label: "永久禁用"
317
+ }, null, 8, ["modelValue"]),
318
+ o.value.disableForever ? I("", !0) : (c(), k(C, {
319
+ key: 0,
320
+ type: "datetime",
321
+ modelValue: o.value.expiry,
322
+ "onUpdate:modelValue": t[2] || (t[2] = (U) => o.value.expiry = U),
323
+ placeholder: "请输入结束时间",
324
+ "value-format": "YYYY-MM-DD HH:mm:ss",
325
+ clearable: ""
326
+ }, null, 8, ["modelValue"]))
327
+ ])
328
+ ]),
329
+ _: 1
330
+ }),
331
+ e(w, { label: "备注" }, {
332
+ default: l(() => [
333
+ e(P, {
334
+ type: "textarea",
335
+ placeholder: "请输入备注",
336
+ modelValue: o.value.remark,
337
+ "onUpdate:modelValue": t[3] || (t[3] = (U) => o.value.remark = U)
338
+ }, null, 8, ["modelValue"])
339
+ ]),
340
+ _: 1
341
+ })
342
+ ]),
343
+ _: 1
344
+ }, 8, ["model"])
345
+ ]),
346
+ _: 1
347
+ }, 8, ["modelValue"]);
348
+ };
349
+ }
350
+ }), K = /* @__PURE__ */ M({
351
+ __name: "FunctionDisableTableDialog",
352
+ setup(d, { expose: u }) {
353
+ const i = N("http"), a = v(!1), r = v({
354
+ userId: null
355
+ }), o = v();
356
+ function b(_) {
357
+ a.value = !0, r.value.userId = _, Z(() => o.value.search());
358
+ }
359
+ function m() {
360
+ o.value.search();
361
+ }
362
+ const V = v();
363
+ function g() {
364
+ V.value.show(r.value.userId);
365
+ }
366
+ async function h(_) {
367
+ await (i == null ? void 0 : i.post(`/api/user/function-disable/${_}/enable`)), Y.success("失效成功"), o.value.search();
368
+ }
369
+ return u({
370
+ show: b
371
+ }), (_, y) => {
372
+ const f = n("el-table-column"), t = n("el-tag"), T = n("el-button"), s = n("el-popconfirm"), w = n("pg-table"), x = n("el-dialog");
373
+ return c(), S($, null, [
374
+ e(x, {
375
+ modelValue: a.value,
376
+ "onUpdate:modelValue": y[0] || (y[0] = (C) => a.value = C),
377
+ title: "功能禁用",
378
+ width: "900px",
379
+ "append-to-body": ""
349
380
  }, {
350
381
  footer: l(() => [
351
- e(x, {
382
+ e(T, {
352
383
  type: "primary",
353
- onClick: a
384
+ onClick: g
354
385
  }, {
355
386
  default: l(() => [
356
- c("提交")
387
+ p(" 添加功能禁用 ")
357
388
  ]),
358
389
  _: 1
359
390
  })
360
391
  ]),
361
392
  default: l(() => [
362
- e(A, {
363
- ref_key: "form",
364
- ref: f,
365
- "label-position": "top",
366
- rules: D.value,
367
- model: w.value
393
+ e(w, {
394
+ ref_key: "table",
395
+ ref: o,
396
+ "data-url": "/api/user/function-disable/page-search",
397
+ "fetch-data": !1,
398
+ condition: r.value
368
399
  }, {
369
400
  default: l(() => [
370
- e(L, {
371
- label: "解锁时间",
372
- prop: "unlockTime"
373
- }, {
374
- default: l(() => [
375
- e($, {
376
- type: "datetime",
377
- shortcuts: U,
378
- modelValue: w.value.unlockTime,
379
- "onUpdate:modelValue": o[1] || (o[1] = (y) => w.value.unlockTime = y)
380
- }, null, 8, ["modelValue"])
381
- ]),
382
- _: 1
401
+ e(f, {
402
+ prop: "id",
403
+ label: "ID",
404
+ width: "80",
405
+ align: "center"
406
+ }),
407
+ e(f, {
408
+ label: "功能",
409
+ prop: "functionLabel",
410
+ align: "center",
411
+ width: "120"
383
412
  }),
384
- e(L, {
385
- label: "允许权限",
386
- prop: "allowPermissionCodes"
413
+ e(f, {
414
+ label: "状态",
415
+ width: "80",
416
+ align: "center"
387
417
  }, {
388
- default: l(() => [
389
- e(N, {
390
- modelValue: w.value.permissions,
391
- "onUpdate:modelValue": o[2] || (o[2] = (y) => w.value.permissions = y)
418
+ default: l(({ row: C }) => [
419
+ e(t, {
420
+ size: "mini",
421
+ type: C.expiry == null || new Date(C.expiry).getTime() >= new Date().getTime() ? "success" : "warning"
392
422
  }, {
393
423
  default: l(() => [
394
- (p(!0), T(M, null, q(b.value, (y, z) => (p(), I(B, {
395
- label: z,
396
- key: z
397
- }, {
398
- default: l(() => [
399
- c(h(y), 1)
400
- ]),
401
- _: 2
402
- }, 1032, ["label"]))), 128))
424
+ p(D(C.expiry == null || new Date(C.expiry).getTime() >= new Date().getTime() ? "生效" : "失效"), 1)
403
425
  ]),
404
- _: 1
405
- }, 8, ["modelValue"])
426
+ _: 2
427
+ }, 1032, ["type"])
406
428
  ]),
407
429
  _: 1
408
430
  }),
409
- e(L, {
410
- label: "描述",
411
- prop: "description"
431
+ e(f, {
432
+ label: "结束时间",
433
+ align: "center",
434
+ width: "160"
412
435
  }, {
413
- default: l(() => [
414
- e(V, {
415
- type: "textarea",
416
- modelValue: w.value.description,
417
- "onUpdate:modelValue": o[3] || (o[3] = (y) => w.value.description = y)
418
- }, null, 8, ["modelValue"])
436
+ default: l(({ row: C }) => [
437
+ p(D(C.expiry ? C.expiry : "永久"), 1)
438
+ ]),
439
+ _: 1
440
+ }),
441
+ e(f, {
442
+ prop: "remark",
443
+ label: "备注",
444
+ "show-overflow-tooltip": "",
445
+ align: "center"
446
+ }),
447
+ e(f, {
448
+ prop: "createdTime",
449
+ label: "创建时间",
450
+ width: "160",
451
+ align: "center"
452
+ }),
453
+ e(f, {
454
+ prop: "操作",
455
+ width: "120",
456
+ align: "center"
457
+ }, {
458
+ default: l(({ row: C }) => [
459
+ C.expiry == null || new Date(C.expiry).getTime() >= new Date().getTime() ? (c(), k(s, {
460
+ key: 0,
461
+ title: "确定当前操作吗?",
462
+ onConfirm: (P) => h(C.id)
463
+ }, {
464
+ reference: l(() => [
465
+ e(T, { type: "warning" }, {
466
+ default: l(() => [
467
+ p("失效")
468
+ ]),
469
+ _: 1
470
+ })
471
+ ]),
472
+ _: 2
473
+ }, 1032, ["onConfirm"])) : I("", !0)
419
474
  ]),
420
475
  _: 1
421
476
  })
422
477
  ]),
423
478
  _: 1
424
- }, 8, ["rules", "model"])
479
+ }, 8, ["condition"])
425
480
  ]),
426
481
  _: 1
427
- }, 8, ["modelValue"])
482
+ }, 8, ["modelValue"]),
483
+ e(fe, {
484
+ ref_key: "addFunctionDisableDialog",
485
+ ref: V,
486
+ onSuccess: m
487
+ }, null, 512)
428
488
  ], 64);
429
489
  };
430
490
  }
431
- }), _e = { key: 0 }, H = /* @__PURE__ */ P({
491
+ }), ve = { key: 0 }, W = /* @__PURE__ */ M({
432
492
  __name: "UserDetailDialog",
433
- setup(m, { expose: d }) {
434
- const i = W(), u = R("http"), _ = k(!1), n = k(), v = k(), r = k({
493
+ setup(d, { expose: u }) {
494
+ const i = J(), a = N("http"), r = v(!1), o = v(), b = v(), m = v({
435
495
  activeName: i.userDetailDialogTabs[0].code,
436
496
  tabs: []
437
- }), D = k(!1);
438
- function w(U, t, o) {
439
- D.value = !0, b(U), t && (r.value.activeName = t), r.value.tabs.length = 0, r.value.tabs = r.value.tabs.concat(i.userDetailDialogTabs), o && (r.value.tabs = r.value.tabs.concat(o));
497
+ }), V = v(!1);
498
+ function g(T, s, w) {
499
+ V.value = !0, h(T), s && (m.value.activeName = s), m.value.tabs.length = 0, m.value.tabs = m.value.tabs.concat(i.userDetailDialogTabs), w && (m.value.tabs = m.value.tabs.concat(w));
440
500
  }
441
- function b(U) {
442
- u == null || u.get(`/api/user/${U}`).then((t) => {
443
- n.value = t.data, D.value = !1, _.value = !0, n.value.inBlacklist && g(U);
501
+ function h(T) {
502
+ a == null || a.get(`/api/user/${T}`).then((s) => {
503
+ o.value = s.data, V.value = !1, r.value = !0, o.value.inBlacklist && _(T);
444
504
  });
445
505
  }
446
- function g(U) {
447
- u == null || u.get(`/api/user/${U}/blacklist`).then((t) => {
448
- v.value = t.data;
506
+ function _(T) {
507
+ a == null || a.get(`/api/user/${T}/blacklist`).then((s) => {
508
+ b.value = s.data;
449
509
  });
450
510
  }
451
- const f = k();
452
- function S() {
453
- f.value.show(n.value.id);
511
+ const y = v();
512
+ function f() {
513
+ y.value.show(o.value.id);
454
514
  }
455
- function a() {
456
- n.value = null, v.value = null;
515
+ function t() {
516
+ o.value = null, b.value = null;
457
517
  }
458
- return d({
459
- show: w
460
- }), (U, t) => {
461
- const o = s("el-descriptions-item"), x = s("el-tag"), $ = s("el-descriptions"), L = s("el-tab-pane"), B = s("el-tabs"), N = s("el-button"), V = s("el-dialog"), A = F("loading"), O = F("permission");
462
- return p(), T(M, null, [
463
- e(V, {
464
- modelValue: _.value,
465
- "onUpdate:modelValue": t[1] || (t[1] = (y) => _.value = y),
518
+ return u({
519
+ show: g
520
+ }), (T, s) => {
521
+ const w = n("el-descriptions-item"), x = n("el-tag"), C = n("el-descriptions"), P = n("el-tab-pane"), L = n("el-tabs"), E = n("el-button"), z = n("el-dialog"), U = H("loading"), B = H("permission");
522
+ return c(), S($, null, [
523
+ e(z, {
524
+ modelValue: r.value,
525
+ "onUpdate:modelValue": s[1] || (s[1] = (F) => r.value = F),
466
526
  title: "用户详情",
467
527
  width: "1300",
468
- onClosed: a
469
- }, le({
528
+ onClosed: t
529
+ }, ee({
470
530
  default: l(() => [
471
- n.value ? K((p(), T("div", _e, [
472
- e($, { border: "" }, {
531
+ o.value ? q((c(), S("div", ve, [
532
+ e(C, { border: "" }, {
473
533
  default: l(() => [
474
- e(o, { label: "用户编号" }, {
534
+ e(w, { label: "用户编号" }, {
475
535
  default: l(() => [
476
- c(h(n.value.id), 1)
536
+ p(D(o.value.id), 1)
477
537
  ]),
478
538
  _: 1
479
539
  }),
480
- e(o, { label: "用户昵称" }, {
540
+ e(w, { label: "用户昵称" }, {
481
541
  default: l(() => [
482
- c(h(n.value.nickname), 1)
542
+ p(D(o.value.nickname), 1)
483
543
  ]),
484
544
  _: 1
485
545
  }),
486
- e(o, { label: "手机号码" }, {
546
+ e(w, { label: "手机号码" }, {
487
547
  default: l(() => [
488
- (p(), I(E, {
489
- "mask-mobile": n.value.mobile,
490
- "user-id": n.value.id,
491
- key: n.value.id
548
+ (c(), k(A, {
549
+ "mask-mobile": o.value.mobile,
550
+ "user-id": o.value.id,
551
+ key: o.value.id
492
552
  }, null, 8, ["mask-mobile", "user-id"]))
493
553
  ]),
494
554
  _: 1
495
555
  }),
496
- e(o, { label: "邀请编码" }, {
556
+ e(w, { label: "邀请编码" }, {
497
557
  default: l(() => [
498
- c(h(n.value.inviteCode), 1)
558
+ p(D(o.value.inviteCode), 1)
499
559
  ]),
500
560
  _: 1
501
561
  }),
502
- e(o, { label: "活动时间" }, {
562
+ e(w, { label: "活动时间" }, {
503
563
  default: l(() => [
504
- c(h(n.value.touchTime), 1)
564
+ p(D(o.value.touchTime), 1)
505
565
  ]),
506
566
  _: 1
507
567
  }),
508
- e(o, { label: "注册时间" }, {
568
+ e(w, { label: "注册时间" }, {
509
569
  default: l(() => [
510
- c(h(n.value.createdTime), 1)
570
+ p(D(o.value.createdTime), 1)
511
571
  ]),
512
572
  _: 1
513
573
  }),
514
- e(o, { label: "最后登陆" }, {
574
+ e(w, { label: "最后登陆" }, {
515
575
  default: l(() => [
516
- c(h(n.value.lastLoginTime), 1)
576
+ p(D(o.value.lastLoginTime), 1)
517
577
  ]),
518
578
  _: 1
519
579
  }),
520
- e(o, { label: "最后更新" }, {
580
+ e(w, { label: "最后更新" }, {
521
581
  default: l(() => [
522
- c(h(n.value.updatedTime), 1)
582
+ p(D(o.value.updatedTime), 1)
523
583
  ]),
524
584
  _: 1
525
585
  }),
526
- e(o, { label: "上级用户" }, {
586
+ e(w, { label: "上级用户" }, {
527
587
  default: l(() => [
528
- c(h(n.value.parentId), 1)
588
+ p(D(o.value.parentId), 1)
529
589
  ]),
530
590
  _: 1
531
591
  }),
532
- e(o, { label: "黑名单" }, {
592
+ e(w, { label: "黑名单" }, {
533
593
  default: l(() => [
534
594
  e(x, {
535
- type: n.value.inBlacklist ? "danger" : "success"
595
+ type: o.value.inBlacklist ? "danger" : "success"
536
596
  }, {
537
597
  default: l(() => [
538
- c(h(n.value.inBlacklist ? "是" : "否"), 1)
598
+ p(D(o.value.inBlacklist ? "是" : "否"), 1)
539
599
  ]),
540
600
  _: 1
541
601
  }, 8, ["type"])
542
602
  ]),
543
603
  _: 1
544
604
  }),
545
- e(o, { label: "邀请关系" }, {
605
+ e(w, { label: "邀请关系" }, {
546
606
  default: l(() => [
547
- c(h(n.value.relationPath), 1)
607
+ p(D(o.value.relationPath), 1)
548
608
  ]),
549
609
  _: 1
550
610
  })
551
611
  ]),
552
612
  _: 1
553
613
  }),
554
- v.value ? (p(), I($, {
614
+ b.value ? (c(), k(C, {
555
615
  key: 0,
556
616
  style: { "margin-top": "10px" },
557
617
  border: "",
558
618
  column: "2"
559
619
  }, {
560
620
  default: l(() => [
561
- e(o, { label: "黑名单解锁时间" }, {
621
+ e(w, { label: "黑名单解锁时间" }, {
562
622
  default: l(() => [
563
- c(h(v.value.unlockTime), 1)
623
+ p(D(b.value.unlockTime), 1)
564
624
  ]),
565
625
  _: 1
566
626
  }),
567
- e(o, { label: "加入时间" }, {
627
+ e(w, { label: "加入时间" }, {
568
628
  default: l(() => [
569
- c(h(v.value.createdTime), 1)
629
+ p(D(b.value.createdTime), 1)
570
630
  ]),
571
631
  _: 1
572
632
  }),
573
- e(o, { label: "允许权限" }, {
633
+ e(w, { label: "允许权限" }, {
574
634
  default: l(() => [
575
- c(h(v.value.allowPermissionCodes ? JSON.parse(v.value.allowPermissionCodes).join(", ") : ""), 1)
635
+ p(D(b.value.allowPermissionCodes ? JSON.parse(b.value.allowPermissionCodes).join(", ") : ""), 1)
576
636
  ]),
577
637
  _: 1
578
638
  }),
579
- e(o, { label: "描述" }, {
639
+ e(w, { label: "描述" }, {
580
640
  default: l(() => [
581
- c(h(v.value.description), 1)
641
+ p(D(b.value.description), 1)
582
642
  ]),
583
643
  _: 1
584
644
  })
585
645
  ]),
586
646
  _: 1
587
- })) : C("", !0),
588
- (p(), I(B, {
589
- modelValue: r.value.activeName,
590
- "onUpdate:modelValue": t[0] || (t[0] = (y) => r.value.activeName = y),
591
- key: `usr_tab_${n.value.id}`,
647
+ })) : I("", !0),
648
+ (c(), k(L, {
649
+ modelValue: m.value.activeName,
650
+ "onUpdate:modelValue": s[0] || (s[0] = (F) => m.value.activeName = F),
651
+ key: `usr_tab_${o.value.id}`,
592
652
  style: { "margin-top": "10px" },
593
653
  type: "border-card"
594
654
  }, {
595
655
  default: l(() => [
596
- (p(!0), T(M, null, q(r.value.tabs, (y, z) => (p(), I(L, {
597
- label: y.name,
598
- name: y.code,
599
- key: `user_detail_dialog_${y.code}`
656
+ (c(!0), S($, null, O(m.value.tabs, (F, Fe) => (c(), k(P, {
657
+ label: F.name,
658
+ name: F.code,
659
+ key: `user_detail_dialog_${F.code}`
600
660
  }, {
601
661
  default: l(() => [
602
- (p(), I(te, null, [
603
- r.value.activeName == y.code ? (p(), I(oe(y.component), {
604
- key: `ud_tab_${y.code}`,
605
- userId: n.value.id
606
- }, null, 8, ["userId"])) : C("", !0)
662
+ (c(), k(le, null, [
663
+ m.value.activeName == F.code ? (c(), k(oe(F.component), {
664
+ key: `ud_tab_${F.code}`,
665
+ userId: o.value.id
666
+ }, null, 8, ["userId"])) : I("", !0)
607
667
  ], 1024))
608
668
  ]),
609
669
  _: 2
@@ -612,44 +672,42 @@ const G = (m, d) => {
612
672
  _: 1
613
673
  }, 8, ["modelValue"]))
614
674
  ])), [
615
- [A, D.value]
616
- ]) : C("", !0)
675
+ [U, V.value]
676
+ ]) : I("", !0)
617
677
  ]),
618
678
  _: 2
619
679
  }, [
620
- n.value ? {
680
+ o.value ? {
621
681
  name: "footer",
622
682
  fn: l(() => [
623
- K((p(), I(N, {
683
+ q((c(), k(E, {
624
684
  icon: "lock",
625
685
  type: "warning",
626
- onClick: S
686
+ onClick: f
627
687
  }, {
628
688
  default: l(() => [
629
- c(h(n.value.inBlacklist ? "修改" : "加入") + "黑名单", 1)
689
+ p("添加功能禁用")
630
690
  ]),
631
691
  _: 1
632
692
  })), [
633
- [O, "ADD_TO_BLACKLIST"]
693
+ [B, "FUNCTION_DISABLE"]
634
694
  ])
635
695
  ]),
636
696
  key: "0"
637
697
  } : void 0
638
698
  ]), 1032, ["modelValue"]),
639
- e(Q, {
640
- ref_key: "addBlacklistComp",
641
- ref: f,
642
- onSuccess: t[2] || (t[2] = (y) => b(n.value.id)),
643
- "hidden-entrance-slot": ""
699
+ e(K, {
700
+ ref_key: "functionDisableTableDialog",
701
+ ref: y
644
702
  }, null, 512)
645
703
  ], 64);
646
704
  };
647
705
  }
648
- }), fe = {
649
- install: (m) => {
650
- m.component("PgUserDetailDialog", H);
706
+ }), be = {
707
+ install: (d) => {
708
+ d.component("PgUserDetailDialog", W);
651
709
  }
652
- }, X = /* @__PURE__ */ P({
710
+ }, ge = /* @__PURE__ */ M({
653
711
  __name: "UserSelectorComp",
654
712
  props: {
655
713
  modelValue: {
@@ -662,55 +720,55 @@ const G = (m, d) => {
662
720
  }
663
721
  },
664
722
  emits: ["update:modelValue"],
665
- setup(m, { emit: d }) {
666
- const i = m, u = R("http");
667
- ae(() => {
668
- i.modelValue && w(i.modelValue);
723
+ setup(d, { emit: u }) {
724
+ const i = d, a = N("http");
725
+ te(() => {
726
+ i.modelValue && g(i.modelValue);
669
727
  });
670
- const _ = k(i.modelValue);
671
- j(_, (b) => {
672
- d("update:modelValue", b);
728
+ const r = v(i.modelValue);
729
+ j(r, (h) => {
730
+ u("update:modelValue", h);
673
731
  });
674
- const n = k(!1), v = k([]);
675
- let r = null;
676
- function D(b) {
677
- b && (n.value = !0, r && clearTimeout(r), r = setTimeout(() => {
678
- u == null || u.get("/api/user/keyword-search", {
679
- keyword: b,
732
+ const o = v(!1), b = v([]);
733
+ let m = null;
734
+ function V(h) {
735
+ h && (o.value = !0, m && clearTimeout(m), m = setTimeout(() => {
736
+ a == null || a.get("/api/user/keyword-search", {
737
+ keyword: h,
680
738
  pageSize: i.pageSize
681
- }).then((g) => {
682
- v.value = g.data;
739
+ }).then((_) => {
740
+ b.value = _.data;
683
741
  }).finally(() => {
684
- n.value = !1;
742
+ o.value = !1;
685
743
  });
686
744
  }, 200));
687
745
  }
688
- function w(b) {
689
- n.value = !0, u == null || u.get(`/api/user/${b}`).then((g) => {
690
- v.value = [g.data];
746
+ function g(h) {
747
+ o.value = !0, a == null || a.get(`/api/user/${h}`).then((_) => {
748
+ b.value = [_.data];
691
749
  }).finally(() => {
692
- n.value = !1;
750
+ o.value = !1;
693
751
  });
694
752
  }
695
- return (b, g) => {
696
- const f = s("el-option"), S = s("el-select");
697
- return p(), I(S, {
698
- modelValue: _.value,
699
- "onUpdate:modelValue": g[0] || (g[0] = (a) => _.value = a),
753
+ return (h, _) => {
754
+ const y = n("el-option"), f = n("el-select");
755
+ return c(), k(f, {
756
+ modelValue: r.value,
757
+ "onUpdate:modelValue": _[0] || (_[0] = (t) => r.value = t),
700
758
  filterable: "",
701
759
  remote: "",
702
- loading: n.value,
703
- "remote-method": D
760
+ loading: o.value,
761
+ "remote-method": V
704
762
  }, {
705
763
  default: l(() => [
706
- (p(!0), T(M, null, q(v.value, (a) => (p(), I(f, {
707
- key: a.id,
708
- value: a.id,
709
- label: `${a.id} / ${a.nickname} / ${a.mobile} / ${a.inviteCode}`
764
+ (c(!0), S($, null, O(b.value, (t) => (c(), k(y, {
765
+ key: t.id,
766
+ value: t.id,
767
+ label: `${t.id} / ${t.nickname} / ${t.mobile} / ${t.inviteCode}`
710
768
  }, {
711
769
  default: l(() => [
712
- J(b.$slots, "default", { user: a }, () => [
713
- c(h(a.id) + " / " + h(a.nickname) + " / " + h(a.mobile) + " / " + h(a.inviteCode), 1)
770
+ ae(h.$slots, "default", { user: t }, () => [
771
+ p(D(t.id) + " / " + D(t.nickname) + " / " + D(t.mobile) + " / " + D(t.inviteCode), 1)
714
772
  ])
715
773
  ]),
716
774
  _: 2
@@ -720,81 +778,201 @@ const G = (m, d) => {
720
778
  }, 8, ["modelValue", "loading"]);
721
779
  };
722
780
  }
723
- }), ve = {
724
- install: (m) => {
725
- m.component("PgUserSelector", X);
781
+ }), we = {
782
+ install: (d) => {
783
+ d.component("PgUserSelector", ge);
726
784
  }
727
- }, be = [
785
+ }, ye = {
786
+ install: (d) => {
787
+ d.component("PgFunctionDisableTableDialog", K);
788
+ }
789
+ }, he = [
728
790
  pe,
729
- fe,
730
- ve
731
- ], ge = (m) => (ie("data-v-391c43be"), m = m(), se(), m), ke = { class: "page-layout" }, we = { style: { "margin-top": "10px" } }, he = /* @__PURE__ */ ge(() => /* @__PURE__ */ Y("template", { "slot-scope": "{row}" }, null, -1)), ye = /* @__PURE__ */ P({
791
+ be,
792
+ we,
793
+ ye
794
+ ], De = {
795
+ __name: "CreateUserDialog",
796
+ emits: ["success"],
797
+ setup(d, { expose: u, emit: i }) {
798
+ const a = N("http"), r = v(!1), o = v({
799
+ mobile: null,
800
+ password: null,
801
+ inviteCode: null
802
+ }), b = {
803
+ mobile: [{ required: !0, message: "请输入手机号" }],
804
+ password: [{ required: !0, message: "请输入登录密码" }]
805
+ }, m = v();
806
+ function V() {
807
+ m.value.validate(async (_) => {
808
+ _ && (await a.post("/api/user/create", o.value), Y.success("创建成功"), i("success"), r.value = !1);
809
+ });
810
+ }
811
+ function g() {
812
+ r.value = !0;
813
+ }
814
+ function h() {
815
+ m.value.resetFields();
816
+ }
817
+ return u({
818
+ show: g
819
+ }), (_, y) => {
820
+ const f = n("el-input"), t = n("el-form-item"), T = n("el-form"), s = n("el-button"), w = n("el-dialog");
821
+ return c(), k(w, {
822
+ modelValue: r.value,
823
+ "onUpdate:modelValue": y[3] || (y[3] = (x) => r.value = x),
824
+ title: "创建用户",
825
+ width: "400",
826
+ onClosed: h
827
+ }, {
828
+ footer: l(() => [
829
+ e(s, {
830
+ type: "primary",
831
+ onClick: V
832
+ }, {
833
+ default: l(() => [
834
+ p("提交")
835
+ ]),
836
+ _: 1
837
+ })
838
+ ]),
839
+ default: l(() => [
840
+ e(T, {
841
+ ref_key: "formRef",
842
+ ref: m,
843
+ model: o.value,
844
+ rules: b,
845
+ "label-position": "top"
846
+ }, {
847
+ default: l(() => [
848
+ e(t, {
849
+ label: "手机号",
850
+ prop: "mobile"
851
+ }, {
852
+ default: l(() => [
853
+ e(f, {
854
+ modelValue: o.value.mobile,
855
+ "onUpdate:modelValue": y[0] || (y[0] = (x) => o.value.mobile = x),
856
+ placeholder: "请输入登录手机号"
857
+ }, null, 8, ["modelValue"])
858
+ ]),
859
+ _: 1
860
+ }),
861
+ e(t, {
862
+ label: "登录密码",
863
+ prop: "password"
864
+ }, {
865
+ default: l(() => [
866
+ e(f, {
867
+ modelValue: o.value.password,
868
+ "onUpdate:modelValue": y[1] || (y[1] = (x) => o.value.password = x),
869
+ placeholder: "请输入登录密码"
870
+ }, null, 8, ["modelValue"])
871
+ ]),
872
+ _: 1
873
+ }),
874
+ e(t, {
875
+ label: "邀请码",
876
+ prop: "inviteCode"
877
+ }, {
878
+ default: l(() => [
879
+ e(f, {
880
+ modelValue: o.value.inviteCode,
881
+ "onUpdate:modelValue": y[2] || (y[2] = (x) => o.value.inviteCode = x),
882
+ placeholder: "请输入邀请码"
883
+ }, null, 8, ["modelValue"])
884
+ ]),
885
+ _: 1
886
+ })
887
+ ]),
888
+ _: 1
889
+ }, 8, ["model"])
890
+ ]),
891
+ _: 1
892
+ }, 8, ["modelValue"]);
893
+ };
894
+ }
895
+ }, ke = (d) => (ie("data-v-2dcce2b2"), d = d(), ue(), d), Ve = { class: "page-layout" }, Te = { style: { "margin-top": "10px" } }, Ce = /* @__PURE__ */ ke(() => /* @__PURE__ */ R("template", { "slot-scope": "{row}" }, null, -1)), xe = /* @__PURE__ */ M({
732
896
  __name: "list",
733
- setup(m) {
734
- const d = k({
897
+ setup(d) {
898
+ const u = v({
735
899
  id: null,
736
900
  parentId: null,
737
901
  phone: null,
738
902
  nicekname: null,
739
903
  inviteCode: null
740
- }), i = k(null);
741
- function u() {
904
+ }), i = v(null);
905
+ function a() {
742
906
  i.value.search();
743
907
  }
744
- const _ = k();
745
- function n(v) {
746
- _.value.show(v.id);
908
+ const r = v();
909
+ function o(V) {
910
+ r.value.show(V.id);
911
+ }
912
+ const b = v();
913
+ function m() {
914
+ b.value.show();
747
915
  }
748
- return (v, r) => {
749
- const D = s("el-input"), w = s("el-button"), b = s("el-space"), g = s("el-card"), f = s("el-table-column"), S = s("el-image");
750
- return p(), T(M, null, [
751
- Y("div", ke, [
752
- e(g, null, {
916
+ return (V, g) => {
917
+ const h = n("el-input"), _ = n("el-button"), y = n("el-space"), f = n("el-card"), t = n("el-table-column"), T = n("el-image");
918
+ return c(), S($, null, [
919
+ R("div", Ve, [
920
+ e(f, null, {
753
921
  default: l(() => [
754
- e(b, null, {
922
+ e(y, null, {
755
923
  default: l(() => [
756
- e(D, {
757
- modelValue: d.value.id,
758
- "onUpdate:modelValue": r[0] || (r[0] = (a) => d.value.id = a),
924
+ e(h, {
925
+ modelValue: u.value.id,
926
+ "onUpdate:modelValue": g[0] || (g[0] = (s) => u.value.id = s),
759
927
  placeholder: "ID",
760
928
  style: { width: "100px" },
761
929
  clearable: ""
762
930
  }, null, 8, ["modelValue"]),
763
- e(D, {
764
- modelValue: d.value.parentId,
765
- "onUpdate:modelValue": r[1] || (r[1] = (a) => d.value.parentId = a),
931
+ e(h, {
932
+ modelValue: u.value.parentId,
933
+ "onUpdate:modelValue": g[1] || (g[1] = (s) => u.value.parentId = s),
766
934
  placeholder: "父用户ID",
767
935
  style: { width: "100px" },
768
936
  clearable: ""
769
937
  }, null, 8, ["modelValue"]),
770
- e(D, {
771
- modelValue: d.value.phone,
772
- "onUpdate:modelValue": r[2] || (r[2] = (a) => d.value.phone = a),
938
+ e(h, {
939
+ modelValue: u.value.phone,
940
+ "onUpdate:modelValue": g[2] || (g[2] = (s) => u.value.phone = s),
773
941
  placeholder: "手机号",
774
942
  style: { width: "120px" },
775
943
  clearable: ""
776
944
  }, null, 8, ["modelValue"]),
777
- e(D, {
778
- modelValue: d.value.nicekname,
779
- "onUpdate:modelValue": r[3] || (r[3] = (a) => d.value.nicekname = a),
945
+ e(h, {
946
+ modelValue: u.value.nicekname,
947
+ "onUpdate:modelValue": g[3] || (g[3] = (s) => u.value.nicekname = s),
780
948
  placeholder: "昵称",
781
949
  style: { width: "150px" },
782
950
  clearable: ""
783
951
  }, null, 8, ["modelValue"]),
784
- e(D, {
785
- modelValue: d.value.inviteCode,
786
- "onUpdate:modelValue": r[4] || (r[4] = (a) => d.value.inviteCode = a),
952
+ e(h, {
953
+ modelValue: u.value.inviteCode,
954
+ "onUpdate:modelValue": g[4] || (g[4] = (s) => u.value.inviteCode = s),
787
955
  placeholder: "邀请码",
788
956
  style: { width: "100px" },
789
957
  clearable: ""
790
958
  }, null, 8, ["modelValue"]),
791
- e(w, {
959
+ e(_, {
792
960
  type: "primary",
793
961
  icon: "search",
794
- onClick: u
962
+ onClick: a
963
+ }, {
964
+ default: l(() => [
965
+ p("搜索")
966
+ ]),
967
+ _: 1
968
+ }),
969
+ e(_, {
970
+ type: "warning",
971
+ icon: "plus",
972
+ onClick: m
795
973
  }, {
796
974
  default: l(() => [
797
- c("搜索")
975
+ p("创建用户")
798
976
  ]),
799
977
  _: 1
800
978
  })
@@ -804,118 +982,118 @@ const G = (m, d) => {
804
982
  ]),
805
983
  _: 1
806
984
  }),
807
- Y("div", we, [
985
+ R("div", Te, [
808
986
  e(ne(re), {
809
987
  ref_key: "userTable",
810
988
  ref: i,
811
989
  "data-url": "/api/user/page",
812
- condition: d.value,
813
- onRowDbClick: r[5] || (r[5] = (a) => n(a))
990
+ condition: u.value,
991
+ onRowDbClick: g[5] || (g[5] = (s) => o(s))
814
992
  }, {
815
993
  columns: l(() => [
816
- e(f, {
994
+ e(t, {
817
995
  prop: "id",
818
996
  label: "UID",
819
997
  width: "80",
820
998
  align: "center"
821
999
  }),
822
- e(f, {
1000
+ e(t, {
823
1001
  prop: "mobile",
824
1002
  label: "手机",
825
1003
  width: "115",
826
1004
  align: "left",
827
1005
  "show-overflow-tooltip": ""
828
1006
  }, {
829
- default: l((a) => [
830
- (p(), I(E, {
831
- "mask-mobile": a.row.mobile,
832
- "user-id": a.row.id,
833
- key: a.row.id
1007
+ default: l((s) => [
1008
+ (c(), k(A, {
1009
+ "mask-mobile": s.row.mobile,
1010
+ "user-id": s.row.id,
1011
+ key: s.row.id
834
1012
  }, null, 8, ["mask-mobile", "user-id"]))
835
1013
  ]),
836
1014
  _: 1
837
1015
  }),
838
- e(f, {
1016
+ e(t, {
839
1017
  prop: "username",
840
1018
  label: "用户名",
841
1019
  width: "110",
842
1020
  align: "left",
843
1021
  "show-overflow-tooltip": ""
844
1022
  }),
845
- e(f, {
1023
+ e(t, {
846
1024
  prop: "nickname",
847
1025
  label: "昵称",
848
1026
  width: "110",
849
1027
  align: "left",
850
1028
  "show-overflow-tooltip": ""
851
1029
  }),
852
- e(f, {
1030
+ e(t, {
853
1031
  prop: "inviteCode",
854
1032
  label: "邀请码",
855
1033
  width: "90",
856
1034
  align: "center",
857
1035
  "show-overflow-tooltip": ""
858
1036
  }),
859
- e(f, {
1037
+ e(t, {
860
1038
  prop: "avatar",
861
1039
  label: "头像",
862
1040
  width: "60",
863
1041
  align: "center",
864
1042
  "show-overflow-tooltip": ""
865
1043
  }, {
866
- default: l((a) => [
867
- e(S, {
1044
+ default: l((s) => [
1045
+ e(T, {
868
1046
  fit: "cover",
869
1047
  size: 30,
870
- src: a.row.avatar,
1048
+ src: s.row.avatar,
871
1049
  "preview-teleported": "",
872
- "preview-src-list": [a.row.avatar]
1050
+ "preview-src-list": [s.row.avatar]
873
1051
  }, null, 8, ["src", "preview-src-list"])
874
1052
  ]),
875
1053
  _: 1
876
1054
  }),
877
- e(f, {
1055
+ e(t, {
878
1056
  prop: "parentId",
879
1057
  label: "上级ID",
880
1058
  width: "80",
881
1059
  align: "left",
882
1060
  "show-overflow-tooltip": ""
883
1061
  }),
884
- e(f, {
1062
+ e(t, {
885
1063
  prop: "relationPath",
886
1064
  label: "邀请关系",
887
1065
  "min-width": "150",
888
1066
  align: "left",
889
1067
  "show-overflow-tooltip": ""
890
1068
  }),
891
- e(f, {
1069
+ e(t, {
892
1070
  prop: "blackUnlockTime",
893
1071
  label: "黑名单解锁",
894
1072
  width: "145",
895
1073
  align: "left",
896
1074
  "show-overflow-tooltip": ""
897
1075
  }),
898
- e(f, {
1076
+ e(t, {
899
1077
  prop: "lastLoginTime",
900
1078
  label: "最后登录时间",
901
1079
  width: "145",
902
1080
  align: "center",
903
1081
  "show-overflow-tooltip": ""
904
1082
  }),
905
- e(f, {
1083
+ e(t, {
906
1084
  prop: "createdTime",
907
1085
  label: "创建时间",
908
1086
  width: "145",
909
1087
  align: "center",
910
1088
  "show-overflow-tooltip": ""
911
1089
  }),
912
- e(f, {
1090
+ e(t, {
913
1091
  label: "操作",
914
1092
  width: "220",
915
1093
  fixed: "right"
916
1094
  }, {
917
1095
  default: l(() => [
918
- he
1096
+ Ce
919
1097
  ]),
920
1098
  _: 1
921
1099
  })
@@ -924,262 +1102,53 @@ const G = (m, d) => {
924
1102
  }, 8, ["condition"])
925
1103
  ])
926
1104
  ]),
927
- e(H, {
1105
+ e(W, {
928
1106
  ref_key: "userDetailDialog",
929
- ref: _
930
- }, null, 512)
931
- ], 64);
932
- };
933
- }
934
- });
935
- const De = /* @__PURE__ */ G(ye, [["__scopeId", "data-v-391c43be"]]), Ve = /* @__PURE__ */ P({
936
- __name: "BlackListView",
937
- setup(m) {
938
- const d = R("http"), i = k({
939
- userId: null,
940
- status: "VALID"
941
- }), u = k();
942
- function _() {
943
- u.value.search();
944
- }
945
- function n(b) {
946
- d == null || d.post(`/api/user/blacklist/${b}/unlock`).then((g) => {
947
- _();
948
- });
949
- }
950
- const v = k();
951
- function r(b) {
952
- v.value.show(b);
953
- }
954
- const D = k();
955
- function w(b) {
956
- D.value.show(b);
957
- }
958
- return (b, g) => {
959
- const f = s("el-option"), S = s("el-select"), a = s("el-button"), U = s("el-space"), t = s("el-card"), o = s("el-table-column"), x = s("el-link"), $ = s("el-tag"), L = s("el-popconfirm"), B = s("pg-table"), N = F("permission");
960
- return p(), T(M, null, [
961
- e(t, null, {
962
- default: l(() => [
963
- e(U, null, {
964
- default: l(() => [
965
- e(X, {
966
- modelValue: i.value.userId,
967
- "onUpdate:modelValue": g[0] || (g[0] = (V) => i.value.userId = V),
968
- clearable: "",
969
- style: { width: "300px" }
970
- }, null, 8, ["modelValue"]),
971
- e(S, {
972
- placeholder: "状态",
973
- modelValue: i.value.status,
974
- "onUpdate:modelValue": g[1] || (g[1] = (V) => i.value.status = V),
975
- clearable: "",
976
- style: { width: "100px" }
977
- }, {
978
- default: l(() => [
979
- e(f, {
980
- value: "VALID",
981
- label: "有效"
982
- }),
983
- e(f, {
984
- value: "INVALID",
985
- label: "失效"
986
- })
987
- ]),
988
- _: 1
989
- }, 8, ["modelValue"]),
990
- e(a, {
991
- icon: "search",
992
- type: "primary",
993
- onClick: _
994
- }, {
995
- default: l(() => [
996
- c("搜索")
997
- ]),
998
- _: 1
999
- })
1000
- ]),
1001
- _: 1
1002
- })
1003
- ]),
1004
- _: 1
1005
- }),
1006
- e(B, {
1007
- ref_key: "table",
1008
- ref: u,
1009
- "data-url": "/api/user/blacklist",
1010
- condition: i.value,
1011
- style: { "margin-top": "10px" }
1012
- }, {
1013
- columns: l(() => [
1014
- e(o, {
1015
- label: "ID",
1016
- prop: "id",
1017
- width: "100"
1018
- }),
1019
- e(o, { label: "用户信息" }, {
1020
- default: l(() => [
1021
- e(o, {
1022
- label: "用户ID",
1023
- width: "100"
1024
- }, {
1025
- default: l(({ row: V }) => [
1026
- e(x, {
1027
- type: "primary",
1028
- onClick: (A) => w(V.userId)
1029
- }, {
1030
- default: l(() => [
1031
- c(h(V.userId), 1)
1032
- ]),
1033
- _: 2
1034
- }, 1032, ["onClick"])
1035
- ]),
1036
- _: 1
1037
- }),
1038
- e(o, {
1039
- label: "手机号",
1040
- width: "150"
1041
- }, {
1042
- default: l(({ row: V }) => [
1043
- e(E, {
1044
- "user-id": V.userId,
1045
- "mask-mobile": V.userMobile
1046
- }, null, 8, ["user-id", "mask-mobile"])
1047
- ]),
1048
- _: 1
1049
- }),
1050
- e(o, {
1051
- label: "用户昵称",
1052
- prop: "userNickname"
1053
- })
1054
- ]),
1055
- _: 1
1056
- }),
1057
- e(o, { label: "限制信息" }, {
1058
- default: l(() => [
1059
- e(o, {
1060
- label: "描述",
1061
- prop: "description"
1062
- }),
1063
- e(o, {
1064
- label: "允许权限",
1065
- prop: "allowPermissionCodes",
1066
- "show-overflow-tooltip": ""
1067
- }),
1068
- e(o, {
1069
- label: "状态",
1070
- prop: "status",
1071
- align: "center",
1072
- width: "100"
1073
- }, {
1074
- default: l(({ row: V }) => [
1075
- e($, {
1076
- type: V.status == "VALID" ? "success" : "warning"
1077
- }, {
1078
- default: l(() => [
1079
- c(h(V.status == "VALID" ? "有效" : "失效"), 1)
1080
- ]),
1081
- _: 2
1082
- }, 1032, ["type"])
1083
- ]),
1084
- _: 1
1085
- }),
1086
- e(o, {
1087
- label: "加入时间",
1088
- prop: "createdTime",
1089
- width: "170"
1090
- }),
1091
- e(o, {
1092
- label: "解锁时间",
1093
- prop: "unlockTime",
1094
- width: "170"
1095
- })
1096
- ]),
1097
- _: 1
1098
- }),
1099
- e(o, null, {
1100
- default: l(({ row: V }) => [
1101
- V.status == "VALID" && b.$hasPer("BLACKLIST_UNLOCK") ? (p(), I(L, {
1102
- key: 0,
1103
- title: "确定要解锁吗?",
1104
- onConfirm: n
1105
- }, {
1106
- reference: l(() => [
1107
- e(a, {
1108
- type: "warning",
1109
- icon: "unlock"
1110
- }, {
1111
- default: l(() => [
1112
- c("解锁")
1113
- ]),
1114
- _: 1
1115
- })
1116
- ]),
1117
- _: 1
1118
- })) : C("", !0),
1119
- V.status == "VALID" ? K((p(), I(a, {
1120
- key: 1,
1121
- icon: "edit",
1122
- onClick: (A) => r(V.userId)
1123
- }, {
1124
- default: l(() => [
1125
- c("编辑")
1126
- ]),
1127
- _: 2
1128
- }, 1032, ["onClick"])), [
1129
- [N, "ADD_TO_BLACKLIST"]
1130
- ]) : C("", !0)
1131
- ]),
1132
- _: 1
1133
- })
1134
- ]),
1135
- _: 1
1136
- }, 8, ["condition"]),
1137
- e(Q, {
1138
- ref_key: "addBlacklistComp",
1139
- ref: v,
1140
- onSuccess: _,
1141
- "hidden-entrance-slot": ""
1107
+ ref: r
1142
1108
  }, null, 512),
1143
- e(H, {
1144
- ref_key: "userDetail",
1145
- ref: D
1109
+ e(De, {
1110
+ ref_key: "createUserDialog",
1111
+ ref: b,
1112
+ onSuccess: a
1146
1113
  }, null, 512)
1147
1114
  ], 64);
1148
1115
  };
1149
1116
  }
1150
- }), Ie = {
1151
- install: (m, d) => {
1152
- let i = d.router, u = i.getRoutes().find((_) => _.path == "/");
1153
- u && u.meta && i.addRoute({
1117
+ });
1118
+ const Ue = /* @__PURE__ */ G(xe, [["__scopeId", "data-v-2dcce2b2"]]), Ie = {
1119
+ install: (d, u) => {
1120
+ let i = u.router, a = i.getRoutes().find((r) => r.path == "/");
1121
+ a && a.meta && i.addRoute({
1154
1122
  path: "/user",
1155
1123
  name: "User",
1156
1124
  redirect: "/user/list",
1157
- component: u.meta.commonLayout,
1125
+ component: a.meta.commonLayout,
1158
1126
  children: [{
1159
1127
  path: "list",
1160
1128
  name: "UserList",
1161
- component: De
1162
- }, {
1163
- path: "blacklist",
1164
- name: "BlackListView",
1165
- component: Ve
1129
+ component: Ue
1130
+ // }, {
1131
+ // path: 'blacklist',
1132
+ // name: 'BlackListView',
1133
+ // component: BlackListView
1166
1134
  }]
1167
1135
  });
1168
1136
  }
1169
- }, Ce = (m, d) => {
1170
- const i = W();
1171
- if (d.userDetailDialogTabs && d.userDetailDialogTabs.length)
1172
- for (let u of d.userDetailDialogTabs)
1173
- i.userDetailDialogTabs.push(u);
1174
- be.forEach((u) => m.use(u)), m.use(Ie, d);
1175
- }, xe = {
1176
- install: Ce
1137
+ }, Se = (d, u) => {
1138
+ const i = J();
1139
+ if (u.userDetailDialogTabs && u.userDetailDialogTabs.length)
1140
+ for (let a of u.userDetailDialogTabs)
1141
+ i.userDetailDialogTabs.push(a);
1142
+ he.forEach((a) => d.use(a)), d.use(Ie, u);
1143
+ }, Re = {
1144
+ install: Se
1177
1145
  };
1178
1146
  export {
1179
- fe as UserDetailDialog,
1147
+ ye as FunctionDisableDialog,
1148
+ be as UserDetailDialog,
1180
1149
  pe as UserMobileComp,
1181
- ve as UserSelectComp,
1182
- xe as default,
1183
- Ce as install,
1184
- W as useUserCoreConfigStore
1150
+ we as UserSelectComp,
1151
+ Re as default,
1152
+ Se as install,
1153
+ J as useUserCoreConfigStore
1185
1154
  };