mgacn-commonsdk 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mgacn-admin.js +1 -1
- package/dist/mgacn-commonsdk.js +601 -582
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/mgacn-commonsdk.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Plus as ot, Delete as it, CircleCloseFilled as ut, Document as ct, Close as dt, CircleClose as Ve, CircleCheck as pt, ArrowUp as ft, ArrowDown as ht } from "@element-plus/icons-vue";
|
|
2
|
-
import { ElMessage as
|
|
2
|
+
import { ElMessage as W, ElMessageBox as Oe } from "element-plus";
|
|
3
3
|
import mt from "cropperjs";
|
|
4
4
|
import * as $e from "ali-oss";
|
|
5
|
-
import { g as gt, _ as
|
|
6
|
-
import { i as
|
|
7
|
-
import { resolveComponent as
|
|
8
|
-
const Ft = $e.default ?? $e,
|
|
5
|
+
import { g as gt, _ as X, o as yt, k as Ie, t as vt, l as bt, m as Ae, F as _t, n as wt, p as Ct, q as kt, r as Ut, u as xt } from "./FilePreview-DVaCq1Fr.js";
|
|
6
|
+
import { i as dl, j as pl, c as fl, v as hl, w as ml, b as gl, x as yl, y as vl, a as bl, s as _l, z as wl } from "./FilePreview-DVaCq1Fr.js";
|
|
7
|
+
import { resolveComponent as $, openBlock as d, createElementBlock as y, createElementVNode as C, toDisplayString as B, createCommentVNode as V, createTextVNode as K, Fragment as Y, renderList as G, normalizeStyle as re, normalizeClass as z, createVNode as x, withCtx as F, withModifiers as de, withDirectives as te, vShow as ne, createBlock as D, computed as ye, ref as O, watch as ae, onMounted as ve, reactive as Le, nextTick as Z, onBeforeUnmount as ze, withKeys as Ne, unref as le, renderSlot as ee, mergeProps as Me, createSlots as St } from "vue";
|
|
8
|
+
const Ft = $e.default ?? $e, He = "__MGACN_COMMONSDK_OSS_URL__";
|
|
9
9
|
function $t(e = "") {
|
|
10
|
-
globalThis[
|
|
10
|
+
globalThis[He] = String(e || "").replace(/\/$/, "");
|
|
11
11
|
}
|
|
12
12
|
function Ee() {
|
|
13
|
-
return globalThis[
|
|
13
|
+
return globalThis[He] || "";
|
|
14
14
|
}
|
|
15
15
|
function Pe(e) {
|
|
16
16
|
return String(e).padStart(2, "0");
|
|
@@ -36,7 +36,7 @@ function Nt(e = {}) {
|
|
|
36
36
|
const t = e.accessKeyId || e.AccessKeyId || e.accessKeyID || "", n = e.accessKeySecret || e.AccessKeySecret || "", r = e.securityToken || e.SecurityToken || e.stsToken || e.token || "", s = e.bucketName || e.bucket || e.BucketName || "";
|
|
37
37
|
let o = String(e.endPoint || e.endpoint || e.EndPoint || "").replace(/^https?:\/\//i, "").replace(/\/$/, "");
|
|
38
38
|
s && o.startsWith(`${s}.`) && (o = o.slice(s.length + 1));
|
|
39
|
-
const m = e.region || (o.startsWith("oss-") ? o.replace(/\.aliyuncs\.com.*$/i, "") : ""), h = String(e.ossUrl || e.domain || e.cdnDomain || "").replace(/\/$/, ""),
|
|
39
|
+
const m = e.region || (o.startsWith("oss-") ? o.replace(/\.aliyuncs\.com.*$/i, "") : ""), h = String(e.ossUrl || e.domain || e.cdnDomain || "").replace(/\/$/, ""), L = s && o ? `https://${s}.${o}` : Ee();
|
|
40
40
|
return {
|
|
41
41
|
accessKeyId: t,
|
|
42
42
|
accessKeySecret: n,
|
|
@@ -44,7 +44,7 @@ function Nt(e = {}) {
|
|
|
44
44
|
bucketName: s,
|
|
45
45
|
endPoint: o,
|
|
46
46
|
region: m,
|
|
47
|
-
ossUrl: h ||
|
|
47
|
+
ossUrl: h || L
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
async function _e(e = {}) {
|
|
@@ -53,7 +53,7 @@ async function _e(e = {}) {
|
|
|
53
53
|
throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败:凭证字段不完整");
|
|
54
54
|
if (!h.securityToken)
|
|
55
55
|
throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败:缺少 securityToken");
|
|
56
|
-
const
|
|
56
|
+
const L = {
|
|
57
57
|
bucket: h.bucketName,
|
|
58
58
|
accessKeyId: h.accessKeyId,
|
|
59
59
|
accessKeySecret: h.accessKeySecret,
|
|
@@ -61,58 +61,58 @@ async function _e(e = {}) {
|
|
|
61
61
|
secure: !0,
|
|
62
62
|
success_action_status: "200"
|
|
63
63
|
};
|
|
64
|
-
h.region && (
|
|
65
|
-
const
|
|
66
|
-
return
|
|
64
|
+
h.region && (L.region = h.region), h.endPoint && (L.endpoint = h.endPoint);
|
|
65
|
+
const _ = new Ft(L);
|
|
66
|
+
return _.options.ossUrl = h.ossUrl || Ee(), _.options.uploadDir = o, _;
|
|
67
67
|
}
|
|
68
68
|
async function We(e = {}) {
|
|
69
|
-
var
|
|
69
|
+
var b, H;
|
|
70
70
|
const { client: t, file: n, dir: r, foldName: s, fileName: o, onProgress: m } = e;
|
|
71
71
|
if (!n)
|
|
72
72
|
throw new Error("[mgacn-commonsdk] uploadToOss 缺少 file");
|
|
73
|
-
const h = t || await _e({ dir: r, foldName: s }),
|
|
74
|
-
let
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
|
|
73
|
+
const h = t || await _e({ dir: r, foldName: s }), L = r || h.options.uploadDir || be(s);
|
|
74
|
+
let _ = o;
|
|
75
|
+
if (!_) {
|
|
76
|
+
const N = n.name || "file", E = N.lastIndexOf("."), J = E > -1 ? N.slice(E) : "";
|
|
77
|
+
_ = `${L}${je(10)}${J}`;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
typeof m == "function" && m(Math.min(100, Math.max(0, Math.floor(Number(
|
|
81
|
-
},
|
|
82
|
-
progress: async (
|
|
83
|
-
|
|
79
|
+
const S = (N) => {
|
|
80
|
+
typeof m == "function" && m(Math.min(100, Math.max(0, Math.floor(Number(N) * 100))));
|
|
81
|
+
}, T = n.size > 1 * 1024 * 1024, p = {
|
|
82
|
+
progress: async (N) => {
|
|
83
|
+
S(N);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
let c;
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
...
|
|
91
|
-
...
|
|
92
|
-
}) : h.put(
|
|
93
|
-
...
|
|
94
|
-
...
|
|
87
|
+
const i = async (N) => {
|
|
88
|
+
const E = N ? { "x-oss-object-acl": "public-read" } : void 0;
|
|
89
|
+
return T ? h.multipartUpload(_, n, {
|
|
90
|
+
...p,
|
|
91
|
+
...E ? { headers: E } : {}
|
|
92
|
+
}) : h.put(_, n, {
|
|
93
|
+
...p,
|
|
94
|
+
...E ? { headers: E } : {}
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
S(0.01), c = await i(!0);
|
|
99
99
|
} catch {
|
|
100
|
-
|
|
100
|
+
S(0.01), c = await i(!1);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
102
|
+
const g = ((b = c == null ? void 0 : c.res) == null ? void 0 : b.statusCode) ?? ((H = c == null ? void 0 : c.res) == null ? void 0 : H.status);
|
|
103
|
+
if (g && g !== 200)
|
|
104
104
|
throw new Error("[mgacn-commonsdk] 上传失败");
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
let
|
|
105
|
+
S(1);
|
|
106
|
+
const w = (h.options.ossUrl || "").replace(/\/$/, ""), M = w ? `${w}/${_}` : _;
|
|
107
|
+
let R = M;
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
R = h.signatureUrl(_, { expires: 3600 * 24 });
|
|
110
110
|
} catch {
|
|
111
111
|
}
|
|
112
112
|
return {
|
|
113
|
-
name:
|
|
114
|
-
url:
|
|
115
|
-
previewUrl:
|
|
113
|
+
name: _,
|
|
114
|
+
url: M,
|
|
115
|
+
previewUrl: R,
|
|
116
116
|
raw: c,
|
|
117
117
|
client: h
|
|
118
118
|
};
|
|
@@ -159,14 +159,14 @@ const Ye = {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
let
|
|
162
|
+
let Re = 0;
|
|
163
163
|
function qe() {
|
|
164
|
-
return
|
|
164
|
+
return Re += 1, `mg-img-${Date.now()}-${Re}`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Rt(e) {
|
|
167
167
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Te(e) {
|
|
170
170
|
return e.map((t) => ({
|
|
171
171
|
uid: qe(),
|
|
172
172
|
url: t,
|
|
@@ -178,7 +178,7 @@ function Re(e) {
|
|
|
178
178
|
function ce(e = "") {
|
|
179
179
|
return String(e).startsWith("blob:");
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Tt(e = "") {
|
|
182
182
|
return /[?&](Expires|Signature|OSSAccessKeyId)=/i.test(String(e));
|
|
183
183
|
}
|
|
184
184
|
function Bt(e = "") {
|
|
@@ -253,7 +253,7 @@ const Dt = {
|
|
|
253
253
|
deep: !0,
|
|
254
254
|
immediate: !0,
|
|
255
255
|
handler(e) {
|
|
256
|
-
e != null && e.length && (this.replaceList(
|
|
256
|
+
e != null && e.length && (this.replaceList(Te(e)), this.ensureSignedPreviews());
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
modelValue: {
|
|
@@ -261,12 +261,12 @@ const Dt = {
|
|
|
261
261
|
handler(e) {
|
|
262
262
|
var o;
|
|
263
263
|
if ((o = this.initFileList) != null && o.length) return;
|
|
264
|
-
const t =
|
|
264
|
+
const t = Rt(e), n = this.successUrls;
|
|
265
265
|
if (t.length === n.length && t.every((m, h) => m === n[h]))
|
|
266
266
|
return;
|
|
267
267
|
const r = new Map(
|
|
268
268
|
this.fileList.map((m) => [m.url, m.previewUrl]).filter(([m]) => m)
|
|
269
|
-
), s =
|
|
269
|
+
), s = Te(t).map((m) => ({
|
|
270
270
|
...m,
|
|
271
271
|
previewUrl: r.get(m.url) || ""
|
|
272
272
|
}));
|
|
@@ -302,7 +302,7 @@ const Dt = {
|
|
|
302
302
|
/** 私有桶回显:给已有 url 补签名预览 */
|
|
303
303
|
async ensureSignedPreviews() {
|
|
304
304
|
const e = this.fileList.filter(
|
|
305
|
-
(t) => t.status === "success" && t.url && !ce(t.previewUrl) && !
|
|
305
|
+
(t) => t.status === "success" && t.url && !ce(t.previewUrl) && !Tt(t.previewUrl || t.url)
|
|
306
306
|
);
|
|
307
307
|
if (e.length)
|
|
308
308
|
try {
|
|
@@ -346,7 +346,7 @@ const Dt = {
|
|
|
346
346
|
handleUpload() {
|
|
347
347
|
if (!this.disabled) {
|
|
348
348
|
if (this.fileList.length >= this.fileNum) {
|
|
349
|
-
|
|
349
|
+
W.error(`文件数量不超过${this.fileNum}`);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
this.openFilePicker();
|
|
@@ -357,7 +357,7 @@ const Dt = {
|
|
|
357
357
|
if (!t.length) return;
|
|
358
358
|
const n = this.dialogVisible || this.isCropper, r = this.fileNum - this.fileList.length;
|
|
359
359
|
if (!n && t.length > r) {
|
|
360
|
-
|
|
360
|
+
W.error(`文件数量不超过${this.fileNum}个`);
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
363
|
const s = [], o = [];
|
|
@@ -406,7 +406,7 @@ const Dt = {
|
|
|
406
406
|
const t = this.maxFileSize * 1024 * 1024, n = [];
|
|
407
407
|
return e.forEach((r) => {
|
|
408
408
|
if (r.size > t) {
|
|
409
|
-
|
|
409
|
+
W.error(`「${r.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
const s = URL.createObjectURL(r), o = {
|
|
@@ -435,7 +435,7 @@ const Dt = {
|
|
|
435
435
|
});
|
|
436
436
|
e.url = r.url, e.previewUrl = t || r.previewUrl || r.url, e.status = "success", n(100), e.raw = null, this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), this.emitFile(), this.$emit("success", r, e);
|
|
437
437
|
} catch (r) {
|
|
438
|
-
e.status = "fail", n(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0),
|
|
438
|
+
e.status = "fail", n(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), W.error((r == null ? void 0 : r.message) || "上传失败"), this.$emit("error", r, e);
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
initCropper() {
|
|
@@ -464,7 +464,7 @@ const Dt = {
|
|
|
464
464
|
},
|
|
465
465
|
confirmCrop() {
|
|
466
466
|
if (this.uploadingCount) {
|
|
467
|
-
|
|
467
|
+
W.error("上传中,请稍后!");
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
if (!this.cropper) return;
|
|
@@ -487,7 +487,7 @@ const Dt = {
|
|
|
487
487
|
}, Vt = { class: "upload-image-cropper" }, Ot = ["multiple", "accept"], It = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "grey-tips"
|
|
490
|
-
}, At = { key: 0 },
|
|
490
|
+
}, At = { key: 0 }, zt = { class: "list-box" }, Ht = {
|
|
491
491
|
key: 0,
|
|
492
492
|
class: "status-mask is-uploading"
|
|
493
493
|
}, Et = { class: "progress-wrap" }, jt = { class: "percent-text" }, Kt = {
|
|
@@ -501,103 +501,103 @@ const Dt = {
|
|
|
501
501
|
class: "btn-box btn-box--rotate"
|
|
502
502
|
}, Jt = { class: "btn-box" };
|
|
503
503
|
function Qt(e, t, n, r, s, o) {
|
|
504
|
-
const m =
|
|
505
|
-
return
|
|
506
|
-
|
|
504
|
+
const m = $("el-image"), h = $("el-progress"), L = $("CircleCloseFilled"), _ = $("el-icon"), S = $("Delete"), T = $("Plus"), p = $("el-button"), c = $("el-dialog");
|
|
505
|
+
return d(), y("div", Vt, [
|
|
506
|
+
C("input", {
|
|
507
507
|
ref: "fileInput",
|
|
508
508
|
type: "file",
|
|
509
509
|
class: "file-input",
|
|
510
510
|
multiple: o.multiple,
|
|
511
511
|
accept: n.accept,
|
|
512
|
-
onChange: t[0] || (t[0] = (...
|
|
512
|
+
onChange: t[0] || (t[0] = (...i) => o.onFileChange && o.onFileChange(...i))
|
|
513
513
|
}, null, 40, Ot),
|
|
514
|
-
n.greyTips ? (
|
|
515
|
-
n.otherTips ? (
|
|
516
|
-
|
|
517
|
-
])) :
|
|
518
|
-
|
|
519
|
-
(
|
|
520
|
-
key:
|
|
521
|
-
class:
|
|
514
|
+
n.greyTips ? (d(), y("div", It, [
|
|
515
|
+
n.otherTips ? (d(), y("div", At, B(n.otherTips), 1)) : V("", !0),
|
|
516
|
+
K(" " + B(n.greyTips), 1)
|
|
517
|
+
])) : V("", !0),
|
|
518
|
+
C("div", zt, [
|
|
519
|
+
(d(!0), y(Y, null, G(s.fileList, (i, g) => (d(), y("div", {
|
|
520
|
+
key: i.uid,
|
|
521
|
+
class: z(["image-box", [`is-${i.status}`]]),
|
|
522
522
|
style: re(n.imageStyle)
|
|
523
523
|
}, [
|
|
524
|
-
|
|
525
|
-
src:
|
|
524
|
+
x(m, {
|
|
525
|
+
src: i.previewUrl || i.url,
|
|
526
526
|
fit: "cover",
|
|
527
527
|
class: "img"
|
|
528
528
|
}, null, 8, ["src"]),
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
i.status === "uploading" ? (d(), y("div", Ht, [
|
|
530
|
+
C("div", Et, [
|
|
531
|
+
x(h, {
|
|
532
532
|
type: "circle",
|
|
533
|
-
percentage:
|
|
533
|
+
percentage: i.percent,
|
|
534
534
|
width: 30,
|
|
535
535
|
"stroke-width": 3,
|
|
536
536
|
"show-text": !1,
|
|
537
537
|
color: "var(--mg-primary, #ff5722)"
|
|
538
538
|
}, null, 8, ["percentage"]),
|
|
539
|
-
|
|
539
|
+
C("span", jt, B(i.percent) + "%", 1)
|
|
540
540
|
])
|
|
541
|
-
])) :
|
|
542
|
-
|
|
541
|
+
])) : i.status === "fail" ? (d(), y("div", Kt, [
|
|
542
|
+
x(_, {
|
|
543
543
|
class: "fail-icon",
|
|
544
544
|
size: 16
|
|
545
545
|
}, {
|
|
546
|
-
default:
|
|
547
|
-
|
|
546
|
+
default: F(() => [
|
|
547
|
+
x(L)
|
|
548
548
|
]),
|
|
549
549
|
_: 1
|
|
550
550
|
}),
|
|
551
|
-
t[5] || (t[5] =
|
|
552
|
-
|
|
551
|
+
t[5] || (t[5] = C("span", { class: "fail-text" }, "失败", -1)),
|
|
552
|
+
x(_, {
|
|
553
553
|
class: "remove-icon",
|
|
554
554
|
size: 14,
|
|
555
555
|
title: "删除",
|
|
556
|
-
onClick: de((
|
|
556
|
+
onClick: de((w) => o.removeImg(g), ["stop"])
|
|
557
557
|
}, {
|
|
558
|
-
default:
|
|
559
|
-
|
|
558
|
+
default: F(() => [
|
|
559
|
+
x(S)
|
|
560
560
|
]),
|
|
561
561
|
_: 1
|
|
562
562
|
}, 8, ["onClick"])
|
|
563
|
-
])) : (
|
|
563
|
+
])) : (d(), y("div", {
|
|
564
564
|
key: 2,
|
|
565
565
|
class: "status-mask is-success",
|
|
566
|
-
onClick: (
|
|
566
|
+
onClick: (w) => o.removeImg(g)
|
|
567
567
|
}, [
|
|
568
|
-
|
|
568
|
+
x(_, {
|
|
569
569
|
class: "remove-icon",
|
|
570
570
|
size: 16
|
|
571
571
|
}, {
|
|
572
|
-
default:
|
|
573
|
-
|
|
572
|
+
default: F(() => [
|
|
573
|
+
x(S)
|
|
574
574
|
]),
|
|
575
575
|
_: 1
|
|
576
576
|
})
|
|
577
577
|
], 8, Wt))
|
|
578
578
|
], 6))), 128)),
|
|
579
|
-
|
|
579
|
+
te(C("div", {
|
|
580
580
|
class: "image-box upload-btn",
|
|
581
581
|
style: re(n.imageStyle),
|
|
582
|
-
onClick: t[1] || (t[1] = (...
|
|
582
|
+
onClick: t[1] || (t[1] = (...i) => o.handleUpload && o.handleUpload(...i))
|
|
583
583
|
}, [
|
|
584
|
-
|
|
584
|
+
x(_, {
|
|
585
585
|
class: "icon",
|
|
586
586
|
size: 14
|
|
587
587
|
}, {
|
|
588
|
-
default:
|
|
589
|
-
|
|
588
|
+
default: F(() => [
|
|
589
|
+
x(T)
|
|
590
590
|
]),
|
|
591
591
|
_: 1
|
|
592
592
|
}),
|
|
593
|
-
t[6] || (t[6] =
|
|
593
|
+
t[6] || (t[6] = C("div", null, "上传图片", -1))
|
|
594
594
|
], 4), [
|
|
595
|
-
[
|
|
595
|
+
[ne, o.showUploadBtn]
|
|
596
596
|
])
|
|
597
597
|
]),
|
|
598
|
-
|
|
598
|
+
x(c, {
|
|
599
599
|
modelValue: s.dialogVisible,
|
|
600
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
600
|
+
"onUpdate:modelValue": t[4] || (t[4] = (i) => s.dialogVisible = i),
|
|
601
601
|
title: "裁剪图片",
|
|
602
602
|
width: "650px",
|
|
603
603
|
top: "5vh",
|
|
@@ -606,63 +606,63 @@ function Qt(e, t, n, r, s, o) {
|
|
|
606
606
|
"close-on-click-modal": !1,
|
|
607
607
|
onClose: o.handleBack
|
|
608
608
|
}, {
|
|
609
|
-
footer:
|
|
610
|
-
n.isDegree ? (
|
|
611
|
-
|
|
612
|
-
onClick: t[2] || (t[2] = (
|
|
609
|
+
footer: F(() => [
|
|
610
|
+
n.isDegree ? (d(), y("div", Xt, [
|
|
611
|
+
x(p, {
|
|
612
|
+
onClick: t[2] || (t[2] = (i) => o.rotate(-n.degree))
|
|
613
613
|
}, {
|
|
614
|
-
default:
|
|
615
|
-
|
|
614
|
+
default: F(() => [...t[7] || (t[7] = [
|
|
615
|
+
K("向左旋转", -1)
|
|
616
616
|
])]),
|
|
617
617
|
_: 1
|
|
618
618
|
}),
|
|
619
|
-
|
|
620
|
-
onClick: t[3] || (t[3] = (
|
|
619
|
+
x(p, {
|
|
620
|
+
onClick: t[3] || (t[3] = (i) => o.rotate(n.degree))
|
|
621
621
|
}, {
|
|
622
|
-
default:
|
|
623
|
-
|
|
622
|
+
default: F(() => [...t[8] || (t[8] = [
|
|
623
|
+
K("向右旋转", -1)
|
|
624
624
|
])]),
|
|
625
625
|
_: 1
|
|
626
626
|
})
|
|
627
|
-
])) :
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
])) : V("", !0),
|
|
628
|
+
C("div", Jt, [
|
|
629
|
+
x(p, {
|
|
630
630
|
type: "primary",
|
|
631
631
|
onClick: o.openFilePicker
|
|
632
632
|
}, {
|
|
633
|
-
default:
|
|
634
|
-
|
|
633
|
+
default: F(() => [
|
|
634
|
+
K(B(s.cropImageUrl ? "重新上传" : "点击上传"), 1)
|
|
635
635
|
]),
|
|
636
636
|
_: 1
|
|
637
637
|
}, 8, ["onClick"]),
|
|
638
|
-
|
|
638
|
+
x(p, {
|
|
639
639
|
type: "primary",
|
|
640
640
|
onClick: o.confirmCrop
|
|
641
641
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
|
|
642
|
+
default: F(() => [...t[9] || (t[9] = [
|
|
643
|
+
K("确定", -1)
|
|
644
644
|
])]),
|
|
645
645
|
_: 1
|
|
646
646
|
}, 8, ["onClick"])
|
|
647
647
|
])
|
|
648
648
|
]),
|
|
649
|
-
default:
|
|
650
|
-
|
|
651
|
-
|
|
649
|
+
default: F(() => [
|
|
650
|
+
C("div", Yt, [
|
|
651
|
+
te(C("img", {
|
|
652
652
|
ref: "cropImage",
|
|
653
653
|
src: s.cropImageUrl,
|
|
654
654
|
class: "cropper-img"
|
|
655
655
|
}, null, 8, qt), [
|
|
656
|
-
[
|
|
656
|
+
[ne, s.cropImageUrl]
|
|
657
657
|
]),
|
|
658
|
-
s.cropImageUrl ?
|
|
658
|
+
s.cropImageUrl ? V("", !0) : (d(), y("div", Gt, "请选择图片后进行裁剪"))
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
_: 1
|
|
662
662
|
}, 8, ["modelValue", "onClose"])
|
|
663
663
|
]);
|
|
664
664
|
}
|
|
665
|
-
const Zt = /* @__PURE__ */
|
|
665
|
+
const Zt = /* @__PURE__ */ X(Dt, [["render", Qt], ["__scopeId", "data-v-68531340"]]), en = ".mp4,.mov,.jpg,.jpeg,.m3u8,.png,.m4v,.doc,.docx,.xls,.xlsx,.pdf";
|
|
666
666
|
let Be = 0;
|
|
667
667
|
function we() {
|
|
668
668
|
return Be += 1, `mg-file-${Date.now()}-${Be}`;
|
|
@@ -832,7 +832,7 @@ const rn = {
|
|
|
832
832
|
handleUpload() {
|
|
833
833
|
if (!this.disabled) {
|
|
834
834
|
if (this.fileList.length >= this.fileNum) {
|
|
835
|
-
|
|
835
|
+
W.error(`文件数量不超过${this.fileNum}`);
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
838
|
this.openFilePicker();
|
|
@@ -847,7 +847,7 @@ const rn = {
|
|
|
847
847
|
if (!t.length || this.disabled) return;
|
|
848
848
|
const n = this.fileNum - this.fileList.length;
|
|
849
849
|
if (t.length > n && !(this.resetFilelist || this.fileNum === 1)) {
|
|
850
|
-
|
|
850
|
+
W.error(`文件数量不超过${this.fileNum}个`);
|
|
851
851
|
return;
|
|
852
852
|
}
|
|
853
853
|
const r = [], s = [];
|
|
@@ -874,7 +874,7 @@ const rn = {
|
|
|
874
874
|
const t = this.maxFileSize * 1024 * 1024, n = [];
|
|
875
875
|
return e.forEach((r) => {
|
|
876
876
|
if (r.size > t) {
|
|
877
|
-
|
|
877
|
+
W.error(`「${r.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
880
880
|
const s = {
|
|
@@ -903,7 +903,7 @@ const rn = {
|
|
|
903
903
|
});
|
|
904
904
|
e.url = n.url, e.name = e.name || oe(n.url), e.status = "success", t(100), e.raw = null, this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), this.emitFile(), this.$emit("success", n, e);
|
|
905
905
|
} catch (n) {
|
|
906
|
-
e.status = "fail", t(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0),
|
|
906
|
+
e.status = "fail", t(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), W.error((n == null ? void 0 : n.message) || "上传失败"), this.$emit("error", n, e);
|
|
907
907
|
}
|
|
908
908
|
},
|
|
909
909
|
onFileClick(e) {
|
|
@@ -922,12 +922,15 @@ const rn = {
|
|
|
922
922
|
class: "el-upload__tip"
|
|
923
923
|
}, dn = {
|
|
924
924
|
key: 2,
|
|
925
|
-
class: "
|
|
926
|
-
}, pn = { class: "
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
925
|
+
class: "mg-file-list"
|
|
926
|
+
}, pn = { class: "mg-file-item__row" }, fn = ["href", "target", "onClick"], hn = ["title"], mn = {
|
|
927
|
+
key: 0,
|
|
928
|
+
class: "mg-file-item__percent"
|
|
929
|
+
}, gn = ["onClick"];
|
|
930
|
+
function yn(e, t, n, r, s, o) {
|
|
931
|
+
const m = $("el-button"), h = $("Document"), L = $("el-icon"), _ = $("CircleCheck"), S = $("CircleClose"), T = $("Close"), p = $("el-progress");
|
|
932
|
+
return d(), y("div", on, [
|
|
933
|
+
C("input", {
|
|
931
934
|
ref: "fileInput",
|
|
932
935
|
type: "file",
|
|
933
936
|
class: "file-input",
|
|
@@ -936,83 +939,87 @@ function gn(e, t, n, r, s, o) {
|
|
|
936
939
|
disabled: n.disabled,
|
|
937
940
|
onChange: t[0] || (t[0] = (...c) => o.onFileChange && o.onFileChange(...c))
|
|
938
941
|
}, null, 40, un),
|
|
939
|
-
n.showButton ? (
|
|
942
|
+
n.showButton ? (d(), D(m, {
|
|
940
943
|
key: 0,
|
|
941
944
|
type: "primary",
|
|
942
945
|
disabled: n.disabled || !o.showUploadBtn,
|
|
943
946
|
onClick: o.handleUpload
|
|
944
947
|
}, {
|
|
945
|
-
default:
|
|
946
|
-
|
|
948
|
+
default: F(() => [
|
|
949
|
+
K(B(n.buttonText), 1)
|
|
947
950
|
]),
|
|
948
951
|
_: 1
|
|
949
|
-
}, 8, ["disabled", "onClick"])) :
|
|
950
|
-
o.tipText ? (
|
|
951
|
-
n.showFileList ? (
|
|
952
|
-
(
|
|
952
|
+
}, 8, ["disabled", "onClick"])) : V("", !0),
|
|
953
|
+
o.tipText ? (d(), y("div", cn, B(o.tipText), 1)) : V("", !0),
|
|
954
|
+
n.showFileList ? (d(), y("ul", dn, [
|
|
955
|
+
(d(!0), y(Y, null, G(s.fileList, (c, i) => (d(), y("li", {
|
|
953
956
|
key: c.uid,
|
|
954
|
-
class:
|
|
955
|
-
tabindex: "0"
|
|
957
|
+
class: z(["mg-file-item", [`is-${c.status}`]])
|
|
956
958
|
}, [
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
class: "
|
|
959
|
+
C("div", pn, [
|
|
960
|
+
C("a", {
|
|
961
|
+
class: "mg-file-item__name",
|
|
960
962
|
href: c.url || void 0,
|
|
961
963
|
target: c.url ? "_blank" : void 0,
|
|
962
964
|
rel: "noopener noreferrer",
|
|
963
|
-
onClick: de((
|
|
965
|
+
onClick: de((g) => o.onFileClick(c), ["prevent"])
|
|
964
966
|
}, [
|
|
965
|
-
|
|
966
|
-
default:
|
|
967
|
-
|
|
967
|
+
x(L, { class: "mg-file-item__doc" }, {
|
|
968
|
+
default: F(() => [
|
|
969
|
+
x(h)
|
|
968
970
|
]),
|
|
969
971
|
_: 1
|
|
970
972
|
}),
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
973
|
+
C("span", {
|
|
974
|
+
class: "mg-file-item__text",
|
|
975
|
+
title: c.name
|
|
976
|
+
}, B(c.name), 9, hn)
|
|
977
|
+
], 8, fn),
|
|
978
|
+
c.status === "uploading" ? (d(), y("span", mn, B(c.percent) + "% ", 1)) : c.status === "success" ? (d(), D(L, {
|
|
979
|
+
key: 1,
|
|
980
|
+
class: "mg-file-item__status is-success"
|
|
978
981
|
}, {
|
|
979
|
-
default:
|
|
980
|
-
|
|
982
|
+
default: F(() => [
|
|
983
|
+
x(_)
|
|
981
984
|
]),
|
|
982
985
|
_: 1
|
|
983
|
-
})) : c.status === "fail" ? (
|
|
984
|
-
key:
|
|
985
|
-
class: "
|
|
986
|
+
})) : c.status === "fail" ? (d(), D(L, {
|
|
987
|
+
key: 2,
|
|
988
|
+
class: "mg-file-item__status is-fail"
|
|
986
989
|
}, {
|
|
987
|
-
default:
|
|
988
|
-
|
|
990
|
+
default: F(() => [
|
|
991
|
+
x(S)
|
|
989
992
|
]),
|
|
990
993
|
_: 1
|
|
991
|
-
})) :
|
|
994
|
+
})) : V("", !0),
|
|
995
|
+
c.status !== "uploading" ? (d(), y("button", {
|
|
996
|
+
key: 3,
|
|
997
|
+
type: "button",
|
|
998
|
+
class: "mg-file-item__remove",
|
|
999
|
+
title: "删除",
|
|
1000
|
+
onClick: de((g) => o.removeFile(i), ["stop"])
|
|
1001
|
+
}, [
|
|
1002
|
+
x(L, { size: 14 }, {
|
|
1003
|
+
default: F(() => [
|
|
1004
|
+
x(T)
|
|
1005
|
+
]),
|
|
1006
|
+
_: 1
|
|
1007
|
+
})
|
|
1008
|
+
], 8, gn)) : V("", !0)
|
|
992
1009
|
]),
|
|
993
|
-
c.status
|
|
1010
|
+
c.status === "uploading" ? (d(), D(p, {
|
|
994
1011
|
key: 0,
|
|
995
|
-
class: "
|
|
996
|
-
title: "删除",
|
|
997
|
-
onClick: de((k) => o.removeFile(d), ["stop"])
|
|
998
|
-
}, {
|
|
999
|
-
default: S(() => [
|
|
1000
|
-
U(M)
|
|
1001
|
-
]),
|
|
1002
|
-
_: 1
|
|
1003
|
-
}, 8, ["onClick"])) : D("", !0),
|
|
1004
|
-
c.status === "uploading" ? (p(), P(u, {
|
|
1005
|
-
key: 1,
|
|
1006
|
-
class: "el-upload-list__item-progress",
|
|
1012
|
+
class: "mg-file-item__progress",
|
|
1007
1013
|
type: "line",
|
|
1008
1014
|
percentage: c.percent,
|
|
1009
|
-
"stroke-width":
|
|
1010
|
-
|
|
1015
|
+
"stroke-width": 4,
|
|
1016
|
+
"show-text": !1
|
|
1017
|
+
}, null, 8, ["percentage"])) : V("", !0)
|
|
1011
1018
|
], 2))), 128))
|
|
1012
|
-
])) :
|
|
1019
|
+
])) : V("", !0)
|
|
1013
1020
|
]);
|
|
1014
1021
|
}
|
|
1015
|
-
const
|
|
1022
|
+
const vn = /* @__PURE__ */ X(rn, [["render", yn], ["__scopeId", "data-v-8ca1b0c0"]]), bn = {
|
|
1016
1023
|
__name: "DateRangePicker",
|
|
1017
1024
|
props: {
|
|
1018
1025
|
start: {
|
|
@@ -1044,86 +1051,86 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1044
1051
|
emits: ["update:start", "update:end", "change"],
|
|
1045
1052
|
setup(e, { emit: t }) {
|
|
1046
1053
|
const n = t, r = e;
|
|
1047
|
-
function s(
|
|
1048
|
-
const c = new Date(
|
|
1054
|
+
function s(p) {
|
|
1055
|
+
const c = new Date(p);
|
|
1049
1056
|
return c.setHours(0, 0, 0, 0), c;
|
|
1050
1057
|
}
|
|
1051
|
-
function o(
|
|
1052
|
-
const c = new Date(
|
|
1058
|
+
function o(p) {
|
|
1059
|
+
const c = new Date(p);
|
|
1053
1060
|
return c.setHours(23, 59, 59, 0), c;
|
|
1054
1061
|
}
|
|
1055
|
-
function m(
|
|
1056
|
-
const c = o(/* @__PURE__ */ new Date()),
|
|
1057
|
-
return
|
|
1062
|
+
function m(p) {
|
|
1063
|
+
const c = o(/* @__PURE__ */ new Date()), i = s(/* @__PURE__ */ new Date());
|
|
1064
|
+
return p(i), [i, c];
|
|
1058
1065
|
}
|
|
1059
1066
|
const h = [
|
|
1060
1067
|
{
|
|
1061
1068
|
text: "七天内",
|
|
1062
|
-
value: () => m((
|
|
1063
|
-
|
|
1069
|
+
value: () => m((p) => {
|
|
1070
|
+
p.setDate(p.getDate() - 6);
|
|
1064
1071
|
})
|
|
1065
1072
|
},
|
|
1066
1073
|
{
|
|
1067
1074
|
text: "一个月内",
|
|
1068
|
-
value: () => m((
|
|
1069
|
-
|
|
1075
|
+
value: () => m((p) => {
|
|
1076
|
+
p.setMonth(p.getMonth() - 1);
|
|
1070
1077
|
})
|
|
1071
1078
|
},
|
|
1072
1079
|
{
|
|
1073
1080
|
text: "一年内",
|
|
1074
|
-
value: () => m((
|
|
1075
|
-
|
|
1081
|
+
value: () => m((p) => {
|
|
1082
|
+
p.setFullYear(p.getFullYear() - 1);
|
|
1076
1083
|
})
|
|
1077
1084
|
}
|
|
1078
|
-
],
|
|
1079
|
-
var
|
|
1085
|
+
], L = ye(() => {
|
|
1086
|
+
var p;
|
|
1080
1087
|
if (r.showShortcuts)
|
|
1081
|
-
return (
|
|
1082
|
-
}),
|
|
1083
|
-
function
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
1088
|
+
return (p = r.shortcuts) != null && p.length ? r.shortcuts : h;
|
|
1089
|
+
}), _ = O([]);
|
|
1090
|
+
function S(p, c) {
|
|
1091
|
+
if (p && c) {
|
|
1092
|
+
_.value = [p, c];
|
|
1086
1093
|
return;
|
|
1087
1094
|
}
|
|
1088
|
-
|
|
1095
|
+
_.value = [];
|
|
1089
1096
|
}
|
|
1090
|
-
|
|
1097
|
+
ae(
|
|
1091
1098
|
() => [r.start, r.end],
|
|
1092
|
-
([
|
|
1093
|
-
|
|
1099
|
+
([p, c]) => {
|
|
1100
|
+
S(p, c);
|
|
1094
1101
|
}
|
|
1095
1102
|
), ve(() => {
|
|
1096
|
-
|
|
1103
|
+
S(r.start, r.end);
|
|
1097
1104
|
});
|
|
1098
|
-
function
|
|
1099
|
-
const c = Array.isArray(
|
|
1100
|
-
c &&
|
|
1105
|
+
function T(p) {
|
|
1106
|
+
const c = Array.isArray(p) ? p[0] : "", i = Array.isArray(p) ? p[1] : "";
|
|
1107
|
+
c && i ? (n("update:start", c), n("update:end", i)) : (n("update:start", ""), n("update:end", "")), n("change");
|
|
1101
1108
|
}
|
|
1102
|
-
return (
|
|
1103
|
-
const
|
|
1104
|
-
return
|
|
1105
|
-
modelValue:
|
|
1106
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
1109
|
+
return (p, c) => {
|
|
1110
|
+
const i = $("el-date-picker");
|
|
1111
|
+
return d(), D(i, {
|
|
1112
|
+
modelValue: _.value,
|
|
1113
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => _.value = g),
|
|
1107
1114
|
type: e.type,
|
|
1108
1115
|
"range-separator": "至",
|
|
1109
1116
|
"start-placeholder": e.title ? `${e.title} 开始` : "开始",
|
|
1110
1117
|
"end-placeholder": "结束",
|
|
1111
1118
|
"value-format": e.valueFormat,
|
|
1112
1119
|
"default-time": e.defaultTime,
|
|
1113
|
-
shortcuts:
|
|
1120
|
+
shortcuts: L.value,
|
|
1114
1121
|
class: "date-range-picker",
|
|
1115
|
-
onChange:
|
|
1122
|
+
onChange: T,
|
|
1116
1123
|
clearable: e.canClearable
|
|
1117
1124
|
}, null, 8, ["modelValue", "type", "start-placeholder", "value-format", "default-time", "shortcuts", "clearable"]);
|
|
1118
1125
|
};
|
|
1119
1126
|
}
|
|
1120
|
-
}, Ge = /* @__PURE__ */
|
|
1127
|
+
}, Ge = /* @__PURE__ */ X(bn, [["__scopeId", "data-v-0dfa12ab"]]), _n = { class: "common-search__body" }, wn = { class: "common-search__control-wrap" }, Cn = ["onKeyup"], kn = { class: "common-search__range-sep" }, Un = {
|
|
1121
1128
|
key: 5,
|
|
1122
1129
|
class: "common-search__range"
|
|
1123
|
-
},
|
|
1130
|
+
}, xn = {
|
|
1124
1131
|
key: 0,
|
|
1125
1132
|
class: "common-search__actions is-inline"
|
|
1126
|
-
},
|
|
1133
|
+
}, Sn = { class: "common-search__actions-main" }, Fn = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
|
|
1127
1134
|
__name: "SearchForm",
|
|
1128
1135
|
props: {
|
|
1129
1136
|
modelValue: { type: Object, default: () => ({}) },
|
|
@@ -1131,118 +1138,118 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1131
1138
|
},
|
|
1132
1139
|
emits: ["change", "search", "reset", "update:modelValue"],
|
|
1133
1140
|
setup(e, { emit: t }) {
|
|
1134
|
-
const n = e, r = t, s =
|
|
1141
|
+
const n = e, r = t, s = O({}), o = Le({}), m = Le({});
|
|
1135
1142
|
let h = !1;
|
|
1136
|
-
function
|
|
1137
|
-
return JSON.stringify(l ?? {}) === JSON.stringify(
|
|
1143
|
+
function L(l, u) {
|
|
1144
|
+
return JSON.stringify(l ?? {}) === JSON.stringify(u ?? {});
|
|
1138
1145
|
}
|
|
1139
|
-
const
|
|
1140
|
-
let
|
|
1141
|
-
const
|
|
1142
|
-
if (!(!
|
|
1146
|
+
const _ = O(null), S = O(!1), T = O(!1), p = O(0), c = O(0), i = O(0), g = O(null);
|
|
1147
|
+
let w = null, M = !1, R = !1;
|
|
1148
|
+
const b = ye(() => {
|
|
1149
|
+
if (!(!T.value || g.value == null))
|
|
1143
1150
|
return {
|
|
1144
|
-
maxHeight: `${
|
|
1151
|
+
maxHeight: `${g.value}px`,
|
|
1145
1152
|
overflow: "hidden"
|
|
1146
1153
|
};
|
|
1147
1154
|
});
|
|
1148
|
-
function
|
|
1155
|
+
function H(l = {}) {
|
|
1149
1156
|
return String(l.label || l.title || "").trim();
|
|
1150
1157
|
}
|
|
1151
|
-
function
|
|
1152
|
-
return String(l.tip ||
|
|
1158
|
+
function N(l = {}) {
|
|
1159
|
+
return String(l.tip || H(l) || "").trim();
|
|
1153
1160
|
}
|
|
1154
|
-
function
|
|
1155
|
-
const
|
|
1156
|
-
return !
|
|
1161
|
+
function E(l = "") {
|
|
1162
|
+
const u = String(l).trim();
|
|
1163
|
+
return !u || (/* @__PURE__ */ new Set(["全部", "或选择", "请输入或选择"])).has(u) ? "" : u.replace(/^请(输入|选择)/, "").trim() || u;
|
|
1157
1164
|
}
|
|
1158
|
-
function J(l = {},
|
|
1165
|
+
function J(l = {}, u = "") {
|
|
1159
1166
|
if (l.placeholder != null && l.placeholder !== "") {
|
|
1160
|
-
const
|
|
1161
|
-
if (
|
|
1167
|
+
const U = E(l.placeholder);
|
|
1168
|
+
if (U) return U;
|
|
1162
1169
|
}
|
|
1163
|
-
const f =
|
|
1164
|
-
return f ||
|
|
1170
|
+
const f = H(l);
|
|
1171
|
+
return f || E(u) || u;
|
|
1165
1172
|
}
|
|
1166
|
-
function Ce(l = {},
|
|
1167
|
-
const f =
|
|
1168
|
-
return f != null && f !== "" ?
|
|
1173
|
+
function Ce(l = {}, u = "min") {
|
|
1174
|
+
const f = u === "min" ? l.minPlaceholder : l.maxPlaceholder, k = H(l), U = u === "min" ? "最小值" : "最大值", P = /* @__PURE__ */ new Set(["最小", "最大", "最小值", "最大值"]);
|
|
1175
|
+
return f != null && f !== "" ? k && P.has(String(f).trim()) ? `${k}${f}` : f : k ? `${k}${U}` : U;
|
|
1169
1176
|
}
|
|
1170
|
-
|
|
1177
|
+
ae(
|
|
1171
1178
|
() => n.modelValue,
|
|
1172
1179
|
(l) => {
|
|
1173
|
-
|
|
1180
|
+
L(l, s.value) || (h = !0, s.value = { ...l || {} }, Z(() => {
|
|
1174
1181
|
h = !1;
|
|
1175
1182
|
}));
|
|
1176
1183
|
},
|
|
1177
1184
|
{ deep: !0, immediate: !0 }
|
|
1178
|
-
),
|
|
1185
|
+
), ae(
|
|
1179
1186
|
s,
|
|
1180
1187
|
() => {
|
|
1181
1188
|
h || r("update:modelValue", { ...s.value });
|
|
1182
1189
|
},
|
|
1183
1190
|
{ deep: !0 }
|
|
1184
|
-
),
|
|
1191
|
+
), ae(
|
|
1185
1192
|
() => n.itemList,
|
|
1186
1193
|
() => {
|
|
1187
|
-
|
|
1194
|
+
S.value = !1, p.value = 0, Z(() => Q());
|
|
1188
1195
|
},
|
|
1189
1196
|
{ deep: !0 }
|
|
1190
1197
|
), ve(() => {
|
|
1191
|
-
Z(() => Q()), typeof ResizeObserver < "u" && (
|
|
1192
|
-
!
|
|
1193
|
-
}),
|
|
1194
|
-
}),
|
|
1195
|
-
|
|
1198
|
+
Z(() => Q()), typeof ResizeObserver < "u" && (w = new ResizeObserver(() => {
|
|
1199
|
+
!M && !R && Q();
|
|
1200
|
+
}), _.value && w.observe(_.value)), window.addEventListener("resize", ke);
|
|
1201
|
+
}), ze(() => {
|
|
1202
|
+
w == null || w.disconnect(), window.removeEventListener("resize", ke);
|
|
1196
1203
|
});
|
|
1197
1204
|
function ke() {
|
|
1198
|
-
!
|
|
1205
|
+
!M && !R && Q();
|
|
1199
1206
|
}
|
|
1200
1207
|
function Je(l) {
|
|
1201
|
-
const
|
|
1202
|
-
if (!
|
|
1203
|
-
const f =
|
|
1204
|
-
return l === Math.min(f,
|
|
1208
|
+
const u = n.itemList.length;
|
|
1209
|
+
if (!u) return !1;
|
|
1210
|
+
const f = p.value > 0 ? p.value : u;
|
|
1211
|
+
return l === Math.min(f, u) - 1;
|
|
1205
1212
|
}
|
|
1206
|
-
function Qe(l,
|
|
1207
|
-
let
|
|
1208
|
-
for (let
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1213
|
+
function Qe(l, u, f, k) {
|
|
1214
|
+
let U = 1, P = l[u].offsetWidth;
|
|
1215
|
+
for (let I = u + 1; I < l.length; I += 1) {
|
|
1216
|
+
const A = l[I].offsetWidth;
|
|
1217
|
+
P + k + A > f ? (U += 1, P = A) : P += k + A;
|
|
1211
1218
|
}
|
|
1212
|
-
return
|
|
1219
|
+
return U;
|
|
1213
1220
|
}
|
|
1214
|
-
function Ze(l,
|
|
1215
|
-
let
|
|
1216
|
-
for (let
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
|
|
1221
|
+
function Ze(l, u, f, k) {
|
|
1222
|
+
let U = 0, P = 0;
|
|
1223
|
+
for (let I = 0; I < l.length; I += 1) {
|
|
1224
|
+
const A = l[I].offsetWidth, q = U === 0 ? A : U + k + A;
|
|
1225
|
+
if (q + k + f <= u)
|
|
1226
|
+
U = q, P = I + 1;
|
|
1220
1227
|
else
|
|
1221
1228
|
break;
|
|
1222
1229
|
}
|
|
1223
|
-
return
|
|
1230
|
+
return P || 1;
|
|
1224
1231
|
}
|
|
1225
1232
|
function et(l) {
|
|
1226
|
-
const
|
|
1233
|
+
const u = l.type === "number-range" || l.type === "numberRange", f = 360;
|
|
1227
1234
|
if (!l.width) {
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
return { width:
|
|
1235
|
+
if (u) {
|
|
1236
|
+
const P = `${f}px`;
|
|
1237
|
+
return { width: P, minWidth: P };
|
|
1231
1238
|
}
|
|
1232
1239
|
return;
|
|
1233
1240
|
}
|
|
1234
|
-
let
|
|
1235
|
-
const
|
|
1236
|
-
return { width:
|
|
1241
|
+
let k = typeof l.width == "number" ? l.width : parseInt(String(l.width), 10);
|
|
1242
|
+
const U = typeof l.width == "number" || Number.isFinite(k) ? `${k}px` : l.width;
|
|
1243
|
+
return { width: U, minWidth: U };
|
|
1237
1244
|
}
|
|
1238
|
-
function Ue(l,
|
|
1245
|
+
function Ue(l, u) {
|
|
1239
1246
|
if (l == null) return "";
|
|
1240
1247
|
if (typeof l != "object") return String(l);
|
|
1241
|
-
const f =
|
|
1248
|
+
const f = u.optionsLabel || "label";
|
|
1242
1249
|
return typeof f == "string" ? l[f] : Array.isArray(f) ? `${l[f[0]]}(${l[f[1]]})` : l.label;
|
|
1243
1250
|
}
|
|
1244
|
-
function ie(l,
|
|
1245
|
-
return l == null || typeof l != "object" ? l : l[
|
|
1251
|
+
function ie(l, u) {
|
|
1252
|
+
return l == null || typeof l != "object" ? l : l[u.optionsValue || "value"];
|
|
1246
1253
|
}
|
|
1247
1254
|
function pe(l) {
|
|
1248
1255
|
return {
|
|
@@ -1250,35 +1257,35 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1250
1257
|
endKey: l.end || `${l.prop}Max`
|
|
1251
1258
|
};
|
|
1252
1259
|
}
|
|
1253
|
-
function xe(l,
|
|
1260
|
+
function xe(l, u = 2) {
|
|
1254
1261
|
if (l == null || l === "") return;
|
|
1255
|
-
const f = Ie(l,
|
|
1262
|
+
const f = Ie(l, u);
|
|
1256
1263
|
if (f == null || f === "") return;
|
|
1257
|
-
const
|
|
1258
|
-
return Number.isFinite(
|
|
1264
|
+
const k = Number(String(f).replace(/,/g, ""));
|
|
1265
|
+
return Number.isFinite(k) ? k : void 0;
|
|
1259
1266
|
}
|
|
1260
1267
|
function fe(l) {
|
|
1261
|
-
const { startKey:
|
|
1262
|
-
let
|
|
1263
|
-
|
|
1268
|
+
const { startKey: u, endKey: f } = pe(l), k = l.precision ?? 2;
|
|
1269
|
+
let U = xe(s.value[u], k), P = xe(s.value[f], k);
|
|
1270
|
+
U != null && P != null && U > P && ([U, P] = [P, U]), s.value[u] = U, s.value[f] = P;
|
|
1264
1271
|
}
|
|
1265
1272
|
function tt(l) {
|
|
1266
|
-
fe(l),
|
|
1273
|
+
fe(l), j();
|
|
1267
1274
|
}
|
|
1268
1275
|
function nt(l) {
|
|
1269
|
-
const { startKey:
|
|
1270
|
-
return
|
|
1276
|
+
const { startKey: u, endKey: f } = pe(l), k = s.value[u], U = s.value[f];
|
|
1277
|
+
return k != null && k !== "" || U != null && U !== "";
|
|
1271
1278
|
}
|
|
1272
1279
|
function lt(l) {
|
|
1273
1280
|
if (l.disabled) return;
|
|
1274
|
-
const { startKey:
|
|
1275
|
-
s.value[
|
|
1281
|
+
const { startKey: u, endKey: f } = pe(l);
|
|
1282
|
+
s.value[u] = void 0, s.value[f] = void 0, j();
|
|
1276
1283
|
}
|
|
1277
|
-
async function st(l,
|
|
1284
|
+
async function st(l, u) {
|
|
1278
1285
|
if (typeof l.remoteMethod == "function") {
|
|
1279
1286
|
m[l.prop] = !0;
|
|
1280
1287
|
try {
|
|
1281
|
-
const f = await l.remoteMethod(
|
|
1288
|
+
const f = await l.remoteMethod(u);
|
|
1282
1289
|
o[l.prop] = Array.isArray(f) ? f : [];
|
|
1283
1290
|
} finally {
|
|
1284
1291
|
m[l.prop] = !1;
|
|
@@ -1286,116 +1293,116 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1286
1293
|
}
|
|
1287
1294
|
}
|
|
1288
1295
|
function he(l) {
|
|
1289
|
-
const
|
|
1296
|
+
const u = l.style.maxHeight, f = l.style.overflow, k = l.style.transition;
|
|
1290
1297
|
l.style.transition = "none", l.style.maxHeight = "none", l.style.overflow = "visible";
|
|
1291
|
-
const
|
|
1292
|
-
return l.style.maxHeight =
|
|
1298
|
+
const U = l.scrollHeight;
|
|
1299
|
+
return l.style.maxHeight = u, l.style.overflow = f, l.offsetHeight, l.style.transition = k, U;
|
|
1293
1300
|
}
|
|
1294
1301
|
function Q() {
|
|
1295
|
-
const l =
|
|
1296
|
-
if (!l ||
|
|
1297
|
-
|
|
1298
|
-
const
|
|
1299
|
-
if (!f.length || !
|
|
1300
|
-
|
|
1302
|
+
const l = _.value;
|
|
1303
|
+
if (!l || M || R) return;
|
|
1304
|
+
M = !0;
|
|
1305
|
+
const u = l.closest(".common-search"), f = Array.from(l.querySelectorAll(".common-search__field")), k = l.querySelector(".common-search__actions");
|
|
1306
|
+
if (!f.length || !u) {
|
|
1307
|
+
T.value = !1, c.value = 0, i.value = 0, g.value = null, p.value = 0, M = !1;
|
|
1301
1308
|
return;
|
|
1302
1309
|
}
|
|
1303
|
-
c.value = f[0].offsetHeight,
|
|
1304
|
-
const
|
|
1305
|
-
let
|
|
1306
|
-
f.length >
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
-
const a =
|
|
1310
|
-
|
|
1310
|
+
c.value = f[0].offsetHeight, i.value = he(l);
|
|
1311
|
+
const U = 16, P = u.clientWidth, I = (k == null ? void 0 : k.offsetWidth) || 220, A = Ze(f, P, I, U);
|
|
1312
|
+
let q = 1;
|
|
1313
|
+
f.length > A && (q += Qe(f, A, P, U));
|
|
1314
|
+
const se = p.value;
|
|
1315
|
+
p.value = A;
|
|
1316
|
+
const a = q > 1, ue = T.value;
|
|
1317
|
+
T.value = a, a ? S.value ? g.value = null : g.value = c.value : (S.value = !1, g.value = null), M = !1, (ue !== a || se !== A) && Z(() => Q());
|
|
1311
1318
|
}
|
|
1312
1319
|
function at() {
|
|
1313
|
-
const l =
|
|
1314
|
-
if (!l ||
|
|
1315
|
-
|
|
1316
|
-
const
|
|
1317
|
-
if (
|
|
1318
|
-
|
|
1320
|
+
const l = _.value;
|
|
1321
|
+
if (!l || R) return;
|
|
1322
|
+
R = !0;
|
|
1323
|
+
const u = l.getBoundingClientRect().height || c.value;
|
|
1324
|
+
if (S.value)
|
|
1325
|
+
g.value = u || he(l), S.value = !1, requestAnimationFrame(() => {
|
|
1319
1326
|
requestAnimationFrame(() => {
|
|
1320
|
-
|
|
1327
|
+
g.value = c.value;
|
|
1321
1328
|
});
|
|
1322
1329
|
});
|
|
1323
1330
|
else {
|
|
1324
|
-
|
|
1331
|
+
g.value = u;
|
|
1325
1332
|
const f = he(l);
|
|
1326
|
-
|
|
1333
|
+
i.value = f, S.value = !0, requestAnimationFrame(() => {
|
|
1327
1334
|
requestAnimationFrame(() => {
|
|
1328
|
-
|
|
1335
|
+
g.value = Math.max(f, c.value || 0);
|
|
1329
1336
|
});
|
|
1330
1337
|
});
|
|
1331
1338
|
}
|
|
1332
1339
|
window.setTimeout(() => {
|
|
1333
|
-
|
|
1340
|
+
R = !1, S.value && (g.value = null), Q();
|
|
1334
1341
|
}, 380);
|
|
1335
1342
|
}
|
|
1336
1343
|
function rt() {
|
|
1337
1344
|
const l = {};
|
|
1338
|
-
return n.itemList.forEach((
|
|
1339
|
-
|
|
1345
|
+
return n.itemList.forEach((u) => {
|
|
1346
|
+
u.type === "daterange" || u.type === "dateRange" ? (l[u.start || u.startProp] = void 0, l[u.end || u.endProp] = void 0) : u.type === "number-range" || u.type === "numberRange" ? (l[u.start || `${u.prop}Min`] = void 0, l[u.end || `${u.prop}Max`] = void 0) : u.multiple ? l[u.prop] = [] : u.prop && (l[u.prop] = void 0);
|
|
1340
1347
|
}), l;
|
|
1341
1348
|
}
|
|
1342
1349
|
function Se() {
|
|
1343
1350
|
r("update:modelValue", { ...s.value });
|
|
1344
1351
|
}
|
|
1345
|
-
function
|
|
1352
|
+
function j() {
|
|
1346
1353
|
Se(), r("change", { ...s.value }), r("search", { ...s.value });
|
|
1347
1354
|
}
|
|
1348
1355
|
function Fe() {
|
|
1349
1356
|
s.value = rt(), Se(), r("reset", { ...s.value }), r("change", { ...s.value });
|
|
1350
1357
|
}
|
|
1351
|
-
return (l,
|
|
1352
|
-
const f =
|
|
1353
|
-
return
|
|
1354
|
-
class:
|
|
1355
|
-
"is-single-row": !
|
|
1356
|
-
"is-multi-row":
|
|
1357
|
-
"is-expanded":
|
|
1358
|
-
"is-collapsed":
|
|
1358
|
+
return (l, u) => {
|
|
1359
|
+
const f = $("el-input"), k = $("el-option"), U = $("el-select"), P = $("el-input-number"), I = $("el-icon"), A = $("el-date-picker"), q = $("el-tooltip"), se = $("el-button");
|
|
1360
|
+
return te((d(), y("div", {
|
|
1361
|
+
class: z(["common-search", {
|
|
1362
|
+
"is-single-row": !T.value,
|
|
1363
|
+
"is-multi-row": T.value,
|
|
1364
|
+
"is-expanded": T.value && S.value,
|
|
1365
|
+
"is-collapsed": T.value && !S.value
|
|
1359
1366
|
}])
|
|
1360
1367
|
}, [
|
|
1361
|
-
|
|
1362
|
-
|
|
1368
|
+
C("div", _n, [
|
|
1369
|
+
C("div", {
|
|
1363
1370
|
ref_key: "fieldsRef",
|
|
1364
|
-
ref:
|
|
1371
|
+
ref: _,
|
|
1365
1372
|
class: "common-search__fields",
|
|
1366
|
-
style: re(
|
|
1373
|
+
style: re(b.value)
|
|
1367
1374
|
}, [
|
|
1368
|
-
(
|
|
1375
|
+
(d(!0), y(Y, null, G(e.itemList, (a, ue) => (d(), y(Y, {
|
|
1369
1376
|
key: a.prop || a.start || ue
|
|
1370
1377
|
}, [
|
|
1371
|
-
|
|
1372
|
-
class:
|
|
1378
|
+
C("div", {
|
|
1379
|
+
class: z(["common-search__field", [`is-${a.type}`, a.className]]),
|
|
1373
1380
|
style: re(et(a))
|
|
1374
1381
|
}, [
|
|
1375
|
-
|
|
1376
|
-
content:
|
|
1377
|
-
disabled: !
|
|
1382
|
+
x(q, {
|
|
1383
|
+
content: N(a),
|
|
1384
|
+
disabled: !N(a),
|
|
1378
1385
|
placement: "top",
|
|
1379
1386
|
"show-after": 280
|
|
1380
1387
|
}, {
|
|
1381
|
-
default:
|
|
1382
|
-
|
|
1383
|
-
a.type === "input" || a.type === "text" ? (
|
|
1388
|
+
default: F(() => [
|
|
1389
|
+
C("div", wn, [
|
|
1390
|
+
a.type === "input" || a.type === "text" ? (d(), D(f, {
|
|
1384
1391
|
key: 0,
|
|
1385
1392
|
modelValue: s.value[a.prop],
|
|
1386
|
-
"onUpdate:modelValue": (
|
|
1393
|
+
"onUpdate:modelValue": (v) => s.value[a.prop] = v,
|
|
1387
1394
|
modelModifiers: { trim: !0 },
|
|
1388
1395
|
clearable: "",
|
|
1389
1396
|
placeholder: J(a, "请输入"),
|
|
1390
1397
|
maxlength: a.maxlength || 200,
|
|
1391
1398
|
disabled: a.disabled,
|
|
1392
1399
|
class: "common-search__control",
|
|
1393
|
-
onKeyup: Ne(
|
|
1394
|
-
onClear:
|
|
1395
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (
|
|
1400
|
+
onKeyup: Ne(j, ["enter"]),
|
|
1401
|
+
onClear: j
|
|
1402
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (d(), D(U, {
|
|
1396
1403
|
key: 1,
|
|
1397
1404
|
modelValue: s.value[a.prop],
|
|
1398
|
-
"onUpdate:modelValue": (
|
|
1405
|
+
"onUpdate:modelValue": (v) => s.value[a.prop] = v,
|
|
1399
1406
|
placeholder: J(a, "请选择"),
|
|
1400
1407
|
clearable: "",
|
|
1401
1408
|
filterable: a.filterable !== !1,
|
|
@@ -1404,21 +1411,21 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1404
1411
|
"collapse-tags-tooltip": a.multiple,
|
|
1405
1412
|
disabled: a.disabled,
|
|
1406
1413
|
class: "common-search__control",
|
|
1407
|
-
onChange:
|
|
1414
|
+
onChange: j
|
|
1408
1415
|
}, {
|
|
1409
|
-
default:
|
|
1410
|
-
(
|
|
1411
|
-
key: `${ie(
|
|
1412
|
-
label: Ue(
|
|
1413
|
-
value: ie(
|
|
1414
|
-
disabled: typeof
|
|
1416
|
+
default: F(() => [
|
|
1417
|
+
(d(!0), y(Y, null, G(a.options || [], (v, me) => (d(), D(k, {
|
|
1418
|
+
key: `${ie(v, a)}-${me}`,
|
|
1419
|
+
label: Ue(v, a),
|
|
1420
|
+
value: ie(v, a),
|
|
1421
|
+
disabled: typeof v == "object" && (v == null ? void 0 : v.disabled)
|
|
1415
1422
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1416
1423
|
]),
|
|
1417
1424
|
_: 2
|
|
1418
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : a.type === "remote-select" || a.type === "remoteSelect" ? (
|
|
1425
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : a.type === "remote-select" || a.type === "remoteSelect" ? (d(), D(U, {
|
|
1419
1426
|
key: 2,
|
|
1420
1427
|
modelValue: s.value[a.prop],
|
|
1421
|
-
"onUpdate:modelValue": (
|
|
1428
|
+
"onUpdate:modelValue": (v) => s.value[a.prop] = v,
|
|
1422
1429
|
placeholder: J(a, "请输入关键词搜索"),
|
|
1423
1430
|
clearable: "",
|
|
1424
1431
|
filterable: "",
|
|
@@ -1427,66 +1434,66 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1427
1434
|
"collapse-tags": a.multiple,
|
|
1428
1435
|
"collapse-tags-tooltip": a.multiple,
|
|
1429
1436
|
"reserve-keyword": !1,
|
|
1430
|
-
"remote-method": (
|
|
1437
|
+
"remote-method": (v) => st(a, v),
|
|
1431
1438
|
loading: !!m[a.prop],
|
|
1432
1439
|
disabled: a.disabled,
|
|
1433
1440
|
class: "common-search__control",
|
|
1434
|
-
onClear: (
|
|
1435
|
-
onChange:
|
|
1441
|
+
onClear: (v) => o[a.prop] = [],
|
|
1442
|
+
onChange: j
|
|
1436
1443
|
}, {
|
|
1437
|
-
default:
|
|
1438
|
-
(
|
|
1439
|
-
key: `${ie(
|
|
1440
|
-
label: Ue(
|
|
1441
|
-
value: ie(
|
|
1442
|
-
disabled: typeof
|
|
1444
|
+
default: F(() => [
|
|
1445
|
+
(d(!0), y(Y, null, G(o[a.prop] || a.options || [], (v, me) => (d(), D(k, {
|
|
1446
|
+
key: `${ie(v, a)}-${me}`,
|
|
1447
|
+
label: Ue(v, a),
|
|
1448
|
+
value: ie(v, a),
|
|
1449
|
+
disabled: typeof v == "object" && (v == null ? void 0 : v.disabled)
|
|
1443
1450
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1444
1451
|
]),
|
|
1445
1452
|
_: 2
|
|
1446
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (
|
|
1453
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (d(), y("div", {
|
|
1447
1454
|
key: 3,
|
|
1448
1455
|
class: "common-search__range common-search__range--number",
|
|
1449
|
-
onKeyup: Ne((
|
|
1456
|
+
onKeyup: Ne((v) => tt(a), ["enter"])
|
|
1450
1457
|
}, [
|
|
1451
|
-
|
|
1458
|
+
x(P, {
|
|
1452
1459
|
modelValue: s.value[a.start || `${a.prop}Min`],
|
|
1453
|
-
"onUpdate:modelValue": (
|
|
1460
|
+
"onUpdate:modelValue": (v) => s.value[a.start || `${a.prop}Min`] = v,
|
|
1454
1461
|
controls: !1,
|
|
1455
1462
|
min: a.min,
|
|
1456
1463
|
max: a.max,
|
|
1457
1464
|
placeholder: Ce(a, "min"),
|
|
1458
1465
|
disabled: a.disabled,
|
|
1459
1466
|
class: "common-search__range-input",
|
|
1460
|
-
onBlur: (
|
|
1467
|
+
onBlur: (v) => fe(a)
|
|
1461
1468
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1462
|
-
|
|
1463
|
-
|
|
1469
|
+
C("span", kn, B(a.separator || "至"), 1),
|
|
1470
|
+
x(P, {
|
|
1464
1471
|
modelValue: s.value[a.end || `${a.prop}Max`],
|
|
1465
|
-
"onUpdate:modelValue": (
|
|
1472
|
+
"onUpdate:modelValue": (v) => s.value[a.end || `${a.prop}Max`] = v,
|
|
1466
1473
|
controls: !1,
|
|
1467
1474
|
min: a.min,
|
|
1468
1475
|
max: a.max,
|
|
1469
1476
|
placeholder: Ce(a, "max"),
|
|
1470
1477
|
disabled: a.disabled,
|
|
1471
1478
|
class: "common-search__range-input",
|
|
1472
|
-
onBlur: (
|
|
1479
|
+
onBlur: (v) => fe(a)
|
|
1473
1480
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1474
|
-
a.clearable !== !1 && nt(a) ? (
|
|
1481
|
+
a.clearable !== !1 && nt(a) ? (d(), D(I, {
|
|
1475
1482
|
key: 0,
|
|
1476
1483
|
class: "common-search__range-clear",
|
|
1477
|
-
onMousedown:
|
|
1484
|
+
onMousedown: u[0] || (u[0] = de(() => {
|
|
1478
1485
|
}, ["prevent"])),
|
|
1479
|
-
onClick: (
|
|
1486
|
+
onClick: (v) => lt(a)
|
|
1480
1487
|
}, {
|
|
1481
|
-
default:
|
|
1482
|
-
|
|
1488
|
+
default: F(() => [
|
|
1489
|
+
x(le(Ve))
|
|
1483
1490
|
]),
|
|
1484
1491
|
_: 1
|
|
1485
|
-
}, 8, ["onClick"])) :
|
|
1486
|
-
], 40,
|
|
1492
|
+
}, 8, ["onClick"])) : V("", !0)
|
|
1493
|
+
], 40, Cn)) : a.type === "date" ? (d(), D(A, {
|
|
1487
1494
|
key: 4,
|
|
1488
1495
|
modelValue: s.value[a.prop],
|
|
1489
|
-
"onUpdate:modelValue": (
|
|
1496
|
+
"onUpdate:modelValue": (v) => s.value[a.prop] = v,
|
|
1490
1497
|
type: a.dateType || "date",
|
|
1491
1498
|
placeholder: J(a, "年/月/日"),
|
|
1492
1499
|
"value-format": a.valueFormat || "YYYY-MM-DD",
|
|
@@ -1494,13 +1501,13 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1494
1501
|
clearable: a.clearable !== !1,
|
|
1495
1502
|
disabled: a.disabled,
|
|
1496
1503
|
class: "common-search__control",
|
|
1497
|
-
onChange:
|
|
1498
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (
|
|
1499
|
-
|
|
1504
|
+
onChange: j
|
|
1505
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (d(), y("div", Un, [
|
|
1506
|
+
x(Ge, {
|
|
1500
1507
|
start: s.value[a.start || a.startProp],
|
|
1501
|
-
"onUpdate:start": (
|
|
1508
|
+
"onUpdate:start": (v) => s.value[a.start || a.startProp] = v,
|
|
1502
1509
|
end: s.value[a.end || a.endProp],
|
|
1503
|
-
"onUpdate:end": (
|
|
1510
|
+
"onUpdate:end": (v) => s.value[a.end || a.endProp] = v,
|
|
1504
1511
|
title: a.label || a.title || "",
|
|
1505
1512
|
type: a.dateType || a.pickerType || "daterange",
|
|
1506
1513
|
"value-format": a.valueFormat || "YYYY-MM-DD HH:mm:ss",
|
|
@@ -1508,9 +1515,9 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1508
1515
|
"show-shortcuts": a.showShortcuts !== !1,
|
|
1509
1516
|
shortcuts: a.shortcuts,
|
|
1510
1517
|
"can-clearable": a.clearable !== !1,
|
|
1511
|
-
onChange:
|
|
1518
|
+
onChange: j
|
|
1512
1519
|
}, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end", "title", "type", "value-format", "format", "show-shortcuts", "shortcuts", "can-clearable"])
|
|
1513
|
-
])) :
|
|
1520
|
+
])) : ee(l.$slots, a.slotName || a.prop, {
|
|
1514
1521
|
item: a,
|
|
1515
1522
|
form: s.value
|
|
1516
1523
|
}, void 0, !0, 6)
|
|
@@ -1519,61 +1526,61 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1519
1526
|
_: 2
|
|
1520
1527
|
}, 1032, ["content", "disabled"])
|
|
1521
1528
|
], 6),
|
|
1522
|
-
Je(ue) ? (
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
search:
|
|
1529
|
+
Je(ue) ? (d(), y("div", xn, [
|
|
1530
|
+
C("div", Sn, [
|
|
1531
|
+
ee(l.$slots, "actions", {
|
|
1532
|
+
search: j,
|
|
1526
1533
|
reset: Fe,
|
|
1527
1534
|
form: s.value
|
|
1528
1535
|
}, () => [
|
|
1529
|
-
|
|
1536
|
+
x(se, {
|
|
1530
1537
|
class: "common-search__reset",
|
|
1531
1538
|
onClick: Fe
|
|
1532
1539
|
}, {
|
|
1533
|
-
default:
|
|
1534
|
-
|
|
1540
|
+
default: F(() => [...u[1] || (u[1] = [
|
|
1541
|
+
K("重置", -1)
|
|
1535
1542
|
])]),
|
|
1536
1543
|
_: 1
|
|
1537
1544
|
}),
|
|
1538
|
-
|
|
1545
|
+
x(se, {
|
|
1539
1546
|
type: "primary",
|
|
1540
1547
|
class: "common-search__submit",
|
|
1541
|
-
onClick:
|
|
1548
|
+
onClick: j
|
|
1542
1549
|
}, {
|
|
1543
|
-
default:
|
|
1544
|
-
|
|
1550
|
+
default: F(() => [...u[2] || (u[2] = [
|
|
1551
|
+
K(" 搜索 ", -1)
|
|
1545
1552
|
])]),
|
|
1546
1553
|
_: 1
|
|
1547
1554
|
})
|
|
1548
1555
|
], !0),
|
|
1549
|
-
|
|
1556
|
+
T.value ? (d(), D(se, {
|
|
1550
1557
|
key: 0,
|
|
1551
1558
|
link: "",
|
|
1552
1559
|
type: "primary",
|
|
1553
1560
|
onClick: at
|
|
1554
1561
|
}, {
|
|
1555
|
-
default:
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
default:
|
|
1559
|
-
|
|
1562
|
+
default: F(() => [
|
|
1563
|
+
K(B(S.value ? "收起" : "展开") + " ", 1),
|
|
1564
|
+
x(I, { class: "el-icon--right" }, {
|
|
1565
|
+
default: F(() => [
|
|
1566
|
+
S.value ? (d(), D(le(ft), { key: 0 })) : (d(), D(le(ht), { key: 1 }))
|
|
1560
1567
|
]),
|
|
1561
1568
|
_: 1
|
|
1562
1569
|
})
|
|
1563
1570
|
]),
|
|
1564
1571
|
_: 1
|
|
1565
|
-
})) :
|
|
1572
|
+
})) : V("", !0)
|
|
1566
1573
|
])
|
|
1567
|
-
])) :
|
|
1574
|
+
])) : V("", !0)
|
|
1568
1575
|
], 64))), 128))
|
|
1569
1576
|
], 4)
|
|
1570
1577
|
])
|
|
1571
1578
|
], 2)), [
|
|
1572
|
-
[
|
|
1579
|
+
[ne, e.itemList.length]
|
|
1573
1580
|
]);
|
|
1574
1581
|
};
|
|
1575
1582
|
}
|
|
1576
|
-
}),
|
|
1583
|
+
}), $n = /* @__PURE__ */ X(Fn, [["__scopeId", "data-v-006c1ace"]]), Ln = {
|
|
1577
1584
|
name: "MgOverflowHid",
|
|
1578
1585
|
props: {
|
|
1579
1586
|
label: String,
|
|
@@ -1596,65 +1603,65 @@ const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609
|
|
|
1596
1603
|
return n && n.length > t && (n = n.slice(0, t) + "..."), n;
|
|
1597
1604
|
}
|
|
1598
1605
|
}
|
|
1599
|
-
},
|
|
1600
|
-
function
|
|
1601
|
-
const m =
|
|
1602
|
-
return
|
|
1603
|
-
n.value && n.value.length > n.maxLength ? (
|
|
1606
|
+
}, Nn = { class: "tableOverflowHid" }, Mn = ["innerHTML"], Pn = { class: "name-wrapper" }, Rn = ["innerHTML"], Tn = { key: 1 }, Bn = ["innerHTML"];
|
|
1607
|
+
function Dn(e, t, n, r, s, o) {
|
|
1608
|
+
const m = $("el-popover");
|
|
1609
|
+
return d(), y("div", Nn, [
|
|
1610
|
+
n.value && n.value.length > n.maxLength ? (d(), D(m, {
|
|
1604
1611
|
key: 0,
|
|
1605
1612
|
trigger: "hover",
|
|
1606
1613
|
placement: "bottom",
|
|
1607
1614
|
width: "400"
|
|
1608
1615
|
}, {
|
|
1609
|
-
reference:
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
class:
|
|
1613
|
-
},
|
|
1614
|
-
[
|
|
1616
|
+
reference: F(() => [
|
|
1617
|
+
C("div", Pn, [
|
|
1618
|
+
te(C("span", {
|
|
1619
|
+
class: z(n.labelClassName)
|
|
1620
|
+
}, B(n.label) + ":", 3), [
|
|
1621
|
+
[ne, n.label]
|
|
1615
1622
|
]),
|
|
1616
|
-
|
|
1617
|
-
class:
|
|
1623
|
+
C("span", {
|
|
1624
|
+
class: z(n.valueClassName),
|
|
1618
1625
|
innerHTML: o.cutString(n.value, n.maxLength)
|
|
1619
|
-
}, null, 10,
|
|
1626
|
+
}, null, 10, Rn)
|
|
1620
1627
|
])
|
|
1621
1628
|
]),
|
|
1622
|
-
default:
|
|
1623
|
-
|
|
1624
|
-
class:
|
|
1625
|
-
},
|
|
1626
|
-
[
|
|
1629
|
+
default: F(() => [
|
|
1630
|
+
te(C("span", {
|
|
1631
|
+
class: z(n.labelClassName)
|
|
1632
|
+
}, B(n.label) + ":", 3), [
|
|
1633
|
+
[ne, n.label]
|
|
1627
1634
|
]),
|
|
1628
|
-
|
|
1635
|
+
C("span", { innerHTML: n.value }, null, 8, Mn)
|
|
1629
1636
|
]),
|
|
1630
1637
|
_: 1
|
|
1631
|
-
})) : (
|
|
1632
|
-
|
|
1633
|
-
class:
|
|
1634
|
-
},
|
|
1635
|
-
[
|
|
1638
|
+
})) : (d(), y("div", Tn, [
|
|
1639
|
+
te(C("span", {
|
|
1640
|
+
class: z(n.labelClassName)
|
|
1641
|
+
}, B(n.label) + ":", 3), [
|
|
1642
|
+
[ne, n.label]
|
|
1636
1643
|
]),
|
|
1637
|
-
|
|
1638
|
-
class:
|
|
1644
|
+
C("span", {
|
|
1645
|
+
class: z([n.valueClassName, "value"])
|
|
1639
1646
|
}, [
|
|
1640
|
-
|
|
1647
|
+
C("span", { innerHTML: n.value }, null, 8, Bn)
|
|
1641
1648
|
], 2)
|
|
1642
1649
|
]))
|
|
1643
1650
|
]);
|
|
1644
1651
|
}
|
|
1645
|
-
const Xe = /* @__PURE__ */
|
|
1652
|
+
const Xe = /* @__PURE__ */ X(Ln, [["render", Dn], ["__scopeId", "data-v-ef86ea54"]]), Vn = { class: "common-table__main" }, On = { key: 0 }, In = { key: 1 }, An = {
|
|
1646
1653
|
key: 2,
|
|
1647
1654
|
class: "price-text"
|
|
1648
|
-
},
|
|
1655
|
+
}, zn = {
|
|
1649
1656
|
key: 3,
|
|
1650
1657
|
class: "rate-text"
|
|
1651
1658
|
}, Hn = {
|
|
1652
1659
|
key: 4,
|
|
1653
1660
|
class: "bold-text"
|
|
1654
|
-
},
|
|
1661
|
+
}, En = {
|
|
1655
1662
|
key: 0,
|
|
1656
1663
|
class: "common-table__pagination"
|
|
1657
|
-
},
|
|
1664
|
+
}, jn = { class: "common-table__pagination-left" }, Kn = /* @__PURE__ */ Object.assign({ name: "MgDataTable" }, {
|
|
1658
1665
|
__name: "DataTable",
|
|
1659
1666
|
props: {
|
|
1660
1667
|
/** 列配置:el-table-column 属性 + slotName */
|
|
@@ -1727,129 +1734,141 @@ const Xe = /* @__PURE__ */ G($n, [["render", Bn], ["__scopeId", "data-v-ef86ea54
|
|
|
1727
1734
|
},
|
|
1728
1735
|
emits: ["pageChange", "cellClick", "edit", "delete", "selectionChange"],
|
|
1729
1736
|
setup(e, { emit: t }) {
|
|
1730
|
-
const n = e, r = t, s = {
|
|
1737
|
+
const n = e, r = t, s = O(null), o = {
|
|
1731
1738
|
background: "var(--brand-secondary)",
|
|
1732
1739
|
color: "var(--brand-text-regular)",
|
|
1733
1740
|
fontWeight: 600,
|
|
1734
1741
|
fontSize: "13px"
|
|
1735
|
-
},
|
|
1736
|
-
headerCellStyle:
|
|
1742
|
+
}, m = ye(() => ({
|
|
1743
|
+
headerCellStyle: o,
|
|
1737
1744
|
...n.tableBind
|
|
1738
1745
|
}));
|
|
1739
|
-
function
|
|
1740
|
-
const { slotName:
|
|
1746
|
+
function h(i) {
|
|
1747
|
+
const { slotName: g, headerSlotName: w, maxLength: M, ...R } = i || {};
|
|
1741
1748
|
return {
|
|
1742
|
-
...
|
|
1749
|
+
...R
|
|
1743
1750
|
};
|
|
1744
1751
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return n.pagination ? (n.pagination.page - 1) * n.pagination.limit +
|
|
1752
|
+
function L(i) {
|
|
1753
|
+
return n.pagination ? (n.pagination.page - 1) * n.pagination.limit + i + 1 : i + 1;
|
|
1747
1754
|
}
|
|
1748
|
-
function
|
|
1749
|
-
var
|
|
1750
|
-
r("pageChange", { page: (
|
|
1755
|
+
function _(i) {
|
|
1756
|
+
var g;
|
|
1757
|
+
r("pageChange", { page: (g = n.pagination) == null ? void 0 : g.page, limit: i });
|
|
1751
1758
|
}
|
|
1752
|
-
function
|
|
1753
|
-
var
|
|
1754
|
-
r("pageChange", { page:
|
|
1759
|
+
function S(i) {
|
|
1760
|
+
var g;
|
|
1761
|
+
r("pageChange", { page: i, limit: (g = n.pagination) == null ? void 0 : g.limit });
|
|
1755
1762
|
}
|
|
1756
|
-
function
|
|
1757
|
-
r("cellClick",
|
|
1763
|
+
function T(i, g, w, M) {
|
|
1764
|
+
r("cellClick", i, g, w, M), n.canCellClick && (g == null ? void 0 : g.label) !== "操作" && window.getSelection().toString();
|
|
1758
1765
|
}
|
|
1759
|
-
function
|
|
1760
|
-
|
|
1766
|
+
function p(i, g, w) {
|
|
1767
|
+
var R, b, H;
|
|
1768
|
+
if (!n.showSelection || (g == null ? void 0 : g.type) === "selection") return;
|
|
1769
|
+
const M = w == null ? void 0 : w.target;
|
|
1770
|
+
(R = M == null ? void 0 : M.closest) != null && R.call(M, "a, button, .el-button, .el-checkbox, .link-btn, input, textarea") || typeof n.selectable == "function" && !n.selectable(i, 0) || (H = (b = s.value) == null ? void 0 : b.toggleRowSelection) == null || H.call(b, i);
|
|
1761
1771
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1772
|
+
function c(i) {
|
|
1773
|
+
r("selectionChange", i);
|
|
1774
|
+
}
|
|
1775
|
+
return (i, g) => {
|
|
1776
|
+
const w = $("el-table-column"), M = $("el-table"), R = $("el-pagination");
|
|
1777
|
+
return d(), y("div", {
|
|
1778
|
+
class: z(["common-table", { "is-fill-height": e.fillHeight }])
|
|
1766
1779
|
}, [
|
|
1767
|
-
|
|
1768
|
-
|
|
1780
|
+
C("div", Vn, [
|
|
1781
|
+
x(M, Me({
|
|
1782
|
+
ref_key: "tableRef",
|
|
1783
|
+
ref: s,
|
|
1769
1784
|
data: e.dataList,
|
|
1770
1785
|
height: e.fillHeight ? "100%" : void 0,
|
|
1771
|
-
class: { "common-pointer-table": e.canCellClick }
|
|
1772
|
-
},
|
|
1773
|
-
onCellClick:
|
|
1774
|
-
|
|
1786
|
+
class: { "common-pointer-table": e.canCellClick || e.showSelection }
|
|
1787
|
+
}, m.value, {
|
|
1788
|
+
onCellClick: T,
|
|
1789
|
+
onRowClick: p,
|
|
1790
|
+
onSelectionChange: c
|
|
1775
1791
|
}), {
|
|
1776
|
-
default:
|
|
1777
|
-
e.showSelection ? (
|
|
1792
|
+
default: F(() => [
|
|
1793
|
+
e.showSelection ? (d(), D(w, {
|
|
1778
1794
|
key: 0,
|
|
1779
1795
|
type: "selection",
|
|
1780
1796
|
width: e.selectionWidth,
|
|
1781
1797
|
align: "center",
|
|
1782
1798
|
selectable: e.selectable,
|
|
1783
1799
|
fixed: "left"
|
|
1784
|
-
}, null, 8, ["width", "selectable"])) :
|
|
1785
|
-
e.showIndex ? (
|
|
1800
|
+
}, null, 8, ["width", "selectable"])) : V("", !0),
|
|
1801
|
+
e.showIndex ? (d(), D(w, {
|
|
1786
1802
|
key: 1,
|
|
1787
1803
|
type: "index",
|
|
1788
1804
|
label: e.indexLabel,
|
|
1789
1805
|
width: e.indexWidth,
|
|
1790
|
-
index:
|
|
1806
|
+
index: L,
|
|
1791
1807
|
align: "center"
|
|
1792
|
-
}, null, 8, ["label", "width"])) :
|
|
1793
|
-
(
|
|
1794
|
-
key:
|
|
1795
|
-
}, { ref_for: !0 },
|
|
1796
|
-
|
|
1808
|
+
}, null, 8, ["label", "width"])) : V("", !0),
|
|
1809
|
+
(d(!0), y(Y, null, G(e.propList, (b, H) => (d(), D(w, Me({
|
|
1810
|
+
key: b.prop || b.slotName || H
|
|
1811
|
+
}, { ref_for: !0 }, h(b)), St({ _: 2 }, [
|
|
1812
|
+
b.headerSlotName ? {
|
|
1797
1813
|
name: "header",
|
|
1798
|
-
fn:
|
|
1799
|
-
|
|
1814
|
+
fn: F(() => [
|
|
1815
|
+
ee(i.$slots, b.headerSlotName, { column: b }, void 0, !0)
|
|
1800
1816
|
]),
|
|
1801
1817
|
key: "0"
|
|
1802
1818
|
} : void 0,
|
|
1803
|
-
|
|
1819
|
+
b.slotName ? {
|
|
1804
1820
|
name: "default",
|
|
1805
|
-
fn:
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
value: String(
|
|
1809
|
-
"max-length":
|
|
1821
|
+
fn: F((N) => [
|
|
1822
|
+
b.slotName === "overtext" ? (d(), y("div", On, [
|
|
1823
|
+
x(Xe, {
|
|
1824
|
+
value: String(N.row[b.prop] ?? ""),
|
|
1825
|
+
"max-length": b.maxLength || 18
|
|
1810
1826
|
}, null, 8, ["value", "max-length"])
|
|
1811
|
-
])) :
|
|
1812
|
-
|
|
1813
|
-
class:
|
|
1814
|
-
"whether-yes":
|
|
1815
|
-
"whether-no":
|
|
1827
|
+
])) : b.slotName === "whether" ? (d(), y("div", In, [
|
|
1828
|
+
C("span", {
|
|
1829
|
+
class: z({
|
|
1830
|
+
"whether-yes": N.row[b.prop] == 1,
|
|
1831
|
+
"whether-no": N.row[b.prop] == 0
|
|
1816
1832
|
})
|
|
1817
|
-
},
|
|
1818
|
-
])) :
|
|
1819
|
-
row:
|
|
1820
|
-
index:
|
|
1821
|
-
column:
|
|
1833
|
+
}, B(N.row[b.prop] == 0 ? "否" : N.row[b.prop] == 1 ? "是" : ""), 3)
|
|
1834
|
+
])) : b.slotName === "price" ? (d(), y("div", An, B(le(Ie)(N.row[b.prop], 2)), 1)) : b.slotName === "rate" ? (d(), y("div", zn, B(le(vt)(N.row[b.prop], 2, "toPercentText")), 1)) : b.slotName === "boldtext" ? (d(), y("div", Hn, B(N.row[b.prop]), 1)) : ee(i.$slots, b.slotName, {
|
|
1835
|
+
row: N.row,
|
|
1836
|
+
index: N.$index,
|
|
1837
|
+
column: b
|
|
1822
1838
|
}, () => [
|
|
1823
|
-
|
|
1839
|
+
K(B(le(bt)(N.row[b.prop])), 1)
|
|
1824
1840
|
], !0, 5)
|
|
1825
1841
|
]),
|
|
1826
1842
|
key: "1"
|
|
1827
1843
|
} : void 0
|
|
1828
1844
|
]), 1040))), 128)),
|
|
1829
|
-
|
|
1845
|
+
ee(i.$slots, "default", {}, void 0, !0)
|
|
1830
1846
|
]),
|
|
1831
1847
|
_: 3
|
|
1832
1848
|
}, 16, ["data", "height", "class"])
|
|
1833
1849
|
]),
|
|
1834
|
-
e.pagination ? (
|
|
1835
|
-
|
|
1850
|
+
e.pagination ? (d(), y("div", En, [
|
|
1851
|
+
C("div", jn, [
|
|
1852
|
+
ee(i.$slots, "pagination-left", {}, void 0, !0)
|
|
1853
|
+
]),
|
|
1854
|
+
x(R, {
|
|
1836
1855
|
background: "",
|
|
1837
1856
|
"current-page": e.pagination.page,
|
|
1838
1857
|
"page-size": e.pagination.limit,
|
|
1839
1858
|
"page-sizes": e.pageSizes,
|
|
1840
1859
|
total: e.pagination.total,
|
|
1841
1860
|
layout: e.paginationLayout,
|
|
1842
|
-
onSizeChange:
|
|
1843
|
-
onCurrentChange:
|
|
1861
|
+
onSizeChange: _,
|
|
1862
|
+
onCurrentChange: S
|
|
1844
1863
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"])
|
|
1845
|
-
])) :
|
|
1864
|
+
])) : V("", !0)
|
|
1846
1865
|
], 2);
|
|
1847
1866
|
};
|
|
1848
1867
|
}
|
|
1849
|
-
}),
|
|
1868
|
+
}), Wn = /* @__PURE__ */ X(Kn, [["__scopeId", "data-v-780178e7"]]), Yn = ["aria-checked", "disabled", "onClick"], qn = { class: "segmented__label" }, Gn = {
|
|
1850
1869
|
key: 0,
|
|
1851
1870
|
class: "segmented__badge"
|
|
1852
|
-
},
|
|
1871
|
+
}, Xn = {
|
|
1853
1872
|
__name: "SegmentedControl",
|
|
1854
1873
|
props: {
|
|
1855
1874
|
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
@@ -1858,78 +1877,78 @@ const Xe = /* @__PURE__ */ G($n, [["render", Bn], ["__scopeId", "data-v-ef86ea54
|
|
|
1858
1877
|
},
|
|
1859
1878
|
emits: ["update:modelValue", "change"],
|
|
1860
1879
|
setup(e, { emit: t }) {
|
|
1861
|
-
const n = e, r = t, s =
|
|
1880
|
+
const n = e, r = t, s = O(null), o = O([]), m = O(!1), h = O({
|
|
1862
1881
|
width: "0px",
|
|
1863
1882
|
transform: "translateX(0px)"
|
|
1864
1883
|
});
|
|
1865
|
-
let
|
|
1866
|
-
function
|
|
1867
|
-
return (
|
|
1884
|
+
let L = null;
|
|
1885
|
+
function _(i) {
|
|
1886
|
+
return (i == null ? void 0 : i.count) != null || (i == null ? void 0 : i.badge) != null;
|
|
1868
1887
|
}
|
|
1869
|
-
function
|
|
1870
|
-
return
|
|
1888
|
+
function S(i) {
|
|
1889
|
+
return i.count != null ? i.count : i.badge;
|
|
1871
1890
|
}
|
|
1872
|
-
function
|
|
1873
|
-
|
|
1891
|
+
function T(i, g) {
|
|
1892
|
+
i && (o.value[g] = i);
|
|
1874
1893
|
}
|
|
1875
|
-
function
|
|
1876
|
-
const
|
|
1877
|
-
if (!
|
|
1878
|
-
const
|
|
1879
|
-
if (!
|
|
1894
|
+
function p() {
|
|
1895
|
+
const i = s.value;
|
|
1896
|
+
if (!i) return;
|
|
1897
|
+
const g = n.options.findIndex((b) => b.value === n.modelValue), w = o.value[g];
|
|
1898
|
+
if (!w) {
|
|
1880
1899
|
h.value = { width: "0px", transform: "translateX(0px)" };
|
|
1881
1900
|
return;
|
|
1882
1901
|
}
|
|
1883
|
-
const
|
|
1902
|
+
const M = i.getBoundingClientRect(), R = w.getBoundingClientRect();
|
|
1884
1903
|
h.value = {
|
|
1885
|
-
width: `${
|
|
1886
|
-
transform: `translateX(${
|
|
1904
|
+
width: `${R.width}px`,
|
|
1905
|
+
transform: `translateX(${R.left - M.left}px)`
|
|
1887
1906
|
}, m.value = !0;
|
|
1888
1907
|
}
|
|
1889
|
-
function c(
|
|
1890
|
-
|
|
1908
|
+
function c(i) {
|
|
1909
|
+
i.disabled || (r("update:modelValue", i.value), r("change", i.value));
|
|
1891
1910
|
}
|
|
1892
|
-
return
|
|
1911
|
+
return ae(
|
|
1893
1912
|
() => [n.modelValue, n.options],
|
|
1894
1913
|
async () => {
|
|
1895
|
-
await Z(),
|
|
1914
|
+
await Z(), p();
|
|
1896
1915
|
},
|
|
1897
1916
|
{ deep: !0 }
|
|
1898
1917
|
), ve(async () => {
|
|
1899
|
-
await Z(),
|
|
1900
|
-
}),
|
|
1901
|
-
|
|
1902
|
-
}), (
|
|
1918
|
+
await Z(), p(), typeof ResizeObserver < "u" && s.value && (L = new ResizeObserver(() => p()), L.observe(s.value));
|
|
1919
|
+
}), ze(() => {
|
|
1920
|
+
L == null || L.disconnect(), L = null;
|
|
1921
|
+
}), (i, g) => (d(), y("div", {
|
|
1903
1922
|
ref_key: "rootRef",
|
|
1904
1923
|
ref: s,
|
|
1905
1924
|
class: "segmented",
|
|
1906
1925
|
role: "radiogroup"
|
|
1907
1926
|
}, [
|
|
1908
|
-
|
|
1909
|
-
class:
|
|
1927
|
+
C("div", {
|
|
1928
|
+
class: z(["segmented__thumb", { "is-ready": m.value }]),
|
|
1910
1929
|
style: re(h.value)
|
|
1911
1930
|
}, null, 6),
|
|
1912
|
-
(
|
|
1913
|
-
key: String(
|
|
1931
|
+
(d(!0), y(Y, null, G(e.options, (w, M) => (d(), y("button", {
|
|
1932
|
+
key: String(w.value),
|
|
1914
1933
|
ref_for: !0,
|
|
1915
|
-
ref: (
|
|
1934
|
+
ref: (R) => T(R, M),
|
|
1916
1935
|
type: "button",
|
|
1917
|
-
class:
|
|
1936
|
+
class: z(["segmented__item", { "is-active": e.modelValue === w.value }]),
|
|
1918
1937
|
role: "radio",
|
|
1919
|
-
"aria-checked": e.modelValue ===
|
|
1920
|
-
disabled:
|
|
1921
|
-
onClick: (
|
|
1938
|
+
"aria-checked": e.modelValue === w.value,
|
|
1939
|
+
disabled: w.disabled,
|
|
1940
|
+
onClick: (R) => c(w)
|
|
1922
1941
|
}, [
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
], 10,
|
|
1942
|
+
C("span", qn, B(w.label), 1),
|
|
1943
|
+
_(w) ? (d(), y("span", Gn, B(S(w)), 1)) : V("", !0)
|
|
1944
|
+
], 10, Yn))), 128))
|
|
1926
1945
|
], 512));
|
|
1927
1946
|
}
|
|
1928
|
-
},
|
|
1929
|
-
function
|
|
1947
|
+
}, Jn = /* @__PURE__ */ X(Xn, [["__scopeId", "data-v-b7b0abe9"]]);
|
|
1948
|
+
function Qn(e) {
|
|
1930
1949
|
return e == null || e === "" ? [] : Array.isArray(e) ? e.map((t) => String(t).trim()).filter(Boolean) : String(e).split(",").map((t) => t.trim()).filter(Boolean);
|
|
1931
1950
|
}
|
|
1932
|
-
function
|
|
1951
|
+
function Zn(e) {
|
|
1933
1952
|
if (!e.parentNode) {
|
|
1934
1953
|
e.style.display = "none";
|
|
1935
1954
|
return;
|
|
@@ -1941,12 +1960,12 @@ function Jn(e) {
|
|
|
1941
1960
|
e.parentNode.removeChild(e);
|
|
1942
1961
|
}
|
|
1943
1962
|
function ge(e, t, n, r = !1) {
|
|
1944
|
-
const s =
|
|
1963
|
+
const s = Qn(t.value);
|
|
1945
1964
|
if (!s.length) return;
|
|
1946
1965
|
let o = Ae(s, n);
|
|
1947
|
-
r && (o = !o), o ||
|
|
1966
|
+
r && (o = !o), o || Zn(e);
|
|
1948
1967
|
}
|
|
1949
|
-
function
|
|
1968
|
+
function el(e) {
|
|
1950
1969
|
e.directive("hasPermission", {
|
|
1951
1970
|
mounted(t, n) {
|
|
1952
1971
|
ge(t, n, "and");
|
|
@@ -1961,59 +1980,59 @@ function Qn(e) {
|
|
|
1961
1980
|
}
|
|
1962
1981
|
});
|
|
1963
1982
|
}
|
|
1964
|
-
const
|
|
1983
|
+
const tl = {
|
|
1965
1984
|
MgImageUpload: Zt,
|
|
1966
|
-
MgFileUpload:
|
|
1985
|
+
MgFileUpload: vn,
|
|
1967
1986
|
MgFilePreview: _t,
|
|
1968
|
-
MgSearchForm:
|
|
1969
|
-
MgDataTable:
|
|
1987
|
+
MgSearchForm: $n,
|
|
1988
|
+
MgDataTable: Wn,
|
|
1970
1989
|
MgDateRangePicker: Ge,
|
|
1971
|
-
MgSegmentedControl:
|
|
1990
|
+
MgSegmentedControl: Jn,
|
|
1972
1991
|
MgOverflowHid: Xe
|
|
1973
|
-
},
|
|
1974
|
-
Object.entries(
|
|
1992
|
+
}, nl = (e, t = {}) => {
|
|
1993
|
+
Object.entries(tl).forEach(([s, o]) => {
|
|
1975
1994
|
e.component(o.name || s, o);
|
|
1976
|
-
}), t.ossUrl && $t(t.ossUrl), typeof t.getPermissions == "function" && wt(t.getPermissions),
|
|
1995
|
+
}), t.ossUrl && $t(t.ossUrl), typeof t.getPermissions == "function" && wt(t.getPermissions), el(e);
|
|
1977
1996
|
const n = Ct(t), r = kt(n);
|
|
1978
1997
|
Ut(n), xt(r), e.config.globalProperties.$request = n, e.config.globalProperties.$api = r, e.config.globalProperties.$hasPermission = Ae;
|
|
1979
|
-
},
|
|
1980
|
-
install:
|
|
1998
|
+
}, il = {
|
|
1999
|
+
install: nl,
|
|
1981
2000
|
version: "1.2.2"
|
|
1982
2001
|
};
|
|
1983
2002
|
export {
|
|
1984
|
-
|
|
2003
|
+
Wn as DataTable,
|
|
1985
2004
|
Ge as DateRangePicker,
|
|
1986
|
-
|
|
2005
|
+
dl as FILE_PREVIEW_ROUTE_PATH,
|
|
1987
2006
|
_t as FilePreview,
|
|
1988
|
-
|
|
2007
|
+
vn as FileUpload,
|
|
1989
2008
|
Zt as ImageUpload,
|
|
1990
|
-
|
|
1991
|
-
|
|
2009
|
+
$n as SearchForm,
|
|
2010
|
+
Jn as SegmentedControl,
|
|
1992
2011
|
Xe as TableOverflowHid,
|
|
1993
2012
|
Ye as aliOssMixin,
|
|
1994
|
-
|
|
1995
|
-
|
|
2013
|
+
pl as buildFilePreviewHref,
|
|
2014
|
+
fl as checkPermission,
|
|
1996
2015
|
kt as createApi,
|
|
1997
2016
|
_e as createOssClient,
|
|
1998
2017
|
Ct as createRequest,
|
|
1999
|
-
|
|
2000
|
-
|
|
2018
|
+
hl as createService,
|
|
2019
|
+
il as default,
|
|
2001
2020
|
gt as getApi,
|
|
2002
2021
|
Ke as getOssSts,
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2022
|
+
ml as getPermissionGetter,
|
|
2023
|
+
gl as getRequest,
|
|
2024
|
+
yl as getSystemId,
|
|
2025
|
+
vl as getUserId,
|
|
2007
2026
|
Ae as hasPermission,
|
|
2008
|
-
|
|
2009
|
-
|
|
2027
|
+
nl as install,
|
|
2028
|
+
el as installPermissionDirectives,
|
|
2010
2029
|
yt as openFilePreview,
|
|
2011
2030
|
xt as setApi,
|
|
2012
2031
|
$t as setDefaultOssUrl,
|
|
2013
2032
|
wt as setPermissionGetter,
|
|
2014
2033
|
Ut as setRequest,
|
|
2015
|
-
|
|
2016
|
-
|
|
2034
|
+
bl as setSystemId,
|
|
2035
|
+
_l as setUserId,
|
|
2017
2036
|
We as uploadToOss,
|
|
2018
|
-
|
|
2037
|
+
wl as utils
|
|
2019
2038
|
};
|