@skyfox2000/webui 1.3.6 → 1.3.8
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-DhPgqGdk.js → file-upload-D7ysapQL.js} +1 -1
- package/lib/assets/modules/{index-02J2AYth.js → index-BiXvleeT.js} +2 -2
- package/lib/assets/modules/{index-CCpTizF9.js → index-_foSmXoy.js} +1 -1
- package/lib/assets/modules/{index-C31q4LHC.js → index-tow3C94d.js} +2 -2
- package/lib/assets/modules/{menuTabs-DyhSKN9r.js → menuTabs-CmB2d0Wh.js} +2 -2
- package/lib/assets/modules/{toolIcon-CqM4gBIc.js → toolIcon-IR6jQE0h.js} +1 -1
- package/lib/assets/modules/{uploadList-ZajZKqaS.js → uploadList-BNx4hnQX.js} +4 -4
- package/lib/assets/modules/{uploadList-DAVjJkqz.js → uploadList-DoiSzbHZ.js} +527 -514
- 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 +124 -126
- package/lib/es/UploadForm/index.js +4 -4
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +14 -14
- package/package.json +2 -2
- package/src/components/content/dialog/excelForm.vue +0 -6
- package/src/components/form/autoComplete/index.vue +3 -10
- package/src/components/form/select/index.vue +48 -24
- package/src/utils/data.ts +10 -1
- package/src/utils/excel-preview.ts +2 -1
|
@@ -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-
|
|
3
|
+
import { _ as q } from "../../assets/modules/toolIcon-IR6jQE0h.js";
|
|
4
4
|
import "@skyfox2000/fapi";
|
|
5
|
-
import "../../assets/modules/uploadList-
|
|
5
|
+
import "../../assets/modules/uploadList-DoiSzbHZ.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-
|
|
10
|
+
import { _ as D } from "../../assets/modules/index-tow3C94d.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,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as y, ref as I, watch as C, onMounted as g, resolveComponent as b, createBlock as n, openBlock as o, unref as e, withCtx as l, createCommentVNode as c, createVNode as r, createElementVNode as u, createElementBlock as k, toDisplayString as w, normalizeClass as S, KeepAlive as N, resolveDynamicComponent as $ } from "vue";
|
|
2
2
|
import { Layout as f, LayoutSider as E } from "ant-design-vue";
|
|
3
|
-
import { a as z } from "../../assets/modules/toolIcon-
|
|
4
|
-
import { I as A, _ as B, f as L, d as V, g as D } from "../../assets/modules/menuTabs-
|
|
5
|
-
import { ad as j, a as K, af as M } from "../../assets/modules/uploadList-
|
|
3
|
+
import { a as z } from "../../assets/modules/toolIcon-IR6jQE0h.js";
|
|
4
|
+
import { I as A, _ as B, f as L, d as V, g as D } from "../../assets/modules/menuTabs-CmB2d0Wh.js";
|
|
5
|
+
import { ad as j, a as K, af as M } from "../../assets/modules/uploadList-DoiSzbHZ.js";
|
|
6
6
|
import "@skyfox2000/microbase";
|
|
7
7
|
import "@skyfox2000/fapi";
|
|
8
8
|
import P from "vue-m-message";
|
package/lib/es/Error403/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { r as s } from "../../assets/modules/uploadList-DoiSzbHZ.js";
|
|
3
3
|
import "@skyfox2000/microbase";
|
|
4
4
|
import "@skyfox2000/fapi";
|
|
5
5
|
import "vue-m-message";
|
package/lib/es/Error404/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { r as s } from "../../assets/modules/uploadList-DoiSzbHZ.js";
|
|
3
3
|
import "@skyfox2000/microbase";
|
|
4
4
|
import "@skyfox2000/fapi";
|
|
5
5
|
import "vue-m-message";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as we, ref as
|
|
2
|
-
import { _ as Y } from "../../assets/modules/index-
|
|
3
|
-
import { Modal as Fe, Upload as
|
|
1
|
+
import { defineComponent as we, ref as c, computed as U, watch as W, onMounted as be, createBlock as H, openBlock as v, unref as i, withCtx as T, renderSlot as J, createElementBlock as x, createCommentVNode as K, createElementVNode as g, createVNode as C, createTextVNode as X, toDisplayString as S, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
|
|
2
|
+
import { _ as Y } from "../../assets/modules/index-_foSmXoy.js";
|
|
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 { E as Te, a1 as Se, a7 as Ee } from "../../assets/modules/uploadList-
|
|
6
|
-
import { A as Re, p as De, U as
|
|
5
|
+
import { E as Te, a1 as Se, a7 as Ee } from "../../assets/modules/uploadList-DoiSzbHZ.js";
|
|
6
|
+
import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-D7ysapQL.js";
|
|
7
7
|
import "@skyfox2000/microbase";
|
|
8
|
-
import
|
|
9
|
-
import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-
|
|
8
|
+
import f from "vue-m-message";
|
|
9
|
+
import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-BiXvleeT.js";
|
|
10
10
|
import "dayjs";
|
|
11
11
|
import "vue-draggable-next";
|
|
12
12
|
import "async-validator";
|
|
13
13
|
import Ve from "@vue-office/excel";
|
|
14
|
-
const Be = (
|
|
15
|
-
`), Me = (
|
|
16
|
-
const e = await ke(
|
|
14
|
+
const Be = (l) => l.includes(",") || l.includes(`
|
|
15
|
+
`), Me = (l, s) => l === "text/csv" || (s == null ? void 0 : s.toLowerCase().includes(".csv")) || !1, ze = (l, s) => l === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l === "application/vnd.ms-excel" || (s == null ? void 0 : s.toLowerCase().match(/\.(xlsx|xls)$/)) !== null, ee = async (l, s = "preview.csv") => {
|
|
16
|
+
const e = await ke(l, s);
|
|
17
17
|
if (e.success)
|
|
18
18
|
return {
|
|
19
19
|
success: !0,
|
|
@@ -21,16 +21,16 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
21
21
|
fileName: e.fileName
|
|
22
22
|
};
|
|
23
23
|
throw new Error(e.error || "CSV格式处理失败");
|
|
24
|
-
}, ae = (
|
|
24
|
+
}, ae = (l, s, e = "预览文件.xlsx") => ({
|
|
25
25
|
success: !0,
|
|
26
|
-
blobUrl: `data:${s || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};base64,${
|
|
26
|
+
blobUrl: `data:${s || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};base64,${l}`,
|
|
27
27
|
fileName: e
|
|
28
|
-
}), ve = async (
|
|
28
|
+
}), ve = async (l, s = !1) => {
|
|
29
29
|
if (s) {
|
|
30
|
-
if (typeof
|
|
31
|
-
return Be(
|
|
32
|
-
if (
|
|
33
|
-
const e = new Blob([
|
|
30
|
+
if (typeof l == "string")
|
|
31
|
+
return Be(l) ? await ee(l) : ae(l);
|
|
32
|
+
if (l instanceof ArrayBuffer || l instanceof Uint8Array) {
|
|
33
|
+
const e = new Blob([l], {
|
|
34
34
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
@@ -41,40 +41,40 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
41
41
|
} else
|
|
42
42
|
throw new Error("不支持的原始文件格式");
|
|
43
43
|
}
|
|
44
|
-
if (
|
|
45
|
-
return Me(
|
|
46
|
-
if (
|
|
44
|
+
if (l.Content && l.Type)
|
|
45
|
+
return Me(l.Type, l.FileName) ? await ee(l.Content, l.FileName || "preview.csv") : ze(l.Type, l.FileName) ? ae(l.Content, l.Type, l.FileName || "预览文件.xlsx") : ae(l.Content);
|
|
46
|
+
if (l.url)
|
|
47
47
|
return {
|
|
48
48
|
success: !0,
|
|
49
|
-
blobUrl:
|
|
50
|
-
fileName:
|
|
49
|
+
blobUrl: l.url,
|
|
50
|
+
fileName: l.fileName || "预览文件.xlsx"
|
|
51
51
|
};
|
|
52
|
-
if (typeof
|
|
53
|
-
return await ee(
|
|
52
|
+
if (typeof l == "string")
|
|
53
|
+
return await ee(l);
|
|
54
54
|
throw new Error("不支持的文件格式");
|
|
55
|
-
}, Pe = async (
|
|
56
|
-
if (!
|
|
57
|
-
|
|
55
|
+
}, Pe = async (l, s) => {
|
|
56
|
+
if (!l || !s)
|
|
57
|
+
return f.error("预览URL或Excel控制器未配置"), { success: !1 };
|
|
58
58
|
try {
|
|
59
59
|
let e = null;
|
|
60
|
-
if (
|
|
60
|
+
if (l.method === "GET") {
|
|
61
61
|
const a = {
|
|
62
|
-
...
|
|
62
|
+
...l,
|
|
63
63
|
method: "GET",
|
|
64
|
-
api:
|
|
65
|
-
authorize:
|
|
64
|
+
api: l.api || s.page.api,
|
|
65
|
+
authorize: l.authorize ?? s.page.authorize
|
|
66
66
|
};
|
|
67
67
|
e = await Ue(a);
|
|
68
68
|
} else {
|
|
69
|
-
const a =
|
|
69
|
+
const a = l.params;
|
|
70
70
|
e = await Te(s, {
|
|
71
|
-
url:
|
|
71
|
+
url: l,
|
|
72
72
|
urlKey: "preview",
|
|
73
73
|
params: a,
|
|
74
74
|
hideErrorToast: !0
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
if (
|
|
77
|
+
if (l.raw)
|
|
78
78
|
return await ve(e, !0);
|
|
79
79
|
if ((e == null ? void 0 : e.status) === fe.SUCCESS && e.data) {
|
|
80
80
|
const a = e.data;
|
|
@@ -82,7 +82,7 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
82
82
|
} else
|
|
83
83
|
throw new Error((e == null ? void 0 : e.msg) || "文件加载失败");
|
|
84
84
|
} catch (e) {
|
|
85
|
-
throw console.error("预览文件加载错误:", e),
|
|
85
|
+
throw console.error("预览文件加载错误:", e), f.error("文件加载失败:" + ((e == null ? void 0 : e.message) || "未知错误")), e;
|
|
86
86
|
}
|
|
87
87
|
}, $e = {
|
|
88
88
|
key: 0,
|
|
@@ -119,8 +119,8 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
119
119
|
previewUrl: {},
|
|
120
120
|
fileType: {}
|
|
121
121
|
},
|
|
122
|
-
setup(
|
|
123
|
-
const e =
|
|
122
|
+
setup(l, { expose: s }) {
|
|
123
|
+
const e = l, a = e.excelCtrl, m = c(!1), w = c(""), le = c([]), y = c(""), P = U(() => !!e.previewUrl), te = U(() => e.enableUpload), de = U(() => {
|
|
124
124
|
switch (e.fileType || "both") {
|
|
125
125
|
case "excel":
|
|
126
126
|
return ".xlsx,.xls";
|
|
@@ -140,7 +140,7 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
140
140
|
default:
|
|
141
141
|
return "请选择Excel或CSV文件";
|
|
142
142
|
}
|
|
143
|
-
}), V =
|
|
143
|
+
}), V = c("待验证数据规则"), E = c("warning"), $ = c("待验证重复数据"), B = c("warning");
|
|
144
144
|
W(
|
|
145
145
|
() => a.visible.value,
|
|
146
146
|
() => {
|
|
@@ -158,23 +158,21 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
158
158
|
},
|
|
159
159
|
{ deep: !0 }
|
|
160
160
|
);
|
|
161
|
-
const F =
|
|
162
|
-
var
|
|
163
|
-
return (
|
|
161
|
+
const F = c(e.uploadParams), R = U(() => {
|
|
162
|
+
var t;
|
|
163
|
+
return (t = F.value) == null ? void 0 : t.uploadUrl;
|
|
164
164
|
}), M = U(() => {
|
|
165
|
-
var
|
|
166
|
-
return (
|
|
165
|
+
var t;
|
|
166
|
+
return (t = F.value) == null ? void 0 : t.duplicateRules;
|
|
167
167
|
}), D = U(() => {
|
|
168
|
-
var
|
|
169
|
-
return (
|
|
168
|
+
var t;
|
|
169
|
+
return (t = F.value) == null ? void 0 : t.duplicateUrl;
|
|
170
170
|
}), I = async () => {
|
|
171
171
|
if (!(!e.previewUrl || !a)) {
|
|
172
172
|
a.isFormLoading.value = !0;
|
|
173
173
|
try {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
} catch (l) {
|
|
177
|
-
console.error("预览文件加载错误:", l), c.error("文件加载失败:" + ((l == null ? void 0 : l.message) || "未知错误"));
|
|
174
|
+
const t = await Pe(e.previewUrl, a);
|
|
175
|
+
t.success && (w.value = t.blobUrl, y.value = t.fileName);
|
|
178
176
|
} finally {
|
|
179
177
|
setTimeout(() => {
|
|
180
178
|
a.isFormLoading.value = !1;
|
|
@@ -182,30 +180,30 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
182
180
|
}
|
|
183
181
|
}
|
|
184
182
|
}, me = async () => {
|
|
185
|
-
var
|
|
183
|
+
var o;
|
|
186
184
|
F.value = e.uploadParams;
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
-
|
|
185
|
+
const t = R.value;
|
|
186
|
+
if (!t) {
|
|
187
|
+
f.error("未配置文件上传地址!");
|
|
190
188
|
return;
|
|
191
189
|
}
|
|
192
190
|
if (_.value) {
|
|
193
|
-
|
|
191
|
+
f.error("表格数据存在验证错误,请修正后再上传!");
|
|
194
192
|
return;
|
|
195
193
|
}
|
|
196
194
|
a.isFormSaving.value = !0;
|
|
197
195
|
try {
|
|
198
196
|
if (!L.value || !y.value) {
|
|
199
|
-
|
|
197
|
+
f.warning("请先选择文件!"), a.isFormSaving.value = !1;
|
|
200
198
|
return;
|
|
201
199
|
}
|
|
202
|
-
const r = new Re(
|
|
200
|
+
const r = new Re(t, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", n = new File([L.value], y.value, {
|
|
203
201
|
type: u
|
|
204
|
-
}), d = De.join(((
|
|
202
|
+
}), d = De.join(((o = F.value) == null ? void 0 : o.basePath) ?? "", y.value), p = {
|
|
205
203
|
uid: "1",
|
|
206
204
|
name: y.value,
|
|
207
|
-
originFileObj:
|
|
208
|
-
status:
|
|
205
|
+
originFileObj: n,
|
|
206
|
+
status: ce.Uploading,
|
|
209
207
|
percent: 0,
|
|
210
208
|
params: {
|
|
211
209
|
FileKey: d
|
|
@@ -213,18 +211,18 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
213
211
|
}, b = new AbortController();
|
|
214
212
|
(await r.uploadFile(p, b.signal, (h) => {
|
|
215
213
|
p.percent = h;
|
|
216
|
-
})).status ===
|
|
214
|
+
})).status === ce.Success && (f.success("文件上传成功,开始业务处理!"), ye(p));
|
|
217
215
|
} catch (r) {
|
|
218
|
-
console.error("上传处理错误:", r),
|
|
216
|
+
console.error("上传处理错误:", r), f.error("上传处理失败:" + ((r == null ? void 0 : r.message) || "未知错误"));
|
|
219
217
|
} finally {
|
|
220
218
|
a.isFormSaving.value = !1;
|
|
221
219
|
}
|
|
222
|
-
}, ye = async (
|
|
220
|
+
}, ye = async (t) => {
|
|
223
221
|
if (a.formData.value) {
|
|
224
222
|
if (e.excelRecordsKey || e.excelRowsKey) {
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
const { excelData: d, excelRows: p } =
|
|
223
|
+
const n = await Ne(L.value);
|
|
224
|
+
if (!n) return null;
|
|
225
|
+
const { excelData: d, excelRows: p } = n, b = d.map((N) => {
|
|
228
226
|
var Q;
|
|
229
227
|
const h = {};
|
|
230
228
|
for (const O in N) {
|
|
@@ -235,8 +233,8 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
235
233
|
});
|
|
236
234
|
e.excelRecordsKey && (a.formData.value[e.excelRecordsKey] = b), e.excelRowsKey && (a.formData.value[e.excelRowsKey] = p);
|
|
237
235
|
}
|
|
238
|
-
const
|
|
239
|
-
a.formData.value[
|
|
236
|
+
const o = e.fileField ?? "FileInfo";
|
|
237
|
+
a.formData.value[o] = t;
|
|
240
238
|
const r = {};
|
|
241
239
|
a.primaryKey && a.formData.value[a.primaryKey] !== void 0 && (r[a.primaryKey] = a.formData.value[a.primaryKey]);
|
|
242
240
|
const u = {
|
|
@@ -249,31 +247,31 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
249
247
|
return;
|
|
250
248
|
a.isFormSaving.value = !0;
|
|
251
249
|
try {
|
|
252
|
-
const
|
|
250
|
+
const n = await Ee(e.excelCtrl, {
|
|
253
251
|
params: u,
|
|
254
252
|
urlKey: "save",
|
|
255
253
|
url: e.excelCtrl.saveUrl
|
|
256
254
|
});
|
|
257
|
-
(
|
|
258
|
-
} catch (
|
|
259
|
-
console.error("保存错误:",
|
|
255
|
+
(n == null ? void 0 : n.status) === fe.SUCCESS && (a.afterSave && a.afterSave(), a.visible.value = !1);
|
|
256
|
+
} catch (n) {
|
|
257
|
+
console.error("保存错误:", n), f.error("数据保存失败,请稍后再试!");
|
|
260
258
|
} finally {
|
|
261
259
|
a.isFormSaving.value = !1;
|
|
262
260
|
}
|
|
263
261
|
}
|
|
264
|
-
}, _ =
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
262
|
+
}, _ = c(!1), k = c(!1), L = c(null), q = c(""), re = async (t) => {
|
|
263
|
+
const o = e.gridCtrl;
|
|
264
|
+
if (o) {
|
|
267
265
|
F.value = e.uploadParams;
|
|
268
266
|
try {
|
|
269
|
-
D.value && (D.value.api || (D.value.api =
|
|
267
|
+
D.value && (D.value.api || (D.value.api = o.page.api), D.value.authorize === void 0 && (D.value.authorize = o.page.authorize));
|
|
270
268
|
const {
|
|
271
269
|
hasError: r,
|
|
272
270
|
errBlob: u,
|
|
273
|
-
validationMsg:
|
|
271
|
+
validationMsg: n,
|
|
274
272
|
duplicateMsg: d
|
|
275
|
-
} = await Ke(
|
|
276
|
-
if (V.value =
|
|
273
|
+
} = await Ke(t, a.formRules.value, M.value, D.value);
|
|
274
|
+
if (V.value = n, $.value = d, r) {
|
|
277
275
|
if (u) {
|
|
278
276
|
_.value = !0, k.value = !0, E.value = "error", B.value = "error";
|
|
279
277
|
const p = URL.createObjectURL(u);
|
|
@@ -285,15 +283,15 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
285
283
|
V.value = "验证异常", $.value = "验证异常", E.value = "error", B.value = "error";
|
|
286
284
|
}
|
|
287
285
|
}
|
|
288
|
-
}, xe = async (
|
|
286
|
+
}, xe = async (t) => {
|
|
289
287
|
if (!e.gridCtrl) {
|
|
290
|
-
|
|
288
|
+
f.error("未配置表格控制器!");
|
|
291
289
|
return;
|
|
292
290
|
}
|
|
293
291
|
F.value = e.uploadParams;
|
|
294
|
-
const r =
|
|
292
|
+
const r = t.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || t.type === "application/vnd.ms-excel", u = t.type === "text/csv" || t.name.toLowerCase().endsWith(".csv"), n = e.fileType || "both";
|
|
295
293
|
let d = !1, p = "";
|
|
296
|
-
switch (
|
|
294
|
+
switch (n) {
|
|
297
295
|
case "excel":
|
|
298
296
|
d = r, p = "只能上传Excel文件!";
|
|
299
297
|
break;
|
|
@@ -306,35 +304,35 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
306
304
|
break;
|
|
307
305
|
}
|
|
308
306
|
if (!d)
|
|
309
|
-
return
|
|
307
|
+
return f.error(p), ue.LIST_IGNORE;
|
|
310
308
|
try {
|
|
311
|
-
if (j(), y.value =
|
|
312
|
-
const h = await
|
|
309
|
+
if (j(), y.value = t.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
|
|
310
|
+
const h = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(h), { csvToExcelView: G } = await import("../../assets/modules/index-BiXvleeT.js").then((he) => he.j), z = await G(O, t.name);
|
|
313
311
|
if (!z.success)
|
|
314
312
|
throw new Error(z.error || "CSV文件处理失败");
|
|
315
313
|
const oe = await (await fetch(z.blobUrl)).arrayBuffer();
|
|
316
314
|
return L.value = oe, await re(oe), !_.value && !k.value && (w.value = z.blobUrl), y.value = z.fileName, a.isFormLoading.value = !1, !1;
|
|
317
315
|
}
|
|
318
|
-
const b = await
|
|
316
|
+
const b = await t.arrayBuffer();
|
|
319
317
|
L.value = b;
|
|
320
318
|
const N = new FileReader();
|
|
321
|
-
N.readAsDataURL(
|
|
322
|
-
h.target ? (await re(b), !_.value && !k.value && (w.value = h.target.result), a.isFormLoading.value = !1) :
|
|
319
|
+
N.readAsDataURL(t), N.onload = async (h) => {
|
|
320
|
+
h.target ? (await re(b), !_.value && !k.value && (w.value = h.target.result), a.isFormLoading.value = !1) : f.error("加载文件失败,请检查文件格式!");
|
|
323
321
|
};
|
|
324
322
|
} catch (b) {
|
|
325
|
-
console.error("文件处理错误:", b),
|
|
323
|
+
console.error("文件处理错误:", b), f.error("文件处理失败,请检查文件格式!"), a.isFormLoading.value = !1, V.value = "文件处理错误", E.value = "error";
|
|
326
324
|
}
|
|
327
325
|
return !1;
|
|
328
326
|
}, A = Se(a.formRules.value);
|
|
329
327
|
be(() => {
|
|
330
|
-
var
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
328
|
+
var o;
|
|
329
|
+
const t = (o = e.gridCtrl) == null ? void 0 : o.page;
|
|
330
|
+
if (t && !P.value) {
|
|
333
331
|
if (!R.value) {
|
|
334
|
-
|
|
332
|
+
f.error("未配置文件上传地址!");
|
|
335
333
|
return;
|
|
336
334
|
}
|
|
337
|
-
R.value.api || (R.value.api =
|
|
335
|
+
R.value.api || (R.value.api = t.api), R.value.authorize === void 0 && (R.value.authorize = t.authorize);
|
|
338
336
|
for (const r in a.formData.value)
|
|
339
337
|
e.gridCtrl.rowData.value && (a.formData.value[r] = e.gridCtrl.rowData.value[r]);
|
|
340
338
|
}
|
|
@@ -342,8 +340,8 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
342
340
|
});
|
|
343
341
|
const j = () => {
|
|
344
342
|
if (w.value = "", y.value = "", le.value = [], L.value = null, q.value = "", a.isFormLoading.value = !1, V.value = "待验证数据规则", E.value = "warning", $.value = "待验证重复数据", B.value = "warning", _.value = !1, k.value = !1, a.formData.value) {
|
|
345
|
-
const
|
|
346
|
-
delete a.formData.value[
|
|
343
|
+
const t = e.fileField ?? "FileInfo", o = e.excelRecordsKey, r = e.excelRowsKey;
|
|
344
|
+
delete a.formData.value[t], o && delete a.formData.value[o], r && delete a.formData.value[r];
|
|
347
345
|
}
|
|
348
346
|
}, se = () => {
|
|
349
347
|
a.visible.value = !1;
|
|
@@ -351,34 +349,34 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
351
349
|
};
|
|
352
350
|
return s({
|
|
353
351
|
clearAll: j
|
|
354
|
-
}), (
|
|
355
|
-
title:
|
|
352
|
+
}), (t, o) => (v(), H(i(Fe), {
|
|
353
|
+
title: t.title ?? "文件上传",
|
|
356
354
|
open: m.value,
|
|
357
|
-
"onUpdate:open":
|
|
358
|
-
wrapClassName: ["modal", "mx-auto",
|
|
355
|
+
"onUpdate:open": o[0] || (o[0] = (r) => m.value = r),
|
|
356
|
+
wrapClassName: ["modal", "mx-auto", t.$attrs.width ? "w-[" + t.$attrs.width + "]" : ""].join(" "),
|
|
359
357
|
width: 940,
|
|
360
358
|
onClose: se
|
|
361
359
|
}, {
|
|
362
360
|
footer: T(() => [
|
|
363
|
-
C(
|
|
361
|
+
C(i(_e), null, {
|
|
364
362
|
default: T(() => {
|
|
365
363
|
var r;
|
|
366
364
|
return [
|
|
367
|
-
C(
|
|
365
|
+
C(i(Y), { onClick: se }, {
|
|
368
366
|
default: T(() => [
|
|
369
|
-
X(S(
|
|
367
|
+
X(S(t.cancelText ?? (P.value ? "关闭" : "取消")), 1)
|
|
370
368
|
]),
|
|
371
369
|
_: 1
|
|
372
370
|
}),
|
|
373
|
-
P.value ? K("", !0) : (
|
|
371
|
+
P.value ? K("", !0) : (v(), H(i(Y), {
|
|
374
372
|
key: 0,
|
|
375
373
|
onClick: me,
|
|
376
374
|
type: "primary",
|
|
377
|
-
loading: ((r =
|
|
378
|
-
disabled: !w.value || _.value || k.value ||
|
|
375
|
+
loading: ((r = i(a)) == null ? void 0 : r.isFormSaving.value) ?? !1,
|
|
376
|
+
disabled: !w.value || _.value || k.value || i(a).isFormLoading.value
|
|
379
377
|
}, {
|
|
380
378
|
default: T(() => [
|
|
381
|
-
X(S(
|
|
379
|
+
X(S(t.saveText ?? "上传文件"), 1)
|
|
382
380
|
]),
|
|
383
381
|
_: 1
|
|
384
382
|
}, 8, ["loading", "disabled"]))
|
|
@@ -388,10 +386,10 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
388
386
|
})
|
|
389
387
|
]),
|
|
390
388
|
default: T(() => [
|
|
391
|
-
J(
|
|
392
|
-
P.value ? K("", !0) : (
|
|
393
|
-
J(
|
|
394
|
-
C(
|
|
389
|
+
J(t.$slots, "default"),
|
|
390
|
+
P.value ? K("", !0) : (v(), x("div", $e, [
|
|
391
|
+
J(t.$slots, "file-before"),
|
|
392
|
+
C(i(ue), {
|
|
395
393
|
"file-list": le.value,
|
|
396
394
|
"before-upload": xe,
|
|
397
395
|
accept: de.value,
|
|
@@ -399,7 +397,7 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
399
397
|
disabled: !te.value
|
|
400
398
|
}, {
|
|
401
399
|
default: T(() => [
|
|
402
|
-
C(
|
|
400
|
+
C(i(Y), {
|
|
403
401
|
type: "primary",
|
|
404
402
|
disabled: !te.value
|
|
405
403
|
}, {
|
|
@@ -411,25 +409,25 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
411
409
|
]),
|
|
412
410
|
_: 1
|
|
413
411
|
}, 8, ["file-list", "accept", "disabled"]),
|
|
414
|
-
w.value && y.value ? (
|
|
415
|
-
C(
|
|
412
|
+
w.value && y.value ? (v(), x("div", Ae, [
|
|
413
|
+
C(i(Z), {
|
|
416
414
|
message: y.value,
|
|
417
415
|
type: "info",
|
|
418
416
|
"show-icon": !1
|
|
419
417
|
}, null, 8, ["message"])
|
|
420
418
|
])) : K("", !0),
|
|
421
|
-
J(
|
|
419
|
+
J(t.$slots, "file-after")
|
|
422
420
|
])),
|
|
423
421
|
g("div", je, [
|
|
424
|
-
|
|
422
|
+
i(a).isFormLoading.value ? (v(), H(i(Le), {
|
|
425
423
|
key: 0,
|
|
426
424
|
size: "large"
|
|
427
425
|
})) : K("", !0),
|
|
428
426
|
g("div", {
|
|
429
|
-
class: Ce(["flex-shrink-0 relative border border-gray-200 rounded-md overflow-hidden", [
|
|
427
|
+
class: Ce(["flex-shrink-0 relative border border-gray-200 rounded-md overflow-hidden", [i(A).length === 0 ? "w-[100%]" : "w-[80%]"]]),
|
|
430
428
|
style: { height: "430px" }
|
|
431
429
|
}, [
|
|
432
|
-
C(
|
|
430
|
+
C(i(Ve), {
|
|
433
431
|
src: w.value,
|
|
434
432
|
onError: ge,
|
|
435
433
|
style: { width: "100%", height: "100%" },
|
|
@@ -443,31 +441,31 @@ const Be = (t) => t.includes(",") || t.includes(`
|
|
|
443
441
|
}
|
|
444
442
|
}, null, 8, ["src"])
|
|
445
443
|
], 2),
|
|
446
|
-
|
|
444
|
+
i(A).length > 0 ? (v(), x("div", Oe, [
|
|
447
445
|
g("div", Ge, [
|
|
448
|
-
|
|
449
|
-
C(
|
|
446
|
+
i(A).length === 0 ? (v(), x("div", Ie, "没有设置验证规则")) : (v(), x("div", qe, [
|
|
447
|
+
C(i(Z), {
|
|
450
448
|
message: V.value,
|
|
451
449
|
type: E.value,
|
|
452
450
|
"show-icon": "",
|
|
453
451
|
class: "mb-2"
|
|
454
452
|
}, null, 8, ["message", "type"]),
|
|
455
453
|
g("div", Qe, [
|
|
456
|
-
(
|
|
454
|
+
(v(!0), x(ie, null, ne(i(A), (r, u) => (v(), x("div", {
|
|
457
455
|
key: u,
|
|
458
456
|
class: "border-b pb-0"
|
|
459
457
|
}, [
|
|
460
458
|
g("div", We, S(r.field), 1),
|
|
461
459
|
g("ul", He, [
|
|
462
|
-
(
|
|
460
|
+
(v(!0), x(ie, null, ne(r.rules, (n, d) => (v(), x("li", {
|
|
463
461
|
key: d,
|
|
464
462
|
class: "text-[12px] text-gray-600"
|
|
465
|
-
}, S(
|
|
463
|
+
}, S(n), 1))), 128))
|
|
466
464
|
])
|
|
467
465
|
]))), 128))
|
|
468
466
|
]),
|
|
469
|
-
M.value && M.value.length > 0 ? (
|
|
470
|
-
C(
|
|
467
|
+
M.value && M.value.length > 0 ? (v(), x("div", Je, [
|
|
468
|
+
C(i(Z), {
|
|
471
469
|
message: $.value,
|
|
472
470
|
type: B.value,
|
|
473
471
|
"show-icon": "",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as y, ref as f, watch as S, onMounted as z, createBlock as D, openBlock as F, unref as u, withCtx as s, createVNode as m, createTextVNode as C } from "vue";
|
|
2
|
-
import { _ as c } from "../../assets/modules/index-
|
|
2
|
+
import { _ as c } from "../../assets/modules/index-_foSmXoy.js";
|
|
3
3
|
import { Modal as _, Space as k } from "ant-design-vue";
|
|
4
4
|
import { ResStatus as E } from "@skyfox2000/fapi";
|
|
5
|
-
import { a3 as h } from "../../assets/modules/uploadList-
|
|
5
|
+
import { a3 as h } from "../../assets/modules/uploadList-DoiSzbHZ.js";
|
|
6
6
|
import "@skyfox2000/microbase";
|
|
7
7
|
import L from "vue-m-message";
|
|
8
8
|
import "async-validator";
|
|
9
9
|
import "dayjs";
|
|
10
|
-
import { A as N } from "../../assets/modules/file-upload-
|
|
10
|
+
import { A as N } from "../../assets/modules/file-upload-D7ysapQL.js";
|
|
11
11
|
import "vue-draggable-next";
|
|
12
|
-
import { U as B } from "../../assets/modules/uploadList-
|
|
12
|
+
import { U as B } from "../../assets/modules/uploadList-BNx4hnQX.js";
|
|
13
13
|
const K = /* @__PURE__ */ y({
|
|
14
14
|
__name: "uploadForm",
|
|
15
15
|
props: {
|