@skyfox2000/webui 1.3.20 → 1.3.21

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,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-XOgjdQdO.js";
4
- import { I as C, _ as S, f as w, d as $, g as N } from "./menuTabs-BFPjaQRI.js";
5
- import { ad as v, a as B, af as E } from "./uploadList-BedljASx.js";
3
+ import { a as b } from "./toolIcon-BuqRfX4F.js";
4
+ import { I as C, _ as S, f as w, d as $, g as N } from "./menuTabs-NVgroqVO.js";
5
+ import { ad as v, a as B, af as E } from "./uploadList-B6MIYOtN.js";
6
6
  import "@skyfox2000/microbase";
7
7
  import "@skyfox2000/fapi";
8
8
  import L from "vue-m-message";
@@ -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-BedljASx.js";
5
+ import { ae as S, ad as w, u as g } from "./uploadList-B6MIYOtN.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,10 +1,10 @@
1
1
  import S from "async-validator";
2
2
  import { httpPost as M, ResStatus as V } from "@skyfox2000/fapi";
3
- import { i as T, ag as $ } from "./uploadList-BedljASx.js";
3
+ import { i as T, ag as $ } from "./uploadList-B6MIYOtN.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 O, normalizeStyle as A } from "vue";
6
6
  import { Spin as N, Alert as L } from "ant-design-vue";
7
- import { _ as K } from "./toolIcon-XOgjdQdO.js";
7
+ import { _ as K } from "./toolIcon-BuqRfX4F.js";
8
8
  const j = (i) => {
9
9
  const e = i.split(`
10
10
  `).filter((c) => c.trim() !== "");
@@ -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-BkChvyed.js";
2
+ import { _ as m } from "./index-D0njzOzQ.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-BedljASx.js";
5
+ import { P as M, d as P, o as $, b as K } from "./uploadList-B6MIYOtN.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-XOgjdQdO.js";
3
+ import { a as P, _ as k } from "./toolIcon-BuqRfX4F.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-XOgjdQdO.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-BedljASx.js";
2
+ import { a as w, _ as b } from "./toolIcon-BuqRfX4F.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-B6MIYOtN.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-BedljASx.js";
4
+ import { c as S } from "./uploadList-B6MIYOtN.js";
5
5
  const T = /* @__PURE__ */ i({
6
6
  __name: "index",
7
7
  props: {
@@ -1,11 +1,11 @@
1
1
  var ma = Object.defineProperty;
2
2
  var va = (e, t, a) => t in e ? ma(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
3
  var $ = (e, t, a) => va(e, typeof t != "symbol" ? t + "" : t, a);
4
- import { inject as te, ref as f, provide as Le, watch as g, toRaw as Ze, h as U, nextTick as ga, shallowRef as K, defineComponent as X, reactive as ya, onMounted as xe, onUnmounted as ie, createBlock as Ae, createCommentVNode as B, openBlock as E, unref as b, mergeProps as le, useAttrs as Ee, createElementBlock as L, createVNode as C, withCtx as V, createTextVNode as Oe, toDisplayString as z, Fragment as ne, renderList as Ue, normalizeClass as ea, createElementVNode as Sa } from "vue";
4
+ import { inject as te, ref as f, provide as Le, watch as g, toRaw as Ze, h as U, nextTick as ga, shallowRef as K, defineComponent as X, reactive as ya, onMounted as xe, onUnmounted as ie, createBlock as Ae, createCommentVNode as B, openBlock as E, unref as b, mergeProps as le, useAttrs as Ee, createElementBlock as L, createVNode as z, withCtx as V, createTextVNode as Oe, toDisplayString as C, Fragment as ne, renderList as Ue, normalizeClass as ea, createElementVNode as Sa } from "vue";
5
5
  import { Switch as ba, AutoComplete as Ia, Input as xa, CheckboxGroup as Aa, Checkbox as Ea, RadioGroup as Oa, Radio as Ra, Select as Ta, SelectOption as wa } from "ant-design-vue";
6
6
  import { createPinia as Pa, defineStore as ue } from "pinia";
7
7
  import ka from "pinia-plugin-persistedstate";
8
- import { combineParams as ce, EnvConfig as ye, AppAction as Be, AppSource as Ce, isMicroApp as Se, mainAppApis as N, isBaseMicroApp as La } from "@skyfox2000/microbase";
8
+ import { combineParams as ce, EnvConfig as ye, AppAction as Be, AppSource as ze, isMicroApp as Se, mainAppApis as N, isBaseMicroApp as La } from "@skyfox2000/microbase";
9
9
  import { ResStatus as T, httpPost as G, setToken as me, fieldMapping as $a, parseFieldTemplate as be, API_HOST as $e, SERVER_HOST as Fa } from "@skyfox2000/fapi";
10
10
  import x from "vue-m-message";
11
11
  import He from "async-validator";
@@ -229,7 +229,7 @@ const fe = {
229
229
  loadingState: e.isTreeLoading,
230
230
  loadingText: !1,
231
231
  processParams: () => ce(e.treeQuery, t)
232
- }).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data, e.data.value) : []);
232
+ }).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? (e.data.value = a.data || [], e.afterLoad && e.afterLoad(e.data.value), e.data.value) : (e.afterLoad && e.afterLoad((a == null ? void 0 : a.data) || []), []));
233
233
  let re;
