@skyfox2000/webui 1.2.8 → 1.2.9
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.
- package/lib/assets/modules/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/lib/assets/modules/file-upload-BYIvmkmy.js +204 -0
- package/lib/assets/modules/form-excel-BUX2QW11.js +235 -0
- package/lib/assets/modules/{index-CTVMLeDF.js → index-DcRkhkn2.js} +1 -1
- package/lib/assets/modules/index-jl5Ie2tZ.js +112 -0
- package/lib/assets/modules/{menuTabs-BtOiocOC.js → menuTabs-DY1XBq16.js} +134 -139
- package/lib/assets/modules/{toolIcon-B9Mw9Ktm.js → toolIcon-BDIOj_3l.js} +1 -1
- package/lib/assets/modules/uploadList-BPG5whz7.js +369 -0
- package/lib/assets/modules/{index-D9kzQ23e.js → uploadList-D2Ux4h1N.js} +553 -513
- package/lib/components/common/index.d.ts +2 -0
- package/lib/components/common/loading/index.vue.d.ts +3 -0
- package/lib/components/content/dialog/index.vue.d.ts +1 -0
- package/lib/components/content/drawer/index.vue.d.ts +2 -0
- package/lib/components/content/form/formItem.vue.d.ts +2 -0
- package/lib/components/form/autoComplete/index.vue.d.ts +41 -4
- package/lib/components/form/cascader/index.vue.d.ts +13 -2
- package/lib/components/form/checkbox/index.vue.d.ts +13 -2
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/propEditor/index.vue.d.ts +10 -1
- package/lib/components/form/radio/index.vue.d.ts +13 -2
- package/lib/components/form/select/index.vue.d.ts +13 -2
- package/lib/components/form/upload/uploadList.vue.d.ts +14 -3
- package/lib/components/index.d.ts +2 -2
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +15 -15
- package/lib/es/Error403/index.js +1 -1
- package/lib/es/Error404/index.js +1 -1
- package/lib/es/ExcelForm/index.js +4 -4
- package/lib/es/UploadForm/index.js +60 -87
- package/lib/index.d.ts +2 -2
- package/lib/typings/form.d.ts +18 -2
- package/lib/typings/option.d.ts +16 -2
- package/lib/typings/page.d.ts +1 -0
- package/lib/utils/file-upload.d.ts +4 -2
- package/lib/utils/form-excel.d.ts +3 -0
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +1085 -1063
- package/package.json +1 -1
- package/scripts/userInput.py +2 -0
- package/src/components/common/index.ts +3 -0
- package/src/components/common/loading/index.vue +11 -0
- package/src/components/content/dialog/index.vue +15 -8
- package/src/components/content/dialog/uploadForm.vue +38 -79
- package/src/components/content/drawer/index.vue +26 -6
- package/src/components/content/form/formItem.vue +21 -5
- package/src/components/content/form/index.vue +4 -2
- package/src/components/content/search/searchItem.vue +1 -1
- package/src/components/form/autoComplete/index.vue +12 -4
- package/src/components/form/cascader/index.vue +1 -1
- package/src/components/form/datePicker/index.vue +1 -1
- package/src/components/form/index.ts +1 -0
- package/src/components/form/input/inputIcon.vue +1 -1
- package/src/components/form/propEditor/index.vue +113 -33
- package/src/components/form/select/index.vue +27 -17
- package/src/components/form/upload/uploadList.vue +174 -34
- package/src/components/index.ts +13 -1
- package/src/directives/permission.ts +2 -2
- package/src/index.ts +3 -1
- package/src/typings/form.d.ts +18 -2
- package/src/typings/option.d.ts +16 -2
- package/src/typings/page.d.ts +1 -0
- package/src/utils/download.ts +1 -1
- package/src/utils/eventbus.ts +1 -1
- package/src/utils/file-upload.ts +75 -14
- package/src/utils/form-excel.ts +50 -1
- package/src/utils/form-validate.ts +18 -1
- package/src/utils/form.ts +3 -1
- package/src/utils/options.ts +38 -12
- package/lib/assets/modules/file-upload-CZO-pMJd.js +0 -176
- package/lib/assets/modules/form-excel-N-2OYqKv.js +0 -211
- package/lib/assets/modules/index-BnHnS9ug.js +0 -111
- package/lib/assets/modules/uploadList-B4LxzsC6.js +0 -210
|
@@ -1,210 +0,0 @@
|
|
|
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-CTVMLeDF.js";
|
|
3
|
-
import { Upload as A, Tag as K, Progress as D } from "ant-design-vue";
|
|
4
|
-
import { httpPost as I, ResStatus as Q } from "@skyfox2000/fapi";
|
|
5
|
-
import "./index-D9kzQ23e.js";
|
|
6
|
-
import { U as o, p as q } from "./file-upload-CZO-pMJd.js";
|
|
7
|
-
import { combineParams as G } from "@skyfox2000/microbase";
|
|
8
|
-
import h from "vue-m-message";
|
|
9
|
-
import "async-validator";
|
|
10
|
-
import "dayjs";
|
|
11
|
-
import "vue-draggable-next";
|
|
12
|
-
const H = (i, u) => {
|
|
13
|
-
const e = document.createElement("a"), a = URL.createObjectURL(i);
|
|
14
|
-
e.href = a, e.download = u, e.style.display = "none", document.body.appendChild(e), e.click(), URL.revokeObjectURL(a), document.body.removeChild(e);
|
|
15
|
-
}, J = (i, u, e) => {
|
|
16
|
-
try {
|
|
17
|
-
e && (i.api || (i.api = e.api), i.authorize === void 0 && (i.authorize = e.authorize));
|
|
18
|
-
const a = G(i.params, u);
|
|
19
|
-
return I(i, a).then((c) => {
|
|
20
|
-
if ((c == null ? void 0 : c.status) === Q.SUCCESS && c.data) {
|
|
21
|
-
const d = c.data, b = d.Content, g = d.FileName, x = atob(b), _ = [];
|
|
22
|
-
for (let m = 0; m < x.length; m++)
|
|
23
|
-
_.push(x.charCodeAt(m));
|
|
24
|
-
const C = new Blob([new Uint8Array(_)], {
|
|
25
|
-
type: d.Type
|
|
26
|
-
});
|
|
27
|
-
H(C, g);
|
|
28
|
-
} else
|
|
29
|
-
h.error("下载文件失败!");
|
|
30
|
-
});
|
|
31
|
-
} catch (a) {
|
|
32
|
-
console.error("下载失败:", a), h.error("文件下载失败,请稍后重试");
|
|
33
|
-
}
|
|
34
|
-
}, W = { class: "w-full border border-solid border-gray-100 mt-1 rounded-md py-5" }, X = { class: "flex items-center justify-between w-full" }, Y = { class: "w-35 mx-3" }, Z = { class: "flex-1 text-sm text-gray-500" }, ee = { class: "mt-4 px-3" }, te = { class: "flex items-center justify-between" }, oe = { class: "flex items-center" }, ne = { class: "flex items-center" }, se = ["onClick"], ae = ["onClick"], re = ["onClick"], ve = /* @__PURE__ */ $({
|
|
35
|
-
__name: "uploadList",
|
|
36
|
-
props: {
|
|
37
|
-
autoUpload: { type: Boolean, default: !1 },
|
|
38
|
-
downloadUrl: {},
|
|
39
|
-
fileList: { default: () => [] },
|
|
40
|
-
placeholder: { default: "" },
|
|
41
|
-
fileExt: {},
|
|
42
|
-
maxFileSize: { default: 20 },
|
|
43
|
-
maxCount: { default: 5 },
|
|
44
|
-
parentPath: {}
|
|
45
|
-
},
|
|
46
|
-
emits: ["update:file-list"],
|
|
47
|
-
setup(i, { emit: u }) {
|
|
48
|
-
const e = i, a = k(e.fileList), c = k(), d = u, b = O(() => {
|
|
49
|
-
var t;
|
|
50
|
-
return (t = e.fileExt) != null && t.length ? e.fileExt.map((s) => `.${s}`).join(",") : "";
|
|
51
|
-
}), g = (t) => {
|
|
52
|
-
var s;
|
|
53
|
-
if (e.fileExt && e.fileExt.length > 0) {
|
|
54
|
-
const n = ((s = t.name.split(".").pop()) == null ? void 0 : s.toLowerCase()) || "";
|
|
55
|
-
if (!e.fileExt.includes(n))
|
|
56
|
-
return h.error("文件类型不支持"), !1;
|
|
57
|
-
}
|
|
58
|
-
return t.size / 1024 / 1024 > e.maxFileSize ? (h.error(`文件大小超过 ${e.maxFileSize}MB 限制`), !1) : e.maxCount > 1 && a.value.length >= e.maxCount ? (h.error(`最多上传 ${e.maxCount} 个文件`), !1) : e.autoUpload;
|
|
59
|
-
}, x = (t) => {
|
|
60
|
-
t.forEach((s) => {
|
|
61
|
-
s.fileName || (s.fileName = s.name), e.parentPath && (s.name = q.join("/", e.parentPath, s.fileName));
|
|
62
|
-
});
|
|
63
|
-
}, _ = O(() => ({
|
|
64
|
-
accept: b.value,
|
|
65
|
-
multiple: !0,
|
|
66
|
-
fileList: a.value,
|
|
67
|
-
"onUpdate:fileList": x,
|
|
68
|
-
beforeUpload: g,
|
|
69
|
-
listType: "text",
|
|
70
|
-
maxCount: e.maxCount,
|
|
71
|
-
showUploadList: !1,
|
|
72
|
-
onChange: (t) => {
|
|
73
|
-
e.autoUpload || (a.value = t.fileList);
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
j(
|
|
77
|
-
() => a.value,
|
|
78
|
-
(t) => {
|
|
79
|
-
d("update:file-list", t);
|
|
80
|
-
},
|
|
81
|
-
{ deep: !0 }
|
|
82
|
-
);
|
|
83
|
-
const C = (t) => {
|
|
84
|
-
const s = a.value[t].minioFile, n = {
|
|
85
|
-
api: e.downloadUrl.api,
|
|
86
|
-
authorize: e.downloadUrl.authorize,
|
|
87
|
-
url: e.downloadUrl.url,
|
|
88
|
-
// url: props.pageData.urls.download!.url,
|
|
89
|
-
params: {
|
|
90
|
-
Query: {
|
|
91
|
-
FileKey: s.Key
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
J(n);
|
|
96
|
-
}, m = (t) => {
|
|
97
|
-
t.status = t.status === o.Offline ? o.Online : o.Offline, t.minioFile.Status = t.status;
|
|
98
|
-
}, L = (t) => {
|
|
99
|
-
a.value.splice(t, 1);
|
|
100
|
-
}, z = () => {
|
|
101
|
-
const t = e.fileExt && e.fileExt.length ? `文件必须为 ${e.fileExt.join("/")}` : "", s = e.maxFileSize !== 0 ? `单文件最大 ${e.maxFileSize}MB` : "", n = e.maxCount !== 0 ? `最多 ${e.maxCount} 个文件` : "";
|
|
102
|
-
return [s, t, n].filter(Boolean).join(",");
|
|
103
|
-
}, N = (t) => {
|
|
104
|
-
switch (t) {
|
|
105
|
-
case o.Uploading:
|
|
106
|
-
return "blue";
|
|
107
|
-
case o.Success:
|
|
108
|
-
return "green";
|
|
109
|
-
case o.Error:
|
|
110
|
-
return "red";
|
|
111
|
-
case o.Online:
|
|
112
|
-
return "green";
|
|
113
|
-
case o.Offline:
|
|
114
|
-
return "pink";
|
|
115
|
-
default:
|
|
116
|
-
return "cyan";
|
|
117
|
-
}
|
|
118
|
-
}, P = (t) => {
|
|
119
|
-
switch (t) {
|
|
120
|
-
case o.Uploading:
|
|
121
|
-
return "上传中";
|
|
122
|
-
case o.Success:
|
|
123
|
-
return "已完成";
|
|
124
|
-
case o.Error:
|
|
125
|
-
return "上传失败";
|
|
126
|
-
case o.Online:
|
|
127
|
-
return "在线";
|
|
128
|
-
case o.Offline:
|
|
129
|
-
return "已下线";
|
|
130
|
-
default:
|
|
131
|
-
return "待上传";
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
return (t, s) => (f(), p("div", W, [
|
|
135
|
-
r("div", X, [
|
|
136
|
-
r("div", Y, [
|
|
137
|
-
v(l(A), B({
|
|
138
|
-
ref_key: "fileUploader",
|
|
139
|
-
ref: c
|
|
140
|
-
}, _.value), {
|
|
141
|
-
default: U(() => [
|
|
142
|
-
v(l(V), null, {
|
|
143
|
-
default: U(() => s[0] || (s[0] = [
|
|
144
|
-
E("选择文件")
|
|
145
|
-
])),
|
|
146
|
-
_: 1,
|
|
147
|
-
__: [0]
|
|
148
|
-
})
|
|
149
|
-
]),
|
|
150
|
-
_: 1
|
|
151
|
-
}, 16)
|
|
152
|
-
]),
|
|
153
|
-
r("div", Z, y(z()), 1)
|
|
154
|
-
]),
|
|
155
|
-
r("div", ee, [
|
|
156
|
-
(f(!0), p(M, null, R(a.value, (n, w) => (f(), p("div", {
|
|
157
|
-
key: w,
|
|
158
|
-
class: "mb-2 pb-1"
|
|
159
|
-
}, [
|
|
160
|
-
r("div", te, [
|
|
161
|
-
r("div", oe, [
|
|
162
|
-
r("span", {
|
|
163
|
-
class: T(["text-gray-700 mr-2", [n.status == l(o).Offline ? "line-through" : ""]])
|
|
164
|
-
}, y(n.fileName ?? n.name), 3),
|
|
165
|
-
r("span", null, [
|
|
166
|
-
v(l(K), {
|
|
167
|
-
color: N(n.status)
|
|
168
|
-
}, {
|
|
169
|
-
default: U(() => [
|
|
170
|
-
E(y(P(n.status)), 1)
|
|
171
|
-
]),
|
|
172
|
-
_: 2
|
|
173
|
-
}, 1032, ["color"])
|
|
174
|
-
])
|
|
175
|
-
]),
|
|
176
|
-
r("div", ne, [
|
|
177
|
-
n.status == l(o).Offline || n.status == l(o).Online ? (f(), p("span", {
|
|
178
|
-
key: 0,
|
|
179
|
-
class: "text-blue-500 hover:text-blue-700 mr-4 cursor-pointer",
|
|
180
|
-
onClick: (S) => m(n)
|
|
181
|
-
}, y(n.status == l(o).Offline ? "上线" : "下线"), 9, se)) : F("", !0),
|
|
182
|
-
n.status == l(o).Offline || n.status == l(o).Online ? (f(), p("span", {
|
|
183
|
-
key: 1,
|
|
184
|
-
class: "text-blue-500 hover:text-blue-700 mr-4 cursor-pointer",
|
|
185
|
-
onClick: (S) => C(w)
|
|
186
|
-
}, "下载", 8, ae)) : F("", !0),
|
|
187
|
-
r("span", {
|
|
188
|
-
class: "text-red-500 hover:text-red-700 cursor-pointer",
|
|
189
|
-
onClick: (S) => L(w)
|
|
190
|
-
}, "删除", 8, re)
|
|
191
|
-
])
|
|
192
|
-
]),
|
|
193
|
-
r("div", null, [
|
|
194
|
-
v(l(D), {
|
|
195
|
-
percent: n.percent,
|
|
196
|
-
"stroke-width": 2,
|
|
197
|
-
"show-info": !1,
|
|
198
|
-
style: { height: "2px" }
|
|
199
|
-
}, null, 8, ["percent"])
|
|
200
|
-
])
|
|
201
|
-
]))), 128))
|
|
202
|
-
])
|
|
203
|
-
]));
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
export {
|
|
207
|
-
ve as _,
|
|
208
|
-
J as a,
|
|
209
|
-
H as d
|
|
210
|
-
};
|