hy-dispatch-ui-v3 0.2.31 → 0.2.33

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 (80) hide show
  1. package/dist/tailwind.css +174 -454
  2. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +4 -4
  3. package/es/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  4. package/es/components/hyButton/button.vue.mjs +112 -65
  5. package/es/components/hyButton/style/button.scss +291 -233
  6. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +1 -1
  7. package/es/components/hyForm/form.vue.mjs +2 -1
  8. package/es/components/hyForm/index.mjs +1 -1
  9. package/es/components/hyForm/js/useAppForm.mjs +1 -2
  10. package/es/components/hyForm/style/form.scss +56 -54
  11. package/es/components/hyIcon/style/icon.scss +1 -1
  12. package/es/components/hyIconBox/style/iconBox.scss +19 -18
  13. package/es/components/hyInput/input.vue.mjs +4 -1
  14. package/es/components/hyMenu/menu.vue.mjs +1 -1
  15. package/es/components/hyMenu/style/menu.scss +1 -1
  16. package/es/components/hySearch/index.mjs +1 -1
  17. package/es/components/hySearch/style/search.scss +50 -50
  18. package/es/components/hyTable/cpns/virtualTable.vue.mjs +342 -319
  19. package/es/components/hyTable/js/index.mjs +19 -3
  20. package/es/components/hyTable/js/useAppTable.mjs +1 -1
  21. package/es/components/hyTable/table.vue.mjs +31 -11
  22. package/es/components/hyTableForm/batchTableForm.vue.mjs +478 -0
  23. package/es/components/hyTableForm/index.mjs +4 -1
  24. package/es/components/hyTableForm/js/index.mjs +123 -0
  25. package/es/components/hyTableForm/js/useAppTableForm.mjs +47 -0
  26. package/es/components/hyTableForm/style/batchTableForm.scss +127 -0
  27. package/es/components/hyTableForm/style/tableForm.scss +42 -0
  28. package/es/components/hyTableForm/tableForm.vue.mjs +452 -7
  29. package/es/components/hyTooltip/tooltip.vue.mjs +2 -2
  30. package/es/components/hyVideoPlayer/cpns/mediaLoading.vue.mjs +1 -1
  31. package/es/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  32. package/es/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  33. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +6 -6
  34. package/es/components/index.mjs +4 -3
  35. package/es/index.mjs +4 -3
  36. package/es/static/hy-svg-icons/hy-icon-dispatch-linear-map-treelist.js +8 -0
  37. package/es/static/hy-svg-icons/hy-icon-dispatch-share-guidao.js +8 -0
  38. package/es/style/tailwind.scss +133 -1
  39. package/es/utils/handler.mjs +4 -4
  40. package/es/version.mjs +1 -1
  41. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +4 -4
  42. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +11 -12
  43. package/lib/components/hyButton/button.vue.js +111 -64
  44. package/lib/components/hyButton/style/button.scss +291 -233
  45. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +1 -1
  46. package/lib/components/hyForm/form.vue.js +2 -1
  47. package/lib/components/hyForm/index.js +1 -0
  48. package/lib/components/hyForm/js/useAppForm.js +1 -2
  49. package/lib/components/hyForm/style/form.scss +56 -54
  50. package/lib/components/hyIcon/style/icon.scss +1 -1
  51. package/lib/components/hyIconBox/style/iconBox.scss +19 -18
  52. package/lib/components/hyInput/input.vue.js +4 -1
  53. package/lib/components/hyMenu/menu.vue.js +1 -1
  54. package/lib/components/hyMenu/style/menu.scss +1 -1
  55. package/lib/components/hySearch/index.js +1 -0
  56. package/lib/components/hySearch/style/search.scss +50 -50
  57. package/lib/components/hyTable/cpns/virtualTable.vue.js +340 -317
  58. package/lib/components/hyTable/js/index.js +19 -3
  59. package/lib/components/hyTable/js/useAppTable.js +1 -1
  60. package/lib/components/hyTable/table.vue.js +31 -11
  61. package/lib/components/hyTableForm/batchTableForm.vue.js +482 -0
  62. package/lib/components/hyTableForm/index.js +5 -0
  63. package/lib/components/hyTableForm/js/index.js +127 -0
  64. package/lib/components/hyTableForm/js/useAppTableForm.js +49 -0
  65. package/lib/components/hyTableForm/style/batchTableForm.scss +127 -0
  66. package/lib/components/hyTableForm/style/tableForm.scss +42 -0
  67. package/lib/components/hyTableForm/tableForm.vue.js +451 -6
  68. package/lib/components/hyTooltip/tooltip.vue.js +2 -2
  69. package/lib/components/hyVideoPlayer/cpns/mediaLoading.vue.js +1 -1
  70. package/lib/components/hyVideoPlayer/style/mediaLoading.scss +5 -5
  71. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +7 -6
  72. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +6 -6
  73. package/lib/components/index.js +35 -30
  74. package/lib/index.js +35 -30
  75. package/lib/static/hy-svg-icons/hy-icon-dispatch-linear-map-treelist.js +8 -0
  76. package/lib/static/hy-svg-icons/hy-icon-dispatch-share-guidao.js +8 -0
  77. package/lib/style/tailwind.scss +133 -1
  78. package/lib/utils/handler.js +4 -4
  79. package/lib/version.js +1 -1
  80. package/package.json +5 -3