234
234
  const Ft = (e) => {
235
235
  re = new He({}), re.messages({
@@ -418,7 +418,7 @@ const Ft = (e) => {
418
418
  ).then((n) => {
419
419
  var o, r;
420
420
  if ((n == null ? void 0 : n.status) === T.SUCCESS)
421
- x.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(), e.autoClose !== !1 && (e.visible.value = !1);
421
+ x.success("保存成功!"), e.grid && (e.grid.reload.value = !0), e.afterSave && e.afterSave(n), e.autoClose !== !1 && (e.visible.value = !1);
422
422
  else if (n != null && n.msg && ((o = n == null ? void 0 : n.msg) == null ? void 0 : o.indexOf("Duplicate entry")) > -1) {
423
423
  const l = (r = n == null ? void 0 : n.msg) == null ? void 0 : r.match(/Duplicate entry '([^']+)' for key '([^']+)'/);
424
424
  if (l && l.length > 2 && l[1] && l[2]) {
@@ -437,8 +437,9 @@ const Ft = (e) => {
437
437
  }
438
438
  x.error(`保存失败!数据 \`${u}\` 已存在!`);
439
439
  } else x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
440
+ e.afterSave && e.afterSave(n);
440
441
  } else
441
- x.error((n == null ? void 0 : n.msg) ?? "保存失败!");
442
+ x.error((n == null ? void 0 : n.msg) ?? "保存失败!"), e.afterSave && e.afterSave(n);
442
443
  });
443
444
  }, Vt = async (e) => {
444
445
  const t = e.page, a = e.grid;
@@ -628,7 +629,7 @@ const Ja = (e) => {
628
629
  AppCode: "",
629
630
  Version: "",
630
631
  Host: "",
631
- Source: Ce.Manual,
632
+ Source: ze.Manual,
632
633
  Action: Be.App,
633
634
  Path: "",
634
635
  Icon: "",
@@ -797,7 +798,7 @@ const Ja = (e) => {
797
798
  AppCode: "",
798
799
  Version: "",
799
800
  Host: "",
800
- Source: Ce.Manual,
801
+ Source: ze.Manual,
801
802
  Action: Be.App,
802
803
  Path: "",
803
804
  Icon: "",
@@ -812,7 +813,7 @@ const Ja = (e) => {
812
813
  }
813
814
  },
814
815
  persist: !1
815
- }), ia = "Token解析失败", ze = "登录过期,请重新登录", je = {
816
+ }), ia = "Token解析失败", Ce = "登录过期,请重新登录", je = {
816
817
  login: {
817
818
  api: "PLATFORM_API",
818
819
  url: "/openapi/LoginSrv/login",
@@ -838,14 +839,14 @@ const Ja = (e) => {
838
839
  Query: e
839
840
  };
840
841
  return G(je.login, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a : null);
841
- }, Ca = (e) => {
842
+ }, za = (e) => {
842
843
  let t = {
843
844
  Query: {
844
845
  AppId: e
845
846
  }
846
847
  };
847
848
  return G(je.auth, t).then((a) => (a == null ? void 0 : a.status) === T.SUCCESS ? a.data : (x.error("获取授权信息失败," + (a == null ? void 0 : a.msg)), null));
848
- }, za = () => {
849
+ }, Ca = () => {
849
850
  let e = {
850
851
  Option: {},
851
852
  Query: {}
@@ -858,10 +859,10 @@ const Ja = (e) => {
858
859
  } catch (t) {
859
860
  return console.error(ia, t), !0;
860
861
  }
861
- }, Me = (e, t) => e == "" ? (x.error(ze, {
862
+ }, Me = (e, t) => e == "" ? (x.error(Ce, {
862
863
  duration: 3e3,
863
864
  onClose: t
864
- }), !1) : Ya(e) ? (x.error(ze, {
865
+ }), !1) : Ya(e) ? (x.error(Ce, {
865
866
  duration: 3e3,
866
867
  onClose: t
867
868
  }), !1) : !0, Xa = (e) => {
@@ -928,7 +929,7 @@ const Ja = (e) => {
928
929
  if (ee.value && ee.value.appId === e)
929
930
  return !0;
930
931
  try {
931
- const t = await Ca(e);
932
+ const t = await za(e);
932
933
  return t ? (ee.value = {
933
934
  appId: e,
934
935
  permits: t.permits || [],
@@ -1026,7 +1027,7 @@ const Ja = (e) => {
1026
1027
  */
1027
1028
  async logout() {
1028
1029
  try {
1029
- await za();
1030
+ await Ca();
1030
1031
  } catch (e) {
1031
1032
  console.error("调用登出接口失败", e);
1032
1033
  } finally {
@@ -1085,9 +1086,12 @@ const Ja = (e) => {
1085
1086
  return s.rows ? (e.tableData.value = s.rows, e.total.value = s.total) : (e.tableData.value = a.data, e.total.value = a.data.length, s = {
1086
1087
  total: e.total.value,
1087
1088
  rows: a.data
1088
- }, e.afterLoad && e.afterLoad(s)), s;
1089
+ }), e.afterLoad && e.afterLoad(s), s;
1089
1090
  }
1090
- return e.tableData.value = [], e.total.value = 0, {
1091
+ return e.tableData.value = [], e.total.value = 0, e.afterLoad && e.afterLoad({
1092
+ total: 0,
1093
+ rows: []
1094
+ }), {
1091
1095
  total: 0,
1092
1096
  rows: []
1093
1097
  };
@@ -1432,7 +1436,7 @@ const q = new at(), Z = (e, t, a) => {
1432
1436
  ), {
1433
1437
  gridCtrl: s
1434
1438
  };
1435
- }, Ct = (e, t) => {
1439
+ }, zt = (e, t) => {
1436
1440
  ke(e);
1437
1441
  const a = {
1438
1442
  ...S.TreeOption,
@@ -1475,7 +1479,7 @@ const q = new at(), Z = (e, t, a) => {
1475
1479
  ), {
1476
1480
  optionCtrl: a
1477
1481
  };
1478
- }, zt = (e, t, a) => {
1482
+ }, Ct = (e, t, a) => {
1479
1483
  ke(e);
1480
1484
  const s = {
1481
1485
  ...S.PageOption,
@@ -1968,7 +1972,7 @@ const q = new at(), Z = (e, t, a) => {
1968
1972
  }), (y, A) => {
1969
1973
  var h;
1970
1974
  return E(), L("div", null, [
1971
- C(b(Ia), le({
1975
+ z(b(Ia), le({
1972
1976
  value: l.value,
1973
1977
  "onUpdate:value": A[0] || (A[0] = (I) => l.value = I),
1974
1978
  class: ["w-full", (h = b(i)) == null ? void 0 : h.errClass],
@@ -1977,10 +1981,10 @@ const q = new at(), Z = (e, t, a) => {
1977
1981
  onSelect: O
1978
1982
  }, b(s), { "allow-clear": !1 }), {
1979
1983
  option: V(({ label: I }) => [
1980
- Oe(z(I), 1)
1984
+ Oe(C(I), 1)
1981
1985
  ]),
1982
1986
  default: V(() => [
1983
- C(b(xa), {
1987
+ z(b(xa), {
1984
1988
  "allow-clear": "",
1985
1989
  placeholder: "请输入并选择" + b(c)
1986
1990
  }, null, 8, ["placeholder"])
@@ -2047,7 +2051,7 @@ const q = new at(), Z = (e, t, a) => {
2047
2051
  }), ie(() => {
2048
2052
  r && de(r, a);
2049
2053
  }), (y, A) => (E(), L("div", mt, [
2050
- C(b(Aa), le({
2054
+ z(b(Aa), le({
2051
2055
  onChange: p,
2052
2056
  class: "w-full mb-[-3px]"
2053
2057
  }, b(s)), {
@@ -2066,11 +2070,11 @@ const q = new at(), Z = (e, t, a) => {
2066
2070
  ])
2067
2071
  }, {
2068
2072
  default: V(() => [
2069
- Oe(z(h.label), 1)
2073
+ Oe(C(h.label), 1)
2070
2074
  ]),
2071
2075
  _: 2
2072
2076
  }, 1032, ["value", "disabled", "class"]);
2073
- }), 128)) : e.nodata ? (E(), L("div", vt, z(e.nodata), 1)) : B("", !0)
2077
+ }), 128)) : e.nodata ? (E(), L("div", vt, C(e.nodata), 1)) : B("", !0)
2074
2078
  ]),
2075
2079
  _: 1
2076
2080
  }, 16)
@@ -2147,7 +2151,7 @@ const q = new at(), Z = (e, t, a) => {
2147
2151
  }), ie(() => {
2148
2152
  r && de(r, a);
2149
2153
  }), (h, I) => (E(), L("div", gt, [
2150
- C(b(Oa), le({
2154
+ z(b(Oa), le({
2151
2155
  value: u.value,
2152
2156
  "onUpdate:value": I[0] || (I[0] = (R) => u.value = R),
2153
2157
  autocheck: !1,
@@ -2172,12 +2176,12 @@ const q = new at(), Z = (e, t, a) => {
2172
2176
  ])
2173
2177
  }, {
2174
2178
  default: V(() => [
2175
- Oe(z(R.label), 1)
2179
+ Oe(C(R.label), 1)
2176
2180
  ]),
2177
2181
  _: 2
2178
2182
  }, 1032, ["checked", "value", "class"])) : B("", !0)
2179
2183
  ], 64);
2180
- }), 128)) : e.nodata ? (E(), L("div", yt, z(e.nodata), 1)) : B("", !0)
2184
+ }), 128)) : e.nodata ? (E(), L("div", yt, C(e.nodata), 1)) : B("", !0)
2181
2185
  ]),
2182
2186
  _: 1
2183
2187
  }, 16, ["value"])
@@ -2299,10 +2303,10 @@ const q = new at(), Z = (e, t, a) => {
2299
2303
  var _, We, qe;
2300
2304
  return E(), L("div", null, [
2301
2305
  (We = (_ = b(i)) == null ? void 0 : _.url) != null && We.loading ? (E(), L("div", St, [
2302
- C(b(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2306
+ z(b(De), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
2303
2307
  P[1] || (P[1] = Sa("span", null, "数据加载中...", -1))
2304
2308
  ])) : B("", !0),
2305
- C(b(Ta), le({
2309
+ z(b(Ta), le({
2306
2310
  class: [(qe = b(r)) == null ? void 0 : qe.errClass, "w-full"],
2307
2311
  value: d.value,
2308
2312
  "onUpdate:value": P[0] || (P[0] = (W) => d.value = W),
@@ -2320,7 +2324,7 @@ const q = new at(), Z = (e, t, a) => {
2320
2324
  value: W.value
2321
2325
  }, {
2322
2326
  default: V(() => [
2323
- Oe(z(W.label), 1)
2327
+ Oe(C(W.label), 1)
2324
2328
  ]),
2325
2329
  _: 2
2326
2330
  }, 1032, ["value"])) : B("", !0)
@@ -2343,8 +2347,8 @@ export {
2343
2347
  Bt as G,
2344
2348
  rt as H,
2345
2349
  ot as I,
2346
- Ct as J,
2347
- zt as K,
2350
+ zt as J,
2351
+ Ct as K,
2348
2352
  nt as L,
2349
2353
  fa as M,
2350
2354
  Yt as N,
@@ -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-BkChvyed.js";
3
- import { a as z, _ as L } from "./toolIcon-XOgjdQdO.js";
2
+ import { _ as ne } from "./index-D0njzOzQ.js";
3
+ import { a as z, _ as L } from "./toolIcon-BuqRfX4F.js";
4
4
  import { httpPost as D, ResStatus as I } from "@skyfox2000/fapi";
5
- import { s as ae, _ as se } from "./uploadList-BedljASx.js";
6
- import { p as R, U as s } from "./file-upload-JBIvw5Xx.js";
5
+ import { s as ae, _ as se } from "./uploadList-B6MIYOtN.js";
6
+ import { p as R, U as s } from "./file-upload-CmnCEJze.js";
7
7
  import { combineParams as V } from "@skyfox2000/microbase";
8
8
  import k from "vue-m-message";
9
9
  import "async-validator";
@@ -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-XOgjdQdO.js";
3
+ import { _ as q } from "../../assets/modules/toolIcon-BuqRfX4F.js";
4
4
  import "@skyfox2000/fapi";
5
- import "../../assets/modules/uploadList-BedljASx.js";
5
+ import "../../assets/modules/uploadList-B6MIYOtN.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-BOYtm8ib.js";
10
+ import { _ as D } from "../../assets/modules/index-CvQ24Mzh.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,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, createBlock as o, openBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as w, KeepAlive as y, unref as n, resolveDynamicComponent as I } from "vue";
2
- import { _ as g } from "../../assets/modules/baseLayout-B9dSxkYo.js";
3
- import { ad as A, a as S } from "../../assets/modules/uploadList-BedljASx.js";
2
+ import { _ as g } from "../../assets/modules/baseLayout-Bz3oRE5o.js";
3
+ import { ad as A, a as S } from "../../assets/modules/uploadList-B6MIYOtN.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import b 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-BedljASx.js";
2
+ import { r as s } from "../../assets/modules/uploadList-B6MIYOtN.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-BedljASx.js";
2
+ import { r as s } from "../../assets/modules/uploadList-B6MIYOtN.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,12 +1,12 @@
1
- import { defineComponent as we, ref as f, computed as T, watch as W, onMounted as be, createBlock as H, openBlock as d, unref as i, withCtx as S, renderSlot as J, createElementBlock as g, createCommentVNode as K, createElementVNode as h, createVNode as C, createTextVNode as X, toDisplayString as E, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
2
- import { _ as Y } from "../../assets/modules/index-BkChvyed.js";
1
+ import { defineComponent as we, ref as f, computed as T, watch as W, onMounted as be, createBlock as H, openBlock as d, unref as n, withCtx as S, renderSlot as J, createElementBlock as g, createCommentVNode as K, createElementVNode as h, createVNode as C, createTextVNode as X, toDisplayString as E, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
2
+ import { _ as Y } from "../../assets/modules/index-D0njzOzQ.js";
3
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-BedljASx.js";
6
- import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-JBIvw5Xx.js";
5
+ import { E as Te, a1 as Se, a7 as Ee } from "../../assets/modules/uploadList-B6MIYOtN.js";
6
+ import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-CmnCEJze.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import p from "vue-m-message";
9
- import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-BMkaOjBS.js";
9
+ import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-CAqiqqdd.js";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
12
  import "async-validator";
@@ -197,12 +197,12 @@ const Be = (l) => l.includes(",") || l.includes(`
197
197
  p.warning("请先选择文件!"), a.isFormSaving.value = !1;
198
198
  return;
199
199
  }
200
- const r = new Re(t, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", n = new File([L.value], y.value, {
200
+ const r = new Re(t, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", i = new File([L.value], y.value, {
201
201
  type: u
202
202
  }), c = De.join(((o = F.value) == null ? void 0 : o.basePath) ?? "", y.value), v = {
203
203
  uid: "1",
204
204
  name: y.value,
205
- originFileObj: n,
205
+ originFileObj: i,
206
206
  status: ce.Uploading,
207
207
  percent: 0,
208
208
  params: {
@@ -220,9 +220,9 @@ const Be = (l) => l.includes(",") || l.includes(`
220
220
  }, ye = async (t) => {
221
221
  if (a.formData.value) {
222
222
  if (e.excelRecordsKey || e.excelRowsKey) {
223
- const n = await Ne(L.value);
224
- if (!n) return null;
225
- const { excelData: c, excelRows: v } = n, x = c.map((N) => {
223
+ const i = await Ne(L.value);
224
+ if (!i) return null;
225
+ const { excelData: c, excelRows: v } = i, x = c.map((N) => {
226
226
  var Q;
227
227
  const w = {};
228
228
  for (const O in N) {
@@ -247,14 +247,14 @@ const Be = (l) => l.includes(",") || l.includes(`
247
247
  return;
248
248
  a.isFormSaving.value = !0;
249
249
  try {
250
- const n = await Ee(e.excelCtrl, {
250
+ const i = await Ee(e.excelCtrl, {
251
251
  params: u,
252
252
  urlKey: "save",
253
253
  url: e.excelCtrl.saveUrl
254
254
  });
255
- (n == null ? void 0 : n.status) === fe.SUCCESS && (a.afterSave && a.afterSave(), a.visible.value = !1);
256
- } catch (n) {
257
- console.error("保存错误:", n), p.error("数据保存失败,请稍后再试!");
255
+ (i == null ? void 0 : i.status) === fe.SUCCESS && (a.afterSave && a.afterSave(i), a.visible.value = !1);
256
+ } catch (i) {
257
+ console.error("保存错误:", i), p.error("数据保存失败,请稍后再试!");
258
258
  } finally {
259
259
  a.isFormSaving.value = !1;
260
260
  }
@@ -268,11 +268,11 @@ const Be = (l) => l.includes(",") || l.includes(`
268
268
  const {
269
269
  errBlob: r,
270
270
  validationMsg: u,
271
- duplicateMsg: n,
271
+ duplicateMsg: i,
272
272
  hasFormatError: c,
273
273
  hasDuplicateError: v
274
274
  } = await Ke(t, a.formRules.value, _.value, D.value);
275
- if (V.value = u, P.value = n, B.value = c ? "error" : a.formRules.value && Object.keys(a.formRules.value).length > 0 ? "success" : "warning", $.value = v ? "error" : _.value && _.value.length > 0 ? "success" : "warning", r) {
275
+ if (V.value = u, P.value = i, B.value = c ? "error" : a.formRules.value && Object.keys(a.formRules.value).length > 0 ? "success" : "warning", $.value = v ? "error" : _.value && _.value.length > 0 ? "success" : "warning", r) {
276
276
  U.value = c ?? !1, k.value = v ?? !1;
277
277
  const x = URL.createObjectURL(r);
278
278
  b.value = x;
@@ -288,9 +288,9 @@ const Be = (l) => l.includes(",") || l.includes(`
288
288
  return;
289
289
  }
290
290
  F.value = e.uploadParams;
291
- 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";
291
+ 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"), i = e.fileType || "both";
292
292
  let c = !1, v = "";
293
- switch (n) {
293
+ switch (i) {
294
294
  case "excel":
295
295
  c = r, v = "只能上传Excel文件!";
296
296
  break;
@@ -306,7 +306,7 @@ const Be = (l) => l.includes(",") || l.includes(`
306
306
  return p.error(v), ue.LIST_IGNORE;
307
307
  try {
308
308
  if (A(), y.value = t.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
309
- const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-BMkaOjBS.js").then((he) => he.j), M = await G(O, t.name);
309
+ const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-CAqiqqdd.js").then((he) => he.j), M = await G(O, t.name);
310
310
  if (!M.success)
311
311
  throw new Error(M.error || "CSV文件处理失败");
312
312
  const oe = await (await fetch(M.blobUrl)).arrayBuffer();
@@ -348,7 +348,7 @@ const Be = (l) => l.includes(",") || l.includes(`
348
348
  };
349
349
  return s({
350
350
  clearAll: A
351
- }), (t, o) => (d(), H(i(Fe), {
351
+ }), (t, o) => (d(), H(n(Fe), {
352
352
  title: t.title ?? "文件上传",
353
353
  open: m.value,
354
354
  "onUpdate:open": o[0] || (o[0] = (r) => m.value = r),
@@ -357,22 +357,22 @@ const Be = (l) => l.includes(",") || l.includes(`
357
357
  onClose: se
358
358
  }, {
359
359
  footer: S(() => [
360
- C(i(_e), null, {
360
+ C(n(_e), null, {
361
361
  default: S(() => {
362
362
  var r;
363
363
  return [
364
- C(i(Y), { onClick: se }, {
364
+ C(n(Y), { onClick: se }, {
365
365
  default: S(() => [
366
366
  X(E(t.cancelText ?? (z.value ? "关闭" : "取消")), 1)
367
367
  ]),
368
368
  _: 1
369
369
  }),
370
- z.value ? K("", !0) : (d(), H(i(Y), {
370
+ z.value ? K("", !0) : (d(), H(n(Y), {
371
371
  key: 0,
372
372
  onClick: me,
373
373
  type: "primary",
374
- loading: ((r = i(a)) == null ? void 0 : r.isFormSaving.value) ?? !1,
375
- disabled: !b.value || U.value || k.value || i(a).isFormLoading.value
374
+ loading: ((r = n(a)) == null ? void 0 : r.isFormSaving.value) ?? !1,
375
+ disabled: !b.value || U.value || k.value || n(a).isFormLoading.value
376
376
  }, {
377
377
  default: S(() => [
378
378
  X(E(t.saveText ?? "上传文件"), 1)
@@ -388,7 +388,7 @@ const Be = (l) => l.includes(",") || l.includes(`
388
388
  J(t.$slots, "default"),
389
389
  z.value ? K("", !0) : (d(), g("div", $e, [
390
390
  J(t.$slots, "file-before"),
391
- C(i(ue), {
391
+ C(n(ue), {
392
392
  "file-list": le.value,
393
393
  "before-upload": xe,
394
394
  accept: de.value,
@@ -396,7 +396,7 @@ const Be = (l) => l.includes(",") || l.includes(`
396
396
  disabled: !te.value
397
397
  }, {
398
398
  default: S(() => [
399
- C(i(Y), {
399
+ C(n(Y), {
400
400
  type: "primary",
401
401
  disabled: !te.value
402
402
  }, {
@@ -409,7 +409,7 @@ const Be = (l) => l.includes(",") || l.includes(`
409
409
  _: 1
410
410
  }, 8, ["file-list", "accept", "disabled"]),
411
411
  b.value && y.value ? (d(), g("div", je, [
412
- C(i(Z), {
412
+ C(n(Z), {
413
413
  message: y.value,
414
414
  type: "info",
415
415
  "show-icon": !1
@@ -418,15 +418,15 @@ const Be = (l) => l.includes(",") || l.includes(`
418
418
  J(t.$slots, "file-after")
419
419
  ])),
420
420
  h("div", Ae, [
421
- i(a).isFormLoading.value ? (d(), H(i(Le), {
421
+ n(a).isFormLoading.value ? (d(), H(n(Le), {
422
422
  key: 0,
423
423
  size: "large"
424
424
  })) : K("", !0),
425
425
  h("div", {
426
- class: Ce(["flex-shrink-0 relative border border-gray-200 rounded-md overflow-hidden", [i(j).length === 0 ? "w-[100%]" : "w-[80%]"]]),
426
+ class: Ce(["flex-shrink-0 relative border border-gray-200 rounded-md overflow-hidden", [n(j).length === 0 ? "w-[100%]" : "w-[80%]"]]),
427
427
  style: { height: "430px" }
428
428
  }, [
429
- C(i(Ve), {
429
+ C(n(Ve), {
430
430
  src: b.value,
431
431
  onError: ge,
432
432
  style: { width: "100%", height: "100%" },
@@ -440,31 +440,31 @@ const Be = (l) => l.includes(",") || l.includes(`
440
440
  }
441
441
  }, null, 8, ["src"])
442
442
  ], 2),
443
- i(j).length > 0 ? (d(), g("div", Oe, [
443
+ n(j).length > 0 ? (d(), g("div", Oe, [
444
444
  h("div", Ge, [
445
- i(j).length === 0 ? (d(), g("div", Ie, "没有设置验证规则")) : (d(), g("div", qe, [
446
- C(i(Z), {
445
+ n(j).length === 0 ? (d(), g("div", Ie, "没有设置验证规则")) : (d(), g("div", qe, [
446
+ C(n(Z), {
447
447
  message: V.value,
448
448
  type: B.value,
449
449
  "show-icon": "",
450
450
  class: "mb-2"
451
451
  }, null, 8, ["message", "type"]),
452
452
  h("div", Qe, [
453
- (d(!0), g(ie, null, ne(i(j), (r, u) => (d(), g("div", {
453
+ (d(!0), g(ie, null, ne(n(j), (r, u) => (d(), g("div", {
454
454
  key: u,
455
455
  class: "border-b pb-0"
456
456
  }, [
457
457
  h("div", We, E(r.field), 1),
458
458
  h("ul", He, [
459
- (d(!0), g(ie, null, ne(r.rules, (n, c) => (d(), g("li", {
459
+ (d(!0), g(ie, null, ne(r.rules, (i, c) => (d(), g("li", {
460
460
  key: c,
461
461
  class: "text-[12px] text-gray-600"
462
- }, E(n), 1))), 128))
462
+ }, E(i), 1))), 128))
463
463
  ])
464
464
  ]))), 128))
465
465
  ]),
466
466
  _.value && _.value.length > 0 ? (d(), g("div", Je, [
467
- C(i(Z), {
467
+ C(n(Z), {
468
468
  message: P.value,
469
469
  type: $.value,
470
470
  "show-icon": "",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, ref as d, watch as _, onMounted as v, resolveComponent as h, createBlock as o, openBlock as t, withCtx as s, createElementVNode as C, normalizeClass as x, createVNode as w, KeepAlive as I, unref as n, resolveDynamicComponent as g } from "vue";
2
- import { _ as y } from "../../assets/modules/baseLayout-B9dSxkYo.js";
3
- import { ad as A, a as S } from "../../assets/modules/uploadList-BedljASx.js";
2
+ import { _ as y } from "../../assets/modules/baseLayout-Bz3oRE5o.js";
3
+ import { ad as A, a as S } from "../../assets/modules/uploadList-B6MIYOtN.js";
4
4
  import "@skyfox2000/microbase";
5
5
  import "@skyfox2000/fapi";
6
6
  import k from "vue-m-message";
@@ -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-BkChvyed.js";
2
+ import { _ as c } from "../../assets/modules/index-D0njzOzQ.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-BedljASx.js";
5
+ import { a3 as h } from "../../assets/modules/uploadList-B6MIYOtN.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-JBIvw5Xx.js";
10
+ import { A as N } from "../../assets/modules/file-upload-CmnCEJze.js";
11
11
  import "vue-draggable-next";
12
- import { U as B } from "../../assets/modules/uploadList-CW7OIDS3.js";
12
+ import { U as B } from "../../assets/modules/uploadList-KG6kpOaY.js";
13
13
  const K = /* @__PURE__ */ y({
14
14
  __name: "uploadForm",
15
15
  props: {
@@ -76,7 +76,7 @@ export type EditorControl<T> = EditorControlOption & {
76
76
  * @param editorCtrl 表单配置数据
77
77
  * @param pageCtrl 页面控制器
78
78
  */
79
- afterSave?: () => void | undefined;
79
+ afterSave?: (result: ApiResponse<any>) => void | undefined;
80
80
  /**
81
81
  * 表单数据
82
82
  * - Model对象
@@ -69,4 +69,8 @@ export type TreeControl = TreeControlOption & {
69
69
  * 是否正在加载中
70
70
  */
71
71
  isTreeLoading: Ref<boolean>;
72
+ /**
73
+ * 表格数据加载后回调
74
+ */
75
+ afterLoad?: (result: TreeNode[] | null) => void;
72
76
  };
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 Pe, b as Ze, d as ea, e as Ee, 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 Y, B as ma, C as ha, D as ga, E as Be } from "./assets/modules/uploadList-BedljASx.js";
2
- import { a9 as Tl, N as $l, Q as Il, U as Dl, a8 as Pl, a6 as El, a7 as Fl, aa as Nl, X as Ml, S as Bl, a4 as Rl, a1 as Al, L as Ol, a3 as Ll, T as zl, G as Ul, Z as Vl, a2 as Yl, a5 as Kl, M as Wl, R as Hl, ab as jl, F as Ql, a0 as ql, ac as Gl, W as Jl, Y as Xl, V as Zl, ad as es, H as as, I as ts, ae as ls, K as ss, af as rs, J as os, $ as ns } from "./assets/modules/uploadList-BedljASx.js";
3
- import { A as cs, U as us, a as ds, g as ps, c as fs, d as vs, p as ms, u as hs, b as gs } from "./assets/modules/file-upload-JBIvw5Xx.js";
1
+ import { u as Je, i as Z, a as me, c as Xe, P as j, o as Pe, b as Ze, d as ea, e as Ee, 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 Y, B as ma, C as ha, D as ga, E as Be } from "./assets/modules/uploadList-B6MIYOtN.js";
2
+ import { a9 as Tl, N as $l, Q as Il, U as Dl, a8 as Pl, a6 as El, a7 as Fl, aa as Nl, X as Ml, S as Bl, a4 as Rl, a1 as Al, L as Ol, a3 as Ll, T as zl, G as Ul, Z as Vl, a2 as Yl, a5 as Kl, M as Wl, R as Hl, ab as jl, F as Ql, a0 as ql, ac as Gl, W as Jl, Y as Xl, V as Zl, ad as es, H as as, I as ts, ae as ls, K as ss, af as rs, J as os, $ as ns } from "./assets/modules/uploadList-B6MIYOtN.js";
3
+ import { A as cs, U as us, a as ds, g as ps, c as fs, d as vs, p as ms, u as hs, b as gs } from "./assets/modules/file-upload-CmnCEJze.js";
4
4
  import { EnvConfig as we } from "@skyfox2000/microbase";
5
5
  import { FrontCache as re, httpPost as Re, ResStatus as Ae, 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 _e, MenuItem as xe, Dropdown as ve, Checkbox as Da, Table as Ye, Tree as Pa, Cascader as Ea, DatePicker as Fa, Input as ee, InputPassword as Na, InputNumber as Ma, RangePicker as Ba, Textarea as Ra, TimePicker as Aa, Transfer as Oa, TreeSelect as La, LayoutContent as za } from "ant-design-vue";
11
11
  import { VueDraggableNext as Ua } from "vue-draggable-next";
12
- import { d as Ke } from "./assets/modules/uploadList-CW7OIDS3.js";
13
- import { C as _s, U as xs, a as ys, p as ks } from "./assets/modules/uploadList-CW7OIDS3.js";
14
- import { c as We } from "./assets/modules/index-BMkaOjBS.js";
15
- import { _ as Ss, h as Cs, b as Ts, a as $s, d as Is, e as Ds, g as Ps, f as Es, n as Fs, p as Ns, t as Ms, v as Bs } from "./assets/modules/index-BMkaOjBS.js";
16
- import { _ as O } from "./assets/modules/index-BkChvyed.js";
17
- import { _ as U } from "./assets/modules/toolIcon-XOgjdQdO.js";
18
- import { a as As } from "./assets/modules/toolIcon-XOgjdQdO.js";
19
- import { _ as Ls, b as zs, c as Us, d as Vs, e as Ys, I as Ks, f as Ws, g as Hs, a as js } from "./assets/modules/menuTabs-BFPjaQRI.js";
20
- import { _ as qs } from "./assets/modules/index-BOYtm8ib.js";
12
+ import { d as Ke } from "./assets/modules/uploadList-KG6kpOaY.js";
13
+ import { C as _s, U as xs, a as ys, p as ks } from "./assets/modules/uploadList-KG6kpOaY.js";
14
+ import { c as We } from "./assets/modules/index-CAqiqqdd.js";
15
+ import { _ as Ss, h as Cs, b as Ts, a as $s, d as Is, e as Ds, g as Ps, f as Es, n as Fs, p as Ns, t as Ms, v as Bs } from "./assets/modules/index-CAqiqqdd.js";
16
+ import { _ as O } from "./assets/modules/index-D0njzOzQ.js";
17
+ import { _ as U } from "./assets/modules/toolIcon-BuqRfX4F.js";
18
+ import { a as As } from "./assets/modules/toolIcon-BuqRfX4F.js";
19
+ import { _ as Ls, b as zs, c as Us, d as Vs, e as Ys, I as Ks, f as Ws, g as Hs, a as js } from "./assets/modules/menuTabs-NVgroqVO.js";
20
+ import { _ as qs } from "./assets/modules/index-CvQ24Mzh.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)
@@ -616,7 +616,7 @@ const Gt = async (s, a) => {
616
616
  if (!a.rule)
617
617
  return !1;
618
618
  const o = f(a.rule.split("."), (p = t == null ? void 0 : t.formRules) == null ? void 0 : p.value);
619
- return o ? o.required ?? !0 : (Ta.error(`"${a.label}" 的验证规则 \`${a.rule}\` 不存在`), i.value.errClass = "text-[#ff4d4f]", i.value.msg = `规则 \`${a.rule}\` 不存在,请检查代码!`, !0);
619
+ return o ? (o.required || (i.value.errClass = "", i.value.msg = ""), o.required ?? !0) : (Ta.error(`"${a.label}" 的验证规则 \`${a.rule}\` 不存在`), i.value.errClass = "text-[#ff4d4f]", i.value.msg = `规则 \`${a.rule}\` 不存在,请检查代码!`, !0);
620
620
  });
621
621
  return (o, p) => (m(), S("div", {
622
622
  class: E(["relative", o.bottomMargin ? o.bottomMargin : "mb-1"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.3.20",
3
+ "version": "1.3.21",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -413,7 +413,7 @@ const dialogSave = async (uploadFile: UploadFile) => {
413
413
 
414
414
  if (result?.status === ResStatus.SUCCESS) {
415
415
  if (excelCtrl.afterSave) {
416
- excelCtrl.afterSave();
416
+ excelCtrl.afterSave(result);
417
417
  }
418
418
  excelCtrl.visible.value = false;
419
419
  }
@@ -81,6 +81,11 @@ const required = computed(() => {
81
81
  errInfo.value.msg = `规则 \`${props.rule}\` 不存在,请检查代码!`;
82
82
  return true;
83
83
  }
84
+ if (!rule.required) {
85
+ // 如果rule.required为false,则表示该字段是可选字段,不需要验证
86
+ errInfo.value.errClass = '';
87
+ errInfo.value.msg = '';
88
+ }
84
89
  return rule.required ?? true;
85
90
  });
86
91
 
@@ -77,7 +77,7 @@ export type EditorControl<T> = EditorControlOption & {
77
77
  * @param editorCtrl 表单配置数据
78
78
  * @param pageCtrl 页面控制器
79
79
  */
80
- afterSave?: () => void | undefined;
80
+ afterSave?: (result: ApiResponse<any>) => void | undefined;
81
81
  /**
82
82
  * 表单数据
83
83
  * - Model对象
@@ -70,4 +70,8 @@ export type TreeControl = TreeControlOption & {
70
70
  * 是否正在加载中
71
71
  */
72
72
  isTreeLoading: Ref<boolean>;
73
+ /**
74
+ * 表格数据加载后回调
75
+ */
76
+ afterLoad?: (result: TreeNode[] | null) => void;
73
77
  };
package/src/utils/form.ts CHANGED
@@ -95,7 +95,7 @@ export const saveForm = async <T>(editorCtrl: EditorControl<T>): Promise<void> =
95
95
  }
96
96
 
97
97
  if (editorCtrl.afterSave) {
98
- editorCtrl.afterSave();
98
+ editorCtrl.afterSave(result);
99
99
  }
100
100
  if (editorCtrl!.autoClose !== false) {
101
101
  editorCtrl!.visible.value = false;
@@ -128,8 +128,14 @@ export const saveForm = async <T>(editorCtrl: EditorControl<T>): Promise<void> =
128
128
  }
129
129
  message.error(`保存失败!数据 \`${fieldValue}\` 已存在!`);
130
130
  } else message.error(result?.msg ?? '保存失败!');
131
+ if (editorCtrl.afterSave) {
132
+ editorCtrl.afterSave(result);
133
+ }
131
134
  } else {
132
135
  message.error(result?.msg ?? '保存失败!');
136
+ if (editorCtrl.afterSave) {
137
+ editorCtrl.afterSave(result);
138
+ }
133
139
  }
134
140
  });
135
141
  };
@@ -140,14 +140,19 @@ export const gridQueryFind = <T>(gridCtrl: GridControl<T>): Promise<FindResult>
140
140
  total: gridCtrl.total.value,
141
141
  rows: result.data as unknown as Record<string, any>[],
142
142
  };
143
-
144
- if (gridCtrl.afterLoad) gridCtrl.afterLoad(findResult);
145
143
  }
144
+ if (gridCtrl.afterLoad) gridCtrl.afterLoad(findResult);
146
145
  return findResult;
147
146
  }
148
147
 
149
148
  gridCtrl.tableData.value = [];
150
149
  gridCtrl.total.value = 0;
150
+ if (gridCtrl.afterLoad) {
151
+ gridCtrl.afterLoad({
152
+ total: 0,
153
+ rows: [],
154
+ });
155
+ }
151
156
  return {
152
157
  total: 0,
153
158
  rows: [],
package/src/utils/tree.ts CHANGED
@@ -20,9 +20,11 @@ export const queryTree = (treeCtrl: TreeControl, params?: ReqParams): Promise<Tr
20
20
  },
21
21
  }).then((result: ApiResponse<TreeNode> | null) => {
22
22
  if (result?.status === ResStatus.SUCCESS) {
23
- treeCtrl.data.value = result.data as unknown as TreeNode[];
24
- return treeCtrl.data.value as unknown as TreeNode[];
23
+ treeCtrl.data.value = (result.data as unknown as TreeNode[]) || [];
24
+ if (treeCtrl.afterLoad) treeCtrl.afterLoad(treeCtrl.data.value);
25
+ return treeCtrl.data.value;
25
26
  }
27
+ if (treeCtrl.afterLoad) treeCtrl.afterLoad((result?.data as unknown as TreeNode[]) || []);
26
28
  return [];
27
29
  });
28
30
  };