@skyfox2000/webui 1.4.9 → 1.4.11

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 (31) hide show
  1. package/lib/assets/modules/{baseLayout-DIny49tw.js → baseLayout-DSVT_hCt.js} +3 -3
  2. package/lib/assets/modules/{file-upload-DHUBZlX4.js → file-upload-T2kmeyGd.js} +59 -45
  3. package/lib/assets/modules/{index-CEffEFtI.js → index-C6BAsERS.js} +1 -1
  4. package/lib/assets/modules/{index-DyRjXb_O.js → index-Cwr2EDEI.js} +2 -2
  5. package/lib/assets/modules/{index-BIAdOoSj.js → index-DkMjvF98.js} +10 -10
  6. package/lib/assets/modules/{menuTabs-CCrFWIOl.js → menuTabs-D99nhxm_.js} +2 -2
  7. package/lib/assets/modules/{toolIcon-BGZR_aUI.js → toolIcon-DDp0EFRE.js} +1 -1
  8. package/lib/assets/modules/{uploadList-CMXuGRWT.js → upload-template-BK8iQQYz.js} +273 -263
  9. package/lib/assets/modules/uploadList-B8p45yS2.js +423 -0
  10. package/lib/es/AceEditor/index.js +3 -3
  11. package/lib/es/BasicLayout/index.js +2 -2
  12. package/lib/es/Error403/index.js +1 -1
  13. package/lib/es/Error404/index.js +1 -1
  14. package/lib/es/ExcelForm/index.js +16 -15
  15. package/lib/es/MenuLayout/index.js +2 -2
  16. package/lib/es/TemplateFile/index.js +62 -90
  17. package/lib/es/UploadForm/index.js +4 -4
  18. package/lib/index.d.ts +1 -0
  19. package/lib/utils/file-upload.d.ts +2 -1
  20. package/lib/utils/upload-template.d.ts +4 -0
  21. package/lib/webui.css +1 -1
  22. package/lib/webui.es.js +52 -50
  23. package/package.json +1 -1
  24. package/src/components/content/dialog/excelForm.vue +5 -0
  25. package/src/components/content/dialog/templateFile.vue +27 -79
  26. package/src/components/content/table/index.vue +1 -0
  27. package/src/components/form/upload/uploadList.vue +122 -40
  28. package/src/index.ts +2 -0
  29. package/src/utils/file-upload.ts +31 -1
  30. package/src/utils/upload-template.ts +15 -0
  31. package/lib/assets/modules/uploadList-l4q5o65m.js +0 -400
