@skyfox2000/webui 1.3.9 → 1.3.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.
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
2
2
  var E = (e, r, o) => r in e ? m(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o;
3
3
  var d = (e, r, o) => E(e, typeof r != "symbol" ? r + "" : r, o);
4
4
  import { hostUrl as v } from "@skyfox2000/fapi";
5
- import { ae as S, ad as w, u as g } from "./uploadList-D80ld89N.js";
5
+ import { ae as S, ad as w, u as g } from "./uploadList-B4wb8I9a.js";
6
6
  import { mainAppApis as a } from "@skyfox2000/microbase";
7
7
  import y from "dayjs";
8
8
  import p from "vue-m-message";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as d, useAttrs as f, createElementBlock as u, openBlock as x, createVNode as e, withCtx as n, unref as o, mergeProps as r, renderSlot as p } from "vue";
2
2
  import { Button as _ } from "ant-design-vue";
3
- import { a as P, _ as k } from "./toolIcon-jkoAB1WI.js";
3
+ import { a as P, _ as k } from "./toolIcon-BSjgzw0G.js";
4
4
  const C = /* @__PURE__ */ d({
5
5
  inheritAttrs: !1,
6
6
  __name: "index",
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as F, provide as _, ref as w, watch as p, onMounted as B, createBlock as n, openBlock as r, unref as a, withCtx as i, createElementVNode as N, renderSlot as b, createVNode as V, createCommentVNode as d, createTextVNode as u, toDisplayString as v } from "vue";
2
- import { _ as m } from "./index-DpVh0k1G.js";
2
+ import { _ as m } from "./index-BRWQ6SRp.js";
3
3
  import { Modal as D, Space as E } from "ant-design-vue";
4
4
  import "@skyfox2000/fapi";
5
- import { P as M, d as P, o as $, b as K } from "./uploadList-D80ld89N.js";
5
+ import { P as M, d as P, o as $, b as K } from "./uploadList-B4wb8I9a.js";
6
6
  import "@skyfox2000/microbase";
7
7
  import "vue-m-message";
8
8
  import "async-validator";
@@ -1,11 +1,11 @@
1
- import V from "async-validator";
2
- import { httpPost as j, ResStatus as M } from "@skyfox2000/fapi";
3
- import { i as T, ag as $ } from "./uploadList-D80ld89N.js";
1
+ import S from "async-validator";
2
+ import { httpPost as M, ResStatus as V } from "@skyfox2000/fapi";
3
+ import { i as T, ag as $ } from "./uploadList-B4wb8I9a.js";
4
4
  import m from "vue-m-message";
5
- import { defineComponent as R, useAttrs as U, createElementBlock as z, openBlock as b, createVNode as B, unref as v, mergeProps as D, computed as E, createBlock as _, withCtx as A, normalizeStyle as O } from "vue";
5
+ import { defineComponent as R, useAttrs as U, createElementBlock as z, openBlock as b, createVNode as B, unref as v, mergeProps as D, computed as E, createBlock as _, withCtx as O, normalizeStyle as A } from "vue";
6
6
  import { Spin as N, Alert as L } from "ant-design-vue";
7
- import { _ as K } from "./toolIcon-jkoAB1WI.js";
8
- const H = (i) => {
7
+ import { _ as K } from "./toolIcon-BSjgzw0G.js";
8
+ const j = (i) => {
9
9
  const e = i.split(`
10
10
  `).filter((c) => c.trim() !== "");
11
11
  if (e.length === 0)
@@ -17,7 +17,7 @@ const H = (i) => {
17
17
  return isNaN(t) ? o : t;
18
18
  })), n = s[0].map((c) => String(c || "")), a = s.slice(1);
19
19
  return { headers: n, rows: a };
20
- }, S = async (i) => {
20
+ }, H = async (i) => {
21
21
  try {
22
22
  const e = await import("exceljs"), s = new e.default.Workbook();
23
23
  await s.xlsx.load(i);
@@ -33,7 +33,7 @@ const H = (i) => {
33
33
  const t = [];
34
34
  a.forEach((u, l) => {
35
35
  const f = r.getCell(l + 1).value;
36
- f != null ? typeof f == "object" ? "richText" in f && Array.isArray(f.richText) ? t.push(f.richText.map((d) => d.text || "").join("")) : "text" in f && typeof f.text == "string" ? t.push(f.text) : (f instanceof Date, t.push(f)) : t.push(f) : t.push(null);
36
+ f != null ? typeof f == "object" ? "richText" in f && Array.isArray(f.richText) ? t.push(f.richText.map((h) => h.text || "").join("")) : "text" in f && typeof f.text == "string" ? t.push(f.text) : (f instanceof Date, t.push(f)) : t.push(f) : t.push(null);
37
37
  }), c.push(t);
38
38
  }
39
39
  }), { headers: a, rows: c };
