hy-dispatch-ui-v3 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/tailwind.css +186 -454
  2. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -5
  3. package/es/components/hyAudioPlayer/js/index.mjs +1 -1
  4. package/es/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  5. package/es/components/hyButton/button.vue.mjs +50 -35
  6. package/es/components/hyButton/style/button.scss +16 -3
  7. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +2 -2
  8. package/es/components/hyConfirmDialog/confirmMethod.mjs +1 -1
  9. package/es/components/hyConfirmDialog/index.mjs +1 -1
  10. package/es/components/hyCutter/cutter.vue.mjs +1 -1
  11. package/es/components/hyDatePicker/datePicker.vue.mjs +1 -1
  12. package/es/components/hyDialog/dialog.vue.mjs +178 -137
  13. package/es/components/hyDialog/style/dialog.scss +13 -0
  14. package/es/components/hyForm/cpns/formItem.vue.mjs +3 -4
  15. package/es/components/hyForm/form.vue.mjs +2 -1
  16. package/es/components/hyForm/js/useAppForm.mjs +1 -1
  17. package/es/components/hyForm/style/form.scss +56 -54
  18. package/es/components/hyIcon/style/icon.scss +1 -1
  19. package/es/components/hyIconBox/style/iconBox.scss +19 -18
  20. package/es/components/hyInput/input.vue.mjs +4 -1
  21. package/es/components/hyNoPermissions/noPermissions.vue.mjs +1 -1
  22. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +1 -1
  23. package/es/components/hyOrgCascader/orgCascader.vue.mjs +1 -1
  24. package/es/components/hySearch/cpns/searchItem.vue.mjs +3 -9
  25. package/es/components/hySearch/js/index.mjs +4 -4
  26. package/es/components/hySearch/style/search.scss +51 -50
  27. package/es/components/hyTable/cpns/columnSelect.vue.mjs +39 -42
  28. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +5 -8
  29. package/es/components/hyTable/cpns/headerItem.vue.mjs +1 -1
  30. package/es/components/hyTable/cpns/virtualTable.vue.mjs +18 -11
  31. package/es/components/hyTable/js/index.mjs +12 -0
  32. package/es/components/hyTable/js/useAppTable.mjs +1 -1
  33. package/es/components/hyTable/style/table.scss +13 -0
  34. package/es/components/hyTable/table.vue.mjs +43 -23
  35. package/es/components/hyTableForm/batchTableForm.vue.mjs +478 -0
  36. package/es/components/hyTableForm/index.mjs +4 -1
  37. package/es/components/hyTableForm/js/index.mjs +123 -0
  38. package/es/components/hyTableForm/js/useAppTableForm.mjs +47 -0
  39. package/es/components/hyTableForm/style/batchTableForm.scss +127 -0
  40. package/es/components/hyTableForm/style/tableForm.scss +42 -0
  41. package/es/components/hyTableForm/tableForm.vue.mjs +452 -7
  42. package/es/components/hyTooltip/tooltip.vue.mjs +6 -6
  43. package/es/components/hyTree/style/index.css +1 -0
  44. package/es/components/hyTree/tree.vue.mjs +2 -0
  45. package/es/components/hyUserAvatar/userAvatar.vue.mjs +2 -2
  46. package/es/components/hyVideoPlayer/cpns/mediaLoading.vue.mjs +1 -1
  47. package/es/components/hyVideoPlayer/js/index.mjs +1 -1
  48. package/es/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  49. package/es/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  50. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +6 -6
  51. package/es/components/index.mjs +2 -1
  52. package/es/index.mjs +2 -1
  53. package/es/locale/en.mjs +1 -1
  54. package/es/locale/zh_CN.mjs +1 -1
  55. package/es/style/element/hy-element.scss +3 -2
  56. package/es/style/tailwind.scss +133 -1
  57. package/es/version.mjs +1 -1
  58. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +4 -4
  59. package/lib/components/hyAudioPlayer/js/index.js +1 -1
  60. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  61. package/lib/components/hyButton/button.vue.js +50 -35
  62. package/lib/components/hyButton/style/button.scss +16 -3
  63. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +2 -2
  64. package/lib/components/hyConfirmDialog/confirmMethod.js +1 -1
  65. package/lib/components/hyConfirmDialog/index.js +1 -1
  66. package/lib/components/hyCutter/cutter.vue.js +1 -1
  67. package/lib/components/hyDatePicker/datePicker.vue.js +1 -1
  68. package/lib/components/hyDialog/dialog.vue.js +177 -136
  69. package/lib/components/hyDialog/style/dialog.scss +13 -0
  70. package/lib/components/hyForm/cpns/formItem.vue.js +3 -4
  71. package/lib/components/hyForm/form.vue.js +2 -1
  72. package/lib/components/hyForm/js/useAppForm.js +1 -1
  73. package/lib/components/hyForm/style/form.scss +56 -54
  74. package/lib/components/hyIcon/style/icon.scss +1 -1
  75. package/lib/components/hyIconBox/style/iconBox.scss +19 -18
  76. package/lib/components/hyInput/input.vue.js +4 -1
  77. package/lib/components/hyNoPermissions/noPermissions.vue.js +1 -1
  78. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +1 -1
  79. package/lib/components/hyOrgCascader/orgCascader.vue.js +1 -1
  80. package/lib/components/hySearch/cpns/searchItem.vue.js +3 -9
  81. package/lib/components/hySearch/js/index.js +4 -4
  82. package/lib/components/hySearch/style/search.scss +51 -50
  83. package/lib/components/hyTable/cpns/columnSelect.vue.js +43 -46
  84. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +4 -7
  85. package/lib/components/hyTable/cpns/headerItem.vue.js +1 -1
  86. package/lib/components/hyTable/cpns/virtualTable.vue.js +18 -11
  87. package/lib/components/hyTable/js/index.js +12 -0
  88. package/lib/components/hyTable/js/useAppTable.js +1 -1
  89. package/lib/components/hyTable/style/table.scss +13 -0
  90. package/lib/components/hyTable/table.vue.js +42 -22
  91. package/lib/components/hyTableForm/batchTableForm.vue.js +482 -0
  92. package/lib/components/hyTableForm/index.js +5 -0
  93. package/lib/components/hyTableForm/js/index.js +127 -0
  94. package/lib/components/hyTableForm/js/useAppTableForm.js +49 -0
  95. package/lib/components/hyTableForm/style/batchTableForm.scss +127 -0
  96. package/lib/components/hyTableForm/style/tableForm.scss +42 -0
  97. package/lib/components/hyTableForm/tableForm.vue.js +451 -6
  98. package/lib/components/hyTooltip/tooltip.vue.js +6 -6
  99. package/lib/components/hyTree/style/index.css +1 -0
  100. package/lib/components/hyTree/tree.vue.js +2 -0
  101. package/lib/components/hyUserAvatar/userAvatar.vue.js +2 -2
  102. package/lib/components/hyVideoPlayer/cpns/mediaLoading.vue.js +1 -1
  103. package/lib/components/hyVideoPlayer/js/index.js +1 -1
  104. package/lib/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  105. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  106. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +6 -6
  107. package/lib/components/index.js +33 -30
  108. package/lib/index.js +33 -30
  109. package/lib/locale/en.js +1 -1
  110. package/lib/locale/zh_CN.js +1 -1
  111. package/lib/style/element/hy-element.scss +3 -2
  112. package/lib/style/tailwind.scss +133 -1
  113. package/lib/version.js +1 -1
  114. package/package.json +5 -3