@@ -0,0 +1,423 @@
1
+ import { defineComponent as ae, ref as P, computed as D, watch as B, resolveDirective as ie, createElementBlock as d, openBlock as u, normalizeClass as $, unref as n, createElementVNode as h, withDirectives as y, createBlock as re, mergeProps as le, withCtx as w, createVNode as p, createTextVNode as z, toDisplayString as T, Fragment as ce, renderList as ue, createCommentVNode as C } from "vue";
2
+ import { _ as pe } from "./index-C6BAsERS.js";
3
+ import { a as A, _ as I } from "./toolIcon-DDp0EFRE.js";
4
+ import { httpPost as K, ResStatus as j } from "@skyfox2000/fapi";
5
+ import { L as V, u as q, t as de, _ as me } from "./upload-template-BK8iQQYz.js";
6
+ import { U as i, f as fe, p as Q } from "./file-upload-T2kmeyGd.js";
7
+ import { combineParams as G } from "@skyfox2000/microbase";
8
+ import _ from "vue-m-message";
9
+ import "async-validator";
10
+ import "dayjs";
11
+ import { Upload as he, Tag as ve, Popconfirm as xe, Progress as ye } from "ant-design-vue";
12
+ import "vue-draggable-next";
13
+ import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
+ const Ce = (l, U) => {
15
+ const t = document.createElement("a"), m = URL.createObjectURL(l);
16
+ t.href = m, t.download = U, t.style.display = "none", document.body.appendChild(t), t.click(), URL.revokeObjectURL(m), document.body.removeChild(t);
17
+ }, _e = (l, U, t) => {
18
+ try {
19
+ t && (l.api || (l.api = t.api), l.authorize === void 0 && (l.authorize = t.authorize));
20
+ const m = G(l.params, U);
21
+ return K(l, m).then((c) => {
22
+ if ((c == null ? void 0 : c.status) === j.SUCCESS && c.data) {
23
+ const s = c.data, S = s.Content, F = s.Key.split("/").pop(), g = atob(S), k = [];
24
+ for (let E = 0; E < g.length; E++)
25
+ k.push(g.charCodeAt(E));
26
+ const x = new Blob([new Uint8Array(k)], {
27
+ type: s.Type
28
+ });
29
+ Ce(x, F);
30
+ } else if ((c == null ? void 0 : c.errno) == V) {
31
+ q().logout(!1);
32
+ return;
33
+ } else
34
+ _.error("下载文件失败!");
35
+ });
36
+ } catch (m) {
37
+ console.error("下载失败:", m), _.error("文件下载失败,请稍后重试");
38
+ }
39
+ }, Ue = ["xlsx", "xls", "csv", "txt"], Se = (l, U, t) => {
40
+ const m = U.split(".").pop();
41
+ if (Ue.includes(m))
42
+ console.log(l);
43
+ else
44
+ return _.error("文件类型不支持预览"), !1;
45
+ const c = G(l.params, t);
46
+ return K(l, c).then((s) => {
47
+ if ((s == null ? void 0 : s.status) === j.SUCCESS && s.data) {
48
+ const F = s.data.Content, g = atob(F), k = [];
49
+ for (let x = 0; x < g.length; x++)
50
+ k.push(g.charCodeAt(x));
51
+ } else if ((s == null ? void 0 : s.errno) == V) {
52
+ q().logout(!1);
53
+ return;
54
+ } else
55
+ _.error("文件预览失败!");
56
+ });
57
+ }, ge = { class: "flex items-center justify-between w-full" }, be = { class: "w-35 mx-3" }, ke = { class: "mt-4 px-3" }, Fe = { class: "flex items-center justify-between" }, Ee = { class: "flex items-center" }, Oe = { class: "flex items-center" }, ze = {
58
+ key: 0,
59
+ class: "mr-2"
60
+ }, Le = {
61
+ key: 1,
62
+ class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer"
63
+ }, Pe = ["onClick"], $e = {
64
+ key: 2,
65
+ class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer"
66
+ }, Ae = ["onClick"], Be = {
67
+ key: 3,
68
+ class: "flex items-center text-red-500 hover:text-red-700 cursor-pointer"
69
+ }, Te = ["onClick"], Ie = {
70
+ key: 0,
71
+ class: "text-sm text-nowrap"
72
+ }, Ke = { key: 0 }, je = /* @__PURE__ */ ae({
73
+ __name: "uploadList",
74
+ props: {
75
+ autoUpload: { type: Boolean, default: !1 },
76
+ uploadUrl: {},
77
+ downloadUrl: {},
78
+ previewUrl: {},
79
+ deleteUrl: {},
80
+ fileList: { default: () => [] },
81
+ placeholder: { default: "" },
82
+ fileExt: {},
83
+ maxFileSize: { default: 20 },
84
+ maxCount: { default: 5 },
85
+ maxCountTip: { type: Boolean, default: !1 },
86
+ maxFileSizeTip: { type: Boolean, default: !0 },
87
+ fileExtTip: { type: Boolean, default: !0 },
88
+ parentPath: {},
89
+ showActionText: { type: Boolean, default: !0 },
90
+ showOnlineSwitch: { type: Boolean, default: !1 },
91
+ showDelete: { type: Boolean, default: !0 }
92
+ },
93
+ emits: ["update:file-list"],
94
+ setup(l, { emit: U }) {
95
+ const t = l, m = de(), { errInfo: c } = m, s = P(t.fileList), S = P([]), F = P(), g = U, k = D(() => {
96
+ var e;
97
+ return (e = t.fileExt) != null && e.length ? t.fileExt.map((o) => `.${o}`).join(",") : "";
98
+ }), x = (e) => {
99
+ var o;
100
+ if (t.fileExt && t.fileExt.length > 0) {
101
+ const r = ((o = e.name.split(".").pop()) == null ? void 0 : o.toLowerCase()) || "";
102
+ if (!t.fileExt.includes(r))
103
+ return _.error("文件类型不支持"), !1;
104
+ }
105
+ return e.size / 1024 / 1024 > t.maxFileSize ? (_.error(`文件大小超过 ${t.maxFileSize}MB 限制`), !1) : !0;
106
+ }, E = () => t.maxCount > 1 && s.value.length >= t.maxCount, H = (e) => {
107
+ const o = e;
108
+ return o.params || (o.params = {}), o.params.FileKey = o.name, t.parentPath && (o.params.FileKey = Q.join("/", t.parentPath, o.name)), o.status = i.Pending, o;
109
+ }, J = (e) => x(e) && t.autoUpload, W = async (e) => {
110
+ if (e.length === 0) return;
111
+ const o = [...s.value];
112
+ let r = !1;
113
+ for (const O of e) {
114
+ if (!x(O)) {
115
+ r = !0;
116
+ continue;
117
+ }
118
+ const b = H(O);
119
+ if (t.maxCount === 1) {
120
+ o.length = 0, o.push(b);
121
+ break;
122
+ }
123
+ if (E()) {
124
+ _.error(`最多上传 ${t.maxCount} 个文件`), r = !0;
125
+ break;
126
+ }
127
+ const a = o.findIndex(
128
+ (f) => f.name === b.name
129
+ );
130
+ a > -1 ? o[a] = b : o.push(b);
131
+ }
132
+ (!r || o.length > 0) && (s.value = o), S.value = [];
133
+ }, X = (e) => {
134
+ S.value = e, W(e);
135
+ }, Y = D(() => ({
136
+ accept: k.value,
137
+ multiple: t.maxCount !== 1,
138
+ fileList: S.value,
139
+ "onUpdate:fileList": X,
140
+ beforeUpload: J,
141
+ listType: "text",
142
+ showUploadList: !1,
143
+ customRequest: async () => {
144
+ if (t.autoUpload && t.uploadUrl)
145
+ for (const e of s.value)
146
+ e.percent === 0 && e.status === i.Pending && await fe(t.uploadUrl, e);
147
+ }
148
+ }));
149
+ B(
150
+ () => t.fileList,
151
+ (e) => {
152
+ s.value = e;
153
+ },
154
+ { deep: !0, immediate: !0 }
155
+ ), B(
156
+ () => s.value,
157
+ (e) => {
158
+ g("update:file-list", e);
159
+ },
160
+ { deep: !0 }
161
+ ), B(
162
+ () => t.parentPath,
163
+ (e) => {
164
+ e && s.value.forEach((o) => {
165
+ o.params.FileKey = Q.join("/", e, o.fileName);
166
+ });
167
+ }
168
+ );
169
+ const M = (e) => {
170
+ const o = s.value[e].minioFile, r = {
171
+ api: t.downloadUrl.api,
172
+ authorize: t.downloadUrl.authorize,
173
+ url: t.downloadUrl.url,
174
+ params: {
175
+ Query: {
176
+ FileKey: o.Key
177
+ }
178
+ }
179
+ };
180
+ _e(r);
181
+ }, Z = (e) => {
182
+ e.minioFile && (e.minioFile.Status = e.status);
183
+ }, N = (e) => {
184
+ const o = s.value[e].minioFile, r = {
185
+ api: t.previewUrl.api,
186
+ authorize: t.previewUrl.authorize,
187
+ url: t.previewUrl.url,
188
+ params: {
189
+ Query: {
190
+ FileKey: o.Key
191
+ }
192
+ }
193
+ };
194
+ Se(r, o.FileName);
195
+ }, R = (e) => {
196
+ const o = s.value[e];
197
+ t.deleteUrl && o.minioFile && o.minioFile.Key ? K(t.deleteUrl, {
198
+ Query: {
199
+ FileKey: o.minioFile.Key
200
+ }
201
+ }).then((r) => {
202
+ r && r.status === j.SUCCESS && (_.success("删除文件成功!"), s.value.splice(e, 1));
203
+ }) : s.value.splice(e, 1), L.value = -1;
204
+ }, L = P(-1), ee = (e, o) => {
205
+ if (L.value = e, o === i.Pending) {
206
+ R(e);
207
+ return;
208
+ }
209
+ }, te = (e) => e === L.value, oe = () => {
210
+ const e = t.fileExt && t.fileExt.length && t.fileExtTip ? `文件必须为 ${t.fileExt.join("/")}` : "", o = t.maxFileSize !== 0 && t.maxFileSizeTip ? `单文件最大 ${t.maxFileSize}MB` : "", r = t.maxCount !== 0 && t.maxCountTip ? `最多 ${t.maxCount} 个文件` : "";
211
+ return [o, e, r].filter(Boolean).join(",");
212
+ }, ne = (e) => {
213
+ switch (e) {
214
+ case i.Uploading:
215
+ return "blue";
216
+ case i.Success:
217
+ return "green";
218
+ case i.Error:
219
+ return "red";
220
+ case i.Online:
221
+ return "green";
222
+ case i.Offline:
223
+ return "pink";
224
+ default:
225
+ return "cyan";
226
+ }
227
+ }, se = (e) => {
228
+ switch (e) {
229
+ case i.Uploading:
230
+ return "上传中";
231
+ case i.Success:
232
+ return "上传完成";
233
+ case i.Error:
234
+ return "上传失败";
235
+ case i.Online:
236
+ return "在线";
237
+ case i.Offline:
238
+ return "已下线";
239
+ default:
240
+ return "待上传";
241
+ }
242
+ };
243
+ return (e, o) => {
244
+ var O, b;
245
+ const r = ie("auth");
246
+ return u(), d("div", {
247
+ class: $(["w-full border border-solid border-gray-100 mt-1 rounded-md py-5", [(O = n(c)) == null ? void 0 : O.errClass]])
248
+ }, [
249
+ h("div", ge, [
250
+ h("div", be, [
251
+ y((u(), re(n(he), le({
252
+ ref_key: "fileUploader",
253
+ ref: F
254
+ }, Y.value), {
255
+ default: w(() => {
256
+ var a;
257
+ return [
258
+ p(n(pe), {
259
+ class: $([((a = n(c)) == null ? void 0 : a.errClass) + "-text"])
260
+ }, {
261
+ default: w(() => o[1] || (o[1] = [
262
+ z("选择文件")
263
+ ])),
264
+ _: 1,
265
+ __: [1]
266
+ }, 8, ["class"])
267
+ ];
268
+ }),
269
+ _: 1
270
+ }, 16)), [
271
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:upload" }]
272
+ ])
273
+ ]),
274
+ h("div", {
275
+ class: $(["flex-1 text-sm text-gray-500", [((b = n(c)) == null ? void 0 : b.errClass) + "-text"]])
276
+ }, T(oe()), 3)
277
+ ]),
278
+ h("div", ke, [
279
+ (u(!0), d(ce, null, ue(s.value, (a, f) => (u(), d("div", {
280
+ key: f,
281
+ class: "mb-2 pb-1"
282
+ }, [
283
+ h("div", Fe, [
284
+ h("div", Ee, [
285
+ h("span", {
286
+ class: $(["text-gray-700 mr-2", [a.status == n(i).Offline ? "line-through" : ""]])
287
+ }, T(a.fileName ?? a.name), 3),
288
+ h("span", null, [
289
+ p(n(ve), {
290
+ color: ne(a.status)
291
+ }, {
292
+ default: w(() => [
293
+ z(T(se(a.status)), 1)
294
+ ]),
295
+ _: 2
296
+ }, 1032, ["color"])
297
+ ])
298
+ ]),
299
+ h("div", Oe, [
300
+ e.showOnlineSwitch && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", ze, [
301
+ p(n(A), { title: "上线或下线" }, {
302
+ default: w(() => [
303
+ y(p(n(me), {
304
+ checked: a.status,
305
+ "onUpdate:checked": (v) => a.status = v,
306
+ data: [
307
+ { label: "上线", value: n(i).Online },
308
+ { label: "下线", value: n(i).Offline }
309
+ ],
310
+ onChange: (v) => Z(a)
311
+ }, null, 8, ["checked", "onUpdate:checked", "data", "onChange"]), [
312
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:online" }]
313
+ ])
314
+ ]),
315
+ _: 2
316
+ }, 1024)
317
+ ])) : C("", !0),
318
+ e.downloadUrl && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", Le, [
319
+ p(n(A), { title: "下载" }, {
320
+ default: w(() => [
321
+ y(p(n(I), {
322
+ icon: "icon-download",
323
+ clickable: "",
324
+ onClick: (v) => M(f)
325
+ }, null, 8, ["onClick"]), [
326
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
327
+ ]),
328
+ e.showActionText ? y((u(), d("span", {
329
+ key: 0,
330
+ class: "mr-2 text-sm text-nowrap",
331
+ onClick: (v) => M(f)
332
+ }, o[2] || (o[2] = [
333
+ z("下载")
334
+ ]), 8, Pe)), [
335
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
336
+ ]) : C("", !0)
337
+ ]),
338
+ _: 2
339
+ }, 1024)
340
+ ])) : C("", !0),
341
+ e.previewUrl && (a.status == n(i).Online || a.status == n(i).Offline) ? (u(), d("div", $e, [
342
+ p(n(A), { title: "预览" }, {
343
+ default: w(() => [
344
+ y(p(n(I), {
345
+ icon: "icon-eye",
346
+ clickable: "",
347
+ onClick: (v) => N(f)
348
+ }, null, 8, ["onClick"]), [
349
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:preview" }]
350
+ ]),
351
+ e.showActionText ? y((u(), d("span", {
352
+ key: 0,
353
+ class: "mr-2 text-sm text-nowrap",
354
+ onClick: (v) => N(f)
355
+ }, o[3] || (o[3] = [
356
+ z("预览")
357
+ ]), 8, Ae)), [
358
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:preview" }]
359
+ ]) : C("", !0)
360
+ ]),
361
+ _: 2
362
+ }, 1024)
363
+ ])) : C("", !0),
364
+ e.showDelete !== !1 ? (u(), d("div", Be, [
365
+ p(n(xe), {
366
+ open: te(f),
367
+ cancelText: "否",
368
+ okText: "是",
369
+ title: "确定删除该文件吗?",
370
+ okButtonProps: { size: "small" },
371
+ cancelButtonProps: { size: "small" },
372
+ onConfirm: (v) => R(f),
373
+ onCancel: o[0] || (o[0] = (v) => L.value = -1)
374
+ }, {
375
+ default: w(() => [
376
+ p(n(A), { title: "删除" }, {
377
+ default: w(() => [
378
+ h("div", {
379
+ onClick: (v) => ee(f, a.status)
380
+ }, [
381
+ y(p(n(I), {
382
+ icon: "icon-new",
383
+ angle: 45,
384
+ clickable: ""
385
+ }, null, 512), [
386
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
387
+ ]),
388
+ e.showActionText ? y((u(), d("span", Ie, o[4] || (o[4] = [
389
+ z("删除")
390
+ ]))), [
391
+ [r, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
392
+ ]) : C("", !0)
393
+ ], 8, Te)
394
+ ]),
395
+ _: 2
396
+ }, 1024)
397
+ ]),
398
+ _: 2
399
+ }, 1032, ["open", "onConfirm"])
400
+ ])) : C("", !0)
401
+ ])
402
+ ]),
403
+ a.status !== n(i).Online && a.status !== n(i).Offline && a.status !== n(i).Success ? (u(), d("div", Ke, [
404
+ p(n(ye), {
405
+ percent: a.percent,
406
+ "stroke-width": 2,
407
+ "show-info": !1,
408
+ style: { height: "2px" }
409
+ }, null, 8, ["percent"])
410
+ ])) : C("", !0)
411
+ ]))), 128))
412
+ ])
413
+ ], 2);
414
+ };
415
+ }
416
+ }), Ze = /* @__PURE__ */ we(je, [["__scopeId", "data-v-063bdf08"]]);
417
+ export {
418
+ Ue as C,
419
+ Ze as U,
420
+ _e as a,
421
+ Ce as d,
422
+ Se as p
423
+ };
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as F, defineAsyncComponent as M, ref as m, watch as V, onMounted as J, createElementBlock as x, openBlock as p, Fragment as K, createElementVNode as v, createVNode as _, toDisplayString as W, unref as i, createBlock as P, withKeys as f, normalizeClass as N, withModifiers as w, withCtx as z, createCommentVNode as L } from "vue";
2
2
  import "ant-design-vue";
