@skyfox2000/webui 1.3.16 → 1.3.18

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 (128) hide show
  1. package/package.json +1 -1
  2. package/src/components/layout/page/baseLayout.vue +44 -0
  3. package/src/components/layout/page/basicLayout.vue +11 -44
  4. package/src/typings/option.d.ts +1 -1
  5. package/src/utils/options.ts +2 -2
  6. package/lib/AceEditor.d.ts +0 -1
  7. package/lib/BasicLayout.d.ts +0 -1
  8. package/lib/Error403.d.ts +0 -1
  9. package/lib/Error404.d.ts +0 -1
  10. package/lib/ExcelForm.d.ts +0 -1
  11. package/lib/UploadForm.d.ts +0 -1
  12. package/lib/assets/modules/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  13. package/lib/assets/modules/file-upload-JBIvw5Xx.js +0 -204
  14. package/lib/assets/modules/index-BMkaOjBS.js +0 -380
  15. package/lib/assets/modules/index-BOYtm8ib.js +0 -112
  16. package/lib/assets/modules/index-BkChvyed.js +0 -109
  17. package/lib/assets/modules/menuTabs-BFPjaQRI.js +0 -671
  18. package/lib/assets/modules/toolIcon-XOgjdQdO.js +0 -50
  19. package/lib/assets/modules/uploadList-BedljASx.js +0 -2407
  20. package/lib/assets/modules/uploadList-CW7OIDS3.js +0 -382
  21. package/lib/components/common/alert/index.vue.d.ts +0 -13
  22. package/lib/components/common/button/index.vue.d.ts +0 -41
  23. package/lib/components/common/icon/appicon.vue.d.ts +0 -11
  24. package/lib/components/common/icon/fullscreen.vue.d.ts +0 -3
  25. package/lib/components/common/icon/helper.vue.d.ts +0 -23
  26. package/lib/components/common/icon/index.vue.d.ts +0 -243
  27. package/lib/components/common/icon/layoutIcon.vue.d.ts +0 -43
  28. package/lib/components/common/icon/projectIcon.vue.d.ts +0 -59
  29. package/lib/components/common/icon/toolIcon.vue.d.ts +0 -43
  30. package/lib/components/common/index.d.ts +0 -22
  31. package/lib/components/common/loading/index.vue.d.ts +0 -3
  32. package/lib/components/common/tooltip/index.vue.d.ts +0 -21
  33. package/lib/components/content/dialog/index.vue.d.ts +0 -35
  34. package/lib/components/content/drawer/index.vue.d.ts +0 -28
  35. package/lib/components/content/form/formItem.vue.d.ts +0 -28
  36. package/lib/components/content/form/index.vue.d.ts +0 -25
  37. package/lib/components/content/index.d.ts +0 -22
  38. package/lib/components/content/search/index.vue.d.ts +0 -32
  39. package/lib/components/content/search/searchItem.vue.d.ts +0 -23
  40. package/lib/components/content/table/index.vue.d.ts +0 -127
  41. package/lib/components/content/table/tableOperate.vue.d.ts +0 -18
  42. package/lib/components/content/toolbar/icontool.vue.d.ts +0 -7
  43. package/lib/components/content/toolbar/index.vue.d.ts +0 -18
  44. package/lib/components/content/tree/index.vue.d.ts +0 -46
  45. package/lib/components/form/aceEditor/aceConfig.d.ts +0 -8
  46. package/lib/components/form/autoComplete/index.vue.d.ts +0 -101
  47. package/lib/components/form/cascader/index.vue.d.ts +0 -80
  48. package/lib/components/form/checkbox/index.vue.d.ts +0 -100
  49. package/lib/components/form/datePicker/index.vue.d.ts +0 -6
  50. package/lib/components/form/index.d.ts +0 -41
  51. package/lib/components/form/input/index.vue.d.ts +0 -29
  52. package/lib/components/form/input/inputIcon.vue.d.ts +0 -10
  53. package/lib/components/form/input/inputNumber.vue.d.ts +0 -3
  54. package/lib/components/form/input/inputPassword.vue.d.ts +0 -3
  55. package/lib/components/form/propEditor/index.vue.d.ts +0 -15
  56. package/lib/components/form/radio/index.vue.d.ts +0 -105
  57. package/lib/components/form/radio/radioStatus.vue.d.ts +0 -31
  58. package/lib/components/form/rangePicker/index.vue.d.ts +0 -16
  59. package/lib/components/form/select/index.vue.d.ts +0 -119
  60. package/lib/components/form/switch/index.vue.d.ts +0 -76
  61. package/lib/components/form/textarea/index.vue.d.ts +0 -3
  62. package/lib/components/form/timePicker/index.vue.d.ts +0 -6
  63. package/lib/components/form/transfer/index.vue.d.ts +0 -38
  64. package/lib/components/form/transfer/transferTable.vue.d.ts +0 -38
  65. package/lib/components/form/treeSelect/index.vue.d.ts +0 -47
  66. package/lib/components/form/upload/uploadList.vue.d.ts +0 -488
  67. package/lib/components/index.d.ts +0 -4
  68. package/lib/components/layout/breadcrumb/index.vue.d.ts +0 -3
  69. package/lib/components/layout/content/index.vue.d.ts +0 -22
  70. package/lib/components/layout/datetime/index.vue.d.ts +0 -3
  71. package/lib/components/layout/header/headerExits.vue.d.ts +0 -3
  72. package/lib/components/layout/header/index.vue.d.ts +0 -3
  73. package/lib/components/layout/header/user.vue.d.ts +0 -3
  74. package/lib/components/layout/index.d.ts +0 -14
  75. package/lib/components/layout/menu/index.vue.d.ts +0 -6
  76. package/lib/components/layout/menu/menuTabs.vue.d.ts +0 -3
  77. package/lib/const/options.d.ts +0 -32
  78. package/lib/directives/enter-submit.d.ts +0 -4
  79. package/lib/directives/index.d.ts +0 -2
  80. package/lib/directives/permission.d.ts +0 -5
  81. package/lib/es/AceEditor/index.js +0 -167
  82. package/lib/es/BasicLayout/index.js +0 -101
  83. package/lib/es/Error403/index.js +0 -39
  84. package/lib/es/Error404/index.js +0 -39
  85. package/lib/es/ExcelForm/index.js +0 -491
  86. package/lib/es/UploadForm/index.js +0 -110
  87. package/lib/index.d.ts +0 -46
  88. package/lib/router/index.d.ts +0 -15
  89. package/lib/stores/appInfo.d.ts +0 -31
  90. package/lib/stores/hostInfo.d.ts +0 -11
  91. package/lib/stores/pageInfo.d.ts +0 -18
  92. package/lib/stores/pinia.d.ts +0 -3
  93. package/lib/stores/settingInfo.d.ts +0 -8
  94. package/lib/stores/userInfo.d.ts +0 -25
  95. package/lib/typings/data.d.ts +0 -80
  96. package/lib/typings/form.d.ts +0 -206
  97. package/lib/typings/menu.d.ts +0 -7
  98. package/lib/typings/option.d.ts +0 -209
  99. package/lib/typings/page.d.ts +0 -70
  100. package/lib/typings/table.d.ts +0 -181
  101. package/lib/typings/tools.d.ts +0 -130
  102. package/lib/typings/tree.d.ts +0 -72
  103. package/lib/typings/upload.d.ts +0 -161
  104. package/lib/typings/urls.d.ts +0 -69
  105. package/lib/utils/cache.d.ts +0 -23
  106. package/lib/utils/data.d.ts +0 -6
  107. package/lib/utils/download.d.ts +0 -6
  108. package/lib/utils/eventbus.d.ts +0 -16
  109. package/lib/utils/excel-preview.d.ts +0 -24
  110. package/lib/utils/excel-view.d.ts +0 -25
  111. package/lib/utils/export-table.d.ts +0 -12
  112. package/lib/utils/file-upload.d.ts +0 -17
  113. package/lib/utils/form-csv.d.ts +0 -18
  114. package/lib/utils/form-excel.d.ts +0 -36
  115. package/lib/utils/form-validate.d.ts +0 -29
  116. package/lib/utils/form.d.ts +0 -9
  117. package/lib/utils/icon-loader.d.ts +0 -125
  118. package/lib/utils/isEmpty.d.ts +0 -1
  119. package/lib/utils/main-openapis.d.ts +0 -8
  120. package/lib/utils/menu.d.ts +0 -6
  121. package/lib/utils/options.d.ts +0 -7
  122. package/lib/utils/page.d.ts +0 -30
  123. package/lib/utils/table.d.ts +0 -21
  124. package/lib/utils/tools.d.ts +0 -18
  125. package/lib/utils/tree.d.ts +0 -3
  126. package/lib/vite-env.d.ts +0 -8
  127. package/lib/webui.css +0 -1
  128. package/lib/webui.es.js +0 -2345