@@ -10,13 +10,13 @@ var search = require('./js/search.js');
10
10
  var headerItem = require('./cpns/headerItem.vue.js');
11
11
  var columnSelect = require('./cpns/columnSelect.vue.js');
12
12
  var virtualTable = require('./cpns/virtualTable.vue.js');
13
- var useMixins = require('../../hooks/useMixins.js');
14
- var index$3 = require('../hySearch/index.js');
15
- var adaptive = require('../../utils/adaptive.js');
16
13
  var useLocale = require('../../hooks/useLocale.js');
14
+ var useMixins = require('../../hooks/useMixins.js');
17
15
  var index = require('../hyTooltip/index.js');
18
16
  var index$1 = require('../hyButton/index.js');
19
17
  var index$2 = require('../hyIcon/index.js');
18
+ var index$3 = require('../hySearch/index.js');
19
+ var adaptive = require('../../utils/adaptive.js');
20
20
  var is = require('../../utils/is.js');
21
21
 
22
22
  import "./style/table.scss";
@@ -177,6 +177,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
177
177
  type: Boolean,
178
178
  required: false,
179
179
  default: true
180
+ },
181
+ expandMode: {
182
+ // 展开模式,不支持树形展开
183
+ type: String,
184
+ default: "default"
185
+ // deafult-默认 accordion-手风琴
186
+ },
187
+ onExpandChange: {
188
+ // 展开回调
189
+ type: Function
180
190
  }
181
191
  },
