@skyfox2000/webui 1.3.21 → 1.4.0
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/{baseLayout-Bz3oRE5o.js → baseLayout-DIEq13qJ.js} +6 -6
- package/lib/assets/modules/{file-upload-CmnCEJze.js → file-upload-DGuLxYSu.js} +2 -2
- package/lib/assets/modules/{index-CAqiqqdd.js → index-BPufvr-r.js} +134 -133
- package/lib/assets/modules/{index-CvQ24Mzh.js → index-CAtotNY6.js} +2 -2
- package/lib/assets/modules/{index-D0njzOzQ.js → index-DVzBH6zL.js} +1 -1
- package/lib/assets/modules/{menuTabs-NVgroqVO.js → menuTabs-DKvoic5x.js} +7 -7
- package/lib/assets/modules/{toolIcon-BuqRfX4F.js → toolIcon-Y7Lpx2Hb.js} +1 -1
- package/lib/assets/modules/{uploadList-B6MIYOtN.js → uploadList-Bh2SzZzX.js} +705 -700
- package/lib/assets/modules/{uploadList-KG6kpOaY.js → uploadList-DG33cpFl.js} +152 -146
- package/lib/components/common/icon/index.vue.d.ts +1 -1
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +5 -5
- package/lib/es/MenuLayout/index.js +2 -2
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/stores/userInfo.d.ts +3 -1
- package/lib/utils/micro-openapis.d.ts +35 -0
- package/lib/webui.es.js +358 -353
- package/package.json +1 -2
- package/src/components/layout/header/headerExits.vue +1 -1
- package/src/stores/appInfo.ts +7 -8
- package/src/stores/userInfo.ts +21 -63
- package/src/utils/data.ts +6 -0
- package/src/utils/download.ts +10 -1
- package/src/utils/export-table.ts +5 -0
- package/src/utils/form-excel.ts +14 -9
- package/src/utils/main-openapis.ts +2 -2
- package/src/utils/micro-openapis.ts +146 -0
- package/src/utils/options.ts +5 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as _, onMounted as I, createBlock as s, openBlock as o, unref as e, withCtx as l, createCommentVNode as r, createVNode as p, createElementVNode as x, createElementBlock as y, toDisplayString as g, renderSlot as h } from "vue";
|
|
2
2
|
import { Layout as i, LayoutSider as k } from "ant-design-vue";
|
|
3
|
-
import { a as b } from "./toolIcon-
|
|
4
|
-
import { I as C, _ as S, f as w, d as $, g as N } from "./menuTabs-
|
|
5
|
-
import {
|
|
3
|
+
import { a as b } from "./toolIcon-Y7Lpx2Hb.js";
|
|
4
|
+
import { I as C, _ as S, f as w, d as $, g as N } from "./menuTabs-DKvoic5x.js";
|
|
5
|
+
import { ae as v, a as B, ag as E } from "./uploadList-Bh2SzZzX.js";
|
|
6
6
|
import "@skyfox2000/microbase";
|
|
7
7
|
import "@skyfox2000/fapi";
|
|
8
8
|
import L from "vue-m-message";
|
|
@@ -17,8 +17,8 @@ const V = { class: "h-[40px] max-h-[40px] bg-[rgba(240,240,240,0.2)] flex flex-n
|
|
|
17
17
|
props: {
|
|
18
18
|
routes: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
20
|
+
setup(m) {
|
|
21
|
+
const f = m, a = v(), t = B(), u = E();
|
|
22
22
|
return I(() => {
|
|
23
23
|
L.closeAll();
|
|
24
24
|
}), (d, c) => (o(), s(e(i), { class: "h-screen" }, {
|
|
@@ -56,7 +56,7 @@ const V = { class: "h-[40px] max-h-[40px] bg-[rgba(240,240,240,0.2)] flex flex-n
|
|
|
56
56
|
e(t).menuCollapse ? r("", !0) : (o(), y("span", z, g(e(a).appInfo.Name), 1))
|
|
57
57
|
]),
|
|
58
58
|
p(w, {
|
|
59
|
-
routes:
|
|
59
|
+
routes: f.routes
|
|
60
60
|
}, null, 8, ["routes"])
|
|
61
61
|
]),
|
|
62
62
|
_: 1
|
|
@@ -2,12 +2,12 @@ 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 {
|
|
5
|
+
import { af as S, ae as w, u as g } from "./uploadList-Bh2SzZzX.js";
|
|
6
6
|
import { mainAppApis as a } from "@skyfox2000/microbase";
|
|
7
7
|
import y from "dayjs";
|
|
8
8
|
import p from "vue-m-message";
|
|
9
9
|
var i = /* @__PURE__ */ ((e) => (e.Pending = "pending", e.Uploading = "uploading", e.Success = "success", e.Error = "error", e.Online = "online", e.Offline = "offline", e))(i || {});
|
|
10
|
-
const U = () => a.value ? a.value.getHostInfo() : S().hostInfo, x = () => a.value && a.value.getAppInfo ? a.value.getAppInfo() : w().appInfo, L = (e) => a.value && a.value.userLogin ? a.value.userLogin(e) : g().login(e, !0), M = () => a.value && a.value.userLogout ? a.value.userLogout() : g().logout(), b = () => a.value && a.value.getToken ? a.value.getToken() : g().getToken(), N = () => a.value && a.value.getUserInfo ? a.value.getUserInfo() : g().getUserInfo();
|
|
10
|
+
const U = () => a.value ? a.value.getHostInfo() : S().hostInfo, x = () => a.value && a.value.getAppInfo ? a.value.getAppInfo() : w().appInfo, L = (e) => a.value && a.value.userLogin ? a.value.userLogin(e) : g().login(e, !0), M = () => a.value && a.value.userLogout ? a.value.userLogout() : g().logout(!0), b = () => a.value && a.value.getToken ? a.value.getToken() : g().getToken(), N = () => a.value && a.value.getUserInfo ? a.value.getUserInfo() : g().getUserInfo();
|
|
11
11
|
class z {
|
|
12
12
|
/**
|
|
13
13
|
* 连接路径参数,已判断 undefined 或 null 值
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import
|
|
1
|
+
import H from "async-validator";
|
|
2
2
|
import { httpPost as M, ResStatus as V } from "@skyfox2000/fapi";
|
|
3
|
-
import { i as T,
|
|
3
|
+
import { i as T, ah as U, L as $, u as z } from "./uploadList-Bh2SzZzX.js";
|
|
4
4
|
import m from "vue-m-message";
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { Spin as
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
5
|
+
import { defineComponent as _, useAttrs as B, createElementBlock as A, openBlock as b, createVNode as O, unref as v, mergeProps as S, computed as E, createBlock as R, withCtx as L, normalizeStyle as N } from "vue";
|
|
6
|
+
import { Spin as K, Alert as P } from "ant-design-vue";
|
|
7
|
+
import { _ as W } from "./toolIcon-Y7Lpx2Hb.js";
|
|
8
|
+
const D = (i) => {
|
|
9
9
|
const e = i.split(`
|
|
10
|
-
`).filter((
|
|
10
|
+
`).filter((l) => l.trim() !== "");
|
|
11
11
|
if (e.length === 0)
|
|
12
12
|
return { headers: [], rows: [] };
|
|
13
|
-
const s = e.map((
|
|
13
|
+
const s = e.map((l) => l.split(",").map((r) => {
|
|
14
14
|
const o = r.trim();
|
|
15
15
|
if (o === "" || o === "null") return null;
|
|
16
16
|
const t = Number(o);
|
|
17
17
|
return isNaN(t) ? o : t;
|
|
18
|
-
})),
|
|
19
|
-
return { headers:
|
|
20
|
-
},
|
|
18
|
+
})), c = s[0].map((l) => String(l || "")), a = s.slice(1);
|
|
19
|
+
return { headers: c, rows: a };
|
|
20
|
+
}, j = async (i) => {
|
|
21
21
|
try {
|
|
22
22
|
const e = await import("exceljs"), s = new e.default.Workbook();
|
|
23
23
|
await s.xlsx.load(i);
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
24
|
+
const c = s.worksheets[0];
|
|
25
|
+
if (!c)
|
|
26
26
|
return { headers: [], rows: [] };
|
|
27
|
-
const a = [],
|
|
28
|
-
return
|
|
27
|
+
const a = [], l = [];
|
|
28
|
+
return c.getRow(1).eachCell((r) => {
|
|
29
29
|
let o = "";
|
|
30
30
|
r.value !== null && r.value !== void 0 && (typeof r.value == "object" ? "richText" in r.value && Array.isArray(r.value.richText) ? o = r.value.richText.map((t) => t.text || "").join("") : "text" in r.value && typeof r.value.text == "string" ? o = r.value.text : r.value instanceof Date ? o = r.value.toLocaleDateString() : o = String(r.value) : o = String(r.value)), a.push(o);
|
|
31
|
-
}),
|
|
31
|
+
}), c.eachRow((r, o) => {
|
|
32
32
|
if (o > 1) {
|
|
33
33
|
const t = [];
|
|
34
|
-
a.forEach((u,
|
|
35
|
-
const f = r.getCell(
|
|
34
|
+
a.forEach((u, n) => {
|
|
35
|
+
const f = r.getCell(n + 1).value;
|
|
36
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
|
+
}), l.push(t);
|
|
38
38
|
}
|
|
39
|
-
}), { headers: a, rows:
|
|
39
|
+
}), { headers: a, rows: l };
|
|
40
40
|
} catch (e) {
|
|
41
41
|
return console.error("Excel解析失败:", e), { headers: [], rows: [] };
|
|
42
42
|
}
|
|
43
43
|
}, g = async (i, e, s) => {
|
|
44
44
|
try {
|
|
45
|
-
const
|
|
45
|
+
const c = await import("exceljs"), a = new c.default.Workbook(), l = a.addWorksheet("Sheet1"), { headers: r, rows: o } = 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: h, col: w, color:
|
|
49
|
+
s != null && s.markCells && s.markCells.forEach(({ row: h, col: w, color: p }) => {
|
|
50
50
|
const y = `${h}-${w}`;
|
|
51
|
-
t.set(y,
|
|
51
|
+
t.set(y, p || "FFFF0000");
|
|
52
52
|
});
|
|
53
|
-
const u =
|
|
53
|
+
const u = l.getRow(1);
|
|
54
54
|
r.forEach((h, w) => {
|
|
55
|
-
const
|
|
56
|
-
|
|
55
|
+
const p = u.getCell(w + 1);
|
|
56
|
+
p.value = h, p.font = { bold: !0 }, p.fill = {
|
|
57
57
|
type: "pattern",
|
|
58
58
|
pattern: "solid",
|
|
59
59
|
fgColor: { argb: "FFE0E0E0" }
|
|
60
|
-
}, s != null && s.markHeaders && s.markHeaders.includes(h) && (
|
|
60
|
+
}, s != null && s.markHeaders && s.markHeaders.includes(h) && (p.fill = {
|
|
61
61
|
type: "pattern",
|
|
62
62
|
pattern: "solid",
|
|
63
63
|
fgColor: { argb: "FFFF0000" }
|
|
64
|
-
},
|
|
64
|
+
}, p.font = {
|
|
65
65
|
name: "Arial",
|
|
66
66
|
size: 10,
|
|
67
67
|
bold: !0,
|
|
68
68
|
color: { argb: "FFFFFFFF" }
|
|
69
69
|
});
|
|
70
70
|
}), o.forEach((h, w) => {
|
|
71
|
-
const
|
|
71
|
+
const p = l.getRow(w + 2);
|
|
72
72
|
h.forEach((y, k) => {
|
|
73
|
-
const F =
|
|
73
|
+
const F = p.getCell(k + 1);
|
|
74
74
|
F.value = y;
|
|
75
75
|
const C = `${w + 2}-${k + 1}`;
|
|
76
76
|
t.has(C) && (F.fill = {
|
|
@@ -79,26 +79,26 @@ const j = (i) => {
|
|
|
79
79
|
fgColor: { argb: t.get(C) }
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
|
-
}),
|
|
82
|
+
}), l.columns.forEach((h) => {
|
|
83
83
|
h.width = 15;
|
|
84
84
|
});
|
|
85
|
-
const
|
|
85
|
+
const n = await a.xlsx.writeBuffer(), d = new Blob([n], {
|
|
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(d),
|
|
91
91
|
fileName: e.replace(/\.(csv|xlsx?)$/i, ".xlsx")
|
|
92
92
|
};
|
|
93
|
-
} catch (
|
|
94
|
-
return console.error("转换Excel失败:",
|
|
93
|
+
} catch (c) {
|
|
94
|
+
return console.error("转换Excel失败:", c), {
|
|
95
95
|
success: !1,
|
|
96
|
-
error:
|
|
96
|
+
error: c instanceof Error ? c.message : "未知错误"
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, q = async (i, e) => {
|
|
100
100
|
try {
|
|
101
|
-
const s =
|
|
101
|
+
const s = D(i);
|
|
102
102
|
return await g(s, e);
|
|
103
103
|
} catch (s) {
|
|
104
104
|
return {
|
|
@@ -106,7 +106,7 @@ const j = (i) => {
|
|
|
106
106
|
error: s instanceof Error ? s.message : "CSV处理失败"
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, J = async (i, e) => {
|
|
110
110
|
try {
|
|
111
111
|
const s = new Blob([i], {
|
|
112
112
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
@@ -122,58 +122,58 @@ const j = (i) => {
|
|
|
122
122
|
error: s instanceof Error ? s.message : "Excel处理失败"
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
},
|
|
125
|
+
}, G = async (i, e) => await g(i, e), ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
126
126
|
__proto__: null,
|
|
127
|
-
csvToExcelView:
|
|
128
|
-
csvToNormalized:
|
|
129
|
-
excelToExcelView:
|
|
130
|
-
excelToNormalized:
|
|
131
|
-
normalizedToExcelView:
|
|
127
|
+
csvToExcelView: q,
|
|
128
|
+
csvToNormalized: D,
|
|
129
|
+
excelToExcelView: J,
|
|
130
|
+
excelToNormalized: j,
|
|
131
|
+
normalizedToExcelView: G,
|
|
132
132
|
toExcel: g
|
|
133
133
|
}, Symbol.toStringTag, { value: "Module" })), x = async (i) => {
|
|
134
|
-
const e = await
|
|
134
|
+
const e = await j(i);
|
|
135
135
|
if (e.headers.length === 0)
|
|
136
136
|
return m.error("Excel文件不包含工作表"), null;
|
|
137
137
|
const s = [];
|
|
138
|
-
return e.rows.forEach((
|
|
138
|
+
return e.rows.forEach((c) => {
|
|
139
139
|
const a = {};
|
|
140
|
-
e.headers.forEach((
|
|
141
|
-
|
|
140
|
+
e.headers.forEach((l, r) => {
|
|
141
|
+
l && (a[l] = c[r]);
|
|
142
142
|
}), s.push(a);
|
|
143
143
|
}), {
|
|
144
144
|
headers: e.headers,
|
|
145
145
|
excelData: s,
|
|
146
146
|
excelRows: e.rows
|
|
147
147
|
};
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
148
|
+
}, Q = async (i, e, s) => {
|
|
149
|
+
const c = await x(i);
|
|
150
|
+
if (!c)
|
|
151
151
|
return { success: !1, error: "Excel文件处理失败" };
|
|
152
|
-
const { headers: a, excelRows:
|
|
152
|
+
const { headers: a, excelRows: l } = c, { markHeaders: r } = e, o = [...a];
|
|
153
153
|
r && r.length > 0 && r.forEach((u) => {
|
|
154
154
|
o.includes(u) || o.push(u);
|
|
155
155
|
});
|
|
156
|
-
const t =
|
|
157
|
-
const
|
|
158
|
-
for (;
|
|
159
|
-
|
|
160
|
-
return
|
|
156
|
+
const t = l.map((u) => {
|
|
157
|
+
const n = [...u];
|
|
158
|
+
for (; n.length < o.length; )
|
|
159
|
+
n.push(null);
|
|
160
|
+
return n;
|
|
161
161
|
});
|
|
162
162
|
return await g({ headers: o, rows: t }, s, e);
|
|
163
|
-
},
|
|
163
|
+
}, X = async (i, e) => {
|
|
164
164
|
if (!e || T(e))
|
|
165
165
|
return { hasError: !1 };
|
|
166
166
|
const s = await x(i);
|
|
167
167
|
if (!s) return { hasError: !0 };
|
|
168
|
-
const { headers:
|
|
168
|
+
const { headers: c, excelData: a } = s, l = [];
|
|
169
169
|
if (Object.keys(e).forEach((t) => {
|
|
170
|
-
|
|
171
|
-
}),
|
|
170
|
+
c.includes(t) || l.push(t);
|
|
171
|
+
}), c.length === 0 || a.length === 0)
|
|
172
172
|
return m.error("Excel文件不包含足够的数据"), { hasError: !0 };
|
|
173
|
-
const r = new
|
|
174
|
-
r.messages(
|
|
175
|
-
const o = await
|
|
176
|
-
return o.length > 0 ||
|
|
173
|
+
const r = new H({});
|
|
174
|
+
r.messages(U.messages()), r.define(e);
|
|
175
|
+
const o = await Y(c, a, r);
|
|
176
|
+
return o.length > 0 || l.length > 0 ? {
|
|
177
177
|
hasError: !0,
|
|
178
178
|
markCells: o.map((u) => ({
|
|
179
179
|
row: u.row + 2,
|
|
@@ -183,62 +183,63 @@ const j = (i) => {
|
|
|
183
183
|
color: "FFFF0000"
|
|
184
184
|
// 红色
|
|
185
185
|
})),
|
|
186
|
-
markHeaders:
|
|
186
|
+
markHeaders: l
|
|
187
187
|
} : { hasError: !1 };
|
|
188
|
-
},
|
|
189
|
-
const
|
|
188
|
+
}, Y = async (i, e, s) => {
|
|
189
|
+
const c = [];
|
|
190
190
|
for (let a = 0; a < e.length; a++) {
|
|
191
|
-
const
|
|
191
|
+
const l = e[a];
|
|
192
192
|
try {
|
|
193
|
-
await s.validate(
|
|
193
|
+
await s.validate(l).catch(({ errors: r }) => {
|
|
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((d) => d.row === a && d.col === u) || o.push({
|
|
198
198
|
row: a,
|
|
199
199
|
col: u,
|
|
200
200
|
header: t.field,
|
|
201
201
|
message: t.message.replace("${label}", i[u])
|
|
202
202
|
}));
|
|
203
|
-
}),
|
|
203
|
+
}), c.push(...o);
|
|
204
204
|
});
|
|
205
205
|
} catch (r) {
|
|
206
206
|
console.error("验证表格数据时发生错误:", r), m.error("验证表格数据时发生错误:" + r);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
return
|
|
210
|
-
},
|
|
209
|
+
return c;
|
|
210
|
+
}, Z = async (i, e, s) => {
|
|
211
211
|
if (!e || e.length === 0)
|
|
212
212
|
return { hasError: !1 };
|
|
213
|
-
const
|
|
214
|
-
if (!
|
|
215
|
-
const { headers: a, excelData:
|
|
216
|
-
if (e.forEach((
|
|
217
|
-
a.includes(
|
|
213
|
+
const c = await x(i);
|
|
214
|
+
if (!c) return { hasError: !0 };
|
|
215
|
+
const { headers: a, excelData: l } = c, r = [];
|
|
216
|
+
if (e.forEach((n) => {
|
|
217
|
+
a.includes(n) || r.push(n);
|
|
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 (
|
|
222
|
-
const f = e.map((
|
|
221
|
+
if (l.forEach((n, d) => {
|
|
222
|
+
const f = e.map((p) => n[p]), h = f.join("|");
|
|
223
223
|
u.push(h);
|
|
224
|
-
const w = f.some((
|
|
225
|
-
w && o.has(h) ? (t.add(
|
|
224
|
+
const w = f.some((p) => p != null && p !== "");
|
|
225
|
+
w && o.has(h) ? (t.add(d), t.add(o.get(h))) : w && o.set(h, d);
|
|
226
226
|
}), s) {
|
|
227
|
-
const
|
|
227
|
+
const n = await M(s, {
|
|
228
228
|
Data: u
|
|
229
229
|
});
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
if ((n == null ? void 0 : n.status) == V.SUCCESS)
|
|
231
|
+
(n == null ? void 0 : n.data).forEach((f) => {
|
|
232
|
+
t.add(f);
|
|
233
|
+
});
|
|
234
|
+
else throw (n == null ? void 0 : n.errno) == $ ? (z().logout(!1), new Error("登录已过期")) : new Error(n == null ? void 0 : n.msg);
|
|
234
235
|
}
|
|
235
236
|
if (t.size > 0) {
|
|
236
|
-
const
|
|
237
|
-
return t.forEach((
|
|
237
|
+
const n = [];
|
|
238
|
+
return t.forEach((d) => {
|
|
238
239
|
e.forEach((f) => {
|
|
239
240
|
const h = a.indexOf(f);
|
|
240
|
-
h >= 0 &&
|
|
241
|
-
row:
|
|
241
|
+
h >= 0 && n.push({
|
|
242
|
+
row: d + 2,
|
|
242
243
|
// Excel行号 = 数组索引 + 2(表头和1-based索引)
|
|
243
244
|
col: h + 1,
|
|
244
245
|
// Excel列号 = 数组索引 + 1(1-based索引)
|
|
@@ -248,30 +249,30 @@ const j = (i) => {
|
|
|
248
249
|
});
|
|
249
250
|
}), {
|
|
250
251
|
hasError: !0,
|
|
251
|
-
markCells:
|
|
252
|
+
markCells: n,
|
|
252
253
|
markHeaders: r
|
|
253
254
|
};
|
|
254
255
|
}
|
|
255
256
|
return { hasError: !1 };
|
|
256
|
-
},
|
|
257
|
-
const a = [],
|
|
257
|
+
}, le = async (i, e, s, c) => {
|
|
258
|
+
const a = [], l = [];
|
|
258
259
|
let r = !1, o = !1, t = "数据验证成功", u = "待验证重复数据";
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
const f = await
|
|
260
|
+
const n = await X(i, e);
|
|
261
|
+
if (n.hasError ? (r = !0, t = "数据验证失败", n.markCells && a.push(...n.markCells), n.markHeaders && l.push(...n.markHeaders)) : e && Object.keys(e).length > 0 && (t = "数据验证通过"), s && s.length > 0) {
|
|
262
|
+
const f = await Z(i, s, c);
|
|
262
263
|
f.hasError ? (o = !0, u = "检测到重复数据", f.markCells && f.markCells.forEach((h) => {
|
|
263
264
|
const w = a.find(
|
|
264
|
-
(
|
|
265
|
+
(p) => p.row === h.row && p.col === h.col
|
|
265
266
|
);
|
|
266
267
|
w ? w.color = "8B0000" : a.push(h);
|
|
267
|
-
}), f.markHeaders &&
|
|
268
|
+
}), f.markHeaders && l.push(...f.markHeaders)) : u = "重复性检验通过";
|
|
268
269
|
}
|
|
269
270
|
if (r || o) {
|
|
270
|
-
const f = await
|
|
271
|
+
const f = await Q(
|
|
271
272
|
i,
|
|
272
273
|
{
|
|
273
274
|
markCells: a,
|
|
274
|
-
markHeaders:
|
|
275
|
+
markHeaders: l
|
|
275
276
|
},
|
|
276
277
|
"validation_errors.xlsx"
|
|
277
278
|
);
|
|
@@ -294,15 +295,15 @@ const j = (i) => {
|
|
|
294
295
|
hasFormatError: !1,
|
|
295
296
|
hasDuplicateError: !1
|
|
296
297
|
};
|
|
297
|
-
},
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
const a = await
|
|
301
|
-
if (!
|
|
298
|
+
}, ie = async (i, e, s) => {
|
|
299
|
+
const c = i.originFileObj;
|
|
300
|
+
if (c) {
|
|
301
|
+
const a = await c.arrayBuffer(), l = await x(a);
|
|
302
|
+
if (!l) {
|
|
302
303
|
m.error("上传的文件不是Excel文件");
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
|
-
const { headers: r, excelRows: o, excelData: t } =
|
|
306
|
+
const { headers: r, excelRows: o, excelData: t } = l;
|
|
306
307
|
s && s.length > 0 ? s.forEach((u) => {
|
|
307
308
|
switch (u) {
|
|
308
309
|
case "Headers":
|
|
@@ -317,15 +318,15 @@ const j = (i) => {
|
|
|
317
318
|
}
|
|
318
319
|
}) : (e.Headers = r, e.RawRows = o, e.Records = t);
|
|
319
320
|
}
|
|
320
|
-
},
|
|
321
|
+
}, I = { class: "absolute z-[9999] w-full h-full top-0 flex flex-flow row items-center justify-center" }, ue = /* @__PURE__ */ _({
|
|
321
322
|
__name: "index",
|
|
322
323
|
setup(i) {
|
|
323
|
-
const e =
|
|
324
|
-
return (s,
|
|
325
|
-
|
|
324
|
+
const e = B();
|
|
325
|
+
return (s, c) => (b(), A("div", I, [
|
|
326
|
+
O(v(K), S({ style: { "margin-top": "-10%" } }, v(e)), null, 16)
|
|
326
327
|
]));
|
|
327
328
|
}
|
|
328
|
-
}),
|
|
329
|
+
}), fe = /* @__PURE__ */ _({
|
|
329
330
|
__name: "index",
|
|
330
331
|
props: {
|
|
331
332
|
icon: {},
|
|
@@ -339,21 +340,21 @@ const j = (i) => {
|
|
|
339
340
|
info: "#1890ff",
|
|
340
341
|
warning: "#faad14",
|
|
341
342
|
error: "#ff4d4f"
|
|
342
|
-
},
|
|
343
|
+
}, c = {
|
|
343
344
|
success: "icon-success-fill",
|
|
344
345
|
info: "icon-info-fill",
|
|
345
346
|
warning: "icon-warn-fill",
|
|
346
347
|
error: "icon-error-fill"
|
|
347
|
-
}, a = E(() => e.type || "info"),
|
|
348
|
-
return (u,
|
|
348
|
+
}, a = E(() => e.type || "info"), l = E(() => s[a.value]), r = E(() => c[a.value]), o = Math.random().toString(36).substring(2, 9), t = E(() => `${o}-${a.value}-${r.value}`);
|
|
349
|
+
return (u, n) => (b(), R(v(P), S({
|
|
349
350
|
"show-icon": u.showIcon,
|
|
350
351
|
type: u.type,
|
|
351
352
|
message: u.message
|
|
352
353
|
}, u.$attrs), {
|
|
353
|
-
icon:
|
|
354
|
-
(b(),
|
|
354
|
+
icon: L(() => [
|
|
355
|
+
(b(), R(W, {
|
|
355
356
|
icon: r.value,
|
|
356
|
-
style:
|
|
357
|
+
style: N({ color: l.value }),
|
|
357
358
|
key: t.value
|
|
358
359
|
}, null, 8, ["icon", "style"]))
|
|
359
360
|
]),
|
|
@@ -362,19 +363,19 @@ const j = (i) => {
|
|
|
362
363
|
}
|
|
363
364
|
});
|
|
364
365
|
export {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
366
|
+
fe as _,
|
|
367
|
+
Z as a,
|
|
368
|
+
ie as b,
|
|
369
|
+
q as c,
|
|
370
|
+
Q as d,
|
|
371
|
+
D as e,
|
|
372
|
+
j as f,
|
|
373
|
+
J as g,
|
|
374
|
+
ue as h,
|
|
375
|
+
le as i,
|
|
376
|
+
ce as j,
|
|
377
|
+
G as n,
|
|
377
378
|
x as p,
|
|
378
379
|
g as t,
|
|
379
|
-
|
|
380
|
+
X as v
|
|
380
381
|
};
|
|
@@ -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-DVzBH6zL.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-Bh2SzZzX.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-Y7Lpx2Hb.js";
|
|
4
4
|
const C = /* @__PURE__ */ d({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as x, createBlock as h, createCommentVNode as I, openBlock as u, unref as t, mergeProps as C, useAttrs as
|
|
2
|
-
import { a as w, _ as b } from "./toolIcon-
|
|
3
|
-
import { c as D,
|
|
1
|
+
import { defineComponent as x, createBlock as h, createCommentVNode as I, openBlock as u, unref as t, mergeProps as C, useAttrs as W, computed as j, ref as y, watch as k, withCtx as d, createElementBlock as g, normalizeStyle as T, createElementVNode as m, inject as q, onMounted as N, createVNode as l, toDisplayString as $, Fragment as L, createTextVNode as K, reactive as J, nextTick as Y, renderList as G, withModifiers as Q } from "vue";
|
|
2
|
+
import { a as w, _ as b } from "./toolIcon-Y7Lpx2Hb.js";
|
|
3
|
+
import { c as D, T as E, ag as P, W as U, V as M, u as F, a as V, U as X, r as H, ae as z } from "./uploadList-Bh2SzZzX.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";
|
|
@@ -272,7 +272,7 @@ const le = /* @__PURE__ */ x({
|
|
|
272
272
|
"update:iconIndex"
|
|
273
273
|
],
|
|
274
274
|
setup(c, { emit: s }) {
|
|
275
|
-
const i =
|
|
275
|
+
const i = W(), e = c, r = s, a = j(() => {
|
|
276
276
|
if (Array.isArray(e.size)) return e.size;
|
|
277
277
|
{
|
|
278
278
|
let o = e.size;
|
|
@@ -302,7 +302,7 @@ const le = /* @__PURE__ */ x({
|
|
|
302
302
|
const S = (o) => {
|
|
303
303
|
if (o.stopPropagation(), e.clickEvent) {
|
|
304
304
|
const v = e.clickEvent.split("#");
|
|
305
|
-
v.length === 2 &&
|
|
305
|
+
v.length === 2 && q("$" + v[0]).$emit(v[1], e.data);
|
|
306
306
|
}
|
|
307
307
|
e.autoSwitch && e.icons.length > 0 && (p.value = (p.value + 1) % e.icons.length, n.value = e.icons[f.value]), r("click");
|
|
308
308
|
}, _ = () => {
|
|
@@ -446,7 +446,7 @@ const le = /* @__PURE__ */ x({
|
|
|
446
446
|
__name: "headerExits",
|
|
447
447
|
setup(c) {
|
|
448
448
|
const s = F(), i = y(!1), e = () => {
|
|
449
|
-
i.value = !1, R.value ? R.value.userLogout() : s.logout();
|
|
449
|
+
i.value = !1, R.value ? R.value.userLogout() : s.logout(!0);
|
|
450
450
|
};
|
|
451
451
|
return (r, a) => (u(), g(L, null, [
|
|
452
452
|
l(t(w), { title: "退出平台" }, {
|
|
@@ -562,7 +562,7 @@ const le = /* @__PURE__ */ x({
|
|
|
562
562
|
routes: {}
|
|
563
563
|
},
|
|
564
564
|
setup(c) {
|
|
565
|
-
const s = c, i = y([]), e = y([]), r =
|
|
565
|
+
const s = c, i = y([]), e = y([]), r = J([]), a = P(), n = (_) => {
|
|
566
566
|
z().push(_.key.toString());
|
|
567
567
|
}, f = V(), p = y([]), S = () => {
|
|
568
568
|
let _ = a.TabActive;
|
|
@@ -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-Bh2SzZzX.js";
|
|
5
5
|
const T = /* @__PURE__ */ i({
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|