st-comp 0.0.199 → 0.0.201

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.
Files changed (37) hide show
  1. package/auto-imports.d.ts +3 -0
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +267 -199
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +27 -25
  6. package/es/KlinePlus.cjs +3 -3
  7. package/es/KlinePlus.js +252 -249
  8. package/es/User.cjs +1 -1
  9. package/es/User.js +714 -624
  10. package/es/VarietySearch.cjs +6 -6
  11. package/es/VarietySearch.js +19 -17
  12. package/es/VarietyTextCopy.cjs +3 -3
  13. package/es/VarietyTextCopy.js +4 -4
  14. package/es/el-checkbox-group-0ea8fbf8.cjs +1 -0
  15. package/es/el-checkbox-group-4ed993c7.js +1 -0
  16. package/es/{el-form-item-eeb64520.js → el-form-item-c53c374d.js} +2 -2
  17. package/es/el-message-box-a93d2f6a.js +489 -0
  18. package/es/el-message-box-c10adb52.cjs +1 -0
  19. package/es/el-text-ac60d0f2.js +67 -0
  20. package/es/el-text-c20a9f48.cjs +1 -0
  21. package/es/style.css +1 -1
  22. package/lib/bundle.js +1 -1
  23. package/lib/bundle.umd.cjs +206 -206
  24. package/lib/{index-c9dddb13.js → index-c0ce50bc.js} +20375 -20219
  25. package/lib/{python-8de8f552.js → python-9dae326e.js} +1 -1
  26. package/lib/style.css +1 -1
  27. package/package.json +1 -1
  28. package/packages/CustomFunction/index.vue +141 -30
  29. package/packages/KlinePlus/index.vue +17 -7
  30. package/packages/User/components/EditInfoDialog/Mobile.vue +110 -0
  31. package/packages/User/components/EditInfoDialog/index.vue +136 -0
  32. package/packages/User/components/SetPasswordDialog.vue +6 -3
  33. package/packages/User/index.vue +7 -22
  34. package/src/pages/KlinePlus/index.vue +6 -5
  35. package/es/el-message-box-48d71ee5.cjs +0 -1
  36. package/es/el-message-box-81ffd21e.js +0 -550
  37. package/packages/User/components/EditInfoDialog.vue +0 -144
