@skyfox2000/webui 1.4.11 → 1.4.12

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,9 +1,9 @@
1
1
  import { defineComponent as ae, ref as P, computed as D, watch as B, resolveDirective as ie, createElementBlock as d, openBlock as u, normalizeClass as $, unref as n, createElementVNode as h, withDirectives as y, createBlock as re, mergeProps as le, withCtx as w, createVNode as p, createTextVNode as z, toDisplayString as T, Fragment as ce, renderList as ue, createCommentVNode as C } from "vue";
2
- import { _ as pe } from "./index-C6BAsERS.js";
3
- import { a as A, _ as I } from "./toolIcon-DDp0EFRE.js";
2
+ import { _ as pe } from "./index-CTuByOKL.js";
3
+ import { a as A, _ as I } from "./toolIcon-ChaoBuya.js";
4
4
  import { httpPost as K, ResStatus as j } from "@skyfox2000/fapi";
5
- import { L as V, u as q, t as de, _ as me } from "./upload-template-BK8iQQYz.js";
6
- import { U as i, f as fe, p as Q } from "./file-upload-T2kmeyGd.js";
5
+ import { L as V, u as q, t as de, _ as me } from "./upload-template-cMYO_YLd.js";
6
+ import { U as i, f as fe, p as Q } from "./file-upload-CB2izhwm.js";
7
7
  import { combineParams as G } from "@skyfox2000/microbase";
8
8
  import _ 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-DDp0EFRE.js";
3
+ import { _ as q } from "../../assets/modules/toolIcon-ChaoBuya.js";
4
4
  import "@skyfox2000/fapi";
5
- import "../../assets/modules/upload-template-BK8iQQYz.js";
5
+ import "../../assets/modules/upload-template-cMYO_YLd.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-Cwr2EDEI.js";
10
+ import { _ as D } from "../../assets/modules/index-B4b_Nr4U.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 g, unref as n, resolveDynamicComponent as y } from "vue";
2
- import { _ as I } from "../../assets/modules/baseLayout-DSVT_hCt.js";
3
- import { ag as A, a as S } from "../../assets/modules/upload-template-BK8iQQYz.js";
2
+ import { _ as I } from "../../assets/modules/baseLayout-CcWMwINU.js";
3
+ import { ag as A, a as S } from "../../assets/modules/upload-template-cMYO_YLd.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/upload-template-BK8iQQYz.js";
2
+ import { r as s } from "../../assets/modules/upload-template-cMYO_YLd.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/upload-template-BK8iQQYz.js";
2
+ import { r as s } from "../../assets/modules/upload-template-cMYO_YLd.js";
3
3
  import "@skyfox2000/microbase";
4
4
  import "@skyfox2000/fapi";
5
5
  import "vue-m-message";
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as we, ref as f, computed as T, watch as H, onMounted as be, createBlock as W, 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-C6BAsERS.js";
2
+ import { _ as Y } from "../../assets/modules/index-CTuByOKL.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 { F as Te, a3 as Se, a9 as Ee } from "../../assets/modules/upload-template-BK8iQQYz.js";
6
- import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-T2kmeyGd.js";
5
+ import { F as Te, a3 as Se, a9 as Ee } from "../../assets/modules/upload-template-cMYO_YLd.js";
6
+ import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-CB2izhwm.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-DkMjvF98.js";
9
+ import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-Ct3cEgTF.js";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
12
  import "async-validator";
