@skyfox2000/webui 1.2.6 → 1.2.8

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 (32) hide show
  1. package/README.md +441 -91
  2. package/lib/assets/modules/{file-upload-Cf9uxE2y.js → file-upload-CZO-pMJd.js} +38 -41
  3. package/lib/assets/modules/{form-excel-DnROEQ0w.js → form-excel-N-2OYqKv.js} +1 -1
  4. package/lib/assets/modules/{index-DvbJb5Ha.js → index-BnHnS9ug.js} +2 -2
  5. package/lib/assets/modules/{index-BkbOMv2e.js → index-CTVMLeDF.js} +1 -1
  6. package/lib/assets/modules/{index-D4mESG0b.js → index-D9kzQ23e.js} +683 -661
  7. package/lib/assets/modules/{menuTabs-DgX7pUbX.js → menuTabs-BtOiocOC.js} +196 -175
  8. package/lib/assets/modules/{toolIcon-C0bp66dj.js → toolIcon-B9Mw9Ktm.js} +1 -1
  9. package/lib/assets/modules/{uploadList-CWhqNLX9.js → uploadList-B4LxzsC6.js} +3 -3
  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 +3 -3
  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 +4 -4
  16. package/lib/es/UploadForm/index.js +4 -4
  17. package/lib/index.d.ts +1 -1
  18. package/lib/stores/userInfo.d.ts +3 -1
  19. package/lib/utils/main-openapis.d.ts +0 -1
  20. package/lib/webui.css +1 -1
  21. package/lib/webui.es.js +234 -243
  22. package/package.json +2 -2
  23. package/src/components/layout/header/headerExits.vue +5 -4
  24. package/src/components/layout/header/index.vue +4 -2
  25. package/src/components/layout/header/user.vue +4 -1
  26. package/src/directives/permission.ts +14 -10
  27. package/src/index.ts +1 -9
  28. package/src/stores/appInfo.ts +64 -26
  29. package/src/stores/pageInfo.ts +1 -0
  30. package/src/stores/settingInfo.ts +1 -7
  31. package/src/stores/userInfo.ts +77 -52
  32. package/src/utils/main-openapis.ts +1 -9