@@ -46,31 +46,31 @@ const H = (i) => {
46
46
  if (r.length === 0)
47
47
  throw new Error("数据为空");
48
48
  const t = /* @__PURE__ */ new Map();
49
- s != null && s.markCells && s.markCells.forEach(({ row: d, col: w, color: p }) => {
50
- const y = `${d}-${w}`;
51
- t.set(y, p || "FFFF0000");
49
+ s != null && s.markCells && s.markCells.forEach(({ row: h, col: w, color: d }) => {
50
+ const y = `${h}-${w}`;
51
+ t.set(y, d || "FFFF0000");
52
52
  });
53
53
  const u = c.getRow(1);
54
- r.forEach((d, w) => {
55
- const p = u.getCell(w + 1);
56
- p.value = d, p.font = { bold: !0 }, p.fill = {
54
+ r.forEach((h, w) => {
55
+ const d = u.getCell(w + 1);
56
+ d.value = h, d.font = { bold: !0 }, d.fill = {
57
57
  type: "pattern",
58
58
  pattern: "solid",
59
59
  fgColor: { argb: "FFE0E0E0" }
60
- }, s != null && s.markHeaders && s.markHeaders.includes(d) && (p.fill = {
60
+ }, s != null && s.markHeaders && s.markHeaders.includes(h) && (d.fill = {
61
61
  type: "pattern",
62
62
  pattern: "solid",
63
63
  fgColor: { argb: "FFFF0000" }
64
- }, p.font = {
64
+ }, d.font = {
65
65
  name: "Arial",
66
66
  size: 10,
67
67
  bold: !0,
68
68
  color: { argb: "FFFFFFFF" }
69
69
  });
70
- }), o.forEach((d, w) => {
71
- const p = c.getRow(w + 2);
72
- d.forEach((y, k) => {
73
- const F = p.getCell(k + 1);
70
+ }), o.forEach((h, w) => {
71
+ const d = c.getRow(w + 2);
72
+ h.forEach((y, k) => {
73
+ const F = d.getCell(k + 1);
74
74
  F.value = y;
75
75
  const C = `${w + 2}-${k + 1}`;
76
76
  t.has(C) && (F.fill = {
@@ -79,15 +79,15 @@ const H = (i) => {
79
79
  fgColor: { argb: t.get(C) }
80
80
  });
81
81
  });
82
- }), c.columns.forEach((d) => {
83
- d.width = 15;
82
+ }), c.columns.forEach((h) => {
83
+ h.width = 15;
84
84
  });
85
- const l = await a.xlsx.writeBuffer(), h = new Blob([l], {
85
+ const l = await a.xlsx.writeBuffer(), p = new Blob([l], {
86
86
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
87
87
  });
88
88
  return {
89
89
  success: !0,
90
- blobUrl: URL.createObjectURL(h),
90
+ blobUrl: URL.createObjectURL(p),
91
91
  fileName: e.replace(/\.(csv|xlsx?)$/i, ".xlsx")
92
92
  };
93
93
  } catch (n) {
@@ -98,7 +98,7 @@ const H = (i) => {
98
98
  }
99
99
  }, P = async (i, e) => {
100
100
  try {
101
- const s = H(i);
101
+ const s = j(i);
102
102
  return await g(s, e);
103
103
  } catch (s) {
104
104
  return {
@@ -125,13 +125,13 @@ const H = (i) => {
125
125
  }, q = async (i, e) => await g(i, e), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
126
  __proto__: null,
127
127
  csvToExcelView: P,
128
- csvToNormalized: H,
128
+ csvToNormalized: j,
129
129
  excelToExcelView: W,
130
- excelToNormalized: S,
130
+ excelToNormalized: H,
131
131
  normalizedToExcelView: q,
132
132
  toExcel: g
133
133
  }, Symbol.toStringTag, { value: "Module" })), x = async (i) => {
134
- const e = await S(i);
134
+ const e = await H(i);
135
135
  if (e.headers.length === 0)
136
136
  return m.error("Excel文件不包含工作表"), null;
137
137
  const s = [];
@@ -170,7 +170,7 @@ const H = (i) => {
170
170
  n.includes(t) || c.push(t);
171
171
  }), n.length === 0 || a.length === 0)
172
172
  return m.error("Excel文件不包含足够的数据"), { hasError: !0 };
173
- const r = new V({});
173
+ const r = new S({});
174
174
  r.messages($.messages()), r.define(e);
175
175
  const o = await Q(n, a, r);
176
176
  return o.length > 0 || c.length > 0 ? {
@@ -194,7 +194,7 @@ const H = (i) => {
194
194
  const o = [];
195
195
  r.forEach((t) => {
196
196
  const u = i.indexOf(t.field);
197
- u >= 0 && (o.some((h) => h.row === a && h.col === u) || o.push({
197
+ u >= 0 && (o.some((p) => p.row === a && p.col === u) || o.push({
198
198
  row: a,
199
199
  col: u,
200
200
  header: t.field,
@@ -218,29 +218,29 @@ const H = (i) => {
218
218
  }), r.length > 0)
219
219
  return m.error(`表头缺少重复检测所需字段: ${r.join(", ")}`), { hasError: !0 };
220
220
  const o = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set(), u = new Array();
221
- if (c.forEach((l, h) => {
222
- const f = e.map((p) => l[p]), d = f.join("|");
223
- u.push(d);
224
- const w = f.some((p) => p != null && p !== "");
225
- w && o.has(d) ? (t.add(h), t.add(o.get(d))) : w && o.set(d, h);
221
+ if (c.forEach((l, p) => {
222
+ const f = e.map((d) => l[d]), h = f.join("|");
223
+ u.push(h);
224
+ const w = f.some((d) => d != null && d !== "");
225
+ w && o.has(h) ? (t.add(p), t.add(o.get(h))) : w && o.set(h, p);
226
226
  }), s) {
227
- const l = await j(s, {
227
+ const l = await M(s, {
228
228
  Data: u
229
229
  });
230
- if (l != null && l.data && l.data.forEach((h) => {
231
- t.add(h);
232
- }), (l == null ? void 0 : l.status) === M.ERROR)
230
+ if (l != null && l.data && l.data.forEach((p) => {
231
+ t.add(p);
232
+ }), (l == null ? void 0 : l.status) === V.ERROR)
233
233
  throw new Error(l.msg);
234
234
  }
235
235
  if (t.size > 0) {
236
236
  const l = [];
237
- return t.forEach((h) => {
237
+ return t.forEach((p) => {
238
238
  e.forEach((f) => {
239
- const d = a.indexOf(f);
240
- d >= 0 && l.push({
241
- row: h + 2,
239
+ const h = a.indexOf(f);
240
+ h >= 0 && l.push({
241
+ row: p + 2,
242
242
  // Excel行号 = 数组索引 + 2(表头和1-based索引)
243
- col: d + 1,
243
+ col: h + 1,
244
244
  // Excel列号 = 数组索引 + 1(1-based索引)
245
245
  color: "FFA500"
246
246
  // 黄橙色
@@ -255,19 +255,19 @@ const H = (i) => {
255
255
  return { hasError: !1 };
256
256
  }, ne = async (i, e, s, n) => {
257
257
  const a = [], c = [];
258
- let r = !1, o = !1, t = "数据验证成功", u = "数据验证通过";
258
+ let r = !1, o = !1, t = "数据验证成功", u = "待验证重复数据";
259
259
  const l = await G(i, e);
260
- if (l.hasError && (r = !0, t = "数据验证失败", l.markCells && a.push(...l.markCells), l.markHeaders && c.push(...l.markHeaders)), s && s.length > 0) {
261
- const h = await X(i, s, n);
262
- h.hasError && (o = !0, u = "检测到重复数据", h.markCells && h.markCells.forEach((f) => {
263
- const d = a.find(
264
- (w) => w.row === f.row && w.col === f.col
260
+ if (l.hasError ? (r = !0, t = "数据验证失败", l.markCells && a.push(...l.markCells), l.markHeaders && c.push(...l.markHeaders)) : e && Object.keys(e).length > 0 && (t = "数据验证通过"), s && s.length > 0) {
261
+ const f = await X(i, s, n);
262
+ f.hasError ? (o = !0, u = "检测到重复数据", f.markCells && f.markCells.forEach((h) => {
263
+ const w = a.find(
264
+ (d) => d.row === h.row && d.col === h.col
265
265
  );
266
- d ? d.color = "8B0000" : a.push(f);
267
- }), h.markHeaders && c.push(...h.markHeaders));
266
+ w ? w.color = "8B0000" : a.push(h);
267
+ }), f.markHeaders && c.push(...f.markHeaders)) : u = "重复性检验通过";
268
268
  }
269
269
  if (r || o) {
270
- const h = await J(
270
+ const f = await J(
271
271
  i,
272
272
  {
273
273
  markCells: a,
@@ -275,21 +275,24 @@ const H = (i) => {
275
275
  },
276
276
  "validation_errors.xlsx"
277
277
  );
278
- return h.success && h.blobUrl ? {
279
- hasError: !0,
280
- errBlob: await (await fetch(h.blobUrl)).blob(),
278
+ return f.success && f.blobUrl ? {
279
+ errBlob: await (await fetch(f.blobUrl)).blob(),
281
280
  validationMsg: t,
282
- duplicateMsg: u
281
+ duplicateMsg: u,
282
+ hasFormatError: r,
283
+ hasDuplicateError: o
283
284
  } : {
284
- hasError: !0,
285
285
  validationMsg: t,
286
- duplicateMsg: u
286
+ duplicateMsg: u,
287
+ hasFormatError: r,
288
+ hasDuplicateError: o
287
289
  };
288
290
  }
289
291
  return {
290
- hasError: !1,
291
292
  validationMsg: t,
292
- duplicateMsg: u
293
+ duplicateMsg: u,
294
+ hasFormatError: !1,
295
+ hasDuplicateError: !1
293
296
  };
294
297
  }, ce = async (i, e, s) => {
295
298
  const n = i.originFileObj;
@@ -347,10 +350,10 @@ const H = (i) => {
347
350
  type: u.type,
348
351
  message: u.message
349
352
  }, u.$attrs), {
350
- icon: A(() => [
353
+ icon: O(() => [
351
354
  (b(), _(K, {
352
355
  icon: r.value,
353
- style: O({ color: c.value }),
356
+ style: A({ color: c.value }),
354
357
  key: t.value
355
358
  }, null, 8, ["icon", "style"]))
356
359
  ]),
@@ -364,8 +367,8 @@ export {
364
367
  ce as b,
365
368
  P as c,
366
369
  J as d,
367
- H as e,
368
- S as f,
370
+ j as e,
371
+ H as f,
369
372
  W as g,
370
373
  le as h,
371
374
  ne as i,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, createBlock as h, createCommentVNode as I, openBlock as u, unref as t, mergeProps as C, useAttrs as q, computed as j, ref as y, watch as k, withCtx as d, createElementBlock as g, normalizeStyle as T, createElementVNode as m, inject as J, onMounted as N, createVNode as l, toDisplayString as $, Fragment as L, createTextVNode as K, reactive as W, nextTick as Y, renderList as G, withModifiers as Q } from "vue";
2
- import { a as w, _ as b } from "./toolIcon-jkoAB1WI.js";
3
- import { c as D, S as E, af as P, V as U, U as M, u as F, a as V, T as X, r as H, ad as z } from "./uploadList-D80ld89N.js";
2
+ import { a as w, _ as b } from "./toolIcon-BSjgzw0G.js";
3
+ import { c as D, S as E, af as P, V as U, U as M, u as F, a as V, T as X, r as H, ad as z } from "./uploadList-B4wb8I9a.js";
4
4
  import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  import { theme as O, Breadcrumb as ee, Modal as te, Flex as ne, LayoutHeader as oe, Space as se, Menu as ie, Tabs as ce, TabPane as ae } from "ant-design-vue";
6
6
  import { mainAppApis as R } from "@skyfox2000/microbase";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as i, createBlock as s, openBlock as l, unref as a, withCtx as p, renderSlot as f, createCommentVNode as u, mergeProps as d } from "vue";
2
2
  import { Tooltip as I } from "ant-design-vue";
3
3
  import { SERVER_HOST as r } from "@skyfox2000/fapi";
4
- import { c as S } from "./uploadList-D80ld89N.js";
4
+ import { c as S } from "./uploadList-B4wb8I9a.js";
5
5
  const T = /* @__PURE__ */ i({
6
6
  __name: "index",
7
7
  props: {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as X, ref as P, computed as M, watch as $, resolveDirective as Y, createElementBlock as v, openBlock as m, normalizeClass as O, unref as n, createElementVNode as f, withDirectives as x, createBlock as Z, mergeProps as ee, withCtx as y, createVNode as u, createTextVNode as F, toDisplayString as A, Fragment as te, renderList as oe, createCommentVNode as b } from "vue";
2
- import { _ as ne } from "./index-DpVh0k1G.js";
3
- import { a as z, _ as L } from "./toolIcon-jkoAB1WI.js";
2
+ import { _ as ne } from "./index-BRWQ6SRp.js";
3
+ import { a as z, _ as L } from "./toolIcon-BSjgzw0G.js";
4
4
  import { httpPost as D, ResStatus as I } from "@skyfox2000/fapi";
5
- import { s as ae, _ as se } from "./uploadList-D80ld89N.js";
6
- import { p as R, U as s } from "./file-upload-Bkrnsn-c.js";
5
+ import { s as ae, _ as se } from "./uploadList-B4wb8I9a.js";
6
+ import { p as R, U as s } from "./file-upload-CwyUkWwi.js";
7
7
  import { combineParams as V } from "@skyfox2000/microbase";
8
8
  import k from "vue-m-message";
9
9
  import "async-validator";