@skyfox2000/webui 0.1.2 → 0.1.4

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 (64) hide show
  1. package/lib/AceEditor.d.ts +0 -3
  2. package/lib/BasicLayout.d.ts +0 -3
  3. package/lib/Error403.d.ts +0 -3
  4. package/lib/Error404.d.ts +0 -3
  5. package/lib/ExcelForm.d.ts +0 -3
  6. package/lib/UploadForm.d.ts +0 -3
  7. package/lib/assets/modules/index-BEWJ_qAH.js +50 -0
  8. package/lib/assets/modules/{excelForm-Dzndz-SG.js → index-BoKIa2sr.js} +1 -1
  9. package/lib/assets/modules/{index-FzWSvscZ.js → index-D47Ci-T3.js} +2 -2
  10. package/lib/assets/modules/menuTabs-JxjPoyCD.js +639 -0
  11. package/lib/assets/modules/uploadList-Dzlg47V0.js +182 -0
  12. package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -1
  13. package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -1
  14. package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -1
  15. package/lib/components/content/index.d.ts +0 -4
  16. package/lib/components/content/index.d.ts.map +1 -1
  17. package/lib/components/form/autoComplete/index.vue.d.ts +3 -3
  18. package/lib/components/form/cascader/index.vue.d.ts +3 -3
  19. package/lib/components/form/checkbox/index.vue.d.ts +1 -1
  20. package/lib/components/form/index.d.ts +0 -2
  21. package/lib/components/form/index.d.ts.map +1 -1
  22. package/lib/components/form/radio/index.vue.d.ts +3 -3
  23. package/lib/components/form/select/index.vue.d.ts +3 -3
  24. package/lib/components/form/transfer/index.vue.d.ts +2 -2
  25. package/lib/components/form/treeSelect/index.vue.d.ts +2 -2
  26. package/lib/components/index.d.ts +3 -6
  27. package/lib/components/index.d.ts.map +1 -1
  28. package/lib/components/layout/index.d.ts +0 -2
  29. package/lib/components/layout/index.d.ts.map +1 -1
  30. package/lib/es/AceEditor/index.js +9 -11
  31. package/lib/es/BasicLayout/index.js +94 -2
  32. package/lib/es/Error403/index.js +31 -2
  33. package/lib/es/Error404/index.js +31 -2
  34. package/lib/es/ExcelForm/index.js +315 -3
  35. package/lib/es/UploadForm/index.js +133 -3
  36. package/lib/webui.css +1 -1
  37. package/lib/webui.es.js +1568 -1575
  38. package/package.json +2 -2
  39. package/src/components/common/icon/layoutIcon.vue +1 -1
  40. package/src/components/common/icon/projectIcon.vue +1 -1
  41. package/src/components/common/icon/toolIcon.vue +2 -2
  42. package/src/components/content/index.ts +4 -4
  43. package/src/components/form/index.ts +2 -2
  44. package/src/components/index.ts +1 -10
  45. package/src/components/layout/index.ts +2 -2
  46. package/lib/assets/modules/basicLayout-YP_-EySb.js +0 -726
  47. package/lib/assets/modules/error403-Bi0E2twj.js +0 -33
  48. package/lib/assets/modules/error404-BF7vasR_.js +0 -33
  49. package/lib/assets/modules/excelForm-WJVQmaDT.js +0 -317
  50. package/lib/assets/modules/index-ekkaExvB.js +0 -49
  51. package/lib/assets/modules/uploadForm-CwXiG05t.js +0 -309
  52. package/lib/components/content/dialog/excelForm.vue.d.ts +0 -31
  53. package/lib/components/content/dialog/excelForm.vue.d.ts.map +0 -1
  54. package/lib/components/content/dialog/uploadForm.vue.d.ts +0 -25
  55. package/lib/components/content/dialog/uploadForm.vue.d.ts.map +0 -1
  56. package/lib/components/error/error403.vue.d.ts +0 -4
  57. package/lib/components/error/error403.vue.d.ts.map +0 -1
  58. package/lib/components/error/error404.vue.d.ts +0 -4
  59. package/lib/components/error/error404.vue.d.ts.map +0 -1
  60. package/lib/components/form/aceEditor/index.vue.d.ts +0 -13
  61. package/lib/components/form/aceEditor/index.vue.d.ts.map +0 -1
  62. package/lib/components/layout/page/basicLayout.vue.d.ts +0 -7
  63. package/lib/components/layout/page/basicLayout.vue.d.ts.map +0 -1
  64. /package/lib/assets/modules/{uploadForm-BahGnrAq.js → index-BahGnrAq.js} +0 -0