@@ -1,15 +1,13 @@
1
- var v = Object.defineProperty;
2
- var m = (t, r, o) => r in t ? v(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
3
- var h = (t, r, o) => m(t, typeof r != "symbol" ? r + "" : r, o);
1
+ var g = Object.defineProperty;
2
+ var v = (e, r, o) => r in e ? g(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o;
3
+ var p = (e, r, o) => v(e, typeof r != "symbol" ? r + "" : r, o);
4
4
  import { hostUrl as E } from "@skyfox2000/fapi";
5
- import { ac as S, ab as I, u as d } from "./index-D4mESG0b.js";
5
+ import { ac as m, ab as S, u as d } from "./index-D9kzQ23e.js";
6
6
  import { mainAppApis as s } from "@skyfox2000/microbase";
7
7
  import b from "dayjs";
8
- var l = /* @__PURE__ */ ((t) => (t.Pending = "pending", t.Uploading = "uploading", t.Success = "success", t.Error = "error", t.Online = "online", t.Offline = "offline", t))(l || {});
9
- const F = () => s.value ? s.value.getHostInfo() : S().hostInfo, H = () => s.value && s.value.getAppInfo ? s.value.getAppInfo() : I().appInfo, x = (t) => s.value && s.value.userLogin ? s.value.userLogin(t) : d().login(t, !0), U = () => s.value && s.value.userLogout ? s.value.userLogout() : d().logout(), w = () => s.value && s.value.getToken ? s.value.getToken() : d().getToken(), L = () => s.value && s.value.getUserInfo ? s.value.getUserInfo() : d().getUserInfo(), M = (t) => {
10
- I().push(t);
11
- };
12
- class z {
8
+ var l = /* @__PURE__ */ ((e) => (e.Pending = "pending", e.Uploading = "uploading", e.Success = "success", e.Error = "error", e.Online = "online", e.Offline = "offline", e))(l || {});
9
+ const F = () => s.value ? s.value.getHostInfo() : m().hostInfo, H = () => s.value && s.value.getAppInfo ? s.value.getAppInfo() : S().appInfo, x = (e) => s.value && s.value.userLogin ? s.value.userLogin(e) : d().login(e, !0), U = () => s.value && s.value.userLogout ? s.value.userLogout() : d().logout(), w = () => s.value && s.value.getToken ? s.value.getToken() : d().getToken(), L = () => s.value && s.value.getUserInfo ? s.value.getUserInfo() : d().getUserInfo();
10
+ class M {
13
11
  /**
14
12
  * 连接路径参数,已判断 undefined 或 null 值
15
13
  * @param args 路径参数数组
@@ -19,7 +17,7 @@ class z {
19
17
  return r.filter((c) => c != null).join("/").replace(/[\/]+/, "/");
20
18
  }
21
19
  }
22
- class D {
20
+ class z {
23
21
  /**
24
22
  * AsyncUploader 构造函数
25
23
  * @param urlInfo 文件上传的 API 配置(IUrlInfo 对象)
@@ -29,15 +27,15 @@ class D {
29
27
  /**
30
28
  * 设置 API 端点和最大并发数,所有上传文件通过该类控制
31
29
  */
32
- h(this, "urlInfo");
30
+ p(this, "urlInfo");
33
31
  /**
34
32
  * 最大并发上传数
35
33
  */
36
- h(this, "maxConcurrent");
34
+ p(this, "maxConcurrent");
37
35
  /**
38
36
  * 控制上传任务的中断信号
39
37
  */
40
- h(this, "abortController");
38
+ p(this, "abortController");
41
39
  this.urlInfo = r, this.maxConcurrent = o;
42
40
  }
43
41
  /**
@@ -49,28 +47,28 @@ class D {
49
47
  async uploadFiles(r, o, u) {
50
48
  if (!r.length) return;
51
49
  const c = Math.min(this.maxConcurrent, r.length), n = [];
52
- for (const e of r)
53
- switch (e.status) {
50
+ for (const t of r)
51
+ switch (t.status) {
54
52
  case l.Success:
55
53
  case l.Online:
56
54
  case l.Offline:
57
55
  break;
58
56
  default:
59
- e.status = l.Pending, n.push(e);
57
+ t.status = l.Pending, n.push(t);
60
58
  break;
61
59
  }
62
60
  const f = [];
63
61
  this.abortController = new AbortController();
64
62
  try {
65
63
  for (; f.length < c && n.length > 0; ) {
66
- const e = n.shift();
67
- if (!e) break;
68
- f.push(this.handleFileStatus(e, f, n, o));
64
+ const t = n.shift();
65
+ if (!t) break;
66
+ f.push(this.handleFileStatus(t, f, n, o));
69
67
  }
70
68
  await Promise.all(f), u == null || u(r);
71
- } catch (e) {
72
- console.error("上传失败:", e), r.forEach((p) => {
73
- p.status = l.Error, p.error = e instanceof Error ? e : new Error("上传失败"), o == null || o(p);
69
+ } catch (t) {
70
+ console.error("上传失败:", t), r.forEach((h) => {
71
+ h.status = l.Error, h.error = t instanceof Error ? t : new Error("上传失败"), o == null || o(h);
74
72
  }), u == null || u(r);
75
73
  }
76
74
  }
@@ -107,32 +105,32 @@ class D {
107
105
  if (f.append("file", r.originFileObj), r.params)
108
106
  for (const a in r.params)
109
107
  f.append(a, r.params[a]);
110
- const e = new XMLHttpRequest(), p = E(this.urlInfo);
111
- if (p === !1) return Promise.resolve(null);
112
- if (e.open("POST", p, !0), this.urlInfo.header && typeof this.urlInfo.header == "object" && Object.entries(this.urlInfo.header).forEach(([a, i]) => {
113
- e.setRequestHeader(a, i);
108
+ const t = new XMLHttpRequest(), h = E(this.urlInfo);
109
+ if (h === !1) return Promise.resolve(null);
110
+ if (t.open("POST", h, !0), this.urlInfo.header && typeof this.urlInfo.header == "object" && Object.entries(this.urlInfo.header).forEach(([a, i]) => {
111
+ t.setRequestHeader(a, i);
114
112
  }), this.urlInfo.authorize) {
115
113
  const a = w();
116
114
  if (!a) {
117
115
  n(new Error("未授权或授权过期"));
118
116
  return;
119
117
  }
120
- e.setRequestHeader("Authorization", "Bearer " + a);
118
+ t.setRequestHeader("Authorization", "Bearer " + a);
121
119
  }
122
- e.upload.addEventListener("progress", (a) => {
120
+ t.upload.addEventListener("progress", (a) => {
123
121
  if (a.lengthComputable && a.total > 0) {
124
122
  const i = Math.round(a.loaded / a.total * 100);
125
123
  u(i);
126
124
  }
127
- }), e.addEventListener("load", () => {
128
- if (e.status >= 200 && e.status < 300) {
129
- const a = e.getResponseHeader("Content-Type");
125
+ }), t.addEventListener("load", () => {
126
+ if (t.status >= 200 && t.status < 300) {
127
+ const a = t.getResponseHeader("Content-Type");
130
128
  if (!a || !a.includes("application/json")) {
131
129
  n(new Error("返回的结果不是 JSON 格式"));
132
130
  return;
133
131
  }
134
132
  try {
135
- const i = JSON.parse(e.response);
133
+ const i = JSON.parse(t.response);
136
134
  if (i.status === "success")
137
135
  i.data && (r.minioFile = {
138
136
  ETag: i.data.ETag,
@@ -143,18 +141,18 @@ class D {
143
141
  Status: l.Online
144
142
  }), c(r);
145
143
  else {
146
- const g = i.msg;
147
- n(new Error(g));
144
+ const I = i.msg;
145
+ n(new Error(I));
148
146
  }
149
147
  } catch (i) {
150
148
  n(new Error("无法解析返回的 JSON 数据: " + i));
151
149
  }
152
150
  } else
153
- n(new Error(`上传失败,状态码:${e.status}`));
154
- }), e.addEventListener("error", () => {
151
+ n(new Error(`上传失败,状态码:${t.status}`));
152
+ }), t.addEventListener("error", () => {
155
153
  n(new Error("上传失败,网络异常"));
156
- }), e.send(f), o.addEventListener("abort", () => {
157
- e.abort(), n(new Error("上传已取消"));
154
+ }), t.send(f), o.addEventListener("abort", () => {
155
+ t.abort(), n(new Error("上传已取消"));
158
156
  });
159
157
  });
160
158
  }
@@ -166,14 +164,13 @@ class D {
166
164
  }
167
165
  }
168
166
  export {
169
- D as A,
167
+ z as A,
170
168
  l as U,
171
169
  H as a,
172
170
  U as b,
173
171
  w as c,
174
172
  L as d,
175
173
  F as g,
176
- M as m,
177
- z as p,
174
+ M as p,
178
175
  x as u
179
176
  };
@@ -1,6 +1,6 @@
1
1
  import k from "async-validator";
2
2
  import { httpPost as J, ResStatus as b } from "@skyfox2000/fapi";
3
- import { i as C, ae as N } from "./index-D4mESG0b.js";
3
+ import { i as C, ae as N } from "./index-D9kzQ23e.js";
4
4
  import w from "vue-m-message";
5
5
  const E = async (v) => {
6
6
  const f = await import("exceljs"), m = new f.Workbook();
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as A, provide as B, ref as S, watch as p, onMounted as F, createBlock as n, openBlock as r, unref as a, withCtx as t, createElementVNode as N, renderSlot as b, createVNode as V, createCommentVNode as d, createTextVNode as u, toDisplayString as m } from "vue";
2
- import { _ as f } from "./index-BkbOMv2e.js";
2
+ import { _ as f } from "./index-CTVMLeDF.js";
3
3
  import { Modal as E, Space as M } from "ant-design-vue";
4
4
  import "@skyfox2000/fapi";
5
- import { P, o as $, d as D, b as K } from "./index-D4mESG0b.js";
5
+ import { P, o as $, d as D, b as K } from "./index-D9kzQ23e.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-C0bp66dj.js";
3
+ import { a as P, _ as k } from "./toolIcon-B9Mw9Ktm.js";
4
4
  const C = /* @__PURE__ */ d({
5
5
  inheritAttrs: !1,
6
6
  __name: "index",