@skyfox2000/webui 1.3.20 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/lib/assets/modules/{baseLayout-B9dSxkYo.js → baseLayout-DIEq13qJ.js} +6 -6
  2. package/lib/assets/modules/{file-upload-JBIvw5Xx.js → file-upload-DGuLxYSu.js} +2 -2
  3. package/lib/assets/modules/{index-BMkaOjBS.js → index-BPufvr-r.js} +134 -133
  4. package/lib/assets/modules/{index-BOYtm8ib.js → index-CAtotNY6.js} +2 -2
  5. package/lib/assets/modules/{index-BkChvyed.js → index-DVzBH6zL.js} +1 -1
  6. package/lib/assets/modules/{menuTabs-BFPjaQRI.js → menuTabs-DKvoic5x.js} +7 -7
  7. package/lib/assets/modules/{toolIcon-XOgjdQdO.js → toolIcon-Y7Lpx2Hb.js} +1 -1
  8. package/lib/assets/modules/{uploadList-BedljASx.js → uploadList-Bh2SzZzX.js} +710 -701
  9. package/lib/assets/modules/{uploadList-CW7OIDS3.js → uploadList-DG33cpFl.js} +152 -146
  10. package/lib/components/common/icon/index.vue.d.ts +1 -1
  11. package/lib/es/AceEditor/index.js +3 -3
  12. package/lib/es/BasicLayout/index.js +2 -2
  13. package/lib/es/Error403/index.js +1 -1
  14. package/lib/es/Error404/index.js +1 -1
  15. package/lib/es/ExcelForm/index.js +38 -38
  16. package/lib/es/MenuLayout/index.js +2 -2
  17. package/lib/es/UploadForm/index.js +4 -4
  18. package/lib/stores/userInfo.d.ts +3 -1
  19. package/lib/typings/form.d.ts +1 -1
  20. package/lib/typings/tree.d.ts +4 -0
  21. package/lib/utils/micro-openapis.d.ts +35 -0
  22. package/lib/webui.es.js +358 -353
  23. package/package.json +1 -2
  24. package/src/components/content/dialog/excelForm.vue +1 -1
  25. package/src/components/content/form/formItem.vue +5 -0
  26. package/src/components/layout/header/headerExits.vue +1 -1
  27. package/src/stores/appInfo.ts +7 -8
  28. package/src/stores/userInfo.ts +21 -63
  29. package/src/typings/form.d.ts +1 -1
  30. package/src/typings/tree.d.ts +4 -0
  31. package/src/utils/data.ts +6 -0
  32. package/src/utils/download.ts +10 -1
  33. package/src/utils/export-table.ts +5 -0
  34. package/src/utils/form-excel.ts +14 -9
  35. package/src/utils/form.ts +7 -1
  36. package/src/utils/main-openapis.ts +2 -2
  37. package/src/utils/micro-openapis.ts +146 -0
  38. package/src/utils/options.ts +5 -0
  39. package/src/utils/table.ts +7 -2
  40. package/src/utils/tree.ts +4 -2
@@ -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-DVzBH6zL.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, a2 as Se, a8 as Ee } from "../../assets/modules/uploadList-Bh2SzZzX.js";
6
+ import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-DGuLxYSu.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-BPufvr-r.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-BPufvr-r.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-DIEq13qJ.js";
3
+ import { ae as A, a as S } from "../../assets/modules/uploadList-Bh2SzZzX.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-DVzBH6zL.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 { a4 as h } from "../../assets/modules/uploadList-Bh2SzZzX.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-DGuLxYSu.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-DG33cpFl.js";
13
13
  const K = /* @__PURE__ */ y({
14
14
  __name: "uploadForm",
15
15
  props: {
@@ -1,6 +1,8 @@
1
1
  import { ApiResponse } from '../../../502417_fapi';
2
2
  import { LoginInfo, UserInfo } from '../../../502424_MicroBase';
3
3
  import { StoreDefinition } from 'pinia';
4
+ export declare const LoginExpired = "\u767B\u5F55\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";
5
+ export declare const LoginExpiredError = 1401;
4
6
  interface UserState {
5
7
  isLogin: boolean;
6
8
  userInfo: UserInfo;
@@ -20,6 +22,6 @@ export declare const useUserInfo: StoreDefinition<"userInfo", UserState, {}, {
20
22
  isAdmin(): boolean;
21
23
  getUserLevel(): string;
22
24
  clean(): Promise<void>;
23
- logout(): Promise<void>;
25
+ logout(exit: boolean): Promise<void>;
24
26
  }>;
25
27
  export {};
@@ -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
  };
@@ -0,0 +1,35 @@
1
+ interface MainApis {
2
+ getAppInfo: () => Promise<any>;
3
+ getHostInfo: () => Promise<any>;
4
+ getUserInfo: () => Promise<any>;
5
+ getToken: () => Promise<any>;
6
+ userLogin: (params: any) => Promise<any>;
7
+ userLogout: () => Promise<any>;
8
+ mainAppPush: (params: any) => Promise<any>;
9
+ }
10
+ type MainApiMethod = keyof MainApis;
11
+ declare class MicroAppSDK {
12
+ constructor();
13
+ ensureMicroAppReady(): void;
14
+ getMainApis(): Partial<MainApis>;
15
+ isInMicroApp(): boolean;
16
+ callMainApi<T extends MainApiMethod>(methodName: T, params?: any): Promise<ReturnType<MainApis[T]>>;
17
+ getAppInfo(): Promise<any>;
18
+ getHostInfo(): Promise<any>;
19
+ getUserInfo(): Promise<any>;
20
+ getToken(): Promise<any>;
21
+ userLogin(params: any): Promise<any>;
22
+ userLogout(): Promise<any>;
23
+ mainAppPush(params: any): Promise<any>;
24
+ }
25
+ declare const microAppSDKInstance: MicroAppSDK;
26
+ export default microAppSDKInstance;
27
+ export { MicroAppSDK, microAppSDKInstance };
28
+ export declare const getAppInfo: () => Promise<any>;
29
+ export declare const getHostInfo: () => Promise<any>;
30
+ export declare const getUserInfo: () => Promise<any>;
31
+ export declare const getToken: () => Promise<any>;
32
+ export declare const userLogin: (params: any) => Promise<any>;
33
+ export declare const userLogout: () => Promise<any>;
34
+ export declare const mainAppPush: (params: any) => Promise<any>;
35
+ export declare const isInMicroApp: () => boolean;