cc1-form 1.1.20 → 1.1.23
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/dist/cc1-form.js +592 -484
- package/dist/cc1-form.umd.cjs +1 -1
- package/dist/components/TCurd/com/form/column.vue.d.ts +30 -0
- package/dist/components/TCurd/com/form/list.vue.d.ts +2 -2
- package/dist/components/TCurd/index.d.ts +21 -0
- package/dist/components/TCurd/index.vue.d.ts +88 -0
- package/dist/components/TCurd/indexType.d.ts +20 -1
- package/dist/index.d.ts +2 -1
- package/dist/utils/TFormConfig.d.ts +12 -0
- package/package.json +1 -1
package/dist/cc1-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessage as ye, ElLoading as ge, ElForm as Q, ElFormItem as B, ElInput as q, ElSwitch as ee, ElSelect as J, ElOption as
|
|
1
|
+
import { defineComponent as K, reactive as _, onMounted as ae, resolveComponent as X, createElementBlock as w, createCommentVNode as C, openBlock as f, renderSlot as k, createElementVNode as D, createVNode as v, withCtx as b, createTextVNode as E, Fragment as U, renderList as M, createBlock as y, normalizeClass as T, normalizeStyle as ne, ref as A, nextTick as ue, unref as l, mergeProps as V, toHandlers as O, resolveDynamicComponent as H, toDisplayString as x, getCurrentInstance as ce, createSlots as ie, withKeys as fe, resolveDirective as me, withDirectives as pe, normalizeProps as he, guardReactiveProps as be } from "vue";
|
|
2
|
+
import { ElMessage as ye, ElLoading as ge, ElForm as Q, ElFormItem as B, ElInput as q, ElSwitch as ee, ElSelect as J, ElOption as P, ElTreeSelect as se, ElDatePicker as te, ElDialog as Y, ElButton as F, ElTableColumn as Z, ElDropdown as we, ElDropdownMenu as ke, ElDropdownItem as G, ElTable as Ce, ElPagination as ve } from "element-plus";
|
|
3
3
|
class S {
|
|
4
4
|
/**
|
|
5
5
|
* 全局配置对象
|
|
@@ -251,6 +251,18 @@ class S {
|
|
|
251
251
|
},
|
|
252
252
|
datetime: {
|
|
253
253
|
type: "datetime"
|
|
254
|
+
},
|
|
255
|
+
select: {
|
|
256
|
+
data: [],
|
|
257
|
+
clearable: !0,
|
|
258
|
+
filterable: !0,
|
|
259
|
+
dataPath: "data.data",
|
|
260
|
+
dataApiConfig: {
|
|
261
|
+
once: !0,
|
|
262
|
+
init: !0,
|
|
263
|
+
create: !0,
|
|
264
|
+
update: !0
|
|
265
|
+
}
|
|
254
266
|
}
|
|
255
267
|
}
|
|
256
268
|
}
|
|
@@ -264,7 +276,7 @@ class S {
|
|
|
264
276
|
S.config = ObjectUtil.deepMerge(S.config, s);
|
|
265
277
|
};
|
|
266
278
|
}
|
|
267
|
-
class
|
|
279
|
+
class $ {
|
|
268
280
|
/**
|
|
269
281
|
* Vue Router 实例,需在应用初始化时赋值
|
|
270
282
|
*/
|
|
@@ -288,7 +300,7 @@ class U {
|
|
|
288
300
|
* @param data 数据
|
|
289
301
|
* @returns 是否显示
|
|
290
302
|
*/
|
|
291
|
-
static isFun = (s, r) => Array.isArray(s) ? s.some((
|
|
303
|
+
static isFun = (s, r) => Array.isArray(s) ? s.some((t) => typeof t == "function" ? t(r) : t) : typeof s == "function" ? s(r) : s;
|
|
292
304
|
/**
|
|
293
305
|
* 获取路由参数,自动获取query、params中的参数, 哪个有就返回哪个
|
|
294
306
|
*/
|
|
@@ -305,9 +317,9 @@ class U {
|
|
|
305
317
|
* @param module
|
|
306
318
|
*/
|
|
307
319
|
static loadModule = async (s) => {
|
|
308
|
-
if (
|
|
320
|
+
if (!$.moduleObj[s])
|
|
309
321
|
throw new Error(`模块${s}未加载,请赋值如:TSys.moduleObj = { ${s}: ()=>import('${s}') }`);
|
|
310
|
-
const r = await
|
|
322
|
+
const r = await $.moduleObj[s]();
|
|
311
323
|
return r.default ?? r;
|
|
312
324
|
};
|
|
313
325
|
/**
|
|
@@ -324,7 +336,7 @@ class U {
|
|
|
324
336
|
* @param type 消息类型
|
|
325
337
|
* @param options 其他选项
|
|
326
338
|
*/
|
|
327
|
-
static showMessage(s, r,
|
|
339
|
+
static showMessage(s, r, t = {}) {
|
|
328
340
|
const n = Date.now();
|
|
329
341
|
if (!this.tipMessages[s] || n - this.tipMessages[s] > this.tipMessagesGap) {
|
|
330
342
|
this.tipMessages[s] = n;
|
|
@@ -333,7 +345,7 @@ class U {
|
|
|
333
345
|
message: s,
|
|
334
346
|
type: r
|
|
335
347
|
},
|
|
336
|
-
|
|
348
|
+
t
|
|
337
349
|
);
|
|
338
350
|
ye(e), setTimeout(() => {
|
|
339
351
|
delete this.tipMessages[s];
|
|
@@ -363,7 +375,7 @@ class U {
|
|
|
363
375
|
* @param show
|
|
364
376
|
* @param text
|
|
365
377
|
*/
|
|
366
|
-
static loading = (s = !0, r = "
|
|
378
|
+
static loading = (s = !0, r = "Loading...") => {
|
|
367
379
|
Timer.un(this.loadingTimer), this.loadingTimer = Timer.once(() => {
|
|
368
380
|
s ? this.loadingObj = ge.service({
|
|
369
381
|
lock: !0,
|
|
@@ -379,11 +391,11 @@ class U {
|
|
|
379
391
|
*/
|
|
380
392
|
static openUrl = (s, r = !0) => {
|
|
381
393
|
if (r) {
|
|
382
|
-
let
|
|
394
|
+
let t = screen.width / 2 - 500, n = screen.height / 2 - 800 / 2 - 30;
|
|
383
395
|
window.open(
|
|
384
396
|
s,
|
|
385
397
|
"_blank",
|
|
386
|
-
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" +
|
|
398
|
+
"toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=1000, height=800, top=" + n + ", left=" + t
|
|
387
399
|
);
|
|
388
400
|
} else
|
|
389
401
|
window.open(
|
|
@@ -397,9 +409,9 @@ class U {
|
|
|
397
409
|
* @param param
|
|
398
410
|
* @returns
|
|
399
411
|
*/
|
|
400
|
-
static getImgPic = (s) => new Promise(async (r,
|
|
412
|
+
static getImgPic = (s) => new Promise(async (r, t) => {
|
|
401
413
|
let n = document.getElementById(s.id);
|
|
402
|
-
const e = await
|
|
414
|
+
const e = await $.loadModule("html2canvas");
|
|
403
415
|
try {
|
|
404
416
|
e(n, {
|
|
405
417
|
logging: !1,
|
|
@@ -412,11 +424,11 @@ class U {
|
|
|
412
424
|
useCORS: !0,
|
|
413
425
|
backgroundColor: "#ffffff00"
|
|
414
426
|
}).then(function(a) {
|
|
415
|
-
let
|
|
416
|
-
r(
|
|
427
|
+
let d = a.toDataURL("image/png");
|
|
428
|
+
r(d);
|
|
417
429
|
});
|
|
418
430
|
} catch (a) {
|
|
419
|
-
|
|
431
|
+
t(a);
|
|
420
432
|
}
|
|
421
433
|
});
|
|
422
434
|
}
|
|
@@ -438,9 +450,9 @@ class L {
|
|
|
438
450
|
* @returns 该字段对应类型的 options 配置,如 select 类型返回 `options.select`
|
|
439
451
|
*/
|
|
440
452
|
static findOptions = (s, r) => {
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
443
|
-
return
|
|
453
|
+
const t = s.column.find((e) => e.key === r), n = (e) => e.replace(/-([a-z])/g, (a, d) => d.toUpperCase());
|
|
454
|
+
if (t)
|
|
455
|
+
return t.options[n(t.type)];
|
|
444
456
|
};
|
|
445
457
|
/**
|
|
446
458
|
* 更新组件数据
|
|
@@ -458,9 +470,9 @@ class L {
|
|
|
458
470
|
}))
|
|
459
471
|
)
|
|
460
472
|
*/
|
|
461
|
-
static setOptionsData = (s, r,
|
|
473
|
+
static setOptionsData = (s, r, t) => {
|
|
462
474
|
const n = L.findOptions(s, r);
|
|
463
|
-
n && (n.data =
|
|
475
|
+
n && (n.data = t);
|
|
464
476
|
};
|
|
465
477
|
static form = {
|
|
466
478
|
openBefore: {
|
|
@@ -471,9 +483,9 @@ class L {
|
|
|
471
483
|
* @param treeData 树形数据
|
|
472
484
|
* @param option 组件配置
|
|
473
485
|
*/
|
|
474
|
-
parentId: (s, r,
|
|
486
|
+
parentId: (s, r, t, n) => {
|
|
475
487
|
const e = S.config.table.rowKey;
|
|
476
|
-
s ? r.type ===
|
|
488
|
+
s ? r.type === $.EDialog.Insert ? (r.form.parentId = s[e], r.form.sort = s.children.length + 1) : r.form.parentId = s.parentId.substring(s.parentId.lastIndexOf(",") + 1) : (r.form.parentId = "0", r.form.sort = t.length + 1), L.setOptionsData(n, "parentId", [{ [e]: "0", title: "根", children: t }]);
|
|
477
489
|
}
|
|
478
490
|
}
|
|
479
491
|
};
|
|
@@ -488,13 +500,13 @@ class R {
|
|
|
488
500
|
* @param field 字段名
|
|
489
501
|
* @param row 行数据
|
|
490
502
|
*/
|
|
491
|
-
static setId = (s, r,
|
|
503
|
+
static setId = (s, r, t) => {
|
|
492
504
|
r[s] || (r[s] = []);
|
|
493
505
|
const n = S.config.table.rowKey;
|
|
494
506
|
r[s].forEach((e) => {
|
|
495
|
-
|
|
496
|
-
let
|
|
497
|
-
a.type === "number" && (
|
|
507
|
+
t.forEach((a) => {
|
|
508
|
+
let d = a.default ?? "";
|
|
509
|
+
a.type === "number" && (d = a.default ?? 0), a.type === "boolean" && (d = a.default ?? !1), a.type === "time" && (d = a.default ?? /* @__PURE__ */ new Date()), e[a.value] === void 0 && (e[a.value] = d);
|
|
498
510
|
}), e[n] || (e[n] = R.getIdFun());
|
|
499
511
|
});
|
|
500
512
|
};
|
|
@@ -505,15 +517,15 @@ class R {
|
|
|
505
517
|
* @param itemFields 元素字段-如:[{label:'',value:''}]
|
|
506
518
|
* @param callback 回调函数
|
|
507
519
|
*/
|
|
508
|
-
static add = (s, r,
|
|
509
|
-
const e = JSONUtil.cp(
|
|
510
|
-
R.setId(s, r,
|
|
520
|
+
static add = (s, r, t, n) => {
|
|
521
|
+
const e = JSONUtil.cp(t);
|
|
522
|
+
R.setId(s, r, t);
|
|
511
523
|
const a = S.config.table.rowKey;
|
|
512
524
|
r[s].push(
|
|
513
525
|
e.reduce(
|
|
514
|
-
(
|
|
526
|
+
(d, m) => {
|
|
515
527
|
let p = m.default ?? "";
|
|
516
|
-
return m.type === "number" && (p = m.default ?? 0), m.type === "boolean" && (p = m.default ?? !1), m.type === "time" && (p = m.default ?? /* @__PURE__ */ new Date()),
|
|
528
|
+
return m.type === "number" && (p = m.default ?? 0), m.type === "boolean" && (p = m.default ?? !1), m.type === "time" && (p = m.default ?? /* @__PURE__ */ new Date()), d[m.value] = p, d;
|
|
517
529
|
},
|
|
518
530
|
{ [a]: R.getIdFun() }
|
|
519
531
|
)
|
|
@@ -526,9 +538,9 @@ class R {
|
|
|
526
538
|
* @param item 元素-如:{_id:''}
|
|
527
539
|
* @param callback 回调函数
|
|
528
540
|
*/
|
|
529
|
-
static remove = (s, r,
|
|
541
|
+
static remove = (s, r, t, n) => {
|
|
530
542
|
const e = S.config.table.rowKey;
|
|
531
|
-
r[s] = r[s].filter((a) => a[e] !==
|
|
543
|
+
r[s] = r[s].filter((a) => a[e] !== t[e]), n?.(r);
|
|
532
544
|
};
|
|
533
545
|
/**
|
|
534
546
|
* 获取没有id的数据
|
|
@@ -537,10 +549,10 @@ class R {
|
|
|
537
549
|
* @returns 没有id的数据
|
|
538
550
|
*/
|
|
539
551
|
static getNoIdData = (s, r) => {
|
|
540
|
-
const
|
|
541
|
-
return
|
|
552
|
+
const t = JSONUtil.cp(s), n = S.config.table.rowKey;
|
|
553
|
+
return t.forEach((e) => {
|
|
542
554
|
e[n] && delete e[n], r && e[r] && R.getNoIdData(e[r], r);
|
|
543
|
-
}),
|
|
555
|
+
}), t;
|
|
544
556
|
};
|
|
545
557
|
}
|
|
546
558
|
const Ve = {
|
|
@@ -550,7 +562,7 @@ const Ve = {
|
|
|
550
562
|
}, Ee = {
|
|
551
563
|
class: "row items-center",
|
|
552
564
|
style: { gap: "10px", width: "100%" }
|
|
553
|
-
}, oe = /* @__PURE__ */
|
|
565
|
+
}, oe = /* @__PURE__ */ K({
|
|
554
566
|
__name: "list",
|
|
555
567
|
props: {
|
|
556
568
|
row: {
|
|
@@ -585,33 +597,33 @@ const Ve = {
|
|
|
585
597
|
}
|
|
586
598
|
},
|
|
587
599
|
emits: ["change"],
|
|
588
|
-
setup(
|
|
589
|
-
const r =
|
|
600
|
+
setup(o, { emit: s }) {
|
|
601
|
+
const r = o, t = _({
|
|
590
602
|
show: !1,
|
|
591
|
-
add: (e, a,
|
|
592
|
-
R.add(e, a,
|
|
603
|
+
add: (e, a, d) => {
|
|
604
|
+
R.add(e, a, d, () => {
|
|
593
605
|
n("change");
|
|
594
606
|
});
|
|
595
607
|
},
|
|
596
|
-
remove: (e, a,
|
|
597
|
-
R.remove(e, a,
|
|
608
|
+
remove: (e, a, d) => {
|
|
609
|
+
R.remove(e, a, d, () => {
|
|
598
610
|
n("change");
|
|
599
611
|
});
|
|
600
612
|
}
|
|
601
613
|
});
|
|
602
614
|
ae(() => {
|
|
603
|
-
R.setId(r.field, r.row, r.itemFields),
|
|
615
|
+
R.setId(r.field, r.row, r.itemFields), t.show = !0;
|
|
604
616
|
});
|
|
605
617
|
const n = s;
|
|
606
618
|
return (e, a) => {
|
|
607
|
-
const
|
|
608
|
-
return
|
|
609
|
-
k(e.$slots, "list-start", { row:
|
|
619
|
+
const d = X("el-button"), m = X("el-input");
|
|
620
|
+
return t.show ? (f(), w("div", Ve, [
|
|
621
|
+
k(e.$slots, "list-start", { row: o.row }),
|
|
610
622
|
D("div", null, [
|
|
611
|
-
v(
|
|
623
|
+
v(d, {
|
|
612
624
|
link: "",
|
|
613
625
|
type: "primary",
|
|
614
|
-
onClick: a[0] || (a[0] = (p) =>
|
|
626
|
+
onClick: a[0] || (a[0] = (p) => t.add(o.field, o.row, o.itemFields))
|
|
615
627
|
}, {
|
|
616
628
|
default: b(() => [...a[2] || (a[2] = [
|
|
617
629
|
E("添加", -1)
|
|
@@ -619,27 +631,27 @@ const Ve = {
|
|
|
619
631
|
_: 1
|
|
620
632
|
})
|
|
621
633
|
]),
|
|
622
|
-
(
|
|
634
|
+
(f(!0), w(U, null, M(o.row[o.field], (p) => (f(), w("div", Ee, [
|
|
623
635
|
k(e.$slots, "item-start", {
|
|
624
636
|
item: p,
|
|
625
|
-
row:
|
|
637
|
+
row: o.row
|
|
626
638
|
}),
|
|
627
|
-
(
|
|
628
|
-
modelValue: p[
|
|
629
|
-
"onUpdate:modelValue": (i) => p[
|
|
630
|
-
style: ne({ width:
|
|
631
|
-
class: T(
|
|
632
|
-
placeholder:
|
|
639
|
+
(f(!0), w(U, null, M(o.itemFields, (c) => (f(), y(m, {
|
|
640
|
+
modelValue: p[c.value],
|
|
641
|
+
"onUpdate:modelValue": (i) => p[c.value] = i,
|
|
642
|
+
style: ne({ width: o.inputWidth }),
|
|
643
|
+
class: T(o.inputClass),
|
|
644
|
+
placeholder: c[o.label] || c[o.value],
|
|
633
645
|
onChange: a[1] || (a[1] = (i) => n("change"))
|
|
634
646
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "class", "placeholder"]))), 256)),
|
|
635
647
|
k(e.$slots, "item-end", {
|
|
636
648
|
item: p,
|
|
637
|
-
row:
|
|
649
|
+
row: o.row
|
|
638
650
|
}),
|
|
639
|
-
v(
|
|
651
|
+
v(d, {
|
|
640
652
|
link: "",
|
|
641
653
|
type: "danger",
|
|
642
|
-
onClick: (
|
|
654
|
+
onClick: (c) => t.remove(o.field, o.row, p)
|
|
643
655
|
}, {
|
|
644
656
|
default: b(() => [...a[3] || (a[3] = [
|
|
645
657
|
E("删除", -1)
|
|
@@ -647,11 +659,11 @@ const Ve = {
|
|
|
647
659
|
_: 1
|
|
648
660
|
}, 8, ["onClick"])
|
|
649
661
|
]))), 256)),
|
|
650
|
-
k(e.$slots, "list-end", { row:
|
|
662
|
+
k(e.$slots, "list-end", { row: o.row })
|
|
651
663
|
])) : C("", !0);
|
|
652
664
|
};
|
|
653
665
|
}
|
|
654
|
-
}), xe = { class: "row curd-row" }, De = /* @__PURE__ */
|
|
666
|
+
}), xe = { class: "row curd-row" }, De = /* @__PURE__ */ K({
|
|
655
667
|
__name: "column",
|
|
656
668
|
props: {
|
|
657
669
|
/**
|
|
@@ -667,29 +679,29 @@ const Ve = {
|
|
|
667
679
|
default: ""
|
|
668
680
|
}
|
|
669
681
|
},
|
|
670
|
-
setup(
|
|
671
|
-
const r =
|
|
682
|
+
setup(o, { expose: s }) {
|
|
683
|
+
const r = $.isFun, t = $.EDialog, n = A(), e = o, a = _({
|
|
672
684
|
rules: {},
|
|
673
685
|
show: !0,
|
|
674
686
|
form: {},
|
|
675
687
|
formDefault: {},
|
|
676
688
|
formColumn: [],
|
|
677
|
-
getDisabled: (
|
|
689
|
+
getDisabled: (d) => d.disabled?.[(e.type || t.Insert) === t.Insert ? "create" : "update"],
|
|
678
690
|
initColumnForm: async () => {
|
|
679
|
-
const
|
|
691
|
+
const d = e.option;
|
|
680
692
|
a.formColumn = [];
|
|
681
|
-
const m = [], p = e.option.form?.maxSpan || 12,
|
|
693
|
+
const m = [], p = e.option.form?.maxSpan || 12, c = e.option.form?.defaultSpan || p;
|
|
682
694
|
let i = [];
|
|
683
|
-
const
|
|
695
|
+
const u = (h) => {
|
|
684
696
|
if (a.formDefault[h.key] = h.value, h.isForm) {
|
|
685
|
-
h.form = h.form || { span:
|
|
686
|
-
let I = h.form.span, j = i.reduce((
|
|
697
|
+
h.form = h.form || { span: c }, h.form.span = h.form.span ?? c;
|
|
698
|
+
let I = h.form.span, j = i.reduce((N, de) => N + de.span, I);
|
|
687
699
|
const z = i.length;
|
|
688
700
|
i.push({ item: h, span: I }), (z === 1 && i[0].span === 0 || j >= p || I === 0 && z > 1) && (m.push(i), i = []), h.rules && (a.rules[h.key] = h.rules);
|
|
689
701
|
}
|
|
690
702
|
};
|
|
691
|
-
|
|
692
|
-
h.isForm = !0,
|
|
703
|
+
d.column.forEach((h) => {
|
|
704
|
+
h.isForm = !0, u(h);
|
|
693
705
|
}), i.length > 0 && m.push(i), a.formColumn = m, a.form = JSONUtil.cp(a.formDefault);
|
|
694
706
|
},
|
|
695
707
|
init: async () => {
|
|
@@ -699,102 +711,102 @@ const Ve = {
|
|
|
699
711
|
return a.initColumnForm(), s({
|
|
700
712
|
ref: n,
|
|
701
713
|
conf: a
|
|
702
|
-
}), (
|
|
714
|
+
}), (d, m) => (f(), y(l(Q), {
|
|
703
715
|
ref_key: "ruleFormRef",
|
|
704
716
|
ref: n,
|
|
705
717
|
model: a.form,
|
|
706
718
|
rules: a.rules
|
|
707
719
|
}, {
|
|
708
720
|
default: b(() => [
|
|
709
|
-
a.show ? (
|
|
710
|
-
k(
|
|
721
|
+
a.show ? (f(!0), w(U, { key: 0 }, M(a.formColumn, (p) => (f(), w("div", xe, [
|
|
722
|
+
k(d.$slots, "form-start", {
|
|
711
723
|
row: a.form
|
|
712
724
|
}),
|
|
713
|
-
(
|
|
714
|
-
l(r)(
|
|
725
|
+
(f(!0), w(U, null, M(p, (c) => (f(), w(U, null, [
|
|
726
|
+
l(r)(c.item.show?.form, a.form) ?? !0 ? (f(), w("div", {
|
|
715
727
|
key: 0,
|
|
716
|
-
class: T(
|
|
728
|
+
class: T(c.item.form.span > 0 ? `col-${c.item.form.span}` : "col")
|
|
717
729
|
}, [
|
|
718
730
|
v(l(B), {
|
|
719
|
-
label:
|
|
720
|
-
prop:
|
|
721
|
-
"label-width":
|
|
731
|
+
label: c.item.label,
|
|
732
|
+
prop: c.item.key,
|
|
733
|
+
"label-width": c.item.form?.labelWidth || "100px"
|
|
722
734
|
}, {
|
|
723
735
|
default: b(() => [
|
|
724
|
-
k(
|
|
736
|
+
k(d.$slots, "form-" + c.item.key + "-start", {
|
|
725
737
|
row: a.form,
|
|
726
|
-
item:
|
|
738
|
+
item: c.item
|
|
727
739
|
}),
|
|
728
|
-
k(
|
|
740
|
+
k(d.$slots, "form-" + c.item.key, {
|
|
729
741
|
row: a.form,
|
|
730
|
-
item:
|
|
742
|
+
item: c.item
|
|
731
743
|
}, () => [
|
|
732
|
-
|
|
744
|
+
c.item.type === "input" ? (f(), y(l(q), V({
|
|
733
745
|
key: 0,
|
|
734
|
-
modelValue: a.form[
|
|
735
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
736
|
-
}, { ref_for: !0 },
|
|
737
|
-
disabled: a.getDisabled(
|
|
738
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
746
|
+
modelValue: a.form[c.item.key],
|
|
747
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
748
|
+
}, { ref_for: !0 }, c.item.options?.input, O(c.item.options?.input?.on || {}), {
|
|
749
|
+
disabled: a.getDisabled(c.item)
|
|
750
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "switch" ? (f(), y(l(ee), V({
|
|
739
751
|
key: 1,
|
|
740
|
-
modelValue: a.form[
|
|
741
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
742
|
-
}, { ref_for: !0 },
|
|
743
|
-
disabled: a.getDisabled(
|
|
744
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
752
|
+
modelValue: a.form[c.item.key],
|
|
753
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
754
|
+
}, { ref_for: !0 }, c.item.options?.switch, O(c.item.options?.switch?.on || {}), {
|
|
755
|
+
disabled: a.getDisabled(c.item)
|
|
756
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "select" ? (f(), y(l(J), V({
|
|
745
757
|
key: 2,
|
|
746
|
-
modelValue: a.form[
|
|
747
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
748
|
-
}, { ref_for: !0 },
|
|
749
|
-
disabled: a.getDisabled(
|
|
758
|
+
modelValue: a.form[c.item.key],
|
|
759
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
760
|
+
}, { ref_for: !0 }, c.item.options?.select, O(c.item.options?.select?.on || {}), {
|
|
761
|
+
disabled: a.getDisabled(c.item),
|
|
750
762
|
style: { width: "100%" }
|
|
751
763
|
}), {
|
|
752
764
|
default: b(() => [
|
|
753
|
-
(
|
|
765
|
+
(f(!0), w(U, null, M(c.item.options?.select?.data, (i) => (f(), y(l(P), {
|
|
754
766
|
key: i.value,
|
|
755
767
|
label: i.label,
|
|
756
768
|
value: i.value
|
|
757
769
|
}, null, 8, ["label", "value"]))), 128))
|
|
758
770
|
]),
|
|
759
771
|
_: 2
|
|
760
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
772
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "list" ? (f(), y(oe, V({
|
|
761
773
|
key: 3,
|
|
762
774
|
row: a.form,
|
|
763
|
-
field:
|
|
764
|
-
}, { ref_for: !0 },
|
|
765
|
-
disabled: a.getDisabled(
|
|
775
|
+
field: c.item.key
|
|
776
|
+
}, { ref_for: !0 }, c.item.options?.list, O(c.item.options?.list?.on || {}), {
|
|
777
|
+
disabled: a.getDisabled(c.item),
|
|
766
778
|
style: { width: "100%" }
|
|
767
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
779
|
+
}), null, 16, ["row", "field", "disabled"])) : c.item.type === "tree-select" ? (f(), y(l(se), V({
|
|
768
780
|
key: 4,
|
|
769
|
-
modelValue: a.form[
|
|
770
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
771
|
-
}, { ref_for: !0 },
|
|
772
|
-
disabled: a.getDisabled(
|
|
781
|
+
modelValue: a.form[c.item.key],
|
|
782
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
783
|
+
}, { ref_for: !0 }, c.item.options?.treeSelect, O(c.item.options?.treeSelect?.on || {}), {
|
|
784
|
+
disabled: a.getDisabled(c.item),
|
|
773
785
|
style: { width: "100%" }
|
|
774
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
786
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type === "datetime" ? (f(), y(l(te), V({
|
|
775
787
|
key: 5,
|
|
776
|
-
modelValue: a.form[
|
|
777
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
778
|
-
}, { ref_for: !0 },
|
|
779
|
-
disabled: a.getDisabled(
|
|
780
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) :
|
|
788
|
+
modelValue: a.form[c.item.key],
|
|
789
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
790
|
+
}, { ref_for: !0 }, c.item.options?.datetime, O(c.item.options?.datetime?.on || {}), {
|
|
791
|
+
disabled: a.getDisabled(c.item)
|
|
792
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.item.type && l(L).customComponent[c.item.type] ? (f(), y(H(l(L).customComponent[c.item.type]), V({
|
|
781
793
|
key: 6,
|
|
782
|
-
modelValue: a.form[
|
|
783
|
-
"onUpdate:modelValue": (i) => a.form[
|
|
784
|
-
}, { ref_for: !0 },
|
|
785
|
-
disabled: a.getDisabled(
|
|
794
|
+
modelValue: a.form[c.item.key],
|
|
795
|
+
"onUpdate:modelValue": (i) => a.form[c.item.key] = i
|
|
796
|
+
}, { ref_for: !0 }, c.item.options?.[c.item.type], O(c.item.options?.[c.item.type]?.on || {}), {
|
|
797
|
+
disabled: a.getDisabled(c.item)
|
|
786
798
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
787
799
|
]),
|
|
788
|
-
k(
|
|
800
|
+
k(d.$slots, "form-" + c.item.key + "-end", {
|
|
789
801
|
row: a.form,
|
|
790
|
-
item:
|
|
802
|
+
item: c.item
|
|
791
803
|
})
|
|
792
804
|
]),
|
|
793
805
|
_: 2
|
|
794
806
|
}, 1032, ["label", "prop", "label-width"])
|
|
795
807
|
], 2)) : C("", !0)
|
|
796
808
|
], 64))), 256)),
|
|
797
|
-
k(
|
|
809
|
+
k(d.$slots, "form-end", {
|
|
798
810
|
row: a.form
|
|
799
811
|
})
|
|
800
812
|
]))), 256)) : C("", !0)
|
|
@@ -803,7 +815,7 @@ const Ve = {
|
|
|
803
815
|
}, 8, ["model", "rules"]));
|
|
804
816
|
}
|
|
805
817
|
});
|
|
806
|
-
const
|
|
818
|
+
const Ue = {
|
|
807
819
|
search: "搜索",
|
|
808
820
|
add: "新增",
|
|
809
821
|
edit: "编辑",
|
|
@@ -841,8 +853,8 @@ class g {
|
|
|
841
853
|
if (typeof s == "function")
|
|
842
854
|
return s(...r);
|
|
843
855
|
s = String(s);
|
|
844
|
-
let
|
|
845
|
-
return s.replace(/{([^}]+)}/g, (n, e) =>
|
|
856
|
+
let t = 0;
|
|
857
|
+
return s.replace(/{([^}]+)}/g, (n, e) => t < r.length ? String(r[t++]) : `{${e}}`);
|
|
846
858
|
}
|
|
847
859
|
static setI18n = (s) => {
|
|
848
860
|
g.curd = ObjectUtil.deepMerge(g.curd, s);
|
|
@@ -852,9 +864,9 @@ class g {
|
|
|
852
864
|
return this.t(this.curd[s], ...r);
|
|
853
865
|
}
|
|
854
866
|
/** curd表单 */
|
|
855
|
-
static curd =
|
|
867
|
+
static curd = Ue;
|
|
856
868
|
}
|
|
857
|
-
class
|
|
869
|
+
class $e {
|
|
858
870
|
/**
|
|
859
871
|
* 导出数据为 Excel 文件(.xlsx),自动触发浏览器下载
|
|
860
872
|
*
|
|
@@ -862,159 +874,188 @@ class Ue {
|
|
|
862
874
|
* @param columns - 列配置数组,需包含 `key`(数据字段)和 `label`(Excel 表头)
|
|
863
875
|
* @param fileName - 文件名(不含扩展名),支持字符串或返回字符串的函数;默认生成「导出数据_日期_时间戳」
|
|
864
876
|
*/
|
|
865
|
-
static exportToExcel = async (s, r,
|
|
877
|
+
static exportToExcel = async (s, r, t) => {
|
|
866
878
|
if (!s || s.length === 0) return;
|
|
867
|
-
const n = await
|
|
879
|
+
const n = await $.loadModule("xlsx"), e = s.map((m) => {
|
|
868
880
|
const p = {};
|
|
869
|
-
return r.forEach((
|
|
870
|
-
p[
|
|
881
|
+
return r.forEach((c) => {
|
|
882
|
+
p[c.label] = m[c.key];
|
|
871
883
|
}), p;
|
|
872
|
-
}), a = n.utils.json_to_sheet(e),
|
|
873
|
-
n.utils.book_append_sheet(
|
|
884
|
+
}), a = n.utils.json_to_sheet(e), d = n.utils.book_new();
|
|
885
|
+
n.utils.book_append_sheet(d, a, "Sheet1"), t ? typeof t == "function" && (t = t()) : t = `导出数据_${(/* @__PURE__ */ new Date()).Format("yyyy-MM-dd")}_${(/* @__PURE__ */ new Date()).getTime()}`, n.writeFile(d, `${t}.xlsx`);
|
|
874
886
|
};
|
|
875
887
|
}
|
|
876
|
-
const W =
|
|
877
|
-
const s =
|
|
888
|
+
const W = $.EDialog, Se = (o) => {
|
|
889
|
+
const s = A(), r = A(), t = _({
|
|
890
|
+
/** 查询区域相关配置对象 */
|
|
878
891
|
search: {
|
|
892
|
+
/** 查询表单列集合 */
|
|
879
893
|
column: {
|
|
894
|
+
/** 搜索表单列列表 */
|
|
880
895
|
list: []
|
|
881
896
|
},
|
|
897
|
+
/** 搜索表单数据对象 */
|
|
882
898
|
form: {},
|
|
899
|
+
/** 搜索表单默认值 */
|
|
883
900
|
formDefault: {},
|
|
901
|
+
/** 获取占位符 */
|
|
884
902
|
getPlaceholder: (n, e = g.tCurd("placeholderInput")) => n.text?.search?.placeholder === void 0 ? `${e}${n.label}` : n.text?.search?.placeholder,
|
|
903
|
+
/** 组装实际要搜索的数据对象 */
|
|
885
904
|
getFormData: () => {
|
|
886
905
|
let n = {};
|
|
887
|
-
|
|
888
|
-
(typeof a.show?.search == "function" ? a.show?.search(
|
|
906
|
+
o.option.column.forEach((a) => {
|
|
907
|
+
(typeof a.show?.search == "function" ? a.show?.search(t.search.form) : a.show?.search) && (n[a.key] = t.search.form[a.key]);
|
|
889
908
|
});
|
|
890
|
-
const e =
|
|
909
|
+
const e = o.option.search?.before?.(n);
|
|
891
910
|
return e && (n = e), n;
|
|
892
911
|
},
|
|
912
|
+
/** 重置搜索表单 */
|
|
893
913
|
reset: () => {
|
|
894
|
-
const n =
|
|
914
|
+
const n = t.search.formDefault;
|
|
895
915
|
Object.keys(n).forEach((e) => {
|
|
896
|
-
|
|
897
|
-
}),
|
|
916
|
+
o.option.search?.resetMode === "none" ? n[e] = void 0 : n[e] = t.search.formDefault[e];
|
|
917
|
+
}), t.search.form = JSONUtil.cp(n), t.page.num = 1, o.option.init !== !1 && t.table.getList();
|
|
898
918
|
},
|
|
919
|
+
/** 提交搜索表单 */
|
|
899
920
|
submit: () => {
|
|
900
|
-
|
|
921
|
+
t.page.num = 1, t.table.getList();
|
|
901
922
|
}
|
|
902
923
|
},
|
|
924
|
+
/** 分页区域相关配置对象 */
|
|
903
925
|
page: {
|
|
904
|
-
|
|
905
|
-
|
|
926
|
+
/** 当前每页条数 */
|
|
927
|
+
size: o.option.page?.size || 10,
|
|
928
|
+
/** 支持切换的每页条数选项 */
|
|
929
|
+
sizeList: o.option.page?.sizeList || [10, 20, 50, 100],
|
|
930
|
+
/** 当前页码 */
|
|
906
931
|
num: 1,
|
|
932
|
+
/** 总条数 */
|
|
907
933
|
total: 0,
|
|
908
|
-
|
|
934
|
+
/** 分页控件的布局方式 */
|
|
935
|
+
layout: o.option.page?.layout || "total, sizes, prev, pager, next, jumper"
|
|
909
936
|
},
|
|
937
|
+
/** 表格区域相关配置对象 */
|
|
910
938
|
table: {
|
|
939
|
+
/** 操作列相关配置 */
|
|
911
940
|
op: {
|
|
941
|
+
/** 动态计算操作列宽度 */
|
|
912
942
|
width: (...n) => n.filter((a) => a).length * 30 + 60
|
|
913
943
|
},
|
|
944
|
+
/** 表格加载中状态 */
|
|
914
945
|
loading: !1,
|
|
946
|
+
/** 表格数据内容 */
|
|
915
947
|
data: [],
|
|
948
|
+
/** 表格展开行相关配置 */
|
|
916
949
|
expand: {
|
|
950
|
+
/** 当前是否全部展开 */
|
|
917
951
|
isExpand: !1,
|
|
952
|
+
/** 已经展开的行key集合 */
|
|
918
953
|
rowKeys: [],
|
|
954
|
+
/** 行展开触发变更函数 */
|
|
919
955
|
change: (n, e) => {
|
|
920
956
|
},
|
|
957
|
+
/** 全部展开/收起 */
|
|
921
958
|
all: () => {
|
|
922
|
-
if (
|
|
923
|
-
|
|
959
|
+
if (t.table.expand.isExpand)
|
|
960
|
+
t.table.expand.rowKeys = [];
|
|
924
961
|
else {
|
|
925
962
|
const n = (e) => {
|
|
926
963
|
let a = [];
|
|
927
|
-
return e.forEach((
|
|
928
|
-
a.push(
|
|
964
|
+
return e.forEach((d) => {
|
|
965
|
+
a.push(d[o.option.table.rowKey]), d.children && d.children.length > 0 && (a = a.concat(n(d.children)));
|
|
929
966
|
}), a;
|
|
930
967
|
};
|
|
931
|
-
|
|
968
|
+
t.table.expand.rowKeys = n(t.table.data);
|
|
932
969
|
}
|
|
933
|
-
|
|
970
|
+
t.table.expand.isExpand = !t.table.expand.isExpand;
|
|
934
971
|
}
|
|
935
972
|
},
|
|
973
|
+
/** 表格列相关配置 */
|
|
936
974
|
column: {
|
|
937
|
-
/**
|
|
938
|
-
* 渲染列数据
|
|
939
|
-
*/
|
|
975
|
+
/** 表格全部列(渲染用) */
|
|
940
976
|
list: [],
|
|
941
|
-
/**
|
|
942
|
-
* 表格列显示控制
|
|
943
|
-
*/
|
|
977
|
+
/** 表格可见列控制集合 */
|
|
944
978
|
show: {
|
|
945
|
-
/**
|
|
946
|
-
* 表格列源数据
|
|
947
|
-
*/
|
|
979
|
+
/** 表格列f原始源数据key数组 */
|
|
948
980
|
listSource: [],
|
|
949
|
-
/**
|
|
950
|
-
* 当前显示表格列数据
|
|
951
|
-
*/
|
|
981
|
+
/** 当前显示表格列数据key数组 */
|
|
952
982
|
list: []
|
|
953
983
|
}
|
|
954
984
|
},
|
|
985
|
+
/** 获取数据列表接口实现 */
|
|
955
986
|
getList: async () => {
|
|
956
|
-
|
|
957
|
-
const n =
|
|
987
|
+
t.table.loading = !0;
|
|
988
|
+
const n = o.option.api.list;
|
|
958
989
|
try {
|
|
990
|
+
await t.initApiData("init");
|
|
959
991
|
const e = await n({
|
|
960
|
-
[S.config.page.size]:
|
|
961
|
-
[S.config.page.num]:
|
|
962
|
-
...
|
|
963
|
-
}), a = S.config.result,
|
|
964
|
-
let m = (Array.isArray(
|
|
965
|
-
const p =
|
|
992
|
+
[S.config.page.size]: t.page.size,
|
|
993
|
+
[S.config.page.num]: t.page.num,
|
|
994
|
+
...t.search.getFormData()
|
|
995
|
+
}), a = S.config.result, d = e.data || { [a.list]: e };
|
|
996
|
+
let m = (Array.isArray(d[a.list]), d[a.list]);
|
|
997
|
+
const p = t.update.formColumn.flat(), c = JSONUtil.cp(m).map((i) => (Object.keys(i).forEach((h) => {
|
|
966
998
|
const I = p.find((j) => j.item.key === h);
|
|
967
999
|
if (I && I.item.type === "select") {
|
|
968
|
-
const j = I.item.options?.select?.data?.find((z) => z.value
|
|
1000
|
+
const j = I.item.options?.select?.data?.find((z) => z.value == i[h])?.label;
|
|
969
1001
|
j && (i[h] = j);
|
|
970
1002
|
}
|
|
971
1003
|
}), i));
|
|
972
|
-
|
|
1004
|
+
t.table.data = o.option.data ? await o.option.data(c, m) : c, t.page.total = d[a.total] || 0;
|
|
973
1005
|
} catch (e) {
|
|
974
1006
|
console.error(e);
|
|
975
1007
|
} finally {
|
|
976
|
-
|
|
1008
|
+
t.table.loading = !1;
|
|
977
1009
|
}
|
|
978
1010
|
},
|
|
1011
|
+
/** 表格多选相关配置 */
|
|
979
1012
|
selection: {
|
|
1013
|
+
/** 已选数据项 */
|
|
980
1014
|
list: [],
|
|
1015
|
+
/** 选中状态回调 */
|
|
981
1016
|
change: (n) => {
|
|
982
|
-
|
|
1017
|
+
t.table.selection.list = n;
|
|
983
1018
|
}
|
|
984
1019
|
}
|
|
985
1020
|
},
|
|
1021
|
+
/** 导出相关配置与功能 */
|
|
986
1022
|
export: {
|
|
1023
|
+
/** 导出逻辑方法集合 */
|
|
987
1024
|
run: {
|
|
1025
|
+
/** 执行指定方式的导出(如select、page、all) */
|
|
988
1026
|
start: async (n) => {
|
|
989
|
-
let e = await
|
|
990
|
-
const
|
|
1027
|
+
let e = await t.export.run[n](), a = o.option.column;
|
|
1028
|
+
const d = JSONUtil.cp({
|
|
991
1029
|
data: e,
|
|
992
1030
|
columns: a
|
|
993
|
-
}), m =
|
|
994
|
-
m.before && m.before(
|
|
1031
|
+
}), m = o.option.tools?.export || {};
|
|
1032
|
+
m.before && m.before(d), $e.exportToExcel(d.data, d.columns, m.fileName);
|
|
995
1033
|
},
|
|
1034
|
+
/** 获取当前选中项进行导出 */
|
|
996
1035
|
select: () => {
|
|
997
|
-
if (
|
|
998
|
-
throw
|
|
999
|
-
return
|
|
1036
|
+
if (t.table.selection.list.length === 0)
|
|
1037
|
+
throw $.fail(g.tCurd("selectDataToExport")), new Error(g.tCurd("selectDataToExport"));
|
|
1038
|
+
return t.table.selection.list;
|
|
1000
1039
|
},
|
|
1040
|
+
/** 导出当前页的数据 */
|
|
1001
1041
|
page: () => {
|
|
1002
|
-
if (
|
|
1003
|
-
throw
|
|
1004
|
-
return
|
|
1042
|
+
if (t.table.data.length === 0)
|
|
1043
|
+
throw $.fail(g.tCurd("noData")), new Error(g.tCurd("noData"));
|
|
1044
|
+
return t.table.data;
|
|
1005
1045
|
},
|
|
1046
|
+
/** 导出所有数据 */
|
|
1006
1047
|
all: async () => {
|
|
1007
|
-
|
|
1048
|
+
t.export.loading = !0;
|
|
1008
1049
|
try {
|
|
1009
|
-
if (
|
|
1010
|
-
await
|
|
1011
|
-
[S.config.page.size]:
|
|
1012
|
-
[S.config.page.num]:
|
|
1013
|
-
...
|
|
1050
|
+
if (o.option.tools?.export?.all) {
|
|
1051
|
+
await o.option.tools?.export?.all({
|
|
1052
|
+
[S.config.page.size]: t.page.size,
|
|
1053
|
+
[S.config.page.num]: t.page.num,
|
|
1054
|
+
...t.search.getFormData()
|
|
1014
1055
|
});
|
|
1015
1056
|
return;
|
|
1016
1057
|
}
|
|
1017
|
-
const n =
|
|
1058
|
+
const n = o.option.api.list, e = await n({
|
|
1018
1059
|
[S.config.page.size]: 999999,
|
|
1019
1060
|
[S.config.page.num]: 1
|
|
1020
1061
|
});
|
|
@@ -1022,161 +1063,227 @@ const W = U.EDialog, Se = (t) => {
|
|
|
1022
1063
|
} catch (n) {
|
|
1023
1064
|
console.error(n);
|
|
1024
1065
|
} finally {
|
|
1025
|
-
|
|
1066
|
+
t.export.loading = !1;
|
|
1026
1067
|
}
|
|
1027
1068
|
}
|
|
1028
1069
|
},
|
|
1070
|
+
/** 导出时loading状态 */
|
|
1029
1071
|
loading: !1,
|
|
1072
|
+
/** 执行导出操作的触发函数 */
|
|
1030
1073
|
click: (n) => {
|
|
1031
|
-
|
|
1074
|
+
t.export.loading || t.export.run.start(n);
|
|
1032
1075
|
}
|
|
1033
1076
|
},
|
|
1077
|
+
/** 表单增删改弹窗相关对象 */
|
|
1034
1078
|
update: {
|
|
1079
|
+
/** 弹窗标题 */
|
|
1035
1080
|
title: "",
|
|
1081
|
+
/** 当前表单校验规则 */
|
|
1036
1082
|
rules: {},
|
|
1083
|
+
/** 弹窗显示控制 */
|
|
1037
1084
|
show: !1,
|
|
1085
|
+
/** 弹窗内容部分显示控制 */
|
|
1038
1086
|
showContent: !1,
|
|
1087
|
+
/** 弹窗loading */
|
|
1039
1088
|
loading: !1,
|
|
1089
|
+
/** 当前操作类型,插入或修改 */
|
|
1040
1090
|
type: W.Insert,
|
|
1091
|
+
/** 当前操作表单数据 */
|
|
1041
1092
|
form: {},
|
|
1093
|
+
/** 表单默认值 */
|
|
1042
1094
|
formDefault: {},
|
|
1095
|
+
/** 表单所有列,二维数组结构按行分组 */
|
|
1043
1096
|
formColumn: [],
|
|
1044
|
-
|
|
1097
|
+
/** 判断是否禁用当前字段 */
|
|
1098
|
+
getDisabled: (n) => n.disabled?.[t.update.type === W.Insert ? "create" : "update"],
|
|
1099
|
+
/** 编辑相关数据与方法 */
|
|
1045
1100
|
edit: {
|
|
1046
|
-
/**
|
|
1047
|
-
* 编辑原数据
|
|
1048
|
-
*/
|
|
1101
|
+
/** 当前编辑的数据原始项对象 */
|
|
1049
1102
|
data: {},
|
|
1050
|
-
/**
|
|
1051
|
-
* 将form填入数据和data比对差异数据返回
|
|
1052
|
-
*/
|
|
1103
|
+
/** 返回编辑时与原值的变更数据,用于局部更新API */
|
|
1053
1104
|
getApiData: (n) => {
|
|
1054
|
-
if (
|
|
1105
|
+
if (o.option.form?.editAll)
|
|
1055
1106
|
return n;
|
|
1056
1107
|
let e = {
|
|
1057
|
-
[
|
|
1108
|
+
[o.option.table?.rowKey]: t.update.edit.data[o.option.table?.rowKey]
|
|
1058
1109
|
};
|
|
1059
|
-
return Object.keys(
|
|
1060
|
-
n[a] !==
|
|
1110
|
+
return Object.keys(t.update.edit.data).forEach((a) => {
|
|
1111
|
+
n[a] !== t.update.edit.data[a] && (e[a] = n[a]);
|
|
1061
1112
|
}), e;
|
|
1062
1113
|
}
|
|
1063
1114
|
},
|
|
1115
|
+
/** 打开增改弹窗 */
|
|
1064
1116
|
open: (n, e) => {
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1117
|
+
t.update.showContent || FunUtil.throttle(async () => {
|
|
1118
|
+
$.loading(!0);
|
|
1119
|
+
try {
|
|
1120
|
+
await t.initApiData("update");
|
|
1121
|
+
const a = n === W.Insert;
|
|
1122
|
+
if (!a && o.option.table?.inlineEdit) {
|
|
1123
|
+
t.inlineEdit.open(e);
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
t.update.type = n, t.update.edit.data = e, t.update.title = a ? g.tCurd("add") : g.tCurd("edit"), t.update.form = JSONUtil.cp(a ? t.update.formDefault : e), await o.option.form?.openBefore?.(e, t.update), t.update.show = !0, t.update.showContent = !0, o.option.form?.openAfter?.(e, t.update);
|
|
1127
|
+
} catch (a) {
|
|
1128
|
+
console.error(a);
|
|
1129
|
+
} finally {
|
|
1130
|
+
$.loading(!1);
|
|
1070
1131
|
}
|
|
1071
|
-
o.update.type = n, o.update.edit.data = e, o.update.title = a ? g.tCurd("add") : g.tCurd("edit"), o.update.form = JSONUtil.cp(a ? o.update.formDefault : e), await t.option.form?.openBefore?.(e, o.update), o.update.show = !0, o.update.showContent = !0, t.option.form?.openAfter?.(e, o.update);
|
|
1072
1132
|
});
|
|
1073
1133
|
},
|
|
1134
|
+
/** 提交增改表单操作 */
|
|
1074
1135
|
submit: () => {
|
|
1075
1136
|
FunUtil.throttle(async () => {
|
|
1076
|
-
await r.value?.validate(async (
|
|
1077
|
-
|
|
1078
|
-
})),
|
|
1079
|
-
const n =
|
|
1080
|
-
let e = JSONUtil.cp(
|
|
1081
|
-
delete e.children, await
|
|
1082
|
-
const a = new Set(
|
|
1083
|
-
Object.keys(e).forEach((
|
|
1084
|
-
if (a.has(
|
|
1085
|
-
const m = new Date(e[
|
|
1086
|
-
isNaN(m) || (e[
|
|
1137
|
+
await r.value?.validate(async (d, m) => new Promise((p, c) => {
|
|
1138
|
+
d || ($.fail(g.tCurd("checkFormData")), c(!1)), p();
|
|
1139
|
+
})), t.update.loading = !0;
|
|
1140
|
+
const n = t.update.type === W.Insert ? o.option.api.create : o.option.api.update;
|
|
1141
|
+
let e = JSONUtil.cp(t.update.form);
|
|
1142
|
+
delete e.children, await o.option.form?.submitBefore?.(e, t.update);
|
|
1143
|
+
const a = new Set(o.option.column.filter((d) => d.type === "datetime").map((d) => d.key));
|
|
1144
|
+
Object.keys(e).forEach((d) => {
|
|
1145
|
+
if (a.has(d) && e[d] != null) {
|
|
1146
|
+
const m = new Date(e[d]).getTime();
|
|
1147
|
+
isNaN(m) || (e[d] = m);
|
|
1087
1148
|
}
|
|
1088
1149
|
});
|
|
1089
1150
|
try {
|
|
1090
1151
|
if (!n) return;
|
|
1091
1152
|
await n({
|
|
1092
1153
|
...e
|
|
1093
|
-
}),
|
|
1094
|
-
} catch (
|
|
1095
|
-
console.error(
|
|
1154
|
+
}), t.update.close(), await t.table.getList(), o.option.form?.submitAfter?.(e, t.update);
|
|
1155
|
+
} catch (d) {
|
|
1156
|
+
console.error(d);
|
|
1096
1157
|
} finally {
|
|
1097
|
-
|
|
1158
|
+
t.update.loading = !1;
|
|
1098
1159
|
}
|
|
1099
1160
|
});
|
|
1100
1161
|
},
|
|
1162
|
+
/** 关闭弹窗和内容 */
|
|
1101
1163
|
close: () => {
|
|
1102
|
-
|
|
1103
|
-
|
|
1164
|
+
t.update.show = !1, setTimeout(() => {
|
|
1165
|
+
t.update.showContent = !1;
|
|
1104
1166
|
}, 350);
|
|
1105
1167
|
}
|
|
1106
1168
|
},
|
|
1169
|
+
/** 行内编辑相关对象 */
|
|
1107
1170
|
inlineEdit: {
|
|
1171
|
+
/** 行内编辑当前行对象 */
|
|
1108
1172
|
row: null,
|
|
1173
|
+
/** 行内编辑表单数据副本 */
|
|
1109
1174
|
form: {},
|
|
1175
|
+
/** 行内编辑loading */
|
|
1110
1176
|
loading: !1,
|
|
1177
|
+
/** 打开行内编辑 */
|
|
1111
1178
|
open: (n) => {
|
|
1112
|
-
|
|
1179
|
+
t.inlineEdit.row = n, t.inlineEdit.form = JSONUtil.cp(n);
|
|
1113
1180
|
},
|
|
1181
|
+
/** 关闭行内编辑 */
|
|
1114
1182
|
close: () => {
|
|
1115
|
-
|
|
1183
|
+
t.inlineEdit.row = null, t.inlineEdit.form = {};
|
|
1116
1184
|
},
|
|
1185
|
+
/** 行内保存提交 */
|
|
1117
1186
|
submit: () => {
|
|
1118
1187
|
FunUtil.throttle(async () => {
|
|
1119
|
-
|
|
1120
|
-
const n =
|
|
1121
|
-
let e = JSONUtil.cp(
|
|
1188
|
+
t.inlineEdit.loading = !0;
|
|
1189
|
+
const n = o.option.api.update;
|
|
1190
|
+
let e = JSONUtil.cp(t.inlineEdit.form);
|
|
1122
1191
|
delete e.children;
|
|
1123
1192
|
try {
|
|
1124
1193
|
if (!n) return;
|
|
1125
|
-
await n({ ...e }),
|
|
1194
|
+
await n({ ...e }), t.inlineEdit.close(), await t.table.getList(), $.success(g.tCurd("operationSuccess"));
|
|
1126
1195
|
} catch (a) {
|
|
1127
1196
|
console.error(a);
|
|
1128
1197
|
} finally {
|
|
1129
|
-
|
|
1198
|
+
t.inlineEdit.loading = !1;
|
|
1130
1199
|
}
|
|
1131
1200
|
});
|
|
1132
1201
|
}
|
|
1133
1202
|
},
|
|
1203
|
+
/** 删除操作弹窗与数据对象 */
|
|
1134
1204
|
remove: {
|
|
1205
|
+
/** 删除弹窗标题 */
|
|
1135
1206
|
title: g.tCurd("confirmDelete"),
|
|
1207
|
+
/** 删除弹窗显示控制 */
|
|
1136
1208
|
show: !1,
|
|
1209
|
+
/** 待删除数据项集合 */
|
|
1137
1210
|
items: [],
|
|
1211
|
+
/** 删除操作loading */
|
|
1138
1212
|
loading: !1,
|
|
1213
|
+
/** 关闭删除弹窗 */
|
|
1139
1214
|
close: () => {
|
|
1140
|
-
|
|
1215
|
+
t.remove.show = !1;
|
|
1141
1216
|
},
|
|
1217
|
+
/** 打开删除弹窗并设置待删除项 */
|
|
1142
1218
|
open: (n) => {
|
|
1143
1219
|
if (n.length === 0) {
|
|
1144
|
-
|
|
1220
|
+
$.fail(g.tCurd("selectDataToDelete"));
|
|
1145
1221
|
return;
|
|
1146
1222
|
}
|
|
1147
|
-
|
|
1223
|
+
t.remove.items = n, t.remove.show = !0;
|
|
1148
1224
|
},
|
|
1225
|
+
/** 执行删除实际操作 */
|
|
1149
1226
|
submit: () => {
|
|
1150
1227
|
FunUtil.throttle(async () => {
|
|
1151
|
-
|
|
1152
|
-
const n =
|
|
1228
|
+
t.remove.loading = !0;
|
|
1229
|
+
const n = o.option.api.delete;
|
|
1153
1230
|
try {
|
|
1154
1231
|
if (!n) return;
|
|
1155
1232
|
await n({
|
|
1156
|
-
[
|
|
1157
|
-
items:
|
|
1158
|
-
}),
|
|
1233
|
+
[o.option.table?.rowKey]: t.remove.items.map((e) => e[o.option.table?.rowKey]),
|
|
1234
|
+
items: t.remove.items
|
|
1235
|
+
}), $.success(g.tCurd("operationSuccess")), t.table.data.length <= 1 && t.page.num > 1 && (t.page.num -= 1), t.remove.close(), await t.table.getList();
|
|
1159
1236
|
} catch (e) {
|
|
1160
1237
|
console.error(e);
|
|
1161
1238
|
} finally {
|
|
1162
|
-
|
|
1239
|
+
t.remove.loading = !1;
|
|
1163
1240
|
}
|
|
1164
1241
|
});
|
|
1165
1242
|
}
|
|
1166
1243
|
},
|
|
1244
|
+
/** 初始化curd关联所有默认与依赖配置及表单列 */
|
|
1167
1245
|
init: () => {
|
|
1168
|
-
|
|
1246
|
+
t.initCurdConfig(), t.initColumnOptions(), t.initColumnForm();
|
|
1247
|
+
},
|
|
1248
|
+
/** 下拉请求等数据缓存 */
|
|
1249
|
+
apiDataMap: {},
|
|
1250
|
+
/** 获取并绑定curd中所有下拉数据等远程依赖 */
|
|
1251
|
+
initApiData: async (n) => {
|
|
1252
|
+
const e = [], a = (d) => {
|
|
1253
|
+
if (d.children && d.children.length) {
|
|
1254
|
+
d.children.forEach((m) => a(m));
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
if (d.type === "select" && d.options?.select?.dataApi && d.options?.select?.dataApiConfig?.[n]) {
|
|
1258
|
+
if (t.apiDataMap[d.key] && d.options?.select?.dataApiConfig?.once) return;
|
|
1259
|
+
const m = (async () => {
|
|
1260
|
+
try {
|
|
1261
|
+
let p = await d.options?.select?.dataApi?.();
|
|
1262
|
+
if (p) {
|
|
1263
|
+
const c = d.options?.select?.dataPath;
|
|
1264
|
+
c && (p = ObjectUtil.getPathValue(p, c)), d.options.select.data = p, t.apiDataMap[d.key] = p;
|
|
1265
|
+
}
|
|
1266
|
+
} catch {
|
|
1267
|
+
}
|
|
1268
|
+
})();
|
|
1269
|
+
e.push(m);
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
return o.option.column.forEach((d) => {
|
|
1273
|
+
a(d);
|
|
1274
|
+
}), await Promise.all(e), !0;
|
|
1169
1275
|
},
|
|
1276
|
+
/** 初始化curd配置(option默认值合并等) */
|
|
1170
1277
|
initCurdConfig: () => {
|
|
1171
1278
|
const n = JSONUtil.cp(S.config);
|
|
1172
1279
|
n.table.emptyText = g.tCurd("noData");
|
|
1173
|
-
const e = ObjectUtil.deepMerge(n,
|
|
1280
|
+
const e = ObjectUtil.deepMerge(n, o.option || {});
|
|
1174
1281
|
Object.keys(e).forEach((a) => {
|
|
1175
|
-
|
|
1282
|
+
o.option[a] = e[a];
|
|
1176
1283
|
});
|
|
1177
1284
|
},
|
|
1178
1285
|
/**
|
|
1179
|
-
* 初始化curd
|
|
1286
|
+
* 初始化curd选项配置,每列merge默认配置等
|
|
1180
1287
|
* @param column
|
|
1181
1288
|
* @returns
|
|
1182
1289
|
*/
|
|
@@ -1190,108 +1297,109 @@ const W = U.EDialog, Se = (t) => {
|
|
|
1190
1297
|
});
|
|
1191
1298
|
const e = (a) => {
|
|
1192
1299
|
if (a.table = ObjectUtil.deepMerge(n.table, a.table || {}), a.children) {
|
|
1193
|
-
a.children.forEach((
|
|
1194
|
-
e(
|
|
1300
|
+
a.children.forEach((d) => {
|
|
1301
|
+
e(d);
|
|
1195
1302
|
});
|
|
1196
1303
|
return;
|
|
1197
1304
|
}
|
|
1198
|
-
a.options = ObjectUtil.deepMerge(n.options, a.options || {}), a.form = ObjectUtil.deepMerge(n.form, a.form || {}), a.show = ObjectUtil.deepMerge(n.show, a.show || {}), a.sort = ObjectUtil.deepMerge(n.sort, a.sort || {}), a.type = a.type || n.type, a.type === "switch" && (a.options.switch.tableBeforeChange = async (
|
|
1305
|
+
a.options = ObjectUtil.deepMerge(n.options, a.options || {}), a.form = ObjectUtil.deepMerge(n.form, a.form || {}), a.show = ObjectUtil.deepMerge(n.show, a.show || {}), a.sort = ObjectUtil.deepMerge(n.sort, a.sort || {}), a.type = a.type || n.type, a.type === "switch" && (a.options.switch.tableBeforeChange = async (d, m) => {
|
|
1199
1306
|
const p = a.options?.switch;
|
|
1200
1307
|
try {
|
|
1201
1308
|
await s.value?.open({
|
|
1202
1309
|
title: g.tCurd("confirmModify"),
|
|
1203
1310
|
content: g.tCurd("confirmSwitchMessage")
|
|
1204
|
-
}),
|
|
1311
|
+
}), t.table.loading = !0;
|
|
1205
1312
|
try {
|
|
1206
|
-
return
|
|
1207
|
-
[
|
|
1208
|
-
[
|
|
1209
|
-
final(
|
|
1210
|
-
|
|
1313
|
+
return o.option.api.update ? (await o.option.api.update({
|
|
1314
|
+
[o.option.table?.rowKey]: m[o.option.table?.rowKey],
|
|
1315
|
+
[d]: m[d] === p.activeValue ? p.inactiveValue : p.activeValue,
|
|
1316
|
+
final(c, i, u) {
|
|
1317
|
+
t.table.loading = !1;
|
|
1211
1318
|
}
|
|
1212
|
-
}),
|
|
1213
|
-
} catch (
|
|
1214
|
-
return console.error(
|
|
1319
|
+
}), t.table.loading = !1, $.success(g.tCurd("operationSuccess")), t.table.getList(), !0) : void 0;
|
|
1320
|
+
} catch (c) {
|
|
1321
|
+
return console.error(c), !1;
|
|
1215
1322
|
} finally {
|
|
1216
|
-
|
|
1323
|
+
t.table.loading = !1;
|
|
1217
1324
|
}
|
|
1218
1325
|
} catch {
|
|
1219
1326
|
return !1;
|
|
1220
1327
|
}
|
|
1221
|
-
}), a.type === "tree-select" && (a.options.treeSelect.rowKey =
|
|
1328
|
+
}), a.type === "tree-select" && (a.options.treeSelect.rowKey = o.option.table?.rowKey, a.options.treeSelect.nodeKey = o.option.table?.rowKey);
|
|
1222
1329
|
};
|
|
1223
|
-
|
|
1330
|
+
o.option.column.forEach(e), o.option.table?.column?.forEach(e);
|
|
1224
1331
|
},
|
|
1332
|
+
/** 初始化配置并生成表单列及默认值及规则 */
|
|
1225
1333
|
initColumnForm: () => {
|
|
1226
|
-
const n =
|
|
1227
|
-
|
|
1334
|
+
const n = o.option;
|
|
1335
|
+
t.update.formColumn = [], t.table.column.show = {
|
|
1228
1336
|
list: [],
|
|
1229
1337
|
listSource: []
|
|
1230
1338
|
};
|
|
1231
|
-
const e = [], a =
|
|
1339
|
+
const e = [], a = o.option.form?.maxSpan || 12, d = o.option.form?.defaultSpan || a / 2;
|
|
1232
1340
|
let m = [];
|
|
1233
|
-
const p = (
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
1341
|
+
const p = (u) => {
|
|
1342
|
+
if (u.children) {
|
|
1343
|
+
t.table.column.show.list.push(u.key), u.children.forEach((h) => {
|
|
1236
1344
|
p(h);
|
|
1237
1345
|
});
|
|
1238
1346
|
return;
|
|
1239
1347
|
}
|
|
1240
|
-
if (
|
|
1241
|
-
|
|
1242
|
-
let h =
|
|
1348
|
+
if (t.update.formDefault[u.key] = u.value, u.table.table && (u.show.table && t.table.column.show.list.push(u.key), u.table.table && t.table.column.show.listSource.push(u.key)), u.isForm) {
|
|
1349
|
+
u.form = u.form || { span: d }, u.form.span = u.form.span ?? d;
|
|
1350
|
+
let h = u.form.span, I = m.reduce((z, N) => z + N.span, h);
|
|
1243
1351
|
const j = m.length;
|
|
1244
|
-
if (m.push({ item:
|
|
1352
|
+
if (m.push({ item: u, span: h }), (j === 1 && m[0].span === 0 || I >= a || h === 0 && j > 1) && (e.push(m), m = []), u.rules) {
|
|
1245
1353
|
const z = {
|
|
1246
1354
|
input: g.tCurd("placeholderInput"),
|
|
1247
1355
|
select: g.tCurd("placeholderSelect")
|
|
1248
|
-
},
|
|
1249
|
-
|
|
1356
|
+
}, N = (z[u.type] || z.input) + u.label;
|
|
1357
|
+
t.update.rules[u.key] = typeof u.rules == "boolean" ? [
|
|
1250
1358
|
{
|
|
1251
1359
|
required: !0,
|
|
1252
|
-
message:
|
|
1360
|
+
message: N,
|
|
1253
1361
|
trigger: "blur"
|
|
1254
1362
|
}
|
|
1255
|
-
] :
|
|
1363
|
+
] : u.rules;
|
|
1256
1364
|
}
|
|
1257
1365
|
}
|
|
1258
|
-
},
|
|
1259
|
-
|
|
1366
|
+
}, c = (u, h) => {
|
|
1367
|
+
u.isForm = h, Array.isArray(u.children) && u.children.forEach((I) => c(I, h));
|
|
1260
1368
|
};
|
|
1261
|
-
n.column.forEach((
|
|
1262
|
-
|
|
1263
|
-
}),
|
|
1264
|
-
u
|
|
1265
|
-
}),
|
|
1266
|
-
const i =
|
|
1267
|
-
i && Object.keys(i).forEach((
|
|
1268
|
-
|
|
1269
|
-
}), n.column.forEach((
|
|
1270
|
-
|
|
1271
|
-
}),
|
|
1369
|
+
n.column.forEach((u) => {
|
|
1370
|
+
u.isForm = !0, c(u, !0), p(u);
|
|
1371
|
+
}), o.option.table?.column?.forEach((u) => {
|
|
1372
|
+
c(u, !1), p(u);
|
|
1373
|
+
}), t.search.column.list = n.column.concat(n.table?.column || []), t.table.column.list = t.search.column.list.filter((u) => u.table?.table), t.search.column.list.sort((u, h) => u.sort?.search - h.sort?.search), t.table.column.list.sort((u, h) => u.sort?.table - h.sort?.table), m.length > 0 && e.push(m), t.update.formColumn = e;
|
|
1374
|
+
const i = o.option.search?.formDefault;
|
|
1375
|
+
i && Object.keys(i).forEach((u) => {
|
|
1376
|
+
t.search.formDefault[u] = i[u];
|
|
1377
|
+
}), n.column.forEach((u) => {
|
|
1378
|
+
u.show?.search || (t.search.formDefault[u.key] = void 0);
|
|
1379
|
+
}), t.search.form = JSONUtil.cp(t.search.formDefault);
|
|
1272
1380
|
}
|
|
1273
1381
|
});
|
|
1274
|
-
return
|
|
1275
|
-
|
|
1276
|
-
}), { conf:
|
|
1277
|
-
}, Oe = { class: "dialog-footer" }, Fe = /* @__PURE__ */
|
|
1382
|
+
return t.init(), ae(() => {
|
|
1383
|
+
o.option.init !== !1 && t.table.getList();
|
|
1384
|
+
}), { conf: t, switchConfirmRef: s, ruleFormRef: r };
|
|
1385
|
+
}, Oe = { class: "dialog-footer" }, Fe = /* @__PURE__ */ K({
|
|
1278
1386
|
__name: "switchConfirm",
|
|
1279
|
-
setup(
|
|
1280
|
-
const r =
|
|
1387
|
+
setup(o, { expose: s }) {
|
|
1388
|
+
const r = A(!1), t = A("确认修改"), n = A("确认要修改状态吗?");
|
|
1281
1389
|
let e = null, a = null;
|
|
1282
|
-
const
|
|
1283
|
-
e = i, a =
|
|
1390
|
+
const d = (c) => (c?.title && (t.value = c.title), c?.content && (n.value = c.content), r.value = !0, new Promise((i, u) => {
|
|
1391
|
+
e = i, a = u;
|
|
1284
1392
|
})), m = () => {
|
|
1285
1393
|
r.value = !1, e?.(!0), e = null, a = null;
|
|
1286
1394
|
}, p = () => {
|
|
1287
1395
|
r.value = !1, a?.(new Error("用户取消操作")), e = null, a = null;
|
|
1288
1396
|
};
|
|
1289
1397
|
return s({
|
|
1290
|
-
open:
|
|
1291
|
-
}), (
|
|
1398
|
+
open: d
|
|
1399
|
+
}), (c, i) => (f(), y(l(Y), {
|
|
1292
1400
|
modelValue: r.value,
|
|
1293
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
1294
|
-
title:
|
|
1401
|
+
"onUpdate:modelValue": i[0] || (i[0] = (u) => r.value = u),
|
|
1402
|
+
title: t.value,
|
|
1295
1403
|
"close-on-click-modal": !1,
|
|
1296
1404
|
width: "400px"
|
|
1297
1405
|
}, {
|
|
@@ -1320,17 +1428,17 @@ const W = U.EDialog, Se = (t) => {
|
|
|
1320
1428
|
_: 1
|
|
1321
1429
|
}, 8, ["modelValue", "title"]));
|
|
1322
1430
|
}
|
|
1323
|
-
}), re = (
|
|
1324
|
-
const r =
|
|
1325
|
-
for (const [
|
|
1326
|
-
r[
|
|
1431
|
+
}), re = (o, s) => {
|
|
1432
|
+
const r = o.__vccOpts || o;
|
|
1433
|
+
for (const [t, n] of s)
|
|
1434
|
+
r[t] = n;
|
|
1327
1435
|
return r;
|
|
1328
1436
|
}, Ie = {}, Me = {
|
|
1329
1437
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1330
1438
|
viewBox: "0 0 1024 1024"
|
|
1331
1439
|
};
|
|
1332
|
-
function je(
|
|
1333
|
-
return
|
|
1440
|
+
function je(o, s) {
|
|
1441
|
+
return f(), w("svg", Me, [...s[0] || (s[0] = [
|
|
1334
1442
|
D("path", {
|
|
1335
1443
|
fill: "currentColor",
|
|
1336
1444
|
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
@@ -1342,45 +1450,45 @@ const Le = /* @__PURE__ */ re(Ie, [["render", je]]), ze = {}, Te = {
|
|
|
1342
1450
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1343
1451
|
viewBox: "0 0 1024 1024"
|
|
1344
1452
|
};
|
|
1345
|
-
function Re(
|
|
1346
|
-
return
|
|
1453
|
+
function Re(o, s) {
|
|
1454
|
+
return f(), w("svg", Te, [...s[0] || (s[0] = [
|
|
1347
1455
|
D("path", {
|
|
1348
1456
|
fill: "currentColor",
|
|
1349
1457
|
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
|
|
1350
1458
|
}, null, -1)
|
|
1351
1459
|
])]);
|
|
1352
1460
|
}
|
|
1353
|
-
const
|
|
1461
|
+
const Ae = /* @__PURE__ */ re(ze, [["render", Re]]), Pe = { class: "row flex-center table-header-label" }, Ke = { class: "table-header-tooltip" }, Ne = ["onClick"], Be = /* @__PURE__ */ K({
|
|
1354
1462
|
__name: "tableColumn",
|
|
1355
1463
|
props: {
|
|
1356
1464
|
conf: {},
|
|
1357
1465
|
columnList: {},
|
|
1358
1466
|
option: {}
|
|
1359
1467
|
},
|
|
1360
|
-
setup(
|
|
1468
|
+
setup(o) {
|
|
1361
1469
|
const s = ce().type;
|
|
1362
|
-
return (r,
|
|
1470
|
+
return (r, t) => {
|
|
1363
1471
|
const n = X("el-tooltip");
|
|
1364
|
-
return
|
|
1472
|
+
return f(!0), w(U, null, M(o.columnList, (e) => (f(), w(U, {
|
|
1365
1473
|
key: e.key
|
|
1366
1474
|
}, [
|
|
1367
|
-
|
|
1475
|
+
o.conf.table.column.show.list.includes(e.key) ? (f(), y(l(Z), V({
|
|
1368
1476
|
key: 0,
|
|
1369
1477
|
prop: e.key,
|
|
1370
1478
|
label: e.label
|
|
1371
1479
|
}, { ref_for: !0 }, e.table), {
|
|
1372
1480
|
header: b(() => [
|
|
1373
1481
|
k(r.$slots, "table-header-" + e.key, { item: e }, () => [
|
|
1374
|
-
D("div",
|
|
1375
|
-
e.table?.tooltip ? (
|
|
1482
|
+
D("div", Pe, [
|
|
1483
|
+
e.table?.tooltip ? (f(), y(n, {
|
|
1376
1484
|
key: 0,
|
|
1377
1485
|
effect: "dark",
|
|
1378
1486
|
content: e.table?.tooltip,
|
|
1379
1487
|
placement: "top"
|
|
1380
1488
|
}, {
|
|
1381
1489
|
default: b(() => [
|
|
1382
|
-
D("span",
|
|
1383
|
-
v(
|
|
1490
|
+
D("span", Ke, [
|
|
1491
|
+
v(Ae)
|
|
1384
1492
|
])
|
|
1385
1493
|
]),
|
|
1386
1494
|
_: 1
|
|
@@ -1390,43 +1498,43 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1390
1498
|
])
|
|
1391
1499
|
]),
|
|
1392
1500
|
default: b(({ row: a }) => [
|
|
1393
|
-
e.children ? (
|
|
1394
|
-
|
|
1395
|
-
(
|
|
1396
|
-
conf:
|
|
1501
|
+
e.children ? (f(), w(U, { key: 0 }, [
|
|
1502
|
+
t[0] || (t[0] = E(" ", -1)),
|
|
1503
|
+
(f(), y(H(l(s)), {
|
|
1504
|
+
conf: o.conf,
|
|
1397
1505
|
columnList: e.children,
|
|
1398
|
-
option:
|
|
1506
|
+
option: o.option
|
|
1399
1507
|
}, ie({ _: 2 }, [
|
|
1400
|
-
M(r.$slots, (
|
|
1508
|
+
M(r.$slots, (d, m) => ({
|
|
1401
1509
|
name: m,
|
|
1402
1510
|
fn: b((p) => [
|
|
1403
1511
|
k(r.$slots, m, V({ ref_for: !0 }, p || {}))
|
|
1404
1512
|
])
|
|
1405
1513
|
}))
|
|
1406
1514
|
]), 1032, ["conf", "columnList", "option"]))
|
|
1407
|
-
], 64)) : (
|
|
1408
|
-
e.show?.form &&
|
|
1409
|
-
e.type === "input" ? (
|
|
1515
|
+
], 64)) : (f(), w(U, { key: 1 }, [
|
|
1516
|
+
e.show?.form && o.option.table?.inlineEdit && o.conf.inlineEdit.row === a && (e.type === "input" || e.type === "select") ? (f(), w(U, { key: 0 }, [
|
|
1517
|
+
e.type === "input" ? (f(), y(l(q), V({
|
|
1410
1518
|
key: 0,
|
|
1411
|
-
modelValue:
|
|
1412
|
-
"onUpdate:modelValue": (
|
|
1519
|
+
modelValue: o.conf.inlineEdit.form[e.key],
|
|
1520
|
+
"onUpdate:modelValue": (d) => o.conf.inlineEdit.form[e.key] = d
|
|
1413
1521
|
}, { ref_for: !0 }, e.options?.input, {
|
|
1414
1522
|
size: "small",
|
|
1415
1523
|
style: { width: "100%" },
|
|
1416
|
-
onKeyup: fe(
|
|
1417
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : e.type === "select" ? (
|
|
1524
|
+
onKeyup: fe(o.conf.inlineEdit.submit, ["enter"])
|
|
1525
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onKeyup"])) : e.type === "select" ? (f(), y(l(J), V({
|
|
1418
1526
|
key: 1,
|
|
1419
|
-
modelValue:
|
|
1420
|
-
"onUpdate:modelValue": (
|
|
1527
|
+
modelValue: o.conf.inlineEdit.form[e.key],
|
|
1528
|
+
"onUpdate:modelValue": (d) => o.conf.inlineEdit.form[e.key] = d
|
|
1421
1529
|
}, { ref_for: !0 }, e.options?.select, {
|
|
1422
1530
|
size: "small",
|
|
1423
1531
|
style: { width: "100%" }
|
|
1424
1532
|
}), {
|
|
1425
1533
|
default: b(() => [
|
|
1426
|
-
(
|
|
1427
|
-
key:
|
|
1428
|
-
label:
|
|
1429
|
-
value:
|
|
1534
|
+
(f(!0), w(U, null, M(e.options?.select?.data, (d) => (f(), y(l(P), {
|
|
1535
|
+
key: d.value,
|
|
1536
|
+
label: d.label,
|
|
1537
|
+
value: d.value
|
|
1430
1538
|
}, null, 8, ["label", "value"]))), 128))
|
|
1431
1539
|
]),
|
|
1432
1540
|
_: 2
|
|
@@ -1436,19 +1544,19 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1436
1544
|
row: a,
|
|
1437
1545
|
item: e
|
|
1438
1546
|
}, () => [
|
|
1439
|
-
e.type === "switch" ? (
|
|
1547
|
+
e.type === "switch" ? (f(), y(l(ee), V({
|
|
1440
1548
|
key: 0,
|
|
1441
1549
|
modelValue: a[e.key],
|
|
1442
|
-
"onUpdate:modelValue": (
|
|
1550
|
+
"onUpdate:modelValue": (d) => a[e.key] = d,
|
|
1443
1551
|
"before-change": () => e.options?.switch?.tableBeforeChange?.(e.key, a)
|
|
1444
|
-
}, { ref_for: !0 }, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (
|
|
1552
|
+
}, { ref_for: !0 }, e.options?.switch), null, 16, ["modelValue", "onUpdate:modelValue", "before-change"])) : (f(), w("span", {
|
|
1445
1553
|
key: 1,
|
|
1446
1554
|
style: ne({
|
|
1447
1555
|
"--table-text-click-color": e.table?.click?.color
|
|
1448
1556
|
}),
|
|
1449
1557
|
class: T({ "table-text-click": e.table?.click?.callback }),
|
|
1450
|
-
onClick: (
|
|
1451
|
-
}, x(a[e.key]), 15,
|
|
1558
|
+
onClick: (d) => e.table?.click?.callback?.(a)
|
|
1559
|
+
}, x(a[e.key]), 15, Ne))
|
|
1452
1560
|
])
|
|
1453
1561
|
], 64))
|
|
1454
1562
|
]),
|
|
@@ -1457,67 +1565,67 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1457
1565
|
], 64))), 128);
|
|
1458
1566
|
};
|
|
1459
1567
|
}
|
|
1460
|
-
}), le = /* @__PURE__ */
|
|
1568
|
+
}), le = /* @__PURE__ */ K({
|
|
1461
1569
|
__name: "formColumn",
|
|
1462
1570
|
props: {
|
|
1463
1571
|
conf: {},
|
|
1464
1572
|
item: {}
|
|
1465
1573
|
},
|
|
1466
|
-
setup(
|
|
1467
|
-
return (s, r) =>
|
|
1574
|
+
setup(o) {
|
|
1575
|
+
return (s, r) => o.item.item.type === "input" ? (f(), y(l(q), V({
|
|
1468
1576
|
key: 0,
|
|
1469
|
-
modelValue:
|
|
1470
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1471
|
-
},
|
|
1472
|
-
disabled:
|
|
1473
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1577
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1578
|
+
"onUpdate:modelValue": r[0] || (r[0] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1579
|
+
}, o.item.item.options?.input, O(o.item.item.options?.input?.on || {}), {
|
|
1580
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1581
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "switch" ? (f(), y(l(ee), V({
|
|
1474
1582
|
key: 1,
|
|
1475
|
-
modelValue:
|
|
1476
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
1477
|
-
},
|
|
1478
|
-
disabled:
|
|
1479
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1583
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1584
|
+
"onUpdate:modelValue": r[1] || (r[1] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1585
|
+
}, o.item.item.options?.switch, {
|
|
1586
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1587
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "select" ? (f(), y(l(J), V({
|
|
1480
1588
|
key: 2,
|
|
1481
|
-
modelValue:
|
|
1482
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
1483
|
-
},
|
|
1484
|
-
disabled:
|
|
1589
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1590
|
+
"onUpdate:modelValue": r[2] || (r[2] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1591
|
+
}, o.item.item.options?.select, O(o.item.item.options?.select?.on || {}), {
|
|
1592
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1485
1593
|
style: { width: "100%" }
|
|
1486
1594
|
}), {
|
|
1487
1595
|
default: b(() => [
|
|
1488
|
-
(
|
|
1489
|
-
key:
|
|
1490
|
-
label:
|
|
1491
|
-
value:
|
|
1596
|
+
(f(!0), w(U, null, M(o.item.item.options?.select?.data, (t) => (f(), y(l(P), {
|
|
1597
|
+
key: t.value,
|
|
1598
|
+
label: t.label,
|
|
1599
|
+
value: t.value
|
|
1492
1600
|
}, null, 8, ["label", "value"]))), 128))
|
|
1493
1601
|
]),
|
|
1494
1602
|
_: 1
|
|
1495
|
-
}, 16, ["modelValue", "disabled"])) :
|
|
1603
|
+
}, 16, ["modelValue", "disabled"])) : o.item.item.type === "list" ? (f(), y(oe, V({
|
|
1496
1604
|
key: 3,
|
|
1497
|
-
row:
|
|
1498
|
-
field:
|
|
1499
|
-
},
|
|
1500
|
-
disabled:
|
|
1605
|
+
row: o.conf.update.form,
|
|
1606
|
+
field: o.item.item.key
|
|
1607
|
+
}, o.item.item.options?.list, O(o.item.item.options?.list?.on || {}), {
|
|
1608
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1501
1609
|
style: { width: "100%" }
|
|
1502
|
-
}), null, 16, ["row", "field", "disabled"])) :
|
|
1610
|
+
}), null, 16, ["row", "field", "disabled"])) : o.item.item.type === "tree-select" ? (f(), y(l(se), V({
|
|
1503
1611
|
key: 4,
|
|
1504
|
-
modelValue:
|
|
1505
|
-
"onUpdate:modelValue": r[3] || (r[3] = (
|
|
1506
|
-
},
|
|
1507
|
-
disabled:
|
|
1612
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1613
|
+
"onUpdate:modelValue": r[3] || (r[3] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1614
|
+
}, o.item.item.options?.treeSelect, O(o.item.item.options?.treeSelect?.on || {}), {
|
|
1615
|
+
disabled: o.conf.update.getDisabled(o.item.item),
|
|
1508
1616
|
style: { width: "100%" }
|
|
1509
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1617
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type === "datetime" ? (f(), y(l(te), V({
|
|
1510
1618
|
key: 5,
|
|
1511
|
-
modelValue:
|
|
1512
|
-
"onUpdate:modelValue": r[4] || (r[4] = (
|
|
1513
|
-
},
|
|
1514
|
-
disabled:
|
|
1515
|
-
}), null, 16, ["modelValue", "disabled"])) :
|
|
1619
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1620
|
+
"onUpdate:modelValue": r[4] || (r[4] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1621
|
+
}, o.item.item.options?.datetime, O(o.item.item.options?.datetime?.on || {}), {
|
|
1622
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1623
|
+
}), null, 16, ["modelValue", "disabled"])) : o.item.item.type && l(L).customComponent[o.item.item.type] ? (f(), y(H(l(L).customComponent[o.item.item.type]), V({
|
|
1516
1624
|
key: 6,
|
|
1517
|
-
modelValue:
|
|
1518
|
-
"onUpdate:modelValue": r[5] || (r[5] = (
|
|
1519
|
-
},
|
|
1520
|
-
disabled:
|
|
1625
|
+
modelValue: o.conf.update.form[o.item.item.key],
|
|
1626
|
+
"onUpdate:modelValue": r[5] || (r[5] = (t) => o.conf.update.form[o.item.item.key] = t)
|
|
1627
|
+
}, o.item.item.options?.[o.item.item.type], O(o.item.item.options?.[o.item.item.type]?.on || {}), {
|
|
1628
|
+
disabled: o.conf.update.getDisabled(o.item.item)
|
|
1521
1629
|
}), null, 16, ["modelValue", "disabled"])) : C("", !0);
|
|
1522
1630
|
}
|
|
1523
1631
|
}), Je = { class: "col relative cc1-form-box" }, We = {
|
|
@@ -1538,7 +1646,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1538
1646
|
}, nt = { class: "col" }, it = {
|
|
1539
1647
|
class: "row form-item-content",
|
|
1540
1648
|
style: { width: "100%" }
|
|
1541
|
-
}, st = { class: "col" }, rt = { class: "dialog-footer" }, dt = { class: "dialog-footer" }, ut = /* @__PURE__ */
|
|
1649
|
+
}, st = { class: "col" }, rt = { class: "dialog-footer" }, dt = { class: "dialog-footer" }, ut = /* @__PURE__ */ K({
|
|
1542
1650
|
__name: "index",
|
|
1543
1651
|
props: {
|
|
1544
1652
|
/**
|
|
@@ -1548,17 +1656,17 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1548
1656
|
default: {}
|
|
1549
1657
|
}
|
|
1550
1658
|
},
|
|
1551
|
-
setup(
|
|
1552
|
-
const r =
|
|
1659
|
+
setup(o, { expose: s }) {
|
|
1660
|
+
const r = $.EDialog, t = o, n = $.isFun, { conf: e, switchConfirmRef: a, ruleFormRef: d } = Se(t);
|
|
1553
1661
|
return s({
|
|
1554
1662
|
conf: e
|
|
1555
1663
|
}), (m, p) => {
|
|
1556
|
-
const
|
|
1557
|
-
return
|
|
1664
|
+
const c = me("loading");
|
|
1665
|
+
return f(), w("div", Je, [
|
|
1558
1666
|
D("div", We, [
|
|
1559
1667
|
k(m.$slots, "box-left"),
|
|
1560
1668
|
D("div", He, [
|
|
1561
|
-
|
|
1669
|
+
o.option.search?.show !== !1 ? (f(), w("div", qe, [
|
|
1562
1670
|
v(l(Q), {
|
|
1563
1671
|
model: l(e).search.form,
|
|
1564
1672
|
inline: ""
|
|
@@ -1567,10 +1675,10 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1567
1675
|
k(m.$slots, "search-start", {
|
|
1568
1676
|
row: l(e).search.form
|
|
1569
1677
|
}),
|
|
1570
|
-
(
|
|
1678
|
+
(f(!0), w(U, null, M(l(e).search.column.list, (i) => (f(), w(U, {
|
|
1571
1679
|
key: i.key
|
|
1572
1680
|
}, [
|
|
1573
|
-
(typeof i.show?.search == "function" ? i.show?.search(l(e).search.form) : i.show?.search) ? (
|
|
1681
|
+
(typeof i.show?.search == "function" ? i.show?.search(l(e).search.form) : i.show?.search) ? (f(), y(l(B), {
|
|
1574
1682
|
key: 0,
|
|
1575
1683
|
label: typeof i.text?.search?.label == "string" ? i.text?.search?.label : i.label,
|
|
1576
1684
|
class: T({
|
|
@@ -1581,60 +1689,60 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1581
1689
|
k(m.$slots, "search-" + i.key, {
|
|
1582
1690
|
row: l(e).search.form
|
|
1583
1691
|
}, () => [
|
|
1584
|
-
i.type === "input" ? (
|
|
1692
|
+
i.type === "input" ? (f(), y(l(q), V({
|
|
1585
1693
|
key: 0,
|
|
1586
1694
|
modelValue: l(e).search.form[i.key],
|
|
1587
|
-
"onUpdate:modelValue": (
|
|
1695
|
+
"onUpdate:modelValue": (u) => l(e).search.form[i.key] = u,
|
|
1588
1696
|
placeholder: l(e).search.getPlaceholder(i),
|
|
1589
1697
|
clearable: "",
|
|
1590
1698
|
disabled: i.disabled?.search
|
|
1591
|
-
}, { ref_for: !0 }, i.options?.input, O(i.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "switch" ? (
|
|
1699
|
+
}, { ref_for: !0 }, i.options?.input, O(i.options?.input?.on || {})), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "switch" ? (f(), y(l(J), V({
|
|
1592
1700
|
key: 1,
|
|
1593
1701
|
modelValue: l(e).search.form[i.key],
|
|
1594
|
-
"onUpdate:modelValue": (
|
|
1702
|
+
"onUpdate:modelValue": (u) => l(e).search.form[i.key] = u,
|
|
1595
1703
|
placeholder: l(e).search.getPlaceholder(i, l(g).tCurd("placeholderSelect")),
|
|
1596
1704
|
clearable: "",
|
|
1597
1705
|
disabled: i.disabled?.search
|
|
1598
1706
|
}, { ref_for: !0 }, i.options?.switch, O(i.options?.switch?.on || {})), {
|
|
1599
1707
|
default: b(() => [
|
|
1600
|
-
(
|
|
1708
|
+
(f(), y(l(P), {
|
|
1601
1709
|
key: i.options?.switch?.activeValue,
|
|
1602
1710
|
label: i.options?.switch?.activeLabel,
|
|
1603
1711
|
value: i.options?.switch?.activeValue
|
|
1604
1712
|
}, null, 8, ["label", "value"])),
|
|
1605
|
-
(
|
|
1713
|
+
(f(), y(l(P), {
|
|
1606
1714
|
key: i.options?.switch?.inactiveValue,
|
|
1607
1715
|
label: i.options?.switch?.inactiveLabel,
|
|
1608
1716
|
value: i.options?.switch?.inactiveValue
|
|
1609
1717
|
}, null, 8, ["label", "value"]))
|
|
1610
1718
|
]),
|
|
1611
1719
|
_: 2
|
|
1612
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (
|
|
1720
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "select" ? (f(), y(l(J), V({
|
|
1613
1721
|
key: 2,
|
|
1614
1722
|
modelValue: l(e).search.form[i.key],
|
|
1615
|
-
"onUpdate:modelValue": (
|
|
1723
|
+
"onUpdate:modelValue": (u) => l(e).search.form[i.key] = u,
|
|
1616
1724
|
placeholder: l(e).search.getPlaceholder(i, l(g).tCurd("placeholderSelect")),
|
|
1617
1725
|
clearable: "",
|
|
1618
1726
|
disabled: i.disabled?.search
|
|
1619
1727
|
}, { ref_for: !0 }, i.options?.select, O(i.options?.select?.on || {})), {
|
|
1620
1728
|
default: b(() => [
|
|
1621
|
-
(
|
|
1622
|
-
key:
|
|
1623
|
-
label:
|
|
1624
|
-
value:
|
|
1729
|
+
(f(!0), w(U, null, M(i.options?.select?.data, (u) => (f(), y(l(P), {
|
|
1730
|
+
key: u.value,
|
|
1731
|
+
label: u.label,
|
|
1732
|
+
value: u.value
|
|
1625
1733
|
}, null, 8, ["label", "value"]))), 128))
|
|
1626
1734
|
]),
|
|
1627
1735
|
_: 2
|
|
1628
|
-
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (
|
|
1736
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : i.type === "datetime" ? (f(), y(l(te), V({
|
|
1629
1737
|
key: 3,
|
|
1630
1738
|
modelValue: l(e).search.form[i.key],
|
|
1631
|
-
"onUpdate:modelValue": (
|
|
1739
|
+
"onUpdate:modelValue": (u) => l(e).search.form[i.key] = u
|
|
1632
1740
|
}, { ref_for: !0 }, i.options?.datetime, O(i.options?.datetime?.on || {}), {
|
|
1633
1741
|
disabled: i.disabled?.search
|
|
1634
|
-
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type && l(L).customComponent[i.type] ? (
|
|
1742
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : i.type && l(L).customComponent[i.type] ? (f(), y(H(l(L).customComponent[i.type]), V({
|
|
1635
1743
|
key: 4,
|
|
1636
1744
|
modelValue: l(e).search.form[i.key],
|
|
1637
|
-
"onUpdate:modelValue": (
|
|
1745
|
+
"onUpdate:modelValue": (u) => l(e).search.form[i.key] = u
|
|
1638
1746
|
}, { ref_for: !0 }, i.options?.[i.type], O(i.options?.[i.type]?.on || {}), {
|
|
1639
1747
|
disabled: i.disabled?.search
|
|
1640
1748
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : C("", !0)
|
|
@@ -1649,9 +1757,9 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1649
1757
|
k(m.$slots, "search-center", {
|
|
1650
1758
|
row: l(e).search.form
|
|
1651
1759
|
}),
|
|
1652
|
-
|
|
1760
|
+
o.option.tools?.search || o.option.tools?.reset ? (f(), y(l(B), { key: 0 }, {
|
|
1653
1761
|
default: b(() => [
|
|
1654
|
-
|
|
1762
|
+
o.option.tools?.search ? (f(), y(l(F), {
|
|
1655
1763
|
key: 0,
|
|
1656
1764
|
type: "primary",
|
|
1657
1765
|
onClick: l(e).search.submit
|
|
@@ -1661,7 +1769,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1661
1769
|
]),
|
|
1662
1770
|
_: 1
|
|
1663
1771
|
}, 8, ["onClick"])) : C("", !0),
|
|
1664
|
-
|
|
1772
|
+
o.option.tools?.reset ? (f(), y(l(F), {
|
|
1665
1773
|
key: 1,
|
|
1666
1774
|
onClick: l(e).search.reset
|
|
1667
1775
|
}, {
|
|
@@ -1682,7 +1790,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1682
1790
|
])) : C("", !0),
|
|
1683
1791
|
D("div", Ge, [
|
|
1684
1792
|
D("div", Xe, [
|
|
1685
|
-
l(n)(
|
|
1793
|
+
l(n)(o.option.tools?.add) ? (f(), w("div", Qe, [
|
|
1686
1794
|
v(l(F), {
|
|
1687
1795
|
type: "primary",
|
|
1688
1796
|
onClick: p[0] || (p[0] = (i) => l(e).update.open(l(r).Insert))
|
|
@@ -1693,7 +1801,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1693
1801
|
_: 1
|
|
1694
1802
|
})
|
|
1695
1803
|
])) : C("", !0),
|
|
1696
|
-
|
|
1804
|
+
o.option.table?.selectable && l(n)(o.option.tools?.delete) ? (f(), w("div", Ye, [
|
|
1697
1805
|
v(l(F), {
|
|
1698
1806
|
type: "danger",
|
|
1699
1807
|
onClick: p[1] || (p[1] = (i) => l(e).remove.open(l(e).table.selection.list))
|
|
@@ -1704,7 +1812,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1704
1812
|
_: 1
|
|
1705
1813
|
})
|
|
1706
1814
|
])) : C("", !0),
|
|
1707
|
-
|
|
1815
|
+
o.option.tools?.expand ? (f(), w("div", Ze, [
|
|
1708
1816
|
v(l(F), {
|
|
1709
1817
|
type: "warning",
|
|
1710
1818
|
onClick: p[2] || (p[2] = (i) => l(e).table.expand.all())
|
|
@@ -1715,14 +1823,14 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1715
1823
|
_: 1
|
|
1716
1824
|
})
|
|
1717
1825
|
])) : C("", !0),
|
|
1718
|
-
|
|
1826
|
+
o.option.tools?.export?.show ? (f(), y(l(we), {
|
|
1719
1827
|
key: 3,
|
|
1720
1828
|
onCommand: l(e).export.click
|
|
1721
1829
|
}, {
|
|
1722
1830
|
dropdown: b(() => [
|
|
1723
1831
|
v(l(ke), null, {
|
|
1724
1832
|
default: b(() => [
|
|
1725
|
-
|
|
1833
|
+
o.option.table?.selectable ? (f(), y(l(G), {
|
|
1726
1834
|
key: 0,
|
|
1727
1835
|
command: "select"
|
|
1728
1836
|
}, {
|
|
@@ -1766,7 +1874,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1766
1874
|
]),
|
|
1767
1875
|
D("div", et, [
|
|
1768
1876
|
k(m.$slots, "tools-right"),
|
|
1769
|
-
|
|
1877
|
+
o.option.tools?.refresh === void 0 || o.option.tools?.refresh ? (f(), w("div", {
|
|
1770
1878
|
key: 0,
|
|
1771
1879
|
class: "refresh-btn",
|
|
1772
1880
|
onClick: p[3] || (p[3] = //@ts-ignore
|
|
@@ -1778,39 +1886,39 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1778
1886
|
]),
|
|
1779
1887
|
D("div", tt, [
|
|
1780
1888
|
D("div", ot, [
|
|
1781
|
-
pe((
|
|
1889
|
+
pe((f(), y(l(Ce), V({
|
|
1782
1890
|
data: l(e).table.data,
|
|
1783
|
-
border:
|
|
1784
|
-
},
|
|
1891
|
+
border: o.option.table?.border === void 0 ? !0 : o.option.table?.border
|
|
1892
|
+
}, o.option.table, {
|
|
1785
1893
|
onSelectionChange: l(e).table.selection.change,
|
|
1786
1894
|
"expand-row-keys": l(e).table.expand.rowKeys,
|
|
1787
1895
|
onExpandChange: l(e).table.expand.change
|
|
1788
1896
|
}), {
|
|
1789
1897
|
default: b(() => [
|
|
1790
|
-
|
|
1898
|
+
o.option.table?.selectable || l(n)(o.option.tools?.delete) || o.option.tools?.export?.show ? (f(), y(l(Z), {
|
|
1791
1899
|
key: 0,
|
|
1792
1900
|
type: "selection",
|
|
1793
|
-
selectable: typeof
|
|
1901
|
+
selectable: typeof o.option.table?.selectable == "function" ? o.option.table?.selectable : void 0,
|
|
1794
1902
|
width: "55"
|
|
1795
1903
|
}, null, 8, ["selectable"])) : C("", !0),
|
|
1796
1904
|
v(Be, {
|
|
1797
1905
|
conf: l(e),
|
|
1798
1906
|
columnList: l(e).table.column.list,
|
|
1799
|
-
option:
|
|
1907
|
+
option: o.option
|
|
1800
1908
|
}, ie({ _: 2 }, [
|
|
1801
|
-
M(m.$slots, (i,
|
|
1802
|
-
name:
|
|
1909
|
+
M(m.$slots, (i, u) => ({
|
|
1910
|
+
name: u,
|
|
1803
1911
|
fn: b((h) => [
|
|
1804
|
-
k(m.$slots,
|
|
1912
|
+
k(m.$slots, u, he(be(h || {})))
|
|
1805
1913
|
])
|
|
1806
1914
|
}))
|
|
1807
1915
|
]), 1032, ["conf", "columnList", "option"]),
|
|
1808
|
-
l(n)(
|
|
1916
|
+
l(n)(o.option.table?.add) || l(n)(o.option.table?.update) || l(n)(o.option.table?.delete) || m.$slots["table-op-left"] || m.$slots["table-op-right"] ? (f(), y(l(Z), V({
|
|
1809
1917
|
key: 1,
|
|
1810
|
-
width: l(e).table.op.width(l(n)(
|
|
1918
|
+
width: l(e).table.op.width(l(n)(o.option.table?.add), l(n)(o.option.table?.update), l(n)(o.option.table?.delete), m.$slots["table-op-left"], m.$slots["table-op-right"]),
|
|
1811
1919
|
align: "center",
|
|
1812
1920
|
fixed: "right"
|
|
1813
|
-
},
|
|
1921
|
+
}, o.option.table?.operate), {
|
|
1814
1922
|
header: b(() => [
|
|
1815
1923
|
k(m.$slots, "table-header-op", {}, () => [
|
|
1816
1924
|
E(x(l(g).tCurd("operation")), 1)
|
|
@@ -1818,7 +1926,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1818
1926
|
]),
|
|
1819
1927
|
default: b(({ row: i }) => [
|
|
1820
1928
|
k(m.$slots, "table-op-left", { row: i }),
|
|
1821
|
-
|
|
1929
|
+
o.option.table?.inlineEdit && l(e).inlineEdit.row === i ? (f(), w(U, { key: 0 }, [
|
|
1822
1930
|
v(l(F), {
|
|
1823
1931
|
link: "",
|
|
1824
1932
|
type: "info",
|
|
@@ -1841,34 +1949,34 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1841
1949
|
_: 1
|
|
1842
1950
|
}, 8, ["onClick", "loading"]),
|
|
1843
1951
|
k(m.$slots, "table-op-edit-right", { row: i })
|
|
1844
|
-
], 64)) : (
|
|
1845
|
-
l(n)(
|
|
1952
|
+
], 64)) : (f(), w(U, { key: 1 }, [
|
|
1953
|
+
l(n)(o.option.table?.add, i) ? (f(), y(l(F), {
|
|
1846
1954
|
key: 0,
|
|
1847
1955
|
link: "",
|
|
1848
1956
|
type: "primary",
|
|
1849
|
-
onClick: (
|
|
1957
|
+
onClick: (u) => l(e).update.open(l(r).Insert, i)
|
|
1850
1958
|
}, {
|
|
1851
1959
|
default: b(() => [
|
|
1852
1960
|
E(x(l(g).tCurd("add")), 1)
|
|
1853
1961
|
]),
|
|
1854
1962
|
_: 1
|
|
1855
1963
|
}, 8, ["onClick"])) : C("", !0),
|
|
1856
|
-
l(n)(
|
|
1964
|
+
l(n)(o.option.table?.update, i) ? (f(), y(l(F), {
|
|
1857
1965
|
key: 1,
|
|
1858
1966
|
link: "",
|
|
1859
1967
|
type: "warning",
|
|
1860
|
-
onClick: (
|
|
1968
|
+
onClick: (u) => l(e).update.open(l(r).Update, i)
|
|
1861
1969
|
}, {
|
|
1862
1970
|
default: b(() => [
|
|
1863
1971
|
E(x(l(g).tCurd("edit")), 1)
|
|
1864
1972
|
]),
|
|
1865
1973
|
_: 1
|
|
1866
1974
|
}, 8, ["onClick"])) : C("", !0),
|
|
1867
|
-
l(n)(
|
|
1975
|
+
l(n)(o.option.table?.delete, i) ? (f(), y(l(F), {
|
|
1868
1976
|
key: 2,
|
|
1869
1977
|
link: "",
|
|
1870
1978
|
type: "danger",
|
|
1871
|
-
onClick: (
|
|
1979
|
+
onClick: (u) => l(e).remove.open([i])
|
|
1872
1980
|
}, {
|
|
1873
1981
|
default: b(() => [
|
|
1874
1982
|
E(x(l(g).tCurd("delete")), 1)
|
|
@@ -1883,12 +1991,12 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1883
1991
|
]),
|
|
1884
1992
|
_: 3
|
|
1885
1993
|
}, 16, ["data", "border", "onSelectionChange", "expand-row-keys", "onExpandChange"])), [
|
|
1886
|
-
[
|
|
1994
|
+
[c, l(e).table.loading]
|
|
1887
1995
|
])
|
|
1888
1996
|
])
|
|
1889
1997
|
]),
|
|
1890
1998
|
D("div", lt, [
|
|
1891
|
-
|
|
1999
|
+
o.option.page?.show === void 0 || o.option.page?.show ? (f(), y(l(ve), {
|
|
1892
2000
|
key: 0,
|
|
1893
2001
|
"current-page": l(e).page.num,
|
|
1894
2002
|
"onUpdate:currentPage": p[4] || (p[4] = (i) => l(e).page.num = i),
|
|
@@ -1911,7 +2019,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1911
2019
|
"onUpdate:modelValue": p[6] || (p[6] = (i) => l(e).update.show = i),
|
|
1912
2020
|
title: l(e).update.title,
|
|
1913
2021
|
"before-close": l(e).update.close
|
|
1914
|
-
},
|
|
2022
|
+
}, o.option.dialog), {
|
|
1915
2023
|
footer: b(() => [
|
|
1916
2024
|
D("span", rt, [
|
|
1917
2025
|
v(l(F), {
|
|
@@ -1937,34 +2045,34 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1937
2045
|
default: b(() => [
|
|
1938
2046
|
v(l(Q), {
|
|
1939
2047
|
ref_key: "ruleFormRef",
|
|
1940
|
-
ref:
|
|
2048
|
+
ref: d,
|
|
1941
2049
|
model: l(e).update.form,
|
|
1942
2050
|
rules: l(e).update.rules
|
|
1943
2051
|
}, {
|
|
1944
2052
|
default: b(() => [
|
|
1945
|
-
l(e).update.showContent ? (
|
|
2053
|
+
l(e).update.showContent ? (f(!0), w(U, { key: 0 }, M(l(e).update.formColumn, (i) => (f(), w(U, null, [
|
|
1946
2054
|
l(n)(() => {
|
|
1947
|
-
const
|
|
2055
|
+
const u = [], h = (I) => {
|
|
1948
2056
|
if (I.children)
|
|
1949
2057
|
return h(I.children);
|
|
1950
|
-
|
|
2058
|
+
u.push(...I.map((j) => j.item.show?.form));
|
|
1951
2059
|
};
|
|
1952
|
-
return h(i),
|
|
1953
|
-
}, l(e).update.form) ? (
|
|
2060
|
+
return h(i), u;
|
|
2061
|
+
}, l(e).update.form) ? (f(), w("div", {
|
|
1954
2062
|
key: 0,
|
|
1955
2063
|
class: T(["row curd-row", {
|
|
1956
|
-
stripe:
|
|
2064
|
+
stripe: o.option.form?.stripe === void 0 ? !0 : o.option.form?.stripe
|
|
1957
2065
|
}])
|
|
1958
2066
|
}, [
|
|
1959
2067
|
k(m.$slots, "form-start", {
|
|
1960
2068
|
row: l(e).update.form
|
|
1961
2069
|
}),
|
|
1962
|
-
(
|
|
1963
|
-
l(n)(
|
|
2070
|
+
(f(!0), w(U, null, M(i, (u) => (f(), w(U, null, [
|
|
2071
|
+
l(n)(u.item.show?.form, l(e).update.form) ? (f(), w("div", {
|
|
1964
2072
|
key: 0,
|
|
1965
|
-
class: T(
|
|
2073
|
+
class: T(u.item.form.span > 0 ? `col-${u.item.form.span}` : "col")
|
|
1966
2074
|
}, [
|
|
1967
|
-
|
|
2075
|
+
u.item.children ? (f(!0), w(U, { key: 0 }, M(u.children, (h) => (f(), y(l(B), {
|
|
1968
2076
|
class: T({
|
|
1969
2077
|
"hide-label": typeof h.item.text?.form?.label == "boolean" ? !h.item.text?.form?.label : !1
|
|
1970
2078
|
}),
|
|
@@ -1985,7 +2093,7 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
1985
2093
|
}, () => [
|
|
1986
2094
|
v(le, {
|
|
1987
2095
|
conf: l(e),
|
|
1988
|
-
item:
|
|
2096
|
+
item: u
|
|
1989
2097
|
}, null, 8, ["conf", "item"])
|
|
1990
2098
|
]),
|
|
1991
2099
|
k(m.$slots, "form-" + h.item.key + "-right", {
|
|
@@ -2000,39 +2108,39 @@ const Ke = /* @__PURE__ */ re(ze, [["render", Re]]), Ne = { class: "row flex-cen
|
|
|
2000
2108
|
])
|
|
2001
2109
|
]),
|
|
2002
2110
|
_: 2
|
|
2003
|
-
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (
|
|
2111
|
+
}, 1032, ["class", "label", "prop", "label-width"]))), 256)) : (f(), y(l(B), {
|
|
2004
2112
|
key: 1,
|
|
2005
2113
|
class: T({
|
|
2006
|
-
"hide-label": typeof
|
|
2114
|
+
"hide-label": typeof u.item.text?.form?.label == "boolean" ? !u.item.text?.form?.label : !1
|
|
2007
2115
|
}),
|
|
2008
|
-
label: typeof
|
|
2009
|
-
prop:
|
|
2010
|
-
"label-width":
|
|
2116
|
+
label: typeof u.item.text?.form?.label == "string" ? u.item.text?.form?.label : u.item.label,
|
|
2117
|
+
prop: u.item.key,
|
|
2118
|
+
"label-width": u.item.form?.labelWidth || "100px"
|
|
2011
2119
|
}, {
|
|
2012
2120
|
default: b(() => [
|
|
2013
2121
|
D("div", it, [
|
|
2014
|
-
k(m.$slots, "form-" +
|
|
2122
|
+
k(m.$slots, "form-" + u.item.key + "-start", {
|
|
2015
2123
|
row: l(e).update.form,
|
|
2016
|
-
item:
|
|
2124
|
+
item: u.item
|
|
2017
2125
|
}),
|
|
2018
2126
|
D("div", st, [
|
|
2019
|
-
k(m.$slots, "form-" +
|
|
2127
|
+
k(m.$slots, "form-" + u.item.key, {
|
|
2020
2128
|
row: l(e).update.form,
|
|
2021
|
-
item:
|
|
2129
|
+
item: u.item
|
|
2022
2130
|
}, () => [
|
|
2023
2131
|
v(le, {
|
|
2024
2132
|
conf: l(e),
|
|
2025
|
-
item:
|
|
2133
|
+
item: u
|
|
2026
2134
|
}, null, 8, ["conf", "item"])
|
|
2027
2135
|
]),
|
|
2028
|
-
k(m.$slots, "form-" +
|
|
2136
|
+
k(m.$slots, "form-" + u.item.key + "-right", {
|
|
2029
2137
|
row: l(e).update.form,
|
|
2030
|
-
item:
|
|
2138
|
+
item: u.item
|
|
2031
2139
|
})
|
|
2032
2140
|
]),
|
|
2033
|
-
k(m.$slots, "form-" +
|
|
2141
|
+
k(m.$slots, "form-" + u.item.key + "-end", {
|
|
2034
2142
|
row: l(e).update.form,
|
|
2035
|
-
item:
|
|
2143
|
+
item: u.item
|
|
2036
2144
|
})
|
|
2037
2145
|
])
|
|
2038
2146
|
]),
|
|
@@ -2100,8 +2208,8 @@ class pt {
|
|
|
2100
2208
|
* @param name - 下载后的文件名,默认 `'download.png'`
|
|
2101
2209
|
*/
|
|
2102
2210
|
static async download(s, r = "download.png") {
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2211
|
+
const t = document.createElement("a");
|
|
2212
|
+
t.style.display = "none", t.href = s, t.setAttribute("download", r), typeof t.download > "u" && t.setAttribute("target", "_blank"), document.body.appendChild(t), t.click(), document.body.removeChild(t), window.URL.revokeObjectURL(s);
|
|
2105
2213
|
}
|
|
2106
2214
|
/**
|
|
2107
2215
|
* 将json对象或者json数组导出为json文件保存
|
|
@@ -2109,7 +2217,7 @@ class pt {
|
|
|
2109
2217
|
* @param name
|
|
2110
2218
|
*/
|
|
2111
2219
|
static exportJSONFile = (s, r) => {
|
|
2112
|
-
const
|
|
2220
|
+
const t = new Blob([JSON.stringify(s)], { type: "application/json" }), n = URL.createObjectURL(t), e = document.createElement("a");
|
|
2113
2221
|
e.href = n, e.download = `${r || "config"}.json`, e.click();
|
|
2114
2222
|
};
|
|
2115
2223
|
/**
|
|
@@ -2117,38 +2225,38 @@ class pt {
|
|
|
2117
2225
|
* @param param
|
|
2118
2226
|
* @returns
|
|
2119
2227
|
*/
|
|
2120
|
-
static importFile = async (s) => new Promise((r,
|
|
2228
|
+
static importFile = async (s) => new Promise((r, t) => {
|
|
2121
2229
|
const n = document.createElement("input");
|
|
2122
2230
|
n.type = "file";
|
|
2123
2231
|
const e = s?.accept || ".json";
|
|
2124
2232
|
n.accept = e, n.style.display = "none", n.onchange = (a) => {
|
|
2125
|
-
const
|
|
2126
|
-
if (!
|
|
2127
|
-
|
|
2233
|
+
const d = a.target.files[0];
|
|
2234
|
+
if (!d) {
|
|
2235
|
+
$.fail("未选择文件"), t("未选择文件");
|
|
2128
2236
|
return;
|
|
2129
2237
|
}
|
|
2130
2238
|
const m = new FileReader();
|
|
2131
2239
|
m.onload = async (p) => {
|
|
2132
|
-
const
|
|
2133
|
-
r(
|
|
2240
|
+
const c = e == ".json" ? JSON.parse(p.target.result) : p.target.result;
|
|
2241
|
+
r(c);
|
|
2134
2242
|
}, m.onerror = () => {
|
|
2135
|
-
|
|
2136
|
-
}, m.readAsText(
|
|
2243
|
+
$.fail("文件读取失败"), t("文件读取失败");
|
|
2244
|
+
}, m.readAsText(d), document.body.removeChild(n);
|
|
2137
2245
|
}, document.body.appendChild(n), n.click();
|
|
2138
2246
|
});
|
|
2139
2247
|
}
|
|
2140
|
-
const ct = (
|
|
2141
|
-
if (
|
|
2248
|
+
const ct = (o, s) => {
|
|
2249
|
+
if (o.component("TCurd", ut), o.component("TFormList", oe), o.component("TColumn", De), s?.customComponent) {
|
|
2142
2250
|
L.customComponent = s.customComponent;
|
|
2143
2251
|
for (const r in s.customComponent)
|
|
2144
|
-
|
|
2252
|
+
o.component(r, s.customComponent[r]);
|
|
2145
2253
|
}
|
|
2146
2254
|
}, ht = {
|
|
2147
2255
|
install: ct
|
|
2148
2256
|
};
|
|
2149
2257
|
export {
|
|
2150
2258
|
R as ArrUtil,
|
|
2151
|
-
|
|
2259
|
+
$e as ExcelUtil,
|
|
2152
2260
|
De as TColumn,
|
|
2153
2261
|
ut as TCurd,
|
|
2154
2262
|
pt as TFile,
|
|
@@ -2156,7 +2264,7 @@ export {
|
|
|
2156
2264
|
S as TFormConfig,
|
|
2157
2265
|
g as TFormI18n,
|
|
2158
2266
|
oe as TFormList,
|
|
2159
|
-
|
|
2267
|
+
$ as TSys,
|
|
2160
2268
|
ht as default,
|
|
2161
2269
|
ct as install
|
|
2162
2270
|
};
|