joy-admin-components 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +1,1276 @@
1
- import { ElForm as d, ElRow as i, ElCol as s } from "element-plus";
2
- import { defineComponent as c, ref as y, onMounted as g, h as r } from "vue";
3
- const u = c({
4
- name: "JoyForm",
5
- setup(o, { slots: t, attrs: n, emit: m }) {
6
- const f = y(null), a = () => t.default ? t.default().filter((e) => e.type !== Symbol.for("v-cmt")).map((e) => e.type === Symbol.for("v-fgt") ? e.children : e).flat().map(
7
- (e) => {
8
- var l;
9
- return r(
10
- s,
11
- { span: ((l = e.props) == null ? void 0 : l.span) || 24 },
1
+ import { ElForm as Se, ElRow as xe, ElCol as Te, dayjs as re } from "element-plus";
2
+ import { defineComponent as ce, ref as F, onMounted as ue, h as X, mergeModels as ie, useAttrs as De, useModel as Oe, computed as J, resolveComponent as x, openBlock as w, createBlock as D, mergeProps as W, unref as B, withCtx as T, renderSlot as Y, createVNode as E, createTextVNode as R, toDisplayString as H, createCommentVNode as P, createElementBlock as A, Fragment as te, renderList as fe, withModifiers as ne, nextTick as de, createElementVNode as M, resolveDynamicComponent as he, withKeys as ze, normalizeStyle as Ee, normalizeClass as oe, reactive as ee, onUnmounted as Ue } from "vue";
3
+ import { difference as Ie, debounce as ge, cloneDeep as Ve } from "lodash";
4
+ import { useI18n as ae } from "vue-i18n";
5
+ import V from "crypto-js";
6
+ import { saveAs as Fe } from "file-saver";
7
+ import me from "exceljs";
8
+ import pe from "dayjs";
9
+ const vt = ce({
10
+ name: "LayOutForm",
11
+ setup(n, { slots: e, attrs: t, emit: o }) {
12
+ const a = F(null), c = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
13
+ (u) => {
14
+ var r;
15
+ return X(
16
+ Te,
17
+ { span: ((r = u.props) == null ? void 0 : r.span) || 24 },
12
18
  {
13
- default: () => e
19
+ default: () => u
14
20
  }
15
21
  );
16
22
  }
17
23
  ) : null;
18
- g(() => {
19
- m("ref", f.value);
24
+ ue(() => {
25
+ o("ref", a.value);
20
26
  });
21
- function p() {
22
- return r(
23
- d,
24
- { ...n, ref: f },
25
- () => r(i, { gutter: n.gutter ?? 20 }, { default: () => a() })
27
+ function l() {
28
+ return X(
29
+ Se,
30
+ { ...t, ref: a },
31
+ () => X(xe, { gutter: t.gutter ?? 20 }, { default: () => c() })
26
32
  );
27
33
  }
28
- return p;
34
+ return l;
29
35
  }
30
- }), S = {
31
- install: (o) => {
32
- o.component(u.name, u);
36
+ });
37
+ const K = (n, e) => {
38
+ const t = n.__vccOpts || n;
39
+ for (const [o, a] of e)
40
+ t[o] = a;
41
+ return t;
42
+ }, Le = {
43
+ __name: "index",
44
+ props: /* @__PURE__ */ ie({
45
+ api: {
46
+ type: Function
47
+ },
48
+ showCheckAll: {
49
+ type: Boolean,
50
+ default: !0
51
+ },
52
+ optionClick: {
53
+ type: Function
54
+ },
55
+ maxLimit: {
56
+ type: Number,
57
+ default: void 0
58
+ },
59
+ minLimit: {
60
+ type: Number,
61
+ default: void 0
62
+ },
63
+ data: {
64
+ type: Array
65
+ },
66
+ labelValue: {
67
+ type: Object,
68
+ default: () => ({
69
+ label: "label",
70
+ labelEn: "labelEn",
71
+ value: "value"
72
+ })
73
+ },
74
+ changeLocal: {
75
+ type: Boolean,
76
+ default: !1
77
+ }
78
+ }, {
79
+ modelValue: {},
80
+ modelModifiers: {}
81
+ }),
82
+ emits: /* @__PURE__ */ ie(["success", "change"], ["update:modelValue"]),
83
+ setup(n, { emit: e }) {
84
+ const t = n, o = De(), { t: a, locale: c } = ae(), l = Oe(n, "modelValue"), u = J({
85
+ get() {
86
+ if (o.multiple == null || l.value == null)
87
+ return !1;
88
+ let f = t.data ? t.data : v.value, i = Ie(
89
+ f.map((m) => o["value-key"] ? m : m[t.labelValue.value]),
90
+ l.value
91
+ ).length == 0;
92
+ return l.value.length == f.length && i;
93
+ },
94
+ set(f) {
95
+ return f;
96
+ }
97
+ }), r = e, v = F([]), p = async () => {
98
+ const { data: f } = await t.api();
99
+ v.value = [...f], r("success", v);
100
+ };
101
+ t.api && p();
102
+ const k = t.labelValue.label.split("-"), d = (f) => {
103
+ if (k.length == 1) {
104
+ if (t.changeLocal)
105
+ return a(f[t.labelValue.label]);
106
+ let i = c.value == "en_us" ? f[t.labelValue.labelEn || "i18nName"] : f[t.labelValue.label];
107
+ return i = i || f[t.labelValue.label], i;
108
+ } else {
109
+ let i = [];
110
+ return k.forEach((m) => {
111
+ i.push(f[m]);
112
+ }), i.join("-");
113
+ }
114
+ };
115
+ function b(f) {
116
+ let i = t.data ? t.data : v.value;
117
+ l.value = f ? i.map((m) => o["value-key"] ? m : m[t.labelValue.value]) : [], de(() => {
118
+ r("change", l.value);
119
+ });
120
+ }
121
+ function h(f) {
122
+ t.optionClick && t.optionClick(f), t.optionClick && r("change", o["value-key"] ? f : f[t.labelValue.value]);
123
+ }
124
+ function s(f) {
125
+ r("change", f);
126
+ }
127
+ function g(f) {
128
+ return o.multiple != null && o.multiple != !1 && t.maxLimit > 0 ? l.value.length >= t.maxLimit && !l.value.includes(f[t.labelValue.value]) : o.multiple != null && o.multiple != !1 && t.minLimit > 0 ? l.value.length <= t.minLimit && l.value.includes(f[t.labelValue.value]) : !1;
129
+ }
130
+ return (f, i) => {
131
+ const m = x("el-checkbox"), $ = x("el-option"), C = x("el-select");
132
+ return w(), D(C, W({
133
+ modelValue: l.value,
134
+ "onUpdate:modelValue": i[1] || (i[1] = (S) => l.value = S)
135
+ }, B(o), {
136
+ filterable: "",
137
+ "collapse-tags": "",
138
+ "collapse-tags-tooltip": "",
139
+ clearable: "",
140
+ onClear: s,
141
+ onChange: s
142
+ }), {
143
+ default: T(() => [
144
+ B(o).multiple != null && B(o).multiple != !1 && n.showCheckAll ? Y(f.$slots, "header", { key: 0 }, () => [
145
+ E(m, {
146
+ class: "mgl20",
147
+ modelValue: u.value,
148
+ "onUpdate:modelValue": i[0] || (i[0] = (S) => u.value = S),
149
+ onChange: b
150
+ }, {
151
+ default: T(() => [
152
+ R(H(f.$t("quan-xuan")), 1)
153
+ ]),
154
+ _: 1
155
+ }, 8, ["modelValue"])
156
+ ], !0) : P("", !0),
157
+ (w(!0), A(te, null, fe(n.data ? n.data : v.value, (S, O) => (w(), D($, {
158
+ key: O,
159
+ disabled: g(S),
160
+ label: d(S),
161
+ onClick: ne((U) => h(S), ["stop"]),
162
+ value: B(o)["value-key"] ? S : S[n.labelValue.value]
163
+ }, null, 8, ["disabled", "label", "onClick", "value"]))), 128))
164
+ ]),
165
+ _: 3
166
+ }, 16, ["modelValue"]);
167
+ };
168
+ }
169
+ }, Ae = /* @__PURE__ */ K(Le, [["__scopeId", "data-v-02dd2f72"]]), yt = {
170
+ __name: "index",
171
+ emits: ["ok", "no"],
172
+ setup(n, { emit: e }) {
173
+ const t = e, o = ge(() => {
174
+ t("ok");
175
+ }, 500);
176
+ function a() {
177
+ t("no");
178
+ }
179
+ return (c, l) => {
180
+ const u = x("el-link"), r = x("el-popconfirm");
181
+ return w(), D(r, W(c.$attrs, {
182
+ onConfirm: B(o),
183
+ onCancel: a
184
+ }), {
185
+ reference: T(() => [
186
+ E(u, {
187
+ underline: "never",
188
+ type: c.$attrs.type
189
+ }, {
190
+ default: T(() => [
191
+ Y(c.$slots, "default")
192
+ ]),
193
+ _: 3
194
+ }, 8, ["type"])
195
+ ]),
196
+ _: 3
197
+ }, 16, ["onConfirm"]);
198
+ };
199
+ }
200
+ };
201
+ const Me = ["accept"], Ye = {
202
+ __name: "index",
203
+ props: {
204
+ accept: {
205
+ type: String,
206
+ default: ".xlsx,.xls"
207
+ },
208
+ loading: {
209
+ type: Boolean,
210
+ default: !1
211
+ }
212
+ },
213
+ emits: ["fileChange"],
214
+ setup(n, { emit: e }) {
215
+ const t = e, o = F(null);
216
+ function a(c) {
217
+ let l = c.target.files[0];
218
+ t("fileChange", l), o.value.value = null;
219
+ }
220
+ return (c, l) => {
221
+ const u = x("el-button");
222
+ return w(), A("span", null, [
223
+ E(u, {
224
+ loading: n.loading,
225
+ class: "mgr10",
226
+ onClick: l[0] || (l[0] = (r) => o.value.click())
227
+ }, {
228
+ default: T(() => [
229
+ R(H(c.$t("dao-ru")), 1)
230
+ ]),
231
+ _: 1
232
+ }, 8, ["loading"]),
233
+ M("input", {
234
+ onChange: a,
235
+ ref_key: "input",
236
+ ref: o,
237
+ accept: n.accept,
238
+ style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
239
+ type: "file"
240
+ }, null, 40, Me)
241
+ ]);
242
+ };
243
+ }
244
+ }, Ct = /* @__PURE__ */ K(Ye, [["__scopeId", "data-v-5f1449ad"]]);
245
+ const Pe = ce({
246
+ props: {
247
+ name: {
248
+ tyepe: String,
249
+ required: !0
250
+ }
251
+ }
252
+ });
253
+ function je(n, e, t, o, a, c) {
254
+ const l = x("el-icon");
255
+ return w(), D(l, { class: "cmp-icon" }, {
256
+ default: T(() => [
257
+ (w(), D(he(n.name)))
258
+ ]),
259
+ _: 1
260
+ });
261
+ }
262
+ const ve = /* @__PURE__ */ K(Pe, [["render", je], ["__scopeId", "data-v-733f9daa"]]);
263
+ const Be = { key: 0 }, Re = { class: "btns" }, He = { class: "left" }, Ne = { class: "right" }, Ke = {
264
+ __name: "index",
265
+ props: {
266
+ form: {
267
+ type: Object,
268
+ required: !0
269
+ }
270
+ },
271
+ emits: ["confirm", "reset"],
272
+ setup(n, { emit: e }) {
273
+ const t = e, o = F(!0), a = F(null), { t: c } = ae(), l = J(() => o.value ? c("guan-bi") : c("zhan-kai"));
274
+ function u() {
275
+ t("confirm");
276
+ }
277
+ function r() {
278
+ t("reset");
279
+ }
280
+ function v() {
281
+ t("confirm");
282
+ }
283
+ return (p, k) => {
284
+ const d = x("el-input"), b = x("el-date-picker"), h = x("el-form-item"), s = x("el-form"), g = x("el-link"), f = x("el-button");
285
+ return w(), A("div", {
286
+ class: "searchBar-container mgt10 mgb10",
287
+ onKeydown: ze(u, ["enter"])
288
+ }, [
289
+ M("div", {
290
+ class: "searchBar",
291
+ style: Ee({ height: o.value ? "auto" : "42px" })
292
+ }, [
293
+ E(s, {
294
+ inline: "",
295
+ model: n.form.data
296
+ }, {
297
+ default: T(() => [
298
+ (w(!0), A(te, null, fe(n.form.items.filter((i) => !i.hidden), (i) => (w(), A(te, {
299
+ key: i.key
300
+ }, [
301
+ i.type == "br" ? (w(), A("br", Be)) : (w(), D(h, {
302
+ key: 1,
303
+ label: i.name
304
+ }, {
305
+ default: T(() => {
306
+ var m, $;
307
+ return [
308
+ i.type === "input" ? (w(), D(d, {
309
+ key: 0,
310
+ modelValue: i.value,
311
+ "onUpdate:modelValue": (C) => i.value = C,
312
+ class: oe(((m = i.option) == null ? void 0 : m.class) || "w150"),
313
+ placeholder: p.$t("qing-shu-ru"),
314
+ clearable: ""
315
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : i.type === "custom" ? (w(), D(he(i.render), { key: 1 })) : P("", !0),
316
+ i.type === "select" ? (w(), D(Ae, W({
317
+ key: 2,
318
+ class: (($ = i.option) == null ? void 0 : $.class) || "w150",
319
+ modelValue: i.value,
320
+ "onUpdate:modelValue": (C) => i.value = C
321
+ }, { ref_for: !0 }, i.option, {
322
+ onChange: u,
323
+ onClear: u
324
+ }), null, 16, ["class", "modelValue", "onUpdate:modelValue"])) : P("", !0),
325
+ i.type === "date" ? (w(), D(b, {
326
+ key: 3,
327
+ class: oe({ datetimerange: "w300", daterange: "w200" }[i.dateType] || "w100"),
328
+ modelValue: i.value,
329
+ "onUpdate:modelValue": (C) => i.value = C,
330
+ "value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[i.dateType] || "YYYY-MM-DD",
331
+ type: i.dateType || "date",
332
+ onFocus: (C) => a.value = i,
333
+ onChange: (C) => v(),
334
+ placeholder: p.$t("qing-xuan-ze"),
335
+ "start-placeholder": p.$t("kai-shi-shi-jian"),
336
+ "end-placeholder": p.$t("jie-shu-shi-jian")
337
+ }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : P("", !0)
338
+ ];
339
+ }),
340
+ _: 2
341
+ }, 1032, ["label"]))
342
+ ], 64))), 128))
343
+ ]),
344
+ _: 1
345
+ }, 8, ["model"])
346
+ ], 4),
347
+ M("div", Re, [
348
+ M("div", He, [
349
+ Y(p.$slots, "table-header-left", {}, void 0, !0)
350
+ ]),
351
+ M("div", Ne, [
352
+ E(g, {
353
+ underline: "never",
354
+ class: "mgr10",
355
+ onClick: k[0] || (k[0] = (i) => o.value = !o.value)
356
+ }, {
357
+ default: T(() => [
358
+ E(ve, {
359
+ name: o.value ? "ArrowUp" : "ArrowDown"
360
+ }, null, 8, ["name"]),
361
+ R(" " + H(l.value), 1)
362
+ ]),
363
+ _: 1
364
+ }),
365
+ E(f, {
366
+ type: "primary",
367
+ onClick: u
368
+ }, {
369
+ default: T(() => [
370
+ R(H(p.$t("shai-xuan")), 1)
371
+ ]),
372
+ _: 1
373
+ }),
374
+ E(f, {
375
+ type: "primary",
376
+ onClick: r
377
+ }, {
378
+ default: T(() => [
379
+ R(H(p.$t("chong-zhi")), 1)
380
+ ]),
381
+ _: 1
382
+ }),
383
+ Y(p.$slots, "btn", {}, void 0, !0)
384
+ ])
385
+ ])
386
+ ], 32);
387
+ };
33
388
  }
389
+ }, qe = /* @__PURE__ */ K(Ke, [["__scopeId", "data-v-f3f60f9c"]]);
390
+ function Ze(n) {
391
+ return n ? Array.isArray(n) ? n : n.split(",").map((e) => e.trim()).filter(Boolean) : [];
392
+ }
393
+ function Z(n) {
394
+ let e = {};
395
+ return n.forEach((t) => {
396
+ const { key: o, type: a, option: c = {}, value: l, dateType: u, toArr: r } = t;
397
+ if (a == "input" && (c != null && c.multiple))
398
+ e[o] = Ze(l);
399
+ else if (a == "date")
400
+ if (u.includes("range")) {
401
+ const [v, p] = o;
402
+ let [k, d] = l || [];
403
+ k && u == "daterange" && (k = re(k).format("YYYY-MM-DD 00:00:00"), d = re(d).format("YYYY-MM-DD 23:59:59")), e[v] = k, e[p] = d;
404
+ } else
405
+ e[o] = l;
406
+ else
407
+ a == "select" ? e[o] = r ? [l] : l : e[o] = l;
408
+ }), e;
409
+ }
410
+ const Je = { class: "center" }, We = {
411
+ __name: "index",
412
+ props: {
413
+ // 表格id 本地存储列设置时使用
414
+ id: {
415
+ type: String,
416
+ required: !0
417
+ },
418
+ loading: {
419
+ type: Boolean,
420
+ default: !1
421
+ },
422
+ // 是否立即请求
423
+ immediate: {
424
+ type: Boolean,
425
+ default: !0
426
+ },
427
+ searchForm: {
428
+ type: Object,
429
+ default: () => ({
430
+ items: [],
431
+ selections: [],
432
+ showSearch: !1,
433
+ showPage: !1,
434
+ showShadow: !1,
435
+ showCheckBox: !1
436
+ })
437
+ },
438
+ api: {
439
+ type: Function
440
+ },
441
+ data: {
442
+ type: Array
443
+ },
444
+ tableConfig: {
445
+ type: Object,
446
+ default: () => ({})
447
+ }
448
+ },
449
+ setup(n, { expose: e }) {
450
+ const { t, locale: o } = ae(), a = n, c = F(!1), l = F([]), u = Ve(a.searchForm.items), r = ee({
451
+ pageNo: 1,
452
+ pageSize: 10,
453
+ total: 0
454
+ }), v = F(null), p = F(450), k = ge(() => {
455
+ de(() => {
456
+ if (!v.value)
457
+ return;
458
+ const _ = v.value.getBoundingClientRect(), z = window.innerHeight, L = _.top, j = 100, G = z - L - j, Q = 200;
459
+ p.value = Math.max(G, Q);
460
+ });
461
+ }, 100), d = () => {
462
+ k();
463
+ };
464
+ ue(() => {
465
+ k(), window.addEventListener("resize", d);
466
+ }), Ue(() => {
467
+ window.removeEventListener("resize", d);
468
+ });
469
+ const b = J(() => C.value.height || p.value);
470
+ async function h(y) {
471
+ const { dataFormat: _ } = a.tableConfig;
472
+ c.value = !0;
473
+ const { code: z, data: L = {} } = await a.api(y).finally(() => {
474
+ c.value = !1, a.searchForm.selections = [];
475
+ });
476
+ if (z == 200) {
477
+ let j = L.rows || [];
478
+ l.value = _ ? _(j) : j, r.total = L.totalRows || 0;
479
+ }
480
+ }
481
+ function s(y = {}) {
482
+ h({ ...r, ...Z(a.searchForm.items), ...y });
483
+ }
484
+ async function g() {
485
+ const { reset: y } = a.tableConfig;
486
+ a.searchForm.items.forEach((_) => {
487
+ const z = u.find((L) => L.key == _.key);
488
+ z && (_.value = z.value);
489
+ }), y && await y(), s();
490
+ }
491
+ a.api && a.immediate && s();
492
+ function f() {
493
+ return { ...r, ...Z(a.searchForm.items) };
494
+ }
495
+ const i = F(null);
496
+ e({ tableRef: i, getList: s, getPrm: f, calculateTableHeight: k });
497
+ const m = ee({
498
+ storage: !0
499
+ }), $ = ee({
500
+ drag: !0,
501
+ resizable: !0,
502
+ maxFixedSize: 0
503
+ }), C = J(() => {
504
+ const {
505
+ customConfig: y,
506
+ columnConfig: _,
507
+ ...z
508
+ } = a.tableConfig;
509
+ return {
510
+ headerAlign: "left",
511
+ align: "center",
512
+ customConfig: { ...m, ...y },
513
+ "column-config": { ...$, ..._ },
514
+ // 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
515
+ "virtual-x-config": {
516
+ enabled: !1,
517
+ scrollToLeftOnChange: !0
518
+ },
519
+ // 纵向虚拟滚动 大于100条开启
520
+ "virtual-y-config": { enabled: !0, gt: 100 },
521
+ ...z
522
+ };
523
+ }), S = (y) => {
524
+ r.pageNo = y, h({ ...r, ...Z(a.searchForm.items) });
525
+ }, O = (y) => {
526
+ r.pageSize = y, r.pageNo = 1, h({ ...r, ...Z(a.searchForm.items) });
527
+ };
528
+ function U() {
529
+ const y = i.value.getCheckboxRecords();
530
+ a.searchForm.selections = y;
531
+ }
532
+ const I = (y) => {
533
+ const _ = i.value;
534
+ if (_) {
535
+ _.toggleCheckboxRow(y);
536
+ const z = i.value.getCheckboxRecords();
537
+ a.searchForm.selections = z;
538
+ }
539
+ };
540
+ return (y, _) => {
541
+ const z = x("el-button"), L = x("el-checkbox"), j = x("el-text"), G = x("vxe-column"), Q = x("VxeTable"), ke = x("el-pagination");
542
+ return w(), A("div", {
543
+ class: oe({ box: n.searchForm.showShadow })
544
+ }, [
545
+ n.searchForm.showSearch ? (w(), D(qe, {
546
+ key: 0,
547
+ form: n.searchForm,
548
+ onReset: g,
549
+ onConfirm: _[1] || (_[1] = (N) => s())
550
+ }, {
551
+ btn: T(() => [
552
+ Y(y.$slots, "search-bar-btn", {}, void 0, !0),
553
+ E(z, {
554
+ round: "",
555
+ onClick: _[0] || (_[0] = (N) => i.value.openCustom())
556
+ }, {
557
+ default: T(() => [
558
+ E(ve, { name: "Tools" })
559
+ ]),
560
+ _: 1
561
+ })
562
+ ]),
563
+ _: 3
564
+ }, 8, ["form"])) : P("", !0),
565
+ Y(y.$slots, "table-header-left", {}, void 0, !0),
566
+ M("div", {
567
+ ref_key: "tableContentRef",
568
+ ref: v
569
+ }, [
570
+ E(Q, W({
571
+ id: n.id,
572
+ ref_key: "tableRef",
573
+ ref: i,
574
+ loading: n.loading || c.value,
575
+ data: n.api ? l.value : n.data
576
+ }, C.value, {
577
+ height: b.value,
578
+ onCheckboxChange: U,
579
+ onCheckboxAll: U,
580
+ border: ""
581
+ }), {
582
+ default: T(() => [
583
+ n.searchForm.showCheckBox ? (w(), D(G, {
584
+ key: 0,
585
+ type: "checkbox",
586
+ width: B(o) == "zh_cn" ? 80 : 150,
587
+ fixed: "left",
588
+ title: y.$t("xu-hao")
589
+ }, {
590
+ checkbox: T(({ rowIndex: N, row: le, checked: we, disabled: q, indeterminate: st }) => [
591
+ M("div", Je, [
592
+ we ? (w(), D(L, {
593
+ key: 0,
594
+ checked: !0,
595
+ disabled: q,
596
+ size: "default",
597
+ onClick: ne(($e) => !q && I(le), ["stop"])
598
+ }, null, 8, ["disabled", "onClick"])) : (w(), D(L, {
599
+ key: 1,
600
+ disabled: q,
601
+ checked: !1,
602
+ size: "default",
603
+ onClick: ne(($e) => !q && I(le), ["stop"])
604
+ }, null, 8, ["disabled", "onClick"])),
605
+ E(j, {
606
+ type: "info",
607
+ class: "mgl5"
608
+ }, {
609
+ default: T(() => [
610
+ R(H(N + 1), 1)
611
+ ]),
612
+ _: 2
613
+ }, 1024)
614
+ ])
615
+ ]),
616
+ _: 1
617
+ }, 8, ["width", "title"])) : P("", !0),
618
+ Y(y.$slots, "default", {}, void 0, !0)
619
+ ]),
620
+ _: 3
621
+ }, 16, ["id", "loading", "data", "height"])
622
+ ], 512),
623
+ n.searchForm.showPage ? (w(), D(ke, {
624
+ key: 1,
625
+ "current-page": r.pageNo,
626
+ "onUpdate:currentPage": _[2] || (_[2] = (N) => r.pageNo = N),
627
+ class: "myPagination mgt10",
628
+ background: "",
629
+ layout: "total, sizes, prev, pager, next",
630
+ total: r.total,
631
+ "page-size": r.pageSize,
632
+ "page-sizes": [10, 50, 100, 500],
633
+ onCurrentChange: S,
634
+ onSizeChange: O
635
+ }, null, 8, ["current-page", "total", "page-size"])) : P("", !0)
636
+ ], 2);
637
+ };
638
+ }
639
+ }, bt = /* @__PURE__ */ K(We, [["__scopeId", "data-v-7b74503d"]]);
640
+ function _t(n, e = {}) {
641
+ const t = {
642
+ inForm: !0,
643
+ required: !0,
644
+ ...e
645
+ }, o = {
646
+ phone: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
647
+ password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
648
+ email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
649
+ }[n], { inForm: a, value: c, required: l, msg: u = "请输入正确内容" } = t;
650
+ return a ? function(r, v, p) {
651
+ if (l) {
652
+ o.test(v) ? p() : p(new Error(u));
653
+ return;
654
+ }
655
+ v && !o.test(v) ? p(new Error(u)) : p();
656
+ } : o.test(c);
657
+ }
658
+ const kt = {
659
+ //加密
660
+ encrypt(n, e) {
661
+ e = e || "1CFEC667A1E6D42DC12565AAAA460494";
662
+ var t = V.enc.Utf8.parse(e), o = V.enc.Utf8.parse(n), a = V.AES.encrypt(o, t, {
663
+ mode: V.mode.ECB,
664
+ padding: V.pad.Pkcs7
665
+ });
666
+ return a.toString();
667
+ },
668
+ //解密
669
+ decrypt(n, e) {
670
+ e = e || "1CFEC667A1E6D42DC12565AAAA460494";
671
+ var t = V.enc.Utf8.parse(e), o = V.AES.decrypt(n, t, {
672
+ mode: V.mode.ECB,
673
+ padding: V.pad.Pkcs7
674
+ });
675
+ return V.enc.Utf8.stringify(o).toString();
676
+ }
677
+ };
678
+ var ye = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
679
+ function Ce(n) {
680
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
681
+ }
682
+ var be = { exports: {} };
683
+ (function(n, e) {
684
+ (function(t, o) {
685
+ n.exports = o();
686
+ })(ye, function() {
687
+ var t = "minute", o = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g;
688
+ return function(c, l, u) {
689
+ var r = l.prototype;
690
+ u.utc = function(s) {
691
+ var g = { date: s, utc: !0, args: arguments };
692
+ return new l(g);
693
+ }, r.utc = function(s) {
694
+ var g = u(this.toDate(), { locale: this.$L, utc: !0 });
695
+ return s ? g.add(this.utcOffset(), t) : g;
696
+ }, r.local = function() {
697
+ return u(this.toDate(), { locale: this.$L, utc: !1 });
698
+ };
699
+ var v = r.parse;
700
+ r.parse = function(s) {
701
+ s.utc && (this.$u = !0), this.$utils().u(s.$offset) || (this.$offset = s.$offset), v.call(this, s);
702
+ };
703
+ var p = r.init;
704
+ r.init = function() {
705
+ if (this.$u) {
706
+ var s = this.$d;
707
+ this.$y = s.getUTCFullYear(), this.$M = s.getUTCMonth(), this.$D = s.getUTCDate(), this.$W = s.getUTCDay(), this.$H = s.getUTCHours(), this.$m = s.getUTCMinutes(), this.$s = s.getUTCSeconds(), this.$ms = s.getUTCMilliseconds();
708
+ } else
709
+ p.call(this);
710
+ };
711
+ var k = r.utcOffset;
712
+ r.utcOffset = function(s, g) {
713
+ var f = this.$utils().u;
714
+ if (f(s))
715
+ return this.$u ? 0 : f(this.$offset) ? k.call(this) : this.$offset;
716
+ if (typeof s == "string" && (s = function(C) {
717
+ C === void 0 && (C = "");
718
+ var S = C.match(o);
719
+ if (!S)
720
+ return null;
721
+ var O = ("" + S[0]).match(a) || ["-", 0, 0], U = O[0], I = 60 * +O[1] + +O[2];
722
+ return I === 0 ? 0 : U === "+" ? I : -I;
723
+ }(s), s === null))
724
+ return this;
725
+ var i = Math.abs(s) <= 16 ? 60 * s : s;
726
+ if (i === 0)
727
+ return this.utc(g);
728
+ var m = this.clone();
729
+ if (g)
730
+ return m.$offset = i, m.$u = !1, m;
731
+ var $ = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
732
+ return (m = this.local().add(i + $, t)).$offset = i, m.$x.$localOffset = $, m;
733
+ };
734
+ var d = r.format;
735
+ r.format = function(s) {
736
+ var g = s || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
737
+ return d.call(this, g);
738
+ }, r.valueOf = function() {
739
+ var s = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
740
+ return this.$d.valueOf() - 6e4 * s;
741
+ }, r.isUTC = function() {
742
+ return !!this.$u;
743
+ }, r.toISOString = function() {
744
+ return this.toDate().toISOString();
745
+ }, r.toString = function() {
746
+ return this.toDate().toUTCString();
747
+ };
748
+ var b = r.toDate;
749
+ r.toDate = function(s) {
750
+ return s === "s" && this.$offset ? u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : b.call(this);
751
+ };
752
+ var h = r.diff;
753
+ r.diff = function(s, g, f) {
754
+ if (s && this.$u === s.$u)
755
+ return h.call(this, s, g, f);
756
+ var i = this.local(), m = u(s).local();
757
+ return h.call(i, m, g, f);
758
+ };
759
+ };
760
+ });
761
+ })(be);
762
+ var Ge = be.exports;
763
+ const Qe = /* @__PURE__ */ Ce(Ge);
764
+ var _e = { exports: {} };
765
+ (function(n, e) {
766
+ (function(t, o) {
767
+ n.exports = o();
768
+ })(ye, function() {
769
+ var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, o = {};
770
+ return function(a, c, l) {
771
+ var u, r = function(d, b, h) {
772
+ h === void 0 && (h = {});
773
+ var s = new Date(d), g = function(f, i) {
774
+ i === void 0 && (i = {});
775
+ var m = i.timeZoneName || "short", $ = f + "|" + m, C = o[$];
776
+ return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: f, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: m }), o[$] = C), C;
777
+ }(b, h);
778
+ return g.formatToParts(s);
779
+ }, v = function(d, b) {
780
+ for (var h = r(d, b), s = [], g = 0; g < h.length; g += 1) {
781
+ var f = h[g], i = f.type, m = f.value, $ = t[i];
782
+ $ >= 0 && (s[$] = parseInt(m, 10));
783
+ }
784
+ var C = s[3], S = C === 24 ? 0 : C, O = s[0] + "-" + s[1] + "-" + s[2] + " " + S + ":" + s[4] + ":" + s[5] + ":000", U = +d;
785
+ return (l.utc(O).valueOf() - (U -= U % 1e3)) / 6e4;
786
+ }, p = c.prototype;
787
+ p.tz = function(d, b) {
788
+ d === void 0 && (d = u);
789
+ var h, s = this.utcOffset(), g = this.toDate(), f = g.toLocaleString("en-US", { timeZone: d }), i = Math.round((g - new Date(f)) / 1e3 / 60), m = 15 * -Math.round(g.getTimezoneOffset() / 15) - i;
790
+ if (!Number(m))
791
+ h = this.utcOffset(0, b);
792
+ else if (h = l(f, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(m, !0), b) {
793
+ var $ = h.utcOffset();
794
+ h = h.add(s - $, "minute");
795
+ }
796
+ return h.$x.$timezone = d, h;
797
+ }, p.offsetName = function(d) {
798
+ var b = this.$x.$timezone || l.tz.guess(), h = r(this.valueOf(), b, { timeZoneName: d }).find(function(s) {
799
+ return s.type.toLowerCase() === "timezonename";
800
+ });
801
+ return h && h.value;
802
+ };
803
+ var k = p.startOf;
804
+ p.startOf = function(d, b) {
805
+ if (!this.$x || !this.$x.$timezone)
806
+ return k.call(this, d, b);
807
+ var h = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
808
+ return k.call(h, d, b).tz(this.$x.$timezone, !0);
809
+ }, l.tz = function(d, b, h) {
810
+ var s = h && b, g = h || b || u, f = v(+l(), g);
811
+ if (typeof d != "string")
812
+ return l(d).tz(g);
813
+ var i = function(S, O, U) {
814
+ var I = S - 60 * O * 1e3, y = v(I, U);
815
+ if (O === y)
816
+ return [I, O];
817
+ var _ = v(I -= 60 * (y - O) * 1e3, U);
818
+ return y === _ ? [I, y] : [S - 60 * Math.min(y, _) * 1e3, Math.max(y, _)];
819
+ }(l.utc(d, s).valueOf(), f, g), m = i[0], $ = i[1], C = l(m).utcOffset($);
820
+ return C.$x.$timezone = g, C;
821
+ }, l.tz.guess = function() {
822
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
823
+ }, l.tz.setDefault = function(d) {
824
+ u = d;
825
+ };
826
+ };
827
+ });
828
+ })(_e);
829
+ var Xe = _e.exports;
830
+ const et = /* @__PURE__ */ Ce(Xe);
831
+ pe.extend(Qe);
832
+ pe.extend(et);
833
+ async function wt(n, e) {
834
+ const { fields: t, range: o = 1 } = e;
835
+ if (!t)
836
+ throw new Error("请输入列字段映射");
837
+ let a = new me.Workbook();
838
+ await a.xlsx.load(n);
839
+ const c = {};
840
+ return a.eachSheet(function(l, u) {
841
+ const r = [];
842
+ l.eachRow(function(v, p) {
843
+ if (p > o) {
844
+ let k = {}, d = !0;
845
+ Object.keys(t).forEach((b) => {
846
+ const h = v.getCell(t[b]).value;
847
+ k[b] = h, h && (d = !1);
848
+ }), d || r.push(k);
849
+ }
850
+ }), c[l._name] = r;
851
+ }), a = null, c;
852
+ }
853
+ const tt = {
854
+ columnWidth: 30
34
855
  };
856
+ async function $t(n, e, t = [], o = {}) {
857
+ if (!n || !e)
858
+ return;
859
+ const { columnStyle: a } = o, { columnWidth: c } = tt;
860
+ e.forEach((r) => {
861
+ r.width = r.width ? r.width : c;
862
+ });
863
+ const { workbook: l, worksheet: u } = nt();
864
+ u.columns = e, u.addRows(t), a && await ot(l, u, a);
865
+ try {
866
+ const r = await l.xlsx.writeBuffer(), v = new File([r], n, {
867
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
868
+ });
869
+ Fe(v);
870
+ } catch (r) {
871
+ console.log(r);
872
+ }
873
+ }
874
+ function nt() {
875
+ const n = new me.Workbook();
876
+ n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
877
+ const e = n.addWorksheet("Sheet1");
878
+ return { workbook: n, worksheet: e };
879
+ }
880
+ async function ot(n, e, t) {
881
+ const o = Object.keys(t);
882
+ for (const a of o) {
883
+ const c = t[a], { type: l } = c;
884
+ switch (l) {
885
+ case "IMG":
886
+ await at(n, e, a);
887
+ break;
888
+ }
889
+ }
890
+ }
891
+ async function at(n, e, t, o) {
892
+ const a = e.getColumn(t), c = a.values;
893
+ e.getColumn(t).width = 20, e.eachRow((l, u) => {
894
+ u > 1 && (l.height = 40);
895
+ });
896
+ for (let l = 0, u = c.length; l < u; l++) {
897
+ if (l < 2)
898
+ continue;
899
+ let r = c[l];
900
+ r && (e.getCell(a.letter + l).value = "", await lt(n, e, r, {
901
+ width: 100,
902
+ height: 50,
903
+ col: a._number - 1,
904
+ row: l - 1
905
+ }));
906
+ }
907
+ }
908
+ async function lt(n, e, t, o) {
909
+ const { col: a, row: c, width: l, height: u } = o, { success: r, base64: v } = await rt(t, 0.3);
910
+ if (r) {
911
+ const p = n.addImage({
912
+ base64: v,
913
+ extension: "jpeg"
914
+ });
915
+ e.addImage(p, {
916
+ tl: { col: a, row: c },
917
+ ext: { width: l, height: u }
918
+ });
919
+ }
920
+ }
921
+ function rt(n, e = 1) {
922
+ const t = new Image();
923
+ return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((o, a) => {
924
+ t.onload = () => {
925
+ const c = document.createElement("canvas");
926
+ c.width = t.width, c.height = t.height, c.getContext("2d").drawImage(t, 0, 0, c.width, c.height), o({
927
+ success: !0,
928
+ //canvas.toDataURL的方法将图片的绝对路径转换为base64编码
929
+ base64: c.toDataURL("image/jpeg", e)
930
+ });
931
+ }, t.onerror = () => {
932
+ o({ success: !1 });
933
+ };
934
+ });
935
+ }
936
+ function it(n) {
937
+ if (n < 26)
938
+ return String.fromCharCode(65 + n);
939
+ {
940
+ const e = String.fromCharCode(65 + Math.floor((n - 26) / 26)), t = String.fromCharCode(65 + (n - 26) % 26);
941
+ return e + t;
942
+ }
943
+ }
944
+ class St {
945
+ constructor(e = {}) {
946
+ this.config = {
947
+ clientCode: e.clientCode || "one-portal",
948
+ casServerUrl: `https://one-portal${e.isTest ? "-test" : ""}.joy-group.com/api`,
949
+ casPortalUrl: `https://one-portal${e.isTest ? "-test" : ""}.joy-group.com`,
950
+ serviceUrl: e.serviceUrl || window.location.origin + "/cas/callback",
951
+ tokenKey: e.tokenKey || "one_portal_token",
952
+ userKey: e.userKey || "one_portal_user",
953
+ debug: e.debug || !1,
954
+ autoLogin: e.autoLogin !== !1,
955
+ // 默认开启自动登录
956
+ loginCallback: e.loginCallback || null,
957
+ logoutCallback: e.logoutCallback || null,
958
+ errorCallback: e.errorCallback || null
959
+ }, this.token = null, this.user = null, this.init();
960
+ }
961
+ /**
962
+ * 初始化SDK
963
+ */
964
+ init() {
965
+ this.log("OnePortal CAS SDK 初始化中..."), this.loadFromStorage();
966
+ const t = new URLSearchParams(window.location.search).get("ticket");
967
+ this.isLoggedIn() && this.config.loginCallback ? this.config.loginCallback(this.user, this.token) : t ? (this.log("检测到ST票据:", t), this.validateTicket(t)) : this.config.autoLogin && !this.isLoggedIn() && (this.log("用户未登录,准备跳转到CAS登录页面"), this.login());
968
+ }
969
+ /**
970
+ * 从本地存储加载数据
971
+ */
972
+ loadFromStorage() {
973
+ try {
974
+ this.token = localStorage.getItem(this.config.tokenKey);
975
+ const e = localStorage.getItem(this.config.userKey);
976
+ e && (this.user = JSON.parse(e)), this.log("从本地存储加载数据:", { token: !!this.token, user: !!this.user });
977
+ } catch (e) {
978
+ this.log("加载本地存储数据失败:", e);
979
+ }
980
+ }
981
+ /**
982
+ * 保存到本地存储
983
+ */
984
+ saveToStorage() {
985
+ try {
986
+ this.token && localStorage.setItem(this.config.tokenKey, this.token), this.user && localStorage.setItem(this.config.userKey, JSON.stringify(this.user)), this.log("数据已保存到本地存储");
987
+ } catch (e) {
988
+ this.log("保存到本地存储失败:", e);
989
+ }
990
+ }
991
+ /**
992
+ * 清除本地存储
993
+ */
994
+ clearStorage() {
995
+ try {
996
+ localStorage.removeItem(this.config.tokenKey), localStorage.removeItem(this.config.userKey), this.log("本地存储已清除");
997
+ } catch (e) {
998
+ this.log("清除本地存储失败:", e);
999
+ }
1000
+ }
1001
+ /**
1002
+ * 检查用户是否已登录
1003
+ */
1004
+ isLoggedIn() {
1005
+ return !!(this.token && this.user);
1006
+ }
1007
+ /**
1008
+ * 获取当前用户信息
1009
+ */
1010
+ getUser() {
1011
+ return this.user;
1012
+ }
1013
+ /**
1014
+ * 获取当前token
1015
+ */
1016
+ getToken() {
1017
+ return this.token;
1018
+ }
1019
+ /**
1020
+ * 登录 - 跳转到CAS登录页面
1021
+ */
1022
+ login() {
1023
+ const e = `${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;
1024
+ this.log("跳转到CAS登录页面:", e), window.location.href = e;
1025
+ }
1026
+ /**
1027
+ * 验证ST票据
1028
+ */
1029
+ async validateTicket(e) {
1030
+ try {
1031
+ this.log("验证ST票据:", e);
1032
+ const t = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${e}`, {
1033
+ method: "GET",
1034
+ headers: {
1035
+ "Content-Type": "application/json"
1036
+ }
1037
+ });
1038
+ if (!t.ok)
1039
+ throw new Error(`HTTP ${t.status}: ${t.statusText}`);
1040
+ const o = await t.json();
1041
+ if (o.success && o.data)
1042
+ return this.token = o.data.token, this.user = o.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
1043
+ throw new Error(o.message || "ST票据验证失败");
1044
+ } catch (t) {
1045
+ return this.log("ST票据验证失败:", t), this.handleError(t), !1;
1046
+ }
1047
+ }
1048
+ /**
1049
+ * 清除URL中的ticket参数
1050
+ */
1051
+ clearTicketFromUrl() {
1052
+ const e = new URL(window.location);
1053
+ e.searchParams.delete("ticket"), window.history.replaceState({}, document.title, e.toString());
1054
+ }
1055
+ /**
1056
+ * 登出
1057
+ */
1058
+ async logout(e = !0) {
1059
+ try {
1060
+ if (this.log("用户登出"), this.token)
1061
+ try {
1062
+ await fetch(`${this.config.casServerUrl}/auth/logout`, {
1063
+ method: "POST",
1064
+ headers: {
1065
+ AppId: this.config.clientCode,
1066
+ Authorization: `Bearer ${this.token}`,
1067
+ "Content-Type": "application/json"
1068
+ }
1069
+ });
1070
+ } catch (t) {
1071
+ this.log("调用服务端登出接口失败:", t);
1072
+ }
1073
+ this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), e && this.login();
1074
+ } catch (t) {
1075
+ this.log("登出失败:", t), this.handleError(t);
1076
+ }
1077
+ }
1078
+ /**
1079
+ * 发送带认证的HTTP请求
1080
+ */
1081
+ async request(e, t = {}) {
1082
+ const o = {
1083
+ headers: {
1084
+ "Content-Type": "application/json",
1085
+ ...t.headers
1086
+ },
1087
+ ...t
1088
+ };
1089
+ o.headers.appId = this.config.clientCode, this.token && (o.headers.Authorization = `Bearer ${this.token}`);
1090
+ try {
1091
+ const a = await fetch(e, o);
1092
+ return a.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : a;
1093
+ } catch (a) {
1094
+ throw this.log("请求失败:", a), a;
1095
+ }
1096
+ }
1097
+ /**
1098
+ * 获取用户信息(从服务端)
1099
+ */
1100
+ async fetchUserInfo() {
1101
+ try {
1102
+ const e = await this.request(`${this.config.casServerUrl}/auth/user`);
1103
+ if (e && e.ok) {
1104
+ const t = await e.json();
1105
+ if (t.success && t.data)
1106
+ return this.user = t.data, this.saveToStorage(), this.user;
1107
+ }
1108
+ return null;
1109
+ } catch (e) {
1110
+ return this.log("获取用户信息失败:", e), null;
1111
+ }
1112
+ }
1113
+ /**
1114
+ * 刷新token
1115
+ */
1116
+ async refreshToken() {
1117
+ this.log("Token刷新功能暂未实现");
1118
+ }
1119
+ /**
1120
+ * 错误处理
1121
+ */
1122
+ handleError(e) {
1123
+ this.log("发生错误:", e), this.config.errorCallback && this.config.errorCallback(e);
1124
+ }
1125
+ /**
1126
+ * 日志输出
1127
+ */
1128
+ log(...e) {
1129
+ this.config.debug && console.log("[OnePortal CAS SDK]", ...e);
1130
+ }
1131
+ /**
1132
+ * 检查登录状态并自动处理
1133
+ */
1134
+ checkLoginStatus() {
1135
+ return !this.isLoggedIn() && this.config.autoLogin ? (this.login(), !1) : this.isLoggedIn();
1136
+ }
1137
+ /**
1138
+ * 设置配置
1139
+ */
1140
+ setConfig(e, t) {
1141
+ this.config[e] = t;
1142
+ }
1143
+ /**
1144
+ * 获取配置
1145
+ */
1146
+ getConfig(e) {
1147
+ return this.config[e];
1148
+ }
1149
+ }
1150
+ function xt(n) {
1151
+ return new Promise((e) => {
1152
+ setTimeout(() => {
1153
+ e();
1154
+ }, n);
1155
+ });
1156
+ }
1157
+ function Tt(n) {
1158
+ return JSON.parse(JSON.stringify(n));
1159
+ }
1160
+ function Dt(n) {
1161
+ let e = [], t = {}, o = (a, c) => Object.prototype.hasOwnProperty.call(a, c);
1162
+ for (const a of n) {
1163
+ t[a.id] = {
1164
+ ...a,
1165
+ // 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
1166
+ children: o(t, a.id) ? t[a.id].children : []
1167
+ };
1168
+ const c = t[a.id];
1169
+ a.pid == -1 ? e.push(c) : (o(t, a.pid) || (t[a.pid] = {
1170
+ children: []
1171
+ }), t[a.pid].children.push(c));
1172
+ }
1173
+ return e;
1174
+ }
1175
+ function Ot(n, e = " ") {
1176
+ return n ? n.split(e).filter((t) => t.trim()) : [];
1177
+ }
1178
+ class se {
1179
+ constructor(e, t = ["label", "value", "labelEn"]) {
1180
+ this.list = e, this.map = new Map(
1181
+ e.map((o) => {
1182
+ let a = {
1183
+ ...o,
1184
+ label: o[t[0]],
1185
+ value: o[t[1]]
1186
+ };
1187
+ return t[2] && (a.labelEn = o[t[2]]), [o[t[1]], a];
1188
+ })
1189
+ );
1190
+ }
1191
+ getName(e, t) {
1192
+ if (!this.has(e))
1193
+ return "-";
1194
+ const { label: o, labelEn: a } = this.map.get(e);
1195
+ return (t == "zh_cn" ? o : a) || o || "-";
1196
+ }
1197
+ getTag(e) {
1198
+ if (!this.has(e))
1199
+ return "info";
1200
+ const { tag: t = "info" } = this.map.get(e);
1201
+ return t;
1202
+ }
1203
+ getItem(e) {
1204
+ return this.has(e) ? this.map.get(e) : null;
1205
+ }
1206
+ getColor(e) {
1207
+ if (!this.has(e))
1208
+ return null;
1209
+ const { color: t } = this.map.get(e);
1210
+ return t;
1211
+ }
1212
+ has(e) {
1213
+ return this.map.has(e);
1214
+ }
1215
+ }
1216
+ function zt(n, e = [], t = "i18nName") {
1217
+ if (n.length == 0)
1218
+ return new se([]);
1219
+ if (e.length < 2)
1220
+ throw new Error("keys 长度必须大于2 默认前两位为 label value ");
1221
+ let o = n.map((a) => {
1222
+ let c = {};
1223
+ return t && (c.labelEn = a[t]), e.forEach((l, u) => {
1224
+ u === 0 ? c.label = a[l] : u === 1 ? c.value = a[l] : c[l] = a[l];
1225
+ }), c;
1226
+ });
1227
+ return new se(o);
1228
+ }
1229
+ function Et(n) {
1230
+ return n ? n.replace(/<[^>]+>/g, "") : "";
1231
+ }
1232
+ function Ut(n) {
1233
+ return n ? (n.includes("\\\\u") && (n = n.replace(/\\/g, "")), n.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
1234
+ }
1235
+ function It(n, e = 10) {
1236
+ let t = 1048576 * e;
1237
+ return !(n.size > t);
1238
+ }
1239
+ function Vt(n) {
1240
+ return Array.from(10).fill(0).map((t, o) => n + "_" + o);
1241
+ }
1242
+ function Ft(n) {
1243
+ let e = {};
1244
+ return n.map((t, o) => {
1245
+ let { key: a, option: c, type: l } = t, u = it(o);
1246
+ c ? e[a] = `${u}---option` : l === "image" ? e[a] = `${u}---image` : e[a] = u;
1247
+ }), e;
1248
+ }
1249
+ function Lt(n, e) {
1250
+ return e.split(".").reduce((t, o) => t && t[o], n);
1251
+ }
35
1252
  export {
36
- u as JoyForm,
37
- S as default
1253
+ Ae as CmpDictionary,
1254
+ yt as ConfrimButton,
1255
+ Ct as ImportButton,
1256
+ vt as LayOutForm,
1257
+ bt as ListPage,
1258
+ St as OnePortalCasSDK,
1259
+ qe as SearchBar,
1260
+ se as StatusMap,
1261
+ Tt as _toRaw,
1262
+ zt as arrToStatusMap,
1263
+ Dt as arrayToTree,
1264
+ It as checkFileSize,
1265
+ _t as creatValidator,
1266
+ Ft as createImportFields,
1267
+ Vt as createListPageId,
1268
+ kt as crypto,
1269
+ $t as exportExcel,
1270
+ Lt as getValueBykey,
1271
+ wt as importExcel,
1272
+ xt as sleep,
1273
+ Ot as stringToArray,
1274
+ Et as stripHtmlTags,
1275
+ Ut as unicode2Str
38
1276
  };