@skyfox2000/webui 1.2.7 → 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.
@@ -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-CKMDsqve.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-CKMDsqve.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-BZvwPKou.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-CKMDsqve.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-66dclHit.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",
@@ -622,10 +622,10 @@ const Da = (e) => {
622
622
  if (w(a) && w(s))
623
623
  return !0;
624
624
  if (te.VITE_PERMISSION_MODE === "role")
625
- return !w(a) && a ? t.hasRole(a) : !0;
625
+ return w(a) ? !0 : t.hasRole(a);
626
626
  if (te.VITE_PERMISSION_MODE === "permit") {
627
627
  let r = !1, n = !1;
628
- return !w(a) && a && (r = t.hasRole(a)), t.isAdmin() ? r : (!w(s) && s && (n = t.hasPermit(e.path, s)), r || n);
628
+ return w(a) || (r = t.hasRole(a)), t.isAdmin() ? r : (w(s) || (n = t.hasPermit(e.path, s)), r || n);
629
629
  }
630
630
  return !1;
631
631
  }, We = (e) => e.map((t) => {
@@ -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 r, toDisplayString as $, Fragment as L, createTextVNode as K, reactive as Q, nextTick as W, renderList as Y, withModifiers as G } from "vue";
2
- import { a as w, _ as b } from "./toolIcon-66dclHit.js";
3
- import { c as D, Q as E, ad as P, T as M, S as R, u as F, a as H, R as X, r as V, ab as z } from "./index-CKMDsqve.js";
2
+ import { a as w, _ as b } from "./toolIcon-B9Mw9Ktm.js";
3
+ import { c as D, Q as E, ad as P, T as M, S as R, u as F, a as H, R as X, r as V, ab as z } from "./index-D9kzQ23e.js";
4
4
  import { theme as O, Breadcrumb as Z, Modal as ee, Flex as te, LayoutHeader as ne, Space as oe, Menu as se, Tabs as ie, TabPane as ce } from "ant-design-vue";
5
5
  import { mainAppApis as U } from "@skyfox2000/microbase";
6
6
  import { SERVER_HOST as B } from "@skyfox2000/fapi";
@@ -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 "./index-CKMDsqve.js";
4
+ import { c as S } from "./index-D9kzQ23e.js";
5
5
  const T = /* @__PURE__ */ i({
6
6
  __name: "index",
7
7
  props: {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as $, ref as k, computed as O, watch as j, createElementBlock as p, openBlock as f, createElementVNode as r, createVNode as v, unref as l, mergeProps as B, withCtx as U, createTextVNode as E, toDisplayString as y, Fragment as M, renderList as R, normalizeClass as T, createCommentVNode as F } from "vue";
2
- import { _ as V } from "./index-BZvwPKou.js";
2
+ import { _ as V } from "./index-CTVMLeDF.js";
3
3
  import { Upload as A, Tag as K, Progress as D } from "ant-design-vue";
4
4
  import { httpPost as I, ResStatus as Q } from "@skyfox2000/fapi";
5
- import "./index-CKMDsqve.js";
6
- import { U as o, p as q } from "./file-upload-D4bA7go8.js";
5
+ import "./index-D9kzQ23e.js";
6
+ import { U as o, p as q } from "./file-upload-CZO-pMJd.js";
7
7
  import { combineParams as G } from "@skyfox2000/microbase";
8
8
  import h 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-66dclHit.js";
3
+ import { _ as q } from "../../assets/modules/toolIcon-B9Mw9Ktm.js";
4
4
  import "@skyfox2000/fapi";
5
- import "../../assets/modules/index-CKMDsqve.js";
5
+ import "../../assets/modules/index-D9kzQ23e.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-D16E7UbH.js";
10
+ import { _ as D } from "../../assets/modules/index-BnHnS9ug.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 b, resolveComponent as g, 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-66dclHit.js";
4
- import { I as A, a as B, g as L, e as V, h as D } from "../../assets/modules/menuTabs-izaFx0kk.js";
5
- import { ab as j, a as K, ad as M } from "../../assets/modules/index-CKMDsqve.js";
3
+ import { a as z } from "../../assets/modules/toolIcon-B9Mw9Ktm.js";
4
+ import { I as A, a as B, g as L, e as V, h as D } from "../../assets/modules/menuTabs-BtOiocOC.js";
5
+ import { ab as j, a as K, ad as M } from "../../assets/modules/index-D9kzQ23e.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/index-CKMDsqve.js";
2
+ import { r as s } from "../../assets/modules/index-D9kzQ23e.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/index-CKMDsqve.js";
2
+ import { r as s } from "../../assets/modules/index-D9kzQ23e.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 Y, ref as r, watch as V, onMounted as Z, createBlock as ee, openBlock as d, unref as i, withCtx as _, renderSlot as le, createElementVNode as c, createVNode as m, createElementBlock as f, createCommentVNode as M, createTextVNode as O, toDisplayString as F, normalizeClass as ae, Fragment as $, renderList as P } from "vue";
2
- import { _ as A } from "../../assets/modules/index-BZvwPKou.js";
2
+ import { _ as A } from "../../assets/modules/index-CTVMLeDF.js";
3
3
  import { Modal as te, Upload as I, Alert as G, Space as re } from "ant-design-vue";
4
4
  import { ResStatus as oe } from "@skyfox2000/fapi";
5
- import { $ as se, a5 as ie } from "../../assets/modules/index-CKMDsqve.js";
6
- import { A as ue, p as ne, U as ce } from "../../assets/modules/file-upload-D4bA7go8.js";
5
+ import { $ as se, a5 as ie } from "../../assets/modules/index-D9kzQ23e.js";
6
+ import { A as ue, p as ne, U as ce } from "../../assets/modules/file-upload-CZO-pMJd.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import n from "vue-m-message";
9
- import { p as ve, v as de, c as fe } from "../../assets/modules/form-excel-DL2_SNiS.js";
9
+ import { p as ve, v as de, c as fe } from "../../assets/modules/form-excel-N-2OYqKv.js";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
12
  import pe from "@vue-office/excel";
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as S, ref as m, watch as k, onMounted as z, createBlock as D, openBlock as E, unref as s, withCtx as f, createVNode as v, createTextVNode as g } from "vue";
2
- import { _ as x } from "../../assets/modules/index-BZvwPKou.js";
2
+ import { _ as x } from "../../assets/modules/index-CTVMLeDF.js";
3
3
  import { Modal as L, Space as N } from "ant-design-vue";
4
4
  import { ResStatus as $ } from "@skyfox2000/fapi";
5
- import { a1 as B } from "../../assets/modules/index-CKMDsqve.js";
6
- import { A as R, U as A } from "../../assets/modules/file-upload-D4bA7go8.js";
5
+ import { a1 as B } from "../../assets/modules/index-D9kzQ23e.js";
6
+ import { A as R, U as A } from "../../assets/modules/file-upload-CZO-pMJd.js";
7
7
  import "@skyfox2000/microbase";
8
8
  import t from "vue-m-message";
9
9
  import "async-validator";
10
10
  import "dayjs";
11
11
  import "vue-draggable-next";
12
- import { _ as M } from "../../assets/modules/uploadList-Dw6eRrJT.js";
12
+ import { _ as M } from "../../assets/modules/uploadList-B4LxzsC6.js";
13
13
  const W = /* @__PURE__ */ S({
14
14
  __name: "uploadForm",
15
15
  props: {
package/lib/index.d.ts CHANGED
@@ -34,7 +34,7 @@ export { exportSelectedRows, exportResults } from './utils/export-table';
34
34
  export { path, AsyncUploader } from './utils/file-upload';
35
35
  export { EventPrefix } from './utils/eventbus';
36
36
  export { default as eventBus } from './utils/eventbus';
37
- export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo, mainAppPush, } from './utils/main-openapis';
37
+ export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo } from './utils/main-openapis';
38
38
  export { router as AppRouter };
39
39
  export { pendingNavigation, routes } from './router';
40
40
  export { useAppInfo } from './stores/appInfo';
@@ -6,4 +6,3 @@ export declare const userLogin: (loginInfo: LoginInfo) => Promise<ApiResponse<Lo
6
6
  export declare const userLogout: () => Promise<ApiResponse<void> | void>;
7
7
  export declare const getToken: () => string;
8
8
  export declare const getUserInfo: () => UserInfo;
9
- export declare const mainAppPush: (subPath: string) => void;
package/lib/webui.es.js CHANGED
@@ -1,23 +1,23 @@
1
- import { u as Xe, i as X, a as ve, c as Ze, P as te, o as ie, b as et, d as De, e as Ee, r as oe, f as tt, g as at, h as Fe, j as lt, k as B, l as Ne, m as Re, n as V, p as ke, q as rt, s as st, O as Oe, t as Me, _ as ot, v as nt, w as it, x as ct, y as ut, z as dt, A as Ae } from "./assets/modules/index-CKMDsqve.js";
2
- import { a7 as gl, L as _l, M as bl, S as xl, a6 as yl, a4 as kl, a5 as wl, a8 as Cl, V as Sl, Q as $l, a2 as Tl, $ as Il, K as Pl, H as Dl, a1 as El, R as Fl, C as Nl, X as Rl, a0 as Ol, a3 as Ml, J as Al, I as Bl, N as zl, a9 as Ul, B as Ll, Z as Yl, aa as Vl, U as Kl, W as Hl, T as jl, ab as Ql, D as ql, E as Wl, ac as Gl, G as Jl, ad as Xl, F as Zl, Y as er } from "./assets/modules/index-CKMDsqve.js";
3
- import { A as ar, U as lr, a as rr, g as sr, c as or, d as nr, m as ir, p as cr, u as ur, b as dr } from "./assets/modules/file-upload-D4bA7go8.js";
1
+ import { u as Xe, i as X, a as ve, c as Ze, P as te, o as ie, b as et, d as Pe, e as Ee, r as oe, f as tt, g as at, h as Fe, j as lt, k as A, l as Ne, m as Re, n as V, p as ke, q as rt, s as st, O as Oe, t as Me, _ as ot, v as nt, w as it, x as ct, y as ut, z as dt, A as Be } from "./assets/modules/index-D9kzQ23e.js";
2
+ import { a7 as gl, L as _l, M as bl, S as xl, a6 as yl, a4 as kl, a5 as wl, a8 as Cl, V as Sl, Q as $l, a2 as Tl, $ as Il, K as Dl, H as Pl, a1 as El, R as Fl, C as Nl, X as Rl, a0 as Ol, a3 as Ml, J as Bl, I as Al, N as zl, a9 as Ul, B as Ll, Z as Yl, aa as Vl, U as Kl, W as Hl, T as jl, ab as Ql, D as ql, E as Wl, ac as Gl, G as Jl, ad as Xl, F as Zl, Y as er } from "./assets/modules/index-D9kzQ23e.js";
3
+ import { A as ar, U as lr, a as rr, g as sr, c as or, d as nr, p as ir, u as cr, b as ur } from "./assets/modules/file-upload-CZO-pMJd.js";
4
4
  import { EnvConfig as we } from "@skyfox2000/microbase";
5
- import { FrontCache as le, httpPost as Be, ResStatus as ze, SERVER_HOST as pt, fieldMapping as re } from "@skyfox2000/fapi";
5
+ import { FrontCache as le, httpPost as Ae, ResStatus as ze, SERVER_HOST as pt, fieldMapping as re } from "@skyfox2000/fapi";
6
6
  import ne from "vue-m-message";
7
- import { defineComponent as w, createBlock as _, openBlock as m, withModifiers as Z, unref as l, useAttrs as J, withCtx as h, createElementVNode as T, createVNode as y, mergeProps as E, renderSlot as D, normalizeStyle as me, toDisplayString as F, createCommentVNode as k, ref as b, provide as Ue, watch as $, onMounted as z, createTextVNode as N, inject as he, resolveDirective as ae, withDirectives as j, computed as G, createElementBlock as S, normalizeClass as M, createSlots as Le, useSlots as ft, Fragment as O, renderList as U, resolveDynamicComponent as vt, onUnmounted as Ye, onActivated as mt, withKeys as Ce } from "vue";
7
+ import { defineComponent as w, createBlock as _, openBlock as m, withModifiers as Z, unref as l, useAttrs as J, withCtx as h, createElementVNode as T, createVNode as y, mergeProps as E, renderSlot as P, normalizeStyle as me, toDisplayString as F, createCommentVNode as k, ref as b, provide as Ue, watch as $, onMounted as z, createTextVNode as N, inject as he, resolveDirective as ae, withDirectives as j, computed as G, createElementBlock as S, normalizeClass as M, createSlots as Le, useSlots as ft, Fragment as O, renderList as U, resolveDynamicComponent as vt, onUnmounted as Ye, onActivated as mt, withKeys as Ce } from "vue";
8
8
  import "async-validator";
9
9
  import de from "dayjs";
10
- import { Popover as ht, theme as Ve, Drawer as gt, Space as ee, Form as Ke, message as _t, FormItem as He, ConfigProvider as Se, Popconfirm as bt, Button as je, DropdownButton as xt, Menu as ge, MenuItem as _e, Dropdown as pe, Checkbox as yt, Switch as kt, Table as Qe, Tree as wt, Cascader as Ct, DatePicker as St, Input as fe, InputPassword as $t, InputNumber as Tt, RangePicker as It, Textarea as Pt, Transfer as Dt, TreeSelect as Et, LayoutContent as Ft } from "ant-design-vue";
10
+ import { Popover as ht, theme as Ve, Drawer as gt, Space as ee, Form as Ke, message as _t, FormItem as He, ConfigProvider as Se, Popconfirm as bt, Button as je, DropdownButton as xt, Menu as ge, MenuItem as _e, Dropdown as pe, Checkbox as yt, Switch as kt, Table as Qe, Tree as wt, Cascader as Ct, DatePicker as St, Input as fe, InputPassword as $t, InputNumber as Tt, RangePicker as It, Textarea as Dt, Transfer as Pt, TreeSelect as Et, LayoutContent as Ft } from "ant-design-vue";
11
11
  import { VueDraggableNext as Nt } from "vue-draggable-next";
12
- import { d as qe } from "./assets/modules/uploadList-Dw6eRrJT.js";
13
- import { _ as fr, a as vr } from "./assets/modules/uploadList-Dw6eRrJT.js";
14
- import { c as hr, p as gr, v as _r } from "./assets/modules/form-excel-DL2_SNiS.js";
15
- import { _ as A } from "./assets/modules/index-BZvwPKou.js";
16
- import { _ as L } from "./assets/modules/toolIcon-66dclHit.js";
17
- import { a as xr } from "./assets/modules/toolIcon-66dclHit.js";
18
- import { _ as Q } from "./assets/modules/menuTabs-izaFx0kk.js";
19
- import { a as kr, c as wr, d as Cr, e as Sr, f as $r, I as Tr, g as Ir, h as Pr, b as Dr } from "./assets/modules/menuTabs-izaFx0kk.js";
20
- import { _ as Fr } from "./assets/modules/index-D16E7UbH.js";
12
+ import { d as qe } from "./assets/modules/uploadList-B4LxzsC6.js";
13
+ import { _ as pr, a as fr } from "./assets/modules/uploadList-B4LxzsC6.js";
14
+ import { c as mr, p as hr, v as gr } from "./assets/modules/form-excel-N-2OYqKv.js";
15
+ import { _ as B } from "./assets/modules/index-CTVMLeDF.js";
16
+ import { _ as L } from "./assets/modules/toolIcon-B9Mw9Ktm.js";
17
+ import { a as br } from "./assets/modules/toolIcon-B9Mw9Ktm.js";
18
+ import { _ as Q } from "./assets/modules/menuTabs-BtOiocOC.js";
19
+ import { a as yr, c as kr, d as wr, e as Cr, f as Sr, I as $r, g as Tr, h as Ir, b as Dr } from "./assets/modules/menuTabs-BtOiocOC.js";
20
+ import { _ as Er } from "./assets/modules/index-BnHnS9ug.js";
21
21
  const $e = (r, a, t, e = "remove") => {
22
22
  if (!t)
23
23
  if (e === "disable") {
@@ -31,12 +31,15 @@ const $e = (r, a, t, e = "remove") => {
31
31
  }
32
32
  }
33
33
  }, Te = (r) => {
34
- const a = Xe(), { url: t, role: e, permit: o } = r, n = t;
34
+ const a = Xe(), { url: t, role: e, permit: o } = r;
35
+ if (X(e) && X(o))
36
+ return !0;
37
+ const n = t;
35
38
  if (we.VITE_PERMISSION_MODE === "role")
36
- return !X(e) && e !== void 0 ? a.hasRole(e) : !0;
39
+ return X(e) ? !0 : a.hasRole(e);
37
40
  if (we.VITE_PERMISSION_MODE === "permit") {
38
41
  let p = !1, u = !1;
39
- return X(e) || (p = a.hasRole(e)), a.isAdmin() ? p : (!X(o) && typeof o == "string" && (u = a.hasPermit(n, o)), X(e) && X(o) ? !0 : p || u);
42
+ return X(e) || (p = a.hasRole(e)), a.isAdmin() ? p : (X(o) || (u = a.hasPermit(n, o)), p || u);
40
43
  }
41
44
  return !1;
42
45
  }, Rt = {
@@ -92,9 +95,9 @@ const $e = (r, a, t, e = "remove") => {
92
95
  }), { buttons: e, menus: o };
93
96
  }, H = (r, a) => r.disabled && typeof r.disabled == "function" ? r.disabled(a) : r.disabled, W = (r, a) => r.visible && typeof r.visible == "function" ? r.visible(a) : r.visible ?? !0, Mt = (r, a) => {
94
97
  a.reload.value = !0;
95
- }, At = (r, a) => {
96
- a.searchBar.value = !a.searchBar.value;
97
98
  }, Bt = (r, a) => {
99
+ a.searchBar.value = !a.searchBar.value;
100
+ }, At = (r, a) => {
98
101
  switch (a.tableSize.value) {
99
102
  case "large":
100
103
  a.tableSize.value = "middle";
@@ -123,7 +126,7 @@ const $e = (r, a, t, e = "remove") => {
123
126
  (r.icons || r.labels) && (r.iconStatus = r.iconStatus || 0, r.iconStatus += 1, r.labels && r.labels.length && (r.label = r.labels[r.iconStatus % r.labels.length]), r.icons && r.icons.length && (r.icon = r.icons[r.iconStatus % r.icons.length]));
124
127
  }, Vt = (r, a) => {
125
128
  a ? delete r.visible : r.visible = !1;
126
- }, Pe = [
129
+ }, De = [
127
130
  {
128
131
  key: "Reload",
129
132
  label: "刷新表格",
@@ -136,13 +139,13 @@ const $e = (r, a, t, e = "remove") => {
136
139
  labels: ["展开搜索栏", "折叠搜索栏"],
137
140
  icon: "icon-search",
138
141
  iconStatus: 0,
139
- click: At
142
+ click: Bt
140
143
  },
141
144
  {
142
145
  key: "RowHeight",
143
146
  label: "行高调整",
144
147
  icon: "icon-row-height",
145
- click: Bt
148
+ click: At
146
149
  },
147
150
  {
148
151
  key: "tool.multiple.checkbox",
@@ -210,7 +213,7 @@ const $e = (r, a, t, e = "remove") => {
210
213
  ], Kt = (r) => {
211
214
  if (!r.tools || r.tools.length > 0) {
212
215
  const a = [];
213
- return r.tools ? a.push(...r.tools) : a.push(...Pe), { tools: be(Pe, 0, a).buttons };
216
+ return r.tools ? a.push(...r.tools) : a.push(...De), { tools: be(De, 0, a).buttons };
214
217
  }
215
218
  return {
216
219
  tools: []
@@ -274,7 +277,7 @@ class Ge {
274
277
  }
275
278
  async function Va() {
276
279
  try {
277
- const r = await Be(
280
+ const r = await Ae(
278
281
  {
279
282
  api: "PLATFORM_API",
280
283
  url: "/api/SysCacheSvr/getLastTime",
@@ -331,13 +334,13 @@ const Ka = async (r, a, t) => {
331
334
  value: s.dataIndex || s.key || ""
332
335
  }));
333
336
  let c = t.page, d = t.gridQuery;
334
- return e.api || (e.api = c.api), e.authorize === void 0 && (e.authorize = c.authorize), t.isGridLoading.value = !0, Be(e, d).then((s) => {
337
+ return e.api || (e.api = c.api), e.authorize === void 0 && (e.authorize = c.authorize), t.isGridLoading.value = !0, Ae(e, d).then((s) => {
335
338
  if (t.isGridLoading.value = !1, (s == null ? void 0 : s.status) === ze.SUCCESS && s.data) {
336
- const f = s.data.map((P) => {
337
- const x = { ...P };
339
+ const f = s.data.map((D) => {
340
+ const x = { ...D };
338
341
  return u.forEach((R) => {
339
342
  const q = R.dataIndex || R.key;
340
- q && R.customRender && (x[q] = R.customRender(P[q], P));
343
+ q && R.customRender && (x[q] = R.customRender(D[q], D));
341
344
  }), x;
342
345
  }), C = new n({ fields: i }).parse(f), I = new Blob([`\uFEFF${C}`], { type: "text/csv" });
343
346
  qe(I, p);
@@ -367,7 +370,7 @@ const Ka = async (r, a, t) => {
367
370
  const a = J();
368
371
  return (t, e) => (m(), _(l(ht), { placement: "topRight" }, {
369
372
  content: h(() => [
370
- D(t.$slots, "default", {}, () => [
373
+ P(t.$slots, "default", {}, () => [
371
374
  T("div", {
372
375
  class: "text-[14px]",
373
376
  style: me({ maxWidth: t.maxWidth })
@@ -468,12 +471,12 @@ const Ka = async (r, a, t) => {
468
471
  ])
469
472
  ]),
470
473
  default: h(() => [
471
- D(u.$slots, "default")
474
+ P(u.$slots, "default")
472
475
  ]),
473
476
  footer: h(() => [
474
477
  y(l(ee), null, {
475
478
  default: h(() => [
476
- u.cancelText !== "" ? (m(), _(l(A), {
479
+ u.cancelText !== "" ? (m(), _(l(B), {
477
480
  key: 0,
478
481
  onClick: i[1] || (i[1] = () => l(ie)(l(n)))
479
482
  }, {
@@ -482,7 +485,7 @@ const Ka = async (r, a, t) => {
482
485
  ]),
483
486
  _: 1
484
487
  })) : k("", !0),
485
- u.saveAsText !== "" && l(n).saveAsBtnVisible !== !1 ? (m(), _(l(A), {
488
+ u.saveAsText !== "" && l(n).saveAsBtnVisible !== !1 ? (m(), _(l(B), {
486
489
  key: 1,
487
490
  onClick: i[2] || (i[2] = () => l(et)(l(n))),
488
491
  type: "primary",
@@ -493,9 +496,9 @@ const Ka = async (r, a, t) => {
493
496
  ]),
494
497
  _: 1
495
498
  }, 8, ["loading"])) : k("", !0),
496
- u.saveText !== "" && l(n).saveBtnVisible !== !1 ? (m(), _(l(A), {
499
+ u.saveText !== "" && l(n).saveBtnVisible !== !1 ? (m(), _(l(B), {
497
500
  key: 2,
498
- onClick: i[3] || (i[3] = () => l(De)(l(n))),
501
+ onClick: i[3] || (i[3] = () => l(Pe)(l(n))),
499
502
  type: "primary",
500
503
  loading: l(n).isFormSaving.value
501
504
  }, {
@@ -533,14 +536,14 @@ const Ka = async (r, a, t) => {
533
536
  }
534
537
  }, {
535
538
  default: h(() => [
536
- D(e.$slots, "default")
539
+ P(e.$slots, "default")
537
540
  ]),
538
541
  _: 3
539
542
  }, 8, ["label-col", "wrapper-col"])), [
540
543
  [
541
544
  n,
542
545
  () => {
543
- l(t) && l(De)(l(t));
546
+ l(t) && l(Pe)(l(t));
544
547
  }
545
548
  ]
546
549
  ]);
@@ -593,10 +596,10 @@ const Ka = async (r, a, t) => {
593
596
  default: h(() => [
594
597
  T("div", Wt, [
595
598
  T("div", Gt, [
596
- D(i.$slots, "default")
599
+ P(i.$slots, "default")
597
600
  ]),
598
601
  T("div", Jt, [
599
- D(i.$slots, "helper", {}, () => [
602
+ P(i.$slots, "helper", {}, () => [
600
603
  i.helper ? (m(), _(l(Qt), {
601
604
  key: 0,
602
605
  text: i.helper
@@ -634,7 +637,7 @@ const Ka = async (r, a, t) => {
634
637
  default: h(() => [
635
638
  T("div", ea, [
636
639
  T("div", ta, [
637
- D(n.$slots, "default")
640
+ P(n.$slots, "default")
638
641
  ])
639
642
  ])
640
643
  ]),
@@ -720,8 +723,8 @@ const Ka = async (r, a, t) => {
720
723
  class: "flex mb-[10px]"
721
724
  }, {
722
725
  default: h(() => [
723
- D(f.$slots, "default"),
724
- f.gridCtrl.searchBar ? D(f.$slots, "control", { key: 0 }) : k("", !0),
726
+ P(f.$slots, "default"),
727
+ f.gridCtrl.searchBar ? P(f.$slots, "control", { key: 0 }) : k("", !0),
725
728
  o.value >= 1 ? (m(), _(ue, {
726
729
  key: 1,
727
730
  class: "w-1/3"
@@ -738,7 +741,7 @@ const Ka = async (r, a, t) => {
738
741
  default: h(() => [
739
742
  y(l(ee), null, {
740
743
  default: h(() => [
741
- y(l(A), {
744
+ y(l(B), {
742
745
  type: "primary",
743
746
  onClick: s,
744
747
  icon: "icon-search"
@@ -749,7 +752,7 @@ const Ka = async (r, a, t) => {
749
752
  _: 1,
750
753
  __: [0]
751
754
  }),
752
- y(l(A), {
755
+ y(l(B), {
753
756
  onClick: v,
754
757
  icon: "icon-reset"
755
758
  }, {
@@ -985,7 +988,7 @@ const Ka = async (r, a, t) => {
985
988
  ], 2)
986
989
  ]),
987
990
  default: h(() => [
988
- y(l(A), {
991
+ y(l(B), {
989
992
  class: M([
990
993
  "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
991
994
  d === 0 ? "rounded-l-[5px]" : "",
@@ -1006,7 +1009,7 @@ const Ka = async (r, a, t) => {
1006
1009
  }, 1032, ["class", "disabled", "tiptext", "onClick"])
1007
1010
  ]),
1008
1011
  _: 2
1009
- }, 1024)) : !c.children && l(W)(c) ? (m(), _(l(A), {
1012
+ }, 1024)) : !c.children && l(W)(c) ? (m(), _(l(B), {
1010
1013
  key: 1,
1011
1014
  class: M([
1012
1015
  "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
@@ -1047,7 +1050,7 @@ const Ka = async (r, a, t) => {
1047
1050
  }, 1024)
1048
1051
  ]),
1049
1052
  default: h(() => [
1050
- y(l(A), {
1053
+ y(l(B), {
1051
1054
  class: M([
1052
1055
  "!w-[46px] px-[5px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
1053
1056
  d === 0 ? "rounded-l-[5px]" : ""
@@ -1115,7 +1118,7 @@ const Ka = async (r, a, t) => {
1115
1118
  return m(), S("div", oa, [
1116
1119
  y(l(ee), null, {
1117
1120
  default: h(() => [
1118
- (m(!0), S(O, null, U(u.value, (v) => j((m(), _(l(A), {
1121
+ (m(!0), S(O, null, U(u.value, (v) => j((m(), _(l(B), {
1119
1122
  key: v.key,
1120
1123
  type: v.type,
1121
1124
  danger: v.danger,
@@ -1151,7 +1154,7 @@ const Ka = async (r, a, t) => {
1151
1154
  })
1152
1155
  ]),
1153
1156
  default: h(() => [
1154
- y(l(A), null, {
1157
+ y(l(B), null, {
1155
1158
  default: h(() => d[0] || (d[0] = [
1156
1159
  N(" 更多操作 ")
1157
1160
  ])),
@@ -1187,7 +1190,7 @@ const Ka = async (r, a, t) => {
1187
1190
  },
1188
1191
  emits: ["change"],
1189
1192
  setup(r, { emit: a }) {
1190
- const t = r, e = b([]), o = a, { editorCtrl: n, errInfo: p } = B(), u = (i) => {
1193
+ const t = r, e = b([]), o = a, { editorCtrl: n, errInfo: p } = A(), u = (i) => {
1191
1194
  p != null && p.value.errClass && n && V(n), o("change", i);
1192
1195
  };
1193
1196
  return z(() => {
@@ -1284,10 +1287,10 @@ const Ka = async (r, a, t) => {
1284
1287
  v.value = !0;
1285
1288
  }, 50);
1286
1289
  }), (f, g) => {
1287
- var I, P;
1290
+ var I, D;
1288
1291
  const C = ae("auth");
1289
1292
  return m(), S(O, null, [
1290
- (I = l(e).buttons) != null && I.value.length || (P = l(e).tools) != null && P.length ? (m(), _(ca, {
1293
+ (I = l(e).buttons) != null && I.value.length || (D = l(e).tools) != null && D.length ? (m(), _(ca, {
1291
1294
  key: 0,
1292
1295
  "grid-ctrl": l(e),
1293
1296
  "editor-ctrl": l(e).editor
@@ -1308,7 +1311,7 @@ const Ka = async (r, a, t) => {
1308
1311
  bodyCell: h((x) => {
1309
1312
  var R, q;
1310
1313
  return [
1311
- D(f.$slots, "bodyCell", {
1314
+ P(f.$slots, "bodyCell", {
1312
1315
  column: x == null ? void 0 : x.column,
1313
1316
  record: x == null ? void 0 : x.record
1314
1317
  }),
@@ -1327,7 +1330,7 @@ const Ka = async (r, a, t) => {
1327
1330
  }, null, 8, ["checked", "onUpdate:checked", "disabled", "data", "onClick", "class", "loading"])), [
1328
1331
  [C, { url: o.value, role: ["Super", "Admin"], permit: ":enabled" }, "disable"]
1329
1332
  ]) : k("", !0),
1330
- l(e) && ((q = x == null ? void 0 : x.column) == null ? void 0 : q.dataIndex) === "operation" ? D(f.$slots, "operate", {
1333
+ l(e) && ((q = x == null ? void 0 : x.column) == null ? void 0 : q.dataIndex) === "operation" ? P(f.$slots, "operate", {
1331
1334
  key: 1,
1332
1335
  record: x == null ? void 0 : x.record
1333
1336
  }, () => [
@@ -1396,7 +1399,7 @@ const Ka = async (r, a, t) => {
1396
1399
  onSelect: c
1397
1400
  }, l(e)), {
1398
1401
  title: h(({ key: v, label: f, icon: g }) => [
1399
- D(d.$slots, "title", {
1402
+ P(d.$slots, "title", {
1400
1403
  label: f,
1401
1404
  key: v,
1402
1405
  icon: g
@@ -1426,7 +1429,7 @@ const Ka = async (r, a, t) => {
1426
1429
  fieldMap: t.fieldMap || ((g = t.url) == null ? void 0 : g.fieldMap),
1427
1430
  params: t.params || ((C = t.url) == null ? void 0 : C.params),
1428
1431
  loadingText: !1
1429
- }), n = B(), { editorCtrl: p, errInfo: u, labelText: i } = n, c = b(e.placeholder);
1432
+ }), n = A(), { editorCtrl: p, errInfo: u, labelText: i } = n, c = b(e.placeholder);
1430
1433
  $(
1431
1434
  () => o.value.loading,
1432
1435
  (I) => {
@@ -1436,15 +1439,15 @@ const Ka = async (r, a, t) => {
1436
1439
  );
1437
1440
  const d = a;
1438
1441
  n.inputEmit = d;
1439
- const s = b([]), v = (I, P) => {
1440
- if (!P || P.length === 0) {
1442
+ const s = b([]), v = (I, D) => {
1443
+ if (!D || D.length === 0) {
1441
1444
  d("update:labels", []), d("update:value", []);
1442
1445
  return;
1443
1446
  }
1444
- const x = P.map((R) => R.label);
1447
+ const x = D.map((R) => R.label);
1445
1448
  d("update:labels", x), d(
1446
1449
  "update:value",
1447
- P.map((R) => R.value)
1450
+ D.map((R) => R.value)
1448
1451
  ), u != null && u.value.errClass && p && V(p);
1449
1452
  };
1450
1453
  return z(() => {
@@ -1456,12 +1459,12 @@ const Ka = async (r, a, t) => {
1456
1459
  }), Ne(t.autoload, t, s, n, o.value, o.value.params);
1457
1460
  }), Ye(() => {
1458
1461
  Re(t, n);
1459
- }), (I, P) => {
1462
+ }), (I, D) => {
1460
1463
  var x;
1461
1464
  return m(), S("div", null, [
1462
1465
  s.value.length ? k("", !0) : (m(), S("div", fa, [
1463
1466
  y(l(it), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
1464
- P[0] || (P[0] = T("span", null, "数据加载中...", -1))
1467
+ D[0] || (D[0] = T("span", null, "数据加载中...", -1))
1465
1468
  ])),
1466
1469
  y(l(Ct), E({
1467
1470
  options: s.value,
@@ -1535,7 +1538,7 @@ const ll = /* @__PURE__ */ w({
1535
1538
  valueFormat: {}
1536
1539
  },
1537
1540
  setup(r) {
1538
- const a = r, { editorCtrl: t, labelText: e, errInfo: o } = B(), n = () => {
1541
+ const a = r, { editorCtrl: t, labelText: e, errInfo: o } = A(), n = () => {
1539
1542
  o != null && o.value.errClass && t && V(t);
1540
1543
  }, p = b(a.valueFormat ?? "YYYY-MM-DD");
1541
1544
  return (u, i) => {
@@ -1556,7 +1559,7 @@ const ll = /* @__PURE__ */ w({
1556
1559
  },
1557
1560
  emits: ["update:value"],
1558
1561
  setup(r, { emit: a }) {
1559
- const { editorCtrl: t, labelText: e, errInfo: o } = B(), n = () => {
1562
+ const { editorCtrl: t, labelText: e, errInfo: o } = A(), n = () => {
1560
1563
  o != null && o.value.errClass && t && V(t);
1561
1564
  }, p = r, u = a, i = b(p.value);
1562
1565
  $(
@@ -1597,14 +1600,14 @@ const ll = /* @__PURE__ */ w({
1597
1600
  d.$slots.addonBefore ? {
1598
1601
  name: "addonBefore",
1599
1602
  fn: h(() => [
1600
- D(d.$slots, "addonBefore")
1603
+ P(d.$slots, "addonBefore")
1601
1604
  ]),
1602
1605
  key: "0"
1603
1606
  } : void 0,
1604
1607
  d.$slots.addonAfter ? {
1605
1608
  name: "addonAfter",
1606
1609
  fn: h(() => [
1607
- D(d.$slots, "addonAfter")
1610
+ P(d.$slots, "addonAfter")
1608
1611
  ]),
1609
1612
  key: "1"
1610
1613
  } : void 0
@@ -1647,7 +1650,7 @@ const ll = /* @__PURE__ */ w({
1647
1650
  }), rl = /* @__PURE__ */ Q(_a, [["__scopeId", "data-v-f7b3ed74"]]), sl = /* @__PURE__ */ w({
1648
1651
  __name: "inputPassword",
1649
1652
  setup(r) {
1650
- const { editorCtrl: a, labelText: t, errInfo: e } = B(), o = () => {
1653
+ const { editorCtrl: a, labelText: t, errInfo: e } = A(), o = () => {
1651
1654
  e != null && e.value.errClass && a && V(a);
1652
1655
  };
1653
1656
  return (n, p) => {
@@ -1664,7 +1667,7 @@ const ll = /* @__PURE__ */ w({
1664
1667
  }), ol = /* @__PURE__ */ w({
1665
1668
  __name: "inputNumber",
1666
1669
  setup(r) {
1667
- const { editorCtrl: a, labelText: t, errInfo: e } = B(), o = () => {
1670
+ const { editorCtrl: a, labelText: t, errInfo: e } = A(), o = () => {
1668
1671
  e != null && e.value.errClass && a && V(a);
1669
1672
  };
1670
1673
  return (n, p) => {
@@ -1792,7 +1795,7 @@ const ll = /* @__PURE__ */ w({
1792
1795
  },
1793
1796
  emits: ["update:startDate", "update:endDate"],
1794
1797
  setup(r, { emit: a }) {
1795
- const t = r, e = a, o = B(), { errInfo: n } = o, p = G(() => t.valueFormat), u = G(() => {
1798
+ const t = r, e = a, o = A(), { errInfo: n } = o, p = G(() => t.valueFormat), u = G(() => {
1796
1799
  const c = t.startDate, d = t.endDate;
1797
1800
  if (!(!c || !d))
1798
1801
  try {
@@ -1822,12 +1825,12 @@ const ll = /* @__PURE__ */ w({
1822
1825
  }), ul = /* @__PURE__ */ Q(dt, [["__scopeId", "data-v-58735935"]]), dl = /* @__PURE__ */ w({
1823
1826
  __name: "index",
1824
1827
  setup(r) {
1825
- const { editorCtrl: a, labelText: t, errInfo: e } = B(), o = () => {
1828
+ const { editorCtrl: a, labelText: t, errInfo: e } = A(), o = () => {
1826
1829
  e != null && e.value.errClass && a && V(a);
1827
1830
  };
1828
1831
  return (n, p) => {
1829
1832
  var u;
1830
- return m(), _(l(Pt), E({
1833
+ return m(), _(l(Dt), E({
1831
1834
  class: ((u = l(e)) == null ? void 0 : u.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
1832
1835
  "allow-clear": !0,
1833
1836
  placeholder: "请输入" + l(t),
@@ -1849,7 +1852,7 @@ const ll = /* @__PURE__ */ w({
1849
1852
  },
1850
1853
  emits: ["change", "update:value"],
1851
1854
  setup(r, { emit: a }) {
1852
- const t = r, e = b({ ...t.url }), { editorCtrl: o, labelText: n, errInfo: p } = B(), u = a, i = b([]), c = b([]);
1855
+ const t = r, e = b({ ...t.url }), { editorCtrl: o, labelText: n, errInfo: p } = A(), u = a, i = b([]), c = b([]);
1853
1856
  t.value && t.value.every((s) => {
1854
1857
  c.value.push(s.toString());
1855
1858
  }), $(
@@ -1865,7 +1868,7 @@ const ll = /* @__PURE__ */ w({
1865
1868
  if (e.value) {
1866
1869
  const s = o == null ? void 0 : o.page;
1867
1870
  if (e.value.api || (e.value.api = s == null ? void 0 : s.api), e.value.authorize === void 0 && (e.value.authorize = s == null ? void 0 : s.authorize), t.autoload) {
1868
- const v = await Ae(o, {
1871
+ const v = await Be(o, {
1869
1872
  urlKey: "list",
1870
1873
  url: { ...e.value, url: e.value.url },
1871
1874
  loadingText: !1,
@@ -1876,18 +1879,18 @@ const ll = /* @__PURE__ */ w({
1876
1879
  }
1877
1880
  }), (s, v) => {
1878
1881
  var f;
1879
- return m(), _(l(Dt), E({
1882
+ return m(), _(l(Pt), E({
1880
1883
  class: ((f = l(p)) == null ? void 0 : f.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
1881
1884
  placeholder: "请输入" + l(n),
1882
1885
  targetKeys: c.value,
1883
1886
  onChange: d
1884
1887
  }, s.$attrs), {
1885
- children: h(({ direction: g, disabled: C, filteredItems: I, onItemSelectAll: P, onItemSelect: x, selectedKeys: R }) => [
1886
- D(s.$slots, "children", {
1888
+ children: h(({ direction: g, disabled: C, filteredItems: I, onItemSelectAll: D, onItemSelect: x, selectedKeys: R }) => [
1889
+ P(s.$slots, "children", {
1887
1890
  direction: g,
1888
1891
  disabled: C,
1889
1892
  filteredItems: I,
1890
- onItemSelectAll: P,
1893
+ onItemSelectAll: D,
1891
1894
  onItemSelect: x,
1892
1895
  selectedKeys: R
1893
1896
  })
@@ -1951,7 +1954,7 @@ const ll = /* @__PURE__ */ w({
1951
1954
  }), i = b([]);
1952
1955
  return z(async () => {
1953
1956
  if (o.value) {
1954
- const c = await Ae(t.gridCtrl, {
1957
+ const c = await Be(t.gridCtrl, {
1955
1958
  urlKey: "list",
1956
1959
  url: { ...t.gridCtrl.gridUrl, url: t.gridCtrl.gridUrl.url },
1957
1960
  params: t.gridCtrl.gridQuery,
@@ -2020,7 +2023,7 @@ const ll = /* @__PURE__ */ w({
2020
2023
  },
2021
2024
  emits: ["change", "update:value"],
2022
2025
  setup(r, { emit: a }) {
2023
- const t = r, e = t.treeCtrl, o = B(), { errInfo: n, labelText: p } = o, u = a;
2026
+ const t = r, e = t.treeCtrl, o = A(), { errInfo: n, labelText: p } = o, u = a;
2024
2027
  o.inputEmit = u;
2025
2028
  const i = b([]), c = b();
2026
2029
  $(
@@ -2081,10 +2084,10 @@ const ll = /* @__PURE__ */ w({
2081
2084
  default: h(() => [
2082
2085
  T("div", $a, [
2083
2086
  e.left ? (m(), S("div", Ta, [
2084
- D(e.$slots, "left")
2087
+ P(e.$slots, "left")
2085
2088
  ])) : k("", !0),
2086
2089
  T("div", Ia, [
2087
- D(e.$slots, "default")
2090
+ P(e.$slots, "default")
2088
2091
  ])
2089
2092
  ])
2090
2093
  ]),
@@ -2094,38 +2097,38 @@ const ll = /* @__PURE__ */ w({
2094
2097
  }
2095
2098
  });
2096
2099
  export {
2097
- kr as AppIcon,
2100
+ yr as AppIcon,
2098
2101
  oe as AppRouter,
2099
2102
  ar as AsyncUploader,
2100
2103
  el as AutoComplete,
2101
- wr as Breadcrumb,
2102
- A as Button,
2104
+ kr as Breadcrumb,
2105
+ B as Button,
2103
2106
  Ge as Cache,
2104
2107
  Ht as CacheKeys,
2105
2108
  tl as Cascader,
2106
2109
  al as Checkbox,
2107
2110
  vl as Content,
2108
2111
  ll as DatePicker,
2109
- Cr as Datetime,
2110
- Fr as Dialog,
2112
+ wr as Datetime,
2113
+ Er as Dialog,
2111
2114
  qa as Drawer,
2112
2115
  gl as EventPrefix,
2113
2116
  Wa as Form,
2114
2117
  Ga as FormItem,
2115
2118
  ja as Fullscreen,
2116
- Sr as Header,
2117
- $r as HeaderExits,
2119
+ Cr as Header,
2120
+ Sr as HeaderExits,
2118
2121
  Qt as Helper,
2119
2122
  _l as ICONS_LIB,
2120
- Tr as Icon,
2123
+ $r as Icon,
2121
2124
  sa as Icontool,
2122
2125
  ga as Input,
2123
2126
  rl as InputIcon,
2124
2127
  ol as InputNumber,
2125
2128
  sl as InputPassword,
2126
2129
  Qa as LayoutIcon,
2127
- Ir as Menu,
2128
- Pr as MenuTabs,
2130
+ Tr as Menu,
2131
+ Ir as MenuTabs,
2129
2132
  Oe as OPTIONS,
2130
2133
  nt as OptionCommProps,
2131
2134
  Dr as ProjectIcon,
@@ -2143,24 +2146,24 @@ export {
2143
2146
  dl as Textarea,
2144
2147
  L as ToolIcon,
2145
2148
  ca as Toolbar,
2146
- xr as Tooltip,
2149
+ br as Tooltip,
2147
2150
  wa as Transfer,
2148
2151
  pl as TransferTable,
2149
2152
  Za as Tree,
2150
2153
  fl as TreeSelect,
2151
- fr as UploadList,
2154
+ pr as UploadList,
2152
2155
  lr as UploadStatus,
2153
- hr as checkExcelDuplicates,
2156
+ mr as checkExcelDuplicates,
2154
2157
  bl as checkIconsExpired,
2155
2158
  it as circleLoading,
2156
2159
  Ze as createFromIconfont,
2157
2160
  xl as crumbs,
2158
- Pe as defaultTools,
2161
+ De as defaultTools,
2159
2162
  yl as doDelete,
2160
2163
  kl as doExecute,
2161
- Ae as doQuery,
2164
+ Be as doQuery,
2162
2165
  wl as doSave,
2163
- vr as donwloadFromMinio,
2166
+ fr as donwloadFromMinio,
2164
2167
  qe as downloadBlob,
2165
2168
  Cl as eventBus,
2166
2169
  Ha as exportResults,
@@ -2173,8 +2176,8 @@ export {
2173
2176
  $l as getIconTransform,
2174
2177
  Tl as getRecordDetail,
2175
2178
  Il as getRuleTexts,
2176
- Pl as getSelectedLabels,
2177
- Dl as getSelectedValues,
2179
+ Dl as getSelectedLabels,
2180
+ Pl as getSelectedValues,
2178
2181
  or as getToken,
2179
2182
  K as getToolByKey,
2180
2183
  be as getToolGroup,
@@ -2192,26 +2195,25 @@ export {
2192
2195
  Rl as initValidate,
2193
2196
  X as isEmpty,
2194
2197
  Ne as loadOption,
2195
- ir as mainAppPush,
2196
2198
  Ol as mergeColumns,
2197
2199
  Vt as onColumnVisibleChanged,
2198
2200
  ie as onFormClose,
2199
- De as onFormSave,
2201
+ Pe as onFormSave,
2200
2202
  et as onFormSaveAs,
2201
2203
  We as onFullscreenClick,
2202
2204
  at as onGridRowDelete,
2203
2205
  tt as onGridRowEdit,
2204
2206
  Ml as onGridRowExpand,
2205
- Al as onOptionChanged,
2207
+ Bl as onOptionChanged,
2206
2208
  Mt as onReloadClick,
2207
2209
  Y as onToolClicked,
2208
2210
  lt as openNewForm,
2209
- Bl as outFormDataFields,
2211
+ Al as outFormDataFields,
2210
2212
  zl as parseIcons,
2211
- cr as path,
2213
+ ir as path,
2212
2214
  Ul as pendingNavigation,
2213
2215
  Ll as pinia,
2214
- gr as processExcelFile,
2216
+ hr as processExcelFile,
2215
2217
  Me as queryTree,
2216
2218
  Yl as resetRules,
2217
2219
  Vl as routes,
@@ -2224,15 +2226,15 @@ export {
2224
2226
  Ee as useFormItemFactory,
2225
2227
  Wl as useGridFactory,
2226
2228
  Gl as useHostInfo,
2227
- B as useInputFactory,
2229
+ A as useInputFactory,
2228
2230
  Jl as usePageFactory,
2229
2231
  Xl as usePageInfo,
2230
2232
  ve as useSettingInfo,
2231
2233
  Kt as useToolFactory,
2232
2234
  Zl as useTreeFactory,
2233
2235
  Xe as useUserInfo,
2234
- ur as userLogin,
2235
- dr as userLogout,
2236
+ cr as userLogin,
2237
+ ur as userLogout,
2236
2238
  er as validateData,
2237
- _r as validateExcel
2239
+ gr as validateExcel
2238
2240
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -77,13 +77,18 @@ const checkPermission = (params: PermissionParams): boolean => {
77
77
  const userInfoStore = useUserInfo();
78
78
  const { url, role, permit } = params;
79
79
 
80
+ // 如果都没有配置,默认允许访问
81
+ if (isEmpty(role) && isEmpty(permit)) {
82
+ return true;
83
+ }
84
+
80
85
  // 获取当前URL,优先使用传入的url,否则使用当前路由路径
81
86
  const currentUrl = url;
82
87
 
83
88
  if (EnvConfig.VITE_PERMISSION_MODE === 'role') {
84
89
  // 仅判断角色权限
85
- if (!isEmpty(role) && role !== undefined) {
86
- return userInfoStore.hasRole(role);
90
+ if (!isEmpty(role)) {
91
+ return userInfoStore.hasRole(role!);
87
92
  }
88
93
  // 如果没有配置角色,默认允许访问
89
94
  return true;
@@ -102,13 +107,8 @@ const checkPermission = (params: PermissionParams): boolean => {
102
107
  }
103
108
 
104
109
  // 检查功能权限
105
- if (!isEmpty(permit) && typeof permit === 'string') {
106
- hasPermitPermission = userInfoStore.hasPermit(currentUrl, permit);
107
- }
108
-
109
- // 如果都没有配置,默认允许访问
110
- if (isEmpty(role) && isEmpty(permit)) {
111
- return true;
110
+ if (!isEmpty(permit)) {
111
+ hasPermitPermission = userInfoStore.hasPermit(currentUrl, permit!);
112
112
  }
113
113
 
114
114
  // 任意一个有权限即可
package/src/index.ts CHANGED
@@ -185,15 +185,7 @@ export { path, AsyncUploader } from '@/utils/file-upload';
185
185
  export { EventPrefix } from '@/utils/eventbus';
186
186
  export { default as eventBus } from '@/utils/eventbus';
187
187
 
188
- export {
189
- getHostInfo,
190
- getAppInfo,
191
- userLogin,
192
- userLogout,
193
- getToken,
194
- getUserInfo,
195
- mainAppPush,
196
- } from '@/utils/main-openapis';
188
+ export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo } from '@/utils/main-openapis';
197
189
 
198
190
  import router from '@/router';
199
191
  export { router as AppRouter };
@@ -52,8 +52,8 @@ const checkRoutePermission = (route: RouteRecord): boolean => {
52
52
 
53
53
  if (EnvConfig.VITE_PERMISSION_MODE === 'role') {
54
54
  // 仅判断角色权限
55
- if (!isEmpty(roles) && roles) {
56
- return userInfoStore.hasRole(roles);
55
+ if (!isEmpty(roles)) {
56
+ return userInfoStore.hasRole(roles!);
57
57
  }
58
58
  // 如果没有配置角色,默认允许访问
59
59
  return true;
@@ -63,8 +63,8 @@ const checkRoutePermission = (route: RouteRecord): boolean => {
63
63
  let hasPermitPermission = false;
64
64
 
65
65
  // 检查角色权限
66
- if (!isEmpty(roles) && roles) {
67
- hasRolePermission = userInfoStore.hasRole(roles);
66
+ if (!isEmpty(roles)) {
67
+ hasRolePermission = userInfoStore.hasRole(roles!);
68
68
  }
69
69
 
70
70
  // 如果是管理员,只需要检查角色权限
@@ -73,8 +73,8 @@ const checkRoutePermission = (route: RouteRecord): boolean => {
73
73
  }
74
74
 
75
75
  // 检查功能权限
76
- if (!isEmpty(permission) && permission) {
77
- hasPermitPermission = userInfoStore.hasPermit(route.path, permission);
76
+ if (!isEmpty(permission)) {
77
+ hasPermitPermission = userInfoStore.hasPermit(route.path, permission!);
78
78
  }
79
79
 
80
80
  // 任意一个有权限即可