@skyfox2000/webui 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
2
2
  var E = (e, r, o) => r in e ? m(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o;
3
3
  var d = (e, r, o) => E(e, typeof r != "symbol" ? r + "" : r, o);
4
4
  import { hostUrl as v } from "@skyfox2000/fapi";
5
- import { ae as S, ad as w, u as g } from "./uploadList-DAVjJkqz.js";
5
+ import { ae as S, ad as w, u as g } from "./uploadList-M21hxVQy.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,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-CCpTizF9.js";
2
+ import { _ as m } from "./index-DTFrhJdN.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-DAVjJkqz.js";
5
+ import { P as M, d as P, o as $, b as K } from "./uploadList-M21hxVQy.js";
6
6
  import "@skyfox2000/microbase";
7
7
  import "vue-m-message";
8
8
  import "async-validator";
@@ -1,10 +1,10 @@
1
1
  import V from "async-validator";
2
2
  import { httpPost as j, ResStatus as M } from "@skyfox2000/fapi";
3
- import { i as T, ag as $ } from "./uploadList-DAVjJkqz.js";
3
+ import { i as T, ag as $ } from "./uploadList-M21hxVQy.js";
4
4
  import m from "vue-m-message";
5
5
  import { defineComponent as R, useAttrs as U, createElementBlock as z, openBlock as b, createVNode as B, unref as v, mergeProps as D, computed as E, createBlock as _, withCtx as A, normalizeStyle as O } from "vue";
6
6
  import { Spin as N, Alert as L } from "ant-design-vue";
7
- import { _ as K } from "./toolIcon-CqM4gBIc.js";
7
+ import { _ as K } from "./toolIcon-CNfvNkNh.js";
8
8
  const H = (i) => {
9
9
  const e = i.split(`
10
10
  `).filter((c) => c.trim() !== "");
@@ -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-CqM4gBIc.js";
3
+ import { a as P, _ as k } from "./toolIcon-CNfvNkNh.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-CqM4gBIc.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-DAVjJkqz.js";
2
+ import { a as w, _ as b } from "./toolIcon-CNfvNkNh.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-M21hxVQy.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-DAVjJkqz.js";
4
+ import { c as S } from "./uploadList-M21hxVQy.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-CCpTizF9.js";
3
- import { a as z, _ as L } from "./toolIcon-CqM4gBIc.js";
2
+ import { _ as ne } from "./index-DTFrhJdN.js";
3
+ import { a as z, _ as L } from "./toolIcon-CNfvNkNh.js";
4
4
  import { httpPost as D, ResStatus as I } from "@skyfox2000/fapi";
5
- import { s as ae, _ as se } from "./uploadList-DAVjJkqz.js";
6
- import { p as R, U as s } from "./file-upload-DhPgqGdk.js";
5
+ import { s as ae, _ as se } from "./uploadList-M21hxVQy.js";
6
+ import { p as R, U as s } from "./file-upload-CKliLHBF.js";
7
7
  import { combineParams as V } from "@skyfox2000/microbase";
8
8
  import k from "vue-m-message";
9
9
  import "async-validator";
@@ -175,10 +175,11 @@ const ue = {
175
175
  }
176
176
  }, P = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, Oe = (e, t) => {
177
177
  var n;
178
+ const a = e.page;
178
179
  return {
179
180
  url: "",
180
- ...(n = e.page.urls) == null ? void 0 : n[t.urlKey],
181
181
  ...e.url,
182
+ ...(n = a.urls) == null ? void 0 : n[t.urlKey],
182
183
  ...t.url,
183
184
  loadingText: t.loadingText
184
185
  };
@@ -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-CqM4gBIc.js";
3
+ import { _ as q } from "../../assets/modules/toolIcon-CNfvNkNh.js";
4
4
  import "@skyfox2000/fapi";
5
- import "../../assets/modules/uploadList-DAVjJkqz.js";
5
+ import "../../assets/modules/uploadList-M21hxVQy.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-C31q4LHC.js";
10
+ import { _ as D } from "../../assets/modules/index-CTOX9glc.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-CqM4gBIc.js";
4
- import { I as A, _ as B, f as L, d as V, g as D } from "../../assets/modules/menuTabs-DyhSKN9r.js";
5
- import { ad as j, a as K, af as M } from "../../assets/modules/uploadList-DAVjJkqz.js";
3
+ import { a as z } from "../../assets/modules/toolIcon-CNfvNkNh.js";
4
+ import { I as A, _ as B, f as L, d as V, g as D } from "../../assets/modules/menuTabs-ylnnzjNu.js";
5
+ import { ad as j, a as K, af as M } from "../../assets/modules/uploadList-M21hxVQy.js";
6
6
  import "@skyfox2000/microbase";
7
7
  import "@skyfox2000/fapi";
8
8
  import P from "vue-m-message";
@@ -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-DAVjJkqz.js";
2
+ import { r as s } from "../../assets/modules/uploadList-M21hxVQy.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -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-DAVjJkqz.js";
2
+ import { r as s } from "../../assets/modules/uploadList-M21hxVQy.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,19 +1,19 @@
1
1
  import { defineComponent as we, ref as v, computed as U, watch as W, onMounted as be, createBlock as H, openBlock as f, unref as n, 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-CCpTizF9.js";
2
+ import { _ as Y } from "../../assets/modules/index-DTFrhJdN.js";
3
3
  import { Modal as Fe, Upload as ce, 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-DAVjJkqz.js";
6
- import { A as Re, p as De, U as ue } from "../../assets/modules/file-upload-DhPgqGdk.js";
5
+ import { E as Te, a1 as Se, a7 as Ee } from "../../assets/modules/uploadList-M21hxVQy.js";
6
+ import { A as Re, p as De, U as ue } from "../../assets/modules/file-upload-CKliLHBF.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import c from "vue-m-message";
9
- import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-02J2AYth.js";
9
+ import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-Cm_1mhHh.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 = (t) => t.includes(",") || t.includes(`
15
- `), Me = (t, s) => t === "text/csv" || (s == null ? void 0 : s.toLowerCase().includes(".csv")) || !1, ze = (t, s) => t === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || t === "application/vnd.ms-excel" || (s == null ? void 0 : s.toLowerCase().match(/\.(xlsx|xls)$/)) !== null, ee = async (t, s = "preview.csv") => {
16
- const e = await ke(t, s);
14
+ const Be = (l) => l.includes(",") || l.includes(`
15
+ `), Me = (l, r) => l === "text/csv" || (r == null ? void 0 : r.toLowerCase().includes(".csv")) || !1, ze = (l, r) => l === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l === "application/vnd.ms-excel" || (r == null ? void 0 : r.toLowerCase().match(/\.(xlsx|xls)$/)) !== null, ee = async (l, r = "preview.csv") => {
16
+ const e = await ke(l, r);
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 = (t, s, e = "预览文件.xlsx") => ({
24
+ }, ae = (l, r, e = "预览文件.xlsx") => ({
25
25
  success: !0,
26
- blobUrl: `data:${s || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};base64,${t}`,
26
+ blobUrl: `data:${r || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};base64,${l}`,
27
27
  fileName: e
28
- }), ve = async (t, s = !1) => {
29
- if (s) {
30
- if (typeof t == "string")
31
- return Be(t) ? await ee(t) : ae(t);
32
- if (t instanceof ArrayBuffer || t instanceof Uint8Array) {
33
- const e = new Blob([t], {
28
+ }), ve = async (l, r = !1) => {
29
+ if (r) {
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 (t.Content && t.Type)
45
- return Me(t.Type, t.FileName) ? await ee(t.Content, t.FileName || "preview.csv") : ze(t.Type, t.FileName) ? ae(t.Content, t.Type, t.FileName || "预览文件.xlsx") : ae(t.Content);
46
- if (t.url)
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: t.url,
50
- fileName: t.fileName || "预览文件.xlsx"
49
+ blobUrl: l.url,
50
+ fileName: l.fileName || "预览文件.xlsx"
51
51
  };
52
- if (typeof t == "string")
53
- return await ee(t);
52
+ if (typeof l == "string")
53
+ return await ee(l);
54
54
  throw new Error("不支持的文件格式");
55
- }, Pe = async (t, s) => {
56
- if (!t || !s)
57
- throw new Error("预览URL或Excel控制器未配置");
55
+ }, Pe = async (l, r) => {
56
+ if (!l || !r)
57
+ return c.error("预览URL或Excel控制器未配置"), { success: !1 };
58
58
  try {
59
59
  let e = null;
60
- if (t.method === "GET") {
60
+ if (l.method === "GET") {
61
61
  const a = {
62
- ...t,
62
+ ...l,
63
63
  method: "GET",
64
- api: t.api || s.page.api,
65
- authorize: t.authorize ?? s.page.authorize
64
+ api: l.api || r.page.api,
65
+ authorize: l.authorize ?? r.page.authorize
66
66
  };
67
67
  e = await Ue(a);
68
68
  } else {
69
- const a = t.params;
70
- e = await Te(s, {
71
- url: t,
69
+ const a = l.params;
70
+ e = await Te(r, {
71
+ url: l,
72
72
  urlKey: "preview",
73
73
  params: a,
74
74
  hideErrorToast: !0
75
75
  });
76
76
  }
77
- if (t.raw)
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;
@@ -119,8 +119,8 @@ const Be = (t) => t.includes(",") || t.includes(`
119
119
  previewUrl: {},
120
120
  fileType: {}
121
121
  },
122
- setup(t, { expose: s }) {
123
- const e = t, a = e.excelCtrl, m = v(!1), w = v(""), le = v([]), y = v(""), P = U(() => !!e.previewUrl), te = U(() => e.enableUpload), de = U(() => {
122
+ setup(l, { expose: r }) {
123
+ const e = l, a = e.excelCtrl, m = v(!1), w = v(""), le = v([]), y = v(""), 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";
@@ -159,22 +159,20 @@ const Be = (t) => t.includes(",") || t.includes(`
159
159
  { deep: !0 }
160
160
  );
161
161
  const F = v(e.uploadParams), R = U(() => {
162
- var l;
163
- return (l = F.value) == null ? void 0 : l.uploadUrl;
162
+ var t;
163
+ return (t = F.value) == null ? void 0 : t.uploadUrl;
164
164
  }), M = U(() => {
165
- var l;
166
- return (l = F.value) == null ? void 0 : l.duplicateRules;
165
+ var t;
166
+ return (t = F.value) == null ? void 0 : t.duplicateRules;
167
167
  }), D = U(() => {
168
- var l;
169
- return (l = F.value) == null ? void 0 : l.duplicateUrl;
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 l = await Pe(e.previewUrl, a);
175
- l.success && (w.value = l.blobUrl, y.value = l.fileName);
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;
@@ -184,8 +182,8 @@ const Be = (t) => t.includes(",") || t.includes(`
184
182
  }, me = async () => {
185
183
  var i;
186
184
  F.value = e.uploadParams;
187
- const l = R.value;
188
- if (!l) {
185
+ const t = R.value;
186
+ if (!t) {
189
187
  c.error("未配置文件上传地址!");
190
188
  return;
191
189
  }
@@ -199,7 +197,7 @@ const Be = (t) => t.includes(",") || t.includes(`
199
197
  c.warning("请先选择文件!"), a.isFormSaving.value = !1;
200
198
  return;
201
199
  }
202
- const r = new Re(l, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", o = new File([L.value], y.value, {
200
+ const s = new Re(t, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", o = new File([L.value], y.value, {
203
201
  type: u
204
202
  }), d = De.join(((i = F.value) == null ? void 0 : i.basePath) ?? "", y.value), p = {
205
203
  uid: "1",
@@ -211,15 +209,15 @@ const Be = (t) => t.includes(",") || t.includes(`
211
209
  FileKey: d
212
210
  }
213
211
  }, b = new AbortController();
214
- (await r.uploadFile(p, b.signal, (h) => {
212
+ (await s.uploadFile(p, b.signal, (h) => {
215
213
  p.percent = h;
216
214
  })).status === ue.Success && (c.success("文件上传成功,开始业务处理!"), ye(p));
217
- } catch (r) {
218
- console.error("上传处理错误:", r), c.error("上传处理失败:" + ((r == null ? void 0 : r.message) || "未知错误"));
215
+ } catch (s) {
216
+ console.error("上传处理错误:", s), c.error("上传处理失败:" + ((s == null ? void 0 : s.message) || "未知错误"));
219
217
  } finally {
220
218
  a.isFormSaving.value = !1;
221
219
  }
222
- }, ye = async (l) => {
220
+ }, ye = async (t) => {
223
221
  if (a.formData.value) {
224
222
  if (e.excelRecordsKey || e.excelRowsKey) {
225
223
  const o = await Ne(L.value);
@@ -236,14 +234,14 @@ const Be = (t) => t.includes(",") || t.includes(`
236
234
  e.excelRecordsKey && (a.formData.value[e.excelRecordsKey] = b), e.excelRowsKey && (a.formData.value[e.excelRowsKey] = p);
237
235
  }
238
236
  const i = e.fileField ?? "FileInfo";
239
- a.formData.value[i] = l;
240
- const r = {};
241
- a.primaryKey && a.formData.value[a.primaryKey] !== void 0 && (r[a.primaryKey] = a.formData.value[a.primaryKey]);
237
+ a.formData.value[i] = t;
238
+ const s = {};
239
+ a.primaryKey && a.formData.value[a.primaryKey] !== void 0 && (s[a.primaryKey] = a.formData.value[a.primaryKey]);
242
240
  const u = {
243
241
  Data: {
244
242
  ...a.formData.value
245
243
  },
246
- Query: r
244
+ Query: s
247
245
  };
248
246
  if (a.beforeSave && a.beforeSave(u) === !1)
249
247
  return;
@@ -261,19 +259,19 @@ const Be = (t) => t.includes(",") || t.includes(`
261
259
  a.isFormSaving.value = !1;
262
260
  }
263
261
  }
264
- }, _ = v(!1), k = v(!1), L = v(null), q = v(""), re = async (l) => {
262
+ }, _ = v(!1), k = v(!1), L = v(null), q = v(""), se = async (t) => {
265
263
  const i = e.gridCtrl;
266
264
  if (i) {
267
265
  F.value = e.uploadParams;
268
266
  try {
269
267
  D.value && (D.value.api || (D.value.api = i.page.api), D.value.authorize === void 0 && (D.value.authorize = i.page.authorize));
270
268
  const {
271
- hasError: r,
269
+ hasError: s,
272
270
  errBlob: u,
273
271
  validationMsg: o,
274
272
  duplicateMsg: d
275
- } = await Ke(l, a.formRules.value, M.value, D.value);
276
- if (V.value = o, $.value = d, r) {
273
+ } = await Ke(t, a.formRules.value, M.value, D.value);
274
+ if (V.value = o, $.value = d, s) {
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,41 +283,41 @@ 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 (l) => {
286
+ }, xe = async (t) => {
289
287
  if (!e.gridCtrl) {
290
288
  c.error("未配置表格控制器!");
291
289
  return;
292
290
  }
293
291
  F.value = e.uploadParams;
294
- const r = l.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l.type === "application/vnd.ms-excel", u = l.type === "text/csv" || l.name.toLowerCase().endsWith(".csv"), o = e.fileType || "both";
292
+ const s = t.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || t.type === "application/vnd.ms-excel", u = t.type === "text/csv" || t.name.toLowerCase().endsWith(".csv"), o = e.fileType || "both";
295
293
  let d = !1, p = "";
296
294
  switch (o) {
297
295
  case "excel":
298
- d = r, p = "只能上传Excel文件!";
296
+ d = s, p = "只能上传Excel文件!";
299
297
  break;
300
298
  case "csv":
301
299
  d = u, p = "只能上传CSV文件!";
302
300
  break;
303
301
  case "both":
304
302
  default:
305
- d = r || u, p = "只能上传Excel文件或CSV文件!";
303
+ d = s || u, p = "只能上传Excel文件或CSV文件!";
306
304
  break;
307
305
  }
308
306
  if (!d)
309
307
  return c.error(p), ce.LIST_IGNORE;
310
308
  try {
311
- if (j(), y.value = l.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
312
- const h = await l.arrayBuffer(), O = new TextDecoder("utf-8").decode(h), { csvToExcelView: G } = await import("../../assets/modules/index-02J2AYth.js").then((he) => he.j), z = await G(O, l.name);
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-Cm_1mhHh.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
- return L.value = oe, await re(oe), !_.value && !k.value && (w.value = z.blobUrl), y.value = z.fileName, a.isFormLoading.value = !1, !1;
314
+ return L.value = oe, await se(oe), !_.value && !k.value && (w.value = z.blobUrl), y.value = z.fileName, a.isFormLoading.value = !1, !1;
317
315
  }
318
- const b = await l.arrayBuffer();
316
+ const b = await t.arrayBuffer();
319
317
  L.value = b;
320
318
  const N = new FileReader();
321
- N.readAsDataURL(l), N.onload = async (h) => {
322
- h.target ? (await re(b), !_.value && !k.value && (w.value = h.target.result), a.isFormLoading.value = !1) : c.error("加载文件失败,请检查文件格式!");
319
+ N.readAsDataURL(t), N.onload = async (h) => {
320
+ h.target ? (await se(b), !_.value && !k.value && (w.value = h.target.result), a.isFormLoading.value = !1) : c.error("加载文件失败,请检查文件格式!");
323
321
  };
324
322
  } catch (b) {
325
323
  console.error("文件处理错误:", b), c.error("文件处理失败,请检查文件格式!"), a.isFormLoading.value = !1, V.value = "文件处理错误", E.value = "error";
@@ -328,45 +326,45 @@ const Be = (t) => t.includes(",") || t.includes(`
328
326
  }, A = Se(a.formRules.value);
329
327
  be(() => {
330
328
  var i;
331
- const l = (i = e.gridCtrl) == null ? void 0 : i.page;
332
- if (l && !P.value) {
329
+ const t = (i = e.gridCtrl) == null ? void 0 : i.page;
330
+ if (t && !P.value) {
333
331
  if (!R.value) {
334
332
  c.error("未配置文件上传地址!");
335
333
  return;
336
334
  }
337
- R.value.api || (R.value.api = l.api), R.value.authorize === void 0 && (R.value.authorize = l.authorize);
338
- for (const r in a.formData.value)
339
- e.gridCtrl.rowData.value && (a.formData.value[r] = e.gridCtrl.rowData.value[r]);
335
+ R.value.api || (R.value.api = t.api), R.value.authorize === void 0 && (R.value.authorize = t.authorize);
336
+ for (const s in a.formData.value)
337
+ e.gridCtrl.rowData.value && (a.formData.value[s] = e.gridCtrl.rowData.value[s]);
340
338
  }
341
339
  m.value = a.visible.value, m.value && e.previewUrl && I();
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 l = e.fileField ?? "FileInfo", i = e.excelRecordsKey, r = e.excelRowsKey;
346
- delete a.formData.value[l], i && delete a.formData.value[i], r && delete a.formData.value[r];
343
+ const t = e.fileField ?? "FileInfo", i = e.excelRecordsKey, s = e.excelRowsKey;
344
+ delete a.formData.value[t], i && delete a.formData.value[i], s && delete a.formData.value[s];
347
345
  }
348
- }, se = () => {
346
+ }, re = () => {
349
347
  a.visible.value = !1;
350
348
  }, ge = () => {
351
349
  };
352
- return s({
350
+ return r({
353
351
  clearAll: j
354
- }), (l, i) => (f(), H(n(Fe), {
355
- title: l.title ?? "文件上传",
352
+ }), (t, i) => (f(), H(n(Fe), {
353
+ title: t.title ?? "文件上传",
356
354
  open: m.value,
357
- "onUpdate:open": i[0] || (i[0] = (r) => m.value = r),
358
- wrapClassName: ["modal", "mx-auto", l.$attrs.width ? "w-[" + l.$attrs.width + "]" : ""].join(" "),
355
+ "onUpdate:open": i[0] || (i[0] = (s) => m.value = s),
356
+ wrapClassName: ["modal", "mx-auto", t.$attrs.width ? "w-[" + t.$attrs.width + "]" : ""].join(" "),
359
357
  width: 940,
360
- onClose: se
358
+ onClose: re
361
359
  }, {
362
360
  footer: T(() => [
363
361
  C(n(_e), null, {
364
362
  default: T(() => {
365
- var r;
363
+ var s;
366
364
  return [
367
- C(n(Y), { onClick: se }, {
365
+ C(n(Y), { onClick: re }, {
368
366
  default: T(() => [
369
- X(S(l.cancelText ?? (P.value ? "关闭" : "取消")), 1)
367
+ X(S(t.cancelText ?? (P.value ? "关闭" : "取消")), 1)
370
368
  ]),
371
369
  _: 1
372
370
  }),
@@ -374,11 +372,11 @@ const Be = (t) => t.includes(",") || t.includes(`
374
372
  key: 0,
375
373
  onClick: me,
376
374
  type: "primary",
377
- loading: ((r = n(a)) == null ? void 0 : r.isFormSaving.value) ?? !1,
375
+ loading: ((s = n(a)) == null ? void 0 : s.isFormSaving.value) ?? !1,
378
376
  disabled: !w.value || _.value || k.value || n(a).isFormLoading.value
379
377
  }, {
380
378
  default: T(() => [
381
- X(S(l.saveText ?? "上传文件"), 1)
379
+ X(S(t.saveText ?? "上传文件"), 1)
382
380
  ]),
383
381
  _: 1
384
382
  }, 8, ["loading", "disabled"]))
@@ -388,9 +386,9 @@ const Be = (t) => t.includes(",") || t.includes(`
388
386
  })
389
387
  ]),
390
388
  default: T(() => [
391
- J(l.$slots, "default"),
389
+ J(t.$slots, "default"),
392
390
  P.value ? K("", !0) : (f(), x("div", $e, [
393
- J(l.$slots, "file-before"),
391
+ J(t.$slots, "file-before"),
394
392
  C(n(ce), {
395
393
  "file-list": le.value,
396
394
  "before-upload": xe,
@@ -418,7 +416,7 @@ const Be = (t) => t.includes(",") || t.includes(`
418
416
  "show-icon": !1
419
417
  }, null, 8, ["message"])
420
418
  ])) : K("", !0),
421
- J(l.$slots, "file-after")
419
+ J(t.$slots, "file-after")
422
420
  ])),
423
421
  g("div", je, [
424
422
  n(a).isFormLoading.value ? (f(), H(n(Le), {
@@ -453,13 +451,13 @@ const Be = (t) => t.includes(",") || t.includes(`
453
451
  class: "mb-2"
454
452
  }, null, 8, ["message", "type"]),
455
453
  g("div", Qe, [
456
- (f(!0), x(ie, null, ne(n(A), (r, u) => (f(), x("div", {
454
+ (f(!0), x(ie, null, ne(n(A), (s, u) => (f(), x("div", {
457
455
  key: u,
458
456
  class: "border-b pb-0"
459
457
  }, [
460
- g("div", We, S(r.field), 1),
458
+ g("div", We, S(s.field), 1),
461
459
  g("ul", He, [
462
- (f(!0), x(ie, null, ne(r.rules, (o, d) => (f(), x("li", {
460
+ (f(!0), x(ie, null, ne(s.rules, (o, d) => (f(), x("li", {
463
461
  key: d,
464
462
  class: "text-[12px] text-gray-600"
465
463
  }, S(o), 1))), 128))
@@ -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-CCpTizF9.js";
2
+ import { _ as c } from "../../assets/modules/index-DTFrhJdN.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-DAVjJkqz.js";
5
+ import { a3 as h } from "../../assets/modules/uploadList-M21hxVQy.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-DhPgqGdk.js";
10
+ import { A as N } from "../../assets/modules/file-upload-CKliLHBF.js";
11
11
  import "vue-draggable-next";
12
- import { U as B } from "../../assets/modules/uploadList-ZajZKqaS.js";
12
+ import { U as B } from "../../assets/modules/uploadList-DroJGtBI.js";
13
13
  const K = /* @__PURE__ */ y({
14
14
  __name: "uploadForm",
15
15
  props: {
package/lib/webui.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { u as Je, i as Z, a as me, c as Xe, P as j, o as Ee, b as Ze, d as ea, e as Pe, r as ce, f as aa, g as ta, h as Fe, j as la, k as ke, l as sa, _ as ra, m as oa, O as Ne, q as Me, n as na, p as ia, s as L, t as ca, v as ua, w as da, x as pa, y as fa, z as va, A as Q, B as ma, C as ha, D as ga, E as Re } from "./assets/modules/uploadList-DAVjJkqz.js";
2
- import { a9 as Sl, N as Cl, Q as Tl, U as $l, a8 as Il, a6 as Dl, a7 as El, aa as Pl, X as Fl, S as Nl, a4 as Ml, a1 as Rl, L as Bl, a3 as Ol, T as Al, G as Ll, Z as zl, a2 as Ul, a5 as Vl, M as Yl, R as Wl, ab as Kl, F as jl, a0 as Hl, ac as Ql, W as ql, Y as Gl, V as Jl, ad as Xl, H as Zl, I as es, ae as as, K as ts, af as ls, J as ss, $ as rs } from "./assets/modules/uploadList-DAVjJkqz.js";
3
- import { A as ns, U as is, a as cs, g as us, c as ds, d as ps, p as fs, u as vs, b as ms } from "./assets/modules/file-upload-DhPgqGdk.js";
1
+ import { u as Je, i as Z, a as me, c as Xe, P as j, o as Ee, b as Ze, d as ea, e as Pe, r as ce, f as aa, g as ta, h as Fe, j as la, k as ke, l as sa, _ as ra, m as oa, O as Ne, q as Me, n as na, p as ia, s as L, t as ca, v as ua, w as da, x as pa, y as fa, z as va, A as Q, B as ma, C as ha, D as ga, E as Re } from "./assets/modules/uploadList-M21hxVQy.js";
2
+ import { a9 as Sl, N as Cl, Q as Tl, U as $l, a8 as Il, a6 as Dl, a7 as El, aa as Pl, X as Fl, S as Nl, a4 as Ml, a1 as Rl, L as Bl, a3 as Ol, T as Al, G as Ll, Z as zl, a2 as Ul, a5 as Vl, M as Yl, R as Wl, ab as Kl, F as jl, a0 as Hl, ac as Ql, W as ql, Y as Gl, V as Jl, ad as Xl, H as Zl, I as es, ae as as, K as ts, af as ls, J as ss, $ as rs } from "./assets/modules/uploadList-M21hxVQy.js";
3
+ import { A as ns, U as is, a as cs, g as us, c as ds, d as ps, p as fs, u as vs, b as ms } from "./assets/modules/file-upload-CKliLHBF.js";
4
4
  import { EnvConfig as we } from "@skyfox2000/microbase";
5
5
  import { FrontCache as re, httpPost as Be, ResStatus as Oe, SERVER_HOST as ba, fieldMapping as oe } from "@skyfox2000/fapi";
6
6
  import he from "vue-m-message";
@@ -9,15 +9,15 @@ import "async-validator";
9
9
  import fe from "dayjs";
10
10
  import { Popover as Sa, theme as Le, Drawer as Ca, Space as te, Form as ze, message as Ta, FormItem as Ue, ConfigProvider as Ce, Popconfirm as $a, Button as Ve, DropdownButton as Ia, Menu as be, MenuItem as xe, Dropdown as ve, Checkbox as Da, Table as Ye, Tree as Ea, Cascader as Pa, DatePicker as Fa, Input as ee, InputPassword as Na, InputNumber as Ma, RangePicker as Ra, Textarea as Ba, Transfer as Oa, TreeSelect as Aa, LayoutContent as La } from "ant-design-vue";
11
11
  import { VueDraggableNext as za } from "vue-draggable-next";
12
- import { d as We } from "./assets/modules/uploadList-ZajZKqaS.js";
13
- import { C as gs, U as bs, a as xs, p as _s } from "./assets/modules/uploadList-ZajZKqaS.js";
14
- import { c as Ke } from "./assets/modules/index-02J2AYth.js";
15
- import { _ as ks, h as ws, b as Ss, a as Cs, d as Ts, e as $s, g as Is, f as Ds, n as Es, p as Ps, t as Fs, v as Ns } from "./assets/modules/index-02J2AYth.js";
16
- import { _ as A } from "./assets/modules/index-CCpTizF9.js";
17
- import { _ as U } from "./assets/modules/toolIcon-CqM4gBIc.js";
18
- import { a as Rs } from "./assets/modules/toolIcon-CqM4gBIc.js";
19
- import { _ as Os, b as As, c as Ls, d as zs, e as Us, I as Vs, f as Ys, g as Ws, a as Ks } from "./assets/modules/menuTabs-DyhSKN9r.js";
20
- import { _ as Hs } from "./assets/modules/index-C31q4LHC.js";
12
+ import { d as We } from "./assets/modules/uploadList-DroJGtBI.js";
13
+ import { C as gs, U as bs, a as xs, p as _s } from "./assets/modules/uploadList-DroJGtBI.js";
14
+ import { c as Ke } from "./assets/modules/index-Cm_1mhHh.js";
15
+ import { _ as ks, h as ws, b as Ss, a as Cs, d as Ts, e as $s, g as Is, f as Ds, n as Es, p as Ps, t as Fs, v as Ns } from "./assets/modules/index-Cm_1mhHh.js";
16
+ import { _ as A } from "./assets/modules/index-DTFrhJdN.js";
17
+ import { _ as U } from "./assets/modules/toolIcon-CNfvNkNh.js";
18
+ import { a as Rs } from "./assets/modules/toolIcon-CNfvNkNh.js";
19
+ import { _ as Os, b as As, c as Ls, d as zs, e as Us, I as Vs, f as Ys, g as Ws, a as Ks } from "./assets/modules/menuTabs-ylnnzjNu.js";
20
+ import { _ as Hs } from "./assets/modules/index-CTOX9glc.js";
21
21
  import { _ as q } from "./assets/modules/_plugin-vue_export-helper-CHgC5LLL.js";
22
22
  const Te = (s, a, e, t = "remove") => {
23
23
  if (!e)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -66,4 +66,4 @@
66
66
  "vite-plugin-dts": "^4.5.4",
67
67
  "vue-tsc": "^2.2.0"
68
68
  }
69
- }
69
+ }
@@ -289,9 +289,6 @@ const loadPreviewFileLocal = async () => {
289
289
  excelUrl.value = result.blobUrl!;
290
290
  fileName.value = result.fileName!;
291
291
  }
292
- } catch (error: any) {
293
- console.error('预览文件加载错误:', error);
294
- message.error('文件加载失败:' + (error?.message || '未知错误'));
295
292
  } finally {
296
293
  setTimeout(() => {
297
294
  excelCtrl.isFormLoading.value = false;
package/src/utils/data.ts CHANGED
@@ -3,12 +3,21 @@ import { ApiResponse, httpPost, IUrlInfo, ResStatus } from '@skyfox2000/fapi';
3
3
  import message from 'vue-m-message';
4
4
  import { isEmpty } from './isEmpty';
5
5
 
6
+ /**
7
+ * 合并URL信息
8
+ * - 使用控件的URL信息
9
+ * - 使用页面的URL信息
10
+ * - 单独配置项的URL信息
11
+ * @param control
12
+ * @param options
13
+ * @returns
14
+ */
6
15
  const combineUrl = (control: AnyControl, options: ExecuteOptions<any>) => {
7
16
  const pageCtrl = control.page;
8
17
  const url: IUrlInfo | undefined = {
9
18
  url: '',
10
- ...pageCtrl.urls?.[options.urlKey],
11
19
  ...control.url,
20
+ ...pageCtrl.urls?.[options.urlKey],
12
21
  ...options.url,
13
22
  loadingText: options.loadingText,
14
23
  };
@@ -138,7 +138,8 @@ export const loadPreviewFile = async (
138
138
  excelCtrl: any,
139
139
  ): Promise<{ success: boolean; blobUrl?: string; fileName?: string }> => {
140
140
  if (!previewUrl || !excelCtrl) {
141
- throw new Error('预览URL或Excel控制器未配置');
141
+ message.error('预览URL或Excel控制器未配置');
142
+ return { success: false };
142
143
  }
143
144
 
144
145
  try {