@@ -1,550 +0,0 @@
1
- import { defineComponent as Q, ref as k, computed as w, onMounted as me, onUpdated as Se, openBlock as f, createBlock as C, resolveDynamicComponent as I, normalizeClass as r, unref as Ie, normalizeStyle as G, withCtx as E, renderSlot as pe, useAttrs as Ae, nextTick as V, reactive as Re, markRaw as W, watch as se, onBeforeUnmount as $e, toRefs as ze, resolveComponent as z, Transition as Le, withDirectives as U, createVNode as A, createElementVNode as b, withModifiers as K, createElementBlock as j, createCommentVNode as S, toDisplayString as L, withKeys as N, vShow as q, createTextVNode as le, isVNode as ge, render as ve } from "vue";
2
- import { b as Ve, u as Oe, i as X, _ as he, w as Pe, x as Z, c as Y, s as De, y as ae, f as ye, z as ie } from "./base-a5af3db3.js";
3
- import { k as Fe, e as He, T as Ke, m as re } from "./use-form-common-props-815d48a6.js";
4
- import { E as Ne } from "./el-button-c95adb85.js";
5
- import { E as Ue } from "./el-input-2f75c4ba.js";
6
- import { E as je, b as qe, c as Ge } from "./el-overlay-09ad71cd.js";
7
- import { E as We, l as ue } from "./index-a871c3eb.js";
8
- import { o as ce, a as Xe, e as Ze } from "./el-popper-b4f97157.js";
9
- import { i as Je } from "./validator-764a9db0.js";
10
- import { u as Qe } from "./use-global-config-b5e9d3d5.js";
11
- import { u as de } from "./index-960806da.js";
12
- import { u as Ye } from "./el-dialog-41ab8417.js";
13
- const _e = Ve({
14
- type: {
15
- type: String,
16
- values: ["primary", "success", "info", "warning", "danger", ""],
17
- default: ""
18
- },
19
- size: {
20
- type: String,
21
- values: Fe,
22
- default: ""
23
- },
24
- truncated: Boolean,
25
- lineClamp: {
26
- type: [String, Number]
27
- },
28
- tag: {
29
- type: String,
30
- default: "span"
31
- }
32
- }), xe = Q({
33
- name: "ElText"
34
- }), en = /* @__PURE__ */ Q({
35
- ...xe,
36
- props: _e,
37
- setup(e) {
38
- const o = e, t = k(), i = He(), l = Oe("text"), s = w(() => [
39
- l.b(),
40
- l.m(o.type),
41
- l.m(i.value),
42
- l.is("truncated", o.truncated),
43
- l.is("line-clamp", !X(o.lineClamp))
44
- ]), c = () => {
45
- var u, m, n, M, d, P, D;
46
- if (Ae().title)
47
- return;
48
- let h = !1;
49
- const F = ((u = t.value) == null ? void 0 : u.textContent) || "";
50
- if (o.truncated) {
51
- const p = (m = t.value) == null ? void 0 : m.offsetWidth, y = (n = t.value) == null ? void 0 : n.scrollWidth;
52
- p && y && y > p && (h = !0);
53
- } else if (!X(o.lineClamp)) {
54
- const p = (M = t.value) == null ? void 0 : M.offsetHeight, y = (d = t.value) == null ? void 0 : d.scrollHeight;
55
- p && y && y > p && (h = !0);
56
- }
57
- h ? (P = t.value) == null || P.setAttribute("title", F) : (D = t.value) == null || D.removeAttribute("title");
58
- };
59
- return me(c), Se(c), (u, m) => (f(), C(I(u.tag), {
60
- ref_key: "textRef",
61
- ref: t,
62
- class: r(Ie(s)),
63
- style: G({ "-webkit-line-clamp": u.lineClamp })
64
- }, {
65
- default: E(() => [
66
- pe(u.$slots, "default")
67
- ]),
68
- _: 3
69
- }, 8, ["class", "style"]));
70
- }
71
- });
72
- var nn = /* @__PURE__ */ he(en, [["__file", "text.vue"]]);
73
- const Mn = Pe(nn), J = "_trap-focus-children", T = [], fe = (e) => {
74
- if (T.length === 0)
75
- return;
76
- const o = T[T.length - 1][J];
77
- if (o.length > 0 && e.code === Xe.tab) {
78
- if (o.length === 1) {
79
- e.preventDefault(), document.activeElement !== o[0] && o[0].focus();
80
- return;
81
- }
82
- const t = e.shiftKey, i = e.target === o[0], l = e.target === o[o.length - 1];
83
- i && t && (e.preventDefault(), o[o.length - 1].focus()), l && !t && (e.preventDefault(), o[0].focus());
84
- }
85
- }, on = {
86
- beforeMount(e) {
87
- e[J] = ce(e), T.push(e), T.length <= 1 && document.addEventListener("keydown", fe);
88
- },
89
- updated(e) {
90
- V(() => {
91
- e[J] = ce(e);
92
- });
93
- },
94
- unmounted() {
95
- T.shift(), T.length === 0 && document.removeEventListener("keydown", fe);
96
- }
97
- }, tn = Q({
98
- name: "ElMessageBox",
99
- directives: {
100
- TrapFocus: on
101
- },
102
- components: {
103
- ElButton: Ne,
104
- ElFocusTrap: Ze,
105
- ElInput: Ue,
106
- ElOverlay: je,
107
- ElIcon: We,
108
- ...Ke
109
- },
110
- inheritAttrs: !1,
111
- props: {
112
- buttonSize: {
113
- type: String,
114
- validator: Je
115
- },
116
- modal: {
117
- type: Boolean,
118
- default: !0
119
- },
120
- lockScroll: {
121
- type: Boolean,
122
- default: !0
123
- },
124
- showClose: {
125
- type: Boolean,
126
- default: !0
127
- },
128
- closeOnClickModal: {
129
- type: Boolean,
130
- default: !0
131
- },
132
- closeOnPressEscape: {
133
- type: Boolean,
134
- default: !0
135
- },
136
- closeOnHashChange: {
137
- type: Boolean,
138
- default: !0
139
- },
140
- center: Boolean,
141
- draggable: Boolean,
142
- overflow: Boolean,
143
- roundButton: Boolean,
144
- container: {
145
- type: String,
146
- default: "body"
147
- },
148
- boxType: {
149
- type: String,
150
- default: ""
151
- }
152
- },
153
- emits: ["vanish", "action"],
154
- setup(e, { emit: o }) {
155
- const {
156
- locale: t,
157
- zIndex: i,
158
- ns: l,
159
- size: s
160
- } = Qe("message-box", w(() => e.buttonSize)), { t: c } = t, { nextZIndex: u } = i, m = k(!1), n = Re({
161
- autofocus: !0,
162
- beforeClose: null,
163
- callback: null,
164
- cancelButtonText: "",
165
- cancelButtonClass: "",
166
- confirmButtonText: "",
167
- confirmButtonClass: "",
168
- customClass: "",
169
- customStyle: {},
170
- dangerouslyUseHTMLString: !1,
171
- distinguishCancelAndClose: !1,
172
- icon: "",
173
- closeIcon: "",
174
- inputPattern: null,
175
- inputPlaceholder: "",
176
- inputType: "text",
177
- inputValue: "",
178
- inputValidator: void 0,
179
- inputErrorMessage: "",
180
- message: "",
181
- modalFade: !0,
182
- modalClass: "",
183
- showCancelButton: !1,
184
- showConfirmButton: !0,
185
- type: "",
186
- title: void 0,
187
- showInput: !1,
188
- action: "",
189
- confirmButtonLoading: !1,
190
- cancelButtonLoading: !1,
191
- confirmButtonLoadingIcon: W(ue),
192
- cancelButtonLoadingIcon: W(ue),
193
- confirmButtonDisabled: !1,
194
- editorErrorMessage: "",
195
- validateError: !1,
196
- zIndex: u()
197
- }), M = w(() => {
198
- const a = n.type;
199
- return { [l.bm("icon", a)]: a && re[a] };
200
- }), d = de(), P = de(), D = w(() => {
201
- const a = n.type;
202
- return n.icon || a && re[a] || "";
203
- }), _ = w(() => !!n.message), h = k(), F = k(), p = k(), y = k(), x = k(), Ce = w(() => n.confirmButtonClass);
204
- se(() => n.inputValue, async (a) => {
205
- await V(), e.boxType === "prompt" && a && ne();
206
- }, { immediate: !0 }), se(() => m.value, (a) => {
207
- var g, v;
208
- a && (e.boxType !== "prompt" && (n.autofocus ? p.value = (v = (g = x.value) == null ? void 0 : g.$el) != null ? v : h.value : p.value = h.value), n.zIndex = u()), e.boxType === "prompt" && (a ? V().then(() => {
209
- var te;
210
- y.value && y.value.$el && (n.autofocus ? p.value = (te = Te()) != null ? te : h.value : p.value = h.value);
211
- }) : (n.editorErrorMessage = "", n.validateError = !1));
212
- });
213
- const be = w(() => e.draggable), Ee = w(() => e.overflow), { isDragging: we } = Ye(h, F, be, Ee);
214
- me(async () => {
215
- await V(), e.closeOnHashChange && window.addEventListener("hashchange", $);
216
- }), $e(() => {
217
- e.closeOnHashChange && window.removeEventListener("hashchange", $);
218
- });
219
- function $() {
220
- m.value && (m.value = !1, V(() => {
221
- n.action && o("action", n.action);
222
- }));
223
- }
224
- const ee = () => {
225
- e.closeOnClickModal && H(n.distinguishCancelAndClose ? "close" : "cancel");
226
- }, Be = Ge(ee), ke = (a) => {
227
- if (n.inputType !== "textarea")
228
- return a.preventDefault(), H("confirm");
229
- }, H = (a) => {
230
- var g;
231
- e.boxType === "prompt" && a === "confirm" && !ne() || (n.action = a, n.beforeClose ? (g = n.beforeClose) == null || g.call(n, a, n, $) : $());
232
- }, ne = () => {
233
- if (e.boxType === "prompt") {
234
- const a = n.inputPattern;
235
- if (a && !a.test(n.inputValue || ""))
236
- return n.editorErrorMessage = n.inputErrorMessage || c("el.messagebox.error"), n.validateError = !0, !1;
237
- const g = n.inputValidator;
238
- if (Z(g)) {
239
- const v = g(n.inputValue);
240
- if (v === !1)
241
- return n.editorErrorMessage = n.inputErrorMessage || c("el.messagebox.error"), n.validateError = !0, !1;
242
- if (Y(v))
243
- return n.editorErrorMessage = v, n.validateError = !0, !1;
244
- }
245
- }
246
- return n.editorErrorMessage = "", n.validateError = !1, !0;
247
- }, Te = () => {
248
- var a, g;
249
- const v = (a = y.value) == null ? void 0 : a.$refs;
250
- return (g = v == null ? void 0 : v.input) != null ? g : v == null ? void 0 : v.textarea;
251
- }, oe = () => {
252
- H("close");
253
- }, Me = () => {
254
- e.closeOnPressEscape && oe();
255
- };
256
- return e.lockScroll && qe(m), {
257
- ...ze(n),
258
- ns: l,
259
- overlayEvent: Be,
260
- visible: m,
261
- hasMessage: _,
262
- typeClass: M,
263
- contentId: d,
264
- inputId: P,
265
- btnSize: s,
266
- iconComponent: D,
267
- confirmButtonClasses: Ce,
268
- rootRef: h,
269
- focusStartRef: p,
270
- headerRef: F,
271
- inputRef: y,
272
- isDragging: we,
273
- confirmRef: x,
274
- doClose: $,
275
- handleClose: oe,
276
- onCloseRequested: Me,
277
- handleWrapperClick: ee,
278
- handleInputEnter: ke,
279
- handleAction: H,
280
- t: c
281
- };
282
- }
283
- });
284
- function sn(e, o, t, i, l, s) {
285
- const c = z("el-icon"), u = z("el-input"), m = z("el-button"), n = z("el-focus-trap"), M = z("el-overlay");
286
- return f(), C(Le, {
287
- name: "fade-in-linear",
288
- onAfterLeave: (d) => e.$emit("vanish"),
289
- persisted: ""
290
- }, {
291
- default: E(() => [
292
- U(A(M, {
293
- "z-index": e.zIndex,
294
- "overlay-class": [e.ns.is("message-box"), e.modalClass],
295
- mask: e.modal
296
- }, {
297
- default: E(() => [
298
- b("div", {
299
- role: "dialog",
300
- "aria-label": e.title,
301
- "aria-modal": "true",
302
- "aria-describedby": e.showInput ? void 0 : e.contentId,
303
- class: r(`${e.ns.namespace.value}-overlay-message-box`),
304
- onClick: e.overlayEvent.onClick,
305
- onMousedown: e.overlayEvent.onMousedown,
306
- onMouseup: e.overlayEvent.onMouseup
307
- }, [
308
- A(n, {
309
- loop: "",
310
- trapped: e.visible,
311
- "focus-trap-el": e.rootRef,
312
- "focus-start-el": e.focusStartRef,
313
- onReleaseRequested: e.onCloseRequested
314
- }, {
315
- default: E(() => [
316
- b("div", {
317
- ref: "rootRef",
318
- class: r([
319
- e.ns.b(),
320
- e.customClass,
321
- e.ns.is("draggable", e.draggable),
322
- e.ns.is("dragging", e.isDragging),
323
- { [e.ns.m("center")]: e.center }
324
- ]),
325
- style: G(e.customStyle),
326
- tabindex: "-1",
327
- onClick: K(() => {
328
- }, ["stop"])
329
- }, [
330
- e.title !== null && e.title !== void 0 ? (f(), j("div", {
331
- key: 0,
332
- ref: "headerRef",
333
- class: r([e.ns.e("header"), { "show-close": e.showClose }])
334
- }, [
335
- b("div", {
336
- class: r(e.ns.e("title"))
337
- }, [
338
- e.iconComponent && e.center ? (f(), C(c, {
339
- key: 0,
340
- class: r([e.ns.e("status"), e.typeClass])
341
- }, {
342
- default: E(() => [
343
- (f(), C(I(e.iconComponent)))
344
- ]),
345
- _: 1
346
- }, 8, ["class"])) : S("v-if", !0),
347
- b("span", null, L(e.title), 1)
348
- ], 2),
349
- e.showClose ? (f(), j("button", {
350
- key: 0,
351
- type: "button",
352
- class: r(e.ns.e("headerbtn")),
353
- "aria-label": e.t("el.messagebox.close"),
354
- onClick: (d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"),
355
- onKeydown: N(K((d) => e.handleAction(e.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
356
- }, [
357
- A(c, {
358
- class: r(e.ns.e("close"))
359
- }, {
360
- default: E(() => [
361
- (f(), C(I(e.closeIcon || "close")))
362
- ]),
363
- _: 1
364
- }, 8, ["class"])
365
- ], 42, ["aria-label", "onClick", "onKeydown"])) : S("v-if", !0)
366
- ], 2)) : S("v-if", !0),
367
- b("div", {
368
- id: e.contentId,
369
- class: r(e.ns.e("content"))
370
- }, [
371
- b("div", {
372
- class: r(e.ns.e("container"))
373
- }, [
374
- e.iconComponent && !e.center && e.hasMessage ? (f(), C(c, {
375
- key: 0,
376
- class: r([e.ns.e("status"), e.typeClass])
377
- }, {
378
- default: E(() => [
379
- (f(), C(I(e.iconComponent)))
380
- ]),
381
- _: 1
382
- }, 8, ["class"])) : S("v-if", !0),
383
- e.hasMessage ? (f(), j("div", {
384
- key: 1,
385
- class: r(e.ns.e("message"))
386
- }, [
387
- pe(e.$slots, "default", {}, () => [
388
- e.dangerouslyUseHTMLString ? (f(), C(I(e.showInput ? "label" : "p"), {
389
- key: 1,
390
- for: e.showInput ? e.inputId : void 0,
391
- innerHTML: e.message
392
- }, null, 8, ["for", "innerHTML"])) : (f(), C(I(e.showInput ? "label" : "p"), {
393
- key: 0,
394
- for: e.showInput ? e.inputId : void 0,
395
- textContent: L(e.message)
396
- }, null, 8, ["for", "textContent"]))
397
- ])
398
- ], 2)) : S("v-if", !0)
399
- ], 2),
400
- U(b("div", {
401
- class: r(e.ns.e("input"))
402
- }, [
403
- A(u, {
404
- id: e.inputId,
405
- ref: "inputRef",
406
- modelValue: e.inputValue,
407
- "onUpdate:modelValue": (d) => e.inputValue = d,
408
- type: e.inputType,
409
- placeholder: e.inputPlaceholder,
410
- "aria-invalid": e.validateError,
411
- class: r({ invalid: e.validateError }),
412
- onKeydown: N(e.handleInputEnter, ["enter"])
413
- }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
414
- b("div", {
415
- class: r(e.ns.e("errormsg")),
416
- style: G({
417
- visibility: e.editorErrorMessage ? "visible" : "hidden"
418
- })
419
- }, L(e.editorErrorMessage), 7)
420
- ], 2), [
421
- [q, e.showInput]
422
- ])
423
- ], 10, ["id"]),
424
- b("div", {
425
- class: r(e.ns.e("btns"))
426
- }, [
427
- e.showCancelButton ? (f(), C(m, {
428
- key: 0,
429
- loading: e.cancelButtonLoading,
430
- "loading-icon": e.cancelButtonLoadingIcon,
431
- class: r([e.cancelButtonClass]),
432
- round: e.roundButton,
433
- size: e.btnSize,
434
- onClick: (d) => e.handleAction("cancel"),
435
- onKeydown: N(K((d) => e.handleAction("cancel"), ["prevent"]), ["enter"])
436
- }, {
437
- default: E(() => [
438
- le(L(e.cancelButtonText || e.t("el.messagebox.cancel")), 1)
439
- ]),
440
- _: 1
441
- }, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : S("v-if", !0),
442
- U(A(m, {
443
- ref: "confirmRef",
444
- type: "primary",
445
- loading: e.confirmButtonLoading,
446
- "loading-icon": e.confirmButtonLoadingIcon,
447
- class: r([e.confirmButtonClasses]),
448
- round: e.roundButton,
449
- disabled: e.confirmButtonDisabled,
450
- size: e.btnSize,
451
- onClick: (d) => e.handleAction("confirm"),
452
- onKeydown: N(K((d) => e.handleAction("confirm"), ["prevent"]), ["enter"])
453
- }, {
454
- default: E(() => [
455
- le(L(e.confirmButtonText || e.t("el.messagebox.confirm")), 1)
456
- ]),
457
- _: 1
458
- }, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
459
- [q, e.showConfirmButton]
460
- ])
461
- ], 2)
462
- ], 14, ["onClick"])
463
- ]),
464
- _: 3
465
- }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
466
- ], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
467
- ]),
468
- _: 3
469
- }, 8, ["z-index", "overlay-class", "mask"]), [
470
- [q, e.visible]
471
- ])
472
- ]),
473
- _: 3
474
- }, 8, ["onAfterLeave"]);
475
- }
476
- var ln = /* @__PURE__ */ he(tn, [["render", sn], ["__file", "index.vue"]]);
477
- const O = /* @__PURE__ */ new Map(), an = (e) => {
478
- let o = document.body;
479
- return e.appendTo && (Y(e.appendTo) && (o = document.querySelector(e.appendTo)), ie(e.appendTo) && (o = e.appendTo), ie(o) || (o = document.body)), o;
480
- }, rn = (e, o, t = null) => {
481
- const i = A(ln, e, Z(e.message) || ge(e.message) ? {
482
- default: Z(e.message) ? e.message : () => e.message
483
- } : null);
484
- return i.appContext = t, ve(i, o), an(e).appendChild(o.firstElementChild), i.component;
485
- }, un = () => document.createElement("div"), cn = (e, o) => {
486
- const t = un();
487
- e.onVanish = () => {
488
- ve(null, t), O.delete(l);
489
- }, e.onAction = (s) => {
490
- const c = O.get(l);
491
- let u;
492
- e.showInput ? u = { value: l.inputValue, action: s } : u = s, e.callback ? e.callback(u, i.proxy) : s === "cancel" || s === "close" ? e.distinguishCancelAndClose && s !== "cancel" ? c.reject("close") : c.reject("cancel") : c.resolve(u);
493
- };
494
- const i = rn(e, t, o), l = i.proxy;
495
- for (const s in e)
496
- ae(e, s) && !ae(l.$props, s) && (s === "closeIcon" && ye(e[s]) ? l[s] = W(e[s]) : l[s] = e[s]);
497
- return l.visible = !0, l;
498
- };
499
- function R(e, o = null) {
500
- if (!De)
501
- return Promise.reject();
502
- let t;
503
- return Y(e) || ge(e) ? e = {
504
- message: e
505
- } : t = e.callback, new Promise((i, l) => {
506
- const s = cn(e, o ?? R._context);
507
- O.set(s, {
508
- options: e,
509
- callback: t,
510
- resolve: i,
511
- reject: l
512
- });
513
- });
514
- }
515
- const dn = ["alert", "confirm", "prompt"], fn = {
516
- alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
517
- confirm: { showCancelButton: !0 },
518
- prompt: { showCancelButton: !0, showInput: !0 }
519
- };
520
- dn.forEach((e) => {
521
- R[e] = mn(e);
522
- });
523
- function mn(e) {
524
- return (o, t, i, l) => {
525
- let s = "";
526
- return ye(t) ? (i = t, s = "") : X(t) ? s = "" : s = t, R(Object.assign({
527
- title: s,
528
- message: o,
529
- type: "",
530
- ...fn[e]
531
- }, i, {
532
- boxType: e
533
- }), l);
534
- };
535
- }
536
- R.close = () => {
537
- O.forEach((e, o) => {
538
- o.doClose();
539
- }), O.clear();
540
- };
541
- R._context = null;
542
- const B = R;
543
- B.install = (e) => {
544
- B._context = e._context, e.config.globalProperties.$msgbox = B, e.config.globalProperties.$messageBox = B, e.config.globalProperties.$alert = B.alert, e.config.globalProperties.$confirm = B.confirm, e.config.globalProperties.$prompt = B.prompt;
545
- };
546
- const Sn = B;
547
- export {
548
- Sn as E,
549
- Mn as a
550
- };
@@ -1,144 +0,0 @@
1
- <!-- 设置资料 -->
2
- <script setup>
3
- import { ref, reactive, inject } from "vue";
4
- import { getUserData } from "st-func";
5
-
6
- const stConfig = inject("stConfig");
7
- const emit = defineEmits(["callBack"]);
8
- const userData = reactive(getUserData());
9
-
10
- const visible = ref(false);
11
- const ruleFormRef = ref();
12
- const ruleForm = reactive({
13
- nickName: "",
14
- email: "",
15
- mobile: "",
16
- });
17
- const rules = reactive({
18
- nickName: [
19
- { required: true, message: "请输入昵称", trigger: "blur" },
20
- {
21
- validator: (rule, value, callback) => {
22
- if (/[\s@<>&%]/.test(value)) {
23
- callback("昵称不能包含空格、@、<、>、&、%等特殊字符");
24
- } else if (value && value.length > 10) {
25
- callback("昵称长度不能超过10个字符");
26
- } else {
27
- callback();
28
- }
29
- },
30
- trigger: "blur",
31
- },
32
- ],
33
- email: [
34
- {
35
- validator: (rule, value, callback) => {
36
- if (value && !/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(value)) {
37
- callback("邮箱格式错误");
38
- } else {
39
- callback();
40
- }
41
- },
42
- trigger: "blur",
43
- },
44
- ],
45
- mobile: [
46
- { required: true, message: "请输入手机号", trigger: "blur" },
47
- {
48
- validator: (rule, value, callback) => {
49
- const regex = /^1[3-9]\d{9}$/;
50
- if (regex.test(value)) {
51
- callback();
52
- } else {
53
- callback("手机号格式错误");
54
- }
55
- },
56
- trigger: "blur",
57
- },
58
- ],
59
- });
60
-
61
- // 提交
62
- const handleSubmit = (formEl) => {
63
- if (!formEl) return;
64
- formEl.validate(async (valid) => {
65
- if (!valid) return false;
66
- // 仅传递修改过的字段
67
- const params = {
68
- ...ruleForm,
69
- userId: userData.id,
70
- username: userData.username,
71
- };
72
- if (params.nickName === userData.nickName) delete params.nickName;
73
- if (params.email === userData.email) delete params.email;
74
- if (params.mobile === userData.mobile) delete params.mobile;
75
- await stConfig.request.post("/invest/sys/user/updateUserInfo", params);
76
- ElMessage.success(`资料修改成功!`);
77
- visible.value = false;
78
- // 设置成功的回调函数
79
- emit("callBack", ruleForm);
80
- });
81
- };
82
-
83
- defineExpose({
84
- open: () => {
85
- Object.assign(userData, getUserData());
86
- Object.assign(ruleForm, {
87
- nickName: userData.nickName,
88
- email: userData.email,
89
- mobile: userData.mobile,
90
- });
91
- visible.value = true;
92
- },
93
- });
94
- </script>
95
-
96
- <template>
97
- <div class="edit-info">
98
- <el-dialog
99
- v-model="visible"
100
- title="设置资料"
101
- width="460"
102
- destroy-on-close
103
- :z-index="200"
104
- >
105
- <el-form
106
- ref="ruleFormRef"
107
- :rules="rules"
108
- :model="ruleForm"
109
- label-width="auto"
110
- :validate-on-rule-change="false"
111
- @submit.native.prevent="handleSubmit(ruleFormRef)"
112
- @keyup.enter.native="handleSubmit(ruleFormRef)"
113
- >
114
- <el-form-item
115
- label="昵称"
116
- prop="nickName"
117
- >
118
- <el-input v-model="ruleForm.nickName" />
119
- </el-form-item>
120
- <el-form-item
121
- label="邮箱"
122
- prop="email"
123
- >
124
- <el-input v-model="ruleForm.email" />
125
- </el-form-item>
126
- <el-form-item
127
- label="手机号"
128
- prop="mobile"
129
- >
130
- <el-input v-model="ruleForm.mobile" />
131
- </el-form-item>
132
- </el-form>
133
- <template #footer>
134
- <el-button @click="visible = false"> 取消 </el-button>
135
- <el-button
136
- type="primary"
137
- @click="handleSubmit(ruleFormRef)"
138
- >
139
- 确认
140
- </el-button>
141
- </template>
142
- </el-dialog>
143
- </div>
144
- </template>