@skyfox2000/webui 1.2.1 → 1.2.3

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.
@@ -1,232 +1,31 @@
1
- import { defineComponent as te, ref as E, watch as P, onMounted as ae, createBlock as le, openBlock as N, unref as k, withCtx as T, renderSlot as re, createElementVNode as O, createVNode as L, createElementBlock as U, createCommentVNode as V, createTextVNode as H, toDisplayString as M, normalizeClass as oe, Fragment as q, renderList as G } from "vue";
2
- import { i as se, v as ie, g as ne, _ as I, b as ce } from "../../assets/modules/form-validate-CgX7aR7T.js";
3
- import { Modal as ue, Upload as Q, Alert as X, Space as fe } from "ant-design-vue";
4
- import { httpPost as ve, ResStatus as Y } from "@skyfox2000/fapi";
5
- import "../../assets/modules/settingInfo-BZakNKIN.js";
6
- import { A as de, p as pe, U as me } from "../../assets/modules/file-upload-CBUcsUnR.js";
7
- import "@skyfox2000/microbase";
8
- import b from "vue-m-message";
9
- import ge from "async-validator";
1
+ import { defineComponent as X, ref as r, watch as V, onMounted as Y, createBlock as ee, openBlock as d, unref as i, withCtx as _, renderSlot as le, createElementVNode as c, createVNode as m, createElementBlock as f, createCommentVNode as M, createTextVNode as O, toDisplayString as F, normalizeClass as ae, Fragment as P, renderList as $ } from "vue";
2
+ import { _ as A } from "../../assets/modules/index-CRKPVlgC.js";
3
+ import { Modal as te, Upload as I, Alert as G, Space as re } from "ant-design-vue";
4
+ import { ResStatus as oe } from "@skyfox2000/fapi";
5
+ import { Z as se, a4 as ie } from "../../assets/modules/pinia-8iujwf8y.js";
6
+ import "vue-draggable-next";
7
+ import n from "vue-m-message";
10
8
  import "dayjs";