182
192
  emits: [
@@ -214,6 +224,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
214
224
  toggleRowExpansion,
215
225
  onTableRowClickHandler,
216
226
  onTableRowContextmenuHandler,
227
+ onTableRowExpandChangeHandler,
217
228
  onTableSelectHandler,
218
229
  isSearchFocus,
219
230
  onSearchInputHandler,
@@ -322,8 +333,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
322
333
  "onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
323
334
  class: "hy-table-search",
324
335
  placeholder: vue.unref(t)("table.searchFor", [__props.controllerText || ""]),
336
+ clearable: "",
325
337
  onFocus: vue.unref(onSearchInputHandler),
326
338
  onBlur: vue.unref(onSearchBlurHandler),
339
+ onClear: vue.unref(onSearchQueryHandler),
327
340
  onKeydown: vue.withKeys(vue.unref(onSearchQueryHandler), ["enter"])
328
341
  }, {
329
342
  append: vue.withCtx(() => [
@@ -342,7 +355,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
342
355
  ]),
343
356
  _: 1
344
357
  /* STABLE */
345
- }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onFocus", "onBlur", "onKeydown"])
358
+ }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onFocus", "onBlur", "onClear", "onKeydown"])
346
359
  ],
347
360
  2
348
361
  /* CLASS */
@@ -417,7 +430,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
417
430
  onSelect: vue.unref(onTableSelectHandler),
418
431
  onSelectAll: vue.unref(onTableSelectHandler),
419
432
  onRowClick: vue.unref(onTableRowClickHandler),
420
- onRowContextmenu: vue.unref(onTableRowContextmenuHandler)
433
+ onRowContextmenu: vue.unref(onTableRowContextmenuHandler),
434
+ onExpandChange: vue.unref(onTableRowExpandChangeHandler)
421
435
  }), {
422
436
  empty: vue.withCtx(() => [
423
437
  vue.renderSlot(_ctx.$slots, "empty", {}, () => [
@@ -470,12 +484,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
470
484
  }, 1032, ["column", "filter-model", "onSearch"])
471
485
  ]),
472
486
  default: vue.withCtx((scope) => [
473
- column?.slot ? vue.renderSlot(_ctx.$slots, column?.slot, vue.mergeProps({
474
- key: 0,
475
- ref_for: true
476
- }, scope)) : column.type === "operator" ? (vue.openBlock(), vue.createElementBlock("div", {
487
+ column?.slot ? vue.renderSlot(_ctx.$slots, column?.slot, vue.mergeProps({ ref_for: true }, scope), void 0, void 0, 0) : column.type === "operator" ? (vue.openBlock(), vue.createElementBlock("div", {
477
488
  key: 1,
478
- class: "flex items-center justify-end text-main"
489
+ class: "flex items-center justify-end gap-2 text-main"
479
490
  }, [
480
491
  (vue.openBlock(true), vue.createElementBlock(
481
492
  vue.Fragment,
@@ -489,31 +500,33 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
489
500
  key: cindex,
490
501
  "is-always": "",
491
502
  overLine: 1,
492
- content: citem.label
503
+ content: citem.desc
493
504
  }, {
494
505
  default: vue.withCtx(() => [
495
506
  vue.createElementVNode("div", {
496
- class: vue.normalizeClass(["ml-2 w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border cursor-pointer", citem.className]),
497
- onClick: ($event) => vue.unref(index$4.operatorClickHandler)(cindex, column, scope, "default")
507
+ class: vue.normalizeClass(["w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border cursor-pointer", citem.className]),
508
+ onClick: vue.withModifiers(($event) => vue.unref(index$4.operatorClickHandler)(cindex, column, scope, "default"), ["stop"]),
509
+ onContextmenu: vue.withModifiers(() => {
510
+ }, ["stop"])
498
511
  }, [
499
512
  vue.createVNode(vue.unref(index$2.HyIcon), {
500
513
  "svg-name": citem.svgName,
501
514
  "class-name": "!w-4 !h-4"
502
515
  }, null, 8, ["svg-name"]),
503
- citem.subLabel ? (vue.openBlock(), vue.createElementBlock(
516
+ citem.label ? (vue.openBlock(), vue.createElementBlock(
504
517
  "div",
505
518
  {
506
519
  key: 0,
507
520
  class: "mt-1 whitespace-nowrap w-full text-center over_one_line"
508
521
  },
509
- vue.toDisplayString(citem.subLabel),
522
+ vue.toDisplayString(citem.label),
510
523
  1
511
524
  /* TEXT */
512
525
  )) : (vue.openBlock(), vue.createElementBlock("div", {
513
526
  key: 1,
514
527
  class: "mt-1 whitespace-nowrap"
515
528
  }, "\xA0"))
516
- ], 10, ["onClick"])
529
+ ], 42, ["onClick", "onContextmenu"])
517
530
  ]),
518
531
  _: 2
519
532
  /* DYNAMIC */
@@ -588,7 +601,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
588
601
  )
589
602
  ]),
590
603
  default: vue.withCtx(() => [
591
- vue.createElementVNode("span", null, [
604
+ vue.createElementVNode("div", {
605
+ onClick: vue.withModifiers(() => {
606
+ }, ["stop"]),
607
+ onContextmenu: vue.withModifiers(() => {
608
+ }, ["stop"])
609
+ }, [
592
610
  vue.createVNode(vue.unref(index.HyTooltip), {
593
611
  "is-always": "",
594
612
  overLine: 1,
@@ -618,7 +636,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
618
636
  _: 1
619
637
  /* STABLE */
620
638
  }, 8, ["content"])
621
- ])
639
+ ], 40, ["onClick", "onContextmenu"])
622
640
  ]),
623
641
  _: 2
624
642
  /* DYNAMIC */
@@ -658,7 +676,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
658
676
  ]),
659
677
  _: 3
660
678
  /* FORWARDED */
661
- }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])) : vue.createCommentVNode("v-if", true),
679
+ }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : vue.createCommentVNode("v-if", true),
662
680
  __props.type === "virtual" ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElAutoResizer), { key: 1 }, {
663
681
  default: vue.withCtx(({ height, width }) => [
664
682
  vue.createVNode(virtualTable.default, vue.mergeProps({
@@ -678,11 +696,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
678
696
  },
679
697
  "row-key": __props.rowKey,
680
698
  "filter-model": __props.filterModel,
699
+ expandMode: __props.expandMode,
681
700
  onSearch: ($event) => vue.unref(getData)(1),
682
701
  onSelect: vue.unref(onTableSelectHandler),
683
702
  onSelectAll: vue.unref(onTableSelectHandler),
684
703
  onRowClick: vue.unref(onTableRowClickHandler),
685
- onRowContextmenu: vue.unref(onTableRowContextmenuHandler)
704
+ onRowContextmenu: vue.unref(onTableRowContextmenuHandler),
705
+ onExpandChange: __props.onExpandChange
686
706
  }), vue.createSlots({
687
707
  empty: vue.withCtx(() => [
688
708
  vue.createElementVNode("div", { class: "w-full h-full flex items-center justify-center border-b border-border" }, [
@@ -708,7 +728,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
708
728
  ])
709
729
  };
710
730
  })
711
- ]), 1040, ["width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])
731
+ ]), 1040, ["width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "expandMode", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])
712
732
  ]),
