@das-fed/ui 7.0.7-hot.21 → 7.0.7-hot.23
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 +5 -5
- package/packages/business-components/ai-panel/{index-8yffh0Id.js → index-DMJXZM7n.js} +1067 -1056
- package/packages/business-components/ai-panel/index-DMJXZM7n.js.gz +0 -0
- package/packages/business-components/ai-panel/{index-IzGl26KU.js → index-MqhMkLo9.js} +9 -9
- package/packages/business-components/ai-panel/index-MqhMkLo9.js.gz +0 -0
- package/packages/business-components/ai-panel/{index-OwRrV6K8.js → index-_q72oKSF.js} +63 -62
- package/packages/business-components/ai-panel/index-_q72oKSF.js.gz +0 -0
- package/packages/business-components/ai-panel/index.js +1 -1
- package/packages/business-components/device-panel/index.js +14908 -14808
- package/packages/business-components/device-panel/index.js.gz +0 -0
- package/packages/business-components/echarts/index.js +2056 -2049
- package/packages/business-components/echarts/index.js.gz +0 -0
- package/packages/business-components/process-configuration/index.js +46 -46
- package/packages/business-components/process-configuration/index.js.gz +0 -0
- package/packages/business-components/process-form/index.js +99 -99
- package/packages/business-components/process-form/index.js.gz +0 -0
- package/packages/business-components/process-search-form/index.js +77 -77
- package/packages/business-components/process-search-form/index.js.gz +0 -0
- package/packages/business-components/process-table/index.js +215 -213
- package/packages/business-components/process-table/index.js.gz +0 -0
- package/packages/business-components/urgent-panel/index.js +1104 -1096
- package/packages/business-components/urgent-panel/index.js.gz +0 -0
- package/packages/business-components/user-org-dialog/index.js +243 -240
- package/packages/business-components/user-org-dialog/index.js.gz +0 -0
- package/packages/business-components/video-dialog/index.js +65 -64
- package/packages/business-components/video-dialog/index.js.gz +0 -0
- package/packages/components/autocomplete/index.js +12 -6
- package/packages/components/autocomplete/index.js.gz +0 -0
- package/packages/components/calendar/index.js +99 -99
- package/packages/components/calendar/index.js.gz +0 -0
- package/packages/components/cascader/index.js +2 -2
- package/packages/components/cascader/index.js.gz +0 -0
- package/packages/components/checkbox/index.js +30 -30
- package/packages/components/checkbox/index.js.gz +0 -0
- package/packages/components/date-picker/index.js +212 -212
- package/packages/components/date-picker/index.js.gz +0 -0
- package/packages/components/dimple-layout/index.js +77 -75
- package/packages/components/dimple-layout/index.js.gz +0 -0
- package/packages/components/dropdown/index.js +25 -24
- package/packages/components/dropdown/index.js.gz +0 -0
- package/packages/components/edit-table/index.js +398 -397
- package/packages/components/edit-table/index.js.gz +0 -0
- package/packages/components/error-overlay-model/index.js +47 -45
- package/packages/components/error-overlay-model/index.js.gz +0 -0
- package/packages/components/form-item/index.js +67 -67
- package/packages/components/form-item/index.js.gz +0 -0
- package/packages/components/hls-player/index.js +14 -7
- package/packages/components/hls-player/index.js.gz +0 -0
- package/packages/components/image-upload/index.js +147 -143
- package/packages/components/image-upload/index.js.gz +0 -0
- package/packages/components/image-viewer/index.js +297 -293
- package/packages/components/image-viewer/index.js.gz +0 -0
- package/packages/components/input/index.js +52 -52
- package/packages/components/input/index.js.gz +0 -0
- package/packages/components/input-number/index.js +26 -26
- package/packages/components/input-number/index.js.gz +0 -0
- package/packages/components/live-player/index.js +251 -248
- package/packages/components/live-player/index.js.gz +0 -0
- package/packages/components/map/index.js +421 -415
- package/packages/components/map/index.js.gz +0 -0
- package/packages/components/menu-aside/index.js +1 -1
- package/packages/components/menu-aside/index.js.gz +0 -0
- package/packages/components/message/index.js +6 -6
- package/packages/components/message/index.js.gz +0 -0
- package/packages/components/popover/index.js +12 -12
- package/packages/components/popover/index.js.gz +0 -0
- package/packages/components/radio-tabs/index.js +34 -34
- package/packages/components/radio-tabs/index.js.gz +0 -0
- package/packages/components/rich-editor/index.js +4613 -4583
- package/packages/components/rich-editor/index.js.gz +0 -0
- package/packages/components/scrollbar/index.js +135 -135
- package/packages/components/scrollbar/index.js.gz +0 -0
- package/packages/components/search/index.js +24 -24
- package/packages/components/search/index.js.gz +0 -0
- package/packages/components/select/index.js +60 -60
- package/packages/components/select/index.js.gz +0 -0
- package/packages/components/select-list/index.js +9 -5
- package/packages/components/select-list/index.js.gz +0 -0
- package/packages/components/special-range-picker-month/index.js +16 -14
- package/packages/components/special-range-picker-month/index.js.gz +0 -0
- package/packages/components/special-range-picker-year/index.js +53 -51
- package/packages/components/special-range-picker-year/index.js.gz +0 -0
- package/packages/components/spin/index.js +33 -33
- package/packages/components/spin/index.js.gz +0 -0
- package/packages/components/split-panel/index.js +129 -128
- package/packages/components/split-panel/index.js.gz +0 -0
- package/packages/components/table/index.js +179 -178
- package/packages/components/table/index.js.gz +0 -0
- package/packages/components/time-line/index.js +1 -1
- package/packages/components/time-line/index.js.gz +0 -0
- package/packages/components/tree-select/index.js +1 -1
- package/packages/components/tree-select/index.js.gz +0 -0
- package/packages/components/tree-table/index.js +2 -2
- package/packages/components/tree-table/index.js.gz +0 -0
- package/packages/components/tree-v2/index.js +1117 -1093
- package/packages/components/tree-v2/index.js.gz +0 -0
- package/packages/business-components/ai-panel/index-8yffh0Id.js.gz +0 -0
- package/packages/business-components/ai-panel/index-IzGl26KU.js.gz +0 -0
- package/packages/business-components/ai-panel/index-OwRrV6K8.js.gz +0 -0
|
@@ -2,10 +2,10 @@ import '@das-fed/ui/packages/components/image-upload/style.css';
|
|
|
2
2
|
import { withInstall as Ie } from "@das-fed/utils/with-install/index";
|
|
3
3
|
import { currentLang as ge, i18n as ve, t as G, setI18nRule as Pe } from "@das-fed/web/packages/i18n/index";
|
|
4
4
|
import { getVar as L, setThemeRule as Se } from "@das-fed/web/packages/theme/index";
|
|
5
|
-
import { computed as X, defineComponent as je, createElementBlock as Le, openBlock as _e, createCommentVNode as ye, withDirectives as K, createVNode as
|
|
6
|
-
import { UploadDragger as He, Upload as
|
|
5
|
+
import { computed as X, defineComponent as je, createElementBlock as Le, openBlock as _e, createCommentVNode as ye, withDirectives as K, createVNode as M, unref as v, normalizeClass as Ne, withCtx as O, createElementVNode as z, toDisplayString as Y, vShow as q, createTextVNode as We } from "vue";
|
|
6
|
+
import { UploadDragger as He, Upload as $e } from "ant-design-vue";
|
|
7
7
|
import "ant-design-vue/es/upload/style/css";
|
|
8
|
-
import { DasSpin as
|
|
8
|
+
import { DasSpin as Ve } from "@das-fed/ui/packages/components/spin/index";
|
|
9
9
|
import { DasButton as Ge } from "@das-fed/ui/packages/components/button/index";
|
|
10
10
|
import { DasIconAddto as Xe } from "@das-fed/ui/packages/icons/addto/index";
|
|
11
11
|
import { DasIconWarning as Ke } from "@das-fed/ui/packages/icons/warning/index";
|
|
@@ -15,12 +15,12 @@ import { useModelValue as we } from "@das-fed/utils/vue";
|
|
|
15
15
|
import "@das-fed/ui/packages/global/theme";
|
|
16
16
|
const qe = () => ({ size2B: (e) => {
|
|
17
17
|
isNaN(Number(e)) ? e = e.toString() : e = e + "M";
|
|
18
|
-
const a = Number(e.slice(0, -1)),
|
|
19
|
-
M:
|
|
20
|
-
K:
|
|
18
|
+
const a = Number(e.slice(0, -1)), i = e[e.length - 1].toUpperCase(), r = 1024, o = {
|
|
19
|
+
M: r * r,
|
|
20
|
+
K: r,
|
|
21
21
|
B: 1
|
|
22
22
|
};
|
|
23
|
-
return { finalSize: a * o[
|
|
23
|
+
return { finalSize: a * o[i], sizeText: e };
|
|
24
24
|
} });
|
|
25
25
|
/*!
|
|
26
26
|
* Compressor.js v1.2.1
|
|
@@ -34,20 +34,20 @@ const qe = () => ({ size2B: (e) => {
|
|
|
34
34
|
function xe(t, e) {
|
|
35
35
|
var a = Object.keys(t);
|
|
36
36
|
if (Object.getOwnPropertySymbols) {
|
|
37
|
-
var
|
|
38
|
-
e && (
|
|
39
|
-
return Object.getOwnPropertyDescriptor(t,
|
|
40
|
-
})), a.push.apply(a,
|
|
37
|
+
var i = Object.getOwnPropertySymbols(t);
|
|
38
|
+
e && (i = i.filter(function(r) {
|
|
39
|
+
return Object.getOwnPropertyDescriptor(t, r).enumerable;
|
|
40
|
+
})), a.push.apply(a, i);
|
|
41
41
|
}
|
|
42
42
|
return a;
|
|
43
43
|
}
|
|
44
44
|
function j(t) {
|
|
45
45
|
for (var e = 1; e < arguments.length; e++) {
|
|
46
46
|
var a = arguments[e] != null ? arguments[e] : {};
|
|
47
|
-
e % 2 ? xe(Object(a), !0).forEach(function(
|
|
48
|
-
Ze(t,
|
|
49
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : xe(Object(a)).forEach(function(
|
|
50
|
-
Object.defineProperty(t,
|
|
47
|
+
e % 2 ? xe(Object(a), !0).forEach(function(i) {
|
|
48
|
+
Ze(t, i, a[i]);
|
|
49
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : xe(Object(a)).forEach(function(i) {
|
|
50
|
+
Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(a, i));
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
return t;
|
|
@@ -58,8 +58,8 @@ function Je(t, e) {
|
|
|
58
58
|
}
|
|
59
59
|
function Ce(t, e) {
|
|
60
60
|
for (var a = 0; a < e.length; a++) {
|
|
61
|
-
var
|
|
62
|
-
|
|
61
|
+
var i = e[a];
|
|
62
|
+
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, De(i.key), i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
function Qe(t, e, a) {
|
|
@@ -79,8 +79,8 @@ function _() {
|
|
|
79
79
|
return _ = Object.assign ? Object.assign.bind() : function(t) {
|
|
80
80
|
for (var e = 1; e < arguments.length; e++) {
|
|
81
81
|
var a = arguments[e];
|
|
82
|
-
for (var
|
|
83
|
-
Object.prototype.hasOwnProperty.call(a,
|
|
82
|
+
for (var i in a)
|
|
83
|
+
Object.prototype.hasOwnProperty.call(a, i) && (t[i] = a[i]);
|
|
84
84
|
}
|
|
85
85
|
return t;
|
|
86
86
|
}, _.apply(this, arguments);
|
|
@@ -89,8 +89,8 @@ function et(t, e) {
|
|
|
89
89
|
if (typeof t != "object" || t === null) return t;
|
|
90
90
|
var a = t[Symbol.toPrimitive];
|
|
91
91
|
if (a !== void 0) {
|
|
92
|
-
var
|
|
93
|
-
if (typeof
|
|
92
|
+
var i = a.call(t, e);
|
|
93
|
+
if (typeof i != "object") return i;
|
|
94
94
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
95
95
|
}
|
|
96
96
|
return String(t);
|
|
@@ -102,25 +102,25 @@ function De(t) {
|
|
|
102
102
|
var Te = { exports: {} };
|
|
103
103
|
(function(t) {
|
|
104
104
|
typeof window > "u" || function(e) {
|
|
105
|
-
var a = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype,
|
|
105
|
+
var a = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype, i = e.Blob && function() {
|
|
106
106
|
try {
|
|
107
107
|
return !!new Blob();
|
|
108
108
|
} catch {
|
|
109
109
|
return !1;
|
|
110
110
|
}
|
|
111
|
-
}(),
|
|
111
|
+
}(), r = i && e.Uint8Array && function() {
|
|
112
112
|
try {
|
|
113
113
|
return new Blob([new Uint8Array(100)]).size === 100;
|
|
114
114
|
} catch {
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
|
-
}(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, m = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, n = (
|
|
117
|
+
}(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, m = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, n = (i || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(c) {
|
|
118
118
|
var u, f, s, h, p, l, w, g, y;
|
|
119
119
|
if (u = c.match(m), !u)
|
|
120
120
|
throw new Error("invalid data URI");
|
|
121
121
|
for (f = u[2] ? u[1] : "text/plain" + (u[3] || ";charset=US-ASCII"), s = !!u[4], h = c.slice(u[0].length), s ? p = atob(h) : p = decodeURIComponent(h), l = new ArrayBuffer(p.length), w = new Uint8Array(l), g = 0; g < p.length; g += 1)
|
|
122
122
|
w[g] = p.charCodeAt(g);
|
|
123
|
-
return
|
|
123
|
+
return i ? new Blob([r ? w : l], {
|
|
124
124
|
type: f
|
|
125
125
|
}) : (y = new o(), y.append(l), y.getBlob(f));
|
|
126
126
|
};
|
|
@@ -270,58 +270,58 @@ var Be = Te.exports, tt = function(e) {
|
|
|
270
270
|
error: null
|
|
271
271
|
}, at = typeof window < "u" && typeof window.document < "u", U = at ? window : {}, N = function(e) {
|
|
272
272
|
return e > 0 && e < 1 / 0;
|
|
273
|
-
},
|
|
273
|
+
}, it = Array.prototype.slice;
|
|
274
274
|
function Z(t) {
|
|
275
|
-
return Array.from ? Array.from(t) :
|
|
275
|
+
return Array.from ? Array.from(t) : it.call(t);
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var rt = /^image\/.+$/;
|
|
278
278
|
function Q(t) {
|
|
279
|
-
return
|
|
279
|
+
return rt.test(t);
|
|
280
280
|
}
|
|
281
281
|
function ot(t) {
|
|
282
282
|
var e = Q(t) ? t.substr(6) : "";
|
|
283
283
|
return e === "jpeg" && (e = "jpg"), ".".concat(e);
|
|
284
284
|
}
|
|
285
|
-
var
|
|
285
|
+
var Me = String.fromCharCode;
|
|
286
286
|
function nt(t, e, a) {
|
|
287
|
-
var
|
|
288
|
-
for (a += e,
|
|
289
|
-
|
|
290
|
-
return
|
|
287
|
+
var i = "", r;
|
|
288
|
+
for (a += e, r = e; r < a; r += 1)
|
|
289
|
+
i += Me(t.getUint8(r));
|
|
290
|
+
return i;
|
|
291
291
|
}
|
|
292
292
|
var st = U.btoa;
|
|
293
293
|
function ke(t, e) {
|
|
294
|
-
for (var a = [],
|
|
295
|
-
a.push(
|
|
294
|
+
for (var a = [], i = 8192, r = new Uint8Array(t); r.length > 0; )
|
|
295
|
+
a.push(Me.apply(null, Z(r.subarray(0, i)))), r = r.subarray(i);
|
|
296
296
|
return "data:".concat(e, ";base64,").concat(st(a.join("")));
|
|
297
297
|
}
|
|
298
298
|
function lt(t) {
|
|
299
299
|
var e = new DataView(t), a;
|
|
300
300
|
try {
|
|
301
|
-
var
|
|
301
|
+
var i, r, o;
|
|
302
302
|
if (e.getUint8(0) === 255 && e.getUint8(1) === 216)
|
|
303
303
|
for (var m = e.byteLength, n = 2; n + 1 < m; ) {
|
|
304
304
|
if (e.getUint8(n) === 255 && e.getUint8(n + 1) === 225) {
|
|
305
|
-
|
|
305
|
+
r = n;
|
|
306
306
|
break;
|
|
307
307
|
}
|
|
308
308
|
n += 1;
|
|
309
309
|
}
|
|
310
|
-
if (
|
|
311
|
-
var c =
|
|
310
|
+
if (r) {
|
|
311
|
+
var c = r + 4, u = r + 10;
|
|
312
312
|
if (nt(e, c, 4) === "Exif") {
|
|
313
313
|
var f = e.getUint16(u);
|
|
314
|
-
if (
|
|
315
|
-
var s = e.getUint32(u + 4,
|
|
314
|
+
if (i = f === 18761, (i || f === 19789) && e.getUint16(u + 2, i) === 42) {
|
|
315
|
+
var s = e.getUint32(u + 4, i);
|
|
316
316
|
s >= 8 && (o = u + s);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
if (o) {
|
|
321
|
-
var h = e.getUint16(o,
|
|
321
|
+
var h = e.getUint16(o, i), p, l;
|
|
322
322
|
for (l = 0; l < h; l += 1)
|
|
323
|
-
if (p = o + l * 12 + 2, e.getUint16(p,
|
|
324
|
-
p += 8, a = e.getUint16(p,
|
|
323
|
+
if (p = o + l * 12 + 2, e.getUint16(p, i) === 274) {
|
|
324
|
+
p += 8, a = e.getUint16(p, i), e.setUint16(p, 1, i);
|
|
325
325
|
break;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -331,7 +331,7 @@ function lt(t) {
|
|
|
331
331
|
return a;
|
|
332
332
|
}
|
|
333
333
|
function ct(t) {
|
|
334
|
-
var e = 0, a = 1,
|
|
334
|
+
var e = 0, a = 1, i = 1;
|
|
335
335
|
switch (t) {
|
|
336
336
|
case 2:
|
|
337
337
|
a = -1;
|
|
@@ -340,10 +340,10 @@ function ct(t) {
|
|
|
340
340
|
e = -180;
|
|
341
341
|
break;
|
|
342
342
|
case 4:
|
|
343
|
-
|
|
343
|
+
i = -1;
|
|
344
344
|
break;
|
|
345
345
|
case 5:
|
|
346
|
-
e = 90,
|
|
346
|
+
e = 90, i = -1;
|
|
347
347
|
break;
|
|
348
348
|
case 6:
|
|
349
349
|
e = 90;
|
|
@@ -358,7 +358,7 @@ function ct(t) {
|
|
|
358
358
|
return {
|
|
359
359
|
rotate: e,
|
|
360
360
|
scaleX: a,
|
|
361
|
-
scaleY:
|
|
361
|
+
scaleY: i
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
364
|
var ut = /\.\d*(?:0|9){12}\d*$/;
|
|
@@ -367,29 +367,29 @@ function Ee(t) {
|
|
|
367
367
|
return ut.test(t) ? Math.round(t * e) / e : t;
|
|
368
368
|
}
|
|
369
369
|
function I(t) {
|
|
370
|
-
var e = t.aspectRatio, a = t.height,
|
|
370
|
+
var e = t.aspectRatio, a = t.height, i = t.width, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none", o = N(i), m = N(a);
|
|
371
371
|
if (o && m) {
|
|
372
372
|
var n = a * e;
|
|
373
|
-
(
|
|
374
|
-
} else o ? a =
|
|
373
|
+
(r === "contain" || r === "none") && n > i || r === "cover" && n < i ? a = i / e : i = a * e;
|
|
374
|
+
} else o ? a = i / e : m && (i = a * e);
|
|
375
375
|
return {
|
|
376
|
-
width:
|
|
376
|
+
width: i,
|
|
377
377
|
height: a
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
function mt(t) {
|
|
381
|
-
for (var e = Z(new Uint8Array(t)), a = e.length,
|
|
382
|
-
var o = e[
|
|
381
|
+
for (var e = Z(new Uint8Array(t)), a = e.length, i = [], r = 0; r + 3 < a; ) {
|
|
382
|
+
var o = e[r], m = e[r + 1];
|
|
383
383
|
if (o === 255 && m === 218)
|
|
384
384
|
break;
|
|
385
385
|
if (o === 255 && m === 216)
|
|
386
|
-
|
|
386
|
+
r += 2;
|
|
387
387
|
else {
|
|
388
|
-
var n = e[
|
|
389
|
-
|
|
388
|
+
var n = e[r + 2] * 256 + e[r + 3], c = r + n + 2, u = e.slice(r, c);
|
|
389
|
+
i.push(u), r = c;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return i.reduce(function(f, s) {
|
|
393
393
|
return s[0] === 255 && s[1] === 225 ? f.concat(s) : f;
|
|
394
394
|
}, []);
|
|
395
395
|
}
|
|
@@ -397,8 +397,8 @@ function ft(t, e) {
|
|
|
397
397
|
var a = Z(new Uint8Array(t));
|
|
398
398
|
if (a[2] !== 255 || a[3] !== 224)
|
|
399
399
|
return t;
|
|
400
|
-
var
|
|
401
|
-
return new Uint8Array(
|
|
400
|
+
var i = a[4] * 256 + a[5], r = [255, 216].concat(e, a.slice(4 + i));
|
|
401
|
+
return new Uint8Array(r);
|
|
402
402
|
}
|
|
403
403
|
var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$/, ht = U.Compressor, gt = /* @__PURE__ */ function() {
|
|
404
404
|
function t(e, a) {
|
|
@@ -407,12 +407,12 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
407
407
|
return Qe(t, [{
|
|
408
408
|
key: "init",
|
|
409
409
|
value: function() {
|
|
410
|
-
var a = this,
|
|
411
|
-
if (!tt(
|
|
410
|
+
var a = this, i = this.file, r = this.options;
|
|
411
|
+
if (!tt(i)) {
|
|
412
412
|
this.fail(new Error("The first argument must be a File or Blob object."));
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
|
-
var o =
|
|
415
|
+
var o = i.type;
|
|
416
416
|
if (!Q(o)) {
|
|
417
417
|
this.fail(new Error("The first argument must be an image File or Blob object."));
|
|
418
418
|
return;
|
|
@@ -421,45 +421,45 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
421
421
|
this.fail(new Error("The current browser does not support image compression."));
|
|
422
422
|
return;
|
|
423
423
|
}
|
|
424
|
-
dt || (
|
|
425
|
-
var m = o === "image/jpeg", n = m &&
|
|
424
|
+
dt || (r.checkOrientation = !1, r.retainExif = !1);
|
|
425
|
+
var m = o === "image/jpeg", n = m && r.checkOrientation, c = m && r.retainExif;
|
|
426
426
|
if (D && !n && !c)
|
|
427
427
|
this.load({
|
|
428
|
-
url: D.createObjectURL(
|
|
428
|
+
url: D.createObjectURL(i)
|
|
429
429
|
});
|
|
430
430
|
else {
|
|
431
431
|
var u = new J();
|
|
432
432
|
this.reader = u, u.onload = function(f) {
|
|
433
433
|
var s = f.target, h = s.result, p = {}, l = 1;
|
|
434
|
-
n && (l = lt(h), l > 1 && _(p, ct(l))), c && (a.exif = mt(h)), n || c ? !D || l > 1 ? p.url = ke(h, o) : p.url = D.createObjectURL(
|
|
434
|
+
n && (l = lt(h), l > 1 && _(p, ct(l))), c && (a.exif = mt(h)), n || c ? !D || l > 1 ? p.url = ke(h, o) : p.url = D.createObjectURL(i) : p.url = h, a.load(p);
|
|
435
435
|
}, u.onabort = function() {
|
|
436
436
|
a.fail(new Error("Aborted to read the image with FileReader."));
|
|
437
437
|
}, u.onerror = function() {
|
|
438
438
|
a.fail(new Error("Failed to read the image with FileReader."));
|
|
439
439
|
}, u.onloadend = function() {
|
|
440
440
|
a.reader = null;
|
|
441
|
-
}, n || c ? u.readAsArrayBuffer(
|
|
441
|
+
}, n || c ? u.readAsArrayBuffer(i) : u.readAsDataURL(i);
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
}, {
|
|
445
445
|
key: "load",
|
|
446
446
|
value: function(a) {
|
|
447
|
-
var
|
|
447
|
+
var i = this, r = this.file, o = this.image;
|
|
448
448
|
o.onload = function() {
|
|
449
|
-
|
|
449
|
+
i.draw(j(j({}, a), {}, {
|
|
450
450
|
naturalWidth: o.naturalWidth,
|
|
451
451
|
naturalHeight: o.naturalHeight
|
|
452
452
|
}));
|
|
453
453
|
}, o.onabort = function() {
|
|
454
|
-
|
|
454
|
+
i.fail(new Error("Aborted to load the image."));
|
|
455
455
|
}, o.onerror = function() {
|
|
456
|
-
|
|
457
|
-
}, U.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(U.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt =
|
|
456
|
+
i.fail(new Error("Failed to load the image."));
|
|
457
|
+
}, U.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(U.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt = r.name, o.src = a.url;
|
|
458
458
|
}
|
|
459
459
|
}, {
|
|
460
460
|
key: "draw",
|
|
461
461
|
value: function(a) {
|
|
462
|
-
var
|
|
462
|
+
var i = this, r = a.naturalWidth, o = a.naturalHeight, m = a.rotate, n = m === void 0 ? 0 : m, c = a.scaleX, u = c === void 0 ? 1 : c, f = a.scaleY, s = f === void 0 ? 1 : f, h = this.file, p = this.image, l = this.options, w = document.createElement("canvas"), g = w.getContext("2d"), y = Math.abs(n) % 180 === 90, C = (l.resize === "contain" || l.resize === "cover") && N(l.width) && N(l.height), x = Math.max(l.maxWidth, 0) || 1 / 0, B = Math.max(l.maxHeight, 0) || 1 / 0, A = Math.max(l.minWidth, 0) || 0, k = Math.max(l.minHeight, 0) || 0, E = r / o, b = l.width, d = l.height;
|
|
463
463
|
if (y) {
|
|
464
464
|
var P = [B, x];
|
|
465
465
|
x = P[0], B = P[1];
|
|
@@ -481,36 +481,36 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
481
481
|
height: k
|
|
482
482
|
}, "cover");
|
|
483
483
|
if (A = ae.width, k = ae.height, C) {
|
|
484
|
-
var
|
|
484
|
+
var ie = I({
|
|
485
485
|
aspectRatio: E,
|
|
486
486
|
width: b,
|
|
487
487
|
height: d
|
|
488
488
|
}, l.resize);
|
|
489
|
-
b =
|
|
489
|
+
b = ie.width, d = ie.height;
|
|
490
490
|
} else {
|
|
491
|
-
var
|
|
491
|
+
var re = I({
|
|
492
492
|
aspectRatio: E,
|
|
493
493
|
width: b,
|
|
494
494
|
height: d
|
|
495
|
-
}), oe =
|
|
496
|
-
b = oe === void 0 ?
|
|
497
|
-
var ne =
|
|
495
|
+
}), oe = re.width;
|
|
496
|
+
b = oe === void 0 ? r : oe;
|
|
497
|
+
var ne = re.height;
|
|
498
498
|
d = ne === void 0 ? o : ne;
|
|
499
499
|
}
|
|
500
500
|
b = Math.floor(Ee(Math.min(Math.max(b, A), x))), d = Math.floor(Ee(Math.min(Math.max(d, k), B)));
|
|
501
|
-
var
|
|
501
|
+
var Oe = -b / 2, Re = -d / 2, Fe = b, ze = d, W = [];
|
|
502
502
|
if (C) {
|
|
503
|
-
var se = 0, le = 0, H =
|
|
503
|
+
var se = 0, le = 0, H = r, $ = o, ce = I({
|
|
504
504
|
aspectRatio: E,
|
|
505
|
-
width:
|
|
505
|
+
width: r,
|
|
506
506
|
height: o
|
|
507
507
|
}, {
|
|
508
508
|
contain: "cover",
|
|
509
509
|
cover: "contain"
|
|
510
510
|
}[l.resize]);
|
|
511
|
-
H = ce.width,
|
|
511
|
+
H = ce.width, $ = ce.height, se = (r - H) / 2, le = (o - $) / 2, W.push(se, le, H, $);
|
|
512
512
|
}
|
|
513
|
-
if (W.push(
|
|
513
|
+
if (W.push(Oe, Re, Fe, ze), y) {
|
|
514
514
|
var ue = [d, b];
|
|
515
515
|
b = ue[0], d = ue[1];
|
|
516
516
|
}
|
|
@@ -519,38 +519,38 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
519
519
|
h.size > l.convertSize && l.convertTypes.indexOf(l.mimeType) >= 0 && (l.mimeType = "image/jpeg");
|
|
520
520
|
var fe = l.mimeType === "image/jpeg";
|
|
521
521
|
if (fe && (me = "#fff"), g.fillStyle = me, g.fillRect(0, 0, b, d), l.beforeDraw && l.beforeDraw.call(this, g, w), !this.aborted && (g.save(), g.translate(b / 2, d / 2), g.rotate(n * Math.PI / 180), g.scale(u, s), g.drawImage.apply(g, [p].concat(W)), g.restore(), l.drew && l.drew.call(this, g, w), !this.aborted)) {
|
|
522
|
-
var de = function(
|
|
523
|
-
if (!
|
|
522
|
+
var de = function(R) {
|
|
523
|
+
if (!i.aborted) {
|
|
524
524
|
var pe = function(F) {
|
|
525
|
-
return
|
|
526
|
-
naturalWidth:
|
|
525
|
+
return i.done({
|
|
526
|
+
naturalWidth: r,
|
|
527
527
|
naturalHeight: o,
|
|
528
528
|
result: F
|
|
529
529
|
});
|
|
530
530
|
};
|
|
531
|
-
if (
|
|
531
|
+
if (R && fe && l.retainExif && i.exif && i.exif.length > 0) {
|
|
532
532
|
var he = function(F) {
|
|
533
|
-
return pe(Be(ke(ft(F,
|
|
533
|
+
return pe(Be(ke(ft(F, i.exif), l.mimeType)));
|
|
534
534
|
};
|
|
535
|
-
if (
|
|
536
|
-
|
|
537
|
-
|
|
535
|
+
if (R.arrayBuffer)
|
|
536
|
+
R.arrayBuffer().then(he).catch(function() {
|
|
537
|
+
i.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
|
|
538
538
|
});
|
|
539
539
|
else {
|
|
540
540
|
var T = new J();
|
|
541
|
-
|
|
542
|
-
var F =
|
|
541
|
+
i.reader = T, T.onload = function(V) {
|
|
542
|
+
var F = V.target;
|
|
543
543
|
he(F.result);
|
|
544
544
|
}, T.onabort = function() {
|
|
545
|
-
|
|
545
|
+
i.fail(new Error("Aborted to read the compressed image with FileReader."));
|
|
546
546
|
}, T.onerror = function() {
|
|
547
|
-
|
|
547
|
+
i.fail(new Error("Failed to read the compressed image with FileReader."));
|
|
548
548
|
}, T.onloadend = function() {
|
|
549
|
-
|
|
550
|
-
}, T.readAsArrayBuffer(
|
|
549
|
+
i.reader = null;
|
|
550
|
+
}, T.readAsArrayBuffer(R);
|
|
551
551
|
}
|
|
552
552
|
} else
|
|
553
|
-
pe(
|
|
553
|
+
pe(R);
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
556
|
w.toBlob ? w.toBlob(de, l.mimeType, l.quality) : de(Be(w.toDataURL(l.mimeType, l.quality)));
|
|
@@ -559,9 +559,9 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
559
559
|
}, {
|
|
560
560
|
key: "done",
|
|
561
561
|
value: function(a) {
|
|
562
|
-
var
|
|
562
|
+
var i = a.naturalWidth, r = a.naturalHeight, o = a.result, m = this.file, n = this.image, c = this.options;
|
|
563
563
|
if (D && n.src.indexOf("blob:") === 0 && D.revokeObjectURL(n.src), o)
|
|
564
|
-
if (c.strict && !c.retainExif && o.size > m.size && c.mimeType === m.type && !(c.width >
|
|
564
|
+
if (c.strict && !c.retainExif && o.size > m.size && c.mimeType === m.type && !(c.width > i || c.height > r || c.minWidth > i || c.minHeight > r || c.maxWidth < i || c.maxHeight < r))
|
|
565
565
|
o = m;
|
|
566
566
|
else {
|
|
567
567
|
var u = /* @__PURE__ */ new Date();
|
|
@@ -574,9 +574,9 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
574
574
|
}, {
|
|
575
575
|
key: "fail",
|
|
576
576
|
value: function(a) {
|
|
577
|
-
var
|
|
578
|
-
if (
|
|
579
|
-
|
|
577
|
+
var i = this.options;
|
|
578
|
+
if (i.error)
|
|
579
|
+
i.error.call(this, a);
|
|
580
580
|
else
|
|
581
581
|
throw a;
|
|
582
582
|
}
|
|
@@ -605,12 +605,12 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
|
|
|
605
605
|
}
|
|
606
606
|
}]), t;
|
|
607
607
|
}();
|
|
608
|
-
const vt = (t, e) => new Promise((a,
|
|
608
|
+
const vt = (t, e) => new Promise((a, i) => {
|
|
609
609
|
if (t.size <= e)
|
|
610
610
|
return t;
|
|
611
|
-
const
|
|
611
|
+
const r = e / t.size, o = Math.max(0.5, Math.min(0.9, 0.8 * r)), m = Math.max(800, Math.min(1920, 1920 * Math.sqrt(r)));
|
|
612
612
|
Ue(t, o, m, m, (n) => {
|
|
613
|
-
n.size <= e ? a(n) : Ue(
|
|
613
|
+
n.size <= e ? a(n) : (console.log("第一次压缩后仍大于5MB,进行二次压缩"), Ue(
|
|
614
614
|
n,
|
|
615
615
|
Math.max(0.4, o - 0.2),
|
|
616
616
|
// 降低质量
|
|
@@ -618,16 +618,16 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
618
618
|
// 缩小尺寸
|
|
619
619
|
Math.max(640, m * 0.8),
|
|
620
620
|
a,
|
|
621
|
-
|
|
621
|
+
i,
|
|
622
622
|
t
|
|
623
623
|
// 传递原始文件用于错误处理
|
|
624
|
-
);
|
|
625
|
-
},
|
|
626
|
-
}), Ue = (t, e, a,
|
|
624
|
+
));
|
|
625
|
+
}, i, t);
|
|
626
|
+
}), Ue = (t, e, a, i, r, o, m) => {
|
|
627
627
|
new gt(t, {
|
|
628
628
|
quality: e,
|
|
629
629
|
maxWidth: a,
|
|
630
|
-
maxHeight:
|
|
630
|
+
maxHeight: i,
|
|
631
631
|
convertSize: 1 / 0,
|
|
632
632
|
success(n) {
|
|
633
633
|
try {
|
|
@@ -635,7 +635,7 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
635
635
|
type: n.type || t.type,
|
|
636
636
|
lastModified: Date.now()
|
|
637
637
|
});
|
|
638
|
-
|
|
638
|
+
r(c);
|
|
639
639
|
} catch (c) {
|
|
640
640
|
o({
|
|
641
641
|
message: "文件转换失败",
|
|
@@ -653,7 +653,7 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
653
653
|
}
|
|
654
654
|
});
|
|
655
655
|
}, yt = (t, e) => {
|
|
656
|
-
const a = we(t, "status"), { size2B:
|
|
656
|
+
const a = we(t, "status"), { size2B: i } = qe(), r = we(t, "isOverMaxLimitCompressImg"), o = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], m = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], n = X(() => {
|
|
657
657
|
var h;
|
|
658
658
|
let s = t.accept ? (h = t.accept) == null ? void 0 : h.split(",") : [];
|
|
659
659
|
return s.includes("image/jpg") && !s.includes("image/jpeg") && s.push("image/jpeg"), s.includes(".jpg") && !s.includes(".jpeg") && s.push(".jpeg"), t.acceptVideo && (s = [...s, ...o]), t.acceptAudio && (s = [...s, ...m]), s.join(",");
|
|
@@ -661,8 +661,8 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
661
661
|
return { isAccept: n, uploadStatus: a, loading: c, errored: u, beforeupload: (s) => {
|
|
662
662
|
var l, w, g;
|
|
663
663
|
if (t.maxSize) {
|
|
664
|
-
const { finalSize: y, sizeText: C } =
|
|
665
|
-
if (s.size > y && !
|
|
664
|
+
const { finalSize: y, sizeText: C } = i(t.maxSize);
|
|
665
|
+
if (s.size > y && !r.value) {
|
|
666
666
|
const x = t.acceptAudio || t.acceptVideo ? "das-ui-import-upload-key4" : "das-ui-import-upload-key3", B = ge.value === "zh-CN" ? "、" : ", ", A = ve(
|
|
667
667
|
x,
|
|
668
668
|
C,
|
|
@@ -683,12 +683,16 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
683
683
|
a.value = "uploading";
|
|
684
684
|
let y = s;
|
|
685
685
|
if (t.maxSize) {
|
|
686
|
-
const { finalSize: C } =
|
|
687
|
-
if (s.size > C &&
|
|
686
|
+
const { finalSize: C } = i(t.maxSize);
|
|
687
|
+
if (s.size > C && r.value && h.includes(s.type))
|
|
688
688
|
try {
|
|
689
|
-
y = await vt(s, C)
|
|
689
|
+
y = await vt(s, C), console.log(
|
|
690
|
+
"压缩成功:",
|
|
691
|
+
`原始大小: ${(s.size / 1024 / 1024).toFixed(2)}MB →`,
|
|
692
|
+
`压缩后: ${(y.size / 1024 / 1024).toFixed(2)}MB`
|
|
693
|
+
);
|
|
690
694
|
} catch (x) {
|
|
691
|
-
y = (x == null ? void 0 : x.original) || s;
|
|
695
|
+
console.log("压缩失败,使用原始文件"), y = (x == null ? void 0 : x.original) || s;
|
|
692
696
|
}
|
|
693
697
|
}
|
|
694
698
|
return e("update:status", "uploading"), e("image-upload", y), !1;
|
|
@@ -735,29 +739,29 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
735
739
|
},
|
|
736
740
|
emits: ["update:status", "image-upload"],
|
|
737
741
|
setup(t, { emit: e }) {
|
|
738
|
-
const a = t,
|
|
742
|
+
const a = t, i = e, { isAccept: r, uploadStatus: o, loading: m, errored: n, beforeupload: c } = yt(a, i);
|
|
739
743
|
return (u, f) => (_e(), Le("div", bt, [
|
|
740
744
|
ye(" 图片上传组件 "),
|
|
741
|
-
K(
|
|
745
|
+
K(M(v(Ve), {
|
|
742
746
|
class: Ne([{ "loading-border": v(m) }]),
|
|
743
747
|
type: "component",
|
|
744
748
|
spinning: v(m)
|
|
745
749
|
}, {
|
|
746
|
-
default:
|
|
747
|
-
|
|
750
|
+
default: O(() => [
|
|
751
|
+
M(v(He), {
|
|
748
752
|
class: "das-ui-image-upload-dragger",
|
|
749
|
-
accept: v(
|
|
753
|
+
accept: v(r),
|
|
750
754
|
"max-count": u.maxCount,
|
|
751
755
|
"before-upload": v(c),
|
|
752
756
|
openFileDialogOnClick: u.openFileDialogOnClick
|
|
753
757
|
}, {
|
|
754
|
-
itemRender:
|
|
755
|
-
default:
|
|
758
|
+
itemRender: O(({ file: s, actions: h }) => f[0] || (f[0] = [])),
|
|
759
|
+
default: O(() => [
|
|
756
760
|
K(z(
|
|
757
761
|
"div",
|
|
758
762
|
wt,
|
|
759
763
|
[
|
|
760
|
-
|
|
764
|
+
M(v(Xe), {
|
|
761
765
|
iconColor: v(L)("--das-ui-color-secondary")
|
|
762
766
|
}, null, 8, ["iconColor"]),
|
|
763
767
|
z(
|
|
@@ -789,7 +793,7 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
789
793
|
Ct,
|
|
790
794
|
[
|
|
791
795
|
z("div", Bt, [
|
|
792
|
-
|
|
796
|
+
M(v(Ke), {
|
|
793
797
|
iconColor: v(L)("--das-ui-color-danger"),
|
|
794
798
|
size: "small"
|
|
795
799
|
}, null, 8, ["iconColor"]),
|
|
@@ -801,19 +805,19 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
801
805
|
/* TEXT */
|
|
802
806
|
)
|
|
803
807
|
]),
|
|
804
|
-
|
|
805
|
-
accept: v(
|
|
808
|
+
M(v($e), {
|
|
809
|
+
accept: v(r),
|
|
806
810
|
"before-upload": v(c),
|
|
807
811
|
"max-count": u.maxCount,
|
|
808
812
|
openFileDialogOnClick: u.openFileDialogOnClick
|
|
809
813
|
}, {
|
|
810
|
-
itemRender:
|
|
811
|
-
default:
|
|
812
|
-
|
|
814
|
+
itemRender: O(({ file: s, actions: h }) => f[1] || (f[1] = [])),
|
|
815
|
+
default: O(() => [
|
|
816
|
+
M(v(Ge), {
|
|
813
817
|
"btn-type": "primary-text",
|
|
814
818
|
block: ""
|
|
815
819
|
}, {
|
|
816
|
-
default:
|
|
820
|
+
default: O(() => [
|
|
817
821
|
We(
|
|
818
822
|
Y(v(G)("das-image-upload-reupload")),
|
|
819
823
|
1
|
|
@@ -837,8 +841,8 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
837
841
|
}
|
|
838
842
|
}), Et = (t, e) => {
|
|
839
843
|
const a = t.__vccOpts || t;
|
|
840
|
-
for (const [
|
|
841
|
-
a[
|
|
844
|
+
for (const [i, r] of e)
|
|
845
|
+
a[i] = r;
|
|
842
846
|
return a;
|
|
843
847
|
}, Ut = /* @__PURE__ */ Et(kt, [["__scopeId", "data-v-29473013"]]), Dt = {
|
|
844
848
|
"das-ui-import-upload-key1": {
|
|
@@ -870,10 +874,10 @@ const vt = (t, e) => new Promise((a, r) => {
|
|
|
870
874
|
"--das-ui-image-upload-bgcolor-hover": { light: L("--das-ui-color-primary-level1") },
|
|
871
875
|
"--das-ui-image-upload-border-color-hover": { light: "#5582F3" },
|
|
872
876
|
"--das-ui-image-upload-border-color-error": { light: L("--das-ui-color-danger-level2") }
|
|
873
|
-
},
|
|
877
|
+
}, Vt = Ie(Ut);
|
|
874
878
|
Pe(Dt);
|
|
875
879
|
Se(Tt);
|
|
876
880
|
export {
|
|
877
|
-
|
|
878
|
-
|
|
881
|
+
Vt as DasImageUpload,
|
|
882
|
+
Vt as default
|
|
879
883
|
};
|