@@ -263,9 +263,7 @@ const useAppTableWrapper = (hy) => {
263
263
  async function onTableRowClickHandler(row) {
264
264
  emits("row-click", row);
265
265
  if (props.rowClickExpand) {
266
- if (tableColumns.value.some((column) => column.type === "expand")) {
267
- tableRef.value.toggleRowExpansion(row);
268
- }
266
+ toggleRowExpansion(row);
269
267
  }
270
268
  if (props.rowClickSelect && isSelectable(row)) {
271
269
  if (tableColumns.value.some((column) => column.type === "selection")) {
@@ -313,6 +311,22 @@ const useAppTableWrapper = (hy) => {
313
311
  }
314
312
  return className.filter(Boolean).join(" ");
315
313
  }
314
+ function toggleRowExpansion(row) {
315
+ if (tableRef.value && tableColumns.value.some((column) => column.type === "expand")) {
316
+ tableRef.value.toggleRowExpansion(row);
317
+ }
318
+ }
319
+ function onTableRowExpandChangeHandler(row, expandedRows) {
320
+ if (is.isBoolean(expandedRows) || props.expandMode !== "accordion" || expandedRows.length <= 1) {
321
+ props.onExpandChange(row, expandedRows);
322
+ return;
323
+ } else {
324
+ expandedRows.forEach((item) => {
325
+ if (getRowKey(row) === getRowKey(item)) return;
326
+ toggleRowExpansion(item);
327
+ });
328
+ }
329
+ }
316
330
  const isSearchFocus = vue.ref(false);
317
331
  function onSearchInputHandler() {
318
332
  isSearchFocus.value = true;
@@ -349,8 +363,10 @@ const useAppTableWrapper = (hy) => {
349
363
  getSelectedList,
350
364
  clearSelection,
351
365
  clearSelectedList,
366
+ toggleRowExpansion,
352
367
  onTableSelectHandler,
353
368
  onTableRowContextmenuHandler,
369
+ onTableRowExpandChangeHandler,
354
370
  onTableRowClickHandler,
355
371
  onTableColumnsSelectHandler,
356
372
  // 搜索选中
@@ -60,7 +60,7 @@ function getColumnEditable(column, index) {
60
60
  };
61
61
  }
62
62
  return {
63
- index,
63
+ index: type === "operator" ? 1e3 : index,
64
64
  lock: false,
65
65
  edit: !type || type === "default",
66
66
  checked: !type || type !== "default" || type === "operator",
@@ -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: [
@@ -211,8 +221,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
211
221
  setTableRowClassName,
212
222
  clearSelection,
213
223
  clearSelectedList,
224
+ toggleRowExpansion,
214
225
  onTableRowClickHandler,
215
226
  onTableRowContextmenuHandler,
227
+ onTableRowExpandChangeHandler,
216
228
  onTableSelectHandler,
217
229
  isSearchFocus,
218
230
  onSearchInputHandler,
@@ -253,7 +265,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
253
265
  getTotalElements,
254
266
  getTableDataSource,
255
267
  clearSelection,
256
- clearSelectedList
268
+ clearSelectedList,
269
+ toggleRowExpansion
257
270
  });
258
271
  return (_ctx, _cache) => {
259
272
  return vue.openBlock(), vue.createElementBlock(
@@ -320,8 +333,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
320
333
  "onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
321
334
  class: "hy-table-search",
322
335
  placeholder: vue.unref(t)("table.searchFor", [__props.controllerText || ""]),
336
+ clearable: "",
323
337
  onFocus: vue.unref(onSearchInputHandler),
324
338
  onBlur: vue.unref(onSearchBlurHandler),
339
+ onClear: vue.unref(onSearchQueryHandler),
325
340
  onKeydown: vue.withKeys(vue.unref(onSearchQueryHandler), ["enter"])
326
341
  }, {
327
342
  append: vue.withCtx(() => [
@@ -340,7 +355,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
340
355
  ]),
341
356
  _: 1
342
357
  /* STABLE */
343
- }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onFocus", "onBlur", "onKeydown"])
358
+ }, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onFocus", "onBlur", "onClear", "onKeydown"])
344
359
  ],
345
360
  2
346
361
  /* CLASS */
@@ -401,7 +416,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
401
416
  __props.type === "default" ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTable), vue.mergeProps({
402
417
  key: 0,
403
418
  ref_key: "tableRef",
404
- ref: tableRef,
419
+ ref: tableRef
420
+ }, _ctx.$attrs, {
405
421
  "row-key": vue.unref(getRowKey),
406
422
  data: vue.unref(tableDataSource),
407
423
  "show-header": __props.showHeader,
@@ -414,8 +430,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
414
430
  onSelect: vue.unref(onTableSelectHandler),
415
431
  onSelectAll: vue.unref(onTableSelectHandler),
416
432
  onRowClick: vue.unref(onTableRowClickHandler),
417
- onRowContextmenu: vue.unref(onTableRowContextmenuHandler)
418
- }, _ctx.$attrs), {
433
+ onRowContextmenu: vue.unref(onTableRowContextmenuHandler),
434
+ onExpandChange: vue.unref(onTableRowExpandChangeHandler)
435
+ }), {
419
436
  empty: vue.withCtx(() => [
420
437
  vue.renderSlot(_ctx.$slots, "empty", {}, () => [
421
438
  vue.createElementVNode(
@@ -655,15 +672,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
655
672
  ]),
656
673
  _: 3
657
674
  /* FORWARDED */
658
- }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])) : vue.createCommentVNode("v-if", true),
675
+ }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : vue.createCommentVNode("v-if", true),
659
676
  __props.type === "virtual" ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElAutoResizer), { key: 1 }, {
660
677
  default: vue.withCtx(({ height, width }) => [
661
678
  vue.createVNode(virtualTable.default, vue.mergeProps({
662
679
  ref_key: "tableRef",
663
- ref: tableRef,
680
+ ref: tableRef
681
+ }, _ctx.$attrs, {
664
682
  width,
665
683
  height,
666
- "row-key": __props.rowKey,
667
684
  data: vue.unref(tableDataSource),
668
685
  columns: vue.unref(tableColumnsList),
669
686
  "columns-editable": vue.unref(tableColumnsEditablele),
@@ -673,13 +690,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
673
690
  style: {
674
691
  "font-size": `${vue.unref(adaptive.parseRem)(__props.fontSize)}rem`
675
692
  },
693
+ "row-key": __props.rowKey,
676
694
  "filter-model": __props.filterModel,
695
+ expandMode: __props.expandMode,
677
696
  onSearch: ($event) => vue.unref(getData)(1),
678
697
  onSelect: vue.unref(onTableSelectHandler),
679
698
  onSelectAll: vue.unref(onTableSelectHandler),
680
699
  onRowClick: vue.unref(onTableRowClickHandler),
681
- onRowContextmenu: vue.unref(onTableRowContextmenuHandler)
682
- }, _ctx.$attrs), vue.createSlots({
700
+ onRowContextmenu: vue.unref(onTableRowContextmenuHandler),
701
+ onExpandChange: __props.onExpandChange
702
+ }), vue.createSlots({
683
703
  empty: vue.withCtx(() => [
684
704
  vue.createElementVNode("div", { class: "w-full h-full flex items-center justify-center border-b border-border" }, [
685
705
  vue.renderSlot(_ctx.$slots, "empty", {}, () => [
@@ -704,7 +724,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
704
724
  ])
705
725
  };
706
726
  })
707
- ]), 1040, ["width", "height", "row-key", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "filter-model", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])
727
+ ]), 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"])
708
728
  ]),
709
729
  _: 3
710
730
  /* FORWARDED */
@@ -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;
@@ -3,9 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tableForm = require('./tableForm.vue.js');
6
+ var batchTableForm = require('./batchTableForm.vue.js');
7
+ var useAppTableForm = require('./js/useAppTableForm.js');
6
8
  var handler = require('../../utils/handler.js');
7
9
 
8
10
  const HyTableForm = handler.withInstall(tableForm.default);
11
+ const HyBatchTableForm = handler.withInstall(batchTableForm.default);
9
12
 
13
+ exports.useAppTableForm = useAppTableForm.useAppTableForm;
14
+ exports.HyBatchTableForm = HyBatchTableForm;
10
15
  exports.HyTableForm = HyTableForm;
11
16
  exports.default = HyTableForm;