@skyfox2000/webui 1.2.10 → 1.2.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.
Files changed (121) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/lib/AceEditor.d.ts +1 -0
  3. package/lib/BasicLayout.d.ts +1 -0
  4. package/lib/Error403.d.ts +1 -0
  5. package/lib/Error404.d.ts +1 -0
  6. package/lib/ExcelForm.d.ts +1 -0
  7. package/lib/UploadForm.d.ts +1 -0
  8. package/lib/assets/modules/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  9. package/lib/assets/modules/file-upload-CGyzCx7I.js +204 -0
  10. package/lib/assets/modules/form-excel-DWirWVPA.js +235 -0
  11. package/lib/assets/modules/index-C1zkNPmi.js +109 -0
  12. package/lib/assets/modules/index-Czk7DDWM.js +112 -0
  13. package/lib/assets/modules/menuTabs-BOax-dro.js +671 -0
  14. package/lib/assets/modules/toolIcon-vJF7OgP6.js +50 -0
  15. package/lib/assets/modules/uploadList-BW23uSvi.js +369 -0
  16. package/lib/assets/modules/uploadList-DaUjVXLU.js +2267 -0
  17. package/lib/components/common/button/index.vue.d.ts +41 -0
  18. package/lib/components/common/icon/appicon.vue.d.ts +11 -0
  19. package/lib/components/common/icon/fullscreen.vue.d.ts +3 -0
  20. package/lib/components/common/icon/helper.vue.d.ts +22 -0
  21. package/lib/components/common/icon/index.vue.d.ts +243 -0
  22. package/lib/components/common/icon/layoutIcon.vue.d.ts +43 -0
  23. package/lib/components/common/icon/projectIcon.vue.d.ts +59 -0
  24. package/lib/components/common/icon/toolIcon.vue.d.ts +43 -0
  25. package/lib/components/common/index.d.ts +20 -0
  26. package/lib/components/common/loading/index.vue.d.ts +3 -0
  27. package/lib/components/common/tooltip/index.vue.d.ts +21 -0
  28. package/lib/components/content/dialog/index.vue.d.ts +35 -0
  29. package/lib/components/content/drawer/index.vue.d.ts +28 -0
  30. package/lib/components/content/form/formItem.vue.d.ts +27 -0
  31. package/lib/components/content/form/index.vue.d.ts +25 -0
  32. package/lib/components/content/index.d.ts +22 -0
  33. package/lib/components/content/search/index.vue.d.ts +30 -0
  34. package/lib/components/content/search/searchItem.vue.d.ts +23 -0
  35. package/lib/components/content/table/index.vue.d.ts +36 -0
  36. package/lib/components/content/table/tableOperate.vue.d.ts +18 -0
  37. package/lib/components/content/toolbar/icontool.vue.d.ts +7 -0
  38. package/lib/components/content/toolbar/index.vue.d.ts +18 -0
  39. package/lib/components/content/tree/index.vue.d.ts +46 -0
  40. package/lib/components/form/aceEditor/aceConfig.d.ts +8 -0
  41. package/lib/components/form/autoComplete/index.vue.d.ts +176 -0
  42. package/lib/components/form/cascader/index.vue.d.ts +120 -0
  43. package/lib/components/form/checkbox/index.vue.d.ts +139 -0
  44. package/lib/components/form/datePicker/index.vue.d.ts +6 -0
  45. package/lib/components/form/index.d.ts +39 -0
  46. package/lib/components/form/input/index.vue.d.ts +26 -0
  47. package/lib/components/form/input/inputIcon.vue.d.ts +10 -0
  48. package/lib/components/form/input/inputNumber.vue.d.ts +3 -0
  49. package/lib/components/form/input/inputPassword.vue.d.ts +3 -0
  50. package/lib/components/form/propEditor/index.vue.d.ts +21 -0
  51. package/lib/components/form/radio/index.vue.d.ts +144 -0
  52. package/lib/components/form/radio/radioStatus.vue.d.ts +31 -0
  53. package/lib/components/form/rangePicker/index.vue.d.ts +16 -0
  54. package/lib/components/form/select/index.vue.d.ts +153 -0
  55. package/lib/components/form/switch/index.vue.d.ts +43 -0
  56. package/lib/components/form/textarea/index.vue.d.ts +3 -0
  57. package/lib/components/form/transfer/index.vue.d.ts +38 -0
  58. package/lib/components/form/transfer/transferTable.vue.d.ts +38 -0
  59. package/lib/components/form/treeSelect/index.vue.d.ts +38 -0
  60. package/lib/components/form/upload/uploadList.vue.d.ts +487 -0
  61. package/lib/components/index.d.ts +4 -0
  62. package/lib/components/layout/breadcrumb/index.vue.d.ts +3 -0
  63. package/lib/components/layout/content/index.vue.d.ts +22 -0
  64. package/lib/components/layout/datetime/index.vue.d.ts +3 -0
  65. package/lib/components/layout/header/headerExits.vue.d.ts +3 -0
  66. package/lib/components/layout/header/index.vue.d.ts +3 -0
  67. package/lib/components/layout/header/user.vue.d.ts +3 -0
  68. package/lib/components/layout/index.d.ts +14 -0
  69. package/lib/components/layout/menu/index.vue.d.ts +6 -0
  70. package/lib/components/layout/menu/menuTabs.vue.d.ts +3 -0
  71. package/lib/const/options.d.ts +32 -0
  72. package/lib/directives/enter-submit.d.ts +4 -0
  73. package/lib/directives/index.d.ts +2 -0
  74. package/lib/directives/permission.d.ts +5 -0
  75. package/lib/es/AceEditor/index.js +167 -0
  76. package/lib/es/BasicLayout/index.js +101 -0
  77. package/lib/es/Error403/index.js +39 -0
  78. package/lib/es/Error404/index.js +39 -0
  79. package/lib/es/ExcelForm/index.js +321 -0
  80. package/lib/es/UploadForm/index.js +110 -0
  81. package/lib/index.d.ts +45 -0
  82. package/lib/router/index.d.ts +15 -0
  83. package/lib/stores/appInfo.d.ts +31 -0
  84. package/lib/stores/hostInfo.d.ts +9 -0
  85. package/lib/stores/pageInfo.d.ts +18 -0
  86. package/lib/stores/pinia.d.ts +3 -0
  87. package/lib/stores/settingInfo.d.ts +8 -0
  88. package/lib/stores/userInfo.d.ts +25 -0
  89. package/lib/typings/data.d.ts +80 -0
  90. package/lib/typings/form.d.ts +187 -0
  91. package/lib/typings/menu.d.ts +7 -0
  92. package/lib/typings/option.d.ts +189 -0
  93. package/lib/typings/page.d.ts +70 -0
  94. package/lib/typings/table.d.ts +181 -0
  95. package/lib/typings/tools.d.ts +130 -0
  96. package/lib/typings/tree.d.ts +72 -0
  97. package/lib/typings/upload.d.ts +161 -0
  98. package/lib/typings/urls.d.ts +69 -0
  99. package/lib/utils/cache.d.ts +23 -0
  100. package/lib/utils/data.d.ts +6 -0
  101. package/lib/utils/download.d.ts +4 -0
  102. package/lib/utils/eventbus.d.ts +16 -0
  103. package/lib/utils/export-table.d.ts +12 -0
  104. package/lib/utils/file-upload.d.ts +17 -0
  105. package/lib/utils/form-excel.d.ts +33 -0
  106. package/lib/utils/form-validate.d.ts +29 -0
  107. package/lib/utils/form.d.ts +9 -0
  108. package/lib/utils/icon-loader.d.ts +125 -0
  109. package/lib/utils/isEmpty.d.ts +1 -0
  110. package/lib/utils/main-openapis.d.ts +8 -0
  111. package/lib/utils/menu.d.ts +6 -0
  112. package/lib/utils/options.d.ts +10 -0
  113. package/lib/utils/page.d.ts +25 -0
  114. package/lib/utils/table.d.ts +21 -0
  115. package/lib/utils/tools.d.ts +18 -0
  116. package/lib/utils/tree.d.ts +3 -0
  117. package/lib/vite-env.d.ts +8 -0
  118. package/lib/webui.css +1 -0
  119. package/lib/webui.es.js +2262 -0
  120. package/package.json +4 -4
  121. package/src/components/content/form/formItem.vue +2 -2
