yc-vep-ui 0.4.14 → 0.4.16
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/dist/{entry-D655w7sz.js → entry-DoRQzUP9.js} +121 -115
- package/dist/hooks/index.js +2 -2
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -2
- package/dist/vep-ui.js +2 -2
- package/package.json +1 -1
|
@@ -1783,6 +1783,10 @@ function omit$1(e = {}, n) {
|
|
|
1783
1783
|
let r = { ...e };
|
|
1784
1784
|
return n.forEach((e) => delete r[e]), r;
|
|
1785
1785
|
}
|
|
1786
|
+
function formatDate(e = /* @__PURE__ */ new Date()) {
|
|
1787
|
+
let n = (e) => e.toString().padStart(2, "0");
|
|
1788
|
+
return `${e.getFullYear()}-${n(e.getMonth() + 1)}-${n(e.getDate())} ${n(e.getHours())}:${n(e.getMinutes())}:${n(e.getSeconds())}`;
|
|
1789
|
+
}
|
|
1786
1790
|
//#endregion
|
|
1787
1791
|
//#region src/components/StaffSelect/default.vue?vue&type=script&setup=true&lang.ts
|
|
1788
1792
|
var default_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -2422,111 +2426,7 @@ var _hoisted_1$4 = { style: {
|
|
|
2422
2426
|
}, 8, ["modelValue"])], 64);
|
|
2423
2427
|
};
|
|
2424
2428
|
}
|
|
2425
|
-
}), image_default = /* @__PURE__ */ _plugin_vue_export_helper_default(image_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-98470b3a"]])
|
|
2426
|
-
__name: "index",
|
|
2427
|
-
props: {
|
|
2428
|
-
icon: {},
|
|
2429
|
-
limit: {},
|
|
2430
|
-
size: {},
|
|
2431
|
-
prop: {},
|
|
2432
|
-
text: {},
|
|
2433
|
-
type: {},
|
|
2434
|
-
defaultValue: {},
|
|
2435
|
-
fileList: {},
|
|
2436
|
-
action: {},
|
|
2437
|
-
onChange: { type: Function },
|
|
2438
|
-
accept: {},
|
|
2439
|
-
showStatusIcon: { type: Boolean },
|
|
2440
|
-
disabled: { type: Boolean },
|
|
2441
|
-
data: {}
|
|
2442
|
-
},
|
|
2443
|
-
emits: [
|
|
2444
|
-
"update:modelValue",
|
|
2445
|
-
"update:fileList",
|
|
2446
|
-
"change",
|
|
2447
|
-
"success",
|
|
2448
|
-
"error",
|
|
2449
|
-
"exceed",
|
|
2450
|
-
"remove"
|
|
2451
|
-
],
|
|
2452
|
-
setup(e, { emit: n }) {
|
|
2453
|
-
let r = n, i = e, { type: a = "file", onChange: o, limit: s, action: c, data: l, prop: u, fileList: d, accept: f, disabled: p, ...m } = i;
|
|
2454
|
-
console.log("accept ->>", f);
|
|
2455
|
-
let g = c || baseUrl + "/attachment/uploadAttachment", _ = { token: localStorage.getItem("TOKEN") || "" }, v = computed(() => {
|
|
2456
|
-
if (!f) return null;
|
|
2457
|
-
let e = [], n = [];
|
|
2458
|
-
return f.split(",").forEach((r) => {
|
|
2459
|
-
let i = r.trim().toLowerCase();
|
|
2460
|
-
i.startsWith(".") ? e.push(i) : i.includes("/*") && n.push(i.replace("/*", ""));
|
|
2461
|
-
}), {
|
|
2462
|
-
extensions: e,
|
|
2463
|
-
mimePrefixes: n
|
|
2464
|
-
};
|
|
2465
|
-
}), y = (e) => {
|
|
2466
|
-
if (!v.value) return !0;
|
|
2467
|
-
let { extensions: n, mimePrefixes: r } = v.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));
|
|
2468
|
-
return !a || !o ? (VepMessage.warning(`只能上传 ${f} 格式的文件`), !1) : !0;
|
|
2469
|
-
}, b = computed(() => l && u && l[u] ? l[u] : i.fileList || []), x = computed(() => b.value.length);
|
|
2470
|
-
function S(e) {
|
|
2471
|
-
r("update:fileList", e);
|
|
2472
|
-
}
|
|
2473
|
-
function C(e, n) {
|
|
2474
|
-
let i = Array.isArray(n) ? n : [];
|
|
2475
|
-
o?.(i, e), r("update:fileList", i), r("update:modelValue", i), r("change", i);
|
|
2476
|
-
}
|
|
2477
|
-
function w() {
|
|
2478
|
-
s && VepMessage.warning(`最多只能上传 ${s} 个文件`);
|
|
2479
|
-
}
|
|
2480
|
-
function T(e, n) {
|
|
2481
|
-
r("update:fileList", n), r("update:modelValue", n), r("remove", n);
|
|
2482
|
-
}
|
|
2483
|
-
function E(e, n) {
|
|
2484
|
-
if (e?.code !== "ok") return VepMessage.error(e?.message);
|
|
2485
|
-
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;
|
|
2486
|
-
c = s ? o.map((r) => r.uid === n.uid ? {
|
|
2487
|
-
...r,
|
|
2488
|
-
status: "success",
|
|
2489
|
-
...e.data,
|
|
2490
|
-
url: a
|
|
2491
|
-
} : r) : [...o, {
|
|
2492
|
-
name: n.name,
|
|
2493
|
-
uid: n.uid,
|
|
2494
|
-
size: n.size,
|
|
2495
|
-
status: "success",
|
|
2496
|
-
...e.data,
|
|
2497
|
-
url: a
|
|
2498
|
-
}], r("update:fileList", c), r("update:modelValue", c), r("success", c);
|
|
2499
|
-
}
|
|
2500
|
-
function D(e, n, i) {
|
|
2501
|
-
r("update:fileList", i), r("update:modelValue", i);
|
|
2502
|
-
}
|
|
2503
|
-
return (e, n) => (openBlock(), createBlock(resolveDynamicComponent(unref(a) === "image" ? image_default : file_default), mergeProps({
|
|
2504
|
-
ref: "uploadInstance",
|
|
2505
|
-
name: "file",
|
|
2506
|
-
action: unref(g),
|
|
2507
|
-
headers: _,
|
|
2508
|
-
"on-change": C,
|
|
2509
|
-
"on-exceed": w,
|
|
2510
|
-
"on-remove": T,
|
|
2511
|
-
"on-success": E,
|
|
2512
|
-
"on-error": D,
|
|
2513
|
-
"file-list": b.value,
|
|
2514
|
-
"onUpdate:fileList": S,
|
|
2515
|
-
count: x.value,
|
|
2516
|
-
limit: unref(s),
|
|
2517
|
-
"before-upload": y,
|
|
2518
|
-
accept: unref(f),
|
|
2519
|
-
disabled: unref(p)
|
|
2520
|
-
}, m), null, 16, [
|
|
2521
|
-
"action",
|
|
2522
|
-
"file-list",
|
|
2523
|
-
"count",
|
|
2524
|
-
"limit",
|
|
2525
|
-
"accept",
|
|
2526
|
-
"disabled"
|
|
2527
|
-
]));
|
|
2528
|
-
}
|
|
2529
|
-
}), Upload_exports = /* @__PURE__ */ __exportAll$1({ default: () => Upload_default }), Upload_default = index_vue_vue_type_script_setup_true_lang_default$2;
|
|
2429
|
+
}), image_default = /* @__PURE__ */ _plugin_vue_export_helper_default(image_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-98470b3a"]]);
|
|
2530
2430
|
//#endregion
|
|
2531
2431
|
//#region src/hooks/useFetch.ts
|
|
2532
2432
|
function useFetch(e, n = {}) {
|
|
@@ -2618,16 +2518,16 @@ function useDefaultTable(e, n) {
|
|
|
2618
2518
|
l.execute({ ...c }), u = !0;
|
|
2619
2519
|
}
|
|
2620
2520
|
}, { flush: "sync" });
|
|
2621
|
-
function d(e = {}) {
|
|
2622
|
-
let { page:
|
|
2623
|
-
o.page =
|
|
2624
|
-
let
|
|
2521
|
+
function d(e = {}, n = !1) {
|
|
2522
|
+
let { page: i, pageSize: a, ...s } = e;
|
|
2523
|
+
o.page = i || 1, o.pageSize = a || 10;
|
|
2524
|
+
let u = [];
|
|
2625
2525
|
Object.keys(c).forEach((e) => {
|
|
2626
|
-
!r.includes(e) && !(e in
|
|
2627
|
-
}),
|
|
2526
|
+
!r.includes(e) && !(e in s) && u.push(e);
|
|
2527
|
+
}), u.forEach((e) => delete c[e]), Object.assign(c, s, {
|
|
2628
2528
|
page: o.page,
|
|
2629
2529
|
pageSize: o.pageSize
|
|
2630
|
-
});
|
|
2530
|
+
}), n || l.execute({ ...c });
|
|
2631
2531
|
}
|
|
2632
2532
|
function f({ page: e, pageSize: n }) {
|
|
2633
2533
|
o.page = e, o.pageSize = n, c.page = e, c.pageSize = n;
|
|
@@ -2687,7 +2587,7 @@ function useComTable(e, n) {
|
|
|
2687
2587
|
page: 1,
|
|
2688
2588
|
pageSize: 10,
|
|
2689
2589
|
params: i
|
|
2690
|
-
}), c({
|
|
2590
|
+
}, !0), c({
|
|
2691
2591
|
tableId: n,
|
|
2692
2592
|
page: 1,
|
|
2693
2593
|
pageSize: 10,
|
|
@@ -4742,7 +4642,113 @@ var hooks_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
4742
4642
|
useRouter: () => useRouter,
|
|
4743
4643
|
useTable: () => useTable,
|
|
4744
4644
|
useUser: () => useUser
|
|
4745
|
-
})
|
|
4645
|
+
}), index_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ defineComponent({
|
|
4646
|
+
__name: "index",
|
|
4647
|
+
props: {
|
|
4648
|
+
icon: {},
|
|
4649
|
+
limit: {},
|
|
4650
|
+
size: {},
|
|
4651
|
+
prop: {},
|
|
4652
|
+
text: {},
|
|
4653
|
+
type: {},
|
|
4654
|
+
defaultValue: {},
|
|
4655
|
+
fileList: {},
|
|
4656
|
+
action: {},
|
|
4657
|
+
onChange: { type: Function },
|
|
4658
|
+
accept: {},
|
|
4659
|
+
showStatusIcon: { type: Boolean },
|
|
4660
|
+
disabled: { type: Boolean },
|
|
4661
|
+
data: {}
|
|
4662
|
+
},
|
|
4663
|
+
emits: [
|
|
4664
|
+
"update:modelValue",
|
|
4665
|
+
"update:fileList",
|
|
4666
|
+
"change",
|
|
4667
|
+
"success",
|
|
4668
|
+
"error",
|
|
4669
|
+
"exceed",
|
|
4670
|
+
"remove"
|
|
4671
|
+
],
|
|
4672
|
+
setup(e, { emit: n }) {
|
|
4673
|
+
let r = n, i = e, { type: a = "file", onChange: o, limit: s, action: c, data: l, prop: u, fileList: d, accept: f, disabled: p, ...m } = i, { userInfo: g } = useUser(), _ = c || baseUrl + "/attachment/uploadAttachment", v = { token: localStorage.getItem("TOKEN") || "" }, y = computed(() => {
|
|
4674
|
+
if (!f) return null;
|
|
4675
|
+
let e = [], n = [];
|
|
4676
|
+
return f.split(",").forEach((r) => {
|
|
4677
|
+
let i = r.trim().toLowerCase();
|
|
4678
|
+
i.startsWith(".") ? e.push(i) : i.includes("/*") && n.push(i.replace("/*", ""));
|
|
4679
|
+
}), {
|
|
4680
|
+
extensions: e,
|
|
4681
|
+
mimePrefixes: n
|
|
4682
|
+
};
|
|
4683
|
+
}), b = (e) => {
|
|
4684
|
+
if (!y.value) return !0;
|
|
4685
|
+
let { extensions: n, mimePrefixes: r } = y.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));
|
|
4686
|
+
return !a || !o ? (VepMessage.warning(`只能上传 ${f} 格式的文件`), !1) : !0;
|
|
4687
|
+
}, x = computed(() => l && u && l[u] ? l[u] : i.fileList || []), S = computed(() => x.value.length);
|
|
4688
|
+
function C(e) {
|
|
4689
|
+
r("update:fileList", e);
|
|
4690
|
+
}
|
|
4691
|
+
function w(e, n) {
|
|
4692
|
+
let i = Array.isArray(n) ? n : [];
|
|
4693
|
+
o?.(i, e), r("update:fileList", i), r("update:modelValue", i), r("change", i);
|
|
4694
|
+
}
|
|
4695
|
+
function T() {
|
|
4696
|
+
s && VepMessage.warning(`最多只能上传 ${s} 个文件`);
|
|
4697
|
+
}
|
|
4698
|
+
function E(e, n) {
|
|
4699
|
+
r("update:fileList", n), r("update:modelValue", n), r("remove", n);
|
|
4700
|
+
}
|
|
4701
|
+
function D(e, n) {
|
|
4702
|
+
if (e?.code !== "ok") return VepMessage.error(e?.message);
|
|
4703
|
+
let a = baseUrl + `/attachment/downloadAttachment?objectKey=${e.data?.objectKey}&fileName=${e.data?.fileName}&token=${localStorage.getItem("TOKEN") || ""}`, o = g.name || "", s = formatDate(), c = l && u && l[u] ? l[u] : i.fileList || [], d = c.some((r) => r?.uid === n.uid || r?.objectKey === e.data?.objectKey), f;
|
|
4704
|
+
f = d ? c.map((r) => r.uid === n.uid ? {
|
|
4705
|
+
...r,
|
|
4706
|
+
status: "success",
|
|
4707
|
+
...e.data,
|
|
4708
|
+
url: a,
|
|
4709
|
+
createdByName: o,
|
|
4710
|
+
creationDate: s
|
|
4711
|
+
} : r) : [...c, {
|
|
4712
|
+
name: n.name,
|
|
4713
|
+
uid: n.uid,
|
|
4714
|
+
size: n.size,
|
|
4715
|
+
status: "success",
|
|
4716
|
+
...e.data,
|
|
4717
|
+
url: a,
|
|
4718
|
+
createdByName: o,
|
|
4719
|
+
creationDate: s
|
|
4720
|
+
}], r("update:fileList", f), r("update:modelValue", f), r("success", f);
|
|
4721
|
+
}
|
|
4722
|
+
function O(e, n, i) {
|
|
4723
|
+
r("update:fileList", i), r("update:modelValue", i);
|
|
4724
|
+
}
|
|
4725
|
+
return (e, n) => (openBlock(), createBlock(resolveDynamicComponent(unref(a) === "image" ? image_default : file_default), mergeProps({
|
|
4726
|
+
ref: "uploadInstance",
|
|
4727
|
+
name: "file",
|
|
4728
|
+
action: unref(_),
|
|
4729
|
+
headers: v,
|
|
4730
|
+
"on-change": w,
|
|
4731
|
+
"on-exceed": T,
|
|
4732
|
+
"on-remove": E,
|
|
4733
|
+
"on-success": D,
|
|
4734
|
+
"on-error": O,
|
|
4735
|
+
"file-list": x.value,
|
|
4736
|
+
"onUpdate:fileList": C,
|
|
4737
|
+
count: S.value,
|
|
4738
|
+
limit: unref(s),
|
|
4739
|
+
"before-upload": b,
|
|
4740
|
+
accept: unref(f),
|
|
4741
|
+
disabled: unref(p)
|
|
4742
|
+
}, m), null, 16, [
|
|
4743
|
+
"action",
|
|
4744
|
+
"file-list",
|
|
4745
|
+
"count",
|
|
4746
|
+
"limit",
|
|
4747
|
+
"accept",
|
|
4748
|
+
"disabled"
|
|
4749
|
+
]));
|
|
4750
|
+
}
|
|
4751
|
+
}), Upload_exports = /* @__PURE__ */ __exportAll$1({ default: () => Upload_default }), Upload_default = index_vue_vue_type_script_setup_true_lang_default$2;
|
|
4746
4752
|
//#endregion
|
|
4747
4753
|
//#region src/components/YcApproval/useDetail.ts
|
|
4748
4754
|
function operateProcess(e) {
|
|
@@ -11110,4 +11116,4 @@ var ycPlugin = { install(e, n) {
|
|
|
11110
11116
|
e.config.globalProperties.$message = Message_exports, e.provide?.("message", Message_exports);
|
|
11111
11117
|
} };
|
|
11112
11118
|
//#endregion
|
|
11113
|
-
export {
|
|
11119
|
+
export { tempToRender as A, Dialog_exports as C, Editor_exports as D, Tree_exports as E, Card_exports as M, Form_exports as O, request_default as S, InfiniteScroll_exports as T, baseUrl as _, YcApproval_exports as a, uniq as b, useUser as c, useRouter as d, useTable as f, wc_utils_exports as g, VepMessage as h, PageAgent_exports as i, Table_exports as j, Filter_exports as k, useDictionary as l, StaffSelect_exports as m, setHostVue as n, Upload_exports as o, useFetch as p, ycPlugin as r, hooks_exports as s, getHostVue as t, useRoute as u, formatDate as v, Descriptions_exports as w, uniqBy as x, omit$1 as y };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as e, d as t, f as n, l as r,
|
|
2
|
-
export {
|
|
1
|
+
import { c as e, d as t, f as n, l as r, p as i, u as a } from "../entry-DoRQzUP9.js";
|
|
2
|
+
export { r as useDictionary, i as useFetch, a as useRoute, t as useRouter, n as useTable, e as useUser };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export declare function uniq<T>(arr: T[]): T[];
|
|
|
7
7
|
/** 根据指定 key 去重数组 */
|
|
8
8
|
export declare function uniqBy<T>(arr: T[], key: keyof T | ((item: T) => unknown)): T[];
|
|
9
9
|
export declare function omit<T extends object, K extends keyof T>(obj: T | undefined, keys: K[]): Partial<T>;
|
|
10
|
+
/** 格式化日期为 YYYY-MM-DD HH:mm:ss */
|
|
11
|
+
export declare function formatDate(date?: Date): string;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { A as e, S as t, _ as n, b as r, v as i, x as a, y as o } from "../entry-DoRQzUP9.js";
|
|
2
|
+
export { n as baseUrl, i as formatDate, o as omit, t as request, e as tempToRender, r as uniq, a as uniqBy };
|
package/dist/vep-ui.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { C as e, D as t, E as n, M as r, O as i, T as a, a as o, g as s, h as c, i as l, j as u, k as d, m as f, n as p, o as m, r as h, s as g, t as _, w as v } from "./entry-DoRQzUP9.js";
|
|
2
|
+
export { r as UiCard, v as UiDescriptions, e as UiDialog, t as UiEditor, d as UiFilter, i as UiForm, a as UiInfiniteScroll, f as UiStaffSelect, u as UiTable, n as UiTree, m as UiUpload, s as WcUtils, o as YcApproval, c as YcMessage, l as YcPageAgent, h as default, h as ycPlugin, _ as getHostVue, g as hooks, p as setHostVue };
|