713
733
  _: 3
714
734
  /* FORWARDED */
@@ -763,7 +783,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
763
783
  )
764
784
  }, {
765
785
  dropdown: vue.withCtx(() => [
766
- vue.createVNode(vue.unref(elementPlus.ElDropdownMenu), null, {
786
+ vue.createVNode(vue.unref(elementPlus.ElDropdownMenu), { class: "hy-table-dropdown-menu" }, {
767
787
  default: vue.withCtx(() => [
768
788
  (vue.openBlock(true), vue.createElementBlock(
769
789
  vue.Fragment,
@@ -0,0 +1,482 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var elementPlus = require('element-plus');
7
+ var tableForm = require('./tableForm.vue.js');
8
+ var index$2 = require('./js/index.js');
9
+ var useApi = require('../../hooks/useApi.js');
10
+ var useLocale = require('../../hooks/useLocale.js');
11
+ var index = require('../hyIcon/index.js');
12
+ var index$1 = require('../hyButton/index.js');
13
+ var index$3 = require('../hyConfirmDialog/index.js');
14
+
15
+ import "./style/batchTableForm.scss";
16
+
17
+ const __default__ = vue.defineComponent({
18
+ name: "HyBatchTableForm"
19
+ });
20
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
21
+ props: {
22
+ // 表格配置项
23
+ tableColumns: {
24
+ // 表格的列
25
+ type: Array,
26
+ required: true,
27
+ default: () => []
28
+ },
29
+ formColumns: {
30
+ type: Array,
31
+ default: () => []
32
+ },
33
+ rules: {
34
+ type: Object,
35
+ default: () => ({})
36
+ },
37
+ emptyText: {
38
+ // 空数据时显示的文本内容
39
+ type: String
40
+ },
41
+ fontSize: {
42
+ // 字体大小
43
+ type: Number,
44
+ default: 14
45
+ },
46
+ rowClickExpand: {
47
+ // 点击行展开
48
+ type: Boolean,
49
+ required: false,
50
+ default: true
51
+ },
52
+ // 表单配置项
53
+ columnNum: {
54
+ type: Number,
55
+ default: 2
56
+ },
57
+ size: {
58
+ type: String,
59
+ default: "default"
60
+ // 'large' | 'default' | 'small'
61
+ },
62
+ // 其他配置项
63
+ beforeDataHandle: {
64
+ type: Function
65
+ },
66
+ templateConfig: {
67
+ type: Object,
68
+ default: () => ({
69
+ title: "\u4E0B\u8F7D\u6A21\u677F",
70
+ url: "",
71
+ fileName: ""
72
+ })
73
+ },
74
+ url: {
75
+ type: String
76
+ },
77
+ submitParams: {
78
+ type: Object
79
+ },
80
+ submitHandler: {
81
+ type: Function
82
+ }
83
+ },
84
+ emits: ["submitting", "submit"],
85
+ setup(__props, { expose: __expose, emit: __emit }) {
86
+ const props = __props;
87
+ const emits = __emit;
88
+ const { api } = useApi.useApi();
89
+ const { t } = useLocale.useLocale();
90
+ const containerRef = vue.useTemplateRef("containerRef");
91
+ const tableRef = vue.useTemplateRef("tableRef");
92
+ const active = vue.ref(1);
93
+ const stepList = [
94
+ {
95
+ title: "\u4E0A\u4F20\u5BFC\u5165\u6587\u4EF6",
96
+ description: "\u4E0A\u4F20\u5DF2\u586B\u5199\u5B8C\u6210\u7684<br/>\u6DFB\u52A0\u6A21\u677F\u6587\u4EF6"
97
+ },
98
+ {
99
+ title: "\u81EA\u52A8\u89E3\u6790\u4E0E\u6821\u9A8C",
100
+ description: "\u7CFB\u7EDF\u5C06\u81EA\u52A8\u89E3\u6790\u60A8<br/>\u4E0A\u4F20\u540E\u7684\u6587\u4EF6\u8FDB\u884C\u663E\u793A"
101
+ },
102
+ {
103
+ title: "\u652F\u6301\u4FEE\u6B63\u5F02\u5E38",
104
+ description: "\u5F02\u5E38\u6570\u636E\u5C06\u6807\u8BB0\u63D0\u793A<br/>\u652F\u6301\u4FEE\u6539\u5E76\u5373\u65F6\u6821\u9A8C"
105
+ },
106
+ {
107
+ title: "\u786E\u8BA4\u5BFC\u5165\u6570\u636E",
108
+ description: "\u4EE5\u5F53\u524D\u6570\u636E\u4E3A\u51C6<br/>\u6267\u884C\u6279\u91CF\u5BFC\u5165\u6DFB\u52A0\u6570\u636E"
109
+ }
110
+ ];
111
+ const templateFileName = vue.ref("");
112
+ const submitNumber = vue.ref(0);
113
+ const submitting = vue.ref(false);
114
+ const submitProgress = vue.ref(0);
115
+ function setData(data = []) {
116
+ if (!tableRef.value) return;
117
+ tableRef.value.setData(data);
118
+ }
119
+ function deleteData(data = []) {
120
+ if (!tableRef.value) return;
121
+ tableRef.value.deleteData(data);
122
+ }
123
+ function getTableDataSource() {
124
+ if (!tableRef.value) return [];
125
+ return tableRef.value.getTableDataSource();
126
+ }
127
+ function validate() {
128
+ if (!tableRef.value) return {};
129
+ return tableRef.value.validate();
130
+ }
131
+ async function onUploadChange(file) {
132
+ const type = file.raw.type;
133
+ if (file.raw.size > 1024 * 1024 * 10) {
134
+ elementPlus.ElMessage.error(`\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC710M\uFF01`);
135
+ return false;
136
+ } else {
137
+ if (type.indexOf("application") !== -1) {
138
+ const files = { 0: file.raw };
139
+ try {
140
+ const data = await index$2.doReadExcel(files, props);
141
+ if (!data) {
142
+ elementPlus.ElMessage.warning("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25");
143
+ return;
144
+ }
145
+ active.value++;
146
+ await vue.nextTick();
147
+ setData(data);
148
+ templateFileName.value = file.name;
149
+ } catch (err) {
150
+ console.error(err);
151
+ return;
152
+ }
153
+ } else {
154
+ elementPlus.ElMessage.error("\u6587\u4EF6\u683C\u5F0F\u6709\u8BEF");
155
+ }
156
+ }
157
+ }
158
+ async function onResetUpload() {
159
+ if (tableRef.value) {
160
+ const { total } = tableRef.value.getStatistics();
161
+ if (total) {
162
+ try {
163
+ await new Promise((resolve, reject) => {
164
+ index$3.HyConfirmDialog.confirm({
165
+ content: submitNumber.value ? `\u672C\u6B21\u5DF2\u6210\u529F\u5BFC\u5165 ${submitNumber.value} \u6761\u6570\u636E\uFF0C\u91CD\u65B0\u4E0A\u4F20\u5C06\u4E0D\u4F1A\u64A4\u9500\u8FD9\u4E9B\u6570\u636E\u3002\u5269\u4F59\u672A\u5BFC\u5165\u6570\u636E\u5C06\u4F1A\u88AB\u6E05\u7A7A` : `\u91CD\u65B0\u4E0A\u4F20\u5C06\u6E05\u7A7A\u5F53\u524D ${total} \u6761\u6570\u636E, <br />\u662F\u5426\u786E\u8BA4\u91CD\u65B0\u4E0A\u4F20`,
166
+ onClose: reject,
167
+ onCancel: reject,
168
+ onSubmit: resolve
169
+ });
170
+ });
171
+ } catch {
172
+ return;
173
+ }
174
+ }
175
+ }
176
+ templateFileName.value = "";
177
+ active.value = 1;
178
+ submitNumber.value = 0;
179
+ }
180
+ async function submitDataSource() {
181
+ if (!props.url && !props.submitHandler) {
182
+ elementPlus.ElMessage.warning("\u8BF7\u914D\u7F6E\u63D0\u4EA4\u8868\u5355\u5730\u5740");
183
+ return Promise.reject();
184
+ }
185
+ if (submitting.value) {
186
+ index$3.HyConfirmDialog.tip({
187
+ content: `\u6570\u636E\u6B63\u5728\u5904\u7406\u4E2D\uFF0C<br/>\u8BF7\u7B49\u5F85\u6570\u636E\u5904\u7406\u5B8C\u6210\u540E\u518D\u5173\u95ED\u5F39\u7A97`
188
+ });
189
+ return Promise.reject();
190
+ }
191
+ const res = validate();
192
+ let { dataSource, total, success, failed } = res;
193
+ if (!total) {
194
+ elementPlus.ElMessage.warning("\u8BF7\u6DFB\u52A0\u6570\u636E");
195
+ return;
196
+ }
197
+ if (!success) {
198
+ elementPlus.ElMessage.warning("\u8BF7\u586B\u5199\u6709\u6548\u4E0A\u4F20\u6570\u636E");
199
+ return;
200
+ }
201
+ if (failed) {
202
+ try {
203
+ await new Promise((resolve, reject) => {
204
+ index$3.HyConfirmDialog.confirm({
205
+ content: `\u5F53\u524D\u5B58\u5728<span class="text-danger-2"> ${failed} \u6761\u6570\u636E\u5F02\u5E38</span>\uFF0C\u672C\u6B21\u5C06\u4EC5\u5BFC\u5165 ${success} \u6761\u5BFC\u5165\u5C31\u7EEA\u6570\u636E\uFF0C\u5F02\u5E38\u6570\u636E\u5C06\u88AB\u5FFD\u7565`,
206
+ onClose: reject,
207
+ onCancel: reject,
208
+ onSubmit: resolve
209
+ });
210
+ });
211
+ } catch {
212
+ return Promise.reject();
213
+ }
214
+ }
215
+ const submitList = [];
216
+ submitProgress.value = 0;
217
+ submitting.value = true;
218
+ emits("submitting");
219
+ for (let i = 0; i <= dataSource.length - 1; i++) {
220
+ const target = dataSource[i];
221
+ const { onlyId, errorMsg, errorMap, children, ...data } = target;
222
+ submitProgress.value = Math.floor((i + 1) / total * 100);
223
+ if (errorMsg) {
224
+ continue;
225
+ }
226
+ let res2;
227
+ try {
228
+ if (props.submitHandler) {
229
+ res2 = await props.submitHandler(data);
230
+ } else {
231
+ res2 = await unref(api).post(props.url, props.submitParams);
232
+ }
233
+ if (res2.code === 200) {
234
+ submitNumber.value++;
235
+ submitList.push(target);
236
+ } else {
237
+ target.errorMsg = {
238
+ prop: null,
239
+ message: res2.msg
240
+ };
241
+ }
242
+ } catch (err) {
243
+ target.errorMsg = {
244
+ prop: null,
245
+ message: err?.msg ? err.msg : err
246
+ };
247
+ console.error(err);
248
+ }
249
+ }
250
+ deleteData(submitList);
251
+ submitting.value = false;
252
+ const submitResult = {
253
+ total,
254
+ success: submitList.length,
255
+ failed: total - submitList.length,
256
+ result: submitList.length === total
257
+ };
258
+ if (submitResult.result) {
259
+ elementPlus.ElMessage.success(`${submitResult.total} \u6761\u6570\u636E\u5BFC\u5165\u5B8C\u6210\uFF0C\u5DF2\u66F4\u65B0`);
260
+ emits("submit", submitResult);
261
+ onResetUpload();
262
+ } else {
263
+ elementPlus.ElMessage.warning(
264
+ `${submitResult.success} \u6761\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF0C ${submitResult.failed} \u6761\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8C03\u6574`
265
+ );
266
+ emits("submit", submitResult);
267
+ }
268
+ }
269
+ __expose({
270
+ setData,
271
+ deleteData,
272
+ getTableDataSource,
273
+ validate,
274
+ submitDataSource
275
+ });
276
+ return (_ctx, _cache) => {
277
+ return vue.openBlock(), vue.createElementBlock(
278
+ "div",
279
+ {
280
+ ref_key: "containerRef",
281
+ ref: containerRef,
282
+ class: "hy-batch-table-form"
283
+ },
284
+ [
285
+ active.value === 1 ? (vue.openBlock(), vue.createElementBlock("div", {
286
+ key: 0,
287
+ class: "max-h-full overflow-y-auto scroll-body"
288
+ }, [
289
+ vue.createElementVNode("div", { class: "hy-batch-table-form-upload-box" }, [
290
+ vue.createVNode(vue.unref(elementPlus.ElUpload), {
291
+ accept: ".xls,.xlsx",
292
+ drag: "",
293
+ multiple: false,
294
+ "auto-upload": false,
295
+ "show-file-list": false,
296
+ class: "w-full h-full",
297
+ "on-change": onUploadChange
298
+ }, {
299
+ default: vue.withCtx(() => [
300
+ vue.createVNode(vue.unref(index.HyIcon), {
301
+ "svg-name": "analytics-echarts-sos",
302
+ "class-name": "!w-[58px] !h-[66px] mb-4"
303
+ }),
304
+ vue.createElementVNode("div", { class: "mb-1.5 text-main" }, [
305
+ vue.createElementVNode("span", null, "\u70B9\u51FB\u6216\u5C06 \u6587\u4EF6 \u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20")
306
+ ]),
307
+ vue.createElementVNode("div", { class: "text-auxiliary text-xs" }, "\u4E00\u6B21\u4EC5\u652F\u6301\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6"),
308
+ vue.createElementVNode("div", { class: "w-full text-main absolute left-1/2 bottom-4 transform -translate-x-1/2" }, [
309
+ vue.createElementVNode("div", { class: "flex items-center justify-center text-xs text-auxiliary gap-2" }, [
310
+ vue.createElementVNode("span", null, "\u6587\u4EF6\u652F\u6301\uFF1A"),
311
+ vue.createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, " .xls "),
312
+ vue.createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, " .xlsx "),
313
+ vue.createElementVNode("span", null, "\u5355\u6587\u4EF6\u4E0D\u8D85\u8FC7 10 MB")
314
+ ])
315
+ ])
316
+ ]),
317
+ _: 1
318
+ /* STABLE */
319
+ })
320
+ ]),
321
+ vue.createElementVNode("div", { class: "hy-batch-table-form-step-box" }, [
322
+ vue.createElementVNode("div", { class: "text-auxiliary text-center mb-[30px]" }, [
323
+ vue.createElementVNode("span", null, "\u6279\u91CF\u6DFB\u52A0\u5BFC\u5165\u6D41\u7A0B\u8BF4\u660E")
324
+ ]),
325
+ vue.createElementVNode("div", { class: "w-full flex" }, [
326
+ (vue.openBlock(), vue.createElementBlock(
327
+ vue.Fragment,
328
+ null,
329
+ vue.renderList(stepList, (item, index) => {
330
+ return vue.createElementVNode("div", {
331
+ key: index,
332
+ class: "w-0 flex-1 flex flex-col items-center relative"
333
+ }, [
334
+ index < stepList.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", {
335
+ key: 0,
336
+ class: "w-3/4 absolute top-[19px] left-full transform -translate-x-1/2",
337
+ style: { "border-top": "2px dashed rgba(var(--hy-border))" }
338
+ })) : vue.createCommentVNode("v-if", true),
339
+ vue.createElementVNode("div", { class: "w-[38px] h-[38px] flex items-center justify-center border border-solid border-border rounded-full bg-background box-border" }, [
340
+ vue.createElementVNode(
341
+ "span",
342
+ { class: "text-base text-main" },
343
+ vue.toDisplayString(index + 1),
344
+ 1
345
+ /* TEXT */
346
+ )
347
+ ]),
348
+ vue.createElementVNode(
349
+ "span",
350
+ { class: "text-main font-bold text-sm mt-3 mb-2" },
351
+ vue.toDisplayString(item.title),
352
+ 1
353
+ /* TEXT */
354
+ ),
355
+ vue.createElementVNode("div", {
356
+ innerHTML: item.description,
357
+ class: "text-auxiliary text-center mb-3 whitespace-nowrap"
358
+ }, null, 8, ["innerHTML"]),
359
+ vue.renderSlot(_ctx.$slots, "template-down", {}, () => [
360
+ index === 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyButton), {
361
+ key: 0,
362
+ type: "primary",
363
+ link: "",
364
+ onClick: () => vue.unref(index$2.downloadTemplateHandler)(props)
365
+ }, {
366
+ default: vue.withCtx(() => [
367
+ vue.createTextVNode(
368
+ vue.toDisplayString(__props.templateConfig ? __props.templateConfig.title : "\u4E0B\u8F7D\u6A21\u677F"),
369
+ 1
370
+ /* TEXT */
371
+ )
372
+ ]),
373
+ _: 1
374
+ /* STABLE */
375
+ }, 8, ["onClick"])) : vue.createCommentVNode("v-if", true)
376
+ ])
377
+ ]);
378
+ }),
379
+ 64
380
+ /* STABLE_FRAGMENT */
381
+ ))
382
+ ])
383
+ ])
384
+ ])) : active.value === 2 ? (vue.openBlock(), vue.createElementBlock("div", {
385
+ key: 1,
386
+ class: "h-full flex flex-col"
387
+ }, [
388
+ vue.createElementVNode("div", { class: "hy-batch-table-form-template-box" }, [
389
+ vue.createElementVNode("div", { class: "flex items-center gap-2" }, [
390
+ vue.createVNode(vue.unref(index.HyIcon), {
391
+ "svg-name": "analytics-echarts-sos",
392
+ "class-name": "!w-[18px] !h-[22px]"
393
+ }),
394
+ vue.createElementVNode(
395
+ "span",
396
+ { class: "text-theme" },
397
+ vue.toDisplayString(templateFileName.value),
398
+ 1
399
+ /* TEXT */
400
+ ),
401
+ vue.createElementVNode("span", { class: "text-auxiliary" }, "\u89E3\u6790\u5B8C\u6210")
402
+ ]),
403
+ vue.createVNode(vue.unref(index$1.HyButton), {
404
+ type: "primary",
405
+ link: "",
406
+ size: "small",
407
+ onClick: onResetUpload
408
+ }, {
409
+ default: vue.withCtx(() => [
410
+ vue.createTextVNode("\u91CD\u65B0\u4E0A\u4F20\u6587\u4EF6")
411
+ ]),
412
+ _: 1
413
+ /* STABLE */
414
+ })
415
+ ]),
416
+ vue.createVNode(tableForm.default, {
417
+ ref_key: "tableRef",
418
+ ref: tableRef,
419
+ tableColumns: __props.tableColumns,
420
+ formColumns: __props.formColumns,
421
+ rules: __props.rules,
422
+ rowClickExpand: __props.rowClickExpand,
423
+ columnNum: __props.columnNum,
424
+ size: __props.size,
425
+ class: "h-0 flex-1"
426
+ }, vue.createSlots({
427
+ _: 2
428
+ /* DYNAMIC */
429
+ }, [
430
+ vue.renderList(_ctx.$slots, (_, slotName) => {
431
+ return {
432
+ name: slotName,
433
+ fn: vue.withCtx((scope) => [
434
+ vue.renderSlot(_ctx.$slots, slotName, vue.normalizeProps(vue.guardReactiveProps(scope)))
435
+ ])
436
+ };
437
+ })
438
+ ]), 1032, ["tableColumns", "formColumns", "rules", "rowClickExpand", "columnNum", "size"])
439
+ ])) : vue.createCommentVNode("v-if", true),
440
+ submitting.value ? (vue.openBlock(), vue.createElementBlock("div", {
441
+ key: 2,
442
+ class: "absolute top-0 right-0 bottom-0 left-0 z-10 flex items-center justify-center"
443
+ }, [
444
+ vue.createElementVNode("div", { class: "w-full h-full absolute bg-[rgba(var(--hy-background-4),0.9)] backdrop-blur-sm" }),
445
+ vue.createElementVNode("div", { class: "flex flex-col items-center text-theme text-xs relative" }, [
446
+ vue.createVNode(vue.unref(index.HyIcon), {
447
+ "svg-name": "analytics-echarts-sos",
448
+ "class-name": "!w-[58px] !h-[66px] mb-[18px]"
449
+ }),
450
+ vue.createElementVNode("div", { class: "flex items-center" }, [
451
+ vue.createElementVNode("span", null, "\u6570\u636E\u6B63\u5728\u5BFC\u5165\u4E2D"),
452
+ vue.createElementVNode(
453
+ "span",
454
+ { class: "ml-1 mr-3" },
455
+ vue.toDisplayString(submitProgress.value) + "%",
456
+ 1
457
+ /* TEXT */
458
+ ),
459
+ vue.createElementVNode("div", { class: "w-[68px] h-0.5 bg-auxiliary rounded-full" }, [
460
+ vue.createElementVNode(
461
+ "div",
462
+ {
463
+ class: "h-full bg-theme rounded-full",
464
+ style: vue.normalizeStyle({ width: `${submitProgress.value}%` })
465
+ },
466
+ null,
467
+ 4
468
+ /* STYLE */
469
+ )
470
+ ])
471
+ ])
472
+ ])
473
+ ])) : vue.createCommentVNode("v-if", true)
474
+ ],
475
+ 512
476
+ /* NEED_PATCH */
477
+ );
478
+ };
479
+ }
480
+ });
481
+
482
+ exports.default = _sfc_main;