PageSourceSearch

https://asketch.ai/_nuxt/B8K-oq3O.js

js asketch.ai collected 2026-10-05 11:51:49 UTC 18,992 bytes, 560 lines download raw bytes

1import { i as N, __tla as __tla_0 } from "./CevamKTt.js";
2import { U as X, __tla as __tla_1 } from "./Cu7fDzXn.js";
3import { fQ as Y, iv as Z, fy as J, cY as x, dD as K, dT as ee, ev as te, ew as se, ex as ne, eO as oe, eS as ae, f_ as le, cq as _, bm as re, le as ie, __tla as __tla_2 } from "./D9BjAukf.js";
4import { __tla as __tla_3 } from "./DJ8WZ0_y.js";
5import { V as de, __tla as __tla_4 } from "./DeRgj6Pb.js";
6import { Z as ce, __tla as __tla_5 } from "./BvSKRw6S.js";
7import { _ as ue, __tla as __tla_6 } from "./_Dt5YUcv.js";
8let $e;
9let __tla = Promise.all([
10  (() => {
11    try {
12      return __tla_0;
13    } catch {
14    }
15  })(),
16  (() => {
17    try {
18      return __tla_1;
19    } catch {
20    }
21  })(),
22  (() => {
23    try {
24      return __tla_2;
25    } catch {
26    }
27  })(),
28  (() => {
29    try {
30      return __tla_3;
31    } catch {
32    }
33  })(),
34  (() => {
35    try {
36      return __tla_4;
37    } catch {
38    }
39  })(),
40  (() => {
41    try {
42      return __tla_5;
43    } catch {
44    }
45  })(),
46  (() => {
47    try {
48      return __tla_6;
49    } catch {
50    }
51  })()
52]).then(async () => {
53  let me, c, Fe, v, A, L, E, i, m, u, d, g, pe, fe, k, _e, ve, ge, be, ye, Ce, he, we, xe, ke, Ve, Se, je, b, Ue, Le;
54  ({ defineComponent: me } = await N("vue"));
55  ({ unref: c, resolveComponent: Fe, openBlock: v, createBlock: A, createCommentVNode: L, isRef: E, createVNode: i, createElementVNode: m, createTextVNode: u, withCtx: d, toDisplayString: g, renderList: pe, Fragment: fe, createElementBlock: k } = await N("vue"));
56  _e = {
57    class: "flex align-center justify-between my-2 mb-4"
58  };
59  ve = {
60    class: "flex align-center gap-4"
61  };
62  ge = {
63    key: 0
64  };
65  be = {
66    class: "flex justify-between mb-4"
67  };
68  ye = {
69    class: "text-theme-success"
70  };
71  Ce = {
72    class: "font-bold"
73  };
74  he = {
75    class: "text-theme-error"
76  };
77  we = {
78    class: "font-bold"
79  };
80  xe = {
81    key: 0,
82    class: "mb-4"
83  };
84  ke = {
85    class: "p-3 rounded max-h-40 overflow-auto"
86  };
87  Ve = {
88    class: "flex flex-wrap gap-2"
89  };
90  Se = {
91    key: 1
92  };
93  je = {
94    class: "flex justify-between items-center mb-2"
95  };
96  ({ ref: b, onMounted: Ue } = await N("vue"));
97  Le = 5;
98  $e = me({
99    __name: "usermanage",
100    setup(Re) {
101      const p = b(), y = b(false), C = b([]), V = b(""), h = b([]), R = b(false), { organizationTreeList: O } = Y(), T = Z(), w = async () => {
102        R.value = true;
103        try {
104          const o = h.value.length > 0 ? h.value.join(",") : void 0;
105          C.value = await le(V.value, o);
106        } finally {
107          R.value = false;
108        }
109      };
110      Ue(() => {
111        w();
112      });
113      const F = () => {
114        w();
115      }, $ = () => {
116        const e = [
117          [
118            "username",
119            "password",
120            "email",
121            "mobile",
122            "balance"
123          ].join(","),
124          "user1,12345678,[email protected],13800000001,1000",
125          "user2,12345678,[email protected],,800",
126          "user3,12345678,,13800000003,1000",
127          "user4,12345678,,,800"
128        ].join(`
129`), r = new Blob([
130          e
131        ], {
132          type: "text/csv;charset=utf-8;"
133        }), s = URL.createObjectURL(r), a = document.createElement("a");
134        a.href = s, a.setAttribute("download", "\u7528\u6237\u5BFC\u5165\u6A21\u677F.csv"), document.body.appendChild(a), a.click(), document.body.removeChild(a), _({
135          message: "\u6A21\u677F\u4E0B\u8F7D\u6210\u529F\uFF01",
136          type: "success"
137        });
138      }, z = (o) => {
139        if (!(o.type === "text/csv" || o.name.endsWith(".csv"))) return _({
140          message: "\u53EA\u80FD\u4E0A\u4F20 CSV \u6587\u4EF6!",
141          type: "error"
142        }), false;
143        const r = new FileReader();
144        return r.readAsText(o), r.onload = (s) => {
145          var _a;
146          try {
147            const a = (_a = s.target) == null ? void 0 : _a.result, f = I(a);
148            if (f.length === 0) {
149              _({
150                message: "CSV\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E\u6216\u4E3A\u7A7A!",
151                type: "error"
152              });
153              return;
154            }
155            M(f);
156          } catch (a) {
157            _({
158              message: `\u89E3\u6790CSV\u6587\u4EF6\u5931\u8D25: ${a 
158instanceof Error ? a.message : String(a)}`,
159              type: "error"
160            });
161          }
162        }, false;
163      }, I = (o) => {
164        var _a;
165        const e = o.split(`
166`), r = [], s = e[0];
167        if (!s) return [];
168        const a = s.trim().split(",");
169        if (![
170          "username",
171          "email",
172          "mobile"
173        ].every((t) => a.includes(t))) return [];
174        for (let t = 1; t < e.length; t++) {
175          const S = (_a = e[t]) == null ? void 0 : _a.trim();
176          if (!S) continue;
177          const j = S.split(",");
178          if (j.length < a.length) continue;
179          const U = {};
180          a.forEach((B, D) => {
181            var _a2;
182            Object.assign(U, {
183              [B]: ((_a2 = j[D]) == null ? void 0 : _a2.trim()) || ""
184            });
185          }), r.push(U);
186        }
187        return r;
188      }, M = async (o) => {
189        try {
190          re("\u6B63\u5728\u5BFC\u5165\u7528\u6237...");
191          const e = await ie(o);
192          _({
193            message: "\u5BFC\u5165\u5B8C\u6210",
194            type: "success"
195          }), p.value = e, y.value = true, await w();
196        } catch {
197          _({
198            message: "\u5BFC\u5165\u5931\u8D25",
199            type: "error"
200          });
201        }
202      }, q = () => {
203        if (!p.value || !p.value.failedCreations.length) return "";
204        const e = [
205          [
206            "username",
207            "password",
208            "email",
209            "mobile",
210            "balance",
211            "reason"
212          ].join(",")
213        ];
214        return p.value.failedCreations.forEach((r) => {
215          const { user: s, reason: a } = r, f = [
216            s.username || "",
217            s.password || "",
218            s.email || "",
219            s.mobile || "",
220            s.balance || "",
221            `"${a.replace(/"/g, '""')}"`
222          ];
223          e.push(f.join(","));
224        }), e.join(`
225`);
226      }, H = () => {
227        const o = q();
228        if (!o) return;
229        const e = new Blob([
230          o
231        ], {
232          type: "text/csv;charset=utf-8;"
233        }), r = URL.createObjectURL(e), s = document.createElement("a");
234        s.href = r, s.setAttribute("download", `\u5BFC\u5165\u5931\u8D25\u7528\u6237_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`), document.body.appendChild(s), s.click(), document.body.removeChild(s);
235      }, l = (o) => {
236        if (o == null || o === "") return "";
237        const e = String(o);
238        return e.includes(",") || e.includes('"') || e.includes(`
239`) ? `"${e.replace(/"/g, '""')}"` : e;
240      }, P = () => {
241        if (!C.value.length) {
242          _({
243            message: "\u6682\u65E0\u7528\u6237\u6570\u636E\u53EF\u5BFC\u51FA",
244            type: "warning"
245          });
246          return;
247        }
248        const o = [
249          "\u5934\u50CF",
250          "\u7528\u6237\u540D",
251          "\u6635\u79F0",
252          "\u89D2\u8272",
253          "\u7EC4\u7EC7",
254          "\u7528\u6237\u72B6\u6001",
255          "\u90AE\u7BB1",
256          "\u624B\u673A",
257          "\u4F59\u989D",
258          "\u4E0A\u6B21\u767B\u5F55",
259          "\u4E0A\u6B21\u767B\u5F55IP",
260          "\u9080\u8BF7\u8005",
261          "\u6CE8\u518C\u65E5\u671F",
262          "\u4F01\u4E1A\u5FAE\u4FE1ID",
263          "\u98DE\u4E66open_id",
264          "\u98DE\u4E66union_id",
265          "\u5FAE\u4FE1openid",
266          "\u5FAE\u4FE1unionid"
267        ], e = {
268          0: "\u6B63\u5E38",
269          1: "\u7981\u7528",
270          2: "\u5220\u9664"
271        }, r = C.value.map((t) => {
272          var _a;
273          const S = Array.isArray(t.role) ? t.role.join(",") : t.role || "", j = ((_a = t.organizations) == null ? void 0 : _a.map((W) => W == null ? void 0 : W.name).filter(Boolean).join(",")) || "", U = t.status !== void 0 ? e[t.status] ?? String(t.status) : "", B = typeof t.inviter_uid == "object" && t.inviter_uid ? t.inviter_uid.username || "" : typeof t.inviter_uid == "string" ? t.inviter_uid : "", D = t.balance != null ? String(Number(t.balance)) : "", G = t.last_login_date ? new Date(t.last_login_date).toLocaleString() : "", Q = t.register_date ? new Date(t.register_date).toLocaleStr
273ing() : "";
274          return [
275            l(t.avatar_url),
276            l(t.username),
277            l(t.nickname),
278            l(S),
279            l(j),
280            l(U),
281            l(t.email),
282            l(t.mobile),
283            l(D),
284            l(G),
285            l(t.last_login_ip),
286            l(B),
287            l(Q),
288            l(t.qyweixin_userid),
289            l(t.feishu_open_id),
290            l(t.feishu_union_id),
291            l(t.wx_openid),
292            l(t.wx_unionid)
293          ].join(",");
294        }), s = "\uFEFF" + [
295          o.join(","),
296          ...r
297        ].join(`
298`), a = new Blob([
299          s
300        ], {
301          type: "text/csv;charset=utf-8;"
302        }), f = URL.createObjectURL(a), n = document.createElement("a");
303        n.href = f, n.setAttribute("download", `\u7528\u6237\u5217\u8868_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`), document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(f), _({
304          message: `\u5DF2\u5BFC\u51FA ${C.value.length} \u6761\u7528\u6237\u6570\u636E`,
305          type: "success"
306        });
307      };
308      return (o, e) => {
309        const r = ce, s = J, a = ue, f = K;
310        return v(), k("div", null, [
311          c(T) ? L("", true) : (v(), A(r, {
312            key: 0,
313            class: "mb-4",
314            type: "info",
315            "show-icon": "",
316            message: `\u975E\u5546\u7528\u7248\u672C\u6700\u591A\u652F\u6301 ${Le} \u4E2A\u7528\u6237\uFF0C\u8D85\u8FC7\u540E\u5C06\u65E0\u6CD5\u6CE8\u518C\u6216\u5BFC\u5165\u65B0\u7528\u6237\u3002\u5982\u9700\u66F4\u591A\u7528\u6237\u8BF7\u83B7\u53D6\u5546\u7528\u6388\u6743\u3002`
317          }, null, 8, [
318            "message"
319          ])),
320          m("div", _e, [
321            m("div", ve, [
322              i(s, {
323                value: c(V),
324                "onUpdate:value": e[0] || (e[0] = (n) => E(V) ? V.value = n : null),
325                class: "w-96",
326                placeholder: "\u641C\u7D22\u7528\u6237\u540D/\u6635\u79F0/\u624B\u673A/\u90AE\u7BB1",
327                loading: c(R),
328                onSearch: w
329              }, null, 8, [
330                "value",
331                "loading"
332              ]),
333              i(a, {
334                value: c(h),
335                "onUpdate:value": e[1] || (e[1] = (n) => E(h) ? h.value = n : null),
336                multiple: "",
337                "tree-data": c(O),
338                style: {
339                  width: "300px"
340                },
341                "allow-clear": "",
342                "tree-default-expand-all": "",
343                "show-search": "",
344                "tree-node-filter-prop": "label",
345                placeholder: "\u6309\u7EC4\u7EC7\u67B6\u6784\u7B5B\u9009",
346                onChange: w
347              }, null, 8, [
348                "value",
349                "tree-data"
350              ])
351            ]),
352            m("div", null, [
353              i(x, {
354                class: "mr-2",
355                variant: "outlined",
356                color: "primary",
357                size: "small",
358                onClick: P
359              }, {
360                default: d(() => [
361                  ...e[4] || (e[4] = [
362                    u(" \u4E0B\u8F7DCSV ", -1)
363                  ])
364                ]),
365                _: 1
366              }),
367              i(x, {
368                class: "mr-2",
369                variant: "outlined",
370                color: "primary",
371                size: "small",
372                onClick: $
373              }, {
374                default: d(() => [
375                  ...e[5] || (e[5] = [
376                    u(" \u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F ", -1)
377                  ])
378                ]),
379                _: 1
380              }),
381              i(f, {
382                "show-upload-list": false,
383                "before-upload": z,
384                accept: ".csv"
385              }, {
386                default: d(() => [
387                  i(x, {
388                    variant: "flat",
389                    color: "primary",
390                    size: "small"
391                  }, {
392                    default: d(() => [
393                      ...e[6] || (e[6] = [
394                        u(" \u6279\u91CF\u5BFC\u5165\u7528\u6237 ", -1)
395                      ])
396                    ]),
397                    _: 1
398                  })
399                ]),
400                _: 1
401              })
402            ])
403          ]),
404          i(X, {
405            users: c(C),
406            onRefresh: F
407          }, null, 8, [
408            "users"
409          ]),
410          i(ee, {
411            modelValue: c(y),
412            "onUpdate:modelValue": e[3] || (e[3] = (n) => E(y) ? y.value = n : null),
413            width: "1000"
414          }, {
415            default: d(() => [
416              i(te, null, {
417                default: d(() => [
418                  i(se, null, {
419                    default: d(() => [
420                      ...e[7] || (e[7] = [
421                        u("\u7528\u6237\u5BFC\u5165\u7ED3\u679C", -1)
422                      ])
423                    ]),
424                    _: 1
425                  }),
426                  i(ne, null, {
427                    default: d(() => [
428                      c(p) ? (v(), k("div", ge, [
429                        m("div", be, [
430                          m("div", ye, [
431                            e[8] || (e[8] = u(" \u6210\u529F\u5BFC\u5165: ", -1)),
432                            m("span", Ce, g(c(p).successfulCreations.length), 1),
433                            e[9] || (e[9] = u(" \u4E2A\u7528\u6237 ", -1))
434                          ]),
435                          m("div", he, [
436                            e[10] || (e[10] = u(" \u5BFC\u5165\u5931\u8D25: ", -1)),
437                            m("span", we, g(c(p).failedCreations.length), 1),
438                            e[11] || (e[11] = u(" \u4E2A\u7528\u6237 ", -1))
439                          ])
440                        ]),
441                        c(p).successfulCreations.length > 0 ? (v(), k("div", xe, [
442                          e[12] || (e[12] = m("div", {
443                            class: "font-medium mb-2"
444                          }, " \u6210\u529F\u5BFC\u5165\u7684\u7528\u6237: ", -1)),
445                          m("div", ke, [
446                            m("div", Ve, [
447                              (v(true), k(fe, null, pe(c(p).successfulCreations, (n) => (v(), A(oe, {
448                                key: n,
449                                variant: "outlined"
450                              }, {
451                                default: d(() => [
452                                  u(g(n), 1)
453                                ]),
454                                _: 2
455                              }, 1024))), 128))
456                            ])
457                          ])
458                        ])) : L("", true),
459                        c(p).failedCreations.length > 0 ? (v(), k("div", Se, [
460                          m("div", je, [
461                            e[14] || (e[14] = m("div", {
462                              class: "font-medium"
463                            }, " \u5BFC\u5165\u5931\u8D25\u7684\u7528\u6237: ", -1)),
464                            i(x, {
465                              color: "primary",
466                              size: "small",
467                              onClick: H
468                            }, {
469                              default: d(() => [
470                                ...e[13] || (e[13] = [
471                                  u(" \u4E0B\u8F7D\u5931\u8D25\u5217\u8868 ", -1)
472                                ])
473                              ]),
474                              _: 1
475                            })
476                          ]),
477                          i(de, {
478                            items: c(p).failedCreations,
479                            headers: [
480                              {
481                                title: "\u7528\u6237\u540D",
482                                key: "user.username",
483                                align: "start"
484                              },
485                              {
486                                title: "\u90AE\u7BB1",
487                                key: "user.email",
488                                align: "start"
489                              },
490                              {
491                                title: "\u624B\u673A\u53F7",
492                                key: "user.mobile",
493                                align: "start"
494                              },
495                              {
496                                title: "\u4F59\u989D",
497                                key: "user.balance",
498                                align: "start"
499                              },
500                              {
501                                title: "\u5931\u8D25\u539F\u56E0",
502                                key: "reason",
503                                align: "start"
504                              }
505                            ],
506                            "items-per-page": 10
507                          }, {
508                            "item.user.username": d(({ item: n }) => [
509                              u(g(n.user.username), 1)
510                            ]),
511                            "item.user.email": d(({ item: n }) => [
512                              u(g(n.user.email), 1)
513                            ]),
514                            "item.user.mobile": d(({ item: n }) => [
515                              u(g(n.user.mobile), 1)
516                            ]),
517                            _: 1
518                          }, 8, [
519                            "items"
520                          ])
521                        ])) : L("", true)
522                      ])) : L("", true)
523                    ]),
524                    _: 1
525                  }),
526                  i(ae, {
527                    class: "justify-end"
528                  }, {
529                    default: d(() => [
530                      i(x, {
531                        color: "primary",
532                        onClick: e[2] || (e[2] = (n) => y.value = false)
533                      }, {
534                        default: d(() => [
535                          ...e[15] || (e[15] = [
536                            u(" \u5173\u95ED ", -1)
537                          ])
538                        ]),
539                        _: 1
540                      })
541                    ]),
542                    _: 1
543                  })
544                ]),
545                _: 1
546              })
547            ]),
548            _: 1
549          }, 8, [
550            "modelValue"
551          ])
552        ]);
553      };
554    }
555  });
556});
557export {
558  __tla,
559  $e as default
560};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.