jmash-core 0.0.3 → 0.0.5
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/401-DZeMj80g.mjs +103 -0
- package/dist/404-D1KiG-19.mjs +37 -0
- package/dist/BarChart-BYm859ri.mjs +203 -0
- package/dist/FileSaver.min-DJ2XURfB.mjs +77 -0
- package/dist/FunnelChart-Czy2TVI1.mjs +106 -0
- package/dist/PieChart-BRbbIH3_.mjs +4 -0
- package/dist/PieChart.vue_vue_type_script_setup_true_lang-XjLBqCzM.mjs +90 -0
- package/dist/RadarChart-Bk_uy6Km.mjs +4 -0
- package/dist/RadarChart.vue_vue_type_script_setup_true_lang-COsDkkQU.mjs +109 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/caret-bottom-DGvkHVYd.mjs +59 -0
- package/dist/common-DuVBTwAv.mjs +36 -0
- package/dist/debounce-XYByYe_I.mjs +81 -0
- package/dist/dropdown2-D_RJXnOl.mjs +160 -0
- package/dist/edit-BTjApg1x.mjs +468 -0
- package/dist/edit-BcLHrCSo.mjs +4 -0
- package/dist/edit-DC3SyT6J.mjs +4 -0
- package/dist/edit-DmP9tv3r.mjs +4 -0
- package/dist/edit-Dr-9X4r3.mjs +4 -0
- package/dist/edit-FjRAXd1B.mjs +832 -0
- package/dist/edit-bpHMc65Q.mjs +4 -0
- package/dist/edit-lB54egzx.mjs +4 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-BKutjIoX.mjs +621 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-BVXBx_a-.mjs +221 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-Bm1SAtWP.mjs +225 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-CYZNHUnm.mjs +156 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-CZmh3q4f.mjs +287 -0
- package/dist/edit.vue_vue_type_script_setup_true_lang-DqZ2GCoE.mjs +136 -0
- package/dist/el-card-Da9MvaWO.mjs +61 -0
- package/dist/el-checkbox-B44P9jFr.mjs +548 -0
- package/dist/el-checkbox-group-l0sNRNKZ.mjs +1 -0
- package/dist/el-col-BY0nB6k3.mjs +135 -0
- package/dist/el-date-picker-CVwJoDEA.mjs +3349 -0
- package/dist/el-dialog-CSWvTJrq.mjs +378 -0
- package/dist/el-dropdown-item-CD8hUpml.mjs +675 -0
- package/dist/el-form-item-f-baJSfe.mjs +1489 -0
- package/dist/el-icon-l0sNRNKZ.mjs +1 -0
- package/dist/el-popover-D8RrIMbA.mjs +159 -0
- package/dist/el-popper-C13p_dqu.mjs +1656 -0
- package/dist/el-progress-CHUzIxT1.mjs +898 -0
- package/dist/el-radio-BpdPD-RN.mjs +251 -0
- package/dist/el-scrollbar-B8QteGV0.mjs +607 -0
- package/dist/el-select-ChOy6agQ.mjs +1040 -0
- package/dist/el-switch-cqWxQwcb.mjs +254 -0
- package/dist/el-table-c9Sup56w.mjs +3168 -0
- package/dist/el-tag-l0sNRNKZ.mjs +1 -0
- package/dist/el-tooltip-l0sNRNKZ.mjs +1 -0
- package/dist/el-tree-select-CKOwMXR7.mjs +1316 -0
- package/dist/importUpload.vue_vue_type_script_setup_true_lang-DWrcOBGS.mjs +116 -0
- package/dist/index-B6wY38lY.mjs +13173 -0
- package/dist/index-BH-_mfRR.mjs +107 -0
- package/dist/index-BfhiNV8H.mjs +486 -0
- package/dist/index-BjqMDjBg.mjs +43994 -0
- package/dist/index-BuHauank.mjs +13 -0
- package/dist/index-CBJwB8q2.mjs +633 -0
- package/dist/index-CGCQHwLq.mjs +482 -0
- package/dist/index-CU0iVHXP.mjs +281 -0
- package/dist/index-CYxGYOaT.mjs +504 -0
- package/dist/index-Cjii0qCc.mjs +278 -0
- package/dist/index-Czh2Pqwr.mjs +63 -0
- package/dist/index-DJ08yxAP.mjs +11 -0
- package/dist/index-DUKlDGLk.mjs +2589 -0
- package/dist/index-DUVtKaDI.mjs +515 -0
- package/dist/index-Dgd4Zhxz.mjs +93 -0
- package/dist/index-Di5--Hao.mjs +328 -0
- package/dist/index-DjkMA-Wh.mjs +40 -0
- package/dist/index-DrKW_cyG.mjs +247 -0
- package/dist/index-LuiPOgGW.mjs +291 -0
- package/dist/index-VD-Tf32c.mjs +74 -0
- package/dist/index-cRrjzkNb.mjs +452 -0
- package/dist/index-cp7l4CIE.mjs +134 -0
- package/dist/index-dKz1IRM_.mjs +279 -0
- package/dist/index-dLPnFa10.mjs +964 -0
- package/dist/index-uykKwY2Z.mjs +12 -0
- package/dist/index-vp1_Sd0A.mjs +55 -0
- package/dist/index.mjs +22 -273
- package/dist/index.vue_vue_type_script_setup_true_lang-DcIQIMBC.mjs +286 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-DidEhco6.mjs +58 -0
- package/dist/isUndefined-CUQZk6oB.mjs +6 -0
- package/dist/moment-CMYwqyVT.mjs +2579 -0
- package/dist/picture-kDaEiPHi.mjs +599 -0
- package/dist/profile-Sn98YUfh.mjs +319 -0
- package/dist/refs-COP_DuTD.mjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types-BolK_Oyb.mjs +205 -0
- package/dist/updatePwd-B3rEU05i.mjs +4 -0
- package/dist/updatePwd.vue_vue_type_script_setup_true_lang-1LEdjkQ3.mjs +151 -0
- package/dist/useColumnToggleTable-CC9EXcfR.mjs +272 -0
- package/dts/src/App.vue.d.ts +1 -1
- package/dts/src/api/auth/index.d.ts +41 -0
- package/dts/src/api/auth/types.d.ts +180 -0
- package/dts/src/api/file/index.d.ts +14 -0
- package/dts/src/api/file/types.d.ts +7 -0
- package/dts/src/api/system/dept/index.d.ts +91 -0
- package/dts/src/api/system/dept/types.d.ts +63 -0
- package/dts/src/api/system/index.d.ts +7 -0
- package/dts/src/api/system/job/index.d.ts +42 -0
- package/dts/src/api/system/job/types.d.ts +60 -0
- package/dts/src/api/system/log/index.d.ts +29 -0
- package/dts/src/api/system/log/types.d.ts +42 -0
- package/dts/src/api/system/menu/index.d.ts +103 -0
- package/dts/src/api/system/menu/types.d.ts +96 -0
- package/dts/src/api/system/module/index.d.ts +57 -0
- package/dts/src/api/system/module/types.d.ts +13 -0
- package/dts/src/api/system/operation/index.d.ts +51 -0
- package/dts/src/api/system/operation/types.d.ts +12 -0
- package/dts/src/api/system/permission/index.d.ts +50 -0
- package/dts/src/api/system/permission/types.d.ts +12 -0
- package/dts/src/api/system/role/index.d.ts +77 -0
- package/dts/src/api/system/role/types.d.ts +26 -0
- package/dts/src/api/system/user/index.d.ts +133 -0
- package/dts/src/api/system/user/types.d.ts +53 -0
- package/dts/src/api/system/userLog/index.d.ts +29 -0
- package/dts/src/api/system/userLog/types.d.ts +22 -0
- package/dts/src/assets/icons/index.d.ts +0 -0
- package/dts/src/components/{icons/IconDocumentation.vue.d.ts → Breadcrumb/index.vue.d.ts} +1 -1
- package/dts/src/components/DictRadio/index.vue.d.ts +23 -0
- package/dts/src/components/DictSelect/index.vue.d.ts +41 -0
- package/dts/src/components/Dictionary/index.vue.d.ts +47 -0
- package/dts/src/components/{TheWelcome.vue.d.ts → GithubCorner/index.vue.d.ts} +1 -1
- package/dts/src/components/Hamburger/index.vue.d.ts +18 -0
- package/dts/src/components/IconSelect/index.vue.d.ts +20 -0
- package/dts/src/components/IconSelect/requireIcons.d.ts +2 -0
- package/dts/src/components/{icons/IconEcosystem.vue.d.ts → LangSelect/index.vue.d.ts} +1 -1
- package/dts/src/components/Pagination/index.vue.d.ts +88 -0
- package/dts/src/components/RightPanel/index.vue.d.ts +21 -0
- package/dts/src/components/{icons/IconCommunity.vue.d.ts → SizeSelect/index.vue.d.ts} +1 -1
- package/dts/src/components/SvgIcon/index.vue.d.ts +43 -0
- package/dts/src/components/Table/index.vue.d.ts +73 -0
- package/dts/src/components/TableSet/index.vue.d.ts +29 -0
- package/dts/src/components/Upload/MultiUpload.vue.d.ts +65 -0
- package/dts/src/components/Upload/SingleUpload.vue.d.ts +18 -0
- package/dts/src/components/Upload/importUpload.vue.d.ts +31 -0
- package/dts/src/components/Upload/index.vue.d.ts +18 -0
- package/dts/src/components/WangEditor/index.vue.d.ts +18 -0
- package/dts/src/directive/index.d.ts +5 -0
- package/dts/src/directive/permission/index.d.ts +9 -0
- package/dts/src/enums/MenuTypeEnum.d.ts +18 -0
- package/dts/src/hooks/useColumnToggleTable.d.ts +7 -0
- package/dts/src/index.d.ts +29 -3
- package/dts/src/lang/index.d.ts +534 -0
- package/dts/src/lang/package/en.d.ts +261 -0
- package/dts/src/lang/package/zh-cn.d.ts +275 -0
- package/dts/src/layout/components/AppMain.vue.d.ts +2 -0
- package/dts/src/layout/components/NavBar/NavRight.vue.d.ts +2 -0
- package/dts/src/layout/components/NavBar/index.vue.d.ts +2 -0
- package/dts/src/layout/components/Settings/index.vue.d.ts +2 -0
- package/dts/src/layout/components/Sidebar/Item.vue.d.ts +23 -0
- package/dts/src/layout/components/Sidebar/LeftMenu.vue.d.ts +24 -0
- package/dts/src/layout/components/Sidebar/Link.vue.d.ts +19 -0
- package/dts/src/layout/components/Sidebar/Logo.vue.d.ts +12 -0
- package/dts/src/layout/components/Sidebar/SidebarItem.vue.d.ts +42 -0
- package/dts/src/layout/components/Sidebar/TopMenu.vue.d.ts +2 -0
- package/dts/src/layout/components/Sidebar/index.vue.d.ts +2 -0
- package/dts/src/layout/components/TagsView/ScrollPane.vue.d.ts +16 -0
- package/dts/src/layout/components/TagsView/index.vue.d.ts +2 -0
- package/dts/src/layout/components/index.d.ts +4 -0
- package/dts/src/layout/index.vue.d.ts +2 -0
- package/dts/src/layout/main.vue.d.ts +2 -0
- package/dts/src/main.d.ts +5 -1
- package/dts/src/permission.d.ts +1 -0
- package/dts/src/router/index.d.ts +10 -0
- package/dts/src/settings.d.ts +13 -0
- package/dts/src/stores/index.d.ts +7 -0
- package/dts/src/stores/modules/tagsView.d.ts +82 -0
- package/dts/src/utils/common.d.ts +6 -0
- package/dts/src/utils/grpc.d.ts +2 -0
- package/dts/src/utils/i18n.d.ts +1 -0
- package/dts/src/utils/index.d.ts +24 -0
- package/dts/src/utils/request.d.ts +2 -0
- package/dts/src/utils/resize.d.ts +1 -0
- package/dts/src/utils/scroll-to.d.ts +6 -0
- package/dts/src/views/dashboard/components/BarChart.vue.d.ts +45 -0
- package/dts/src/views/dashboard/components/FunnelChart.vue.d.ts +45 -0
- package/dts/src/views/dashboard/components/PieChart.vue.d.ts +45 -0
- package/dts/src/views/dashboard/components/RadarChart.vue.d.ts +45 -0
- package/dts/src/views/dashboard/index.vue.d.ts +2 -0
- package/dts/src/views/error-page/401.vue.d.ts +2 -0
- package/dts/src/views/error-page/404.vue.d.ts +2 -0
- package/dts/src/views/login/components/types.vue.d.ts +2 -0
- package/dts/src/views/login/index.vue.d.ts +2 -0
- package/dts/src/views/my/profile.vue.d.ts +2 -0
- package/dts/src/views/my/updatePwd.vue.d.ts +18 -0
- package/dts/src/views/redirect/index.vue.d.ts +2 -0
- package/dts/src/views/system/dept/edit.vue.d.ts +31 -0
- package/dts/src/views/system/dept/index.vue.d.ts +2 -0
- package/dts/src/views/system/job/edit.vue.d.ts +30 -0
- package/dts/src/views/system/job/index.vue.d.ts +2 -0
- package/dts/src/views/system/log/index.vue.d.ts +2 -0
- package/dts/src/views/system/log/oplog/index.vue.d.ts +2 -0
- package/dts/src/views/system/log/userLog/index.vue.d.ts +2 -0
- package/dts/src/views/system/menu/edit.vue.d.ts +31 -0
- package/dts/src/views/system/menu/index.vue.d.ts +2 -0
- package/dts/src/views/system/module/edit.vue.d.ts +31 -0
- package/dts/src/views/system/module/index.vue.d.ts +2 -0
- package/dts/src/views/system/operation/edit.vue.d.ts +31 -0
- package/dts/src/views/system/operation/index.vue.d.ts +2 -0
- package/dts/src/views/system/permission/edit.vue.d.ts +30 -0
- package/dts/src/views/system/permission/index.vue.d.ts +2 -0
- package/dts/src/views/system/role/edit.vue.d.ts +31 -0
- package/dts/src/views/system/role/index.vue.d.ts +2 -0
- package/dts/src/views/system/user/edit.vue.d.ts +31 -0
- package/dts/src/views/system/user/index.vue.d.ts +2 -0
- package/dts/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -2
- package/dts/src/components/HelloWorld.vue.d.ts +0 -15
- package/dts/src/components/WelcomeItem.vue.d.ts +0 -11
- package/dts/src/components/icons/IconSupport.vue.d.ts +0 -2
- package/dts/src/components/icons/IconTooling.vue.d.ts +0 -2
- package/dts/src/stores/counter.d.ts +0 -13
- package/dts/src/views/AboutView.vue.d.ts +0 -2
- package/dts/src/views/HomeView.vue.d.ts +0 -2
|
@@ -0,0 +1,898 @@
|
|
|
1
|
+
import { defineComponent as j, computed as C, openBlock as g, createElementBlock as w, normalizeClass as v, unref as e, createElementVNode as N, normalizeStyle as A, renderSlot as L, toDisplayString as W, createCommentVNode as k, createBlock as O, withCtx as T, resolveDynamicComponent as Fe, ref as ce, TransitionGroup as Le, Fragment as Re, renderList as Te, withKeys as pe, withModifiers as I, createVNode as B, inject as _e, shallowRef as Y, watch as ee, onBeforeUnmount as Ue, provide as Oe, toRef as De, createSlots as te, mergeProps as se } from "vue";
|
|
2
|
+
import { m as K, n as h, x as z, c6 as Be, c7 as fe, bB as Ne, c8 as ve, A as ye, V as me, O as ae, z as M, _ as H, L as ge, a4 as x, b8 as he, ab as be, o as Q, b4 as S, w as je, aP as V, c9 as Ae, F as Me, ca as qe, cb as oe, cc as Ie, cd as ze, aU as Ke } from "./index-B6wY38lY.mjs";
|
|
3
|
+
import { j as He } from "./el-form-item-f-baJSfe.mjs";
|
|
4
|
+
import { i as We } from "./el-scrollbar-B8QteGV0.mjs";
|
|
5
|
+
var Ve = 1, Xe = 4;
|
|
6
|
+
function ne(a) {
|
|
7
|
+
return He(a, Ve | Xe);
|
|
8
|
+
}
|
|
9
|
+
const Ge = K({
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "line",
|
|
13
|
+
values: ["line", "circle", "dashboard"]
|
|
14
|
+
},
|
|
15
|
+
percentage: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 0,
|
|
18
|
+
validator: (a) => a >= 0 && a <= 100
|
|
19
|
+
},
|
|
20
|
+
status: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "",
|
|
23
|
+
values: ["", "success", "exception", "warning"]
|
|
24
|
+
},
|
|
25
|
+
indeterminate: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
duration: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 3
|
|
32
|
+
},
|
|
33
|
+
strokeWidth: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 6
|
|
36
|
+
},
|
|
37
|
+
strokeLinecap: {
|
|
38
|
+
type: h(String),
|
|
39
|
+
default: "round"
|
|
40
|
+
},
|
|
41
|
+
textInside: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
width: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 126
|
|
48
|
+
},
|
|
49
|
+
showText: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
},
|
|
53
|
+
color: {
|
|
54
|
+
type: h([
|
|
55
|
+
String,
|
|
56
|
+
Array,
|
|
57
|
+
Function
|
|
58
|
+
]),
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
striped: Boolean,
|
|
62
|
+
stripedFlow: Boolean,
|
|
63
|
+
format: {
|
|
64
|
+
type: h(Function),
|
|
65
|
+
default: (a) => `${a}%`
|
|
66
|
+
}
|
|
67
|
+
}), Je = ["aria-valuenow"], Ye = { viewBox: "0 0 100 100" }, Qe = ["d", "stroke", "stroke-linecap", "stroke-width"], Ze = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"], xe = { key: 0 }, et = j({
|
|
68
|
+
name: "ElProgress"
|
|
69
|
+
}), tt = /* @__PURE__ */ j({
|
|
70
|
+
...et,
|
|
71
|
+
props: Ge,
|
|
72
|
+
setup(a) {
|
|
73
|
+
const t = a, s = {
|
|
74
|
+
success: "#13ce66",
|
|
75
|
+
exception: "#ff4949",
|
|
76
|
+
warning: "#e6a23c",
|
|
77
|
+
default: "#20a0ff"
|
|
78
|
+
}, i = z("progress"), p = C(() => ({
|
|
79
|
+
width: `${t.percentage}%`,
|
|
80
|
+
animationDuration: `${t.duration}s`,
|
|
81
|
+
backgroundColor: P(t.percentage)
|
|
82
|
+
})), d = C(() => (t.strokeWidth / t.width * 100).toFixed(1)), y = C(() => ["circle", "dashboard"].includes(t.type) ? Number.parseInt(`${50 - Number.parseFloat(d.value) / 2}`, 10) : 0), E = C(() => {
|
|
83
|
+
const n = y.value, F = t.type === "dashboard";
|
|
84
|
+
return `
|
|
85
|
+
M 50 50
|
|
86
|
+
m 0 ${F ? "" : "-"}${n}
|
|
87
|
+
a ${n} ${n} 0 1 1 0 ${F ? "-" : ""}${n * 2}
|
|
88
|
+
a ${n} ${n} 0 1 1 0 ${F ? "" : "-"}${n * 2}
|
|
89
|
+
`;
|
|
90
|
+
}), b = C(() => 2 * Math.PI * y.value), $ = C(() => t.type === "dashboard" ? 0.75 : 1), R = C(() => `${-1 * b.value * (1 - $.value) / 2}px`), m = C(() => ({
|
|
91
|
+
strokeDasharray: `${b.value * $.value}px, ${b.value}px`,
|
|
92
|
+
strokeDashoffset: R.value
|
|
93
|
+
})), l = C(() => ({
|
|
94
|
+
strokeDasharray: `${b.value * $.value * (t.percentage / 100)}px, ${b.value}px`,
|
|
95
|
+
strokeDashoffset: R.value,
|
|
96
|
+
transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
|
|
97
|
+
})), o = C(() => {
|
|
98
|
+
let n;
|
|
99
|
+
return t.color ? n = P(t.percentage) : n = s[t.status] || s.default, n;
|
|
100
|
+
}), c = C(() => t.status === "warning" ? Be : t.type === "line" ? t.status === "success" ? fe : Ne : t.status === "success" ? ve : ye), r = C(() => t.type === "line" ? 12 + t.strokeWidth * 0.4 : t.width * 0.111111 + 2), f = C(() => t.format(t.percentage));
|
|
101
|
+
function u(n) {
|
|
102
|
+
const F = 100 / n.length;
|
|
103
|
+
return n.map((_, U) => ae(_) ? {
|
|
104
|
+
color: _,
|
|
105
|
+
percentage: (U + 1) * F
|
|
106
|
+
} : _).sort((_, U) => _.percentage - U.percentage);
|
|
107
|
+
}
|
|
108
|
+
const P = (n) => {
|
|
109
|
+
var F;
|
|
110
|
+
const { color: D } = t;
|
|
111
|
+
if (me(D))
|
|
112
|
+
return D(n);
|
|
113
|
+
if (ae(D))
|
|
114
|
+
return D;
|
|
115
|
+
{
|
|
116
|
+
const _ = u(D);
|
|
117
|
+
for (const U of _)
|
|
118
|
+
if (U.percentage > n)
|
|
119
|
+
return U.color;
|
|
120
|
+
return (F = _[_.length - 1]) == null ? void 0 : F.color;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return (n, F) => (g(), w("div", {
|
|
124
|
+
class: v([
|
|
125
|
+
e(i).b(),
|
|
126
|
+
e(i).m(n.type),
|
|
127
|
+
e(i).is(n.status),
|
|
128
|
+
{
|
|
129
|
+
[e(i).m("without-text")]: !n.showText,
|
|
130
|
+
[e(i).m("text-inside")]: n.textInside
|
|
131
|
+
}
|
|
132
|
+
]),
|
|
133
|
+
role: "progressbar",
|
|
134
|
+
"aria-valuenow": n.percentage,
|
|
135
|
+
"aria-valuemin": "0",
|
|
136
|
+
"aria-valuemax": "100"
|
|
137
|
+
}, [
|
|
138
|
+
n.type === "line" ? (g(), w("div", {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: v(e(i).b("bar"))
|
|
141
|
+
}, [
|
|
142
|
+
N("div", {
|
|
143
|
+
class: v(e(i).be("bar", "outer")),
|
|
144
|
+
style: A({ height: `${n.strokeWidth}px` })
|
|
145
|
+
}, [
|
|
146
|
+
N("div", {
|
|
147
|
+
class: v([
|
|
148
|
+
e(i).be("bar", "inner"),
|
|
149
|
+
{ [e(i).bem("bar", "inner", "indeterminate")]: n.indeterminate },
|
|
150
|
+
{ [e(i).bem("bar", "inner", "striped")]: n.striped },
|
|
151
|
+
{ [e(i).bem("bar", "inner", "striped-flow")]: n.stripedFlow }
|
|
152
|
+
]),
|
|
153
|
+
style: A(e(p))
|
|
154
|
+
}, [
|
|
155
|
+
(n.showText || n.$slots.default) && n.textInside ? (g(), w("div", {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: v(e(i).be("bar", "innerText"))
|
|
158
|
+
}, [
|
|
159
|
+
L(n.$slots, "default", { percentage: n.percentage }, () => [
|
|
160
|
+
N("span", null, W(e(f)), 1)
|
|
161
|
+
])
|
|
162
|
+
], 2)) : k("v-if", !0)
|
|
163
|
+
], 6)
|
|
164
|
+
], 6)
|
|
165
|
+
], 2)) : (g(), w("div", {
|
|
166
|
+
key: 1,
|
|
167
|
+
class: v(e(i).b("circle")),
|
|
168
|
+
style: A({ height: `${n.width}px`, width: `${n.width}px` })
|
|
169
|
+
}, [
|
|
170
|
+
(g(), w("svg", Ye, [
|
|
171
|
+
N("path", {
|
|
172
|
+
class: v(e(i).be("circle", "track")),
|
|
173
|
+
d: e(E),
|
|
174
|
+
stroke: `var(${e(i).cssVarName("fill-color-light")}, #e5e9f2)`,
|
|
175
|
+
"stroke-linecap": n.strokeLinecap,
|
|
176
|
+
"stroke-width": e(d),
|
|
177
|
+
fill: "none",
|
|
178
|
+
style: A(e(m))
|
|
179
|
+
}, null, 14, Qe),
|
|
180
|
+
N("path", {
|
|
181
|
+
class: v(e(i).be("circle", "path")),
|
|
182
|
+
d: e(E),
|
|
183
|
+
stroke: e(o),
|
|
184
|
+
fill: "none",
|
|
185
|
+
opacity: n.percentage ? 1 : 0,
|
|
186
|
+
"stroke-linecap": n.strokeLinecap,
|
|
187
|
+
"stroke-width": e(d),
|
|
188
|
+
style: A(e(l))
|
|
189
|
+
}, null, 14, Ze)
|
|
190
|
+
]))
|
|
191
|
+
], 6)),
|
|
192
|
+
(n.showText || n.$slots.default) && !n.textInside ? (g(), w("div", {
|
|
193
|
+
key: 2,
|
|
194
|
+
class: v(e(i).e("text")),
|
|
195
|
+
style: A({ fontSize: `${e(r)}px` })
|
|
196
|
+
}, [
|
|
197
|
+
L(n.$slots, "default", { percentage: n.percentage }, () => [
|
|
198
|
+
n.status ? (g(), O(e(M), { key: 1 }, {
|
|
199
|
+
default: T(() => [
|
|
200
|
+
(g(), O(Fe(e(c))))
|
|
201
|
+
]),
|
|
202
|
+
_: 1
|
|
203
|
+
})) : (g(), w("span", xe, W(e(f)), 1))
|
|
204
|
+
])
|
|
205
|
+
], 6)) : k("v-if", !0)
|
|
206
|
+
], 10, Je));
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
var st = /* @__PURE__ */ H(tt, [["__file", "progress.vue"]]);
|
|
210
|
+
const at = ge(st), ke = Symbol("uploadContextKey"), ot = "ElUpload";
|
|
211
|
+
class nt extends Error {
|
|
212
|
+
constructor(t, s, i, p) {
|
|
213
|
+
super(t), this.name = "UploadAjaxError", this.status = s, this.method = i, this.url = p;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function re(a, t, s) {
|
|
217
|
+
let i;
|
|
218
|
+
return s.response ? i = `${s.response.error || s.response}` : s.responseText ? i = `${s.responseText}` : i = `fail to ${t.method} ${a} ${s.status}`, new nt(i, s.status, t.method, a);
|
|
219
|
+
}
|
|
220
|
+
function rt(a) {
|
|
221
|
+
const t = a.responseText || a.response;
|
|
222
|
+
if (!t)
|
|
223
|
+
return t;
|
|
224
|
+
try {
|
|
225
|
+
return JSON.parse(t);
|
|
226
|
+
} catch {
|
|
227
|
+
return t;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const lt = (a) => {
|
|
231
|
+
typeof XMLHttpRequest > "u" && x(ot, "XMLHttpRequest is undefined");
|
|
232
|
+
const t = new XMLHttpRequest(), s = a.action;
|
|
233
|
+
t.upload && t.upload.addEventListener("progress", (d) => {
|
|
234
|
+
const y = d;
|
|
235
|
+
y.percent = d.total > 0 ? d.loaded / d.total * 100 : 0, a.onProgress(y);
|
|
236
|
+
});
|
|
237
|
+
const i = new FormData();
|
|
238
|
+
if (a.data)
|
|
239
|
+
for (const [d, y] of Object.entries(a.data))
|
|
240
|
+
he(y) && y.length ? i.append(d, ...y) : i.append(d, y);
|
|
241
|
+
i.append(a.filename, a.file, a.file.name), t.addEventListener("error", () => {
|
|
242
|
+
a.onError(re(s, a, t));
|
|
243
|
+
}), t.addEventListener("load", () => {
|
|
244
|
+
if (t.status < 200 || t.status >= 300)
|
|
245
|
+
return a.onError(re(s, a, t));
|
|
246
|
+
a.onSuccess(rt(t));
|
|
247
|
+
}), t.open(a.method, s, !0), a.withCredentials && "withCredentials" in t && (t.withCredentials = !0);
|
|
248
|
+
const p = a.headers || {};
|
|
249
|
+
if (p instanceof Headers)
|
|
250
|
+
p.forEach((d, y) => t.setRequestHeader(y, d));
|
|
251
|
+
else
|
|
252
|
+
for (const [d, y] of Object.entries(p))
|
|
253
|
+
be(y) || t.setRequestHeader(d, String(y));
|
|
254
|
+
return t.send(i), t;
|
|
255
|
+
}, $e = ["text", "picture", "picture-card"];
|
|
256
|
+
let it = 1;
|
|
257
|
+
const Z = () => Date.now() + it++, we = K({
|
|
258
|
+
action: {
|
|
259
|
+
type: String,
|
|
260
|
+
default: "#"
|
|
261
|
+
},
|
|
262
|
+
headers: {
|
|
263
|
+
type: h(Object)
|
|
264
|
+
},
|
|
265
|
+
method: {
|
|
266
|
+
type: String,
|
|
267
|
+
default: "post"
|
|
268
|
+
},
|
|
269
|
+
data: {
|
|
270
|
+
type: h([Object, Function, Promise]),
|
|
271
|
+
default: () => Q({})
|
|
272
|
+
},
|
|
273
|
+
multiple: {
|
|
274
|
+
type: Boolean,
|
|
275
|
+
default: !1
|
|
276
|
+
},
|
|
277
|
+
name: {
|
|
278
|
+
type: String,
|
|
279
|
+
default: "file"
|
|
280
|
+
},
|
|
281
|
+
drag: {
|
|
282
|
+
type: Boolean,
|
|
283
|
+
default: !1
|
|
284
|
+
},
|
|
285
|
+
withCredentials: Boolean,
|
|
286
|
+
showFileList: {
|
|
287
|
+
type: Boolean,
|
|
288
|
+
default: !0
|
|
289
|
+
},
|
|
290
|
+
accept: {
|
|
291
|
+
type: String,
|
|
292
|
+
default: ""
|
|
293
|
+
},
|
|
294
|
+
fileList: {
|
|
295
|
+
type: h(Array),
|
|
296
|
+
default: () => Q([])
|
|
297
|
+
},
|
|
298
|
+
autoUpload: {
|
|
299
|
+
type: Boolean,
|
|
300
|
+
default: !0
|
|
301
|
+
},
|
|
302
|
+
listType: {
|
|
303
|
+
type: String,
|
|
304
|
+
values: $e,
|
|
305
|
+
default: "text"
|
|
306
|
+
},
|
|
307
|
+
httpRequest: {
|
|
308
|
+
type: h(Function),
|
|
309
|
+
default: lt
|
|
310
|
+
},
|
|
311
|
+
disabled: Boolean,
|
|
312
|
+
limit: Number
|
|
313
|
+
}), ut = K({
|
|
314
|
+
...we,
|
|
315
|
+
beforeUpload: {
|
|
316
|
+
type: h(Function),
|
|
317
|
+
default: S
|
|
318
|
+
},
|
|
319
|
+
beforeRemove: {
|
|
320
|
+
type: h(Function)
|
|
321
|
+
},
|
|
322
|
+
onRemove: {
|
|
323
|
+
type: h(Function),
|
|
324
|
+
default: S
|
|
325
|
+
},
|
|
326
|
+
onChange: {
|
|
327
|
+
type: h(Function),
|
|
328
|
+
default: S
|
|
329
|
+
},
|
|
330
|
+
onPreview: {
|
|
331
|
+
type: h(Function),
|
|
332
|
+
default: S
|
|
333
|
+
},
|
|
334
|
+
onSuccess: {
|
|
335
|
+
type: h(Function),
|
|
336
|
+
default: S
|
|
337
|
+
},
|
|
338
|
+
onProgress: {
|
|
339
|
+
type: h(Function),
|
|
340
|
+
default: S
|
|
341
|
+
},
|
|
342
|
+
onError: {
|
|
343
|
+
type: h(Function),
|
|
344
|
+
default: S
|
|
345
|
+
},
|
|
346
|
+
onExceed: {
|
|
347
|
+
type: h(Function),
|
|
348
|
+
default: S
|
|
349
|
+
},
|
|
350
|
+
crossorigin: {
|
|
351
|
+
type: h(String)
|
|
352
|
+
}
|
|
353
|
+
}), dt = K({
|
|
354
|
+
files: {
|
|
355
|
+
type: h(Array),
|
|
356
|
+
default: () => Q([])
|
|
357
|
+
},
|
|
358
|
+
disabled: {
|
|
359
|
+
type: Boolean,
|
|
360
|
+
default: !1
|
|
361
|
+
},
|
|
362
|
+
handlePreview: {
|
|
363
|
+
type: h(Function),
|
|
364
|
+
default: S
|
|
365
|
+
},
|
|
366
|
+
listType: {
|
|
367
|
+
type: String,
|
|
368
|
+
values: $e,
|
|
369
|
+
default: "text"
|
|
370
|
+
},
|
|
371
|
+
crossorigin: {
|
|
372
|
+
type: h(String)
|
|
373
|
+
}
|
|
374
|
+
}), ct = {
|
|
375
|
+
remove: (a) => !!a
|
|
376
|
+
}, pt = ["onKeydown"], ft = ["src", "crossorigin"], vt = ["onClick"], yt = ["title"], mt = ["onClick"], gt = ["onClick"], ht = j({
|
|
377
|
+
name: "ElUploadList"
|
|
378
|
+
}), bt = /* @__PURE__ */ j({
|
|
379
|
+
...ht,
|
|
380
|
+
props: dt,
|
|
381
|
+
emits: ct,
|
|
382
|
+
setup(a, { emit: t }) {
|
|
383
|
+
const s = a, { t: i } = je(), p = z("upload"), d = z("icon"), y = z("list"), E = V(), b = ce(!1), $ = C(() => [
|
|
384
|
+
p.b("list"),
|
|
385
|
+
p.bm("list", s.listType),
|
|
386
|
+
p.is("disabled", s.disabled)
|
|
387
|
+
]), R = (m) => {
|
|
388
|
+
t("remove", m);
|
|
389
|
+
};
|
|
390
|
+
return (m, l) => (g(), O(Le, {
|
|
391
|
+
tag: "ul",
|
|
392
|
+
class: v(e($)),
|
|
393
|
+
name: e(y).b()
|
|
394
|
+
}, {
|
|
395
|
+
default: T(() => [
|
|
396
|
+
(g(!0), w(Re, null, Te(m.files, (o) => (g(), w("li", {
|
|
397
|
+
key: o.uid || o.name,
|
|
398
|
+
class: v([
|
|
399
|
+
e(p).be("list", "item"),
|
|
400
|
+
e(p).is(o.status),
|
|
401
|
+
{ focusing: b.value }
|
|
402
|
+
]),
|
|
403
|
+
tabindex: "0",
|
|
404
|
+
onKeydown: pe((c) => !e(E) && R(o), ["delete"]),
|
|
405
|
+
onFocus: l[0] || (l[0] = (c) => b.value = !0),
|
|
406
|
+
onBlur: l[1] || (l[1] = (c) => b.value = !1),
|
|
407
|
+
onClick: l[2] || (l[2] = (c) => b.value = !1)
|
|
408
|
+
}, [
|
|
409
|
+
L(m.$slots, "default", { file: o }, () => [
|
|
410
|
+
m.listType === "picture" || o.status !== "uploading" && m.listType === "picture-card" ? (g(), w("img", {
|
|
411
|
+
key: 0,
|
|
412
|
+
class: v(e(p).be("list", "item-thumbnail")),
|
|
413
|
+
src: o.url,
|
|
414
|
+
crossorigin: m.crossorigin,
|
|
415
|
+
alt: ""
|
|
416
|
+
}, null, 10, ft)) : k("v-if", !0),
|
|
417
|
+
o.status === "uploading" || m.listType !== "picture-card" ? (g(), w("div", {
|
|
418
|
+
key: 1,
|
|
419
|
+
class: v(e(p).be("list", "item-info"))
|
|
420
|
+
}, [
|
|
421
|
+
N("a", {
|
|
422
|
+
class: v(e(p).be("list", "item-name")),
|
|
423
|
+
onClick: I((c) => m.handlePreview(o), ["prevent"])
|
|
424
|
+
}, [
|
|
425
|
+
B(e(M), {
|
|
426
|
+
class: v(e(d).m("document"))
|
|
427
|
+
}, {
|
|
428
|
+
default: T(() => [
|
|
429
|
+
B(e(Ae))
|
|
430
|
+
]),
|
|
431
|
+
_: 1
|
|
432
|
+
}, 8, ["class"]),
|
|
433
|
+
N("span", {
|
|
434
|
+
class: v(e(p).be("list", "item-file-name")),
|
|
435
|
+
title: o.name
|
|
436
|
+
}, W(o.name), 11, yt)
|
|
437
|
+
], 10, vt),
|
|
438
|
+
o.status === "uploading" ? (g(), O(e(at), {
|
|
439
|
+
key: 0,
|
|
440
|
+
type: m.listType === "picture-card" ? "circle" : "line",
|
|
441
|
+
"stroke-width": m.listType === "picture-card" ? 6 : 2,
|
|
442
|
+
percentage: Number(o.percentage),
|
|
443
|
+
style: A(m.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
444
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : k("v-if", !0)
|
|
445
|
+
], 2)) : k("v-if", !0),
|
|
446
|
+
N("label", {
|
|
447
|
+
class: v(e(p).be("list", "item-status-label"))
|
|
448
|
+
}, [
|
|
449
|
+
m.listType === "text" ? (g(), O(e(M), {
|
|
450
|
+
key: 0,
|
|
451
|
+
class: v([e(d).m("upload-success"), e(d).m("circle-check")])
|
|
452
|
+
}, {
|
|
453
|
+
default: T(() => [
|
|
454
|
+
B(e(fe))
|
|
455
|
+
]),
|
|
456
|
+
_: 1
|
|
457
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(m.listType) ? (g(), O(e(M), {
|
|
458
|
+
key: 1,
|
|
459
|
+
class: v([e(d).m("upload-success"), e(d).m("check")])
|
|
460
|
+
}, {
|
|
461
|
+
default: T(() => [
|
|
462
|
+
B(e(ve))
|
|
463
|
+
]),
|
|
464
|
+
_: 1
|
|
465
|
+
}, 8, ["class"])) : k("v-if", !0)
|
|
466
|
+
], 2),
|
|
467
|
+
e(E) ? k("v-if", !0) : (g(), O(e(M), {
|
|
468
|
+
key: 2,
|
|
469
|
+
class: v(e(d).m("close")),
|
|
470
|
+
onClick: (c) => R(o)
|
|
471
|
+
}, {
|
|
472
|
+
default: T(() => [
|
|
473
|
+
B(e(ye))
|
|
474
|
+
]),
|
|
475
|
+
_: 2
|
|
476
|
+
}, 1032, ["class", "onClick"])),
|
|
477
|
+
k(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
|
|
478
|
+
k(" This is a bug which needs to be fixed "),
|
|
479
|
+
k(" TODO: Fix the incorrect navigation interaction "),
|
|
480
|
+
e(E) ? k("v-if", !0) : (g(), w("i", {
|
|
481
|
+
key: 3,
|
|
482
|
+
class: v(e(d).m("close-tip"))
|
|
483
|
+
}, W(e(i)("el.upload.deleteTip")), 3)),
|
|
484
|
+
m.listType === "picture-card" ? (g(), w("span", {
|
|
485
|
+
key: 4,
|
|
486
|
+
class: v(e(p).be("list", "item-actions"))
|
|
487
|
+
}, [
|
|
488
|
+
N("span", {
|
|
489
|
+
class: v(e(p).be("list", "item-preview")),
|
|
490
|
+
onClick: (c) => m.handlePreview(o)
|
|
491
|
+
}, [
|
|
492
|
+
B(e(M), {
|
|
493
|
+
class: v(e(d).m("zoom-in"))
|
|
494
|
+
}, {
|
|
495
|
+
default: T(() => [
|
|
496
|
+
B(e(Me))
|
|
497
|
+
]),
|
|
498
|
+
_: 1
|
|
499
|
+
}, 8, ["class"])
|
|
500
|
+
], 10, mt),
|
|
501
|
+
e(E) ? k("v-if", !0) : (g(), w("span", {
|
|
502
|
+
key: 0,
|
|
503
|
+
class: v(e(p).be("list", "item-delete")),
|
|
504
|
+
onClick: (c) => R(o)
|
|
505
|
+
}, [
|
|
506
|
+
B(e(M), {
|
|
507
|
+
class: v(e(d).m("delete"))
|
|
508
|
+
}, {
|
|
509
|
+
default: T(() => [
|
|
510
|
+
B(e(qe))
|
|
511
|
+
]),
|
|
512
|
+
_: 1
|
|
513
|
+
}, 8, ["class"])
|
|
514
|
+
], 10, gt))
|
|
515
|
+
], 2)) : k("v-if", !0)
|
|
516
|
+
])
|
|
517
|
+
], 42, pt))), 128)),
|
|
518
|
+
L(m.$slots, "append")
|
|
519
|
+
]),
|
|
520
|
+
_: 3
|
|
521
|
+
}, 8, ["class", "name"]));
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
var le = /* @__PURE__ */ H(bt, [["__file", "upload-list.vue"]]);
|
|
525
|
+
const kt = K({
|
|
526
|
+
disabled: {
|
|
527
|
+
type: Boolean,
|
|
528
|
+
default: !1
|
|
529
|
+
}
|
|
530
|
+
}), $t = {
|
|
531
|
+
file: (a) => he(a)
|
|
532
|
+
}, wt = ["onDrop", "onDragover"], Ee = "ElUploadDrag", Et = j({
|
|
533
|
+
name: Ee
|
|
534
|
+
}), Ct = /* @__PURE__ */ j({
|
|
535
|
+
...Et,
|
|
536
|
+
props: kt,
|
|
537
|
+
emits: $t,
|
|
538
|
+
setup(a, { emit: t }) {
|
|
539
|
+
_e(ke) || x(Ee, "usage: <el-upload><el-upload-dragger /></el-upload>");
|
|
540
|
+
const i = z("upload"), p = ce(!1), d = V(), y = (b) => {
|
|
541
|
+
if (d.value)
|
|
542
|
+
return;
|
|
543
|
+
p.value = !1, b.stopPropagation();
|
|
544
|
+
const $ = Array.from(b.dataTransfer.files);
|
|
545
|
+
t("file", $);
|
|
546
|
+
}, E = () => {
|
|
547
|
+
d.value || (p.value = !0);
|
|
548
|
+
};
|
|
549
|
+
return (b, $) => (g(), w("div", {
|
|
550
|
+
class: v([e(i).b("dragger"), e(i).is("dragover", p.value)]),
|
|
551
|
+
onDrop: I(y, ["prevent"]),
|
|
552
|
+
onDragover: I(E, ["prevent"]),
|
|
553
|
+
onDragleave: $[0] || ($[0] = I((R) => p.value = !1, ["prevent"]))
|
|
554
|
+
}, [
|
|
555
|
+
L(b.$slots, "default")
|
|
556
|
+
], 42, wt));
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
var St = /* @__PURE__ */ H(Ct, [["__file", "upload-dragger.vue"]]);
|
|
560
|
+
const Pt = K({
|
|
561
|
+
...we,
|
|
562
|
+
beforeUpload: {
|
|
563
|
+
type: h(Function),
|
|
564
|
+
default: S
|
|
565
|
+
},
|
|
566
|
+
onRemove: {
|
|
567
|
+
type: h(Function),
|
|
568
|
+
default: S
|
|
569
|
+
},
|
|
570
|
+
onStart: {
|
|
571
|
+
type: h(Function),
|
|
572
|
+
default: S
|
|
573
|
+
},
|
|
574
|
+
onSuccess: {
|
|
575
|
+
type: h(Function),
|
|
576
|
+
default: S
|
|
577
|
+
},
|
|
578
|
+
onProgress: {
|
|
579
|
+
type: h(Function),
|
|
580
|
+
default: S
|
|
581
|
+
},
|
|
582
|
+
onError: {
|
|
583
|
+
type: h(Function),
|
|
584
|
+
default: S
|
|
585
|
+
},
|
|
586
|
+
onExceed: {
|
|
587
|
+
type: h(Function),
|
|
588
|
+
default: S
|
|
589
|
+
}
|
|
590
|
+
}), Ft = ["onKeydown"], Lt = ["name", "multiple", "accept"], Rt = j({
|
|
591
|
+
name: "ElUploadContent",
|
|
592
|
+
inheritAttrs: !1
|
|
593
|
+
}), Tt = /* @__PURE__ */ j({
|
|
594
|
+
...Rt,
|
|
595
|
+
props: Pt,
|
|
596
|
+
setup(a, { expose: t }) {
|
|
597
|
+
const s = a, i = z("upload"), p = V(), d = Y({}), y = Y(), E = (r) => {
|
|
598
|
+
if (r.length === 0)
|
|
599
|
+
return;
|
|
600
|
+
const { autoUpload: f, limit: u, fileList: P, multiple: n, onStart: F, onExceed: D } = s;
|
|
601
|
+
if (u && P.length + r.length > u) {
|
|
602
|
+
D(r, P);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
n || (r = r.slice(0, 1));
|
|
606
|
+
for (const _ of r) {
|
|
607
|
+
const U = _;
|
|
608
|
+
U.uid = Z(), F(U), f && b(U);
|
|
609
|
+
}
|
|
610
|
+
}, b = async (r) => {
|
|
611
|
+
if (y.value.value = "", !s.beforeUpload)
|
|
612
|
+
return R(r);
|
|
613
|
+
let f, u = {};
|
|
614
|
+
try {
|
|
615
|
+
const n = s.data, F = s.beforeUpload(r);
|
|
616
|
+
u = oe(s.data) ? ne(s.data) : s.data, f = await F, oe(s.data) && We(n, u) && (u = ne(s.data));
|
|
617
|
+
} catch {
|
|
618
|
+
f = !1;
|
|
619
|
+
}
|
|
620
|
+
if (f === !1) {
|
|
621
|
+
s.onRemove(r);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
let P = r;
|
|
625
|
+
f instanceof Blob && (f instanceof File ? P = f : P = new File([f], r.name, {
|
|
626
|
+
type: r.type
|
|
627
|
+
})), R(Object.assign(P, {
|
|
628
|
+
uid: r.uid
|
|
629
|
+
}), u);
|
|
630
|
+
}, $ = async (r, f) => me(r) ? r(f) : r, R = async (r, f) => {
|
|
631
|
+
const {
|
|
632
|
+
headers: u,
|
|
633
|
+
data: P,
|
|
634
|
+
method: n,
|
|
635
|
+
withCredentials: F,
|
|
636
|
+
name: D,
|
|
637
|
+
action: _,
|
|
638
|
+
onProgress: U,
|
|
639
|
+
onSuccess: Ce,
|
|
640
|
+
onError: Se,
|
|
641
|
+
httpRequest: Pe
|
|
642
|
+
} = s;
|
|
643
|
+
try {
|
|
644
|
+
f = await $(f ?? P, r);
|
|
645
|
+
} catch {
|
|
646
|
+
s.onRemove(r);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
const { uid: X } = r, G = {
|
|
650
|
+
headers: u || {},
|
|
651
|
+
withCredentials: F,
|
|
652
|
+
file: r,
|
|
653
|
+
data: f,
|
|
654
|
+
method: n,
|
|
655
|
+
filename: D,
|
|
656
|
+
action: _,
|
|
657
|
+
onProgress: (q) => {
|
|
658
|
+
U(q, r);
|
|
659
|
+
},
|
|
660
|
+
onSuccess: (q) => {
|
|
661
|
+
Ce(q, r), delete d.value[X];
|
|
662
|
+
},
|
|
663
|
+
onError: (q) => {
|
|
664
|
+
Se(q, r), delete d.value[X];
|
|
665
|
+
}
|
|
666
|
+
}, J = Pe(G);
|
|
667
|
+
d.value[X] = J, J instanceof Promise && J.then(G.onSuccess, G.onError);
|
|
668
|
+
}, m = (r) => {
|
|
669
|
+
const f = r.target.files;
|
|
670
|
+
f && E(Array.from(f));
|
|
671
|
+
}, l = () => {
|
|
672
|
+
p.value || (y.value.value = "", y.value.click());
|
|
673
|
+
}, o = () => {
|
|
674
|
+
l();
|
|
675
|
+
};
|
|
676
|
+
return t({
|
|
677
|
+
abort: (r) => {
|
|
678
|
+
Ie(d.value).filter(r ? ([u]) => String(r.uid) === u : () => !0).forEach(([u, P]) => {
|
|
679
|
+
P instanceof XMLHttpRequest && P.abort(), delete d.value[u];
|
|
680
|
+
});
|
|
681
|
+
},
|
|
682
|
+
upload: b
|
|
683
|
+
}), (r, f) => (g(), w("div", {
|
|
684
|
+
class: v([e(i).b(), e(i).m(r.listType), e(i).is("drag", r.drag)]),
|
|
685
|
+
tabindex: "0",
|
|
686
|
+
onClick: l,
|
|
687
|
+
onKeydown: pe(I(o, ["self"]), ["enter", "space"])
|
|
688
|
+
}, [
|
|
689
|
+
r.drag ? (g(), O(St, {
|
|
690
|
+
key: 0,
|
|
691
|
+
disabled: e(p),
|
|
692
|
+
onFile: E
|
|
693
|
+
}, {
|
|
694
|
+
default: T(() => [
|
|
695
|
+
L(r.$slots, "default")
|
|
696
|
+
]),
|
|
697
|
+
_: 3
|
|
698
|
+
}, 8, ["disabled"])) : L(r.$slots, "default", { key: 1 }),
|
|
699
|
+
N("input", {
|
|
700
|
+
ref_key: "inputRef",
|
|
701
|
+
ref: y,
|
|
702
|
+
class: v(e(i).e("input")),
|
|
703
|
+
name: r.name,
|
|
704
|
+
multiple: r.multiple,
|
|
705
|
+
accept: r.accept,
|
|
706
|
+
type: "file",
|
|
707
|
+
onChange: m,
|
|
708
|
+
onClick: f[0] || (f[0] = I(() => {
|
|
709
|
+
}, ["stop"]))
|
|
710
|
+
}, null, 42, Lt)
|
|
711
|
+
], 42, Ft));
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
var ie = /* @__PURE__ */ H(Tt, [["__file", "upload-content.vue"]]);
|
|
715
|
+
const ue = "ElUpload", de = (a) => {
|
|
716
|
+
var t;
|
|
717
|
+
(t = a.url) != null && t.startsWith("blob:") && URL.revokeObjectURL(a.url);
|
|
718
|
+
}, _t = (a, t) => {
|
|
719
|
+
const s = ze(a, "fileList", void 0, { passive: !0 }), i = (l) => s.value.find((o) => o.uid === l.uid);
|
|
720
|
+
function p(l) {
|
|
721
|
+
var o;
|
|
722
|
+
(o = t.value) == null || o.abort(l);
|
|
723
|
+
}
|
|
724
|
+
function d(l = ["ready", "uploading", "success", "fail"]) {
|
|
725
|
+
s.value = s.value.filter((o) => !l.includes(o.status));
|
|
726
|
+
}
|
|
727
|
+
const y = (l, o) => {
|
|
728
|
+
const c = i(o);
|
|
729
|
+
c && (console.error(l), c.status = "fail", s.value.splice(s.value.indexOf(c), 1), a.onError(l, c, s.value), a.onChange(c, s.value));
|
|
730
|
+
}, E = (l, o) => {
|
|
731
|
+
const c = i(o);
|
|
732
|
+
c && (a.onProgress(l, c, s.value), c.status = "uploading", c.percentage = Math.round(l.percent));
|
|
733
|
+
}, b = (l, o) => {
|
|
734
|
+
const c = i(o);
|
|
735
|
+
c && (c.status = "success", c.response = l, a.onSuccess(l, c, s.value), a.onChange(c, s.value));
|
|
736
|
+
}, $ = (l) => {
|
|
737
|
+
be(l.uid) && (l.uid = Z());
|
|
738
|
+
const o = {
|
|
739
|
+
name: l.name,
|
|
740
|
+
percentage: 0,
|
|
741
|
+
status: "ready",
|
|
742
|
+
size: l.size,
|
|
743
|
+
raw: l,
|
|
744
|
+
uid: l.uid
|
|
745
|
+
};
|
|
746
|
+
if (a.listType === "picture-card" || a.listType === "picture")
|
|
747
|
+
try {
|
|
748
|
+
o.url = URL.createObjectURL(l);
|
|
749
|
+
} catch (c) {
|
|
750
|
+
Ke(ue, c.message), a.onError(c, o, s.value);
|
|
751
|
+
}
|
|
752
|
+
s.value = [...s.value, o], a.onChange(o, s.value);
|
|
753
|
+
}, R = async (l) => {
|
|
754
|
+
const o = l instanceof File ? i(l) : l;
|
|
755
|
+
o || x(ue, "file to be removed not found");
|
|
756
|
+
const c = (r) => {
|
|
757
|
+
p(r);
|
|
758
|
+
const f = s.value;
|
|
759
|
+
f.splice(f.indexOf(r), 1), a.onRemove(r, f), de(r);
|
|
760
|
+
};
|
|
761
|
+
a.beforeRemove ? await a.beforeRemove(o, s.value) !== !1 && c(o) : c(o);
|
|
762
|
+
};
|
|
763
|
+
function m() {
|
|
764
|
+
s.value.filter(({ status: l }) => l === "ready").forEach(({ raw: l }) => {
|
|
765
|
+
var o;
|
|
766
|
+
return l && ((o = t.value) == null ? void 0 : o.upload(l));
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
return ee(() => a.listType, (l) => {
|
|
770
|
+
l !== "picture-card" && l !== "picture" || (s.value = s.value.map((o) => {
|
|
771
|
+
const { raw: c, url: r } = o;
|
|
772
|
+
if (!r && c)
|
|
773
|
+
try {
|
|
774
|
+
o.url = URL.createObjectURL(c);
|
|
775
|
+
} catch (f) {
|
|
776
|
+
a.onError(f, o, s.value);
|
|
777
|
+
}
|
|
778
|
+
return o;
|
|
779
|
+
}));
|
|
780
|
+
}), ee(s, (l) => {
|
|
781
|
+
for (const o of l)
|
|
782
|
+
o.uid || (o.uid = Z()), o.status || (o.status = "success");
|
|
783
|
+
}, { immediate: !0, deep: !0 }), {
|
|
784
|
+
uploadFiles: s,
|
|
785
|
+
abort: p,
|
|
786
|
+
clearFiles: d,
|
|
787
|
+
handleError: y,
|
|
788
|
+
handleProgress: E,
|
|
789
|
+
handleStart: $,
|
|
790
|
+
handleSuccess: b,
|
|
791
|
+
handleRemove: R,
|
|
792
|
+
submit: m,
|
|
793
|
+
revokeFileObjectURL: de
|
|
794
|
+
};
|
|
795
|
+
}, Ut = j({
|
|
796
|
+
name: "ElUpload"
|
|
797
|
+
}), Ot = /* @__PURE__ */ j({
|
|
798
|
+
...Ut,
|
|
799
|
+
props: ut,
|
|
800
|
+
setup(a, { expose: t }) {
|
|
801
|
+
const s = a, i = V(), p = Y(), {
|
|
802
|
+
abort: d,
|
|
803
|
+
submit: y,
|
|
804
|
+
clearFiles: E,
|
|
805
|
+
uploadFiles: b,
|
|
806
|
+
handleStart: $,
|
|
807
|
+
handleError: R,
|
|
808
|
+
handleRemove: m,
|
|
809
|
+
handleSuccess: l,
|
|
810
|
+
handleProgress: o,
|
|
811
|
+
revokeFileObjectURL: c
|
|
812
|
+
} = _t(s, p), r = C(() => s.listType === "picture-card"), f = C(() => ({
|
|
813
|
+
...s,
|
|
814
|
+
fileList: b.value,
|
|
815
|
+
onStart: $,
|
|
816
|
+
onProgress: o,
|
|
817
|
+
onSuccess: l,
|
|
818
|
+
onError: R,
|
|
819
|
+
onRemove: m
|
|
820
|
+
}));
|
|
821
|
+
return Ue(() => {
|
|
822
|
+
b.value.forEach(c);
|
|
823
|
+
}), Oe(ke, {
|
|
824
|
+
accept: De(s, "accept")
|
|
825
|
+
}), t({
|
|
826
|
+
abort: d,
|
|
827
|
+
submit: y,
|
|
828
|
+
clearFiles: E,
|
|
829
|
+
handleStart: $,
|
|
830
|
+
handleRemove: m
|
|
831
|
+
}), (u, P) => (g(), w("div", null, [
|
|
832
|
+
e(r) && u.showFileList ? (g(), O(le, {
|
|
833
|
+
key: 0,
|
|
834
|
+
disabled: e(i),
|
|
835
|
+
"list-type": u.listType,
|
|
836
|
+
files: e(b),
|
|
837
|
+
crossorigin: u.crossorigin,
|
|
838
|
+
"handle-preview": u.onPreview,
|
|
839
|
+
onRemove: e(m)
|
|
840
|
+
}, te({
|
|
841
|
+
append: T(() => [
|
|
842
|
+
B(ie, se({
|
|
843
|
+
ref_key: "uploadRef",
|
|
844
|
+
ref: p
|
|
845
|
+
}, e(f)), {
|
|
846
|
+
default: T(() => [
|
|
847
|
+
u.$slots.trigger ? L(u.$slots, "trigger", { key: 0 }) : k("v-if", !0),
|
|
848
|
+
!u.$slots.trigger && u.$slots.default ? L(u.$slots, "default", { key: 1 }) : k("v-if", !0)
|
|
849
|
+
]),
|
|
850
|
+
_: 3
|
|
851
|
+
}, 16)
|
|
852
|
+
]),
|
|
853
|
+
_: 2
|
|
854
|
+
}, [
|
|
855
|
+
u.$slots.file ? {
|
|
856
|
+
name: "default",
|
|
857
|
+
fn: T(({ file: n }) => [
|
|
858
|
+
L(u.$slots, "file", { file: n })
|
|
859
|
+
])
|
|
860
|
+
} : void 0
|
|
861
|
+
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : k("v-if", !0),
|
|
862
|
+
!e(r) || e(r) && !u.showFileList ? (g(), O(ie, se({
|
|
863
|
+
key: 1,
|
|
864
|
+
ref_key: "uploadRef",
|
|
865
|
+
ref: p
|
|
866
|
+
}, e(f)), {
|
|
867
|
+
default: T(() => [
|
|
868
|
+
u.$slots.trigger ? L(u.$slots, "trigger", { key: 0 }) : k("v-if", !0),
|
|
869
|
+
!u.$slots.trigger && u.$slots.default ? L(u.$slots, "default", { key: 1 }) : k("v-if", !0)
|
|
870
|
+
]),
|
|
871
|
+
_: 3
|
|
872
|
+
}, 16)) : k("v-if", !0),
|
|
873
|
+
u.$slots.trigger ? L(u.$slots, "default", { key: 2 }) : k("v-if", !0),
|
|
874
|
+
L(u.$slots, "tip"),
|
|
875
|
+
!e(r) && u.showFileList ? (g(), O(le, {
|
|
876
|
+
key: 3,
|
|
877
|
+
disabled: e(i),
|
|
878
|
+
"list-type": u.listType,
|
|
879
|
+
files: e(b),
|
|
880
|
+
crossorigin: u.crossorigin,
|
|
881
|
+
"handle-preview": u.onPreview,
|
|
882
|
+
onRemove: e(m)
|
|
883
|
+
}, te({ _: 2 }, [
|
|
884
|
+
u.$slots.file ? {
|
|
885
|
+
name: "default",
|
|
886
|
+
fn: T(({ file: n }) => [
|
|
887
|
+
L(u.$slots, "file", { file: n })
|
|
888
|
+
])
|
|
889
|
+
} : void 0
|
|
890
|
+
]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : k("v-if", !0)
|
|
891
|
+
]));
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
var Dt = /* @__PURE__ */ H(Ot, [["__file", "upload.vue"]]);
|
|
895
|
+
const Mt = ge(Dt);
|
|
896
|
+
export {
|
|
897
|
+
Mt as E
|
|
898
|
+
};
|