yc-vep-ui 0.3.52 → 0.3.54
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.
|
@@ -46,7 +46,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
46
46
|
readonly fileList: import('./type').IUploadRawFile[];
|
|
47
47
|
readonly action?: string | undefined;
|
|
48
48
|
readonly onChange?: ((file: any, files: import('./type').IUploadRawFile[]) => void) | undefined;
|
|
49
|
-
readonly accept?: string
|
|
49
|
+
readonly accept?: string | undefined;
|
|
50
50
|
readonly showSuccessStatus?: boolean | undefined;
|
|
51
51
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
52
52
|
$attrs: import('vue').Attrs;
|
|
@@ -2392,25 +2392,27 @@ 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 = reactive({ token: localStorage.getItem("TOKEN") || "" }), _ =
|
|
2396
|
-
if (g.token = localStorage.getItem("TOKEN") || "",
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
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 = reactive({ token: localStorage.getItem("TOKEN") || "" }), _ = (e) => {
|
|
2396
|
+
if (g.token = localStorage.getItem("TOKEN") || "", f) {
|
|
2397
|
+
let n = "." + e.name.split(".").pop().toLowerCase();
|
|
2398
|
+
if (!f.split(",").map((e) => e.trim().toLowerCase()).some((r) => r.startsWith(".") ? n === r : r.includes("/*") ? e.type.startsWith(r.replace("/*", "")) : !1)) return VepMessage.warning(`只能上传 ${f} 格式的文件`), !1;
|
|
2399
|
+
}
|
|
2400
|
+
return !0;
|
|
2401
|
+
}, v = computed(() => l && u && l[u] ? l[u] : i.fileList || []), y = computed(() => v.value.length);
|
|
2402
|
+
function b(e) {
|
|
2401
2403
|
r("update:fileList", e);
|
|
2402
2404
|
}
|
|
2403
|
-
function
|
|
2405
|
+
function x(e, n) {
|
|
2404
2406
|
let i = Array.isArray(n) ? n : [];
|
|
2405
2407
|
o?.(i, e), r("update:fileList", i), r("update:modelValue", i), r("change", i);
|
|
2406
2408
|
}
|
|
2407
|
-
function
|
|
2409
|
+
function S() {
|
|
2408
2410
|
s && VepMessage.warning(`最多只能上传 ${s} 个文件`);
|
|
2409
2411
|
}
|
|
2410
|
-
function
|
|
2412
|
+
function C(e, n) {
|
|
2411
2413
|
r("update:fileList", n), r("update:modelValue", n), r("remove", n);
|
|
2412
2414
|
}
|
|
2413
|
-
function
|
|
2415
|
+
function w(e, n) {
|
|
2414
2416
|
if (e?.code !== "ok") return VepMessage.error(e?.message);
|
|
2415
2417
|
let a = baseUrl + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${g.token}`, o = l && u && l[u] ? l[u] : i.fileList || [], s = o.some((r) => r?.uid === n.uid || r?.objectKey === e.data?.objectKey), c;
|
|
2416
2418
|
c = s ? o.map((r) => r.uid === n.uid ? {
|
|
@@ -2427,7 +2429,7 @@ var _hoisted_1$4 = { style: {
|
|
|
2427
2429
|
url: a
|
|
2428
2430
|
}], r("update:fileList", c), r("update:modelValue", c), r("success", c);
|
|
2429
2431
|
}
|
|
2430
|
-
function
|
|
2432
|
+
function T(e, n, i) {
|
|
2431
2433
|
r("update:fileList", i), r("update:modelValue", i);
|
|
2432
2434
|
}
|
|
2433
2435
|
return (e, n) => (openBlock(), createBlock(resolveDynamicComponent(unref(a) === "image" ? image_default : file_default), mergeProps({
|
|
@@ -2435,16 +2437,16 @@ var _hoisted_1$4 = { style: {
|
|
|
2435
2437
|
name: "file",
|
|
2436
2438
|
action: unref(m),
|
|
2437
2439
|
headers: g,
|
|
2438
|
-
"on-change":
|
|
2439
|
-
"on-exceed":
|
|
2440
|
-
"on-remove":
|
|
2441
|
-
"on-success":
|
|
2442
|
-
"on-error":
|
|
2443
|
-
"file-list":
|
|
2444
|
-
"onUpdate:fileList":
|
|
2445
|
-
count:
|
|
2440
|
+
"on-change": x,
|
|
2441
|
+
"on-exceed": S,
|
|
2442
|
+
"on-remove": C,
|
|
2443
|
+
"on-success": w,
|
|
2444
|
+
"on-error": T,
|
|
2445
|
+
"file-list": v.value,
|
|
2446
|
+
"onUpdate:fileList": b,
|
|
2447
|
+
count: y.value,
|
|
2446
2448
|
limit: unref(s),
|
|
2447
|
-
"before-upload":
|
|
2449
|
+
"before-upload": _
|
|
2448
2450
|
}, p), null, 16, [
|
|
2449
2451
|
"action",
|
|
2450
2452
|
"headers",
|
|
@@ -2457,55 +2459,48 @@ var _hoisted_1$4 = { style: {
|
|
|
2457
2459
|
//#endregion
|
|
2458
2460
|
//#region src/hooks/useFetch.ts
|
|
2459
2461
|
function useFetch(e, n = {}) {
|
|
2460
|
-
let { immediate: r = !0, method: i = "GET", onBefore: a, onSuccess: o, onError: s, onFinally: c, ...l } = n, u = {
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
token: localStorage.getItem("TOKEN") ?? "",
|
|
2465
|
-
...l.headers || {}
|
|
2466
|
-
})
|
|
2467
|
-
}, d = ref(!1), f = ref(null), p = ref(null), m = reactive({}), g = !1;
|
|
2468
|
-
async function _() {
|
|
2469
|
-
if (g) return Promise.reject(/* @__PURE__ */ Error("请求正在进行中,请勿重复触发"));
|
|
2470
|
-
g = !0, d.value = !0, p.value = null;
|
|
2462
|
+
let { immediate: r = !0, method: i = "GET", onBefore: a, onSuccess: o, onError: s, onFinally: c, ...l } = n, u = ref(!1), d = ref(null), f = ref(null), p = reactive({}), m = !1;
|
|
2463
|
+
async function g() {
|
|
2464
|
+
if (m) return Promise.reject(/* @__PURE__ */ Error("请求正在进行中,请勿重复触发"));
|
|
2465
|
+
m = !0, u.value = !0, f.value = null;
|
|
2471
2466
|
try {
|
|
2472
|
-
|
|
2473
|
-
let r =
|
|
2474
|
-
if (a?.(
|
|
2467
|
+
v = JSON.stringify(toRaw(p)), y = isRef(n.ready) ? n.ready.value : n.ready ?? !0;
|
|
2468
|
+
let r = e, s = {};
|
|
2469
|
+
if (a?.(p) === !1) return Promise.reject(/* @__PURE__ */ Error("请求被 onBefore 钩子取消"));
|
|
2475
2470
|
if (i === "GET") {
|
|
2476
|
-
let e = new URLSearchParams(toRaw(
|
|
2471
|
+
let e = new URLSearchParams(toRaw(p)).toString();
|
|
2477
2472
|
e && (r = `${r}?${e}`);
|
|
2478
|
-
} else
|
|
2479
|
-
let
|
|
2480
|
-
return
|
|
2473
|
+
} else s = toRaw(p);
|
|
2474
|
+
let c = await request_default?.[i?.toLocaleLowerCase?.()](r, s);
|
|
2475
|
+
return c.code ? ["return.optSuccess", "ok"].includes(c.code) || VepMessage.error(c.message || "未知错误!") : c.data?.success || VepMessage.error(c.message || "未知错误!"), d.value = c, o?.(c), c;
|
|
2481
2476
|
} catch (e) {
|
|
2482
2477
|
let n = e instanceof Error ? e : Error(String(e));
|
|
2483
|
-
throw
|
|
2478
|
+
throw f.value = n, console.error("请求发生错误:", n), s?.(n), n;
|
|
2484
2479
|
} finally {
|
|
2485
|
-
|
|
2480
|
+
u.value = !1, m = !1, c?.();
|
|
2486
2481
|
}
|
|
2487
2482
|
}
|
|
2488
|
-
let
|
|
2483
|
+
let _ = null, v = "", y;
|
|
2489
2484
|
watchEffect(() => {
|
|
2490
2485
|
let e = toValue(l.defaultParams);
|
|
2491
|
-
Object.keys(
|
|
2486
|
+
Object.keys(p).forEach((e) => delete p[e]), Object.assign(p, e || {});
|
|
2492
2487
|
let i = isRef(n.ready) ? n.ready.value : n.ready ?? !0;
|
|
2493
|
-
i &&
|
|
2494
|
-
let e = JSON.stringify(toRaw(
|
|
2495
|
-
r &&
|
|
2488
|
+
i && y === !1 && (v = ""), y = i, _ && clearTimeout(_), _ = setTimeout(() => {
|
|
2489
|
+
let e = JSON.stringify(toRaw(p));
|
|
2490
|
+
r && y && !m && e !== v && (v = e, nextTick(() => g()));
|
|
2496
2491
|
}, 10);
|
|
2497
2492
|
});
|
|
2498
|
-
function
|
|
2499
|
-
for (let e in
|
|
2500
|
-
Object.assign(
|
|
2493
|
+
function b(e) {
|
|
2494
|
+
for (let e in p) p[e] = void 0;
|
|
2495
|
+
Object.assign(p, e);
|
|
2501
2496
|
}
|
|
2502
2497
|
return {
|
|
2503
|
-
execute:
|
|
2504
|
-
loading:
|
|
2505
|
-
data:
|
|
2506
|
-
error:
|
|
2507
|
-
params:
|
|
2508
|
-
setParams:
|
|
2498
|
+
execute: g,
|
|
2499
|
+
loading: u,
|
|
2500
|
+
data: d,
|
|
2501
|
+
error: f,
|
|
2502
|
+
params: p,
|
|
2503
|
+
setParams: b
|
|
2509
2504
|
};
|
|
2510
2505
|
}
|
|
2511
2506
|
//#endregion
|
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-kohyVfPD.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-kohyVfPD.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-kohyVfPD.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 };
|