yc-vep-ui 0.3.54 → 0.3.55
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.
|
@@ -2392,29 +2392,37 @@ var _hoisted_1$4 = { style: {
|
|
|
2392
2392
|
"remove"
|
|
2393
2393
|
],
|
|
2394
2394
|
setup(e, { emit: n }) {
|
|
2395
|
-
let r = n, i = e, { type: a = "file", onChange: o, limit: s, action: c, data: l, prop: u, fileList: d, accept: f, ...p } = i, m = c || baseUrl + "/attachment/uploadAttachment", g =
|
|
2396
|
-
if (
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2395
|
+
let r = n, i = e, { type: a = "file", onChange: o, limit: s, action: c, data: l, prop: u, fileList: d, accept: f, ...p } = i, m = c || baseUrl + "/attachment/uploadAttachment", g = { token: localStorage.getItem("TOKEN") || "" }, _ = computed(() => {
|
|
2396
|
+
if (!f) return null;
|
|
2397
|
+
let e = [], n = [];
|
|
2398
|
+
return f.split(",").forEach((r) => {
|
|
2399
|
+
let i = r.trim().toLowerCase();
|
|
2400
|
+
i.startsWith(".") ? e.push(i) : i.includes("/*") && n.push(i.replace("/*", ""));
|
|
2401
|
+
}), {
|
|
2402
|
+
extensions: e,
|
|
2403
|
+
mimePrefixes: n
|
|
2404
|
+
};
|
|
2405
|
+
}), v = (e) => {
|
|
2406
|
+
if (!_.value) return !0;
|
|
2407
|
+
let { extensions: n, mimePrefixes: r } = _.value, i = "." + (e.name.split(".").pop() || "").toLowerCase(), a = n.length === 0 || n.includes(i), o = r.length === 0 || r.some((n) => e.type.startsWith(n));
|
|
2408
|
+
return !a || !o ? (VepMessage.warning(`只能上传 ${f} 格式的文件`), !1) : !0;
|
|
2409
|
+
}, y = computed(() => l && u && l[u] ? l[u] : i.fileList || []), b = computed(() => y.value.length);
|
|
2410
|
+
function x(e) {
|
|
2403
2411
|
r("update:fileList", e);
|
|
2404
2412
|
}
|
|
2405
|
-
function
|
|
2413
|
+
function S(e, n) {
|
|
2406
2414
|
let i = Array.isArray(n) ? n : [];
|
|
2407
2415
|
o?.(i, e), r("update:fileList", i), r("update:modelValue", i), r("change", i);
|
|
2408
2416
|
}
|
|
2409
|
-
function
|
|
2417
|
+
function C() {
|
|
2410
2418
|
s && VepMessage.warning(`最多只能上传 ${s} 个文件`);
|
|
2411
2419
|
}
|
|
2412
|
-
function
|
|
2420
|
+
function w(e, n) {
|
|
2413
2421
|
r("update:fileList", n), r("update:modelValue", n), r("remove", n);
|
|
2414
2422
|
}
|
|
2415
|
-
function
|
|
2423
|
+
function T(e, n) {
|
|
2416
2424
|
if (e?.code !== "ok") return VepMessage.error(e?.message);
|
|
2417
|
-
let a = baseUrl + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${
|
|
2425
|
+
let a = baseUrl + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${localStorage.getItem("TOKEN") || ""}`, o = l && u && l[u] ? l[u] : i.fileList || [], s = o.some((r) => r?.uid === n.uid || r?.objectKey === e.data?.objectKey), c;
|
|
2418
2426
|
c = s ? o.map((r) => r.uid === n.uid ? {
|
|
2419
2427
|
...r,
|
|
2420
2428
|
status: "success",
|
|
@@ -2429,7 +2437,7 @@ var _hoisted_1$4 = { style: {
|
|
|
2429
2437
|
url: a
|
|
2430
2438
|
}], r("update:fileList", c), r("update:modelValue", c), r("success", c);
|
|
2431
2439
|
}
|
|
2432
|
-
function
|
|
2440
|
+
function E(e, n, i) {
|
|
2433
2441
|
r("update:fileList", i), r("update:modelValue", i);
|
|
2434
2442
|
}
|
|
2435
2443
|
return (e, n) => (openBlock(), createBlock(resolveDynamicComponent(unref(a) === "image" ? image_default : file_default), mergeProps({
|
|
@@ -2437,22 +2445,23 @@ var _hoisted_1$4 = { style: {
|
|
|
2437
2445
|
name: "file",
|
|
2438
2446
|
action: unref(m),
|
|
2439
2447
|
headers: g,
|
|
2440
|
-
"on-change":
|
|
2441
|
-
"on-exceed":
|
|
2442
|
-
"on-remove":
|
|
2443
|
-
"on-success":
|
|
2444
|
-
"on-error":
|
|
2445
|
-
"file-list":
|
|
2446
|
-
"onUpdate:fileList":
|
|
2447
|
-
count:
|
|
2448
|
+
"on-change": S,
|
|
2449
|
+
"on-exceed": C,
|
|
2450
|
+
"on-remove": w,
|
|
2451
|
+
"on-success": T,
|
|
2452
|
+
"on-error": E,
|
|
2453
|
+
"file-list": y.value,
|
|
2454
|
+
"onUpdate:fileList": x,
|
|
2455
|
+
count: b.value,
|
|
2448
2456
|
limit: unref(s),
|
|
2449
|
-
"before-upload":
|
|
2457
|
+
"before-upload": v,
|
|
2458
|
+
accept: unref(f)
|
|
2450
2459
|
}, p), null, 16, [
|
|
2451
2460
|
"action",
|
|
2452
|
-
"headers",
|
|
2453
2461
|
"file-list",
|
|
2454
2462
|
"count",
|
|
2455
|
-
"limit"
|
|
2463
|
+
"limit",
|
|
2464
|
+
"accept"
|
|
2456
2465
|
]));
|
|
2457
2466
|
}
|
|
2458
2467
|
}), Upload_exports = /* @__PURE__ */ __exportAll$1({ default: () => Upload_default }), Upload_default = index_vue_vue_type_script_setup_true_lang_default$2;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as e, d as t, f as n, l as r, s as i, u as a } from "../entry-
|
|
1
|
+
import { c as e, d as t, f as n, l as r, s as i, u as a } from "../entry-BxTCv3y1.js";
|
|
2
2
|
export { e as useDictionary, n as useFetch, r as useRoute, a as useRouter, t as useTable, i as useUser };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { O as e, _ as t, b as n, v as r, y as i } from "../entry-
|
|
1
|
+
import { O as e, _ as t, b as n, v as r, y as i } from "../entry-BxTCv3y1.js";
|
|
2
2
|
export { t as baseUrl, n as request, e as tempToRender, r as uniq, i as uniqBy };
|
package/dist/vep-ui.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, S as i, T as a, a as o, g as s, h as c, i as l, k as u, m as d, n as f, o as p, p as m, r as h, t as g, w as _, x as v } from "./entry-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, S as i, T as a, a as o, g as s, h as c, i as l, k as u, m as d, n as f, o as p, p as m, r as h, t as g, w as _, x as v } from "./entry-BxTCv3y1.js";
|
|
2
2
|
export { e as UiCard, i as UiDescriptions, v as UiDialog, a as UiEditor, n as UiFilter, r as UiForm, t as UiInfiniteScroll, d as UiStaffSelect, u as UiTable, _ as UiTree, m as UiUpload, s as WcUtils, o as YcApproval, c as YcMessage, l as YcPageAgent, h as default, h as ycPlugin, g as getHostVue, p as hooks, f as setHostVue };
|