11
- import "../../assets/modules/index-DmWrkTXX.js";
12
- import he from "@vue-office/excel";
13
- const K = async (C) => {
14
- const o = await import("exceljs"), a = new o.Workbook();
15
- await a.xlsx.load(C);
16
- const f = a.worksheets[0];
17
- if (!f)
18
- return b.error("Excel文件不包含工作表"), null;
19
- const s = [], y = [];
20
- return f.getRow(1).eachCell((t) => {
21
- let r = "";
22
- if (t.value !== null && t.value !== void 0)
23
- if (typeof t.value == "object")
24
- if ("richText" in t.value && Array.isArray(t.value.richText))
25
- r = t.value.richText.map((l) => l.text || "").join("");
26
- else if ("text" in t.value && typeof t.value.text == "string")
27
- r = t.value.text;
28
- else if (t.value instanceof Date)
29
- r = t.value.toLocaleDateString();
30
- else
31
- try {
32
- r = JSON.stringify(t.value);
33
- } catch {
34
- r = String(t.value);
35
- }
36
- else
37
- r = String(t.value);
38
- s.push(r);
39
- }), f.eachRow((t, r) => {
40
- if (r > 1) {
41
- const l = {};
42
- s.forEach((c, i) => {
43
- if (c) {
44
- const n = t.getCell(i + 1).value;
45
- n != null ? typeof n == "object" ? "richText" in n && Array.isArray(n.richText) ? l[c] = n.richText.map((g) => g.text || "").join("") : "text" in n && typeof n.text == "string" ? l[c] = n.text : (n instanceof Date, l[c] = n) : l[c] = n : l[c] = null;
46
- }
47
- }), y.push(l);
48
- }
49
- }), { workbook: a, worksheet: f, headers: s, excelData: y };
50
- }, Z = async (C, o) => {
51
- const a = await import("exceljs"), f = await K(C);
52
- if (!f) return { hasError: !0 };
53
- const { worksheet: s, headers: y } = f, { markCells: t, markHeaders: r } = o;
54
- if (t.length === 0 && (!r || r.length === 0))
55
- return { hasError: !1 };
56
- const l = [...y];
57
- r && r.length > 0 && r.forEach((v) => {
58
- l.includes(v) || l.push(v);
59
- });
60
- const c = new a.Workbook(), i = c.addWorksheet("Sheet1"), p = 15, n = /* @__PURE__ */ new Map();
61
- t.forEach(({ row: v, col: F, color: u }) => {
62
- const w = `${v}-${F}`;
63
- n.set(w, u || "FFFF0000");
64
- });
65
- for (let v = 0; v < l.length; v++) {
66
- const F = i.getColumn(v + 1);
67
- if (v < s.columnCount && v < y.length) {
68
- const u = s.getColumn(v + 1);
69
- u && u.width ? F.width = u.width : F.width = p;
70
- } else
71
- F.width = p;
72
- }
73
- const g = i.getRow(1);
74
- l.forEach((v, F) => {
75
- const u = g.getCell(F + 1);
76
- u.value = v;
77
- const w = F < y.length;
78
- if (w && F < s.columnCount) {
79
- const e = s.getRow(1).getCell(F + 1);
80
- e.style && (u.style = JSON.parse(JSON.stringify(e.style))), e.font && (u.font = JSON.parse(JSON.stringify(e.font))), e.alignment && (u.alignment = JSON.parse(JSON.stringify(e.alignment))), e.border && (u.border = JSON.parse(JSON.stringify(e.border))), e.numFmt && (u.numFmt = e.numFmt), e.fill && (u.fill = JSON.parse(JSON.stringify(e.fill)));
81
- }
82
- r && r.includes(v) && !w && (u.fill = {
83
- type: "pattern",
84
- pattern: "solid",
85
- fgColor: { argb: "FFFF0000" }
86
- // 红色背景
87
- }, u.font = {
88
- name: "Arial",
89
- size: 10,
90
- bold: !0,
91
- color: { argb: "FFFFFFFF" }
92
- // 白色文字
93
- });
94
- }), g.commit(), s.eachRow((v, F) => {
95
- if (F > 1) {
96
- const u = i.getRow(F);
97
- for (let w = 0; w < l.length; w++) {
98
- const e = u.getCell(w + 1);
99
- if (w < y.length && w < s.columnCount) {
100
- const h = v.getCell(w + 1);
101
- if (e.value = h.value, e.value !== null && e.value !== void 0 && typeof e.value == "object" && !("richText" in e.value) && !("formula" in e.value) && !("hyperlink" in e.value) && !(e.value instanceof Date))
102
- try {
103
- "text" in e.value && typeof e.value.text == "string" ? e.value = e.value.text : e.value = JSON.stringify(e.value);
104
- } catch {
105
- e.value = String(e.value);
106
- }
107
- h.style && (e.style = JSON.parse(JSON.stringify(h.style))), h.font && (e.font = JSON.parse(JSON.stringify(h.font))), h.alignment && (e.alignment = JSON.parse(JSON.stringify(h.alignment))), h.border && (e.border = JSON.parse(JSON.stringify(h.border))), h.numFmt && (e.numFmt = h.numFmt), h.fill && (e.fill = JSON.parse(JSON.stringify(h.fill)));
108
- const A = `${F}-${w + 1}`;
109
- n.has(A) && (e.fill = {
110
- type: "pattern",
111
- pattern: "solid",
112
- fgColor: { argb: n.get(A) }
113
- });
114
- } else
115
- e.value = null;
116
- }
117
- v.height && (u.height = v.height), v.outlineLevel && (u.outlineLevel = v.outlineLevel), u.commit();
118
- }
119
- });
120
- const J = await c.xlsx.writeBuffer();
121
- return { hasError: !0, errBlob: new Blob([J], {
122
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
123
- }) };
124
- }, xe = async (C, o) => {
125
- if (!o || se(o))
126
- return { hasError: !1 };
127
- const a = await K(C);
128
- if (!a) return { hasError: !0 };
129
- const { headers: f, excelData: s } = a, y = [];
130
- if (Object.keys(o).forEach((l) => {
131
- f.includes(l) || y.push(l);
132
- }), f.length === 0 || s.length === 0)
133
- return b.error("Excel文件不包含足够的数据"), { hasError: !0 };
134
- const t = new ge({});
135
- t.messages(ie.messages()), t.define(o);
136
- const r = await ye(f, s, t);
137
- if (r.length > 0 || y.length > 0) {
138
- const l = r.map((c) => ({
139
- row: c.row + 2,
140
- // 转为Excel行号(+2是因为表头占一行,且是1-based索引)
141
- col: c.col + 1,
142
- // 转为Excel列号(+1是因为是1-based索引)
143
- color: "FFFF0000"
144
- // 红色
145
- }));
146
- return Z(C, {
147
- markCells: l,
148
- markHeaders: y
149
- });
150
- }
151
- return { hasError: !1 };
152
- }, ye = async (C, o, a) => {
153
- const f = [];
154
- for (let s = 0; s < o.length; s++) {
155
- const y = o[s];
156
- try {
157
- await a.validate(y).catch(({ errors: t }) => {
158
- const r = [];
159
- t.forEach((l) => {
160
- const c = C.indexOf(l.field);
161
- c >= 0 && (r.some((p) => p.row === s && p.col === c) || r.push({
162
- row: s,
163
- col: c,
164
- header: l.field,
165
- message: l.message.replace("${label}", C[c])
166
- }));
167
- }), f.push(...r);
168
- });
169
- } catch (t) {
170
- console.error("验证表格数据时发生错误:", t), b.error("验证表格数据时发生错误:" + t);
171
- }
172
- }
173
- return f;
174
- }, we = async (C, o, a) => {
175
- if (!o || o.length === 0)
176
- return { hasError: !1 };
177
- const f = await K(C);
178
- if (!f) return { hasError: !0 };
179
- const { headers: s, excelData: y } = f, t = [];
180
- if (o.forEach((i) => {
181
- s.includes(i) || t.push(i);
182
- }), t.length > 0)
183
- return b.error(`表头缺少重复检测所需字段: ${t.join(", ")}`), { hasError: !0 };
184
- const r = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), c = new Array();
185
- if (y.forEach((i, p) => {
186
- const n = o.map((g) => i[g]).join("|");
187
- c.push(n), r.has(n) ? (l.add(p), l.add(r.get(n))) : r.set(n, p);
188
- }), a) {
189
- const i = await ve(a, {
190
- Data: c
191
- });
192
- if (i != null && i.data && i.data.forEach((p) => {
193
- l.add(p);
194
- }), (i == null ? void 0 : i.status) === Y.ERROR)
195
- throw new Error(i.msg);
196
- }
197
- if (l.size > 0) {
198
- const i = [];
199
- return l.forEach((p) => {
200
- o.forEach((n) => {
201
- const g = s.indexOf(n);
202
- g >= 0 && i.push({
203
- row: p + 2,
204
- // Excel行号 = 数组索引 + 2(表头和1-based索引)
205
- col: g + 1,
206
- // Excel列号 = 数组索引 + 1(1-based索引)
207
- color: "FFFF0000"
208
- // 红色
209
- });
210
- });
211
- }), Z(C, { markCells: i, markHeaders: t });
212
- }
213
- return { hasError: !1 };
214
- }, be = { class: "mb-4 flex items-center" }, Fe = {
9
+ import "@skyfox2000/microbase";
10
+ import { A as ue, p as ne, U as ce } from "../../assets/modules/file-upload-D5dPRmq8.js";
11
+ import { p as ve, v as de, c as fe } from "../../assets/modules/form-excel-DITF2FoK.js";
12
+ import pe from "@vue-office/excel";
13
+ const me = { class: "mb-4 flex items-center" }, xe = {
215
14
  key: 0,
216
15
  class: "ml-3 text-gray-600"
217
- }, Ee = { class: "flex gap-4" }, Ce = {
16
+ }, ge = { class: "flex gap-4" }, ye = {
218
17
  key: 0,
219
18
  class: "w-[22%] flex-grow overflow-hidden flex flex-col"
220
- }, Se = { class: "bg-gray-50 p-2 rounded border flex-grow flex flex-col" }, ke = {
19
+ }, he = { class: "bg-gray-50 p-2 rounded border flex-grow flex flex-col" }, _e = {
221
20
  key: 0,
222
21
  class: "text-gray-500"
223
- }, _e = {
22
+ }, be = {
224
23
  key: 1,
225
24
  class: "flex flex-col"
226
- }, Oe = { class: "overflow-y-auto" }, De = { class: "text-[13px] text-gray-600" }, Ne = { class: "pl-5 mt-1 mb-0" }, Je = {
25
+ }, we = { class: "overflow-y-auto" }, Ce = { class: "text-[13px] text-gray-600" }, Fe = { class: "pl-5 mt-1 mb-0" }, Ee = {
227
26
  key: 0,
228
27
  class: "mt-3"
229
- }, Ue = { class: "text-[12px] text-gray-600 p-1" }, Le = { class: "text-[13px] text-gray-600" }, Re = { class: "pl-5 mt-1 mb-0" }, Be = { class: "text-[12px] text-gray-600" }, qe = /* @__PURE__ */ te({
28
+ }, Ue = { class: "text-[12px] text-gray-600 p-1" }, Se = { class: "text-[13px] text-gray-600" }, ke = { class: "pl-5 mt-1 mb-0" }, De = { class: "text-[12px] text-gray-600" }, Pe = /* @__PURE__ */ X({
230
29
  __name: "excelForm",
231
30
  props: {
232
31
  title: {},
@@ -238,189 +37,189 @@ const K = async (C) => {
238
37
  excelBatchField: {},
239
38
  saveText: {}
240
39
  },
241
- setup(C) {
242
- const o = C, a = o.excelCtrl, f = E(!1), s = E(""), y = E([]), t = E(""), r = E(!0), l = E("待验证数据规则"), c = E("warning"), i = E("待验证重复数据"), p = E("warning");
243
- P(
244
- () => a.visible.value,
40
+ setup(Q) {
41
+ const o = Q, e = o.excelCtrl, b = r(!1), w = r(""), Z = r([]), x = r(""), E = r(!0), U = r("待验证数据规则"), S = r("warning"), k = r("待验证重复数据"), D = r("warning");
42
+ V(
43
+ () => e.visible.value,
245
44
  () => {
246
- f.value = a.visible.value;
45
+ b.value = e.visible.value;
247
46
  }
248
- ), P(
249
- () => f.value,
47
+ ), V(
48
+ () => b.value,
250
49
  () => {
251
- a.visible.value = f.value;
50
+ e.visible.value = b.value;
252
51
  }
253
52
  );
254
- const n = E(o.uploadParams), g = E(n.value.uploadUrl), J = E(n.value.duplicateRules), R = E(n.value.duplicateUrl), v = async () => {
255
- const d = g.value;
256
- if (!d) {
257
- b.error("未配置文件上传地址!");
53
+ const R = r(o.uploadParams), p = r(R.value.uploadUrl), g = r(R.value.duplicateRules), C = r(R.value.duplicateUrl), q = async () => {
54
+ const l = p.value;
55
+ if (!l) {
56
+ n.error("未配置文件上传地址!");
258
57
  return;
259
58
  }
260
- if (u.value) {
261
- b.error("表格数据存在验证错误,请修正后再上传!");
59
+ if (B.value) {
60
+ n.error("表格数据存在验证错误,请修正后再上传!");
262
61
  return;
263
62
  }
264
- a.isFormLoading.value = !0;
63
+ e.isFormLoading.value = !0;
265
64
  try {
266
- if (!e.value || !t.value) {
267
- b.warning("请先选择Excel文件!"), a.isFormLoading.value = !1;
65
+ if (!z.value || !x.value) {
66
+ n.warning("请先选择Excel文件!"), e.isFormLoading.value = !1;
268
67
  return;
269
68
  }
270
- const m = new de(d, 1), S = new File([e.value], t.value, {
69
+ const a = new ue(l, 1), s = new File([z.value], x.value, {
271
70
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
272
- }), x = pe.join(n.value.basePath, t.value), D = {
71
+ }), t = ne.join(R.value.basePath, x.value), v = {
273
72
  uid: "1",
274
- name: t.value,
275
- originFileObj: S,
276
- status: me.Uploading,
73
+ name: x.value,
74
+ originFileObj: s,
75
+ status: ce.Uploading,
277
76
  percent: 0,
278
77
  params: {
279
- FileKey: x
78
+ FileKey: t
280
79
  }
281
- }, B = new AbortController();
80
+ }, y = new AbortController();
282
81
  try {
283
- await m.uploadFile(D, B.signal, (_) => {
284
- D.percent = _;
285
- }), b.success("文件上传成功,开始业务处理!"), F(D);
286
- } catch (_) {
287
- throw console.error("文件上传错误:", _), b.error((_ == null ? void 0 : _.message) || "文件上传失败,请稍后再试!"), _;
82
+ await a.uploadFile(v, y.signal, (u) => {
83
+ v.percent = u;
84
+ }), n.success("文件上传成功,开始业务处理!"), H(v);
85
+ } catch (u) {
86
+ throw console.error("文件上传错误:", u), n.error((u == null ? void 0 : u.message) || "文件上传失败,请稍后再试!"), u;
288
87
  }
289
- } catch (m) {
290
- console.error("上传处理错误:", m), b.error("上传处理失败:" + ((m == null ? void 0 : m.message) || "未知错误"));
88
+ } catch (a) {
89
+ console.error("上传处理错误:", a), n.error("上传处理失败:" + ((a == null ? void 0 : a.message) || "未知错误"));
291
90
  } finally {
292
- a.isFormLoading.value = !1;
91
+ e.isFormLoading.value = !1;
293
92
  }
294
- }, F = async (d) => {
295
- if (a.formData.value) {
93
+ }, H = async (l) => {
94
+ if (e.formData.value) {
296
95
  if (o.excelBatchField) {
297
- const x = await K(e.value);
298
- if (!x) return null;
299
- const { excelData: D } = x, B = D.map((_) => {
300
- const j = {};
301
- for (const $ in _) {
302
- const z = o.excelFieldMap[$];
303
- z && (j[z] = _[$]);
96
+ const t = await ve(z.value);
97
+ if (!t) return null;
98
+ const { excelData: v } = t, y = v.map((u) => {
99
+ const h = {};
100
+ for (const L in u) {
101
+ const j = o.excelFieldMap[L];
102
+ j && (h[j] = u[L]);
304
103
  }
305
- return j;
104
+ return h;
306
105
  });
307
- a.formData.value[o.excelBatchField] = B;
106
+ e.formData.value[o.excelBatchField] = y;
308
107
  }
309
- const m = o.fileField ?? "FileInfo";
310
- a.formData.value[m] = d, a.beforeSave && a.beforeSave();
311
- const S = {
108
+ const a = o.fileField ?? "FileInfo";
109
+ e.formData.value[a] = l, e.beforeSave && e.beforeSave();
110
+ const s = {
312
111
  Data: {
313
- ...a.formData.value
112
+ ...e.formData.value
314
113
  },
315
114
  Query: {
316
- [o.excelCtrl.primaryKey]: a.formData.value[o.excelCtrl.primaryKey]
115
+ [o.excelCtrl.primaryKey]: e.formData.value[o.excelCtrl.primaryKey]
317
116
  }
318
117
  };
319
- a.isFormLoading.value = !0;
118
+ e.isFormLoading.value = !0;
320
119
  try {
321
- const x = await ce(o.excelCtrl, {
322
- params: S,
120
+ const t = await ie(o.excelCtrl, {
121
+ params: s,
323
122
  urlKey: "save",
324
123
  url: o.excelCtrl.saveUrl
325
124
  });
326
- (x == null ? void 0 : x.status) === Y.SUCCESS ? (b.success("数据保存成功!"), a.afterSave && a.afterSave(), a.visible.value = !1) : b.error("保存失败:" + ((x == null ? void 0 : x.msg) || "未知错误"));
327
- } catch (x) {
328
- console.error("保存错误:", x), b.error("数据保存失败,请稍后再试!");
125
+ (t == null ? void 0 : t.status) === oe.SUCCESS ? (n.success("数据保存成功!"), e.afterSave && e.afterSave(), e.visible.value = !1) : n.error("保存失败:" + ((t == null ? void 0 : t.msg) || "未知错误"));
126
+ } catch (t) {
127
+ console.error("保存错误:", t), n.error("数据保存失败,请稍后再试!");
329
128
  } finally {
330
- a.isFormLoading.value = !1;
129
+ e.isFormLoading.value = !1;
331
130
  }
332
131
  }
333
- }, u = E(!1), w = E(!1), e = E(null), W = async (d) => {
334
- if (!(d.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || d.type === "application/vnd.ms-excel"))
335
- return b.error("只能上传Excel文件!"), Q.LIST_IGNORE;
132
+ }, B = r(!1), N = r(!1), z = r(null), J = async (l) => {
133
+ if (!(l.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l.type === "application/vnd.ms-excel"))
134
+ return n.error("只能上传Excel文件!"), I.LIST_IGNORE;
336
135
  try {
337
- t.value = d.name, u.value = !1, w.value = !1, r.value = !0, l.value = "待验证数据规则", c.value = "warning", i.value = "待验证重复数据", p.value = "warning";
338
- const S = await d.arrayBuffer();
339
- e.value = S;
340
- const x = new FileReader();
341
- x.readAsDataURL(d), x.onload = async (D) => {
342
- if (D.target) {
343
- const { hasError: B, errBlob: _ } = await xe(S, a.formRules.value);
344
- if (B) {
345
- if (_) {
346
- u.value = !0, r.value = !1, l.value = "数据验证失败", c.value = "error";
347
- const j = URL.createObjectURL(_);
348
- s.value = j;
136
+ x.value = l.name, B.value = !1, N.value = !1, E.value = !0, U.value = "待验证数据规则", S.value = "warning", k.value = "待验证重复数据", D.value = "warning";
137
+ const s = await l.arrayBuffer();
138
+ z.value = s;
139
+ const t = new FileReader();
140
+ t.readAsDataURL(l), t.onload = async (v) => {
141
+ if (v.target) {
142
+ const { hasError: y, errBlob: u } = await de(s, e.formRules.value);
143
+ if (y) {
144
+ if (u) {
145
+ B.value = !0, E.value = !1, U.value = "数据验证失败", S.value = "error";
146
+ const h = URL.createObjectURL(u);
147
+ w.value = h;
349
148
  }
350
149
  return;
351
150
  } else
352
- l.value = "数据验证成功", c.value = "success";
353
- if (J.value && J.value.length > 0 && R.value)
151
+ U.value = "数据验证成功", S.value = "success";
152
+ if (g.value && g.value.length > 0 && C.value)
354
153
  try {
355
- R.value.api || (R.value.api = o.gridCtrl.page.api), R.value.authorize === void 0 && (R.value.authorize = o.gridCtrl.page.authorize);
356
- const { hasError: j, errBlob: $ } = await we(
357
- S,
358
- J.value,
359
- R.value
154
+ C.value.api || (C.value.api = o.gridCtrl.page.api), C.value.authorize === void 0 && (C.value.authorize = o.gridCtrl.page.authorize);
155
+ const { hasError: h, errBlob: L } = await fe(
156
+ s,
157
+ g.value,
158
+ C.value
360
159
  );
361
- if (j) {
362
- if ($) {
363
- w.value = !0, i.value = "检测到重复数据", p.value = "error";
364
- const z = URL.createObjectURL($);
365
- s.value = z;
160
+ if (h) {
161
+ if (L) {
162
+ N.value = !0, k.value = "检测到重复数据", D.value = "error";
163
+ const j = URL.createObjectURL(L);
164
+ w.value = j;
366
165
  }
367
166
  return;
368
167
  } else
369
- w.value = !1, i.value = "数据验证通过", p.value = "success";
168
+ N.value = !1, k.value = "数据验证通过", D.value = "success";
370
169
  } catch {
371
- i.value = "重复检测异常", p.value = "error";
170
+ k.value = "重复检测异常", D.value = "error";
372
171
  }
373
- s.value = D.target.result, r.value = !1;
172
+ w.value = v.target.result, E.value = !1;
374
173
  } else
375
- b.error("加载Excel文件失败,请检查文件格式!");
174
+ n.error("加载Excel文件失败,请检查文件格式!");
376
175
  };
377
- } catch (S) {
378
- console.error("Excel处理错误:", S), b.error("Excel文件处理失败,请检查文件格式!"), r.value = !1, l.value = "Excel处理错误", c.value = "error";
176
+ } catch (s) {
177
+ console.error("Excel处理错误:", s), n.error("Excel文件处理失败,请检查文件格式!"), E.value = !1, U.value = "Excel处理错误", S.value = "error";
379
178
  }
380
179
  return !1;
381
- }, h = ne(a.formRules.value);
382
- ae(() => {
383
- const d = o.gridCtrl.page;
384
- if (g.value = g.value ?? d.urls.upload, !g.value) {
385
- b.error("未配置文件上传地址!");
180
+ }, T = se(e.formRules.value);
181
+ Y(() => {
182
+ const l = o.gridCtrl.page;
183
+ if (p.value = p.value ?? l.urls.upload, !p.value) {
184
+ n.error("未配置文件上传地址!");
386
185
  return;
387
186
  }
388
- g.value.api || (g.value.api = d.api), g.value.authorize === void 0 && (g.value.authorize = d.authorize);
389
- for (const m in a.formData.value)
390
- o.gridCtrl.rowData.value && (a.formData.value[m] = o.gridCtrl.rowData.value[m]);
391
- f.value = a.visible.value;
187
+ p.value.api || (p.value.api = l.api), p.value.authorize === void 0 && (p.value.authorize = l.authorize);
188
+ for (const a in e.formData.value)
189
+ o.gridCtrl.rowData.value && (e.formData.value[a] = o.gridCtrl.rowData.value[a]);
190
+ b.value = e.visible.value;
392
191
  });
393
- const A = () => {
394
- a.visible.value = !1;
395
- }, ee = () => {
192
+ const K = () => {
193
+ e.visible.value = !1;
194
+ }, W = () => {
396
195
  console.error("渲染失败");
397
196
  };
398
- return (d, m) => (N(), le(k(ue), {
399
- title: d.title ?? "Excel文件上传",
400
- open: f.value,
401
- "onUpdate:open": m[0] || (m[0] = (S) => f.value = S),
402
- wrapClassName: ["modal", "mx-auto", d.$attrs.width ? "w-[" + d.$attrs.width + "]" : ""].join(" "),
197
+ return (l, a) => (d(), ee(i(te), {
198
+ title: l.title ?? "Excel文件上传",
199
+ open: b.value,
200
+ "onUpdate:open": a[0] || (a[0] = (s) => b.value = s),
201
+ wrapClassName: ["modal", "mx-auto", l.$attrs.width ? "w-[" + l.$attrs.width + "]" : ""].join(" "),
403
202
  width: 940,
404
- onClose: A
203
+ onClose: K
405
204
  }, {
406
- footer: T(() => [
407
- L(k(fe), null, {
408
- default: T(() => [
409
- L(k(I), { onClick: A }, {
410
- default: T(() => m[2] || (m[2] = [
411
- H("取消")
205
+ footer: _(() => [
206
+ m(i(re), null, {
207
+ default: _(() => [
208
+ m(i(A), { onClick: K }, {
209
+ default: _(() => a[2] || (a[2] = [
210
+ O("取消")
412
211
  ])),
413
212
  _: 1,
414
213
  __: [2]
415
214
  }),
416
- L(k(I), {
417
- onClick: v,
215
+ m(i(A), {
216
+ onClick: q,
418
217
  type: "primary",
419
- loading: k(a).isFormSaving.value,
420
- disabled: !s.value || u.value || w.value || r.value
218
+ loading: i(e).isFormSaving.value,
219
+ disabled: !w.value || B.value || N.value || E.value
421
220
  }, {
422
- default: T(() => [
423
- H(M(d.saveText ?? "上传文件"), 1)
221
+ default: _(() => [
222
+ O(F(l.saveText ?? "上传文件"), 1)
424
223
  ]),
425
224
  _: 1
426
225
  }, 8, ["loading", "disabled"])
@@ -428,19 +227,19 @@ const K = async (C) => {
428
227
  _: 1
429
228
  })
430
229
  ]),
431
- default: T(() => [
432
- re(d.$slots, "default"),
433
- O("div", be, [
434
- L(k(Q), {
435
- "file-list": y.value,
436
- "before-upload": W,
230
+ default: _(() => [
231
+ le(l.$slots, "default"),
232
+ c("div", me, [
233
+ m(i(I), {
234
+ "file-list": Z.value,
235
+ "before-upload": J,
437
236
  accept: ".xlsx,.xls",
438
237
  showUploadList: !0
439
238
  }, {
440
- default: T(() => [
441
- L(k(I), { type: "primary" }, {
442
- default: T(() => m[1] || (m[1] = [
443
- H("选择Excel文件")
239
+ default: _(() => [
240
+ m(i(A), { type: "primary" }, {
241
+ default: _(() => a[1] || (a[1] = [
242
+ O("选择Excel文件")
444
243
  ])),
445
244
  _: 1,
446
245
  __: [1]
@@ -448,18 +247,18 @@ const K = async (C) => {
448
247
  ]),
449
248
  _: 1
450
249
  }, 8, ["file-list"]),
451
- s.value && t.value ? (N(), U("div", Fe, [
452
- O("span", null, M(t.value), 1)
453
- ])) : V("", !0)
250
+ w.value && x.value ? (d(), f("div", xe, [
251
+ c("span", null, F(x.value), 1)
252
+ ])) : M("", !0)
454
253
  ]),
455
- O("div", Ee, [
456
- O("div", {
457
- class: oe(["flex-shrink-0 excel-container", [k(h).length === 0 ? "w-[100%]" : "w-[80%]"]]),
254
+ c("div", ge, [
255
+ c("div", {
256
+ class: ae(["flex-shrink-0 excel-container", [i(T).length === 0 ? "w-[100%]" : "w-[80%]"]]),
458
257
  style: { height: "430px" }
459
258
  }, [
460
- L(k(he), {
461
- src: s.value,
462
- onError: ee,
259
+ m(i(pe), {
260
+ src: w.value,
261
+ onError: W,
463
262
  style: { width: "100%", height: "100%" },
464
263
  options: {
465
264
  styles: !0,
@@ -471,46 +270,46 @@ const K = async (C) => {
471
270
  }
472
271
  }, null, 8, ["src"])
473
272
  ], 2),
474
- k(h).length > 0 ? (N(), U("div", Ce, [
475
- O("div", Se, [
476
- k(h).length === 0 ? (N(), U("div", ke, "没有设置验证规则")) : (N(), U("div", _e, [
477
- L(k(X), {
478
- message: l.value,
479
- type: c.value,
273
+ i(T).length > 0 ? (d(), f("div", ye, [
274
+ c("div", he, [
275
+ i(T).length === 0 ? (d(), f("div", _e, "没有设置验证规则")) : (d(), f("div", be, [
276
+ m(i(G), {
277
+ message: U.value,
278
+ type: S.value,
480
279
  "show-icon": "",
481
280
  class: "mb-2"
482
281
  }, null, 8, ["message", "type"]),
483
- O("div", Oe, [
484
- (N(!0), U(q, null, G(k(h), (S, x) => (N(), U("div", {
485
- key: x,
282
+ c("div", we, [
283
+ (d(!0), f(P, null, $(i(T), (s, t) => (d(), f("div", {
284
+ key: t,
486
285
  class: "border-b pb-0"
487
286
  }, [
488
- O("div", De, M(S.field), 1),
489
- O("ul", Ne, [
490
- (N(!0), U(q, null, G(S.rules, (D, B) => (N(), U("li", {
491
- key: B,
287
+ c("div", Ce, F(s.field), 1),
288
+ c("ul", Fe, [
289
+ (d(!0), f(P, null, $(s.rules, (v, y) => (d(), f("li", {
290
+ key: y,
492
291
  class: "text-[12px] text-gray-600"
493
- }, M(D), 1))), 128))
292
+ }, F(v), 1))), 128))
494
293
  ])
495
294
  ]))), 128))
496
295
  ]),
497
- J.value && J.value.length > 0 ? (N(), U("div", Je, [
498
- L(k(X), {
499
- message: i.value,
500
- type: p.value,
296
+ g.value && g.value.length > 0 ? (d(), f("div", Ee, [
297
+ m(i(G), {
298
+ message: k.value,
299
+ type: D.value,
501
300
  "show-icon": "",
502
301
  class: "mt-2 mb-2"
503
302
  }, null, 8, ["message", "type"]),
504
- O("div", Ue, [
505
- O("div", Le, " 以下" + M(J.value.length > 1 ? "组合" : "字段") + "必须唯一 ", 1),
506
- O("ul", Re, [
507
- O("li", Be, M(J.value.join(", ")), 1)
303
+ c("div", Ue, [
304
+ c("div", Se, " 以下" + F(g.value.length > 1 ? "组合" : "字段") + "必须唯一 ", 1),
305
+ c("ul", ke, [
306
+ c("li", De, F(g.value.join(", ")), 1)
508
307
  ])
509
308
  ])
510
- ])) : V("", !0)
309
+ ])) : M("", !0)
511
310
  ]))
512
311
  ])
513
- ])) : V("", !0)
312
+ ])) : M("", !0)
514
313
  ])
515
314
  ]),
516
315
  _: 3
@@ -518,5 +317,5 @@ const K = async (C) => {
518
317
  }
519
318
  });
520
319
  export {
521
- qe as default
320
+ Pe as default
522
321
  };