@@ -1,33 +0,0 @@
1
- import { defineComponent as n, createBlock as p, openBlock as i, unref as e, withCtx as r, createVNode as _, createTextVNode as a } from "vue";
2
- import { Result as c, Button as m } from "ant-design-vue";
3
- import { AppRouter as s } from "@skyfox2000/webbase";
4
- const x = /* @__PURE__ */ n({
5
- __name: "error403",
6
- setup(u) {
7
- const o = () => {
8
- s.back();
9
- };
10
- return (l, t) => (i(), p(e(c), {
11
- status: "403",
12
- title: "403",
13
- "sub-title": "您没有权限访问当前页面!"
14
- }, {
15
- extra: r(() => [
16
- _(e(m), {
17
- type: "primary",
18
- onClick: o
19
- }, {
20
- default: r(() => t[0] || (t[0] = [
21
- a("点击返回")
22
- ])),
23
- _: 1,
24
- __: [0]
25
- })
26
- ]),
27
- _: 1
28
- }));
29
- }
30
- });
31
- export {
32
- x as _
33
- };
@@ -1,33 +0,0 @@
1
- import { defineComponent as n, createBlock as p, openBlock as i, unref as e, withCtx as r, createVNode as _, createTextVNode as a } from "vue";
2
- import { Result as c, Button as m } from "ant-design-vue";
3
- import { AppRouter as s } from "@skyfox2000/webbase";
4
- const x = /* @__PURE__ */ n({
5
- __name: "error404",
6
- setup(u) {
7
- const o = () => {
8
- s.back();
9
- };
10
- return (l, t) => (i(), p(e(c), {
11
- status: "404",
12
- title: "404",
13
- "sub-title": "页面不存在或者没有权限访问页面!"
14
- }, {
15
- extra: r(() => [
16
- _(e(m), {
17
- type: "primary",
18
- onClick: o
19
- }, {
20
- default: r(() => t[0] || (t[0] = [
21
- a("点击返回")
22
- ])),
23
- _: 1,
24
- __: [0]
25
- })
26
- ]),
27
- _: 1
28
- }));
29
- }
30
- });
31
- export {
32
- x as _
33
- };
@@ -1,317 +0,0 @@
1
- import { defineComponent as Y, ref as r, watch as A, 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 P, renderList as $ } from "vue";
2
- import { _ as K } from "./excelForm-Dzndz-SG.js";
3
- import { Modal as te, Upload as I, Alert as G, Space as re } from "ant-design-vue";
4
- import { ResStatus as oe } from "@skyfox2000/fapi";
5
- import { getRuleTexts as se, AsyncUploader as ie, path as ue, UploadStatus as ne, processExcelFile as ce, doSave as ve, validateExcel as de, checkExcelDuplicates as fe } from "@skyfox2000/webbase";
6
- import "./index-ekkaExvB.js";
7
- import n from "vue-m-message";
8
- import pe from "@vue-office/excel";
9
- const me = { class: "mb-4 flex items-center" }, xe = {
10
- key: 0,
11
- class: "ml-3 text-gray-600"
12
- }, ge = { class: "flex gap-4" }, ye = {
13
- key: 0,
14
- class: "w-[22%] flex-grow overflow-hidden flex flex-col"
15
- }, he = { class: "bg-gray-50 p-2 rounded border flex-grow flex flex-col" }, _e = {
16
- key: 0,
17
- class: "text-gray-500"
18
- }, be = {
19
- key: 1,
20
- class: "flex flex-col"
21
- }, we = { class: "overflow-y-auto" }, Ce = { class: "text-[13px] text-gray-600" }, Fe = { class: "pl-5 mt-1 mb-0" }, Ee = {
22
- key: 0,
23
- class: "mt-3"
24
- }, Ue = { class: "text-[12px] text-gray-600 p-1" }, Se = { class: "text-[13px] text-gray-600" }, ke = { class: "pl-5 mt-1 mb-0" }, De = { class: "text-[12px] text-gray-600" }, Oe = /* @__PURE__ */ Y({
25
- __name: "excelForm",
26
- props: {
27
- title: {},
28
- gridCtrl: {},
29
- excelCtrl: {},
30
- uploadParams: {},
31
- excelFieldMap: {},
32
- fileField: {},
33
- excelBatchField: {},
34
- saveText: {}
35
- },
36
- setup(Q) {
37
- const o = Q, e = o.excelCtrl, b = r(!1), w = r(""), q = r([]), x = r(""), E = r(!0), U = r("待验证数据规则"), S = r("warning"), k = r("待验证重复数据"), D = r("warning");
38
- A(
39
- () => e.visible.value,
40
- () => {
41
- b.value = e.visible.value;
42
- }
43
- ), A(
44
- () => b.value,
45
- () => {
46
- e.visible.value = b.value;
47
- }
48
- );
49
- const R = r(o.uploadParams), p = r(R.value.uploadUrl), g = r(R.value.duplicateRules), C = r(R.value.duplicateUrl), H = async () => {
50
- const l = p.value;
51
- if (!l) {
52
- n.error("未配置文件上传地址!");
53
- return;
54
- }
55
- if (B.value) {
56
- n.error("表格数据存在验证错误,请修正后再上传!");
57
- return;
58
- }
59
- e.isFormLoading.value = !0;
60
- try {
61
- if (!z.value || !x.value) {
62
- n.warning("请先选择Excel文件!"), e.isFormLoading.value = !1;
63
- return;
64
- }
65
- const a = new ie(l, 1), s = new File([z.value], x.value, {
66
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
67
- }), t = ue.join(R.value.basePath, x.value), v = {
68
- uid: "1",
69
- name: x.value,
70
- originFileObj: s,
71
- status: ne.Uploading,
72
- percent: 0,
73
- params: {
74
- FileKey: t
75
- }
76
- }, y = new AbortController();
77
- try {
78
- await a.uploadFile(v, y.signal, (u) => {
79
- v.percent = u;
80
- }), n.success("文件上传成功,开始业务处理!"), J(v);
81
- } catch (u) {
82
- throw console.error("文件上传错误:", u), n.error((u == null ? void 0 : u.message) || "文件上传失败,请稍后再试!"), u;
83
- }
84
- } catch (a) {
85
- console.error("上传处理错误:", a), n.error("上传处理失败:" + ((a == null ? void 0 : a.message) || "未知错误"));
86
- } finally {
87
- e.isFormLoading.value = !1;
88
- }
89
- }, J = async (l) => {
90
- if (e.formData.value) {
91
- if (o.excelBatchField) {
92
- const t = await ce(z.value);
93
- if (!t) return null;
94
- const { excelData: v } = t, y = v.map((u) => {
95
- const h = {};
96
- for (const L in u) {
97
- const j = o.excelFieldMap[L];
98
- j && (h[j] = u[L]);
99
- }
100
- return h;
101
- });
102
- e.formData.value[o.excelBatchField] = y;
103
- }
104
- const a = o.fileField ?? "FileInfo";
105
- e.formData.value[a] = l, e.beforeSave && e.beforeSave();
106
- const s = {
107
- Data: {
108
- ...e.formData.value
109
- },
110
- Query: {
111
- [o.excelCtrl.primaryKey]: e.formData.value[o.excelCtrl.primaryKey]
112
- }
113
- };
114
- e.isFormLoading.value = !0;
115
- try {
116
- const t = await ve(o.excelCtrl, {
117
- params: s,
118
- urlKey: "save",
119
- url: o.excelCtrl.saveUrl
120
- });
121
- (t == null ? void 0 : t.status) === oe.SUCCESS ? (n.success("数据保存成功!"), e.afterSave && e.afterSave(), e.visible.value = !1) : n.error("保存失败:" + ((t == null ? void 0 : t.msg) || "未知错误"));
122
- } catch (t) {
123
- console.error("保存错误:", t), n.error("数据保存失败,请稍后再试!");
124
- } finally {
125
- e.isFormLoading.value = !1;
126
- }
127
- }
128
- }, B = r(!1), N = r(!1), z = r(null), W = async (l) => {
129
- if (!(l.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l.type === "application/vnd.ms-excel"))
130
- return n.error("只能上传Excel文件!"), I.LIST_IGNORE;
131
- try {
132
- x.value = l.name, B.value = !1, N.value = !1, E.value = !0, U.value = "待验证数据规则", S.value = "warning", k.value = "待验证重复数据", D.value = "warning";
133
- const s = await l.arrayBuffer();
134
- z.value = s;
135
- const t = new FileReader();
136
- t.readAsDataURL(l), t.onload = async (v) => {
137
- if (v.target) {
138
- const { hasError: y, errBlob: u } = await de(s, e.formRules.value);
139
- if (y) {
140
- if (u) {
141
- B.value = !0, E.value = !1, U.value = "数据验证失败", S.value = "error";
142
- const h = URL.createObjectURL(u);
143
- w.value = h;
144
- }
145
- return;
146
- } else
147
- U.value = "数据验证成功", S.value = "success";
148
- if (g.value && g.value.length > 0 && C.value)
149
- try {
150
- C.value.api || (C.value.api = o.gridCtrl.page.api), C.value.authorize === void 0 && (C.value.authorize = o.gridCtrl.page.authorize);
151
- const { hasError: h, errBlob: L } = await fe(
152
- s,
153
- g.value,
154
- C.value
155
- );
156
- if (h) {
157
- if (L) {
158
- N.value = !0, k.value = "检测到重复数据", D.value = "error";
159
- const j = URL.createObjectURL(L);
160
- w.value = j;
161
- }
162
- return;
163
- } else
164
- N.value = !1, k.value = "数据验证通过", D.value = "success";
165
- } catch {
166
- k.value = "重复检测异常", D.value = "error";
167
- }
168
- w.value = v.target.result, E.value = !1;
169
- } else
170
- n.error("加载Excel文件失败,请检查文件格式!");
171
- };
172
- } catch (s) {
173
- console.error("Excel处理错误:", s), n.error("Excel文件处理失败,请检查文件格式!"), E.value = !1, U.value = "Excel处理错误", S.value = "error";
174
- }
175
- return !1;
176
- }, T = se(e.formRules.value);
177
- Z(() => {
178
- const l = o.gridCtrl.page;
179
- if (p.value = p.value ?? l.urls.upload, !p.value) {
180
- n.error("未配置文件上传地址!");
181
- return;
182
- }
183
- p.value.api || (p.value.api = l.api), p.value.authorize === void 0 && (p.value.authorize = l.authorize);
184
- for (const a in e.formData.value)
185
- o.gridCtrl.rowData.value && (e.formData.value[a] = o.gridCtrl.rowData.value[a]);
186
- b.value = e.visible.value;
187
- });
188
- const V = () => {
189
- e.visible.value = !1;
190
- }, X = () => {
191
- console.error("渲染失败");
192
- };
193
- return (l, a) => (d(), ee(i(te), {
194
- title: l.title ?? "Excel文件上传",
195
- open: b.value,
196
- "onUpdate:open": a[0] || (a[0] = (s) => b.value = s),
197
- wrapClassName: ["modal", "mx-auto", l.$attrs.width ? "w-[" + l.$attrs.width + "]" : ""].join(" "),
198
- width: 940,
199
- onClose: V
200
- }, {
201
- footer: _(() => [
202
- m(i(re), null, {
203
- default: _(() => [
204
- m(i(K), { onClick: V }, {
205
- default: _(() => a[2] || (a[2] = [
206
- O("取消")
207
- ])),
208
- _: 1,
209
- __: [2]
210
- }),
211
- m(i(K), {
212
- onClick: H,
213
- type: "primary",
214
- loading: i(e).isFormSaving.value,
215
- disabled: !w.value || B.value || N.value || E.value
216
- }, {
217
- default: _(() => [
218
- O(F(l.saveText ?? "上传文件"), 1)
219
- ]),
220
- _: 1
221
- }, 8, ["loading", "disabled"])
222
- ]),
223
- _: 1
224
- })
225
- ]),
226
- default: _(() => [
227
- le(l.$slots, "default"),
228
- c("div", me, [
229
- m(i(I), {
230
- "file-list": q.value,
231
- "before-upload": W,
232
- accept: ".xlsx,.xls",
233
- showUploadList: !0
234
- }, {
235
- default: _(() => [
236
- m(i(K), { type: "primary" }, {
237
- default: _(() => a[1] || (a[1] = [
238
- O("选择Excel文件")
239
- ])),
240
- _: 1,
241
- __: [1]
242
- })
243
- ]),
244
- _: 1
245
- }, 8, ["file-list"]),
246
- w.value && x.value ? (d(), f("div", xe, [
247
- c("span", null, F(x.value), 1)
248
- ])) : M("", !0)
249
- ]),
250
- c("div", ge, [
251
- c("div", {
252
- class: ae(["flex-shrink-0 excel-container", [i(T).length === 0 ? "w-[100%]" : "w-[80%]"]]),
253
- style: { height: "430px" }
254
- }, [
255
- m(i(pe), {
256
- src: w.value,
257
- onError: X,
258
- style: { width: "100%", height: "100%" },
259
- options: {
260
- styles: !0,
261
- formatCells: !0,
262
- skipStyles: !1,
263
- autoStyle: !0,
264
- keepOriginalFormat: !0,
265
- renderingStyle: "svg"
266
- }
267
- }, null, 8, ["src"])
268
- ], 2),
269
- i(T).length > 0 ? (d(), f("div", ye, [
270
- c("div", he, [
271
- i(T).length === 0 ? (d(), f("div", _e, "没有设置验证规则")) : (d(), f("div", be, [
272
- m(i(G), {
273
- message: U.value,
274
- type: S.value,
275
- "show-icon": "",
276
- class: "mb-2"
277
- }, null, 8, ["message", "type"]),
278
- c("div", we, [
279
- (d(!0), f(P, null, $(i(T), (s, t) => (d(), f("div", {
280
- key: t,
281
- class: "border-b pb-0"
282
- }, [
283
- c("div", Ce, F(s.field), 1),
284
- c("ul", Fe, [
285
- (d(!0), f(P, null, $(s.rules, (v, y) => (d(), f("li", {
286
- key: y,
287
- class: "text-[12px] text-gray-600"
288
- }, F(v), 1))), 128))
289
- ])
290
- ]))), 128))
291
- ]),
292
- g.value && g.value.length > 0 ? (d(), f("div", Ee, [
293
- m(i(G), {
294
- message: k.value,
295
- type: D.value,
296
- "show-icon": "",
297
- class: "mt-2 mb-2"
298
- }, null, 8, ["message", "type"]),
299
- c("div", Ue, [
300
- c("div", Se, " 以下" + F(g.value.length > 1 ? "组合" : "字段") + "必须唯一 ", 1),
301
- c("ul", ke, [
302
- c("li", De, F(g.value.join(", ")), 1)
303
- ])
304
- ])
305
- ])) : M("", !0)
306
- ]))
307
- ])
308
- ])) : M("", !0)
309
- ])
310
- ]),
311
- _: 3
312
- }, 8, ["title", "open", "wrapClassName"]));
313
- }
314
- });
315
- export {
316
- Oe as _
317
- };
@@ -1,49 +0,0 @@
1
- import { defineComponent as r, createBlock as i, openBlock as s, unref as l, withCtx as m, renderSlot as p, createCommentVNode as f, mergeProps as u } from "vue";
2
- import { Tooltip as d } from "ant-design-vue";
3
- import { SERVER_HOST as x } from "@skyfox2000/fapi";
4
- import { createFromIconfont as y } from "@skyfox2000/webbase";
5
- const _ = /* @__PURE__ */ r({
6
- __name: "index",
7
- props: {
8
- size: {}
9
- },
10
- setup(o) {
11
- const e = o, t = {}, n = {};
12
- return e.size === "small" && (n.fontSize = "12px", n.padding = "4px 6px", n.minHeight = "26px", t.height = "30px"), (c, a) => (s(), i(l(d), {
13
- overlayInnerStyle: n,
14
- overlayStyle: t
15
- }, {
16
- default: m(() => [
17
- p(c.$slots, "default")
18
- ]),
19
- _: 3
20
- }));
21
- }
22
- }), g = /* @__PURE__ */ r({
23
- __name: "toolIcon",
24
- props: {
25
- icon: {
26
- type: String
27
- },
28
- icons: {
29
- type: Array
30
- }
31
- },
32
- setup(o) {
33
- const e = o, n = y({
34
- iconUrl: `${x.TOOL_ICONS}`,
35
- monoColor: !0,
36
- icon: e.icon,
37
- icons: e.icons
38
- });
39
- return (c, a) => o.icon || o.icons ? (s(), i(l(n), u({
40
- key: 0,
41
- icon: o.icon,
42
- icons: o.icons
43
- }, c.$attrs), null, 16, ["icon", "icons"])) : f("", !0);
44
- }
45
- });
46
- export {
47
- g as _,
48
- _ as a
49
- };