cc1-form 1.1.22 → 1.1.24

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