@skyfox2000/webui 1.3.10 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/modules/{file-upload-CwyUkWwi.js → file-upload-C2F7lPSM.js} +1 -1
- package/lib/assets/modules/{index-B_XPl41L.js → index-BIrJNh7I.js} +68 -65
- package/lib/assets/modules/{index-DHWlaZL2.js → index-Wb7_c6EZ.js} +2 -2
- package/lib/assets/modules/{index-BRWQ6SRp.js → index-sCdzN6vg.js} +1 -1
- package/lib/assets/modules/{menuTabs-NoNLt_B5.js → menuTabs-Dk9meNAk.js} +2 -2
- package/lib/assets/modules/{toolIcon-BSjgzw0G.js → toolIcon-s2mFt6QR.js} +1 -1
- package/lib/assets/modules/{uploadList-1Zmhwr0q.js → uploadList-B2L8NHoj.js} +4 -4
- package/lib/assets/modules/{uploadList-B4wb8I9a.js → uploadList-C_T_ft8_.js} +216 -204
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +3 -3
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +112 -113
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/utils/form-excel.d.ts +2 -1
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +14 -14
- package/package.json +1 -1
- package/src/components/content/dialog/excelForm.vue +12 -13
- package/src/components/form/radio/index.vue +8 -0
- package/src/components/form/select/index.vue +17 -1
- package/src/utils/form-excel.ts +18 -8
|
@@ -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-
|
|
5
|
+
import { ae as S, ad as w, u as g } from "./uploadList-C_T_ft8_.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,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { httpPost as
|
|
3
|
-
import { i as T, ag as $ } from "./uploadList-
|
|
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-C_T_ft8_.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
|
|
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-
|
|
8
|
-
const
|
|
7
|
+
import { _ as K } from "./toolIcon-s2mFt6QR.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
|
-
},
|
|
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((
|
|
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:
|
|
50
|
-
const y = `${
|
|
51
|
-
t.set(y,
|
|
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((
|
|
55
|
-
const
|
|
56
|
-
|
|
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(
|
|
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
|
-
},
|
|
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((
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
const F =
|
|
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((
|
|
83
|
-
|
|
82
|
+
}), c.columns.forEach((h) => {
|
|
83
|
+
h.width = 15;
|
|
84
84
|
});
|
|
85
|
-
const l = await a.xlsx.writeBuffer(),
|
|
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(
|
|
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 =
|
|
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:
|
|
128
|
+
csvToNormalized: j,
|
|
129
129
|
excelToExcelView: W,
|
|
130
|
-
excelToNormalized:
|
|
130
|
+
excelToNormalized: H,
|
|
131
131
|
normalizedToExcelView: q,
|
|
132
132
|
toExcel: g
|
|
133
133
|
}, Symbol.toStringTag, { value: "Module" })), x = async (i) => {
|
|
134
|
-
const e = await
|
|
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
|
|
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((
|
|
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,
|
|
222
|
-
const f = e.map((
|
|
223
|
-
u.push(
|
|
224
|
-
const w = f.some((
|
|
225
|
-
w && o.has(
|
|
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
|
|
227
|
+
const l = await M(s, {
|
|
228
228
|
Data: u
|
|
229
229
|
});
|
|
230
|
-
if (l != null && l.data && l.data.forEach((
|
|
231
|
-
t.add(
|
|
232
|
-
}), (l == null ? void 0 : l.status) ===
|
|
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((
|
|
237
|
+
return t.forEach((p) => {
|
|
238
238
|
e.forEach((f) => {
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
row:
|
|
239
|
+
const h = a.indexOf(f);
|
|
240
|
+
h >= 0 && l.push({
|
|
241
|
+
row: p + 2,
|
|
242
242
|
// Excel行号 = 数组索引 + 2(表头和1-based索引)
|
|
243
|
-
col:
|
|
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
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
(
|
|
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
|
-
|
|
267
|
-
}),
|
|
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
|
|
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
|
|
279
|
-
|
|
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:
|
|
353
|
+
icon: O(() => [
|
|
351
354
|
(b(), _(K, {
|
|
352
355
|
icon: r.value,
|
|
353
|
-
style:
|
|
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
|
-
|
|
368
|
-
|
|
370
|
+
j as e,
|
|
371
|
+
H as f,
|
|
369
372
|
W as g,
|
|
370
373
|
le as h,
|
|
371
374
|
ne as i,
|
|
@@ -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-
|
|
2
|
+
import { _ as m } from "./index-sCdzN6vg.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-
|
|
5
|
+
import { P as M, d as P, o as $, b as K } from "./uploadList-C_T_ft8_.js";
|
|
6
6
|
import "@skyfox2000/microbase";
|
|
7
7
|
import "vue-m-message";
|
|
8
8
|
import "async-validator";
|
|
@@ -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-
|
|
3
|
+
import { a as P, _ as k } from "./toolIcon-s2mFt6QR.js";
|
|
4
4
|
const C = /* @__PURE__ */ d({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
@@ -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-
|
|
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-
|
|
2
|
+
import { a as w, _ as b } from "./toolIcon-s2mFt6QR.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-C_T_ft8_.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-
|
|
4
|
+
import { c as S } from "./uploadList-C_T_ft8_.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-
|
|
3
|
-
import { a as z, _ as L } from "./toolIcon-
|
|
2
|
+
import { _ as ne } from "./index-sCdzN6vg.js";
|
|
3
|
+
import { a as z, _ as L } from "./toolIcon-s2mFt6QR.js";
|
|
4
4
|
import { httpPost as D, ResStatus as I } from "@skyfox2000/fapi";
|
|
5
|
-
import { s as ae, _ as se } from "./uploadList-
|
|
6
|
-
import { p as R, U as s } from "./file-upload-
|
|
5
|
+
import { s as ae, _ as se } from "./uploadList-C_T_ft8_.js";
|
|
6
|
+
import { p as R, U as s } from "./file-upload-C2F7lPSM.js";
|
|
7
7
|
import { combineParams as V } from "@skyfox2000/microbase";
|
|
8
8
|
import k from "vue-m-message";
|
|
9
9
|
import "async-validator";
|