@lemon30_npm/csit-vue3 1.0.60 → 1.0.63
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/csit-vue3.js +1049 -837
- package/dist/index.css +1 -1
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.css +0 -0
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue.js +1 -1
- package/dist/lib/ci-common-list/ci-common-list-pagination/index.vue2.js +1 -1
- package/dist/lib/ci-dictionary-select/index.css +1 -0
- package/dist/lib/ci-dictionary-select/index.vue.js +1 -1
- package/dist/lib/ci-dictionary-select/index.vue2.js +95 -45
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.css +1 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.js +9 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue.js +7 -0
- package/dist/lib/ci-element-plus/ci-choose-all-select/index.vue2.js +113 -0
- package/dist/lib/ci-upload/computed/index.js +21 -9
- package/dist/lib/ci-upload/hooks/useFileSize.js +10 -0
- package/dist/lib/ci-upload/index.css +1 -1
- package/dist/lib/ci-upload/index.vue.js +3 -3
- package/dist/lib/ci-upload/index.vue2.js +182 -155
- package/dist/lib/ci-upload/props/index.js +8 -3
- package/dist/lib/components/index.js +25 -22
- package/dist/lib/styles/reset-elementPlus/index.css +1 -1
- package/dist/types/src/components/components-project/ci-dictionary-select/index.vue.d.ts +5 -2
- package/dist/types/src/components/components-project/ci-dictionary-select/type.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.d.ts +8 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/index.vue.d.ts +36 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/model/index.d.ts +1 -0
- package/dist/types/src/components/components-project/ci-element-plus/ci-choose-all-select/type.d.ts +17 -0
- package/dist/types/src/components/components-project/ci-upload/computed/index.d.ts +0 -1
- package/dist/types/src/components/components-project/ci-upload/hooks/useFileSize.d.ts +3 -0
- package/dist/types/src/components/components-project/ci-upload/index.vue.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/props/index.d.ts +2 -0
- package/dist/types/src/components/components-project/ci-upload/type.d.ts +2 -0
- package/dist/types/src/views-demo/usedemo-ci-choose-all-select/index.vue.d.ts +2 -0
- package/dist/types/src/views-demo/usedemo-ci-choose-all-select/routes/index.d.ts +13 -0
- package/package.json +8 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function i() {
|
|
2
|
+
return { formatFileSize: (t) => {
|
|
3
|
+
if (!t || t <= 0) return "0.00KB";
|
|
4
|
+
const o = 1024, r = 1024 * 1024, n = 1024 * 1024 * 1024;
|
|
5
|
+
return t < r ? (t / o).toFixed(2) + "KB" : t < n ? (t / r).toFixed(2) + "MB" : (t / n).toFixed(2) + "GB";
|
|
6
|
+
} };
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
i as useFileSize
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.CiUpload[data-v-
|
|
1
|
+
.CiUpload[data-v-ba8bfffc]{width:680px;line-height:normal}.CiUpload .el-link.is-underline[data-v-ba8bfffc]:hover:after{border-bottom:none}.CiUpload .el-link.is-hover-underline[data-v-ba8bfffc]:hover:after{border-bottom:none}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger{height:142px;padding:0;display:flex;flex-direction:column;justify-content:center;align-items:center}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon,.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-hover,.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-disabled{width:20px;height:20px}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-hover,.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-disabled{display:none}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger:hover{background-color:#fafbfd}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger:hover .upload-btn-icon{display:none}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger:hover .upload-btn-icon-hover{display:block}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger:hover .upload-btn-icon-disabled{display:none}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .drag-text-info{margin-top:20px}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .drag-text-info .drag-text-info-click{color:#3573f3}.CiUpload .ci-el-upload-component[data-v-ba8bfffc] .el-upload-dragger .drag-text-info .drag-text-info-black{color:#191919}.CiUpload .ci-el-upload-component .upload-btn[data-v-ba8bfffc]{color:#4a4a4a!important;border-color:#dbdbdb!important}.CiUpload .ci-el-upload-component .upload-btn .upload-btn-icon[data-v-ba8bfffc],.CiUpload .ci-el-upload-component .upload-btn .upload-btn-icon-hover[data-v-ba8bfffc],.CiUpload .ci-el-upload-component .upload-btn .upload-btn-icon-disabled[data-v-ba8bfffc]{width:20px;height:20px;margin-right:10px}.CiUpload .ci-el-upload-component .upload-btn .upload-btn-icon-hover[data-v-ba8bfffc],.CiUpload .ci-el-upload-component .upload-btn .upload-btn-icon-disabled[data-v-ba8bfffc]{display:none}.CiUpload .ci-el-upload-component .upload-btn[data-v-ba8bfffc]:hover{color:#3573f3!important;border-color:#3573f3!important}.CiUpload .ci-el-upload-component .upload-btn:hover .upload-btn-icon[data-v-ba8bfffc]{display:none}.CiUpload .ci-el-upload-component .upload-btn:hover .upload-btn-icon-hover[data-v-ba8bfffc]{display:block}.CiUpload .ci-el-upload-component .upload-btn:hover .upload-btn-icon-disabled[data-v-ba8bfffc]{display:none}.CiUpload .ci-el-upload-component .upload-btn.is-disabled[data-v-ba8bfffc]{color:#a4a4a4!important;background-color:#f5f5f5!important;border-color:#dbdbdb!important;opacity:1!important}.CiUpload .ci-el-upload-component .upload-btn.is-disabled .upload-btn-icon[data-v-ba8bfffc],.CiUpload .ci-el-upload-component .upload-btn.is-disabled .upload-btn-icon-hover[data-v-ba8bfffc]{display:none}.CiUpload .ci-el-upload-component .upload-btn.is-disabled .upload-btn-icon-disabled[data-v-ba8bfffc]{display:block}.CiUpload .ci-el-upload-component .default-tip-slot-textInfo[data-v-ba8bfffc],.CiUpload .ci-el-upload-component .tip-slot-textInfo[data-v-ba8bfffc]{color:#a4a4a4;font-size:12px;margin-top:10px}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger{background-color:#f5f5f5}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon,.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-hover{display:none}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .upload-btn-icon-disabled{display:block}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger:hover{border:1px dashed #dcdfe6}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .drag-text-info{margin-top:20px}.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .drag-text-info .drag-text-info-click,.CiUpload .ci-el-upload-component.is-disabled[data-v-ba8bfffc] .el-upload-dragger .drag-text-info .drag-text-info-black{color:#a4a4a4}.CiUpload .custom-file-list-default[data-v-ba8bfffc]{margin-top:20px;border:1px solid #dbdbdb;padding:8px 10px;border-radius:4px}.CiUpload .custom-file-list-default.is-readonly[data-v-ba8bfffc]{margin-top:0;border:none;padding:0}.CiUpload .custom-file-list-default .file-item-wrapper[data-v-ba8bfffc]{padding:5px}.CiUpload .custom-file-list-default .file-item-wrapper[data-v-ba8bfffc]:hover{background-color:#f0f2f5}.CiUpload .custom-file-list-default .file-item-wrapper:hover .file-progress-bar[data-v-ba8bfffc]{background-color:#e8e5e5}.CiUpload .custom-file-list-default .file-item-wrapper[data-v-ba8bfffc]:not(:last-child){margin-bottom:8px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top[data-v-ba8bfffc]{display:flex;align-items:center;justify-content:space-between}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .file-name-file-icon[data-v-ba8bfffc]{display:flex;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .file-name-file-icon .file-icon[data-v-ba8bfffc]{width:22px;height:22px;margin-right:5px;align-self:flex-start}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .file-name-file-icon .file-name[data-v-ba8bfffc]{max-width:257px;flex-shrink:0}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .file-name-file-icon .file-name.is-show-file-name-ellipsis-tooltip[data-v-ba8bfffc] .el-link__inner{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right[data-v-ba8bfffc]{display:flex;align-items:center;justify-content:center;height:25px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-size[data-v-ba8bfffc]{color:#a4a4a4;font-size:14px;margin-right:8px;display:inline-flex;height:100%;position:relative;top:.5px;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-operate-btn[data-v-ba8bfffc]{margin-right:8px;height:100%;display:flex;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-operate-btn .el-divider--vertical[data-v-ba8bfffc]{font-size:14px;border-left-color:#191919;position:relative;top:.5px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper[data-v-ba8bfffc]{height:100%;display:flex;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .uploading[data-v-ba8bfffc]{height:100%;display:flex;align-items:center;color:#3573f3;font-size:14px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .uploading .uploading-icon[data-v-ba8bfffc]{width:14px;height:14px;margin-right:4px;animation:rotate 1.5s linear infinite}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .success[data-v-ba8bfffc],.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .downloading[data-v-ba8bfffc]{display:inline-flex;height:100%;justify-content:center;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .success .success-icon[data-v-ba8bfffc],.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .downloading .success-icon[data-v-ba8bfffc]{width:19px;height:19px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .fail.fail-icon-wrapper[data-v-ba8bfffc]{display:flex;align-items:center}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .fail.fail-icon-wrapper .fail-icon[data-v-ba8bfffc]{width:19px;height:19px}.CiUpload .custom-file-list-default .file-item-wrapper .file-item-top .top-right .file-status-icon-wrapper .fail.fail-icon-wrapper .retry-icon[data-v-ba8bfffc]{margin:0 8px;cursor:pointer;width:18px;height:18px}.CiUpload .custom-file-list-default .file-item-wrapper .file-progress-bar[data-v-ba8bfffc]{width:100%;height:5px;background-color:#f0f0f0;border-radius:3px;overflow:hidden;margin-top:5px}.CiUpload .custom-file-list-default .file-item-wrapper .file-progress-bar .file-progress-inner[data-v-ba8bfffc]{height:100%;background-color:#3573f3;transition:width .3s ease}.CiUpload .custom-file-list-default .file-item-wrapper .download-progress-bar .file-progress-inner[data-v-ba8bfffc]{background-color:#2aca96}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import f from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = /* @__PURE__ */ f(o, [["__scopeId", "data-v-ba8bfffc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { ElUpload as se, ElButton as le, ElLink as ae,
|
|
2
|
-
import { defineComponent as re, mergeDefaults as de, useSlots as ue, ref as D, watch as
|
|
1
|
+
import { ElUpload as se, ElButton as le, ElLink as ae, ElTooltip as ie, ElDivider as ne } from "element-plus/es";
|
|
2
|
+
import { defineComponent as re, mergeDefaults as de, useSlots as ue, ref as D, watch as me, createElementBlock as l, openBlock as s, createBlock as b, createCommentVNode as i, mergeProps as pe, unref as c, createSlots as ce, withCtx as u, renderSlot as z, Fragment as f, createElementVNode as a, toDisplayString as y, renderList as U, normalizeProps as fe, guardReactiveProps as ge, normalizeClass as C, createTextVNode as B, createVNode as S, normalizeStyle as R, nextTick as L } from "vue";
|
|
3
3
|
import I from "./icons/icon-upload-btn.svg.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import K from "./icons/icon-upload-btn-hover.svg.js";
|
|
5
|
+
import V from "./icons/icon-upload-btn-disabled.svg.js";
|
|
6
6
|
import ye from "./icons/icon-loading-blue.svg.js";
|
|
7
7
|
import ve from "./icons/icon-upload-success.svg.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { ElMessageBox as he, ElMessage as
|
|
8
|
+
import ke from "./icons/icon-upload-retry.svg.js";
|
|
9
|
+
import we from "./icons/icon-upload-fail.svg.js";
|
|
10
|
+
import { ElMessageBox as he, ElMessage as _ } from "element-plus";
|
|
11
11
|
import { useUpload as be } from "./hooks/useUpload.js";
|
|
12
12
|
import { useUploadRetry as Be } from "./hooks/useUploadRetry.js";
|
|
13
|
-
import { downloadFileWithAxios as
|
|
14
|
-
import { getFileIconByName as
|
|
15
|
-
import { useExposeMethods as
|
|
13
|
+
import { downloadFileWithAxios as Se } from "./utils/file.js";
|
|
14
|
+
import { getFileIconByName as Ce } from "./utils/file-icon-maps.js";
|
|
15
|
+
import { useExposeMethods as _e } from "./expose/index.js";
|
|
16
16
|
import { useCiUploadComputed as ze } from "./computed/index.js";
|
|
17
|
-
import { defaultProps as
|
|
18
|
-
|
|
17
|
+
import { defaultProps as Le } from "./props/index.js";
|
|
18
|
+
import { useFileSize as Ee } from "./hooks/useFileSize.js";
|
|
19
|
+
const Ne = { class: "CiUpload" }, $e = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "tip-slot-textInfo"
|
|
21
|
-
},
|
|
22
|
+
}, De = {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "default-tip-slot-textInfo"
|
|
24
|
-
},
|
|
25
|
+
}, Te = { class: "upload-btn-text" }, Pe = {
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "tip-slot-textInfo"
|
|
27
|
-
},
|
|
28
|
+
}, Ue = {
|
|
28
29
|
key: 1,
|
|
29
30
|
class: "default-tip-slot-textInfo"
|
|
30
|
-
}, Re = { class: "file-item-top" }, Ie = { class: "file-name-file-icon" },
|
|
31
|
+
}, Re = { class: "file-item-top" }, Ie = { class: "file-name-file-icon" }, Ke = ["src"], Ve = { class: "top-right" }, Me = {
|
|
31
32
|
key: 0,
|
|
32
33
|
class: "file-size"
|
|
33
|
-
},
|
|
34
|
+
}, qe = {
|
|
34
35
|
key: 1,
|
|
35
36
|
class: "file-operate-btn"
|
|
36
|
-
},
|
|
37
|
+
}, Ae = { class: "file-status-icon-wrapper" }, He = { class: "uploading-percentage" }, We = ["onClick"], Oe = {
|
|
37
38
|
key: 0,
|
|
38
39
|
class: "file-item-bottom file-progress-bar"
|
|
39
|
-
},
|
|
40
|
+
}, je = {
|
|
40
41
|
key: 0,
|
|
41
42
|
class: "file-item-bottom file-progress-bar download-progress-bar"
|
|
42
|
-
},
|
|
43
|
+
}, Fe = {
|
|
43
44
|
name: "CiUpload"
|
|
44
|
-
},
|
|
45
|
-
...
|
|
45
|
+
}, mt = /* @__PURE__ */ re({
|
|
46
|
+
...Fe,
|
|
46
47
|
props: /* @__PURE__ */ de({
|
|
47
48
|
action: {},
|
|
48
49
|
downloadUrl: {},
|
|
@@ -66,54 +67,60 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
66
67
|
drag: { type: Boolean },
|
|
67
68
|
disabled: { type: Boolean },
|
|
68
69
|
readonly: { type: Boolean },
|
|
69
|
-
axiosInstance: {}
|
|
70
|
-
|
|
70
|
+
axiosInstance: {},
|
|
71
|
+
minSize: {},
|
|
72
|
+
showFileNameEllipsisTooltip: { type: Boolean }
|
|
73
|
+
}, Le),
|
|
71
74
|
emits: ["update:fileList", "onSuccess", "onRemove", "onChange", "onError", "onCustomDownload"],
|
|
72
|
-
setup(M, { expose:
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
checkUploadStatus:
|
|
75
|
+
setup(M, { expose: q, emit: A }) {
|
|
76
|
+
const { formatFileSize: E } = Ee(), H = ue(), T = D(), v = D(!1), k = D([]), { checkUploadStatus: W } = _e(k), n = M, { customHttpRequest: O } = be(n.axiosInstance), d = A;
|
|
77
|
+
q({
|
|
78
|
+
checkUploadStatus: W
|
|
76
79
|
});
|
|
77
|
-
const { retryUpload:
|
|
78
|
-
|
|
79
|
-
() =>
|
|
80
|
+
const { retryUpload: j } = Be(k, d, n);
|
|
81
|
+
me(
|
|
82
|
+
() => n.fileList,
|
|
80
83
|
(e) => {
|
|
81
|
-
|
|
84
|
+
k.value = e.map((t) => ({ ...t }));
|
|
82
85
|
},
|
|
83
86
|
{ immediate: !0 }
|
|
84
87
|
);
|
|
85
|
-
const
|
|
88
|
+
const N = (e) => {
|
|
86
89
|
var t;
|
|
87
|
-
(t =
|
|
88
|
-
},
|
|
89
|
-
if (
|
|
90
|
+
(t = T.value) == null || t.handleRemove(e);
|
|
91
|
+
}, $ = (e) => {
|
|
92
|
+
if (n.customDownload) {
|
|
90
93
|
d("onCustomDownload", e);
|
|
91
94
|
return;
|
|
92
95
|
}
|
|
93
|
-
e.downloadPercentage = 0, e.status = "downloading",
|
|
96
|
+
e.downloadPercentage = 0, e.status = "downloading", Se(
|
|
94
97
|
{
|
|
95
98
|
fileKey: e.fileKey || "当前此条数据没有fileKey字段",
|
|
96
99
|
fileName: e.fileName || "当前此条数据没有fileName字段"
|
|
97
100
|
},
|
|
98
|
-
|
|
101
|
+
n.downloadUrl,
|
|
99
102
|
(t) => {
|
|
100
103
|
e.downloadPercentage = t, t === 100 && (e.status = "success");
|
|
101
104
|
},
|
|
102
105
|
(t) => {
|
|
103
106
|
e.status = "success";
|
|
104
107
|
},
|
|
105
|
-
|
|
108
|
+
n.axiosInstance
|
|
106
109
|
);
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
}, F = (e) => {
|
|
111
|
+
console.log("开始上传文件:", e);
|
|
112
|
+
const t = n.accept.split(",").map((o) => o.trim().toLowerCase()), m = e.type.toLowerCase(), g = e.name.toLowerCase();
|
|
113
|
+
return t.some((o) => m === o || g.endsWith(o)) ? e.size < n.minSize || e.size === 0 ? (e.size === 0 ? _.error("文件大小不能为空") : _.error(`文件大小不能小于 ${E(n.minSize)}`), v.value = !0, L(() => {
|
|
114
|
+
const o = n.fileList.filter((r) => r.uid !== e.uid);
|
|
115
|
+
d("update:fileList", o), v.value = !1;
|
|
116
|
+
}), !1) : e.size <= n.maxSize ? !0 : (_.error(`文件大小超出限制,最大文件大小为${E(n.maxSize)}`), v.value = !0, L(() => {
|
|
117
|
+
const o = n.fileList.filter((r) => r.uid !== e.uid);
|
|
118
|
+
d("update:fileList", o), v.value = !1;
|
|
119
|
+
}), !1) : (_.error("不支持上传该类型文件"), v.value = !0, L(() => {
|
|
120
|
+
const o = n.fileList.filter((r) => r.uid !== e.uid);
|
|
121
|
+
d("update:fileList", o), v.value = !1;
|
|
115
122
|
}), !1);
|
|
116
|
-
},
|
|
123
|
+
}, G = (e, t) => v.value ? !0 : he.confirm(
|
|
117
124
|
`确定删除 ${e.fileName || e.name} 文件?`,
|
|
118
125
|
"确定删除",
|
|
119
126
|
{
|
|
@@ -126,52 +133,52 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
126
133
|
// 用户点击“确定”按钮,允许删除
|
|
127
134
|
() => !1
|
|
128
135
|
// 用户点击“取消”按钮,取消删除
|
|
129
|
-
),
|
|
130
|
-
|
|
131
|
-
},
|
|
136
|
+
), J = (e, t) => {
|
|
137
|
+
_.error(`文件数量超出限制,最大文件数量为${n.limit}个`);
|
|
138
|
+
}, Q = (e, t, m) => {
|
|
132
139
|
t.status = "fail", t.percentage = 0, L(() => {
|
|
133
|
-
d("update:fileList", [...
|
|
140
|
+
d("update:fileList", [...m, t]), d("onError", t, m);
|
|
134
141
|
});
|
|
135
|
-
},
|
|
136
|
-
var p,
|
|
142
|
+
}, X = (e, t, m) => {
|
|
143
|
+
var p, w, h;
|
|
137
144
|
if (!e) return;
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
}, X = (e, t) => {
|
|
141
|
-
e.status === "success" && !e.response || (d("update:fileList", t), d("onChange", e, t));
|
|
145
|
+
const g = m.find((o) => o.uid === t.uid);
|
|
146
|
+
g && (g.fileName = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.fileName) || t.name, g.fileKey = ((w = e == null ? void 0 : e.data) == null ? void 0 : w.fileKey) || "当前接口没有返回fileKey字段", g.fileSize = ((h = e == null ? void 0 : e.data) == null ? void 0 : h.fileSize) || t.size), d("update:fileList", m), d("onSuccess", t, m);
|
|
142
147
|
}, Y = (e, t) => {
|
|
148
|
+
e.status === "success" && !e.response || (d("update:fileList", t), d("onChange", e, t));
|
|
149
|
+
}, Z = (e, t) => {
|
|
143
150
|
d("update:fileList", t), d("onRemove", e, t);
|
|
144
|
-
}, { hasRealDefaultSlot:
|
|
151
|
+
}, { hasRealDefaultSlot: x, finalBeforeUpload: ee, defaultTipSlotTextInfo: P, otherSlots: te } = ze(n, H, F);
|
|
145
152
|
return (e, t) => {
|
|
146
|
-
const
|
|
147
|
-
return s(), l("div",
|
|
148
|
-
e.readonly ?
|
|
153
|
+
const m = le, g = se, p = ae, w = ie, h = ne;
|
|
154
|
+
return s(), l("div", Ne, [
|
|
155
|
+
e.readonly ? i("", !0) : (s(), b(g, pe({
|
|
149
156
|
key: 0,
|
|
150
157
|
class: ["ci-el-upload-component", { "is-disabled": e.disabled }],
|
|
151
158
|
ref_key: "uploadRef",
|
|
152
|
-
ref:
|
|
159
|
+
ref: T,
|
|
153
160
|
action: e.action,
|
|
154
161
|
data: e.data,
|
|
155
162
|
headers: e.headers,
|
|
156
|
-
"file-list":
|
|
163
|
+
"file-list": k.value,
|
|
157
164
|
accept: e.accept,
|
|
158
165
|
limit: e.limit,
|
|
159
166
|
multiple: e.multiple,
|
|
160
167
|
drag: e.drag,
|
|
161
168
|
disabled: e.disabled,
|
|
162
|
-
"before-upload":
|
|
163
|
-
"before-remove":
|
|
164
|
-
"on-success":
|
|
165
|
-
"on-change":
|
|
166
|
-
"on-remove":
|
|
167
|
-
"on-exceed":
|
|
168
|
-
"on-error":
|
|
169
|
-
"http-request":
|
|
169
|
+
"before-upload": c(ee),
|
|
170
|
+
"before-remove": G,
|
|
171
|
+
"on-success": X,
|
|
172
|
+
"on-change": Y,
|
|
173
|
+
"on-remove": Z,
|
|
174
|
+
"on-exceed": J,
|
|
175
|
+
"on-error": Q,
|
|
176
|
+
"http-request": c(O),
|
|
170
177
|
"show-file-list": !1
|
|
171
|
-
}, e.$attrs),
|
|
172
|
-
default:
|
|
173
|
-
|
|
174
|
-
e.drag ? (s(), l(
|
|
178
|
+
}, e.$attrs), ce({
|
|
179
|
+
default: u(() => [
|
|
180
|
+
c(x) ? z(e.$slots, "default", { key: 0 }, void 0, !0) : (s(), l(f, { key: 1 }, [
|
|
181
|
+
e.drag ? (s(), l(f, { key: 0 }, [
|
|
175
182
|
t[0] || (t[0] = a("img", {
|
|
176
183
|
class: "upload-btn-icon",
|
|
177
184
|
src: I,
|
|
@@ -179,12 +186,12 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
179
186
|
}, null, -1)),
|
|
180
187
|
t[1] || (t[1] = a("img", {
|
|
181
188
|
class: "upload-btn-icon-hover",
|
|
182
|
-
src:
|
|
189
|
+
src: K,
|
|
183
190
|
alt: ""
|
|
184
191
|
}, null, -1)),
|
|
185
192
|
t[2] || (t[2] = a("img", {
|
|
186
193
|
class: "upload-btn-icon-disabled",
|
|
187
|
-
src:
|
|
194
|
+
src: V,
|
|
188
195
|
alt: ""
|
|
189
196
|
}, null, -1)),
|
|
190
197
|
t[3] || (t[3] = a("div", { class: "drag-text-info" }, [
|
|
@@ -192,14 +199,14 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
192
199
|
a("span", { class: "drag-text-info-black" }, "或将文件拖拽到这里上传")
|
|
193
200
|
], -1)),
|
|
194
201
|
e.$slots.tip ? (s(), l("div", $e, [
|
|
195
|
-
|
|
196
|
-
])) : (s(), l("div",
|
|
197
|
-
], 64)) : (s(),
|
|
202
|
+
z(e.$slots, "tip", {}, void 0, !0)
|
|
203
|
+
])) : (s(), l("div", De, y(c(P)), 1))
|
|
204
|
+
], 64)) : (s(), b(m, {
|
|
198
205
|
key: 1,
|
|
199
206
|
class: "upload-btn",
|
|
200
207
|
disabled: e.disabled
|
|
201
208
|
}, {
|
|
202
|
-
default:
|
|
209
|
+
default: u(() => [
|
|
203
210
|
t[4] || (t[4] = a("img", {
|
|
204
211
|
class: "upload-btn-icon",
|
|
205
212
|
src: I,
|
|
@@ -207,15 +214,15 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
207
214
|
}, null, -1)),
|
|
208
215
|
t[5] || (t[5] = a("img", {
|
|
209
216
|
class: "upload-btn-icon-hover",
|
|
210
|
-
src:
|
|
217
|
+
src: K,
|
|
211
218
|
alt: ""
|
|
212
219
|
}, null, -1)),
|
|
213
220
|
t[6] || (t[6] = a("img", {
|
|
214
221
|
class: "upload-btn-icon-disabled",
|
|
215
|
-
src:
|
|
222
|
+
src: V,
|
|
216
223
|
alt: ""
|
|
217
224
|
}, null, -1)),
|
|
218
|
-
a("span",
|
|
225
|
+
a("span", Te, y(e.uploadBtnText), 1)
|
|
219
226
|
]),
|
|
220
227
|
_: 1,
|
|
221
228
|
__: [4, 5, 6]
|
|
@@ -226,25 +233,25 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
226
233
|
}, [
|
|
227
234
|
e.drag ? void 0 : {
|
|
228
235
|
name: "tip",
|
|
229
|
-
fn:
|
|
230
|
-
e.$slots.tip ? (s(), l("div",
|
|
231
|
-
|
|
232
|
-
])) : (s(), l("div",
|
|
236
|
+
fn: u(() => [
|
|
237
|
+
e.$slots.tip ? (s(), l("div", Pe, [
|
|
238
|
+
z(e.$slots, "tip", {}, void 0, !0)
|
|
239
|
+
])) : (s(), l("div", Ue, y(c(P)), 1))
|
|
233
240
|
]),
|
|
234
241
|
key: "0"
|
|
235
242
|
},
|
|
236
|
-
|
|
237
|
-
name:
|
|
238
|
-
fn:
|
|
239
|
-
|
|
243
|
+
U(c(te), (o, r) => ({
|
|
244
|
+
name: r,
|
|
245
|
+
fn: u((oe) => [
|
|
246
|
+
z(e.$slots, r, fe(ge(oe || {})), void 0, !0)
|
|
240
247
|
])
|
|
241
248
|
}))
|
|
242
249
|
]), 1040, ["class", "action", "data", "headers", "file-list", "accept", "limit", "multiple", "drag", "disabled", "before-upload", "http-request"])),
|
|
243
|
-
|
|
250
|
+
k.value.length ? (s(), l("div", {
|
|
244
251
|
key: 1,
|
|
245
|
-
class:
|
|
252
|
+
class: C(["custom-file-list-default", { "is-readonly": e.readonly }])
|
|
246
253
|
}, [
|
|
247
|
-
(s(!0), l(
|
|
254
|
+
(s(!0), l(f, null, U(k.value, (o) => (s(), l("div", {
|
|
248
255
|
class: "file-item-wrapper",
|
|
249
256
|
key: o.uid
|
|
250
257
|
}, [
|
|
@@ -253,141 +260,161 @@ const Le = { class: "CiUpload" }, $e = {
|
|
|
253
260
|
e.showFileExtIcon ? (s(), l("img", {
|
|
254
261
|
key: 0,
|
|
255
262
|
class: "file-icon",
|
|
256
|
-
src:
|
|
257
|
-
}, null, 8,
|
|
258
|
-
|
|
263
|
+
src: c(Ce)(o.fileName || o.name)
|
|
264
|
+
}, null, 8, Ke)) : i("", !0),
|
|
265
|
+
e.showFileNameEllipsisTooltip ? (s(), b(w, {
|
|
266
|
+
key: 2,
|
|
267
|
+
effect: "dark",
|
|
268
|
+
content: o.fileName || o.name,
|
|
269
|
+
placement: "right"
|
|
270
|
+
}, {
|
|
271
|
+
default: u(() => [
|
|
272
|
+
S(p, {
|
|
273
|
+
class: C(["top-left file-name", { "is-show-file-name-ellipsis-tooltip": e.showFileNameEllipsisTooltip }]),
|
|
274
|
+
disabled: o.status === "downloading" || o.status === "uploading",
|
|
275
|
+
onClick: (r) => $(o)
|
|
276
|
+
}, {
|
|
277
|
+
default: u(() => [
|
|
278
|
+
B(y(o.fileName || o.name), 1)
|
|
279
|
+
]),
|
|
280
|
+
_: 2
|
|
281
|
+
}, 1032, ["class", "disabled", "onClick"])
|
|
282
|
+
]),
|
|
283
|
+
_: 2
|
|
284
|
+
}, 1032, ["content"])) : (s(), b(p, {
|
|
285
|
+
key: 1,
|
|
259
286
|
class: "top-left file-name",
|
|
260
287
|
disabled: o.status === "downloading" || o.status === "uploading",
|
|
261
|
-
onClick: (
|
|
288
|
+
onClick: (r) => $(o)
|
|
262
289
|
}, {
|
|
263
|
-
default:
|
|
264
|
-
B(
|
|
290
|
+
default: u(() => [
|
|
291
|
+
B(y(o.fileName || o.name), 1)
|
|
265
292
|
]),
|
|
266
293
|
_: 2
|
|
267
|
-
}, 1032, ["disabled", "onClick"])
|
|
294
|
+
}, 1032, ["disabled", "onClick"]))
|
|
268
295
|
]),
|
|
269
|
-
a("div",
|
|
270
|
-
e.showFileSize ? (s(), l("span", Me,
|
|
271
|
-
o.status !== "fail" ? (s(), l("div",
|
|
272
|
-
o.status !== "uploading" ? (s(), l(
|
|
273
|
-
e.showPreviewBtn ? (s(), l(
|
|
274
|
-
|
|
275
|
-
onClick: (
|
|
296
|
+
a("div", Ve, [
|
|
297
|
+
e.showFileSize ? (s(), l("span", Me, y(c(E)(o.fileSize || o.size)), 1)) : i("", !0),
|
|
298
|
+
o.status !== "fail" ? (s(), l("div", qe, [
|
|
299
|
+
o.status !== "uploading" ? (s(), l(f, { key: 0 }, [
|
|
300
|
+
e.showPreviewBtn ? (s(), l(f, { key: 0 }, [
|
|
301
|
+
S(p, {
|
|
302
|
+
onClick: (r) => N(o)
|
|
276
303
|
}, {
|
|
277
|
-
default:
|
|
304
|
+
default: u(() => t[7] || (t[7] = [
|
|
278
305
|
B(" 在线预览 ")
|
|
279
306
|
])),
|
|
280
307
|
_: 2,
|
|
281
308
|
__: [7]
|
|
282
309
|
}, 1032, ["onClick"]),
|
|
283
|
-
h
|
|
284
|
-
], 64)) :
|
|
285
|
-
e.showDownloadBtn ? (s(), l(
|
|
286
|
-
|
|
310
|
+
S(h, { direction: "vertical" })
|
|
311
|
+
], 64)) : i("", !0),
|
|
312
|
+
e.showDownloadBtn ? (s(), l(f, { key: 1 }, [
|
|
313
|
+
S(p, {
|
|
287
314
|
disabled: o.status === "downloading",
|
|
288
|
-
onClick: (
|
|
315
|
+
onClick: (r) => $(o)
|
|
289
316
|
}, {
|
|
290
|
-
default:
|
|
291
|
-
B(
|
|
317
|
+
default: u(() => [
|
|
318
|
+
B(y(o.status === "downloading" && e.showDownloadProgress && e.customDownload ? `下载中...${o.downloadPercentage || 0}%` : "下载"), 1)
|
|
292
319
|
]),
|
|
293
320
|
_: 2
|
|
294
321
|
}, 1032, ["disabled", "onClick"]),
|
|
295
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
322
|
+
e.showDeleteBtn && !e.readonly ? (s(), b(h, {
|
|
296
323
|
key: 0,
|
|
297
324
|
direction: "vertical"
|
|
298
|
-
})) :
|
|
299
|
-
], 64)) :
|
|
300
|
-
e.showDeleteBtn && !e.readonly ? (s(),
|
|
325
|
+
})) : i("", !0)
|
|
326
|
+
], 64)) : i("", !0),
|
|
327
|
+
e.showDeleteBtn && !e.readonly ? (s(), b(p, {
|
|
301
328
|
key: 2,
|
|
302
|
-
onClick: (
|
|
329
|
+
onClick: (r) => N(o)
|
|
303
330
|
}, {
|
|
304
|
-
default:
|
|
331
|
+
default: u(() => t[8] || (t[8] = [
|
|
305
332
|
B("删除")
|
|
306
333
|
])),
|
|
307
334
|
_: 2,
|
|
308
335
|
__: [8]
|
|
309
|
-
}, 1032, ["onClick"])) :
|
|
310
|
-
], 64)) :
|
|
311
|
-
])) :
|
|
312
|
-
a("div",
|
|
336
|
+
}, 1032, ["onClick"])) : i("", !0)
|
|
337
|
+
], 64)) : i("", !0)
|
|
338
|
+
])) : i("", !0),
|
|
339
|
+
a("div", Ae, [
|
|
313
340
|
o.status === "uploading" ? (s(), l("div", {
|
|
314
341
|
key: 0,
|
|
315
|
-
class:
|
|
342
|
+
class: C(o.status)
|
|
316
343
|
}, [
|
|
317
344
|
t[9] || (t[9] = a("img", {
|
|
318
345
|
class: "uploading-icon",
|
|
319
346
|
src: ye
|
|
320
347
|
}, null, -1)),
|
|
321
|
-
a("span",
|
|
322
|
-
], 2)) :
|
|
323
|
-
e.readonly ?
|
|
348
|
+
a("span", He, y(o.percentage) + "%", 1)
|
|
349
|
+
], 2)) : i("", !0),
|
|
350
|
+
e.readonly ? i("", !0) : (s(), l(f, { key: 1 }, [
|
|
324
351
|
o.status === "success" || o.status === "downloading" ? (s(), l("span", {
|
|
325
352
|
key: 0,
|
|
326
|
-
class:
|
|
353
|
+
class: C(o.status)
|
|
327
354
|
}, t[10] || (t[10] = [
|
|
328
355
|
a("img", {
|
|
329
356
|
class: "success-icon",
|
|
330
357
|
src: ve
|
|
331
358
|
}, null, -1)
|
|
332
|
-
]), 2)) :
|
|
359
|
+
]), 2)) : i("", !0)
|
|
333
360
|
], 64)),
|
|
334
361
|
o.status === "fail" ? (s(), l("div", {
|
|
335
362
|
key: 2,
|
|
336
|
-
class:
|
|
363
|
+
class: C(["fail-icon-wrapper", o.status])
|
|
337
364
|
}, [
|
|
338
|
-
|
|
339
|
-
onClick: (
|
|
365
|
+
S(p, {
|
|
366
|
+
onClick: (r) => N(o)
|
|
340
367
|
}, {
|
|
341
|
-
default:
|
|
368
|
+
default: u(() => t[11] || (t[11] = [
|
|
342
369
|
B(" 删除 ")
|
|
343
370
|
])),
|
|
344
371
|
_: 2,
|
|
345
372
|
__: [11]
|
|
346
373
|
}, 1032, ["onClick"]),
|
|
347
|
-
|
|
374
|
+
S(w, {
|
|
348
375
|
effect: "dark",
|
|
349
376
|
content: "点击重新上传",
|
|
350
377
|
placement: "bottom"
|
|
351
378
|
}, {
|
|
352
|
-
default:
|
|
379
|
+
default: u(() => [
|
|
353
380
|
a("img", {
|
|
354
381
|
class: "retry-icon",
|
|
355
|
-
src:
|
|
356
|
-
onClick: (
|
|
357
|
-
}, null, 8,
|
|
382
|
+
src: ke,
|
|
383
|
+
onClick: (r) => c(j)(o)
|
|
384
|
+
}, null, 8, We)
|
|
358
385
|
]),
|
|
359
386
|
_: 2
|
|
360
387
|
}, 1024),
|
|
361
388
|
t[12] || (t[12] = a("img", {
|
|
362
389
|
class: "fail-icon",
|
|
363
|
-
src:
|
|
390
|
+
src: we
|
|
364
391
|
}, null, -1))
|
|
365
|
-
], 2)) :
|
|
392
|
+
], 2)) : i("", !0)
|
|
366
393
|
])
|
|
367
394
|
])
|
|
368
395
|
]),
|
|
369
|
-
e.showUploadProgress ? (s(), l(
|
|
370
|
-
o.status === "uploading" ? (s(), l("div",
|
|
396
|
+
e.showUploadProgress ? (s(), l(f, { key: 0 }, [
|
|
397
|
+
o.status === "uploading" ? (s(), l("div", Oe, [
|
|
371
398
|
a("div", {
|
|
372
399
|
class: "file-progress-inner",
|
|
373
400
|
style: R({ width: (o.percentage || 0) + "%" })
|
|
374
401
|
}, null, 4)
|
|
375
|
-
])) :
|
|
376
|
-
], 64)) :
|
|
377
|
-
e.showDownloadProgress ? (s(), l(
|
|
378
|
-
o.status === "downloading" ? (s(), l("div",
|
|
402
|
+
])) : i("", !0)
|
|
403
|
+
], 64)) : i("", !0),
|
|
404
|
+
e.showDownloadProgress ? (s(), l(f, { key: 1 }, [
|
|
405
|
+
o.status === "downloading" ? (s(), l("div", je, [
|
|
379
406
|
a("div", {
|
|
380
407
|
class: "file-progress-inner",
|
|
381
408
|
style: R({ width: (o.downloadPercentage || 0) + "%" })
|
|
382
409
|
}, null, 4)
|
|
383
|
-
])) :
|
|
384
|
-
], 64)) :
|
|
410
|
+
])) : i("", !0)
|
|
411
|
+
], 64)) : i("", !0)
|
|
385
412
|
]))), 128))
|
|
386
|
-
], 2)) :
|
|
413
|
+
], 2)) : i("", !0)
|
|
387
414
|
]);
|
|
388
415
|
};
|
|
389
416
|
}
|
|
390
417
|
});
|
|
391
418
|
export {
|
|
392
|
-
|
|
419
|
+
mt as default
|
|
393
420
|
};
|