@@ -0,0 +1,369 @@
1
+ import { defineComponent as K, ref as z, onMounted as X, onUnmounted as Y, createBlock as R, createCommentVNode as g, openBlock as f, unref as a, mergeProps as D, computed as j, watch as L, resolveDirective as Z, createElementBlock as x, normalizeClass as O, createElementVNode as p, withDirectives as y, withCtx as C, createVNode as m, createTextVNode as E, toDisplayString as $, Fragment as ee, renderList as te } from "vue";
2
+ import { _ as oe } from "./index-C1zkNPmi.js";
3
+ import { a as B, _ as V } from "./toolIcon-vJF7OgP6.js";
4
+ import { httpPost as ae, ResStatus as ne } from "@skyfox2000/fapi";
5
+ import { p as I, s as se, t as le, w as re } from "./uploadList-DaUjVXLU.js";
6
+ import { p as M, U as s } from "./file-upload-CGyzCx7I.js";
7
+ import { combineParams as ie } from "@skyfox2000/microbase";
8
+ import k from "vue-m-message";
9
+ import "async-validator";
10
+ import "dayjs";
11
+ import { Switch as ce, Upload as ue, Tag as de, Popconfirm as pe, Progress as me } from "ant-design-vue";
12
+ import "vue-draggable-next";
13
+ import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
+ const he = (u, _) => {
15
+ const e = document.createElement("a"), i = URL.createObjectURL(u);
16
+ e.href = i, e.download = _, e.style.display = "none", document.body.appendChild(e), e.click(), URL.revokeObjectURL(i), document.body.removeChild(e);
17
+ }, ve = (u, _, e) => {
18
+ try {
19
+ e && (u.api || (u.api = e.api), u.authorize === void 0 && (u.authorize = e.authorize));
20
+ const i = ie(u.params, _);
21
+ return ae(u, i).then((d) => {
22
+ if ((d == null ? void 0 : d.status) === ne.SUCCESS && d.data) {
23
+ const r = d.data, v = r.Content, b = r.Key.split("/").pop(), c = atob(v), S = [];
24
+ for (let U = 0; U < c.length; U++)
25
+ S.push(c.charCodeAt(U));
26
+ const w = new Blob([new Uint8Array(S)], {
27
+ type: r.Type
28
+ });
29
+ he(w, b);
30
+ } else
31
+ k.error("下载文件失败!");
32
+ });
33
+ } catch (i) {
34
+ console.error("下载失败:", i), k.error("文件下载失败,请稍后重试");
35
+ }
36
+ }, xe = /* @__PURE__ */ K({
37
+ __name: "index",
38
+ props: {
39
+ /**
40
+ * 选择项数据
41
+ */
42
+ data: {
43
+ type: Array,
44
+ required: !0
45
+ }
46
+ },
47
+ emits: ["change"],
48
+ setup(u, { emit: _ }) {
49
+ const e = u, i = z([]), d = _, { editorCtrl: r, errInfo: v } = I(), b = (c) => {
50
+ v != null && v.value.errClass && r && re(r), d("change", c);
51
+ };
52
+ return X(() => {
53
+ if (!e.data || e.data.length != 2) {
54
+ console.error("Switch组件: ", e.data), k.error("Switch组件必须有且只有两个选项");
55
+ return;
56
+ }
57
+ se(!1, e, i);
58
+ }), Y(() => {
59
+ le(e);
60
+ }), (c, S) => {
61
+ var w;
62
+ return i.value.length === 2 ? (f(), R(a(ce), D({
63
+ key: 0,
64
+ class: [
65
+ ((w = a(v)) == null ? void 0 : w.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "",
66
+ "bg-blue-300",
67
+ "w-[58px]"
68
+ ],
69
+ checkedChildren: i.value[0].label,
70
+ checkedValue: i.value[0].value,
71
+ unCheckedChildren: i.value[1].label,
72
+ unCheckedValue: i.value[1].value,
73
+ onChange: b
74
+ }, c.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : g("", !0);
75
+ };
76
+ }
77
+ }), _e = { class: "flex items-center justify-between w-full" }, Ce = { class: "w-35 mx-3" }, we = { class: "mt-4 px-3" }, ye = { class: "flex items-center justify-between" }, ge = { class: "flex items-center" }, ke = { class: "flex items-center" }, be = {
78
+ key: 0,
79
+ class: "mr-2"
80
+ }, Se = {
81
+ key: 1,
82
+ class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer"
83
+ }, Ue = ["onClick"], Fe = { class: "flex items-center text-red-500 hover:text-red-700 cursor-pointer" }, Oe = ["onClick"], Ee = {
84
+ key: 0,
85
+ class: "text-sm text-nowrap"
86
+ }, ze = { key: 0 }, Le = /* @__PURE__ */ K({
87
+ __name: "uploadList",
88
+ props: {
89
+ autoUpload: { type: Boolean, default: !1 },
90
+ uploadUrl: {},
91
+ downloadUrl: {},
92
+ fileList: { default: () => [] },
93
+ placeholder: { default: "" },
94
+ fileExt: {},
95
+ maxFileSize: { default: 20 },
96
+ maxCount: { default: 5 },
97
+ maxCountTip: { type: Boolean, default: !1 },
98
+ maxFileSizeTip: { type: Boolean, default: !0 },
99
+ fileExtTip: { type: Boolean, default: !0 },
100
+ parentPath: {},
101
+ showActionText: { type: Boolean, default: !0 },
102
+ showOnlineSwitch: { type: Boolean, default: !1 }
103
+ },
104
+ emits: ["update:file-list"],
105
+ setup(u, { emit: _ }) {
106
+ const e = u, i = I(), { errInfo: d } = i, r = z(e.fileList), v = z(), b = _, c = z(!1), S = j(() => {
107
+ var t;
108
+ return (t = e.fileExt) != null && t.length ? e.fileExt.map((o) => `.${o}`).join(",") : "";
109
+ }), w = (t) => {
110
+ var o;
111
+ if (e.fileExt && e.fileExt.length > 0) {
112
+ const n = ((o = t.name.split(".").pop()) == null ? void 0 : o.toLowerCase()) || "";
113
+ if (!e.fileExt.includes(n))
114
+ return k.error("文件类型不支持"), !1;
115
+ }
116
+ return t.size / 1024 / 1024 > e.maxFileSize ? (k.error(`文件大小超过 ${e.maxFileSize}MB 限制`), !1) : e.maxCount > 1 && r.value.length >= e.maxCount ? (k.error(`最多上传 ${e.maxCount} 个文件`), !1) : (c.value = !1, e.autoUpload);
117
+ }, U = (t) => {
118
+ t.forEach((o) => {
119
+ const n = o;
120
+ n.fileName || (n.fileName = n.name), e.parentPath && (n.name = M.join("/", e.parentPath, n.fileName)), n.params || (n.params = {}), n.params.FileKey = n.name, n.status = s.Pending;
121
+ });
122
+ }, q = j(() => ({
123
+ accept: S.value,
124
+ multiple: !0,
125
+ fileList: r.value,
126
+ "onUpdate:fileList": U,
127
+ beforeUpload: w,
128
+ listType: "text",
129
+ maxCount: e.maxCount,
130
+ showUploadList: !1,
131
+ onChange: (t) => {
132
+ e.autoUpload || (r.value = t.fileList);
133
+ }
134
+ }));
135
+ L(
136
+ () => e.fileList,
137
+ (t) => {
138
+ r.value = t;
139
+ },
140
+ { deep: !0, immediate: !0 }
141
+ ), L(
142
+ () => r.value,
143
+ (t) => {
144
+ b("update:file-list", t);
145
+ },
146
+ { deep: !0 }
147
+ ), L(
148
+ () => e.parentPath,
149
+ (t) => {
150
+ t && r.value.forEach((o) => {
151
+ o.params.FileKey = M.join("/", t, o.fileName);
152
+ });
153
+ }
154
+ );
155
+ const P = (t) => {
156
+ if (!e.downloadUrl) return;
157
+ const o = r.value[t].minioFile, n = {
158
+ api: e.downloadUrl.api,
159
+ authorize: e.downloadUrl.authorize,
160
+ url: e.downloadUrl.url,
161
+ params: {
162
+ Query: {
163
+ FileKey: o.Key
164
+ }
165
+ }
166
+ };
167
+ ve(n);
168
+ }, Q = (t) => {
169
+ t.minioFile && (t.minioFile.Status = t.status);
170
+ }, T = (t) => {
171
+ r.value.splice(t, 1), c.value = !1;
172
+ }, G = (t, o) => {
173
+ if (o === s.Pending) {
174
+ T(t);
175
+ return;
176
+ }
177
+ c.value = !0;
178
+ }, H = () => {
179
+ const t = e.fileExt && e.fileExt.length && e.fileExtTip ? `文件必须为 ${e.fileExt.join("/")}` : "", o = e.maxFileSize !== 0 && e.maxFileSizeTip ? `单文件最大 ${e.maxFileSize}MB` : "", n = e.maxCount !== 0 && e.maxCountTip ? `最多 ${e.maxCount} 个文件` : "";
180
+ return [o, t, n].filter(Boolean).join(",");
181
+ }, J = (t) => {
182
+ switch (t) {
183
+ case s.Uploading:
184
+ return "blue";
185
+ case s.Success:
186
+ return "green";
187
+ case s.Error:
188
+ return "red";
189
+ case s.Online:
190
+ return "green";
191
+ case s.Offline:
192
+ return "pink";
193
+ default:
194
+ return "cyan";
195
+ }
196
+ }, W = (t) => {
197
+ switch (t) {
198
+ case s.Uploading:
199
+ return "上传中";
200
+ case s.Success:
201
+ return "上传完成";
202
+ case s.Error:
203
+ return "上传失败";
204
+ case s.Online:
205
+ return "在线";
206
+ case s.Offline:
207
+ return "已下线";
208
+ default:
209
+ return "待上传";
210
+ }
211
+ };
212
+ return (t, o) => {
213
+ var A, N;
214
+ const n = Z("auth");
215
+ return f(), x("div", {
216
+ class: O(["w-full border border-solid border-gray-100 mt-1 rounded-md py-5", [(A = a(d)) == null ? void 0 : A.errClass]])
217
+ }, [
218
+ p("div", _e, [
219
+ p("div", Ce, [
220
+ y((f(), R(a(ue), D({
221
+ ref_key: "fileUploader",
222
+ ref: v
223
+ }, q.value), {
224
+ default: C(() => {
225
+ var l;
226
+ return [
227
+ m(a(oe), {
228
+ class: O([((l = a(d)) == null ? void 0 : l.errClass) + "-text"])
229
+ }, {
230
+ default: C(() => o[2] || (o[2] = [
231
+ E("选择文件")
232
+ ])),
233
+ _: 1,
234
+ __: [2]
235
+ }, 8, ["class"])
236
+ ];
237
+ }),
238
+ _: 1
239
+ }, 16)), [
240
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:upload" }]
241
+ ])
242
+ ]),
243
+ p("div", {
244
+ class: O(["flex-1 text-sm text-gray-500", [((N = a(d)) == null ? void 0 : N.errClass) + "-text"]])
245
+ }, $(H()), 3)
246
+ ]),
247
+ p("div", we, [
248
+ (f(!0), x(ee, null, te(r.value, (l, F) => (f(), x("div", {
249
+ key: F,
250
+ class: "mb-2 pb-1"
251
+ }, [
252
+ p("div", ye, [
253
+ p("div", ge, [
254
+ p("span", {
255
+ class: O(["text-gray-700 mr-2", [l.status == a(s).Offline ? "line-through" : ""]])
256
+ }, $(l.fileName ?? l.name), 3),
257
+ p("span", null, [
258
+ m(a(de), {
259
+ color: J(l.status)
260
+ }, {
261
+ default: C(() => [
262
+ E($(W(l.status)), 1)
263
+ ]),
264
+ _: 2
265
+ }, 1032, ["color"])
266
+ ])
267
+ ]),
268
+ p("div", ke, [
269
+ t.showOnlineSwitch && (l.status == a(s).Online || l.status == a(s).Offline) ? (f(), x("div", be, [
270
+ m(a(B), { title: "上线或下线" }, {
271
+ default: C(() => [
272
+ y(m(a(xe), {
273
+ checked: l.status,
274
+ "onUpdate:checked": (h) => l.status = h,
275
+ data: [
276
+ { label: "上线", value: a(s).Online },
277
+ { label: "下线", value: a(s).Offline }
278
+ ],
279
+ onChange: (h) => Q(l)
280
+ }, null, 8, ["checked", "onUpdate:checked", "data", "onChange"]), [
281
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:online" }]
282
+ ])
283
+ ]),
284
+ _: 2
285
+ }, 1024)
286
+ ])) : g("", !0),
287
+ t.downloadUrl && (l.status == a(s).Online || l.status == a(s).Offline) ? (f(), x("div", Se, [
288
+ m(a(B), { title: "下载" }, {
289
+ default: C(() => [
290
+ y(m(a(V), {
291
+ icon: "icon-download",
292
+ clickable: "",
293
+ onClick: (h) => P(F)
294
+ }, null, 8, ["onClick"]), [
295
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
296
+ ]),
297
+ t.showActionText ? y((f(), x("span", {
298
+ key: 0,
299
+ class: "mr-2 text-sm text-nowrap",
300
+ onClick: (h) => P(F)
301
+ }, o[3] || (o[3] = [
302
+ E("下载")
303
+ ]), 8, Ue)), [
304
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:download" }]
305
+ ]) : g("", !0)
306
+ ]),
307
+ _: 2
308
+ }, 1024)
309
+ ])) : g("", !0),
310
+ p("div", Fe, [
311
+ m(a(pe), {
312
+ open: c.value,
313
+ "onUpdate:open": o[0] || (o[0] = (h) => c.value = h),
314
+ cancelText: "否",
315
+ okText: "是",
316
+ title: "确定删除该文件吗?",
317
+ okButtonProps: { size: "small" },
318
+ cancelButtonProps: { size: "small" },
319
+ onConfirm: (h) => T(F),
320
+ onCancel: o[1] || (o[1] = (h) => c.value = !1)
321
+ }, {
322
+ default: C(() => [
323
+ m(a(B), { title: "删除" }, {
324
+ default: C(() => [
325
+ p("div", {
326
+ onClick: (h) => G(F, l.status)
327
+ }, [
328
+ y(m(a(V), {
329
+ icon: "icon-new",
330
+ angle: 45,
331
+ clickable: ""
332
+ }, null, 512), [
333
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
334
+ ]),
335
+ t.showActionText ? y((f(), x("span", Ee, o[4] || (o[4] = [
336
+ E("删除")
337
+ ]))), [
338
+ [n, { role: ["Super", "Admin"], permit: ":uploadlist:delete" }]
339
+ ]) : g("", !0)
340
+ ], 8, Oe)
341
+ ]),
342
+ _: 2
343
+ }, 1024)
344
+ ]),
345
+ _: 2
346
+ }, 1032, ["open", "onConfirm"])
347
+ ])
348
+ ])
349
+ ]),
350
+ l.status !== a(s).Online && l.status !== a(s).Offline && l.status !== a(s).Success ? (f(), x("div", ze, [
351
+ m(a(me), {
352
+ percent: l.percent,
353
+ "stroke-width": 2,
354
+ "show-info": !1,
355
+ style: { height: "2px" }
356
+ }, null, 8, ["percent"])
357
+ ])) : g("", !0)
358
+ ]))), 128))
359
+ ])
360
+ ], 2);
361
+ };
362
+ }
363
+ }), qe = /* @__PURE__ */ fe(Le, [["__scopeId", "data-v-78bfcd29"]]);
364
+ export {
365
+ qe as U,
366
+ xe as _,
367
+ ve as a,
368
+ he as d
369
+ };