@@ -1,491 +0,0 @@
1
- import { defineComponent as we, ref as f, computed as T, watch as W, onMounted as be, createBlock as H, openBlock as d, unref as i, withCtx as S, renderSlot as J, createElementBlock as g, createCommentVNode as K, createElementVNode as h, createVNode as C, createTextVNode as X, toDisplayString as E, normalizeClass as Ce, Fragment as ie, renderList as ne } from "vue";
2
- import { _ as Y } from "../../assets/modules/index-BkChvyed.js";
3
- import { Modal as Fe, Upload as ue, Space as _e } from "ant-design-vue";
4
- import { httpGet as Ue, ResStatus as fe } from "@skyfox2000/fapi";
5
- import { E as Te, a1 as Se, a7 as Ee } from "../../assets/modules/uploadList-BedljASx.js";
6
- import { A as Re, p as De, U as ce } from "../../assets/modules/file-upload-JBIvw5Xx.js";
7
- import "@skyfox2000/microbase";
8
- import p from "vue-m-message";
9
- import { c as ke, _ as Z, h as Le, p as Ne, i as Ke } from "../../assets/modules/index-BMkaOjBS.js";
10
- import "dayjs";
11
- import "vue-draggable-next";
12
- import "async-validator";
13
- import Ve from "@vue-office/excel";
14
- const Be = (l) => l.includes(",") || l.includes(`
15
- `), Me = (l, s) => l === "text/csv" || (s == null ? void 0 : s.toLowerCase().includes(".csv")) || !1, ze = (l, s) => l === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || l === "application/vnd.ms-excel" || (s == null ? void 0 : s.toLowerCase().match(/\.(xlsx|xls)$/)) !== null, ee = async (l, s = "preview.csv") => {
16
- const e = await ke(l, s);
17
- if (e.success)
18
- return {
19
- success: !0,
20
- blobUrl: e.blobUrl,
21
- fileName: e.fileName
22
- };
23
- throw new Error(e.error || "CSV格式处理失败");
24
- }, ae = (l, s, e = "预览文件.xlsx") => ({
25
- success: !0,
26
- blobUrl: `data:${s || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};base64,${l}`,
27
- fileName: e
28
- }), ve = async (l, s = !1) => {
29
- if (s) {
30
- if (typeof l == "string")
31
- return Be(l) ? await ee(l) : ae(l);
32
- if (l instanceof ArrayBuffer || l instanceof Uint8Array) {
33
- const e = new Blob([l], {
34
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
35
- });
36
- return {
37
- success: !0,
38
- blobUrl: URL.createObjectURL(e),
39
- fileName: "预览文件.xlsx"
40
- };
41
- } else
42
- throw new Error("不支持的原始文件格式");
43
- }
44
- if (l.Content && l.Type)
45
- return Me(l.Type, l.FileName) ? await ee(l.Content, l.FileName || "preview.csv") : ze(l.Type, l.FileName) ? ae(l.Content, l.Type, l.FileName || "预览文件.xlsx") : ae(l.Content);
46
- if (l.url)
47
- return {
48
- success: !0,
49
- blobUrl: l.url,
50
- fileName: l.fileName || "预览文件.xlsx"
51
- };
52
- if (typeof l == "string")
53
- return await ee(l);
54
- throw new Error("不支持的文件格式");
55
- }, Pe = async (l, s) => {
56
- if (!l || !s)
57
- return p.error("预览URL或Excel控制器未配置"), { success: !1 };
58
- try {
59
- let e = null;
60
- if (l.method === "GET") {
61
- const a = {
62
- ...l,
63
- method: "GET",
64
- api: l.api || s.page.api,
65
- authorize: l.authorize ?? s.page.authorize
66
- };
67
- e = await Ue(a);
68
- } else {
69
- const a = l.params;
70
- e = await Te(s, {
71
- url: l,
72
- urlKey: "preview",
73
- params: a,
74
- hideErrorToast: !0
75
- });
76
- }
77
- if (l.raw)
78
- return await ve(e, !0);
79
- if ((e == null ? void 0 : e.status) === fe.SUCCESS && e.data) {
80
- const a = e.data;
81
- return await ve(a, !1);
82
- } else
83
- throw new Error((e == null ? void 0 : e.msg) || "文件加载失败");
84
- } catch (e) {
85
- throw console.error("预览文件加载错误:", e), p.error("文件加载失败:" + ((e == null ? void 0 : e.message) || "未知错误")), e;
86
- }
87
- }, $e = {
88
- key: 0,
89
- class: "mb-4 flex items-center"
90
- }, je = {
91
- key: 0,
92
- class: "ml-3 text-gray-600"
93
- }, Ae = { class: "flex gap-4 relative" }, Oe = {
94
- key: 1,
95
- class: "w-[22%] flex-grow overflow-hidden flex flex-col"
96
- }, Ge = { class: "bg-gray-50 p-2 rounded border flex-grow flex flex-col" }, Ie = {
97
- key: 0,
98
- class: "text-gray-500"
99
- }, qe = {
100
- key: 1,
101
- class: "flex flex-col"
102
- }, Qe = { class: "overflow-y-auto" }, We = { class: "text-[13px] text-gray-600" }, He = { class: "pl-5 mt-1 mb-0" }, Je = {
103
- key: 0,
104
- class: "mt-3"
105
- }, Xe = { class: "text-[12px] text-gray-600 p-1" }, Ye = { class: "text-[13px] text-gray-600" }, Ze = { class: "pl-5 mt-1 mb-0" }, ea = { class: "text-[12px] text-gray-600" }, ma = /* @__PURE__ */ we({
106
- __name: "excelForm",
107
- props: {
108
- title: {},
109
- gridCtrl: {},
110
- excelCtrl: {},
111
- enableUpload: { type: Boolean, default: !0 },
112
- uploadParams: {},
113
- excelFieldMap: {},
114
- fileField: {},
115
- excelRecordsKey: {},
116
- excelRowsKey: {},
117
- saveText: {},
118
- cancelText: {},
119
- previewUrl: {},
120
- fileType: {}
121
- },
122
- setup(l, { expose: s }) {
123
- const e = l, a = e.excelCtrl, m = f(!1), b = f(""), le = f([]), y = f(""), z = T(() => !!e.previewUrl), te = T(() => e.enableUpload), de = T(() => {
124
- switch (e.fileType || "both") {
125
- case "excel":
126
- return ".xlsx,.xls";
127
- case "csv":
128
- return ".csv";
129
- case "both":
130
- default:
131
- return ".xlsx,.xls,.csv";
132
- }
133
- }), pe = T(() => {
134
- switch (e.fileType || "both") {
135
- case "excel":
136
- return "请选择Excel文件";
137
- case "csv":
138
- return "请选择CSV文件";
139
- case "both":
140
- default:
141
- return "请选择Excel或CSV文件";
142
- }
143
- }), V = f("待验证数据规则"), B = f("warning"), P = f("待验证重复数据"), $ = f("warning");
144
- W(
145
- () => a.visible.value,
146
- () => {
147
- m.value = a.visible.value, m.value && (A(), e.previewUrl && I());
148
- }
149
- ), W(
150
- () => m.value,
151
- () => {
152
- a.visible.value = m.value, m.value || A();
153
- }
154
- ), W(
155
- () => e.previewUrl,
156
- () => {
157
- m.value && e.previewUrl && I();
158
- },
159
- { deep: !0 }
160
- );
161
- const F = f(e.uploadParams), R = T(() => {
162
- var t;
163
- return (t = F.value) == null ? void 0 : t.uploadUrl;
164
- }), _ = T(() => {
165
- var t;
166
- return (t = F.value) == null ? void 0 : t.duplicateRules;
167
- }), D = T(() => {
168
- var t;
169
- return (t = F.value) == null ? void 0 : t.duplicateUrl;
170
- }), I = async () => {
171
- if (!(!e.previewUrl || !a)) {
172
- a.isFormLoading.value = !0;
173
- try {
174
- const t = await Pe(e.previewUrl, a);
175
- t.success && (b.value = t.blobUrl, y.value = t.fileName);
176
- } finally {
177
- setTimeout(() => {
178
- a.isFormLoading.value = !1;
179
- }, 1e3);
180
- }
181
- }
182
- }, me = async () => {
183
- var o;
184
- F.value = e.uploadParams;
185
- const t = R.value;
186
- if (!t) {
187
- p.error("未配置文件上传地址!");
188
- return;
189
- }
190
- if (U.value) {
191
- p.error("表格数据存在验证错误,请修正后再上传!");
192
- return;
193
- }
194
- a.isFormSaving.value = !0;
195
- try {
196
- if (!L.value || !y.value) {
197
- p.warning("请先选择文件!"), a.isFormSaving.value = !1;
198
- return;
199
- }
200
- const r = new Re(t, 1), u = q.value || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", n = new File([L.value], y.value, {
201
- type: u
202
- }), c = De.join(((o = F.value) == null ? void 0 : o.basePath) ?? "", y.value), v = {
203
- uid: "1",
204
- name: y.value,
205
- originFileObj: n,
206
- status: ce.Uploading,
207
- percent: 0,
208
- params: {
209
- FileKey: c
210
- }
211
- }, x = new AbortController();
212
- (await r.uploadFile(v, x.signal, (w) => {
213
- v.percent = w;
214
- })).status === ce.Success && (p.success("文件上传成功,开始业务处理!"), ye(v));
215
- } catch (r) {
216
- console.error("上传处理错误:", r), p.error("上传处理失败:" + ((r == null ? void 0 : r.message) || "未知错误"));
217
- } finally {
218
- a.isFormSaving.value = !1;
219
- }
220
- }, ye = async (t) => {
221
- if (a.formData.value) {
222
- if (e.excelRecordsKey || e.excelRowsKey) {
223
- const n = await Ne(L.value);
224
- if (!n) return null;
225
- const { excelData: c, excelRows: v } = n, x = c.map((N) => {
226
- var Q;
227
- const w = {};
228
- for (const O in N) {
229
- const G = (Q = e.excelFieldMap) == null ? void 0 : Q[O];
230
- G && (w[G] = N[O]);
231
- }
232
- return w;
233
- });
234
- e.excelRecordsKey && (a.formData.value[e.excelRecordsKey] = x), e.excelRowsKey && (a.formData.value[e.excelRowsKey] = v);
235
- }
236
- const o = e.fileField ?? "FileInfo";
237
- a.formData.value[o] = t;
238
- const r = {};
239
- a.primaryKey && a.formData.value[a.primaryKey] !== void 0 && (r[a.primaryKey] = a.formData.value[a.primaryKey]);
240
- const u = {
241
- Data: {
242
- ...a.formData.value
243
- },
244
- Query: r
245
- };
246
- if (a.beforeSave && a.beforeSave(u) === !1)
247
- return;
248
- a.isFormSaving.value = !0;
249
- try {
250
- const n = await Ee(e.excelCtrl, {
251
- params: u,
252
- urlKey: "save",
253
- url: e.excelCtrl.saveUrl
254
- });
255
- (n == null ? void 0 : n.status) === fe.SUCCESS && (a.afterSave && a.afterSave(), a.visible.value = !1);
256
- } catch (n) {
257
- console.error("保存错误:", n), p.error("数据保存失败,请稍后再试!");
258
- } finally {
259
- a.isFormSaving.value = !1;
260
- }
261
- }
262
- }, U = f(!1), k = f(!1), L = f(null), q = f(""), re = async (t) => {
263
- const o = e.gridCtrl;
264
- if (o) {
265
- F.value = e.uploadParams;
266
- try {
267
- D.value && (D.value.api || (D.value.api = o.page.api), D.value.authorize === void 0 && (D.value.authorize = o.page.authorize));
268
- const {
269
- errBlob: r,
270
- validationMsg: u,
271
- duplicateMsg: n,
272
- hasFormatError: c,
273
- hasDuplicateError: v
274
- } = await Ke(t, a.formRules.value, _.value, D.value);
275
- if (V.value = u, P.value = n, B.value = c ? "error" : a.formRules.value && Object.keys(a.formRules.value).length > 0 ? "success" : "warning", $.value = v ? "error" : _.value && _.value.length > 0 ? "success" : "warning", r) {
276
- U.value = c ?? !1, k.value = v ?? !1;
277
- const x = URL.createObjectURL(r);
278
- b.value = x;
279
- } else
280
- U.value = !1, k.value = !1;
281
- } catch {
282
- V.value = "验证异常", P.value = "验证异常", B.value = "error", $.value = "error";
283
- }
284
- }
285
- }, xe = async (t) => {
286
- if (!e.gridCtrl) {
287
- p.error("未配置表格控制器!");
288
- return;
289
- }
290
- F.value = e.uploadParams;
291
- const r = t.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || t.type === "application/vnd.ms-excel", u = t.type === "text/csv" || t.name.toLowerCase().endsWith(".csv"), n = e.fileType || "both";
292
- let c = !1, v = "";
293
- switch (n) {
294
- case "excel":
295
- c = r, v = "只能上传Excel文件!";
296
- break;
297
- case "csv":
298
- c = u, v = "只能上传CSV文件!";
299
- break;
300
- case "both":
301
- default:
302
- c = r || u, v = "只能上传Excel文件或CSV文件!";
303
- break;
304
- }
305
- if (!c)
306
- return p.error(v), ue.LIST_IGNORE;
307
- try {
308
- if (A(), y.value = t.name, q.value = u ? "text/csv" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", u) {
309
- const w = await t.arrayBuffer(), O = new TextDecoder("utf-8").decode(w), { csvToExcelView: G } = await import("../../assets/modules/index-BMkaOjBS.js").then((he) => he.j), M = await G(O, t.name);
310
- if (!M.success)
311
- throw new Error(M.error || "CSV文件处理失败");
312
- const oe = await (await fetch(M.blobUrl)).arrayBuffer();
313
- return L.value = oe, await re(oe), !U.value && !k.value && (b.value = M.blobUrl), y.value = M.fileName, a.isFormLoading.value = !1, !1;
314
- }
315
- const x = await t.arrayBuffer();
316
- L.value = x;
317
- const N = new FileReader();
318
- N.readAsDataURL(t), N.onload = async (w) => {
319
- w.target ? (await re(x), !U.value && !k.value && (b.value = w.target.result), a.isFormLoading.value = !1) : p.error("加载文件失败,请检查文件格式!");
320
- };
321
- } catch (x) {
322
- console.error("文件处理错误:", x), p.error("文件处理失败,请检查文件格式!"), a.isFormLoading.value = !1, V.value = "文件处理错误", B.value = "error";
323
- }
324
- return !1;
325
- }, j = Se(a.formRules.value);
326
- be(() => {
327
- var o;
328
- const t = (o = e.gridCtrl) == null ? void 0 : o.page;
329
- if (t && !z.value) {
330
- if (!R.value) {
331
- p.error("未配置文件上传地址!");
332
- return;
333
- }
334
- R.value.api || (R.value.api = t.api), R.value.authorize === void 0 && (R.value.authorize = t.authorize);
335
- for (const r in a.formData.value)
336
- e.gridCtrl.rowData.value && (a.formData.value[r] = e.gridCtrl.rowData.value[r]);
337
- }
338
- m.value = a.visible.value, m.value && e.previewUrl && I();
339
- });
340
- const A = () => {
341
- if (b.value = "", y.value = "", le.value = [], L.value = null, q.value = "", a.isFormLoading.value = !1, V.value = "待验证数据规则", B.value = "warning", P.value = "待验证重复数据", $.value = "warning", U.value = !1, k.value = !1, a.formData.value) {
342
- const t = e.fileField ?? "FileInfo", o = e.excelRecordsKey, r = e.excelRowsKey;
343
- delete a.formData.value[t], o && delete a.formData.value[o], r && delete a.formData.value[r];
344
- }
345
- }, se = () => {
346
- a.visible.value = !1;
347
- }, ge = () => {
348
- };
349
- return s({
350
- clearAll: A
351
- }), (t, o) => (d(), H(i(Fe), {
352
- title: t.title ?? "文件上传",
353
- open: m.value,
354
- "onUpdate:open": o[0] || (o[0] = (r) => m.value = r),
355
- wrapClassName: ["modal", "mx-auto", t.$attrs.width ? "w-[" + t.$attrs.width + "]" : ""].join(" "),
356
- width: 940,
357
- onClose: se
358
- }, {
359
- footer: S(() => [
360
- C(i(_e), null, {
361
- default: S(() => {
362
- var r;
363
- return [
364
- C(i(Y), { onClick: se }, {
365
- default: S(() => [
366
- X(E(t.cancelText ?? (z.value ? "关闭" : "取消")), 1)
367
- ]),
368
- _: 1
369
- }),
370
- z.value ? K("", !0) : (d(), H(i(Y), {
371
- key: 0,
372
- onClick: me,
373
- type: "primary",
374
- loading: ((r = i(a)) == null ? void 0 : r.isFormSaving.value) ?? !1,
375
- disabled: !b.value || U.value || k.value || i(a).isFormLoading.value
376
- }, {
377
- default: S(() => [
378
- X(E(t.saveText ?? "上传文件"), 1)
379
- ]),
380
- _: 1
381
- }, 8, ["loading", "disabled"]))
382
- ];
383
- }),
384
- _: 1
385
- })
386
- ]),
387
- default: S(() => [
388
- J(t.$slots, "default"),
389
- z.value ? K("", !0) : (d(), g("div", $e, [
390
- J(t.$slots, "file-before"),
391
- C(i(ue), {
392
- "file-list": le.value,
393
- "before-upload": xe,
394
- accept: de.value,
395
- showUploadList: !0,
396
- disabled: !te.value
397
- }, {
398
- default: S(() => [
399
- C(i(Y), {
400
- type: "primary",
401
- disabled: !te.value
402
- }, {
403
- default: S(() => [
404
- X(E(pe.value), 1)
405
- ]),
406
- _: 1
407
- }, 8, ["disabled"])
408
- ]),
409
- _: 1
410
- }, 8, ["file-list", "accept", "disabled"]),
411
- b.value && y.value ? (d(), g("div", je, [
412
- C(i(Z), {
413
- message: y.value,
414
- type: "info",
415
- "show-icon": !1
416
- }, null, 8, ["message"])
417
- ])) : K("", !0),
418
- J(t.$slots, "file-after")
419
- ])),
420
- h("div", Ae, [
421
- i(a).isFormLoading.value ? (d(), H(i(Le), {
422
- key: 0,
423
- size: "large"
424
- })) : K("", !0),
425
- h("div", {
426
- class: Ce(["flex-shrink-0 relative border border-gray-200 rounded-md overflow-hidden", [i(j).length === 0 ? "w-[100%]" : "w-[80%]"]]),
427
- style: { height: "430px" }
428
- }, [
429
- C(i(Ve), {
430
- src: b.value,
431
- onError: ge,
432
- style: { width: "100%", height: "100%" },
433
- options: {
434
- styles: !0,
435
- formatCells: !0,
436
- skipStyles: !1,
437
- autoStyle: !0,
438
- keepOriginalFormat: !0,
439
- renderingStyle: "svg"
440
- }
441
- }, null, 8, ["src"])
442
- ], 2),
443
- i(j).length > 0 ? (d(), g("div", Oe, [
444
- h("div", Ge, [
445
- i(j).length === 0 ? (d(), g("div", Ie, "没有设置验证规则")) : (d(), g("div", qe, [
446
- C(i(Z), {
447
- message: V.value,
448
- type: B.value,
449
- "show-icon": "",
450
- class: "mb-2"
451
- }, null, 8, ["message", "type"]),
452
- h("div", Qe, [
453
- (d(!0), g(ie, null, ne(i(j), (r, u) => (d(), g("div", {
454
- key: u,
455
- class: "border-b pb-0"
456
- }, [
457
- h("div", We, E(r.field), 1),
458
- h("ul", He, [
459
- (d(!0), g(ie, null, ne(r.rules, (n, c) => (d(), g("li", {
460
- key: c,
461
- class: "text-[12px] text-gray-600"
462
- }, E(n), 1))), 128))
463
- ])
464
- ]))), 128))
465
- ]),
466
- _.value && _.value.length > 0 ? (d(), g("div", Je, [
467
- C(i(Z), {
468
- message: P.value,
469
- type: $.value,
470
- "show-icon": "",
471
- class: "mt-2 mb-2"
472
- }, null, 8, ["message", "type"]),
473
- h("div", Xe, [
474
- h("div", Ye, " 以下" + E(_.value.length > 1 ? "组合" : "字段") + "必须唯一 ", 1),
475
- h("ul", Ze, [
476
- h("li", ea, E(_.value.join(", ")), 1)
477
- ])
478
- ])
479
- ])) : K("", !0)
480
- ]))
481
- ])
482
- ])) : K("", !0)
483
- ])
484
- ]),
485
- _: 3
486
- }, 8, ["title", "open", "wrapClassName"]));
487
- }
488
- });
489
- export {
490
- ma as default
491
- };
@@ -1,110 +0,0 @@
1
- import { defineComponent as y, ref as f, watch as S, onMounted as z, createBlock as D, openBlock as F, unref as u, withCtx as s, createVNode as m, createTextVNode as C } from "vue";
2
- import { _ as c } from "../../assets/modules/index-BkChvyed.js";
3
- import { Modal as _, Space as k } from "ant-design-vue";
4
- import { ResStatus as E } from "@skyfox2000/fapi";
5
- import { a3 as h } from "../../assets/modules/uploadList-BedljASx.js";
6
- import "@skyfox2000/microbase";
7
- import L from "vue-m-message";
8
- import "async-validator";
9
- import "dayjs";
10
- import { A as N } from "../../assets/modules/file-upload-JBIvw5Xx.js";
11
- import "vue-draggable-next";
12
- import { U as B } from "../../assets/modules/uploadList-CW7OIDS3.js";
13
- const K = /* @__PURE__ */ y({
14
- __name: "uploadForm",
15
- props: {
16
- fileExt: {},
17
- gridCtrl: {},
18
- maxCount: {},
19
- maxConcurrent: {},
20
- uploadForm: {},
21
- uploadUrl: {},
22
- downloadUrl: {},
23
- continueOnError: { type: Boolean }
24
- },
25
- emits: ["before:file-list", "before:upload", "after:upload", "on:progress"],
26
- setup(w, { emit: g }) {
27
- const l = w, a = l.uploadForm, p = f(!1), x = l.maxCount ?? 1, U = l.maxConcurrent ?? 3, n = f([]), d = g;
28
- S(
29
- () => a.visible.value,
30
- () => {
31
- p.value = a.visible.value;
32
- }
33
- );
34
- const r = f(l.uploadUrl), t = f(l.downloadUrl), b = async () => {
35
- d("before:upload", n.value), await new N(r.value, U).doUpload(
36
- n.value,
37
- a.isFormLoading,
38
- l.continueOnError,
39
- async (o, i) => {
40
- d("after:upload", o, i), o && a.formData.value && (await h(l.gridCtrl, a.formData.value)).status === E.SUCCESS && (a.visible.value = !1);
41
- },
42
- (o) => {
43
- d("on:progress", o);
44
- }
45
- );
46
- };
47
- z(() => {
48
- const e = l.gridCtrl.page;
49
- if (r.value = r.value ?? e.urls.upload, t.value = t.value ?? e.urls.download, !r.value) {
50
- L.error("未配置文件上传地址!");
51
- return;
52
- }
53
- r.value.api || (r.value.api = e.api), r.value.authorize === void 0 && (r.value.authorize = e.authorize), t.value && (t.value.api || (t.value.api = e.api), t.value.authorize === void 0 && (t.value.authorize = e.authorize));
54
- for (const i in a.formData.value)
55
- l.gridCtrl.rowData.value && (a.formData.value[i] = l.gridCtrl.rowData.value[i]);
56
- const o = [];
57
- d("before:file-list", a, o), n.value.push(...o), p.value = a.visible.value;
58
- });
59
- const v = () => {
60
- a.visible.value = !1;
61
- };
62
- return (e, o) => (F(), D(u(_), {
63
- title: "文件上传",
64
- open: p.value,
65
- "onUpdate:open": o[1] || (o[1] = (i) => p.value = i),
66
- wrapClassName: "modal mx-auto " + (e.$attrs.width ? "w-[" + e.$attrs.width + "]" : "w-[430px]"),
67
- onClose: v
68
- }, {
69
- footer: s(() => [
70
- m(u(k), null, {
71
- default: s(() => [
72
- m(u(c), { onClick: v }, {
73
- default: s(() => o[2] || (o[2] = [
74
- C("取消")
75
- ])),
76
- _: 1,
77
- __: [2]
78
- }),
79
- m(u(c), {
80
- onClick: b,
81
- type: "primary",
82
- loading: u(a).isFormSaving.value
83
- }, {
84
- default: s(() => o[3] || (o[3] = [
85
- C(" 上传文件并保存 ")
86
- ])),
87
- _: 1,
88
- __: [3]
89
- }, 8, ["loading"])
90
- ]),
91
- _: 1
92
- })
93
- ]),
94
- default: s(() => [
95
- m(B, {
96
- "file-list": n.value,
97
- "onUpdate:fileList": o[0] || (o[0] = (i) => n.value = i),
98
- "upload-url": r.value,
99
- "download-url": t.value,
100
- "max-count": u(x),
101
- "file-ext": e.fileExt
102
- }, null, 8, ["file-list", "upload-url", "download-url", "max-count", "file-ext"])
103
- ]),
104
- _: 1
105
- }, 8, ["open", "wrapClassName"]));
106
- }
107
- });
108
- export {
109
- K as default
110
- };
package/lib/index.d.ts DELETED
@@ -1,46 +0,0 @@
1
- import { default as router } from './router';
2
- export { pinia } from './stores/pinia';
3
- export type { AnyControl, PostOptions, ExecuteOptions, } from './typings/data.d';
4
- export type { PageControl, PageControlOption, PrimaryKey, } from './typings/page.d';
5
- export { ProviderKeys } from './typings/page.d';
6
- export type { GridControl, GridControlOption, } from './typings/table.d';
7
- export type { EditorControl, EditorControlOption, InputFactoryItems, ValidateRule, ValidateRuleItem, ValidateError, } from './typings/form.d';
8
- export type { ButtonTool, ButtonTools, ButtonType, IconTool, RowRecord, } from './typings/tools.d';
9
- export type { TreeControl, TreeControlOption, TreeNode, } from './typings/tree.d';
10
- export type { UploadFile, MinioFile, ExcelFileParams, } from './typings/upload.d';
11
- export { UploadStatus } from './typings/upload.d';
12
- export type { ApiUrls, ReqUrls, } from './typings/urls.d';
13
- export type { OptionItemProps, OptionProps, SelectValue, } from './typings/option.d';
14
- export type { BreadcrumbRoute, } from './typings/menu.d';
15
- export { OPTIONS } from './const/options';
16
- export { OptionCommProps } from './typings/option.d';
17
- export { initDirective } from './directives/index';
18
- export { isEmpty } from './utils/isEmpty';
19
- export { queryTree } from './utils/tree';
20
- export { getToolByKey, getToolGroup, getToolStatus, getToolVisible, onReloadClick, onToolClicked, onFullscreenClick, onColumnVisibleChanged, defaultTools, useToolFactory, } from './utils/tools';
21
- export { initPageFactory, useEditorFactory, useGridFactory, useTreeFactory, usePageFactory, useOptionFactory, } from './utils/page';
22
- export { loadOption, unloadOption, getSelectedValues, outFormDataFields, onOptionChanged, getSelectedLabels, } from './utils/options';
23
- export { downloadBlob, donwloadFromMinio, previewFromMinio, CanPreviewFileExt } from './utils/download';
24
- export { ICONS_LIB, checkIconsExpired, circleLoading, createFromIconfont, parseIcons, getIconTransform, } from './utils/icon-loader';
25
- export { CacheKeys, Cache, initCacheCheck } from './utils/cache';
26
- export { initMenu, crumbs, showBreadcrumb } from './utils/menu';
27
- export { onFormSave, onFormSaveAs, onFormClose, saveForm, getFormDetail, openNewForm, setFormData } from './utils/form';
28
- export { initValidate, formValidate, validateData, resetRules, getRuleTexts, useInputFactory, useFormItemFactory, } from './utils/form-validate';
29
- export { validateExcel, checkExcelDuplicates, processExcelFile, appendExcelData, createMarkedExcelView, } from './utils/form-excel';
30
- export { csvToExcelBlob, processCsvFile } from './utils/form-csv';
31
- export { csvToNormalized, excelToNormalized, toExcel, csvToExcelView, excelToExcelView, normalizedToExcelView, type NormalizedData, type ExcelViewResult, type ExcelMarkCell, type ExcelMarkInfo, } from './utils/excel-view';
32
- export { filterColumns, mergeColumns, gridQueryList, gridQueryFind, gridRowUpdate, gridStatusUpdate, getRecordDetail, onGridRowExpand, onGridRowEdit, onGridRowDelete, } from './utils/table';
33
- export { doQuery, doExecute, doSave, doDelete } from './utils/data';
34
- export { exportSelectedRows, exportResults } from './utils/export-table';
35
- export { path, AsyncUploader } from './utils/file-upload';
36
- export { EventPrefix } from './utils/eventbus';
37
- export { default as eventBus } from './utils/eventbus';
38
- export { getHostInfo, getAppInfo, userLogin, userLogout, getToken, getUserInfo } from './utils/main-openapis';
39
- export { router as AppRouter };
40
- export { pendingNavigation, routes } from './router';
41
- export { useAppInfo } from './stores/appInfo';
42
- export { useHostInfo } from './stores/hostInfo';
43
- export { useUserInfo } from './stores/userInfo';
44
- export { usePageInfo } from './stores/pageInfo';
45
- export { useSettingInfo } from './stores/settingInfo';
46
- export { Alert, Button, Tooltip, AppIcon, Fullscreen, Helper, Icon, LayoutIcon, ProjectIcon, ToolIcon, Loading, Dialog, Drawer, Form, FormItem, Search, SearchItem, Table, TableOperate, Toolbar, Icontool, Tree, AutoComplete, Cascader, Checkbox, DatePicker, Input, InputIcon, InputPassword, InputNumber, PropEditor, type PropConfigItem, Radio, RadioStatus, RangePicker, Select, Switch, Textarea, TimePicker, Transfer, TransferTable, TreeSelect, UploadList, Breadcrumb, Content, Datetime, Header, HeaderExits, Menu, MenuTabs, } from './components/index';
@@ -1,15 +0,0 @@
1
- import { RouteRecord } from '../../../502424_MicroBase';
2
- import { RouteLocationNormalizedGeneric, RouteRecordRaw, Router } from 'vue-router';
3
- import { Ref } from 'vue';
4
- export declare const LOGIN_PATH = "/login/";
5
- declare const routes: RouteRecord[];
6
- export declare const addAppRoutes: (subRoutes: RouteRecord[]) => void;
7
- export declare const flattenRoute: (route: RouteRecordRaw, flattenRoutes: Record<string, RouteRecord>, parent?: RouteRecord, parentPath?: string) => void;
8
- declare const router: Router;
9
- export { routes };
10
- export declare const pendingNavigation: Ref<{
11
- to: RouteLocationNormalizedGeneric;
12
- next: Function;
13
- } | null>;
14
- export declare const continueNavigation: (defaultPage: string) => void;
15
- export default router;