3
- import { _ as q } from "../../assets/modules/toolIcon-BGZR_aUI.js";
3
+ import { _ as q } from "../../assets/modules/toolIcon-DDp0EFRE.js";
4
4
  import "@skyfox2000/fapi";
5
- import "../../assets/modules/uploadList-CMXuGRWT.js";
5
+ import "../../assets/modules/upload-template-BK8iQQYz.js";
6
6
  import "@skyfox2000/microbase";
7
7
  import "vue-m-message";
8
8
  import "async-validator";
9
9
  import "dayjs";
10
- import { _ as D } from "../../assets/modules/index-DyRjXb_O.js";
10
+ import { _ as D } from "../../assets/modules/index-Cwr2EDEI.js";
11
11
  import "vue-draggable-next";
12
12
  const h = async (s) => window.ace ? window.ace : new Promise((l, t) => {
13
13
  const o = document.createElement("script");
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, createBlock as o, openBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as w, KeepAlive as g, unref as n, resolveDynamicComponent as y } from "vue";
2
- import { _ as I } from "../../assets/modules/baseLayout-DIny49tw.js";
3
- import { ag as A, a as S } from "../../assets/modules/uploadList-CMXuGRWT.js";
2
+ import { _ as I } from "../../assets/modules/baseLayout-DSVT_hCt.js";
3
+ import { ag as A, a as S } from "../../assets/modules/upload-template-BK8iQQYz.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import b from "vue-m-message";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, createBlock as p, openBlock as m, unref as r, withCtx as e, createVNode as n, createTextVNode as a } from "vue";
2
- import { r as s } from "../../assets/modules/uploadList-CMXuGRWT.js";
2
+ import { r as s } from "../../assets/modules/upload-template-BK8iQQYz.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, createBlock as p, openBlock as m, unref as r, withCtx as e, createVNode as n, createTextVNode as a } from "vue";
2
- import { r as s } from "../../assets/modules/uploadList-CMXuGRWT.js";
2
+ import { r as s } from "../../assets/modules/upload-template-BK8iQQYz.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,12 +1,12 @@
1
- import { defineComponent as we, ref as f, computed as T, watch as W, onMounted as be, createBlock as H, openBlock as d, unref as n, withCtx as S, renderSlot as J, createElementBlock as g, createCommentVNode as K, createElementVNode as h, createVNode as C, createTextVNode as X, toDisplayString as E, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
2
- import { _ as Y } from "../../assets/modules/index-CEffEFtI.js";
1
+ import { defineComponent as we, ref as f, computed as T, watch as H, onMounted as be, createBlock as W, openBlock as d, unref as n, withCtx as S, renderSlot as J, createElementBlock as g, createCommentVNode as K, createElementVNode as h, createVNode as C, createTextVNode as X, toDisplayString as E, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
2
+ import { _ as Y } from "../../assets/modules/index-C6BAsERS.js";
3
3
  import { Modal as Fe, Upload as ue, Space as _e } from "ant-design-vue";
4
4
  import { httpGet as Ue, ResStatus as fe } from "@skyfox2000/fapi";
5
- import { F as Te, a3 as Se, a9 as Ee } from "../../assets/modules/uploadList-CMXuGRWT.js";
6
- import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-DHUBZlX4.js";
5
+ import { F as Te, a3 as Se, a9 as Ee } from "../../assets/modules/upload-template-BK8iQQYz.js";
6
+ import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-T2kmeyGd.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import p from "vue-m-message";
9
- import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-BIAdOoSj.js";
9
+ import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-DkMjvF98.js";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
12
  import "async-validator";
@@ -99,7 +99,7 @@ const Be = (l) => l.includes(",") || l.includes(`
99
99
  }, qe = {
100
100
  key: 1,
101
101
  class: "flex flex-col"
102
- }, Qe = { class: "overflow-y-auto" }, We = { class: "text-[13px] text-gray-600" }, He = { class: "pl-5 mt-1 mb-0" }, Je = {
102
+ }, Qe = { class: "overflow-y-auto" }, He = { class: "text-[13px] text-gray-600" }, We = { class: "pl-5 mt-1 mb-0" }, Je = {
103
103
  key: 0,
104
104
  class: "mt-3"
105
105
  }, Xe = { class: "text-[12px] text-gray-600 p-1" }, Ye = { class: "text-[13px] text-gray-600" }, Ze = { class: "pl-5 mt-1 mb-0" }, ea = { class: "text-[12px] text-gray-600" }, ma = /* @__PURE__ */ we({
@@ -110,6 +110,7 @@ const Be = (l) => l.includes(",") || l.includes(`
110
110
  excelCtrl: {},
111
111
  enableUpload: { type: Boolean, default: !0 },
112
112
  uploadParams: {},
113
+ excelHeaders: {},
113
114
  excelFieldMap: {},
114
115
  fileField: {},
115
116
  excelRecordsKey: {},
@@ -141,17 +142,17 @@ const Be = (l) => l.includes(",") || l.includes(`
141
142
  return "请选择Excel或CSV文件";
142
143
  }
143
144
  }), V = f("待验证数据规则"), B = f("warning"), P = f("待验证重复数据"), $ = f("warning");
144
- W(
145
+ H(
145
146
  () => a.visible.value,
146
147
  () => {
147
148
  m.value = a.visible.value, m.value && (A(), e.previewUrl && I());
148
149
  }
149
- ), W(
150
+ ), H(
150
151
  () => m.value,
151
152
  () => {
152
153
  a.visible.value = m.value, m.value || A();
153
154
  }
154
- ), W(
155
+ ), H(
155
156
  () => e.previewUrl,
156
157
  () => {
157
158
  m.value && e.previewUrl && I();
@@ -306,7 +307,7 @@ const Be = (l) => l.includes(",") || l.includes(`
306
307
  return p.error(v), ue.LIST_IGNORE;
307
308
  try {
308
309
  if (A(), y.value = t.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
309
- const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-BIAdOoSj.js").then((he) => he.j), M = await G(O, t.name);
310
+ const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-DkMjvF98.js").then((he) => he.j), M = await G(O, t.name);
310
311
  if (!M.success)
311
312
  throw new Error(M.error || "CSV文件处理失败");
312
313
  const oe = await (await fetch(M.blobUrl)).arrayBuffer();
@@ -348,7 +349,7 @@ const Be = (l) => l.includes(",") || l.includes(`
348
349
  };
349
350
  return s({
350
351
  clearAll: A
351
- }), (t, o) => (d(), H(n(Fe), {
352
+ }), (t, o) => (d(), W(n(Fe), {
352
353
  title: t.title ?? "文件上传",
353
354
  open: m.value,
354
355
  "onUpdate:open": o[0] || (o[0] = (r) => m.value = r),
@@ -367,7 +368,7 @@ const Be = (l) => l.includes(",") || l.includes(`
367
368
  ]),
368
369
  _: 1
369
370
  }),
370
- z.value ? K("", !0) : (d(), H(n(Y), {
371
+ z.value ? K("", !0) : (d(), W(n(Y), {
371
372
  key: 0,
372
373
  onClick: me,
373
374
  type: "primary",
@@ -418,7 +419,7 @@ const Be = (l) => l.includes(",") || l.includes(`
418
419
  J(t.$slots, "file-after")
419
420
  ])),
420
421
  h("div", Ae, [
421
- n(a).isFormLoading.value ? (d(), H(n(Le), {
422
+ n(a).isFormLoading.value ? (d(), W(n(Le), {
422
423
  key: 0,
423
424
  size: "large"
424
425
  })) : K("", !0),
@@ -454,8 +455,8 @@ const Be = (l) => l.includes(",") || l.includes(`
454
455
  key: u,
455
456
  class: "border-b pb-0"
456
457
  }, [
457
- h("div", We, E(r.field), 1),
458
- h("ul", He, [
458
+ h("div", He, E(r.field), 1),
459
+ h("ul", We, [
459
460
  (d(!0), g(ie, null, ne(r.rules, (i, c) => (d(), g("li", {
460
461
  key: c,
461
462
  class: "text-[12px] text-gray-600"
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, createBlock as o, openBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as g, KeepAlive as w, unref as n, resolveDynamicComponent as I } from "vue";
2
- import { _ as y } from "../../assets/modules/baseLayout-DIny49tw.js";
3
- import { ag as A, a as S } from "../../assets/modules/uploadList-CMXuGRWT.js";
2
+ import { _ as y } from "../../assets/modules/baseLayout-DSVT_hCt.js";
3
+ import { ag as A, a as S } from "../../assets/modules/upload-template-BK8iQQYz.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import k from "vue-m-message";