@web-utils/component 2.0.10 → 2.0.11
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/chunks/3d28cc08.js +57 -0
- package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
- package/dist/chunks/5d33812d.js +147 -0
- package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
- package/dist/chunks/9d848bf6.js +99 -0
- package/dist/chunks/a0bb327b.js +96 -0
- package/dist/chunks/a8891d2c.js +30 -0
- package/dist/chunks/c69d5628.js +248 -0
- package/dist/chunks/de9fe802.js +24 -0
- package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
- package/dist/components/address-input/index.js +56 -43
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/aside-menu/index.js +36 -30
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/awesome-button/index.js +35 -32
- package/dist/components/base.css +66 -1
- package/dist/components/capsule-tab/index.js +33 -27
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/chunk-file-uploader/index.js +88 -54
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +31 -25
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +42 -28
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +212 -134
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +34 -28
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +35 -29
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +181 -153
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +68 -49
- package/dist/components/confirm-button/index.js +21 -19
- package/dist/components/confirmable/index.js +19 -18
- package/dist/components/context-menu/index.js +130 -108
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/custom-scrollbar/index.js +67 -49
- package/dist/components/data-table-picker/index.js +81 -62
- package/dist/components/dynamic-table/index.js +113 -89
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +201 -120
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/editable-progress/index.js +93 -60
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +638 -423
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +46 -33
- package/dist/components/egd-collapse-item/index.js +76 -60
- package/dist/components/element-dialog/index.js +147 -95
- package/dist/components/element-dialog/style.css +102 -1
- package/dist/components/empty-view/index.js +34 -28
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +32 -26
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +40 -25
- package/dist/components/flex-item/index.js +57 -29
- package/dist/components/flex-row/index.js +40 -25
- package/dist/components/flex-scroller/index.js +32 -26
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/form-button/index.js +38 -34
- package/dist/components/form-cascader/index.js +81 -71
- package/dist/components/form-checkbox-group/index.js +113 -88
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +132 -70
- package/dist/components/form-holder/index.js +39 -32
- package/dist/components/form-input/index.js +62 -56
- package/dist/components/form-input-email/index.js +60 -48
- package/dist/components/form-input-id-card/index.js +59 -53
- package/dist/components/form-input-number/index.js +68 -61
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +55 -49
- package/dist/components/form-input-time/index.js +59 -53
- package/dist/components/form-item/index.js +123 -80
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +26 -25
- package/dist/components/form-item-group/index.js +111 -85
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +104 -85
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +91 -76
- package/dist/components/form-switch/index.js +57 -51
- package/dist/components/form-textarea/index.js +57 -51
- package/dist/components/form-view/index.js +232 -165
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/guide-steps/index.js +58 -44
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/icon-card/index.js +35 -29
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/iframe-window/index.js +35 -29
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-viewer/index.js +66 -48
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +193 -127
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +57 -45
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +120 -73
- package/dist/components/loading-view/index.js +32 -26
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/nav-bar/index.js +37 -27
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +31 -23
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/page/index.js +28 -22
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +36 -30
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +83 -62
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +68 -53
- package/dist/components/page-skeleton/index.js +37 -31
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +48 -42
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +253 -186
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +199 -129
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +151 -110
- package/dist/components/photo-swipe/style.css +20 -1
- package/dist/components/resize-observer/index.js +68 -34
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search-popover/index.js +211 -153
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign-panel/index.js +142 -92
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/split-pane/index.js +162 -101
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +34 -31
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +44 -37
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +150 -85
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +72 -54
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +35 -30
- package/dist/components/table-column/index.js +32 -30
- package/dist/components/table-view/index.js +227 -156
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +58 -44
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/tinymce-editor/index.js +95 -79
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +121 -92
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +84 -63
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +48 -41
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +36 -29
- package/dist/components/vue-tags-input/index.js +308 -188
- package/dist/components/vue-tags-input/style.css +682 -1
- package/dist/components/watermark/index.js +37 -25
- package/dist/components/watermark/style.css +11 -1
- package/dist/components/x-dialog/index.js +93 -67
- package/dist/components/x-dialog/style.css +15 -1
- package/dist/index.css +1105 -193
- package/dist/index.es.js +7242 -4789
- package/package.json +1 -1
- package/web-types.json +1 -1
- package/dist/chunks/3a79781b.js +0 -75
- package/dist/chunks/5d4282fb.js +0 -30
- package/dist/chunks/76680a03.js +0 -24
- package/dist/chunks/8c0142e0.js +0 -81
- package/dist/chunks/97652d86.js +0 -26
- package/dist/chunks/b4acd3a6.js +0 -126
- package/dist/chunks/f71045fc.js +0 -184
|
@@ -1,104 +1,109 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { s as
|
|
3
|
-
import { n as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import Uploader from "simple-uploader.js";
|
|
2
|
+
import { s as secondsToStr } from "../../chunks/a8891d2c.js";
|
|
3
|
+
import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
|
|
4
|
+
const events = ["fileProgress", "fileSuccess", "fileComplete", "fileError"];
|
|
5
|
+
const events$1 = events;
|
|
6
|
+
var render = function() {
|
|
7
|
+
var _vm = this;
|
|
8
|
+
var _h = _vm.$createElement;
|
|
9
|
+
var _c = _vm._self._c || _h;
|
|
10
|
+
return _c("div", {
|
|
8
11
|
staticClass: "chunk-file-uploader-file",
|
|
9
12
|
attrs: {
|
|
10
|
-
status:
|
|
13
|
+
"status": _vm.status
|
|
11
14
|
}
|
|
12
|
-
}, [
|
|
13
|
-
return [
|
|
15
|
+
}, [_vm._t("default", function() {
|
|
16
|
+
return [_c("div", {
|
|
14
17
|
staticClass: "chunk-file-uploader-file-info"
|
|
15
|
-
}, [
|
|
18
|
+
}, [_c("div", {
|
|
16
19
|
staticClass: "chunk-file-uploader-file-name",
|
|
17
20
|
attrs: {
|
|
18
|
-
title:
|
|
21
|
+
"title": _vm.file.name
|
|
19
22
|
}
|
|
20
|
-
}, [
|
|
23
|
+
}, [_c("i", {
|
|
21
24
|
staticClass: "chunk-file-uploader-file-icon",
|
|
22
25
|
attrs: {
|
|
23
|
-
icon:
|
|
26
|
+
"icon": _vm.fileCategory
|
|
24
27
|
}
|
|
25
|
-
}),
|
|
28
|
+
}), _vm._v(_vm._s(_vm.file.name) + " ")]), _c("div", {
|
|
26
29
|
staticClass: "chunk-file-uploader-file-size"
|
|
27
|
-
}, [
|
|
30
|
+
}, [_vm._v(" " + _vm._s(_vm.formatedSize) + " ")]), _c("div", {
|
|
28
31
|
staticClass: "chunk-file-uploader-file-status"
|
|
29
|
-
}, [
|
|
32
|
+
}, [_c("span", {
|
|
30
33
|
directives: [{
|
|
31
34
|
name: "show",
|
|
32
35
|
rawName: "v-show",
|
|
33
|
-
value: !["uploading", "md5"].includes(
|
|
36
|
+
value: !["uploading", "md5"].includes(_vm.status),
|
|
34
37
|
expression: "!['uploading', 'md5'].includes(status)"
|
|
35
38
|
}]
|
|
36
|
-
}, [
|
|
39
|
+
}, [_vm._v(_vm._s(_vm.statusText))]), _c("span", {
|
|
37
40
|
directives: [{
|
|
38
41
|
name: "show",
|
|
39
42
|
rawName: "v-show",
|
|
40
|
-
value:
|
|
43
|
+
value: _vm.status === "md5",
|
|
41
44
|
expression: "status === 'md5'"
|
|
42
45
|
}]
|
|
43
|
-
}, [
|
|
46
|
+
}, [_vm._v(_vm._s(_vm.file.md5Progress))]), _c("span", {
|
|
44
47
|
directives: [{
|
|
45
48
|
name: "show",
|
|
46
49
|
rawName: "v-show",
|
|
47
|
-
value:
|
|
50
|
+
value: _vm.status === "uploading",
|
|
48
51
|
expression: "status === 'uploading'"
|
|
49
52
|
}],
|
|
50
53
|
staticStyle: {
|
|
51
54
|
"padding-left": "4px"
|
|
52
55
|
}
|
|
53
|
-
}, [
|
|
56
|
+
}, [_c("span", [_vm._v(_vm._s(_vm.progressStyle.progress))]), _vm._v(" | "), _c("em", [_vm._v(_vm._s(_vm.formatedAverageSpeed))]), _vm._v(" | "), _c("i", [_vm._v(_vm._s(_vm.formatedTimeRemaining))])])]), _c("div", {
|
|
54
57
|
staticClass: "chunk-file-uploader-file-actions"
|
|
55
|
-
}, [
|
|
58
|
+
}, [_c("span", {
|
|
56
59
|
staticClass: "chunk-file-uploader-file-pause",
|
|
57
60
|
on: {
|
|
58
|
-
click:
|
|
61
|
+
"click": _vm.pause
|
|
59
62
|
}
|
|
60
|
-
}),
|
|
63
|
+
}), _c("span", {
|
|
61
64
|
staticClass: "chunk-file-uploader-file-resume",
|
|
62
65
|
on: {
|
|
63
|
-
click:
|
|
66
|
+
"click": _vm.resume
|
|
64
67
|
}
|
|
65
|
-
}, [
|
|
68
|
+
}, [_vm._v("️")]), _c("span", {
|
|
66
69
|
staticClass: "chunk-file-uploader-file-retry",
|
|
67
70
|
on: {
|
|
68
|
-
click:
|
|
71
|
+
"click": _vm.retry
|
|
69
72
|
}
|
|
70
|
-
}),
|
|
73
|
+
}), _c("span", {
|
|
71
74
|
staticClass: "chunk-file-uploader-file-remove",
|
|
72
75
|
on: {
|
|
73
|
-
click:
|
|
76
|
+
"click": _vm.remove
|
|
74
77
|
}
|
|
75
78
|
})])])];
|
|
76
79
|
}, {
|
|
77
|
-
file:
|
|
78
|
-
list:
|
|
79
|
-
status:
|
|
80
|
-
paused:
|
|
81
|
-
error:
|
|
82
|
-
response:
|
|
83
|
-
averageSpeed:
|
|
84
|
-
formatedAverageSpeed:
|
|
85
|
-
currentSpeed:
|
|
86
|
-
isComplete:
|
|
87
|
-
isUploading:
|
|
88
|
-
size:
|
|
89
|
-
formatedSize:
|
|
90
|
-
uploadedSize:
|
|
91
|
-
progress:
|
|
92
|
-
progressStyle:
|
|
93
|
-
progressingClass:
|
|
94
|
-
timeRemaining:
|
|
95
|
-
formatedTimeRemaining:
|
|
96
|
-
type:
|
|
97
|
-
extension:
|
|
98
|
-
fileCategory:
|
|
80
|
+
"file": _vm.file,
|
|
81
|
+
"list": _vm.list,
|
|
82
|
+
"status": _vm.status,
|
|
83
|
+
"paused": _vm.paused,
|
|
84
|
+
"error": _vm.error,
|
|
85
|
+
"response": _vm.response,
|
|
86
|
+
"averageSpeed": _vm.averageSpeed,
|
|
87
|
+
"formatedAverageSpeed": _vm.formatedAverageSpeed,
|
|
88
|
+
"currentSpeed": _vm.currentSpeed,
|
|
89
|
+
"isComplete": _vm.isComplete,
|
|
90
|
+
"isUploading": _vm.isUploading,
|
|
91
|
+
"size": _vm.size,
|
|
92
|
+
"formatedSize": _vm.formatedSize,
|
|
93
|
+
"uploadedSize": _vm.uploadedSize,
|
|
94
|
+
"progress": _vm.progress,
|
|
95
|
+
"progressStyle": _vm.progressStyle,
|
|
96
|
+
"progressingClass": _vm.progressingClass,
|
|
97
|
+
"timeRemaining": _vm.timeRemaining,
|
|
98
|
+
"formatedTimeRemaining": _vm.formatedTimeRemaining,
|
|
99
|
+
"type": _vm.type,
|
|
100
|
+
"extension": _vm.extension,
|
|
101
|
+
"fileCategory": _vm.fileCategory
|
|
99
102
|
})], 2);
|
|
100
|
-
}
|
|
101
|
-
|
|
103
|
+
};
|
|
104
|
+
var staticRenderFns = [];
|
|
105
|
+
const ChunkFileUploaderFile_vue_vue_type_style_index_0_lang = "";
|
|
106
|
+
const __vue2_script = {
|
|
102
107
|
name: "ChunkFileUploaderFile",
|
|
103
108
|
props: {
|
|
104
109
|
file: {
|
|
@@ -109,18 +114,18 @@ const h = {
|
|
|
109
114
|
},
|
|
110
115
|
list: {
|
|
111
116
|
type: Boolean,
|
|
112
|
-
default:
|
|
117
|
+
default: false
|
|
113
118
|
}
|
|
114
119
|
},
|
|
115
120
|
data() {
|
|
116
121
|
return {
|
|
117
122
|
response: null,
|
|
118
|
-
paused:
|
|
119
|
-
error:
|
|
123
|
+
paused: false,
|
|
124
|
+
error: false,
|
|
120
125
|
averageSpeed: 0,
|
|
121
126
|
currentSpeed: 0,
|
|
122
|
-
isComplete:
|
|
123
|
-
isUploading:
|
|
127
|
+
isComplete: false,
|
|
128
|
+
isUploading: false,
|
|
124
129
|
size: 0,
|
|
125
130
|
formatedSize: "",
|
|
126
131
|
uploadedSize: 0,
|
|
@@ -133,9 +138,11 @@ const h = {
|
|
|
133
138
|
},
|
|
134
139
|
computed: {
|
|
135
140
|
fileCategory() {
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
const extension = this.extension;
|
|
142
|
+
const isFolder = this.file.isFolder;
|
|
143
|
+
let type = isFolder ? "folder" : "unknown";
|
|
144
|
+
const categoryMap = this.file.uploader.opts.categoryMap;
|
|
145
|
+
const typeMap = categoryMap || {
|
|
139
146
|
image: ["gif", "jpg", "jpeg", "png", "bmp", "webp"],
|
|
140
147
|
video: ["mp4", "m3u8", "rmvb", "avi", "swf", "3gp", "mkv", "flv"],
|
|
141
148
|
audio: ["mp3", "wav", "wma", "ogg", "aac", "flac"],
|
|
@@ -155,50 +162,85 @@ const h = {
|
|
|
155
162
|
"pptx"
|
|
156
163
|
]
|
|
157
164
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
Object.keys(typeMap).forEach((_type) => {
|
|
166
|
+
const extensions = typeMap[_type];
|
|
167
|
+
if (extensions.indexOf(extension) > -1) {
|
|
168
|
+
type = _type;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
return type;
|
|
161
172
|
},
|
|
162
173
|
progressStyle() {
|
|
163
|
-
const
|
|
174
|
+
const progress = Math.floor(this.progress * 100);
|
|
175
|
+
const style = `translateX(${Math.floor(progress - 100)}%)`;
|
|
164
176
|
return {
|
|
165
|
-
progress: `${
|
|
166
|
-
webkitTransform:
|
|
167
|
-
mozTransform:
|
|
168
|
-
msTransform:
|
|
169
|
-
transform:
|
|
177
|
+
progress: `${progress}%`,
|
|
178
|
+
webkitTransform: style,
|
|
179
|
+
mozTransform: style,
|
|
180
|
+
msTransform: style,
|
|
181
|
+
transform: style
|
|
170
182
|
};
|
|
171
183
|
},
|
|
172
184
|
formatedAverageSpeed() {
|
|
173
|
-
return `${
|
|
185
|
+
return `${Uploader.utils.formatSize(this.averageSpeed)} / s`;
|
|
174
186
|
},
|
|
175
187
|
status() {
|
|
176
|
-
const { isUploading
|
|
177
|
-
|
|
188
|
+
const { isUploading, isComplete, isError, paused } = this;
|
|
189
|
+
const { md5Computing } = this.file;
|
|
190
|
+
if (md5Computing) {
|
|
191
|
+
return "md5";
|
|
192
|
+
} else if (isComplete) {
|
|
193
|
+
return "success";
|
|
194
|
+
} else if (isError) {
|
|
195
|
+
return "error";
|
|
196
|
+
} else if (isUploading) {
|
|
197
|
+
return "uploading";
|
|
198
|
+
} else if (paused) {
|
|
199
|
+
return "paused";
|
|
200
|
+
} else {
|
|
201
|
+
return "waiting";
|
|
202
|
+
}
|
|
178
203
|
},
|
|
179
204
|
statusText() {
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
205
|
+
const status = this.status;
|
|
206
|
+
const fileStatusText = this.file.uploader.fileStatusText;
|
|
207
|
+
let txt = status;
|
|
208
|
+
if (typeof fileStatusText === "function") {
|
|
209
|
+
txt = fileStatusText(status, this.response);
|
|
210
|
+
} else {
|
|
211
|
+
txt = fileStatusText[status];
|
|
212
|
+
}
|
|
213
|
+
return txt || "";
|
|
183
214
|
},
|
|
184
215
|
formatedTimeRemaining() {
|
|
185
|
-
const
|
|
186
|
-
|
|
216
|
+
const timeRemaining = this.timeRemaining;
|
|
217
|
+
const file = this.file;
|
|
218
|
+
if (timeRemaining === Number.POSITIVE_INFINITY || timeRemaining === 0) {
|
|
187
219
|
return "";
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
220
|
+
}
|
|
221
|
+
let parsedTimeRemaining = secondsToStr(timeRemaining);
|
|
222
|
+
const parseTimeRemaining = file.uploader.opts.parseTimeRemaining;
|
|
223
|
+
if (parseTimeRemaining) {
|
|
224
|
+
parsedTimeRemaining = parseTimeRemaining(timeRemaining, parsedTimeRemaining);
|
|
225
|
+
}
|
|
226
|
+
return parsedTimeRemaining;
|
|
191
227
|
}
|
|
192
228
|
},
|
|
193
229
|
watch: {
|
|
194
|
-
status(
|
|
195
|
-
|
|
196
|
-
this.
|
|
197
|
-
|
|
230
|
+
status(newStatus, oldStatus) {
|
|
231
|
+
if (oldStatus && newStatus === "uploading" && oldStatus !== "uploading") {
|
|
232
|
+
this.tid = setTimeout(() => {
|
|
233
|
+
this.progressingClass = "uploader-file-progressing";
|
|
234
|
+
}, 200);
|
|
235
|
+
} else {
|
|
236
|
+
clearTimeout(this.tid);
|
|
237
|
+
this.progressingClass = "";
|
|
238
|
+
}
|
|
198
239
|
}
|
|
199
240
|
},
|
|
200
241
|
mounted() {
|
|
201
|
-
const
|
|
242
|
+
const staticProps = ["paused", "error", "averageSpeed", "currentSpeed"];
|
|
243
|
+
const fnProps = [
|
|
202
244
|
"isComplete",
|
|
203
245
|
"isUploading",
|
|
204
246
|
{
|
|
@@ -224,88 +266,124 @@ const h = {
|
|
|
224
266
|
fn: "getExtension"
|
|
225
267
|
}
|
|
226
268
|
];
|
|
227
|
-
|
|
228
|
-
this[
|
|
229
|
-
}), i.forEach((t) => {
|
|
230
|
-
typeof t == "string" ? this[t] = this.file[t]() : this[t.key] = this.file[t.fn]();
|
|
269
|
+
staticProps.forEach((prop) => {
|
|
270
|
+
this[prop] = this.file[prop];
|
|
231
271
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
272
|
+
fnProps.forEach((fnProp) => {
|
|
273
|
+
if (typeof fnProp === "string") {
|
|
274
|
+
this[fnProp] = this.file[fnProp]();
|
|
275
|
+
} else {
|
|
276
|
+
this[fnProp.key] = this.file[fnProp.fn]();
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
const handlers = this._handlers = {};
|
|
280
|
+
const eventHandler = (event) => {
|
|
281
|
+
handlers[event] = (...args) => {
|
|
282
|
+
this.fileEventsHandler(event, args);
|
|
283
|
+
};
|
|
284
|
+
return handlers[event];
|
|
285
|
+
};
|
|
286
|
+
events$1.forEach((event) => {
|
|
287
|
+
this.file.uploader.on(event, eventHandler(event));
|
|
237
288
|
});
|
|
238
289
|
},
|
|
239
290
|
destroyed() {
|
|
240
|
-
|
|
241
|
-
this.file.uploader.off(
|
|
242
|
-
})
|
|
291
|
+
events$1.forEach((event) => {
|
|
292
|
+
this.file.uploader.off(event, this._handlers[event]);
|
|
293
|
+
});
|
|
294
|
+
this._handlers = null;
|
|
243
295
|
},
|
|
244
296
|
methods: {
|
|
245
297
|
_actionCheck() {
|
|
246
|
-
this.paused = this.file.paused
|
|
298
|
+
this.paused = this.file.paused;
|
|
299
|
+
this.error = this.file.error;
|
|
300
|
+
this.isUploading = this.file.isUploading();
|
|
247
301
|
},
|
|
248
302
|
pause() {
|
|
249
|
-
this.file.pause()
|
|
303
|
+
this.file.pause();
|
|
304
|
+
this._actionCheck();
|
|
305
|
+
this._fileProgress();
|
|
250
306
|
},
|
|
251
307
|
resume() {
|
|
252
|
-
this.file.resume()
|
|
308
|
+
this.file.resume();
|
|
309
|
+
this._actionCheck();
|
|
253
310
|
},
|
|
254
311
|
remove() {
|
|
255
|
-
this.$set(this.file, "canceled",
|
|
312
|
+
this.$set(this.file, "canceled", true);
|
|
313
|
+
this.file.cancel();
|
|
256
314
|
},
|
|
257
315
|
retry() {
|
|
258
|
-
this.file.retry()
|
|
316
|
+
this.file.retry();
|
|
317
|
+
this._actionCheck();
|
|
259
318
|
},
|
|
260
|
-
processResponse(
|
|
261
|
-
let
|
|
319
|
+
processResponse(message) {
|
|
320
|
+
let res = message;
|
|
262
321
|
try {
|
|
263
|
-
|
|
264
|
-
} catch {
|
|
322
|
+
res = JSON.parse(message);
|
|
323
|
+
} catch (e) {
|
|
265
324
|
}
|
|
266
|
-
this.response =
|
|
325
|
+
this.response = res;
|
|
267
326
|
},
|
|
268
|
-
fileEventsHandler(
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
327
|
+
fileEventsHandler(event, args) {
|
|
328
|
+
const rootFile = args[0];
|
|
329
|
+
const file = args[1];
|
|
330
|
+
const target = this.list ? rootFile : file;
|
|
331
|
+
if (this.file === target) {
|
|
332
|
+
if (this.list && event === "fileSuccess") {
|
|
333
|
+
this.processResponse(args[2]);
|
|
273
334
|
return;
|
|
274
335
|
}
|
|
275
|
-
this[`_${
|
|
336
|
+
this[`_${event}`].apply(this, args);
|
|
276
337
|
}
|
|
277
338
|
},
|
|
278
339
|
_fileProgress() {
|
|
279
|
-
this.progress = this.file.progress()
|
|
340
|
+
this.progress = this.file.progress();
|
|
341
|
+
this.averageSpeed = this.file.averageSpeed;
|
|
342
|
+
this.currentSpeed = this.file.currentSpeed;
|
|
343
|
+
this.timeRemaining = this.file.timeRemaining();
|
|
344
|
+
this.uploadedSize = this.file.sizeUploaded();
|
|
345
|
+
this._actionCheck();
|
|
280
346
|
},
|
|
281
|
-
_fileSuccess(
|
|
282
|
-
|
|
347
|
+
_fileSuccess(rootFile, file, message) {
|
|
348
|
+
if (rootFile) {
|
|
349
|
+
this.processResponse(message);
|
|
350
|
+
}
|
|
351
|
+
this._fileProgress();
|
|
352
|
+
this.error = false;
|
|
353
|
+
this.isComplete = true;
|
|
354
|
+
this.isUploading = false;
|
|
283
355
|
},
|
|
284
356
|
_fileComplete() {
|
|
285
357
|
this._fileSuccess();
|
|
286
358
|
},
|
|
287
|
-
_fileError(
|
|
288
|
-
this._fileProgress()
|
|
359
|
+
_fileError(rootFile, file, message) {
|
|
360
|
+
this._fileProgress();
|
|
361
|
+
this.processResponse(message);
|
|
362
|
+
this.error = true;
|
|
363
|
+
this.isComplete = false;
|
|
364
|
+
this.isUploading = false;
|
|
289
365
|
}
|
|
290
366
|
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
367
|
+
};
|
|
368
|
+
const __cssModules = {};
|
|
369
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
370
|
+
__vue2_script,
|
|
371
|
+
render,
|
|
372
|
+
staticRenderFns,
|
|
373
|
+
false,
|
|
374
|
+
__vue2_injectStyles,
|
|
298
375
|
null,
|
|
299
376
|
null,
|
|
300
377
|
null
|
|
301
378
|
);
|
|
302
|
-
function
|
|
303
|
-
for (let
|
|
304
|
-
this[
|
|
379
|
+
function __vue2_injectStyles(context) {
|
|
380
|
+
for (let o in __cssModules) {
|
|
381
|
+
this[o] = __cssModules[o];
|
|
382
|
+
}
|
|
305
383
|
}
|
|
306
|
-
const
|
|
307
|
-
return
|
|
384
|
+
const ChunkFileUploaderFile = /* @__PURE__ */ function() {
|
|
385
|
+
return __component__.exports;
|
|
308
386
|
}();
|
|
309
387
|
export {
|
|
310
|
-
|
|
388
|
+
ChunkFileUploaderFile as default
|
|
311
389
|
};
|
|
@@ -1 +1,125 @@
|
|
|
1
|
-
|
|
1
|
+
/* 全局公共颜色配置 */ /* 全局公共尺寸配置 */
|
|
2
|
+
/* 应用头部高度 */
|
|
3
|
+
/* 页面宽度 */
|
|
4
|
+
/* 侧栏宽度 */
|
|
5
|
+
/* 标签高度 */
|
|
6
|
+
/* 页面头部工具条高度 */
|
|
7
|
+
.chunk-file-uploader-file {
|
|
8
|
+
position: relative;
|
|
9
|
+
height: 49px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
line-height: 49px;
|
|
12
|
+
border-bottom: 1px solid #cdcdcd;
|
|
13
|
+
}
|
|
14
|
+
.chunk-file-uploader-file[status=waiting] .chunk-file-uploader-file-pause, .chunk-file-uploader-file[status=uploading] .chunk-file-uploader-file-pause {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
.chunk-file-uploader-file[status=paused] .chunk-file-uploader-file-resume {
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
|
+
.chunk-file-uploader-file[status=error] .chunk-file-uploader-file-retry {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
.chunk-file-uploader-file[status=success] .chunk-file-uploader-file-remove {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
.chunk-file-uploader-file[status=error] .chunk-file-uploader-file-progress {
|
|
27
|
+
background: #ffe0e0;
|
|
28
|
+
}
|
|
29
|
+
.chunk-file-uploader-file-progress {
|
|
30
|
+
position: absolute;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
background: #e2eeff;
|
|
34
|
+
transform: translateX(-100%);
|
|
35
|
+
}
|
|
36
|
+
.chunk-file-uploader-file-progressing {
|
|
37
|
+
transition: all 0.4s linear;
|
|
38
|
+
}
|
|
39
|
+
.chunk-file-uploader-file-info {
|
|
40
|
+
position: relative;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
height: 100%;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
}
|
|
47
|
+
.chunk-file-uploader-file-info:hover {
|
|
48
|
+
background-color: rgba(240, 240, 240, 0.2);
|
|
49
|
+
}
|
|
50
|
+
.chunk-file-uploader-file-info i, .chunk-file-uploader-file-info em {
|
|
51
|
+
font-style: normal;
|
|
52
|
+
}
|
|
53
|
+
.chunk-file-uploader-file-name, .chunk-file-uploader-file-size, .chunk-file-uploader-file-meta, .chunk-file-uploader-file-status, .chunk-file-uploader-file-actions {
|
|
54
|
+
position: relative;
|
|
55
|
+
height: 100%;
|
|
56
|
+
padding: 0 10px;
|
|
57
|
+
}
|
|
58
|
+
.chunk-file-uploader-file-size, .chunk-file-uploader-file-meta, .chunk-file-uploader-file-status, .chunk-file-uploader-file-actions {
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
.chunk-file-uploader-file-name {
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
text-indent: 14px;
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
}
|
|
68
|
+
.chunk-file-uploader-file-icon {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
width: 24px;
|
|
71
|
+
height: 24px;
|
|
72
|
+
margin-top: 13px;
|
|
73
|
+
margin-right: 8px;
|
|
74
|
+
vertical-align: top;
|
|
75
|
+
}
|
|
76
|
+
.chunk-file-uploader-file-icon::before {
|
|
77
|
+
display: block;
|
|
78
|
+
height: 100%;
|
|
79
|
+
color: #808080;
|
|
80
|
+
font-size: 24px;
|
|
81
|
+
line-height: 1;
|
|
82
|
+
text-indent: 0;
|
|
83
|
+
content: "📃";
|
|
84
|
+
}
|
|
85
|
+
.chunk-file-uploader-file-icon[icon=folder]::before {
|
|
86
|
+
content: "📂";
|
|
87
|
+
}
|
|
88
|
+
.chunk-file-uploader-file-icon[icon=image]::before {
|
|
89
|
+
content: "📊";
|
|
90
|
+
}
|
|
91
|
+
.chunk-file-uploader-file-icon[icon=video]::before {
|
|
92
|
+
content: "📹";
|
|
93
|
+
}
|
|
94
|
+
.chunk-file-uploader-file-icon[icon=audio]::before {
|
|
95
|
+
content: "🎵";
|
|
96
|
+
}
|
|
97
|
+
.chunk-file-uploader-file-icon[icon=document]::before {
|
|
98
|
+
content: "📋";
|
|
99
|
+
}
|
|
100
|
+
.chunk-file-uploader-file-actions > span {
|
|
101
|
+
display: none;
|
|
102
|
+
float: left;
|
|
103
|
+
width: 16px;
|
|
104
|
+
height: 16px;
|
|
105
|
+
margin-top: 16px;
|
|
106
|
+
margin-right: 10px;
|
|
107
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAABkCAYAAAD0ZHJ6AAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACxMAAAsTAQCanBgAAARkSURBVGje7ZnfS1NRHMAH4ptPkvQSuAdBkCxD8FUQJMEULUgzy1KyyPVQ4JMiiP4Bvg6EwUQQfMmwhwRDshwaKUjDVCgoSdDNHkzTJZ6+Z37Purve8+PeTb2TM/ggu+ew89l33x8H9BBCPG7GowXTJej3+wnDvEm0JuLC04+EYWftVAUv+fiCvDUdQR1BHUEdQR3BTIygvixoQS14XgTtthLVdpNWwXRLqvQ724LplFRtyrYF0yVpFLQrKRVMh6RZ0I6kkmCqklaCqpKZH0FX56Crq9jVfdDVk0RfFrSgFsxkQVmLcdKCVrKySCrryhPEyYShhzOcrFtG0EoilfHHk1CRU5rF6ZjNZhlVOW6RnMSVyyilKies4pO41diVy8wIujoHXV3FGdMHXTtJKLFYTLhZtq4vC1rwXApCZTIqgR6g1PBMCO9DL3bMMSqBHqDU8EyISDAHiGKvWwcCQG2KgjlAFCDAOhAAap0K5gKLphk8mqJgLrCIgoxRJ4J5wKpJ7gAoMkn5EBXBPGDVJHcAFJmkfIhQcAql1oBpTvTol9gG9pm4RHAKpdaAaU706JfYBvaZuJVgPQrt4sFlnOh5MC/p3lmJYD0K7eLBZZzoeTAv6d5ZnuAYHjpgEOnk5F0ufhG6v1ggOIaHDhhEOjl5l4tfhO4vthLcwAMrFNvLJO5vEwhu4IEViu1lEve3WQmyoihQFBzG/V0CQVYUBYqCw7i/SxTBcpsRbFeIYLnNCLZbCY5b5KAnxRwct8hBj9McZFVMW0ihRNBuFdMWUigRlFaxuQ9WWYjRMTiIe5z0wSoLMToGB3GPsA9aTZIJoB+nRgBnM1tzOkkmgH6cGgGczWzNpzqLx3n/aULJJgezeNw07oxQySbVywKjBOgFRnDs+VEsx8FlgVEC9AIjOPb8KJYjvSzoG7UW1IJaUAtqQS14toLNM5fN5APdwBJA8G83Pk/aK/rgzVvXzeQD3cASQPBvNz5P2ssTzAaGUIrHEO6zI5gNDKEUjyHcxxWkh4Ylcowwk1QQpIeGJXKMMJO0EgwqyjGCioJBJvDrxRMSuVOTJEXfbz1/bHwWtBL0yoQehK6RucgE+bGzanzulQh6E3IgQV+xpc8kcrfuSO7eTfJ3ZYmQw0Oy9azVKOk1C/bJ5D5F38YPeLfx0rjWJxHsS0SqsSYuxySjj5qO5Oj7xQWy2VBtFOwzCy6ryH3YfE3uh64Y1xckgstJPydEjkkeHv07Iy4Xaao15+KCWTBx6M/db+T9xivSErqaJDdzXI6yLRE8Vgg0coex/SPJvT0SbWu0KpZtbgSpCH3NRt7I5OxHkObc6heU+/M/J5vrpBFM5GBLqCQux14COXs5CNXK5OjPGm1tSMrJSOMNYQ4mVTGV/L6zTL7+DovkbFUxbSW0Wo05l8hJWsU+cRWfSh+Mt5Lb1ck/J1TvVsdDaR/MiEni+llsdZuZp62EViu+96bpNjNPWwmtVnzvFd5m9IVVC54x/wA7gNvqFG9vXQAAAABJRU5ErkJggg==") no-repeat 0 0;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
}
|
|
110
|
+
.chunk-file-uploader-file-actions > span:hover {
|
|
111
|
+
background-position-x: -21px;
|
|
112
|
+
}
|
|
113
|
+
.chunk-file-uploader-file-actions .chunk-file-uploader-file-pause {
|
|
114
|
+
background-position-y: 0;
|
|
115
|
+
}
|
|
116
|
+
.chunk-file-uploader-file-actions .chunk-file-uploader-file-resume {
|
|
117
|
+
background-position-y: -17px;
|
|
118
|
+
}
|
|
119
|
+
.chunk-file-uploader-file-actions .chunk-file-uploader-file-retry {
|
|
120
|
+
background-position-y: -53px;
|
|
121
|
+
}
|
|
122
|
+
.chunk-file-uploader-file-actions .chunk-file-uploader-file-remove {
|
|
123
|
+
display: block;
|
|
124
|
+
background-position-y: -34px;
|
|
125
|
+
}
|