@@ -307,7 +307,7 @@ const Be = (l) => l.includes(",") || l.includes(`
307
307
  return p.error(v), ue.LIST_IGNORE;
308
308
  try {
309
309
  if (A(), y.value = t.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
310
- const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-DkMjvF98.js").then((he) => he.j), M = await G(O, t.name);
310
+ const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-Ct3cEgTF.js").then((he) => he.j), M = await G(O, t.name);
311
311
  if (!M.success)
312
312
  throw new Error(M.error || "CSV文件处理失败");
313
313
  const oe = await (await fetch(M.blobUrl)).arrayBuffer();
@@ -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 g, KeepAlive as w, unref as n, resolveDynamicComponent as I } from "vue";
2
- import { _ as y } from "../../assets/modules/baseLayout-DSVT_hCt.js";
3
- import { ag as A, a as S } from "../../assets/modules/upload-template-BK8iQQYz.js";
2
+ import { _ as y } from "../../assets/modules/baseLayout-CcWMwINU.js";
3
+ import { ag as A, a as S } from "../../assets/modules/upload-template-cMYO_YLd.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 x, ref as o, watch as S, onMounted as h, createBlock as C, openBlock as F, unref as m, withCtx as s, createVNode as f, createTextVNode as q } from "vue";
2
- import { _ as L } from "../../assets/modules/index-C6BAsERS.js";
2
+ import { _ as L } from "../../assets/modules/index-CTuByOKL.js";
3
3
  import { Modal as z, Space as D } from "ant-design-vue";
4
4
  import { httpPost as N, ResStatus as O } from "@skyfox2000/fapi";
5
- import { aj as d } from "../../assets/modules/upload-template-BK8iQQYz.js";
6
- import { U as b } from "../../assets/modules/file-upload-T2kmeyGd.js";
5
+ import { aj as d } from "../../assets/modules/upload-template-cMYO_YLd.js";
6
+ import { U as b } from "../../assets/modules/file-upload-CB2izhwm.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import "vue-m-message";
9
9
  import "async-validator";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
- import { U as j } from "../../assets/modules/uploadList-B8p45yS2.js";
12
+ import { U as j } from "../../assets/modules/uploadList-qzgXU9sK.js";
13
13
  const _ = /* @__PURE__ */ x({
14
14
  __name: "templateFile",
15
15
  props: {
@@ -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-C6BAsERS.js";
2
+ import { _ as c } from "../../assets/modules/index-CTuByOKL.js";
3
3
  import { Modal as _, Space as k } from "ant-design-vue";
4
4
  import { ResStatus as E } from "@skyfox2000/fapi";
5
- import { a5 as h } from "../../assets/modules/upload-template-BK8iQQYz.js";
5
+ import { a5 as h } from "../../assets/modules/upload-template-cMYO_YLd.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-T2kmeyGd.js";
10
+ import { A as N } from "../../assets/modules/file-upload-CB2izhwm.js";
11
11
  import "vue-draggable-next";
12
- import { U as B } from "../../assets/modules/uploadList-B8p45yS2.js";
12
+ import { U as B } from "../../assets/modules/uploadList-qzgXU9sK.js";
13
13
  const K = /* @__PURE__ */ y({
14
14
  __name: "uploadForm",
15
15
  props: {
@@ -2,6 +2,7 @@ import { AppInfo, HostInfo, UserInfo } from '../../../502424_MicroBase';
2
2
  declare class MicroAppSDK {
3
3
  private static messageId;
4
4
  private static callbacks;
5
+ private static pendingRequests;
5
6
  static isInMicroApp(): boolean;
6
7
  private static callMainAppMethod;
7
8
  static handleResponseData(data: any): void;
package/lib/webui.es.js CHANGED
@@ -1,6 +1,6 @@
1
- import { u as Ee, i as Z, a as me, L as Xe, c as Ze, P as j, o as Pe, b as ea, d as aa, e as Fe, r as ce, f as ta, g as la, h as Ne, j as sa, k as ke, l as ra, _ as oa, m as na, O as Me, n as ia, q as Be, p as ca, s as ua, t as L, v as da, w as pa, x as fa, y as va, z as ma, A as ha, B as Y, C as ga, D as ba, E as xa, F as Re } from "./assets/modules/upload-template-BK8iQQYz.js";
2
- import { ab as Il, R as Dl, ad as El, S as Pl, W as Fl, aa as Nl, a8 as Ml, a9 as Bl, ac as Rl, Z as Ol, U as Al, a6 as Ll, a3 as zl, N as Ul, a5 as Vl, V as Yl, H as Kl, a0 as Wl, a4 as Hl, a7 as jl, Q as Ql, T as ql, ae as Gl, G as Jl, a2 as Xl, af as Zl, Y as es, $ as as, X as ts, ak as ls, aj as ss, ag as rs, I as os, J as ns, ah as is, M as cs, ai as us, K as ds, a1 as ps } from "./assets/modules/upload-template-BK8iQQYz.js";
3
- import { A as vs, U as ms, p as hs } from "./assets/modules/file-upload-T2kmeyGd.js";
1
+ import { u as Ee, i as Z, a as me, L as Xe, c as Ze, P as j, o as Pe, b as ea, d as aa, e as Fe, r as ce, f as ta, g as la, h as Ne, j as sa, k as ke, l as ra, _ as oa, m as na, O as Me, n as ia, q as Be, p as ca, s as ua, t as L, v as da, w as pa, x as fa, y as va, z as ma, A as ha, B as Y, C as ga, D as ba, E as xa, F as Re } from "./assets/modules/upload-template-cMYO_YLd.js";
2
+ import { ab as Il, R as Dl, ad as El, S as Pl, W as Fl, aa as Nl, a8 as Ml, a9 as Bl, ac as Rl, Z as Ol, U as Al, a6 as Ll, a3 as zl, N as Ul, a5 as Vl, V as Yl, H as Kl, a0 as Wl, a4 as Hl, a7 as jl, Q as Ql, T as ql, ae as Gl, G as Jl, a2 as Xl, af as Zl, Y as es, $ as as, X as ts, ak as ls, aj as ss, ag as rs, I as os, J as ns, ah as is, M as cs, ai as us, K as ds, a1 as ps } from "./assets/modules/upload-template-cMYO_YLd.js";
3
+ import { A as vs, U as ms, p as hs } from "./assets/modules/file-upload-CB2izhwm.js";
4
4
  import { EnvConfig as we } from "@skyfox2000/microbase";
5
5
  import { FrontCache as re, httpPost as Oe, ResStatus as Ae, SERVER_HOST as _a, 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 Ta, theme as ze, Drawer as $a, Space as te, Form as Ue, message as Ia, FormItem as Ve, ConfigProvider as Ce, Popconfirm as Da, Button as Ye, DropdownButton as Ea, Menu as xe, MenuItem as _e, Dropdown as ve, Checkbox as Pa, Table as Ke, Tree as Fa, Cascader as Na, DatePicker as Ma, Input as ee, InputPassword as Ba, InputNumber as Ra, RangePicker as Oa, Textarea as Aa, TimePicker as La, Transfer as za, TreeSelect as Ua, LayoutContent as Va } from "ant-design-vue";
11
11
  import { VueDraggableNext as Ya } from "vue-draggable-next";
12
- import { d as We } from "./assets/modules/uploadList-B8p45yS2.js";
13
- import { C as bs, U as xs, a as _s, p as ys } from "./assets/modules/uploadList-B8p45yS2.js";
14
- import { c as He } from "./assets/modules/index-DkMjvF98.js";
15
- import { _ as ws, h as Ss, b as Cs, a as Ts, d as $s, e as Is, g as Ds, f as Es, n as Ps, p as Fs, t as Ns, v as Ms } from "./assets/modules/index-DkMjvF98.js";
16
- import { _ as A } from "./assets/modules/index-C6BAsERS.js";
17
- import { _ as U } from "./assets/modules/toolIcon-DDp0EFRE.js";
18
- import { a as Rs } from "./assets/modules/toolIcon-DDp0EFRE.js";
19
- import { _ as As, b as Ls, c as zs, d as Us, e as Vs, I as Ys, f as Ks, g as Ws, a as Hs } from "./assets/modules/menuTabs-D99nhxm_.js";
20
- import { _ as Qs } from "./assets/modules/index-Cwr2EDEI.js";
12
+ import { d as We } from "./assets/modules/uploadList-qzgXU9sK.js";
13
+ import { C as bs, U as xs, a as _s, p as ys } from "./assets/modules/uploadList-qzgXU9sK.js";
14
+ import { c as He } from "./assets/modules/index-Ct3cEgTF.js";
15
+ import { _ as ws, h as Ss, b as Cs, a as Ts, d as $s, e as Is, g as Ds, f as Es, n as Ps, p as Fs, t as Ns, v as Ms } from "./assets/modules/index-Ct3cEgTF.js";
16
+ import { _ as A } from "./assets/modules/index-CTuByOKL.js";
17
+ import { _ as U } from "./assets/modules/toolIcon-ChaoBuya.js";
18
+ import { a as Rs } from "./assets/modules/toolIcon-ChaoBuya.js";
19
+ import { _ as As, b as Ls, c as zs, d as Us, e as Vs, I as Ys, f as Ks, g as Ws, a as Hs } from "./assets/modules/menuTabs-L6-Txvgp.js";
20
+ import { _ as Qs } from "./assets/modules/index-B4b_Nr4U.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.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -25,6 +25,7 @@ interface ApiResponseData {
25
25
  class MicroAppSDK {
26
26
  private static messageId = 0;
27
27
  private static callbacks = new Map<number, { resolve: Function; reject: Function }>();
28
+ private static pendingRequests = new Map<string, Promise<any>>();
28
29
 
29
30
  /**
30
31
  * 检查是否在微前端环境中运行
@@ -46,6 +47,15 @@ class MicroAppSDK {
46
47
  throw new Error(`未配置${method}接口!`);
47
48
  }
48
49
 
50
+ // 生成请求标识符(方法名+参数JSON字符串)
51
+ const requestKey = `${method}_${JSON.stringify(params)}`;
52
+
53
+ // 检查是否已有相同请求正在进行
54
+ if (this.pendingRequests.has(requestKey)) {
55
+ // 返回正在进行的请求的Promise
56
+ return this.pendingRequests.get(requestKey);
57
+ }
58
+
49
59
  // 生成唯一消息ID
50
60
  const id = ++this.messageId;
51
61
 
@@ -57,11 +67,15 @@ class MicroAppSDK {
57
67
  setTimeout(() => {
58
68
  if (this.callbacks.has(id)) {
59
69
  this.callbacks.delete(id);
70
+ this.pendingRequests.delete(requestKey);
60
71
  reject(new Error(`API调用超时: ${method}`));
61
72
  }
62
73
  }, 10000); // 10秒超时
63
74
  });
64
75
 
76
+ // 保存正在进行的请求
77
+ this.pendingRequests.set(requestKey, promise);
78
+
65
79
  // 构造请求数据
66
80
  const requestData: ApiRequestData = {
67
81
  type: 'API_REQUEST',
@@ -74,7 +88,14 @@ class MicroAppSDK {
74
88
  (window as any).microApp.dispatch(requestData);
75
89
 
76
90
  // 等待结果
77
- return promise;
91
+ try {
92
+ const result = await promise;
93
+ this.pendingRequests.delete(requestKey);
94
+ return result;
95
+ } catch (error) {
96
+ this.pendingRequests.delete(requestKey);
97
+ throw error;
98
+ }
78
99
  }
79
100
 
80
101
  /**
@@ -165,4 +186,4 @@ export const MicroOpenApis = {
165
186
  userLogout: MicroAppSDK.userLogout.bind(MicroAppSDK),
166
187
  mainAppPush: MicroAppSDK.mainAppPush.bind(MicroAppSDK),
167
188
  isInMicroApp: MicroAppSDK.isInMicroApp.bind(MicroAppSDK),
168
- };
189
+ };