@das-fed/ui 7.0.4-test.1 → 7.0.4-test.2
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/package.json +6 -5
- package/packages/business-components/currency-page/index.d.ts +3 -1
- package/packages/business-components/currency-page/index.js +40 -35
- package/packages/business-components/currency-page/index.js.gz +0 -0
- package/packages/business-components/currency-page/src/index.vue.d.ts +3 -1
- package/packages/business-components/currency-page/src/type.d.ts +6 -0
- package/packages/business-components/currency-page/style.css +1 -1
- package/packages/components/image-upload/index.d.ts +1 -0
- package/packages/components/image-upload/index.js +767 -114
- package/packages/components/image-upload/index.js.gz +0 -0
- package/packages/components/image-upload/src/Index.vue.d.ts +1 -0
- package/packages/components/image-upload/src/hooks/use-compress-image.d.ts +1 -0
- package/packages/components/image-upload/src/type.d.ts +3 -0
- package/packages/components/image-upload/style.css +1 -1
- package/packages/components/image-upload/style.css.gz +0 -0
- package/packages/components/image-viewer/index.d.ts +1 -0
- package/packages/components/image-viewer/index.js +1086 -434
- package/packages/components/image-viewer/index.js.gz +0 -0
- package/packages/components/image-viewer/src/Index.vue.d.ts +1 -0
- package/packages/components/image-viewer/src/hooks/use-compress-image.d.ts +1 -0
- package/packages/components/image-viewer/src/type.d.ts +3 -0
- package/packages/components/image-viewer/style.css +1 -1
- package/packages/components/image-viewer/style.css.gz +0 -0
- package/packages/components/tree-table/index.js +291 -263
- package/packages/components/tree-table/index.js.gz +0 -0
- package/packages/components/tree-table/src/hooks/use-five.d.ts +4 -0
- package/packages/components/tree-table/src/hooks/use-four.d.ts +4 -0
- package/packages/components/tree-table/src/type.d.ts +1 -1
- package/packages/components/tree-table/style.css +1 -1
- package/packages/components/tree-table/style.css.gz +0 -0
|
@@ -1,272 +1,921 @@
|
|
|
1
1
|
import '@das-fed/ui/packages/components/image-viewer/style.css';
|
|
2
|
-
import { withInstall as
|
|
3
|
-
import { setThemeRule as
|
|
4
|
-
import { ref as
|
|
5
|
-
import { ElImageViewer as
|
|
6
|
-
import { Upload as
|
|
7
|
-
import { vDasTooltip as
|
|
8
|
-
import { DasImageUpload as
|
|
9
|
-
import { DasSpin as
|
|
10
|
-
import { DasAudioVideo as
|
|
11
|
-
import { DasIconDownload as
|
|
12
|
-
import { DasIconChange as
|
|
13
|
-
import { DasIconDelete as
|
|
14
|
-
import { useModelValue as
|
|
15
|
-
import { DasMessage as
|
|
16
|
-
import { extractFilename as
|
|
17
|
-
import { getConfig as
|
|
18
|
-
import { currentLang as
|
|
19
|
-
import { iotMinio as
|
|
20
|
-
import { useFile as
|
|
21
|
-
import { getUserInfo as
|
|
22
|
-
import { pureImageSrc as
|
|
2
|
+
import { withInstall as rt } from "@das-fed/utils/with-install/index";
|
|
3
|
+
import { setThemeRule as ot } from "@das-fed/web/packages/theme/index";
|
|
4
|
+
import { ref as Ee, computed as x, watch as st, createApp as lt, defineComponent as ut, createElementBlock as U, openBlock as y, Fragment as de, createCommentVNode as p, createElementVNode as X, withDirectives as J, normalizeStyle as fe, createVNode as ie, unref as n, normalizeClass as ge, withCtx as ne, createBlock as O, vShow as j, isRef as Qe, createTextVNode as Pe, toDisplayString as Te, renderList as Me } from "vue";
|
|
5
|
+
import { ElImageViewer as ct, ElImage as Le } from "element-plus";
|
|
6
|
+
import { Upload as Fe } from "ant-design-vue";
|
|
7
|
+
import { vDasTooltip as Ne } from "@das-fed/ui/packages/components/text-tooltip/index";
|
|
8
|
+
import { DasImageUpload as Ve } from "@das-fed/ui/packages/components/image-upload/index";
|
|
9
|
+
import { DasSpin as Je } from "@das-fed/ui/packages/components/spin/index";
|
|
10
|
+
import { DasAudioVideo as ve } from "@das-fed/ui/packages/components/audio-video/index";
|
|
11
|
+
import { DasIconDownload as je } from "@das-fed/ui/packages/icons/download/index";
|
|
12
|
+
import { DasIconChange as pe } from "@das-fed/ui/packages/icons/change/index";
|
|
13
|
+
import { DasIconDelete as ze } from "@das-fed/ui/packages/icons/delete/index";
|
|
14
|
+
import { useModelValue as be } from "@das-fed/utils/vue";
|
|
15
|
+
import { DasMessage as xe } from "@das-fed/ui/packages/components/message/index";
|
|
16
|
+
import { extractFilename as _e, getFileExtension as mt } from "@das-fed/utils/common-tools";
|
|
17
|
+
import { getConfig as De } from "@das-fed/utils/config";
|
|
18
|
+
import { currentLang as Ke, i18n as He } from "@das-fed/web/packages/i18n/index";
|
|
19
|
+
import { iotMinio as et } from "@das-fed/utils/api-services/modules/iot";
|
|
20
|
+
import { useFile as dt } from "@das-fed/utils/api-services/modules/file";
|
|
21
|
+
import { getUserInfo as ft } from "@das-fed/utils/common-info";
|
|
22
|
+
import { pureImageSrc as Re } from "@das-fed/utils/pure-image-src";
|
|
23
23
|
import "ant-design-vue/es/upload/style/css";
|
|
24
24
|
import "element-plus/es/components/image/style/css";
|
|
25
25
|
import "element-plus/es/components/image-viewer/style/css";
|
|
26
26
|
import "@das-fed/ui/packages/global/theme";
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
let
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
|
|
27
|
+
const Ie = "data:image/png;base64,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", gt = (t, e) => {
|
|
28
|
+
const i = new Image();
|
|
29
|
+
i.setAttribute("crossOrigin", "Anonymous"), i.onload = function() {
|
|
30
|
+
let a = document.createElement("canvas");
|
|
31
|
+
const r = a.getContext("2d");
|
|
32
|
+
a.width = i.width, a.height = i.height, r.drawImage(i, 0, 0, i.width, i.height), a.toBlob((o) => {
|
|
33
|
+
let g = URL.createObjectURL(o), s = document.createElement("a"), f = new MouseEvent("click");
|
|
34
|
+
const c = t.substring(t.lastIndexOf(".")).toLowerCase();
|
|
35
|
+
s.download = e || `default${c}`, s.href = g, s.dispatchEvent(f), URL.revokeObjectURL(g);
|
|
36
36
|
});
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
t && fetch(t).then((
|
|
40
|
-
const
|
|
41
|
-
document.body.appendChild(
|
|
42
|
-
const
|
|
43
|
-
|
|
37
|
+
}, i.src = t + "?v=" + Date.now();
|
|
38
|
+
}, vt = (t, e) => {
|
|
39
|
+
t && fetch(t).then((i) => i.blob()).then((i) => {
|
|
40
|
+
const a = document.createElement("a");
|
|
41
|
+
document.body.appendChild(a), a.style.display = "none";
|
|
42
|
+
const r = window.URL.createObjectURL(i);
|
|
43
|
+
a.href = r, a.download = e, a.click(), document.body.removeChild(a), window.URL.revokeObjectURL(r);
|
|
44
44
|
});
|
|
45
|
-
},
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
const t =
|
|
45
|
+
}, pt = (t) => {
|
|
46
|
+
const e = (t == null ? void 0 : t.minioTokenApi) ?? "token";
|
|
47
|
+
return et.get(e, (i) => (i.headers || (i.headers = {}), t != null && t.baseUrl && (i.baseURL = t.baseUrl), i));
|
|
48
|
+
}, ht = (t) => et.post("put-object", (e) => (e.headers || (e.headers = {}), t && (e.baseURL = t), e.headers["Content-Type"] = "multipart/form-data", e)), wt = () => {
|
|
49
|
+
const t = ft();
|
|
50
50
|
return t ? t.tenantId : "";
|
|
51
|
-
},
|
|
52
|
-
const { baseUrl:
|
|
53
|
-
const [
|
|
54
|
-
return
|
|
55
|
-
}, { generateUniqueName:
|
|
56
|
-
return { upload: async (
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
accessKeyId:
|
|
61
|
-
secretAccessKey:
|
|
62
|
-
sessionToken:
|
|
63
|
-
file:
|
|
64
|
-
bucketName:
|
|
65
|
-
filePath:
|
|
51
|
+
}, At = (t) => {
|
|
52
|
+
const { baseUrl: e, serviceName: i, pathPrefix: a, bucketName: r, minioTokenApi: o, autoContentType: g } = t, s = async () => {
|
|
53
|
+
const [v, d] = await pt({ baseUrl: e, minioTokenApi: o })().run();
|
|
54
|
+
return v ? { stauts: !1 } : { status: !0, data: d };
|
|
55
|
+
}, { generateUniqueName: f } = dt();
|
|
56
|
+
return { upload: async (v, d = {}) => {
|
|
57
|
+
const C = await s();
|
|
58
|
+
if (!C.status) return;
|
|
59
|
+
const h = v.name, m = C.data, E = a || wt(), k = h.substring(h.lastIndexOf(".")).toLowerCase(), S = t.randomName ? `${f("")}${k}` : h, K = i ? `${E}/${i}/${S}` : `${E}/${S}`, T = {
|
|
60
|
+
accessKeyId: m.accessKeyId,
|
|
61
|
+
secretAccessKey: m.secretAccessKey,
|
|
62
|
+
sessionToken: m.sessionToken,
|
|
63
|
+
file: v,
|
|
64
|
+
bucketName: r || "business",
|
|
65
|
+
filePath: K,
|
|
66
66
|
isThumbnail: !0,
|
|
67
|
-
autoContentType:
|
|
68
|
-
...
|
|
69
|
-
}, [
|
|
70
|
-
return
|
|
67
|
+
autoContentType: g === !0 ? !0 : void 0,
|
|
68
|
+
...d
|
|
69
|
+
}, [M, L] = await ht(e)(T).run();
|
|
70
|
+
return M ? "error" : L.value;
|
|
71
71
|
} };
|
|
72
|
-
},
|
|
73
|
-
isNaN(Number(
|
|
74
|
-
const
|
|
75
|
-
M:
|
|
76
|
-
K:
|
|
72
|
+
}, yt = () => ({ size2B: (e) => {
|
|
73
|
+
isNaN(Number(e)) ? e = e.toString() : e = e + "M";
|
|
74
|
+
const i = Number(e.slice(0, -1)), a = e[e.length - 1].toUpperCase(), r = 1024, o = {
|
|
75
|
+
M: r * r,
|
|
76
|
+
K: r,
|
|
77
77
|
B: 1
|
|
78
78
|
};
|
|
79
|
-
return { finalSize:
|
|
80
|
-
} }),
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
} }),
|
|
85
|
-
const
|
|
86
|
-
return await
|
|
87
|
-
},
|
|
88
|
-
const
|
|
89
|
-
let
|
|
90
|
-
for (const
|
|
91
|
-
const
|
|
92
|
-
|
|
79
|
+
return { finalSize: i * o[a], sizeText: e };
|
|
80
|
+
} }), Ct = (t) => ({ handlerImageSrc: (i, a) => {
|
|
81
|
+
if (a.startsWith("http")) return a;
|
|
82
|
+
const r = t.useOriginUrl ? a : Re(a);
|
|
83
|
+
return i + r;
|
|
84
|
+
} }), Et = async (t) => {
|
|
85
|
+
const i = De().baseURL + Re(t);
|
|
86
|
+
return await _e(i);
|
|
87
|
+
}, bt = async (t) => {
|
|
88
|
+
const e = De();
|
|
89
|
+
let i = [];
|
|
90
|
+
for (const a of t) {
|
|
91
|
+
const r = e.baseURL + Re(a), o = await _e(r);
|
|
92
|
+
i.push(o);
|
|
93
93
|
}
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
return i;
|
|
95
|
+
};
|
|
96
|
+
/*!
|
|
97
|
+
* Compressor.js v1.2.1
|
|
98
|
+
* https://fengyuanchen.github.io/compressorjs
|
|
99
|
+
*
|
|
100
|
+
* Copyright 2018-present Chen Fengyuan
|
|
101
|
+
* Released under the MIT license
|
|
102
|
+
*
|
|
103
|
+
* Date: 2023-02-28T14:09:41.732Z
|
|
104
|
+
*/
|
|
105
|
+
function We(t, e) {
|
|
106
|
+
var i = Object.keys(t);
|
|
107
|
+
if (Object.getOwnPropertySymbols) {
|
|
108
|
+
var a = Object.getOwnPropertySymbols(t);
|
|
109
|
+
e && (a = a.filter(function(r) {
|
|
110
|
+
return Object.getOwnPropertyDescriptor(t, r).enumerable;
|
|
111
|
+
})), i.push.apply(i, a);
|
|
112
|
+
}
|
|
113
|
+
return i;
|
|
114
|
+
}
|
|
115
|
+
function he(t) {
|
|
116
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
117
|
+
var i = arguments[e] != null ? arguments[e] : {};
|
|
118
|
+
e % 2 ? We(Object(i), !0).forEach(function(a) {
|
|
119
|
+
kt(t, a, i[a]);
|
|
120
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : We(Object(i)).forEach(function(a) {
|
|
121
|
+
Object.defineProperty(t, a, Object.getOwnPropertyDescriptor(i, a));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return t;
|
|
125
|
+
}
|
|
126
|
+
function Bt(t, e) {
|
|
127
|
+
if (!(t instanceof e))
|
|
128
|
+
throw new TypeError("Cannot call a class as a function");
|
|
129
|
+
}
|
|
130
|
+
function Ye(t, e) {
|
|
131
|
+
for (var i = 0; i < e.length; i++) {
|
|
132
|
+
var a = e[i];
|
|
133
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, tt(a.key), a);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function It(t, e, i) {
|
|
137
|
+
return e && Ye(t.prototype, e), i && Ye(t, i), Object.defineProperty(t, "prototype", {
|
|
138
|
+
writable: !1
|
|
139
|
+
}), t;
|
|
140
|
+
}
|
|
141
|
+
function kt(t, e, i) {
|
|
142
|
+
return e = tt(e), e in t ? Object.defineProperty(t, e, {
|
|
143
|
+
value: i,
|
|
144
|
+
enumerable: !0,
|
|
145
|
+
configurable: !0,
|
|
146
|
+
writable: !0
|
|
147
|
+
}) : t[e] = i, t;
|
|
148
|
+
}
|
|
149
|
+
function Ae() {
|
|
150
|
+
return Ae = Object.assign ? Object.assign.bind() : function(t) {
|
|
151
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
152
|
+
var i = arguments[e];
|
|
153
|
+
for (var a in i)
|
|
154
|
+
Object.prototype.hasOwnProperty.call(i, a) && (t[a] = i[a]);
|
|
155
|
+
}
|
|
156
|
+
return t;
|
|
157
|
+
}, Ae.apply(this, arguments);
|
|
158
|
+
}
|
|
159
|
+
function Dt(t, e) {
|
|
160
|
+
if (typeof t != "object" || t === null) return t;
|
|
161
|
+
var i = t[Symbol.toPrimitive];
|
|
162
|
+
if (i !== void 0) {
|
|
163
|
+
var a = i.call(t, e);
|
|
164
|
+
if (typeof a != "object") return a;
|
|
165
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
166
|
+
}
|
|
167
|
+
return String(t);
|
|
168
|
+
}
|
|
169
|
+
function tt(t) {
|
|
170
|
+
var e = Dt(t, "string");
|
|
171
|
+
return typeof e == "symbol" ? e : String(e);
|
|
172
|
+
}
|
|
173
|
+
var at = { exports: {} };
|
|
174
|
+
(function(t) {
|
|
175
|
+
typeof window > "u" || function(e) {
|
|
176
|
+
var i = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype, a = e.Blob && function() {
|
|
177
|
+
try {
|
|
178
|
+
return !!new Blob();
|
|
179
|
+
} catch {
|
|
180
|
+
return !1;
|
|
181
|
+
}
|
|
182
|
+
}(), r = a && e.Uint8Array && function() {
|
|
183
|
+
try {
|
|
184
|
+
return new Blob([new Uint8Array(100)]).size === 100;
|
|
185
|
+
} catch {
|
|
186
|
+
return !1;
|
|
187
|
+
}
|
|
188
|
+
}(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, g = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, s = (a || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(f) {
|
|
189
|
+
var c, v, d, C, h, m, E, k, S;
|
|
190
|
+
if (c = f.match(g), !c)
|
|
191
|
+
throw new Error("invalid data URI");
|
|
192
|
+
for (v = c[2] ? c[1] : "text/plain" + (c[3] || ";charset=US-ASCII"), d = !!c[4], C = f.slice(c[0].length), d ? h = atob(C) : h = decodeURIComponent(C), m = new ArrayBuffer(h.length), E = new Uint8Array(m), k = 0; k < h.length; k += 1)
|
|
193
|
+
E[k] = h.charCodeAt(k);
|
|
194
|
+
return a ? new Blob([r ? E : m], {
|
|
195
|
+
type: v
|
|
196
|
+
}) : (S = new o(), S.append(m), S.getBlob(v));
|
|
197
|
+
};
|
|
198
|
+
e.HTMLCanvasElement && !i.toBlob && (i.mozGetAsFile ? i.toBlob = function(f, c, v) {
|
|
199
|
+
var d = this;
|
|
200
|
+
setTimeout(function() {
|
|
201
|
+
v && i.toDataURL && s ? f(s(d.toDataURL(c, v))) : f(d.mozGetAsFile("blob", c));
|
|
202
|
+
});
|
|
203
|
+
} : i.toDataURL && s && (i.msToBlob ? i.toBlob = function(f, c, v) {
|
|
204
|
+
var d = this;
|
|
205
|
+
setTimeout(function() {
|
|
206
|
+
(c && c !== "image/png" || v) && i.toDataURL && s ? f(s(d.toDataURL(c, v))) : f(d.msToBlob(c));
|
|
207
|
+
});
|
|
208
|
+
} : i.toBlob = function(f, c, v) {
|
|
209
|
+
var d = this;
|
|
210
|
+
setTimeout(function() {
|
|
211
|
+
f(s(d.toDataURL(c, v)));
|
|
212
|
+
});
|
|
213
|
+
})), t.exports ? t.exports = s : e.dataURLtoBlob = s;
|
|
214
|
+
}(window);
|
|
215
|
+
})(at);
|
|
216
|
+
var Ge = at.exports, Rt = function(e) {
|
|
217
|
+
return typeof Blob > "u" ? !1 : e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
|
|
218
|
+
}, Xe = {
|
|
219
|
+
/**
|
|
220
|
+
* Indicates if output the original image instead of the compressed one
|
|
221
|
+
* when the size of the compressed image is greater than the original one's
|
|
222
|
+
* @type {boolean}
|
|
223
|
+
*/
|
|
224
|
+
strict: !0,
|
|
225
|
+
/**
|
|
226
|
+
* Indicates if read the image's Exif Orientation information,
|
|
227
|
+
* and then rotate or flip the image automatically.
|
|
228
|
+
* @type {boolean}
|
|
229
|
+
*/
|
|
230
|
+
checkOrientation: !0,
|
|
231
|
+
/**
|
|
232
|
+
* Indicates if retain the image's Exif information after compressed.
|
|
233
|
+
* @type {boolean}
|
|
234
|
+
*/
|
|
235
|
+
retainExif: !1,
|
|
236
|
+
/**
|
|
237
|
+
* The max width of the output image.
|
|
238
|
+
* @type {number}
|
|
239
|
+
*/
|
|
240
|
+
maxWidth: 1 / 0,
|
|
241
|
+
/**
|
|
242
|
+
* The max height of the output image.
|
|
243
|
+
* @type {number}
|
|
244
|
+
*/
|
|
245
|
+
maxHeight: 1 / 0,
|
|
246
|
+
/**
|
|
247
|
+
* The min width of the output image.
|
|
248
|
+
* @type {number}
|
|
249
|
+
*/
|
|
250
|
+
minWidth: 0,
|
|
251
|
+
/**
|
|
252
|
+
* The min height of the output image.
|
|
253
|
+
* @type {number}
|
|
254
|
+
*/
|
|
255
|
+
minHeight: 0,
|
|
256
|
+
/**
|
|
257
|
+
* The width of the output image.
|
|
258
|
+
* If not specified, the natural width of the source image will be used.
|
|
259
|
+
* @type {number}
|
|
260
|
+
*/
|
|
261
|
+
width: void 0,
|
|
262
|
+
/**
|
|
263
|
+
* The height of the output image.
|
|
264
|
+
* If not specified, the natural height of the source image will be used.
|
|
265
|
+
* @type {number}
|
|
266
|
+
*/
|
|
267
|
+
height: void 0,
|
|
268
|
+
/**
|
|
269
|
+
* Sets how the size of the image should be resized to the container
|
|
270
|
+
* specified by the `width` and `height` options.
|
|
271
|
+
* @type {string}
|
|
272
|
+
*/
|
|
273
|
+
resize: "none",
|
|
274
|
+
/**
|
|
275
|
+
* The quality of the output image.
|
|
276
|
+
* It must be a number between `0` and `1`,
|
|
277
|
+
* and only available for `image/jpeg` and `image/webp` images.
|
|
278
|
+
* Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}.
|
|
279
|
+
* @type {number}
|
|
280
|
+
*/
|
|
281
|
+
quality: 0.8,
|
|
282
|
+
/**
|
|
283
|
+
* The mime type of the output image.
|
|
284
|
+
* By default, the original mime type of the source image file will be used.
|
|
285
|
+
* @type {string}
|
|
286
|
+
*/
|
|
287
|
+
mimeType: "auto",
|
|
288
|
+
/**
|
|
289
|
+
* Files whose file type is included in this list,
|
|
290
|
+
* and whose file size exceeds the `convertSize` value will be converted to JPEGs.
|
|
291
|
+
* @type {string|Array}
|
|
292
|
+
*/
|
|
293
|
+
convertTypes: ["image/png"],
|
|
294
|
+
/**
|
|
295
|
+
* PNG files over this size (5 MB by default) will be converted to JPEGs.
|
|
296
|
+
* To disable this, just set the value to `Infinity`.
|
|
297
|
+
* @type {number}
|
|
298
|
+
*/
|
|
299
|
+
convertSize: 5e6,
|
|
300
|
+
/**
|
|
301
|
+
* The hook function to execute before draw the image into the canvas for compression.
|
|
302
|
+
* @type {Function}
|
|
303
|
+
* @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
|
|
304
|
+
* @param {HTMLCanvasElement} canvas - The canvas for compression.
|
|
305
|
+
* @example
|
|
306
|
+
* function (context, canvas) {
|
|
307
|
+
* context.fillStyle = '#fff';
|
|
308
|
+
* }
|
|
309
|
+
*/
|
|
310
|
+
beforeDraw: null,
|
|
311
|
+
/**
|
|
312
|
+
* The hook function to execute after drew the image into the canvas for compression.
|
|
313
|
+
* @type {Function}
|
|
314
|
+
* @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.
|
|
315
|
+
* @param {HTMLCanvasElement} canvas - The canvas for compression.
|
|
316
|
+
* @example
|
|
317
|
+
* function (context, canvas) {
|
|
318
|
+
* context.filter = 'grayscale(100%)';
|
|
319
|
+
* }
|
|
320
|
+
*/
|
|
321
|
+
drew: null,
|
|
322
|
+
/**
|
|
323
|
+
* The hook function to execute when success to compress the image.
|
|
324
|
+
* @type {Function}
|
|
325
|
+
* @param {File} file - The compressed image File object.
|
|
326
|
+
* @example
|
|
327
|
+
* function (file) {
|
|
328
|
+
* console.log(file);
|
|
329
|
+
* }
|
|
330
|
+
*/
|
|
331
|
+
success: null,
|
|
332
|
+
/**
|
|
333
|
+
* The hook function to execute when fail to compress the image.
|
|
334
|
+
* @type {Function}
|
|
335
|
+
* @param {Error} err - An Error object.
|
|
336
|
+
* @example
|
|
337
|
+
* function (err) {
|
|
338
|
+
* console.log(err.message);
|
|
339
|
+
* }
|
|
340
|
+
*/
|
|
341
|
+
error: null
|
|
342
|
+
}, St = typeof window < "u" && typeof window.document < "u", q = St ? window : {}, ye = function(e) {
|
|
343
|
+
return e > 0 && e < 1 / 0;
|
|
344
|
+
}, Ut = Array.prototype.slice;
|
|
345
|
+
function Se(t) {
|
|
346
|
+
return Array.from ? Array.from(t) : Ut.call(t);
|
|
347
|
+
}
|
|
348
|
+
var Ot = /^image\/.+$/;
|
|
349
|
+
function ke(t) {
|
|
350
|
+
return Ot.test(t);
|
|
351
|
+
}
|
|
352
|
+
function Qt(t) {
|
|
353
|
+
var e = ke(t) ? t.substr(6) : "";
|
|
354
|
+
return e === "jpeg" && (e = "jpg"), ".".concat(e);
|
|
355
|
+
}
|
|
356
|
+
var it = String.fromCharCode;
|
|
357
|
+
function Pt(t, e, i) {
|
|
358
|
+
var a = "", r;
|
|
359
|
+
for (i += e, r = e; r < i; r += 1)
|
|
360
|
+
a += it(t.getUint8(r));
|
|
361
|
+
return a;
|
|
362
|
+
}
|
|
363
|
+
var Tt = q.btoa;
|
|
364
|
+
function qe(t, e) {
|
|
365
|
+
for (var i = [], a = 8192, r = new Uint8Array(t); r.length > 0; )
|
|
366
|
+
i.push(it.apply(null, Se(r.subarray(0, a)))), r = r.subarray(a);
|
|
367
|
+
return "data:".concat(e, ";base64,").concat(Tt(i.join("")));
|
|
368
|
+
}
|
|
369
|
+
function Mt(t) {
|
|
370
|
+
var e = new DataView(t), i;
|
|
371
|
+
try {
|
|
372
|
+
var a, r, o;
|
|
373
|
+
if (e.getUint8(0) === 255 && e.getUint8(1) === 216)
|
|
374
|
+
for (var g = e.byteLength, s = 2; s + 1 < g; ) {
|
|
375
|
+
if (e.getUint8(s) === 255 && e.getUint8(s + 1) === 225) {
|
|
376
|
+
r = s;
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
s += 1;
|
|
380
|
+
}
|
|
381
|
+
if (r) {
|
|
382
|
+
var f = r + 4, c = r + 10;
|
|
383
|
+
if (Pt(e, f, 4) === "Exif") {
|
|
384
|
+
var v = e.getUint16(c);
|
|
385
|
+
if (a = v === 18761, (a || v === 19789) && e.getUint16(c + 2, a) === 42) {
|
|
386
|
+
var d = e.getUint32(c + 4, a);
|
|
387
|
+
d >= 8 && (o = c + d);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (o) {
|
|
392
|
+
var C = e.getUint16(o, a), h, m;
|
|
393
|
+
for (m = 0; m < C; m += 1)
|
|
394
|
+
if (h = o + m * 12 + 2, e.getUint16(h, a) === 274) {
|
|
395
|
+
h += 8, i = e.getUint16(h, a), e.setUint16(h, 1, a);
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
} catch {
|
|
400
|
+
i = 1;
|
|
401
|
+
}
|
|
402
|
+
return i;
|
|
403
|
+
}
|
|
404
|
+
function Lt(t) {
|
|
405
|
+
var e = 0, i = 1, a = 1;
|
|
406
|
+
switch (t) {
|
|
407
|
+
case 2:
|
|
408
|
+
i = -1;
|
|
409
|
+
break;
|
|
410
|
+
case 3:
|
|
411
|
+
e = -180;
|
|
412
|
+
break;
|
|
413
|
+
case 4:
|
|
414
|
+
a = -1;
|
|
415
|
+
break;
|
|
416
|
+
case 5:
|
|
417
|
+
e = 90, a = -1;
|
|
418
|
+
break;
|
|
419
|
+
case 6:
|
|
420
|
+
e = 90;
|
|
421
|
+
break;
|
|
422
|
+
case 7:
|
|
423
|
+
e = 90, i = -1;
|
|
424
|
+
break;
|
|
425
|
+
case 8:
|
|
426
|
+
e = -90;
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
rotate: e,
|
|
431
|
+
scaleX: i,
|
|
432
|
+
scaleY: a
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
var Ft = /\.\d*(?:0|9){12}\d*$/;
|
|
436
|
+
function Ze(t) {
|
|
437
|
+
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
|
|
438
|
+
return Ft.test(t) ? Math.round(t * e) / e : t;
|
|
439
|
+
}
|
|
440
|
+
function se(t) {
|
|
441
|
+
var e = t.aspectRatio, i = t.height, a = t.width, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none", o = ye(a), g = ye(i);
|
|
442
|
+
if (o && g) {
|
|
443
|
+
var s = i * e;
|
|
444
|
+
(r === "contain" || r === "none") && s > a || r === "cover" && s < a ? i = a / e : a = i * e;
|
|
445
|
+
} else o ? i = a / e : g && (a = i * e);
|
|
446
|
+
return {
|
|
447
|
+
width: a,
|
|
448
|
+
height: i
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
function Nt(t) {
|
|
452
|
+
for (var e = Se(new Uint8Array(t)), i = e.length, a = [], r = 0; r + 3 < i; ) {
|
|
453
|
+
var o = e[r], g = e[r + 1];
|
|
454
|
+
if (o === 255 && g === 218)
|
|
455
|
+
break;
|
|
456
|
+
if (o === 255 && g === 216)
|
|
457
|
+
r += 2;
|
|
458
|
+
else {
|
|
459
|
+
var s = e[r + 2] * 256 + e[r + 3], f = r + s + 2, c = e.slice(r, f);
|
|
460
|
+
a.push(c), r = f;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return a.reduce(function(v, d) {
|
|
464
|
+
return d[0] === 255 && d[1] === 225 ? v.concat(d) : v;
|
|
465
|
+
}, []);
|
|
466
|
+
}
|
|
467
|
+
function Vt(t, e) {
|
|
468
|
+
var i = Se(new Uint8Array(t));
|
|
469
|
+
if (i[2] !== 255 || i[3] !== 224)
|
|
470
|
+
return t;
|
|
471
|
+
var a = i[4] * 256 + i[5], r = [255, 216].concat(e, i.slice(4 + a));
|
|
472
|
+
return new Uint8Array(r);
|
|
473
|
+
}
|
|
474
|
+
var Jt = q.ArrayBuffer, Be = q.FileReader, te = q.URL || q.webkitURL, jt = /\.\w+$/, zt = q.Compressor, xt = /* @__PURE__ */ function() {
|
|
475
|
+
function t(e, i) {
|
|
476
|
+
Bt(this, t), this.file = e, this.exif = [], this.image = new Image(), this.options = he(he({}, Xe), i), this.aborted = !1, this.result = null, this.init();
|
|
477
|
+
}
|
|
478
|
+
return It(t, [{
|
|
479
|
+
key: "init",
|
|
480
|
+
value: function() {
|
|
481
|
+
var i = this, a = this.file, r = this.options;
|
|
482
|
+
if (!Rt(a)) {
|
|
483
|
+
this.fail(new Error("The first argument must be a File or Blob object."));
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
var o = a.type;
|
|
487
|
+
if (!ke(o)) {
|
|
488
|
+
this.fail(new Error("The first argument must be an image File or Blob object."));
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
if (!te || !Be) {
|
|
492
|
+
this.fail(new Error("The current browser does not support image compression."));
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
Jt || (r.checkOrientation = !1, r.retainExif = !1);
|
|
496
|
+
var g = o === "image/jpeg", s = g && r.checkOrientation, f = g && r.retainExif;
|
|
497
|
+
if (te && !s && !f)
|
|
498
|
+
this.load({
|
|
499
|
+
url: te.createObjectURL(a)
|
|
500
|
+
});
|
|
501
|
+
else {
|
|
502
|
+
var c = new Be();
|
|
503
|
+
this.reader = c, c.onload = function(v) {
|
|
504
|
+
var d = v.target, C = d.result, h = {}, m = 1;
|
|
505
|
+
s && (m = Mt(C), m > 1 && Ae(h, Lt(m))), f && (i.exif = Nt(C)), s || f ? !te || m > 1 ? h.url = qe(C, o) : h.url = te.createObjectURL(a) : h.url = C, i.load(h);
|
|
506
|
+
}, c.onabort = function() {
|
|
507
|
+
i.fail(new Error("Aborted to read the image with FileReader."));
|
|
508
|
+
}, c.onerror = function() {
|
|
509
|
+
i.fail(new Error("Failed to read the image with FileReader."));
|
|
510
|
+
}, c.onloadend = function() {
|
|
511
|
+
i.reader = null;
|
|
512
|
+
}, s || f ? c.readAsArrayBuffer(a) : c.readAsDataURL(a);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}, {
|
|
516
|
+
key: "load",
|
|
517
|
+
value: function(i) {
|
|
518
|
+
var a = this, r = this.file, o = this.image;
|
|
519
|
+
o.onload = function() {
|
|
520
|
+
a.draw(he(he({}, i), {}, {
|
|
521
|
+
naturalWidth: o.naturalWidth,
|
|
522
|
+
naturalHeight: o.naturalHeight
|
|
523
|
+
}));
|
|
524
|
+
}, o.onabort = function() {
|
|
525
|
+
a.fail(new Error("Aborted to load the image."));
|
|
526
|
+
}, o.onerror = function() {
|
|
527
|
+
a.fail(new Error("Failed to load the image."));
|
|
528
|
+
}, q.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(q.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt = r.name, o.src = i.url;
|
|
529
|
+
}
|
|
530
|
+
}, {
|
|
531
|
+
key: "draw",
|
|
532
|
+
value: function(i) {
|
|
533
|
+
var a = this, r = i.naturalWidth, o = i.naturalHeight, g = i.rotate, s = g === void 0 ? 0 : g, f = i.scaleX, c = f === void 0 ? 1 : f, v = i.scaleY, d = v === void 0 ? 1 : v, C = this.file, h = this.image, m = this.options, E = document.createElement("canvas"), k = E.getContext("2d"), S = Math.abs(s) % 180 === 90, K = (m.resize === "contain" || m.resize === "cover") && ye(m.width) && ye(m.height), T = Math.max(m.maxWidth, 0) || 1 / 0, M = Math.max(m.maxHeight, 0) || 1 / 0, L = Math.max(m.minWidth, 0) || 0, H = Math.max(m.minHeight, 0) || 0, z = r / o, b = m.width, B = m.height;
|
|
534
|
+
if (S) {
|
|
535
|
+
var Z = [M, T];
|
|
536
|
+
T = Z[0], M = Z[1];
|
|
537
|
+
var $ = [H, L];
|
|
538
|
+
L = $[0], H = $[1];
|
|
539
|
+
var u = [B, b];
|
|
540
|
+
b = u[0], B = u[1];
|
|
541
|
+
}
|
|
542
|
+
K && (z = b / B);
|
|
543
|
+
var w = se({
|
|
544
|
+
aspectRatio: z,
|
|
545
|
+
width: T,
|
|
546
|
+
height: M
|
|
547
|
+
}, "contain");
|
|
548
|
+
T = w.width, M = w.height;
|
|
549
|
+
var I = se({
|
|
550
|
+
aspectRatio: z,
|
|
551
|
+
width: L,
|
|
552
|
+
height: H
|
|
553
|
+
}, "cover");
|
|
554
|
+
if (L = I.width, H = I.height, K) {
|
|
555
|
+
var A = se({
|
|
556
|
+
aspectRatio: z,
|
|
557
|
+
width: b,
|
|
558
|
+
height: B
|
|
559
|
+
}, m.resize);
|
|
560
|
+
b = A.width, B = A.height;
|
|
561
|
+
} else {
|
|
562
|
+
var _ = se({
|
|
563
|
+
aspectRatio: z,
|
|
564
|
+
width: b,
|
|
565
|
+
height: B
|
|
566
|
+
}), W = _.width;
|
|
567
|
+
b = W === void 0 ? r : W;
|
|
568
|
+
var l = _.height;
|
|
569
|
+
B = l === void 0 ? o : l;
|
|
570
|
+
}
|
|
571
|
+
b = Math.floor(Ze(Math.min(Math.max(b, L), T))), B = Math.floor(Ze(Math.min(Math.max(B, H), M)));
|
|
572
|
+
var D = -b / 2, F = -B / 2, ee = b, N = B, R = [];
|
|
573
|
+
if (K) {
|
|
574
|
+
var Q = 0, P = 0, G = r, Y = o, le = se({
|
|
575
|
+
aspectRatio: z,
|
|
576
|
+
width: r,
|
|
577
|
+
height: o
|
|
578
|
+
}, {
|
|
579
|
+
contain: "cover",
|
|
580
|
+
cover: "contain"
|
|
581
|
+
}[m.resize]);
|
|
582
|
+
G = le.width, Y = le.height, Q = (r - G) / 2, P = (o - Y) / 2, R.push(Q, P, G, Y);
|
|
583
|
+
}
|
|
584
|
+
if (R.push(D, F, ee, N), S) {
|
|
585
|
+
var ue = [B, b];
|
|
586
|
+
b = ue[0], B = ue[1];
|
|
587
|
+
}
|
|
588
|
+
E.width = b, E.height = B, ke(m.mimeType) || (m.mimeType = C.type);
|
|
589
|
+
var V = "transparent";
|
|
590
|
+
C.size > m.convertSize && m.convertTypes.indexOf(m.mimeType) >= 0 && (m.mimeType = "image/jpeg");
|
|
591
|
+
var ce = m.mimeType === "image/jpeg";
|
|
592
|
+
if (ce && (V = "#fff"), k.fillStyle = V, k.fillRect(0, 0, b, B), m.beforeDraw && m.beforeDraw.call(this, k, E), !this.aborted && (k.save(), k.translate(b / 2, B / 2), k.rotate(s * Math.PI / 180), k.scale(c, d), k.drawImage.apply(k, [h].concat(R)), k.restore(), m.drew && m.drew.call(this, k, E), !this.aborted)) {
|
|
593
|
+
var me = function(re) {
|
|
594
|
+
if (!a.aborted) {
|
|
595
|
+
var Ue = function(oe) {
|
|
596
|
+
return a.done({
|
|
597
|
+
naturalWidth: r,
|
|
598
|
+
naturalHeight: o,
|
|
599
|
+
result: oe
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
if (re && ce && m.retainExif && a.exif && a.exif.length > 0) {
|
|
603
|
+
var Oe = function(oe) {
|
|
604
|
+
return Ue(Ge(qe(Vt(oe, a.exif), m.mimeType)));
|
|
605
|
+
};
|
|
606
|
+
if (re.arrayBuffer)
|
|
607
|
+
re.arrayBuffer().then(Oe).catch(function() {
|
|
608
|
+
a.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
|
|
609
|
+
});
|
|
610
|
+
else {
|
|
611
|
+
var ae = new Be();
|
|
612
|
+
a.reader = ae, ae.onload = function(Ce) {
|
|
613
|
+
var oe = Ce.target;
|
|
614
|
+
Oe(oe.result);
|
|
615
|
+
}, ae.onabort = function() {
|
|
616
|
+
a.fail(new Error("Aborted to read the compressed image with FileReader."));
|
|
617
|
+
}, ae.onerror = function() {
|
|
618
|
+
a.fail(new Error("Failed to read the compressed image with FileReader."));
|
|
619
|
+
}, ae.onloadend = function() {
|
|
620
|
+
a.reader = null;
|
|
621
|
+
}, ae.readAsArrayBuffer(re);
|
|
622
|
+
}
|
|
623
|
+
} else
|
|
624
|
+
Ue(re);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
E.toBlob ? E.toBlob(me, m.mimeType, m.quality) : me(Ge(E.toDataURL(m.mimeType, m.quality)));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}, {
|
|
631
|
+
key: "done",
|
|
632
|
+
value: function(i) {
|
|
633
|
+
var a = i.naturalWidth, r = i.naturalHeight, o = i.result, g = this.file, s = this.image, f = this.options;
|
|
634
|
+
if (te && s.src.indexOf("blob:") === 0 && te.revokeObjectURL(s.src), o)
|
|
635
|
+
if (f.strict && !f.retainExif && o.size > g.size && f.mimeType === g.type && !(f.width > a || f.height > r || f.minWidth > a || f.minHeight > r || f.maxWidth < a || f.maxHeight < r))
|
|
636
|
+
o = g;
|
|
637
|
+
else {
|
|
638
|
+
var c = /* @__PURE__ */ new Date();
|
|
639
|
+
o.lastModified = c.getTime(), o.lastModifiedDate = c, o.name = g.name, o.name && o.type !== g.type && (o.name = o.name.replace(jt, Qt(o.type)));
|
|
640
|
+
}
|
|
641
|
+
else
|
|
642
|
+
o = g;
|
|
643
|
+
this.result = o, f.success && f.success.call(this, o);
|
|
644
|
+
}
|
|
645
|
+
}, {
|
|
646
|
+
key: "fail",
|
|
647
|
+
value: function(i) {
|
|
648
|
+
var a = this.options;
|
|
649
|
+
if (a.error)
|
|
650
|
+
a.error.call(this, i);
|
|
651
|
+
else
|
|
652
|
+
throw i;
|
|
653
|
+
}
|
|
654
|
+
}, {
|
|
655
|
+
key: "abort",
|
|
656
|
+
value: function() {
|
|
657
|
+
this.aborted || (this.aborted = !0, this.reader ? this.reader.abort() : this.image.complete ? this.fail(new Error("The compression process has been aborted.")) : (this.image.onload = null, this.image.onabort()));
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Get the no conflict compressor class.
|
|
661
|
+
* @returns {Compressor} The compressor class.
|
|
662
|
+
*/
|
|
663
|
+
}], [{
|
|
664
|
+
key: "noConflict",
|
|
665
|
+
value: function() {
|
|
666
|
+
return window.Compressor = zt, t;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Change the default options.
|
|
670
|
+
* @param {Object} options - The new default options.
|
|
671
|
+
*/
|
|
672
|
+
}, {
|
|
673
|
+
key: "setDefaults",
|
|
674
|
+
value: function(i) {
|
|
675
|
+
Ae(Xe, i);
|
|
676
|
+
}
|
|
677
|
+
}]), t;
|
|
678
|
+
}();
|
|
679
|
+
const Kt = (t, e) => new Promise((i, a) => {
|
|
680
|
+
if (t.size <= e)
|
|
681
|
+
return t;
|
|
682
|
+
const r = e / t.size, o = Math.max(0.5, Math.min(0.9, 0.8 * r)), g = Math.max(800, Math.min(1920, 1920 * Math.sqrt(r)));
|
|
683
|
+
$e(t, o, g, g, (s) => {
|
|
684
|
+
s.size <= e ? i(s) : $e(
|
|
685
|
+
s,
|
|
686
|
+
Math.max(0.4, o - 0.2),
|
|
687
|
+
// 降低质量
|
|
688
|
+
Math.max(640, g * 0.8),
|
|
689
|
+
// 缩小尺寸
|
|
690
|
+
Math.max(640, g * 0.8),
|
|
691
|
+
i,
|
|
692
|
+
a,
|
|
693
|
+
t
|
|
694
|
+
// 传递原始文件用于错误处理
|
|
695
|
+
);
|
|
696
|
+
}, a, t);
|
|
697
|
+
}), $e = (t, e, i, a, r, o, g) => {
|
|
698
|
+
new xt(t, {
|
|
699
|
+
quality: e,
|
|
700
|
+
maxWidth: i,
|
|
701
|
+
maxHeight: a,
|
|
702
|
+
convertSize: 1 / 0,
|
|
703
|
+
success(s) {
|
|
704
|
+
try {
|
|
705
|
+
const f = new File([s], t.name, {
|
|
706
|
+
type: s.type || t.type,
|
|
707
|
+
lastModified: Date.now()
|
|
708
|
+
});
|
|
709
|
+
r(f);
|
|
710
|
+
} catch (f) {
|
|
711
|
+
o({
|
|
712
|
+
message: "文件转换失败",
|
|
713
|
+
error: f,
|
|
714
|
+
original: g || t
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
},
|
|
718
|
+
error(s) {
|
|
719
|
+
o({
|
|
720
|
+
message: "图片压缩失败",
|
|
721
|
+
error: s,
|
|
722
|
+
original: g || t
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
}, Ht = (t, e) => {
|
|
727
|
+
const i = De(), a = be(t, "modelValue"), r = be(t, "status"), { upload: o } = At(t), { size2B: g } = yt(), { handlerImageSrc: s } = Ct(t), f = be(t, "isOverMaxLimitCompressImg"), c = Ee(""), v = Ee([]), d = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], C = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], h = x(() => t.baseUrl ? t.baseUrl : process.env.NODE_ENV === "production" ? "" : i.baseURL || ""), m = (l) => {
|
|
728
|
+
if (l) {
|
|
729
|
+
const D = l.substring(l.lastIndexOf(".")).toLowerCase();
|
|
730
|
+
if (d.includes(D)) return "isVideo";
|
|
731
|
+
if (C.includes(D)) return "isAudio";
|
|
101
732
|
}
|
|
102
733
|
return "isImg";
|
|
103
|
-
},
|
|
104
|
-
var
|
|
105
|
-
let
|
|
106
|
-
return
|
|
107
|
-
}),
|
|
108
|
-
const
|
|
109
|
-
if (typeof
|
|
110
|
-
return
|
|
111
|
-
for (const
|
|
112
|
-
|
|
113
|
-
return
|
|
114
|
-
}),
|
|
734
|
+
}, E = x(() => {
|
|
735
|
+
var D;
|
|
736
|
+
let l = t.accept ? (D = t.accept) == null ? void 0 : D.split(",") : [];
|
|
737
|
+
return l.includes("image/jpg") && !l.includes("image/jpeg") && l.push("image/jpeg"), l.includes(".jpg") && !l.includes(".jpeg") && l.push(".jpeg"), t.acceptVideo && (l = [...l, ...d]), t.acceptAudio && (l = [...l, ...C]), l.join(",");
|
|
738
|
+
}), k = x(() => r.value === "uploading"), S = Ee(0), K = (l) => k.value ? S.value === l : !1, T = x(() => a.value ? [s(h.value, a.value)] : []), M = x(() => a.value ? a.value.map((l) => [s(h.value, l)]) : []), L = x(() => t.status !== "info" && (t.needDeleteBtn || t.needChangeBtn) || t.needDownloadBtn), H = x(() => t.status !== "info" && t.needDeleteBtn || t.needDownloadBtn), z = x(() => {
|
|
739
|
+
const l = [], D = t.previewBtnConfig;
|
|
740
|
+
if (typeof D == "boolean")
|
|
741
|
+
return D ? ["zoom_in", "zoom_out", "turn_left", "turn_right", "full_screen"] : [];
|
|
742
|
+
for (const F in D)
|
|
743
|
+
D[F] && l.push(F);
|
|
744
|
+
return l;
|
|
745
|
+
}), b = () => {
|
|
115
746
|
setTimeout(() => {
|
|
116
|
-
const
|
|
117
|
-
|
|
747
|
+
const l = document.querySelector(".el-image-viewer__wrapper");
|
|
748
|
+
l == null || l.classList.add("das-image-viewer-preview-btn-groups"), l == null || l.classList.add(...z.value);
|
|
118
749
|
}, 0);
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
t.limitNum === 1 ? (
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
let
|
|
127
|
-
t.limitNum === 1 ?
|
|
128
|
-
},
|
|
129
|
-
|
|
750
|
+
}, B = (l) => {
|
|
751
|
+
e("clickChangeIcon", l);
|
|
752
|
+
}, Z = (l, D) => {
|
|
753
|
+
t.limitNum === 1 ? (a.value = "", e("update:modelValue", ""), e("deleteImage", l)) : (a.value.splice(D, 1), e("update:modelValue", a.value), e("deleteImage", l));
|
|
754
|
+
}, $ = (l, D = 0) => {
|
|
755
|
+
var ee;
|
|
756
|
+
e("downloadImage", l);
|
|
757
|
+
let F = "";
|
|
758
|
+
t.limitNum === 1 ? F = t.imageName || c.value : F = ((ee = t.imageName) == null ? void 0 : ee[D]) || v.value[D], m(l) === "isImg" ? gt(s(h.value, l), F) : vt(s(h.value, l), F);
|
|
759
|
+
}, u = [
|
|
760
|
+
"image/jpeg",
|
|
761
|
+
"image/png",
|
|
762
|
+
"image/webp",
|
|
763
|
+
"image/gif",
|
|
764
|
+
"image/bmp",
|
|
765
|
+
"image/tiff",
|
|
766
|
+
"image/svg+xml"
|
|
767
|
+
], w = async (l, D) => {
|
|
768
|
+
var ee;
|
|
130
769
|
if (t.maxSize) {
|
|
131
|
-
const { finalSize:
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
770
|
+
const { finalSize: N, sizeText: R } = g(t.maxSize);
|
|
771
|
+
if (l.size > N && !f.value) {
|
|
772
|
+
const Q = Ke.value === "zh-CN" ? "、" : ", ", P = He(
|
|
134
773
|
"das-ui-import-upload-key3",
|
|
135
|
-
|
|
136
|
-
((
|
|
137
|
-
).value,
|
|
138
|
-
return
|
|
774
|
+
R,
|
|
775
|
+
((ee = E.value) == null ? void 0 : ee.toUpperCase().replaceAll(".", "").replaceAll(",", Q)) ?? ""
|
|
776
|
+
).value, G = t.errorMessage || P;
|
|
777
|
+
return xe.warning(G), !1;
|
|
139
778
|
}
|
|
140
779
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
780
|
+
const F = async (N) => {
|
|
781
|
+
let R = l;
|
|
782
|
+
if (t.maxSize) {
|
|
783
|
+
const { finalSize: P, sizeText: G } = g(t.maxSize);
|
|
784
|
+
if (l.size > P && f.value && u.includes(l.type))
|
|
785
|
+
try {
|
|
786
|
+
R = await Kt(l, P);
|
|
787
|
+
} catch (Y) {
|
|
788
|
+
R = (Y == null ? void 0 : Y.original) || l;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
S.value = N, e("update:status", "uploading"), e("image-upload", R);
|
|
792
|
+
const Q = await o(R);
|
|
793
|
+
return Q === "error" ? (e("update:status", "error"), !1) : (e("upload-success", R, Q), t.limitNum === 1 ? a.value = Q : a.value[N] = Q, e("update:modelValue", a.value), e("update:status", "normal"), !1);
|
|
145
794
|
};
|
|
146
795
|
if (t.customCheck) {
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
return new Promise(async (
|
|
150
|
-
let
|
|
796
|
+
const N = t.customCheck(l);
|
|
797
|
+
if (N instanceof Promise)
|
|
798
|
+
return new Promise(async (R, Q) => {
|
|
799
|
+
let P;
|
|
151
800
|
try {
|
|
152
|
-
|
|
801
|
+
P = await N.then();
|
|
153
802
|
} catch {
|
|
154
|
-
|
|
803
|
+
P = !1;
|
|
155
804
|
}
|
|
156
|
-
|
|
805
|
+
P ? F(D) : Q(!1);
|
|
157
806
|
});
|
|
158
|
-
if (!
|
|
159
|
-
} else if (
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
if (!
|
|
163
|
-
const
|
|
164
|
-
return
|
|
807
|
+
if (!N) return !1;
|
|
808
|
+
} else if (E.value) {
|
|
809
|
+
const N = E.value.split(",").filter((V) => V.trim().startsWith(".")).map((V) => V.trim()), R = E.value.split(",").filter((V) => !V.trim().startsWith(".")).map((V) => V.trim()), Q = mt(l.name), P = N.includes(Q);
|
|
810
|
+
let G = R.includes("image/*") && l.type.split("/")[0].trim() === "image", Y = R.includes("video/*") && l.type.split("/")[0].trim() === "video", le = R.includes("audio/*") && l.type.split("/")[0].trim() === "audio", ue = R.includes(l.type) || G || Y || le;
|
|
811
|
+
if (!P && !ue) {
|
|
812
|
+
const V = t.acceptAudio || t.acceptVideo ? "das-ui-import-upload-key2" : "das-ui-import-upload-key1", ce = Ke.value === "zh-CN" ? "、" : ", ", me = t.errorMessage || He(V, E.value.toUpperCase().replaceAll(".", "").replaceAll(",", ce)).value;
|
|
813
|
+
return xe.warning(me), !1;
|
|
165
814
|
}
|
|
166
815
|
}
|
|
167
|
-
return
|
|
168
|
-
},
|
|
169
|
-
t.limitNum !== 1 && (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
if (
|
|
174
|
-
|
|
816
|
+
return F(D);
|
|
817
|
+
}, I = async (l) => {
|
|
818
|
+
t.limitNum !== 1 && (S.value = a.length), e("update:status", "uploading"), e("image-upload", l);
|
|
819
|
+
const D = await o(l);
|
|
820
|
+
e("upload-success", l, D), t.limitNum === 1 ? A(D) : _(D);
|
|
821
|
+
}, A = (l) => {
|
|
822
|
+
if (l === "error") {
|
|
823
|
+
e("update:status", "error");
|
|
175
824
|
return;
|
|
176
825
|
}
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
if (
|
|
180
|
-
|
|
826
|
+
a.value = l, e("update:modelValue", a.value), e("update:status", "normal");
|
|
827
|
+
}, _ = (l) => {
|
|
828
|
+
if (l === "error") {
|
|
829
|
+
e("update:status", "error");
|
|
181
830
|
return;
|
|
182
831
|
}
|
|
183
|
-
|
|
832
|
+
a.value.push(l), e("update:modelValue", a.value), e("update:status", "normal");
|
|
184
833
|
};
|
|
185
|
-
return
|
|
186
|
-
const
|
|
187
|
-
|
|
834
|
+
return st(a, async () => {
|
|
835
|
+
const l = t.limitNum ?? 1;
|
|
836
|
+
l === 1 && a.value ? c.value = await Et(a.value) : l > 1 && a.value.length > 0 && (v.value = await bt(a.value));
|
|
188
837
|
}, {
|
|
189
838
|
deep: !0,
|
|
190
839
|
immediate: !0
|
|
191
840
|
}), {
|
|
192
|
-
url:
|
|
193
|
-
singlePreviewList:
|
|
194
|
-
multiPreviewList:
|
|
195
|
-
isAccept:
|
|
196
|
-
loading:
|
|
197
|
-
uploadStatus:
|
|
198
|
-
previewBtns:
|
|
199
|
-
operateShow:
|
|
200
|
-
operateShow_Multi:
|
|
201
|
-
singlePreviewName:
|
|
202
|
-
multiPreviewName:
|
|
203
|
-
getFileType:
|
|
204
|
-
changeImg:
|
|
205
|
-
delImg:
|
|
206
|
-
beforeupload:
|
|
207
|
-
uploadImg:
|
|
208
|
-
onDownload:
|
|
209
|
-
handleImageClick:
|
|
210
|
-
isLoadingMulti:
|
|
841
|
+
url: a,
|
|
842
|
+
singlePreviewList: T,
|
|
843
|
+
multiPreviewList: M,
|
|
844
|
+
isAccept: E,
|
|
845
|
+
loading: k,
|
|
846
|
+
uploadStatus: r,
|
|
847
|
+
previewBtns: z,
|
|
848
|
+
operateShow: L,
|
|
849
|
+
operateShow_Multi: H,
|
|
850
|
+
singlePreviewName: c,
|
|
851
|
+
multiPreviewName: v,
|
|
852
|
+
getFileType: m,
|
|
853
|
+
changeImg: B,
|
|
854
|
+
delImg: Z,
|
|
855
|
+
beforeupload: w,
|
|
856
|
+
uploadImg: I,
|
|
857
|
+
onDownload: $,
|
|
858
|
+
handleImageClick: b,
|
|
859
|
+
isLoadingMulti: K
|
|
211
860
|
};
|
|
212
|
-
},
|
|
213
|
-
var
|
|
214
|
-
const { __IN_DAS_MICRO_APP:
|
|
215
|
-
if (!
|
|
216
|
-
const { origin:
|
|
217
|
-
(
|
|
218
|
-
},
|
|
219
|
-
sendMessageToMainApp:
|
|
861
|
+
}, Wt = (t, e) => {
|
|
862
|
+
var o;
|
|
863
|
+
const { __IN_DAS_MICRO_APP: i, __DAS_MAIN_APP_HREF: a } = window;
|
|
864
|
+
if (!i || !a) return;
|
|
865
|
+
const { origin: r } = new URL(a);
|
|
866
|
+
(o = window.top) == null || o.postMessage({ type: t, data: e }, r);
|
|
867
|
+
}, nt = "proxy-image-viewer", we = {
|
|
868
|
+
sendMessageToMainApp: Wt,
|
|
220
869
|
// @ts-ignore
|
|
221
870
|
isMicroApp: () => window.__IN_DAS_MICRO_APP && window.top !== window.self,
|
|
222
871
|
addEventFromMicroApp: () => {
|
|
223
872
|
window.addEventListener("message", (t) => {
|
|
224
|
-
const { type:
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
const { previewList:
|
|
229
|
-
urlList:
|
|
873
|
+
const { type: e, data: i } = t.data;
|
|
874
|
+
if (e !== nt) return;
|
|
875
|
+
const a = document.createElement("div");
|
|
876
|
+
a.classList.add("das-image-viewer-preview-btn-groups");
|
|
877
|
+
const { previewList: r, previewBtns: o } = i, g = lt(ct, {
|
|
878
|
+
urlList: r,
|
|
230
879
|
onClose: () => {
|
|
231
|
-
|
|
880
|
+
g.unmount(), document.body.removeChild(a);
|
|
232
881
|
}
|
|
233
882
|
});
|
|
234
|
-
document.body.appendChild(
|
|
235
|
-
const
|
|
236
|
-
|
|
883
|
+
document.body.appendChild(a), g.mount(a), setTimeout(() => {
|
|
884
|
+
const s = document.querySelector(".el-image-viewer__wrapper");
|
|
885
|
+
s == null || s.classList.add("das-image-viewer-preview-btn-groups"), s == null || s.classList.add(...o);
|
|
237
886
|
}, 0);
|
|
238
887
|
});
|
|
239
888
|
}
|
|
240
889
|
};
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
const { handleImageClickProxy:
|
|
244
|
-
return { needPreviewImage:
|
|
890
|
+
we.addEventFromMicroApp();
|
|
891
|
+
const Yt = (t) => {
|
|
892
|
+
const { handleImageClickProxy: e, previewBtns: i } = t;
|
|
893
|
+
return { needPreviewImage: x(() => !t.needPreview || we.isMicroApp() ? !1 : t.needPreview), handleImageClick: (o) => {
|
|
245
894
|
if (!t.needPreview) return;
|
|
246
|
-
if (!
|
|
247
|
-
|
|
895
|
+
if (!we.isMicroApp()) {
|
|
896
|
+
e();
|
|
248
897
|
return;
|
|
249
898
|
}
|
|
250
|
-
let
|
|
251
|
-
Array.isArray(
|
|
252
|
-
previewList:
|
|
253
|
-
previewBtns:
|
|
899
|
+
let g = [];
|
|
900
|
+
Array.isArray(o) && g.push(...o), typeof o == "string" && g.push(o), we.sendMessageToMainApp(nt, {
|
|
901
|
+
previewList: g,
|
|
902
|
+
previewBtns: i.value
|
|
254
903
|
});
|
|
255
904
|
} };
|
|
256
|
-
},
|
|
905
|
+
}, Gt = {
|
|
257
906
|
key: 0,
|
|
258
907
|
class: "das-ui-image-viewer-container"
|
|
259
|
-
},
|
|
908
|
+
}, Xt = {
|
|
260
909
|
class: "no-data-img",
|
|
261
|
-
src:
|
|
910
|
+
src: Ie,
|
|
262
911
|
alt: ""
|
|
263
|
-
},
|
|
912
|
+
}, qt = { class: "image-name" }, Zt = { class: "das-ui-image-viewer-groups" }, $t = { class: "image-name" }, _t = { class: "das-ui-image-viewer-container" }, ea = {
|
|
264
913
|
key: 1,
|
|
265
914
|
class: "das-ui-image-viewer-container"
|
|
266
|
-
},
|
|
915
|
+
}, ta = { class: "das-ui-image-viewer" }, aa = {
|
|
267
916
|
key: 2,
|
|
268
917
|
class: "das-ui-image-viewer"
|
|
269
|
-
},
|
|
918
|
+
}, ia = /* @__PURE__ */ ut({
|
|
270
919
|
__name: "Index",
|
|
271
920
|
props: {
|
|
272
921
|
style: { default: "" },
|
|
@@ -299,136 +948,137 @@ const _e = (t) => {
|
|
|
299
948
|
videoHeight: {},
|
|
300
949
|
randomName: { type: Boolean, default: !1 },
|
|
301
950
|
useOriginUrl: { type: Boolean, default: !1 },
|
|
302
|
-
openFileDialogOnClick: { type: Boolean, default: !0 }
|
|
951
|
+
openFileDialogOnClick: { type: Boolean, default: !0 },
|
|
952
|
+
isOverMaxLimitCompressImg: { type: Boolean, default: !1 }
|
|
303
953
|
},
|
|
304
954
|
emits: ["update:modelValue", "update:status", "downloadImage", "image-upload", "upload-success", "clickChangeIcon", "deleteImage"],
|
|
305
|
-
setup(t, { emit:
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
].filter((
|
|
312
|
-
let
|
|
313
|
-
return
|
|
314
|
-
"justify-content":
|
|
955
|
+
setup(t, { emit: e }) {
|
|
956
|
+
const i = t, a = e, r = x(() => {
|
|
957
|
+
const w = [
|
|
958
|
+
i.needDownloadBtn,
|
|
959
|
+
i.limitNum === 1 && d.value !== "info" && i.needChangeBtn,
|
|
960
|
+
d.value !== "info" && i.needDeleteBtn
|
|
961
|
+
].filter((A) => A).length;
|
|
962
|
+
let I = "center";
|
|
963
|
+
return w === 2 && (I = "space-around"), w === 3 && (I = "space-between"), {
|
|
964
|
+
"justify-content": I
|
|
315
965
|
};
|
|
316
|
-
}),
|
|
317
|
-
|
|
966
|
+
}), o = x(() => i.mode === "view" ? !1 : s.value ? d.value === "error" : d.value !== "info"), g = (u) => {
|
|
967
|
+
u.stopPropagation();
|
|
318
968
|
}, {
|
|
319
|
-
url:
|
|
320
|
-
isAccept:
|
|
321
|
-
singlePreviewList:
|
|
322
|
-
multiPreviewList:
|
|
323
|
-
uploadStatus:
|
|
324
|
-
loading:
|
|
325
|
-
previewBtns:
|
|
326
|
-
operateShow:
|
|
327
|
-
operateShow_Multi:
|
|
328
|
-
singlePreviewName:
|
|
329
|
-
multiPreviewName:
|
|
330
|
-
changeImg:
|
|
331
|
-
delImg:
|
|
332
|
-
beforeupload:
|
|
333
|
-
uploadImg:
|
|
334
|
-
onDownload:
|
|
335
|
-
handleImageClick:
|
|
336
|
-
getFileType:
|
|
337
|
-
isLoadingMulti:
|
|
338
|
-
} =
|
|
339
|
-
needPreview:
|
|
340
|
-
handleImageClickProxy:
|
|
341
|
-
previewBtns:
|
|
969
|
+
url: s,
|
|
970
|
+
isAccept: f,
|
|
971
|
+
singlePreviewList: c,
|
|
972
|
+
multiPreviewList: v,
|
|
973
|
+
uploadStatus: d,
|
|
974
|
+
loading: C,
|
|
975
|
+
previewBtns: h,
|
|
976
|
+
operateShow: m,
|
|
977
|
+
operateShow_Multi: E,
|
|
978
|
+
singlePreviewName: k,
|
|
979
|
+
multiPreviewName: S,
|
|
980
|
+
changeImg: K,
|
|
981
|
+
delImg: T,
|
|
982
|
+
beforeupload: M,
|
|
983
|
+
uploadImg: L,
|
|
984
|
+
onDownload: H,
|
|
985
|
+
handleImageClick: z,
|
|
986
|
+
getFileType: b,
|
|
987
|
+
isLoadingMulti: B
|
|
988
|
+
} = Ht(i, a), { needPreviewImage: Z, handleImageClick: $ } = Yt({
|
|
989
|
+
needPreview: i.needPreview,
|
|
990
|
+
handleImageClickProxy: z,
|
|
991
|
+
previewBtns: h
|
|
342
992
|
});
|
|
343
|
-
return (
|
|
344
|
-
|
|
993
|
+
return (u, w) => (y(), U(
|
|
994
|
+
de,
|
|
345
995
|
null,
|
|
346
996
|
[
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
997
|
+
p(" 单文件 "),
|
|
998
|
+
u.limitNum === 1 ? (y(), U("div", Gt, [
|
|
999
|
+
X(
|
|
350
1000
|
"div",
|
|
351
1001
|
{
|
|
352
1002
|
class: "das-ui-image-viewer",
|
|
353
|
-
style:
|
|
1003
|
+
style: fe(u.style)
|
|
354
1004
|
},
|
|
355
1005
|
[
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
class:
|
|
1006
|
+
p(" 状态不为 error 时显示 "),
|
|
1007
|
+
J(ie(n(Je), {
|
|
1008
|
+
class: ge([{ "loading-border": n(C) }]),
|
|
359
1009
|
type: "component",
|
|
360
|
-
spinning:
|
|
1010
|
+
spinning: n(C)
|
|
361
1011
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
|
|
364
|
-
|
|
1012
|
+
default: ne(() => [
|
|
1013
|
+
p(" 图片 "),
|
|
1014
|
+
n(b)(n(c)[0]) === "isImg" ? J((y(), O(n(Le), {
|
|
365
1015
|
key: 0,
|
|
366
|
-
class:
|
|
1016
|
+
class: ge(["image-context", [n(h)]]),
|
|
367
1017
|
"preview-teleported": !0,
|
|
368
|
-
src:
|
|
369
|
-
"preview-src-list":
|
|
1018
|
+
src: n(c)[0],
|
|
1019
|
+
"preview-src-list": n(Z) ? n(c) : void 0,
|
|
370
1020
|
"initial-index": 0,
|
|
371
|
-
fit:
|
|
372
|
-
onClick:
|
|
1021
|
+
fit: u.imageFit,
|
|
1022
|
+
onClick: w[0] || (w[0] = (I) => n($)(n(c)))
|
|
373
1023
|
}, null, 8, ["class", "src", "preview-src-list", "fit"])), [
|
|
374
|
-
[
|
|
375
|
-
]) :
|
|
376
|
-
|
|
377
|
-
|
|
1024
|
+
[j, !n(C)]
|
|
1025
|
+
]) : p("v-if", !0),
|
|
1026
|
+
p(" 视频 "),
|
|
1027
|
+
n(b)(n(c)[0]) === "isVideo" ? J((y(), O(n(ve), {
|
|
378
1028
|
key: 1,
|
|
379
|
-
mode:
|
|
380
|
-
src:
|
|
381
|
-
needPreview:
|
|
1029
|
+
mode: n(d) === "info" || u.mode === "view" ? "view" : "normal",
|
|
1030
|
+
src: n(c)[0],
|
|
1031
|
+
needPreview: u.needPreview,
|
|
382
1032
|
width: "100%",
|
|
383
1033
|
height: "100%",
|
|
384
|
-
"player-props": { videoWidth:
|
|
1034
|
+
"player-props": { videoWidth: u.videoWidth, videoHeight: u.videoHeight },
|
|
385
1035
|
fullPath: ""
|
|
386
1036
|
}, null, 8, ["mode", "src", "needPreview", "player-props"])), [
|
|
387
|
-
[
|
|
388
|
-
]) :
|
|
389
|
-
|
|
390
|
-
|
|
1037
|
+
[j, !n(C)]
|
|
1038
|
+
]) : p("v-if", !0),
|
|
1039
|
+
p(" 音频 "),
|
|
1040
|
+
n(b)(n(c)[0]) === "isAudio" ? J((y(), O(n(ve), {
|
|
391
1041
|
key: 2,
|
|
392
|
-
mode:
|
|
393
|
-
src:
|
|
394
|
-
needPreview:
|
|
1042
|
+
mode: n(d) === "info" || u.mode === "view" ? "view" : "normal",
|
|
1043
|
+
src: n(c)[0],
|
|
1044
|
+
needPreview: u.needPreview,
|
|
395
1045
|
width: "100%",
|
|
396
1046
|
height: "100%",
|
|
397
1047
|
type: "audio",
|
|
398
1048
|
fullPath: ""
|
|
399
1049
|
}, null, 8, ["mode", "src", "needPreview"])), [
|
|
400
|
-
[
|
|
401
|
-
]) :
|
|
402
|
-
!
|
|
1050
|
+
[j, !n(C)]
|
|
1051
|
+
]) : p("v-if", !0),
|
|
1052
|
+
!n(C) && n(m) ? (y(), U(
|
|
403
1053
|
"div",
|
|
404
1054
|
{
|
|
405
1055
|
key: 3,
|
|
406
1056
|
class: "operate-container",
|
|
407
|
-
style:
|
|
408
|
-
onClick:
|
|
1057
|
+
style: fe(r.value),
|
|
1058
|
+
onClick: g
|
|
409
1059
|
},
|
|
410
1060
|
[
|
|
411
|
-
|
|
1061
|
+
u.needDownloadBtn ? (y(), O(n(je), {
|
|
412
1062
|
key: 0,
|
|
413
1063
|
class: "operate-btn",
|
|
414
1064
|
size: "medium",
|
|
415
1065
|
"icon-color": "#fff",
|
|
416
|
-
onClick:
|
|
417
|
-
})) :
|
|
418
|
-
|
|
1066
|
+
onClick: w[1] || (w[1] = (I) => n(H)(n(s)))
|
|
1067
|
+
})) : p("v-if", !0),
|
|
1068
|
+
n(d) !== "info" && u.needChangeBtn ? (y(), U("div", {
|
|
419
1069
|
key: 1,
|
|
420
1070
|
class: "change-icon-box",
|
|
421
|
-
onClick:
|
|
1071
|
+
onClick: w[2] || (w[2] = (I) => n(K)(n(s)))
|
|
422
1072
|
}, [
|
|
423
|
-
|
|
1073
|
+
u.openFileDialogOnClick ? (y(), O(n(Fe), {
|
|
424
1074
|
key: 0,
|
|
425
|
-
"before-upload": (
|
|
426
|
-
accept:
|
|
427
|
-
openFileDialogOnClick:
|
|
1075
|
+
"before-upload": (I) => n(M)(I, 0),
|
|
1076
|
+
accept: n(f),
|
|
1077
|
+
openFileDialogOnClick: u.openFileDialogOnClick
|
|
428
1078
|
}, {
|
|
429
|
-
itemRender:
|
|
430
|
-
default:
|
|
431
|
-
|
|
1079
|
+
itemRender: ne(({ file: I, actions: A }) => w[7] || (w[7] = [])),
|
|
1080
|
+
default: ne(() => [
|
|
1081
|
+
ie(n(pe), {
|
|
432
1082
|
class: "operate-btn m-t-6",
|
|
433
1083
|
"icon-color": "#fff",
|
|
434
1084
|
size: "medium"
|
|
@@ -436,168 +1086,169 @@ const _e = (t) => {
|
|
|
436
1086
|
]),
|
|
437
1087
|
_: 1
|
|
438
1088
|
/* STABLE */
|
|
439
|
-
}, 8, ["before-upload", "accept", "openFileDialogOnClick"])) :
|
|
440
|
-
|
|
1089
|
+
}, 8, ["before-upload", "accept", "openFileDialogOnClick"])) : p("v-if", !0),
|
|
1090
|
+
u.openFileDialogOnClick ? p("v-if", !0) : (y(), O(n(pe), {
|
|
441
1091
|
key: 1,
|
|
442
1092
|
class: "operate-btn m-t-6",
|
|
443
1093
|
"icon-color": "#fff",
|
|
444
1094
|
size: "medium"
|
|
445
1095
|
}))
|
|
446
|
-
])) :
|
|
447
|
-
|
|
1096
|
+
])) : p("v-if", !0),
|
|
1097
|
+
n(d) !== "info" && u.needDeleteBtn ? (y(), O(n(ze), {
|
|
448
1098
|
key: 2,
|
|
449
1099
|
class: "operate-btn",
|
|
450
1100
|
"icon-color": "#fff",
|
|
451
1101
|
size: "medium",
|
|
452
|
-
onClick:
|
|
453
|
-
})) :
|
|
1102
|
+
onClick: w[3] || (w[3] = (I) => n(T)(n(s)))
|
|
1103
|
+
})) : p("v-if", !0)
|
|
454
1104
|
],
|
|
455
1105
|
4
|
|
456
1106
|
/* STYLE */
|
|
457
|
-
)) :
|
|
1107
|
+
)) : p("v-if", !0)
|
|
458
1108
|
]),
|
|
459
1109
|
_: 1
|
|
460
1110
|
/* STABLE */
|
|
461
1111
|
}, 8, ["class", "spinning"]), [
|
|
462
|
-
[
|
|
1112
|
+
[j, n(s) && u.status !== "error"]
|
|
463
1113
|
]),
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
status:
|
|
467
|
-
"onUpdate:status":
|
|
468
|
-
"max-size":
|
|
469
|
-
accept:
|
|
470
|
-
acceptVideo:
|
|
471
|
-
message:
|
|
472
|
-
acceptAudio:
|
|
473
|
-
autoContentType:
|
|
474
|
-
"custom-check":
|
|
475
|
-
"error-message":
|
|
476
|
-
openFileDialogOnClick:
|
|
477
|
-
onImageUpload:
|
|
478
|
-
|
|
479
|
-
|
|
1114
|
+
p(" 上传模式,当 url 为空或者 uploading 和 error 时显示 "),
|
|
1115
|
+
J(ie(n(Ve), {
|
|
1116
|
+
status: n(d),
|
|
1117
|
+
"onUpdate:status": w[4] || (w[4] = (I) => Qe(d) ? d.value = I : null),
|
|
1118
|
+
"max-size": u.maxSize,
|
|
1119
|
+
accept: u.accept,
|
|
1120
|
+
acceptVideo: u.acceptVideo,
|
|
1121
|
+
message: u.message,
|
|
1122
|
+
acceptAudio: u.acceptAudio,
|
|
1123
|
+
autoContentType: u.autoContentType,
|
|
1124
|
+
"custom-check": u.customCheck,
|
|
1125
|
+
"error-message": u.errorMessage,
|
|
1126
|
+
openFileDialogOnClick: u.openFileDialogOnClick,
|
|
1127
|
+
onImageUpload: n(L),
|
|
1128
|
+
isOverMaxLimitCompressImg: u.isOverMaxLimitCompressImg
|
|
1129
|
+
}, null, 8, ["status", "max-size", "accept", "acceptVideo", "message", "acceptAudio", "autoContentType", "custom-check", "error-message", "openFileDialogOnClick", "onImageUpload", "isOverMaxLimitCompressImg"]), [
|
|
1130
|
+
[j, o.value]
|
|
480
1131
|
]),
|
|
481
|
-
|
|
482
|
-
|
|
1132
|
+
p(" 查看模式 "),
|
|
1133
|
+
J(X(
|
|
483
1134
|
"img",
|
|
484
|
-
|
|
1135
|
+
Xt,
|
|
485
1136
|
null,
|
|
486
1137
|
512
|
|
487
1138
|
/* NEED_PATCH */
|
|
488
1139
|
), [
|
|
489
|
-
[
|
|
1140
|
+
[j, !n(s) && (n(d) === "info" || u.mode === "view")]
|
|
490
1141
|
])
|
|
491
1142
|
],
|
|
492
1143
|
4
|
|
493
1144
|
/* STYLE */
|
|
494
1145
|
),
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
1146
|
+
J((y(), U("div", qt, [
|
|
1147
|
+
Pe(
|
|
1148
|
+
Te(i.imageName || n(k)),
|
|
498
1149
|
1
|
|
499
1150
|
/* TEXT */
|
|
500
1151
|
)
|
|
501
1152
|
])), [
|
|
502
|
-
[
|
|
503
|
-
[
|
|
1153
|
+
[j, n(s) && u.showImageName && (n(d) === "normal" || n(d) === "info")],
|
|
1154
|
+
[n(Ne)]
|
|
504
1155
|
])
|
|
505
|
-
])) : (
|
|
506
|
-
|
|
1156
|
+
])) : (y(), U(
|
|
1157
|
+
de,
|
|
507
1158
|
{ key: 1 },
|
|
508
1159
|
[
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
(
|
|
513
|
-
|
|
1160
|
+
p(" 多文件 "),
|
|
1161
|
+
X("div", Zt, [
|
|
1162
|
+
p(" 已上传的图片集合 "),
|
|
1163
|
+
(y(!0), U(
|
|
1164
|
+
de,
|
|
514
1165
|
null,
|
|
515
|
-
|
|
516
|
-
var
|
|
517
|
-
return
|
|
518
|
-
key:
|
|
1166
|
+
Me(n(s), (I, A) => {
|
|
1167
|
+
var _;
|
|
1168
|
+
return y(), U("div", {
|
|
1169
|
+
key: A,
|
|
519
1170
|
class: "das-ui-image-viewer-container"
|
|
520
1171
|
}, [
|
|
521
|
-
|
|
1172
|
+
X(
|
|
522
1173
|
"div",
|
|
523
1174
|
{
|
|
524
1175
|
class: "das-ui-image-viewer",
|
|
525
|
-
style:
|
|
1176
|
+
style: fe(u.style)
|
|
526
1177
|
},
|
|
527
1178
|
[
|
|
528
|
-
|
|
529
|
-
class:
|
|
1179
|
+
J(ie(n(Je), {
|
|
1180
|
+
class: ge([{ "loading-border": n(B)(A) }]),
|
|
530
1181
|
type: "component",
|
|
531
|
-
spinning:
|
|
1182
|
+
spinning: n(B)(A)
|
|
532
1183
|
}, {
|
|
533
|
-
default:
|
|
534
|
-
|
|
1184
|
+
default: ne(() => [
|
|
1185
|
+
n(b)(n(v)[A][0]) === "isImg" ? J((y(), O(n(Le), {
|
|
535
1186
|
key: 0,
|
|
536
|
-
class:
|
|
537
|
-
src:
|
|
1187
|
+
class: ge(["image-context", [n(h)]]),
|
|
1188
|
+
src: n(v)[A][0],
|
|
538
1189
|
"preview-teleported": !0,
|
|
539
|
-
"preview-src-list":
|
|
540
|
-
"initial-index":
|
|
541
|
-
onClick: (
|
|
1190
|
+
"preview-src-list": n(Z) ? n(v)[A] : void 0,
|
|
1191
|
+
"initial-index": A,
|
|
1192
|
+
onClick: (W) => n($)(n(v)[A]),
|
|
542
1193
|
fit: "cover"
|
|
543
1194
|
}, null, 8, ["class", "src", "preview-src-list", "initial-index", "onClick"])), [
|
|
544
|
-
[
|
|
545
|
-
]) :
|
|
546
|
-
|
|
547
|
-
|
|
1195
|
+
[j, !n(B)(A)]
|
|
1196
|
+
]) : p("v-if", !0),
|
|
1197
|
+
p(" 视频 "),
|
|
1198
|
+
n(b)(n(v)[A][0]) === "isVideo" ? J((y(), O(n(ve), {
|
|
548
1199
|
key: 1,
|
|
549
|
-
mode:
|
|
550
|
-
src:
|
|
551
|
-
needPreview:
|
|
1200
|
+
mode: n(d) === "info" || u.mode === "view" ? "view" : "normal",
|
|
1201
|
+
src: n(v)[A][0],
|
|
1202
|
+
needPreview: u.needPreview,
|
|
552
1203
|
width: "100%",
|
|
553
1204
|
height: "100%",
|
|
554
1205
|
fullPath: "",
|
|
555
|
-
"player-props": { videoWidth:
|
|
1206
|
+
"player-props": { videoWidth: u.videoWidth, videoHeight: u.videoHeight }
|
|
556
1207
|
}, null, 8, ["mode", "src", "needPreview", "player-props"])), [
|
|
557
|
-
[
|
|
558
|
-
]) :
|
|
559
|
-
|
|
560
|
-
|
|
1208
|
+
[j, !n(B)(A)]
|
|
1209
|
+
]) : p("v-if", !0),
|
|
1210
|
+
p(" 音频 "),
|
|
1211
|
+
n(b)(n(v)[A][0]) === "isAudio" ? J((y(), O(n(ve), {
|
|
561
1212
|
key: 2,
|
|
562
|
-
mode:
|
|
563
|
-
src:
|
|
564
|
-
needPreview:
|
|
1213
|
+
mode: n(d) === "info" || u.mode === "view" ? "view" : "normal",
|
|
1214
|
+
src: n(v)[A][0],
|
|
1215
|
+
needPreview: u.needPreview,
|
|
565
1216
|
width: "100%",
|
|
566
1217
|
height: "100%",
|
|
567
1218
|
type: "audio",
|
|
568
1219
|
fullPath: ""
|
|
569
1220
|
}, null, 8, ["mode", "src", "needPreview"])), [
|
|
570
|
-
[
|
|
571
|
-
]) :
|
|
572
|
-
!
|
|
1221
|
+
[j, !n(B)(A)]
|
|
1222
|
+
]) : p("v-if", !0),
|
|
1223
|
+
!n(C) && n(E) ? (y(), U(
|
|
573
1224
|
"div",
|
|
574
1225
|
{
|
|
575
1226
|
key: 3,
|
|
576
1227
|
class: "operate-container",
|
|
577
|
-
style:
|
|
1228
|
+
style: fe(r.value)
|
|
578
1229
|
},
|
|
579
1230
|
[
|
|
580
|
-
|
|
1231
|
+
u.needDownloadBtn ? (y(), O(n(je), {
|
|
581
1232
|
key: 0,
|
|
582
1233
|
class: "operate-btn",
|
|
583
1234
|
size: "medium",
|
|
584
1235
|
"icon-color": "#fff",
|
|
585
|
-
onClick: (
|
|
586
|
-
}, null, 8, ["onClick"])) :
|
|
587
|
-
|
|
1236
|
+
onClick: (W) => n(H)(I, A)
|
|
1237
|
+
}, null, 8, ["onClick"])) : p("v-if", !0),
|
|
1238
|
+
n(d) !== "info" && u.needChangeBtn ? (y(), U("div", {
|
|
588
1239
|
key: 1,
|
|
589
1240
|
class: "change-icon-box",
|
|
590
|
-
onClick:
|
|
1241
|
+
onClick: w[5] || (w[5] = (W) => n(K)(n(s)))
|
|
591
1242
|
}, [
|
|
592
|
-
|
|
1243
|
+
u.openFileDialogOnClick ? (y(), O(n(Fe), {
|
|
593
1244
|
key: 0,
|
|
594
|
-
"before-upload": (
|
|
595
|
-
accept:
|
|
596
|
-
openFileDialogOnClick:
|
|
1245
|
+
"before-upload": (W) => n(M)(W, A),
|
|
1246
|
+
accept: n(f),
|
|
1247
|
+
openFileDialogOnClick: u.openFileDialogOnClick
|
|
597
1248
|
}, {
|
|
598
|
-
itemRender:
|
|
599
|
-
default:
|
|
600
|
-
|
|
1249
|
+
itemRender: ne(({ file: W, actions: l }) => w[8] || (w[8] = [])),
|
|
1250
|
+
default: ne(() => [
|
|
1251
|
+
ie(n(pe), {
|
|
601
1252
|
class: "operate-btn m-t-6",
|
|
602
1253
|
"icon-color": "#fff",
|
|
603
1254
|
size: "medium"
|
|
@@ -605,62 +1256,62 @@ const _e = (t) => {
|
|
|
605
1256
|
]),
|
|
606
1257
|
_: 2
|
|
607
1258
|
/* DYNAMIC */
|
|
608
|
-
}, 1032, ["before-upload", "accept", "openFileDialogOnClick"])) :
|
|
609
|
-
|
|
1259
|
+
}, 1032, ["before-upload", "accept", "openFileDialogOnClick"])) : p("v-if", !0),
|
|
1260
|
+
u.openFileDialogOnClick ? p("v-if", !0) : (y(), O(n(pe), {
|
|
610
1261
|
key: 1,
|
|
611
1262
|
class: "operate-btn m-t-6",
|
|
612
1263
|
"icon-color": "#fff",
|
|
613
1264
|
size: "medium"
|
|
614
1265
|
}))
|
|
615
|
-
])) :
|
|
616
|
-
|
|
1266
|
+
])) : p("v-if", !0),
|
|
1267
|
+
n(d) !== "info" && u.needDeleteBtn ? (y(), O(n(ze), {
|
|
617
1268
|
key: 2,
|
|
618
1269
|
class: "operate-btn",
|
|
619
1270
|
"icon-color": "#fff",
|
|
620
1271
|
size: "medium",
|
|
621
|
-
onClick: (
|
|
622
|
-
}, null, 8, ["onClick"])) :
|
|
1272
|
+
onClick: (W) => n(T)(I, A)
|
|
1273
|
+
}, null, 8, ["onClick"])) : p("v-if", !0)
|
|
623
1274
|
],
|
|
624
1275
|
4
|
|
625
1276
|
/* STYLE */
|
|
626
|
-
)) :
|
|
1277
|
+
)) : p("v-if", !0)
|
|
627
1278
|
]),
|
|
628
1279
|
_: 2
|
|
629
1280
|
/* DYNAMIC */
|
|
630
1281
|
}, 1032, ["class", "spinning"]), [
|
|
631
|
-
[
|
|
1282
|
+
[j, I]
|
|
632
1283
|
])
|
|
633
1284
|
],
|
|
634
1285
|
4
|
|
635
1286
|
/* STYLE */
|
|
636
1287
|
),
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
1288
|
+
J((y(), U("div", $t, [
|
|
1289
|
+
Pe(
|
|
1290
|
+
Te(((_ = i.imageName) == null ? void 0 : _[A]) || n(S)[A]),
|
|
640
1291
|
1
|
|
641
1292
|
/* TEXT */
|
|
642
1293
|
)
|
|
643
1294
|
])), [
|
|
644
|
-
[
|
|
645
|
-
[
|
|
1295
|
+
[j, I && u.showImageName && !n(B)(A)],
|
|
1296
|
+
[n(Ne)]
|
|
646
1297
|
])
|
|
647
1298
|
]);
|
|
648
1299
|
}),
|
|
649
1300
|
128
|
|
650
1301
|
/* KEYED_FRAGMENT */
|
|
651
1302
|
)),
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
1303
|
+
p(" 查看模式下,默认占位符 "),
|
|
1304
|
+
u.mode === "view" ? (y(!0), U(
|
|
1305
|
+
de,
|
|
655
1306
|
{ key: 0 },
|
|
656
|
-
|
|
657
|
-
|
|
1307
|
+
Me(u.limitNum - n(s).length, (I) => (y(), U("div", _t, w[9] || (w[9] = [
|
|
1308
|
+
X(
|
|
658
1309
|
"div",
|
|
659
1310
|
{ class: "das-ui-image-viewer" },
|
|
660
1311
|
[
|
|
661
|
-
|
|
1312
|
+
X("img", {
|
|
662
1313
|
class: "no-data-img",
|
|
663
|
-
src:
|
|
1314
|
+
src: Ie,
|
|
664
1315
|
alt: ""
|
|
665
1316
|
})
|
|
666
1317
|
],
|
|
@@ -670,39 +1321,40 @@ const _e = (t) => {
|
|
|
670
1321
|
])))),
|
|
671
1322
|
256
|
|
672
1323
|
/* UNKEYED_FRAGMENT */
|
|
673
|
-
)) :
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
status:
|
|
679
|
-
"onUpdate:status":
|
|
680
|
-
"max-size":
|
|
681
|
-
accept:
|
|
682
|
-
acceptVideo:
|
|
683
|
-
acceptAudio:
|
|
684
|
-
message:
|
|
685
|
-
"custom-check":
|
|
686
|
-
"error-message":
|
|
687
|
-
openFileDialogOnClick:
|
|
688
|
-
onImageUpload:
|
|
689
|
-
|
|
1324
|
+
)) : p("v-if", !0),
|
|
1325
|
+
p(" 图片数量未到达最大数量限制时,显示上传组件 "),
|
|
1326
|
+
u.mode === "upload" && n(d) !== "info" && n(s).length < u.limitNum ? (y(), U("div", ea, [
|
|
1327
|
+
X("div", ta, [
|
|
1328
|
+
ie(n(Ve), {
|
|
1329
|
+
status: n(d),
|
|
1330
|
+
"onUpdate:status": w[6] || (w[6] = (I) => Qe(d) ? d.value = I : null),
|
|
1331
|
+
"max-size": u.maxSize,
|
|
1332
|
+
accept: u.accept,
|
|
1333
|
+
acceptVideo: u.acceptVideo,
|
|
1334
|
+
acceptAudio: u.acceptAudio,
|
|
1335
|
+
message: u.message,
|
|
1336
|
+
"custom-check": u.customCheck,
|
|
1337
|
+
"error-message": u.errorMessage,
|
|
1338
|
+
openFileDialogOnClick: u.openFileDialogOnClick,
|
|
1339
|
+
onImageUpload: n(L),
|
|
1340
|
+
isOverMaxLimitCompressImg: u.isOverMaxLimitCompressImg
|
|
1341
|
+
}, null, 8, ["status", "max-size", "accept", "acceptVideo", "acceptAudio", "message", "custom-check", "error-message", "openFileDialogOnClick", "onImageUpload", "isOverMaxLimitCompressImg"])
|
|
690
1342
|
])
|
|
691
|
-
])) :
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
1343
|
+
])) : p("v-if", !0),
|
|
1344
|
+
p(" 当图片状态为查看态且无数据时,显示无数据图片 "),
|
|
1345
|
+
n(d) === "info" && n(s).length === 0 ? (y(), U("div", aa, w[10] || (w[10] = [
|
|
1346
|
+
X(
|
|
695
1347
|
"img",
|
|
696
1348
|
{
|
|
697
1349
|
class: "no-data-img",
|
|
698
|
-
src:
|
|
1350
|
+
src: Ie,
|
|
699
1351
|
alt: ""
|
|
700
1352
|
},
|
|
701
1353
|
null,
|
|
702
1354
|
-1
|
|
703
1355
|
/* HOISTED */
|
|
704
1356
|
)
|
|
705
|
-
]))) :
|
|
1357
|
+
]))) : p("v-if", !0)
|
|
706
1358
|
])
|
|
707
1359
|
],
|
|
708
1360
|
2112
|
|
@@ -713,20 +1365,20 @@ const _e = (t) => {
|
|
|
713
1365
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
714
1366
|
));
|
|
715
1367
|
}
|
|
716
|
-
}),
|
|
717
|
-
const
|
|
718
|
-
for (const [
|
|
719
|
-
|
|
720
|
-
return
|
|
721
|
-
},
|
|
1368
|
+
}), na = (t, e) => {
|
|
1369
|
+
const i = t.__vccOpts || t;
|
|
1370
|
+
for (const [a, r] of e)
|
|
1371
|
+
i[a] = r;
|
|
1372
|
+
return i;
|
|
1373
|
+
}, ra = /* @__PURE__ */ na(ia, [["__scopeId", "data-v-0cbe0660"]]), oa = {
|
|
722
1374
|
"--das-ui-image-viewer-bg-color": { light: "rgba(0, 0, 0, 0.5)" },
|
|
723
1375
|
"--das-ui-image-viewer-btn-hover": { light: "#87A9FF" },
|
|
724
1376
|
"--das-ui-image-viewer-btn-active": { light: "#276FF5" }
|
|
725
|
-
},
|
|
726
|
-
|
|
1377
|
+
}, Pa = rt(ra);
|
|
1378
|
+
ot(oa);
|
|
727
1379
|
export {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1380
|
+
Pa as DasImageViewer,
|
|
1381
|
+
Pa as default,
|
|
1382
|
+
At as minioUpload,
|
|
1383
|
+
yt as useCalculateSize
|
|
732
1384
|
};
|