mgacn-commonsdk 1.2.1 → 1.2.3
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/FilePreview-DVaCq1Fr.js +839 -0
- package/dist/mgacn-admin.js +1110 -1038
- package/dist/mgacn-commonsdk.js +320 -312
- package/dist/style.css +2 -2
- package/package.json +25 -2
- package/dist/_plugin-vue_export-helper-C5bbN0Gq.js +0 -569
package/dist/mgacn-commonsdk.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Plus as ot, Delete as it, CircleCloseFilled as ut, Document as ct, Close as dt, CircleClose as
|
|
2
|
-
import { ElMessage as
|
|
1
|
+
import { Plus as ot, Delete as it, CircleCloseFilled as ut, Document as ct, Close as dt, CircleClose as De, CircleCheck as pt, ArrowUp as ft, ArrowDown as ht } from "@element-plus/icons-vue";
|
|
2
|
+
import { ElMessage as K, 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 G,
|
|
6
|
-
import { c as
|
|
7
|
-
import { resolveComponent as F, openBlock as u, createElementBlock as b, createElementVNode as w, toDisplayString as T, createCommentVNode as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
globalThis[
|
|
5
|
+
import { g as gt, _ as G, 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 ul, j as cl, c as dl, v as pl, w as fl, b as hl, x as ml, y as gl, a as yl, s as vl, z as bl } from "./FilePreview-DVaCq1Fr.js";
|
|
7
|
+
import { resolveComponent as F, openBlock as u, createElementBlock as b, createElementVNode as w, toDisplayString as T, createCommentVNode as V, createTextVNode as j, Fragment as W, renderList as q, normalizeStyle as re, normalizeClass as H, createVNode as U, withCtx as S, withModifiers as de, withDirectives as ee, vShow as te, createBlock as P, computed as ye, ref as A, watch as se, onMounted as ve, reactive as Le, nextTick as Z, onBeforeUnmount as He, withKeys as Ne, unref as ne, renderSlot as ae, mergeProps as Me, createSlots as St } from "vue";
|
|
8
|
+
const Ft = $e.default ?? $e, ze = "__MGACN_COMMONSDK_OSS_URL__";
|
|
9
|
+
function $t(e = "") {
|
|
10
|
+
globalThis[ze] = String(e || "").replace(/\/$/, "");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return globalThis[
|
|
12
|
+
function Ee() {
|
|
13
|
+
return globalThis[ze] || "";
|
|
14
14
|
}
|
|
15
15
|
function Pe(e) {
|
|
16
16
|
return String(e).padStart(2, "0");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Lt() {
|
|
19
19
|
const e = /* @__PURE__ */ new Date();
|
|
20
20
|
return `${e.getFullYear()}${Pe(e.getMonth() + 1)}${Pe(e.getDate())}`;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function je(e = 10) {
|
|
23
23
|
const t = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
24
24
|
let n = "";
|
|
25
25
|
for (let r = 0; r < e; r++)
|
|
@@ -27,16 +27,16 @@ function Ke(e = 10) {
|
|
|
27
27
|
return n;
|
|
28
28
|
}
|
|
29
29
|
function be(e = "portal_cms") {
|
|
30
|
-
return `${e}/${
|
|
30
|
+
return `${e}/${Lt()}/`;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Ke(e) {
|
|
33
33
|
return gt().getOssSts(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
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(/\/$/, ""), $ = s && o ? `https://${s}.${o}` :
|
|
39
|
+
const m = e.region || (o.startsWith("oss-") ? o.replace(/\.aliyuncs\.com.*$/i, "") : ""), h = String(e.ossUrl || e.domain || e.cdnDomain || "").replace(/\/$/, ""), $ = s && o ? `https://${s}.${o}` : Ee();
|
|
40
40
|
return {
|
|
41
41
|
accessKeyId: t,
|
|
42
42
|
accessKeySecret: n,
|
|
@@ -48,7 +48,7 @@ function $t(e = {}) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
async function _e(e = {}) {
|
|
51
|
-
const { dir: t, foldName: n, getOss: r, ossinfo: s } = e, o = t || be(n || "portal_cms"), m = s || (typeof r == "function" ? await r(o) : await
|
|
51
|
+
const { dir: t, foldName: n, getOss: r, ossinfo: s } = e, o = t || be(n || "portal_cms"), m = s || (typeof r == "function" ? await r(o) : await Ke(o)), h = Nt(m || {});
|
|
52
52
|
if (!h.accessKeyId || !h.accessKeySecret || !h.bucketName)
|
|
53
53
|
throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败:凭证字段不完整");
|
|
54
54
|
if (!h.securityToken)
|
|
@@ -62,62 +62,62 @@ async function _e(e = {}) {
|
|
|
62
62
|
success_action_status: "200"
|
|
63
63
|
};
|
|
64
64
|
h.region && ($.region = h.region), h.endPoint && ($.endpoint = h.endPoint);
|
|
65
|
-
const _ = new
|
|
66
|
-
return _.options.ossUrl = h.ossUrl ||
|
|
65
|
+
const _ = new Ft($);
|
|
66
|
+
return _.options.ossUrl = h.ossUrl || Ee(), _.options.uploadDir = o, _;
|
|
67
67
|
}
|
|
68
68
|
async function We(e = {}) {
|
|
69
|
-
var
|
|
69
|
+
var R, X;
|
|
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
73
|
const h = t || await _e({ dir: r, foldName: s }), $ = r || h.options.uploadDir || be(s);
|
|
74
74
|
let _ = o;
|
|
75
75
|
if (!_) {
|
|
76
|
-
const
|
|
77
|
-
_ = `${$}${
|
|
76
|
+
const D = n.name || "file", z = D.lastIndexOf("."), J = z > -1 ? D.slice(z) : "";
|
|
77
|
+
_ = `${$}${je(10)}${J}`;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
typeof m == "function" && m(Math.min(100, Math.max(0, Math.floor(Number(
|
|
79
|
+
const L = (D) => {
|
|
80
|
+
typeof m == "function" && m(Math.min(100, Math.max(0, Math.floor(Number(D) * 100))));
|
|
81
81
|
}, g = n.size > 1 * 1024 * 1024, p = {
|
|
82
|
-
progress: async (
|
|
83
|
-
|
|
82
|
+
progress: async (D) => {
|
|
83
|
+
L(D);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
let d;
|
|
87
|
-
const c = async (
|
|
88
|
-
const
|
|
87
|
+
const c = async (D) => {
|
|
88
|
+
const z = D ? { "x-oss-object-acl": "public-read" } : void 0;
|
|
89
89
|
return g ? h.multipartUpload(_, n, {
|
|
90
90
|
...p,
|
|
91
|
-
...
|
|
91
|
+
...z ? { headers: z } : {}
|
|
92
92
|
}) : h.put(_, n, {
|
|
93
93
|
...p,
|
|
94
|
-
...
|
|
94
|
+
...z ? { headers: z } : {}
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
L(0.01), d = await c(!0);
|
|
99
99
|
} catch {
|
|
100
|
-
|
|
100
|
+
L(0.01), d = await c(!1);
|
|
101
101
|
}
|
|
102
|
-
const x = ((
|
|
102
|
+
const x = ((R = d == null ? void 0 : d.res) == null ? void 0 : R.statusCode) ?? ((X = d == null ? void 0 : d.res) == null ? void 0 : X.status);
|
|
103
103
|
if (x && x !== 200)
|
|
104
104
|
throw new Error("[mgacn-commonsdk] 上传失败");
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
let
|
|
105
|
+
L(1);
|
|
106
|
+
const N = (h.options.ossUrl || "").replace(/\/$/, ""), y = N ? `${N}/${_}` : _;
|
|
107
|
+
let B = y;
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
B = h.signatureUrl(_, { expires: 3600 * 24 });
|
|
110
110
|
} catch {
|
|
111
111
|
}
|
|
112
112
|
return {
|
|
113
113
|
name: _,
|
|
114
114
|
url: y,
|
|
115
|
-
previewUrl:
|
|
115
|
+
previewUrl: B,
|
|
116
116
|
raw: d,
|
|
117
117
|
client: h
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Mt(e = "", t = "") {
|
|
121
121
|
const n = String(e || "").trim();
|
|
122
122
|
if (!n) return "";
|
|
123
123
|
if (!/^https?:\/\//i.test(n)) return n.replace(/^\//, "");
|
|
@@ -133,8 +133,8 @@ function Nt(e = "", t = "") {
|
|
|
133
133
|
return "";
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
async function
|
|
137
|
-
const n = t.client || await _e(t), r =
|
|
136
|
+
async function Pt(e, t = {}) {
|
|
137
|
+
const n = t.client || await _e(t), r = Mt(e, n.options.ossUrl);
|
|
138
138
|
if (!r) return e;
|
|
139
139
|
try {
|
|
140
140
|
return n.signatureUrl(r, { expires: t.expires || 3600 * 24 });
|
|
@@ -147,9 +147,9 @@ const Ye = {
|
|
|
147
147
|
getDir() {
|
|
148
148
|
return be(this.foldName || "portal_cms");
|
|
149
149
|
},
|
|
150
|
-
randomString:
|
|
150
|
+
randomString: je,
|
|
151
151
|
getOss() {
|
|
152
|
-
return
|
|
152
|
+
return Ke(this.getDir());
|
|
153
153
|
},
|
|
154
154
|
async createOssClient() {
|
|
155
155
|
return _e({
|
|
@@ -163,10 +163,10 @@ let Te = 0;
|
|
|
163
163
|
function qe() {
|
|
164
164
|
return Te += 1, `mg-img-${Date.now()}-${Te}`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Tt(e) {
|
|
167
167
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Re(e) {
|
|
170
170
|
return e.map((t) => ({
|
|
171
171
|
uid: qe(),
|
|
172
172
|
url: t,
|
|
@@ -178,14 +178,14 @@ function Be(e) {
|
|
|
178
178
|
function ce(e = "") {
|
|
179
179
|
return String(e).startsWith("blob:");
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Rt(e = "") {
|
|
182
182
|
return /[?&](Expires|Signature|OSSAccessKeyId)=/i.test(String(e));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Bt(e = "") {
|
|
185
185
|
const t = e.lastIndexOf(".");
|
|
186
186
|
return t > -1 ? e.slice(t + 1).toLowerCase() : "";
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const Vt = {
|
|
189
189
|
name: "MgImageUpload",
|
|
190
190
|
mixins: [Ye],
|
|
191
191
|
components: { CircleCloseFilled: ut, Delete: it, Plus: ot },
|
|
@@ -253,7 +253,7 @@ const Bt = {
|
|
|
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(Re(e)), this.ensureSignedPreviews());
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
modelValue: {
|
|
@@ -261,12 +261,12 @@ const Bt = {
|
|
|
261
261
|
handler(e) {
|
|
262
262
|
var o;
|
|
263
263
|
if ((o = this.initFileList) != null && o.length) return;
|
|
264
|
-
const t =
|
|
264
|
+
const t = Tt(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 = Re(t).map((m) => ({
|
|
270
270
|
...m,
|
|
271
271
|
previewUrl: r.get(m.url) || ""
|
|
272
272
|
}));
|
|
@@ -302,14 +302,14 @@ const Bt = {
|
|
|
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) && !Rt(t.previewUrl || t.url)
|
|
306
306
|
);
|
|
307
307
|
if (e.length)
|
|
308
308
|
try {
|
|
309
309
|
const t = await this.createOssClient();
|
|
310
310
|
await Promise.all(
|
|
311
311
|
e.map(async (n) => {
|
|
312
|
-
const r = await
|
|
312
|
+
const r = await Pt(n.url, { client: t });
|
|
313
313
|
r && (n.previewUrl = r);
|
|
314
314
|
})
|
|
315
315
|
);
|
|
@@ -346,7 +346,7 @@ const Bt = {
|
|
|
346
346
|
handleUpload() {
|
|
347
347
|
if (!this.disabled) {
|
|
348
348
|
if (this.fileList.length >= this.fileNum) {
|
|
349
|
-
|
|
349
|
+
K.error(`文件数量不超过${this.fileNum}`);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
this.openFilePicker();
|
|
@@ -357,12 +357,12 @@ const Bt = {
|
|
|
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
|
+
K.error(`文件数量不超过${this.fileNum}个`);
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
363
|
const s = [], o = [];
|
|
364
364
|
if (t.forEach((m) => {
|
|
365
|
-
this.acceptList.includes(
|
|
365
|
+
this.acceptList.includes(Bt(m.name)) ? s.push(m) : o.push(m);
|
|
366
366
|
}), o.length) {
|
|
367
367
|
const m = o.map((h) => h.name).join(",");
|
|
368
368
|
Oe.confirm(
|
|
@@ -406,7 +406,7 @@ const Bt = {
|
|
|
406
406
|
const t = this.maxFileSize * 1024 * 1024, n = [];
|
|
407
407
|
return e.forEach((r) => {
|
|
408
408
|
if (r.size > t) {
|
|
409
|
-
|
|
409
|
+
K.error(`「${r.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
const s = URL.createObjectURL(r), o = {
|
|
@@ -435,7 +435,7 @@ const Bt = {
|
|
|
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), K.error((r == null ? void 0 : r.message) || "上传失败"), this.$emit("error", r, e);
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
initCropper() {
|
|
@@ -464,7 +464,7 @@ const Bt = {
|
|
|
464
464
|
},
|
|
465
465
|
confirmCrop() {
|
|
466
466
|
if (this.uploadingCount) {
|
|
467
|
-
|
|
467
|
+
K.error("上传中,请稍后!");
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
if (!this.cropper) return;
|
|
@@ -484,25 +484,25 @@ const Bt = {
|
|
|
484
484
|
!t || t.status === "uploading" || (this.revokePreview(t), this.fileList.splice(e, 1), this.emitFile());
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
},
|
|
487
|
+
}, Dt = { class: "upload-image-cropper" }, Ot = ["multiple", "accept"], It = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "grey-tips"
|
|
490
|
-
},
|
|
490
|
+
}, At = { key: 0 }, Ht = { class: "list-box" }, zt = {
|
|
491
491
|
key: 0,
|
|
492
492
|
class: "status-mask is-uploading"
|
|
493
|
-
},
|
|
493
|
+
}, Et = { class: "progress-wrap" }, jt = { class: "percent-text" }, Kt = {
|
|
494
494
|
key: 1,
|
|
495
495
|
class: "status-mask is-fail"
|
|
496
|
-
},
|
|
496
|
+
}, Wt = ["onClick"], Yt = { class: "cropper-box" }, qt = ["src"], Gt = {
|
|
497
497
|
key: 0,
|
|
498
498
|
class: "cropper-placeholder"
|
|
499
|
-
},
|
|
499
|
+
}, Xt = {
|
|
500
500
|
key: 0,
|
|
501
501
|
class: "btn-box btn-box--rotate"
|
|
502
|
-
},
|
|
503
|
-
function
|
|
504
|
-
const m = F("el-image"), h = F("el-progress"), $ = F("CircleCloseFilled"), _ = F("el-icon"),
|
|
505
|
-
return u(), b("div",
|
|
502
|
+
}, Jt = { class: "btn-box" };
|
|
503
|
+
function Qt(e, t, n, r, s, o) {
|
|
504
|
+
const m = F("el-image"), h = F("el-progress"), $ = F("CircleCloseFilled"), _ = F("el-icon"), L = F("Delete"), g = F("Plus"), p = F("el-button"), d = F("el-dialog");
|
|
505
|
+
return u(), b("div", Dt, [
|
|
506
506
|
w("input", {
|
|
507
507
|
ref: "fileInput",
|
|
508
508
|
type: "file",
|
|
@@ -510,15 +510,15 @@ function Xt(e, t, n, r, s, o) {
|
|
|
510
510
|
multiple: o.multiple,
|
|
511
511
|
accept: n.accept,
|
|
512
512
|
onChange: t[0] || (t[0] = (...c) => o.onFileChange && o.onFileChange(...c))
|
|
513
|
-
}, null, 40,
|
|
514
|
-
n.greyTips ? (u(), b("div",
|
|
515
|
-
n.otherTips ? (u(), b("div",
|
|
516
|
-
|
|
517
|
-
])) :
|
|
518
|
-
w("div",
|
|
513
|
+
}, null, 40, Ot),
|
|
514
|
+
n.greyTips ? (u(), b("div", It, [
|
|
515
|
+
n.otherTips ? (u(), b("div", At, T(n.otherTips), 1)) : V("", !0),
|
|
516
|
+
j(" " + T(n.greyTips), 1)
|
|
517
|
+
])) : V("", !0),
|
|
518
|
+
w("div", Ht, [
|
|
519
519
|
(u(!0), b(W, null, q(s.fileList, (c, x) => (u(), b("div", {
|
|
520
520
|
key: c.uid,
|
|
521
|
-
class:
|
|
521
|
+
class: H(["image-box", [`is-${c.status}`]]),
|
|
522
522
|
style: re(n.imageStyle)
|
|
523
523
|
}, [
|
|
524
524
|
U(m, {
|
|
@@ -526,8 +526,8 @@ function Xt(e, t, n, r, s, o) {
|
|
|
526
526
|
fit: "cover",
|
|
527
527
|
class: "img"
|
|
528
528
|
}, null, 8, ["src"]),
|
|
529
|
-
c.status === "uploading" ? (u(), b("div",
|
|
530
|
-
w("div",
|
|
529
|
+
c.status === "uploading" ? (u(), b("div", zt, [
|
|
530
|
+
w("div", Et, [
|
|
531
531
|
U(h, {
|
|
532
532
|
type: "circle",
|
|
533
533
|
percentage: c.percent,
|
|
@@ -536,9 +536,9 @@ function Xt(e, t, n, r, s, o) {
|
|
|
536
536
|
"show-text": !1,
|
|
537
537
|
color: "var(--mg-primary, #ff5722)"
|
|
538
538
|
}, null, 8, ["percentage"]),
|
|
539
|
-
w("span",
|
|
539
|
+
w("span", jt, T(c.percent) + "%", 1)
|
|
540
540
|
])
|
|
541
|
-
])) : c.status === "fail" ? (u(), b("div",
|
|
541
|
+
])) : c.status === "fail" ? (u(), b("div", Kt, [
|
|
542
542
|
U(_, {
|
|
543
543
|
class: "fail-icon",
|
|
544
544
|
size: 16
|
|
@@ -553,28 +553,28 @@ function Xt(e, t, n, r, s, o) {
|
|
|
553
553
|
class: "remove-icon",
|
|
554
554
|
size: 14,
|
|
555
555
|
title: "删除",
|
|
556
|
-
onClick: de((
|
|
556
|
+
onClick: de((N) => o.removeImg(x), ["stop"])
|
|
557
557
|
}, {
|
|
558
558
|
default: S(() => [
|
|
559
|
-
U(
|
|
559
|
+
U(L)
|
|
560
560
|
]),
|
|
561
561
|
_: 1
|
|
562
562
|
}, 8, ["onClick"])
|
|
563
563
|
])) : (u(), b("div", {
|
|
564
564
|
key: 2,
|
|
565
565
|
class: "status-mask is-success",
|
|
566
|
-
onClick: (
|
|
566
|
+
onClick: (N) => o.removeImg(x)
|
|
567
567
|
}, [
|
|
568
568
|
U(_, {
|
|
569
569
|
class: "remove-icon",
|
|
570
570
|
size: 16
|
|
571
571
|
}, {
|
|
572
572
|
default: S(() => [
|
|
573
|
-
U(
|
|
573
|
+
U(L)
|
|
574
574
|
]),
|
|
575
575
|
_: 1
|
|
576
576
|
})
|
|
577
|
-
], 8,
|
|
577
|
+
], 8, Wt))
|
|
578
578
|
], 6))), 128)),
|
|
579
579
|
ee(w("div", {
|
|
580
580
|
class: "image-box upload-btn",
|
|
@@ -607,12 +607,12 @@ function Xt(e, t, n, r, s, o) {
|
|
|
607
607
|
onClose: o.handleBack
|
|
608
608
|
}, {
|
|
609
609
|
footer: S(() => [
|
|
610
|
-
n.isDegree ? (u(), b("div",
|
|
610
|
+
n.isDegree ? (u(), b("div", Xt, [
|
|
611
611
|
U(p, {
|
|
612
612
|
onClick: t[2] || (t[2] = (c) => o.rotate(-n.degree))
|
|
613
613
|
}, {
|
|
614
614
|
default: S(() => [...t[7] || (t[7] = [
|
|
615
|
-
|
|
615
|
+
j("向左旋转", -1)
|
|
616
616
|
])]),
|
|
617
617
|
_: 1
|
|
618
618
|
}),
|
|
@@ -620,18 +620,18 @@ function Xt(e, t, n, r, s, o) {
|
|
|
620
620
|
onClick: t[3] || (t[3] = (c) => o.rotate(n.degree))
|
|
621
621
|
}, {
|
|
622
622
|
default: S(() => [...t[8] || (t[8] = [
|
|
623
|
-
|
|
623
|
+
j("向右旋转", -1)
|
|
624
624
|
])]),
|
|
625
625
|
_: 1
|
|
626
626
|
})
|
|
627
|
-
])) :
|
|
628
|
-
w("div",
|
|
627
|
+
])) : V("", !0),
|
|
628
|
+
w("div", Jt, [
|
|
629
629
|
U(p, {
|
|
630
630
|
type: "primary",
|
|
631
631
|
onClick: o.openFilePicker
|
|
632
632
|
}, {
|
|
633
633
|
default: S(() => [
|
|
634
|
-
|
|
634
|
+
j(T(s.cropImageUrl ? "重新上传" : "点击上传"), 1)
|
|
635
635
|
]),
|
|
636
636
|
_: 1
|
|
637
637
|
}, 8, ["onClick"]),
|
|
@@ -640,37 +640,37 @@ function Xt(e, t, n, r, s, o) {
|
|
|
640
640
|
onClick: o.confirmCrop
|
|
641
641
|
}, {
|
|
642
642
|
default: S(() => [...t[9] || (t[9] = [
|
|
643
|
-
|
|
643
|
+
j("确定", -1)
|
|
644
644
|
])]),
|
|
645
645
|
_: 1
|
|
646
646
|
}, 8, ["onClick"])
|
|
647
647
|
])
|
|
648
648
|
]),
|
|
649
649
|
default: S(() => [
|
|
650
|
-
w("div",
|
|
650
|
+
w("div", Yt, [
|
|
651
651
|
ee(w("img", {
|
|
652
652
|
ref: "cropImage",
|
|
653
653
|
src: s.cropImageUrl,
|
|
654
654
|
class: "cropper-img"
|
|
655
|
-
}, null, 8,
|
|
655
|
+
}, null, 8, qt), [
|
|
656
656
|
[te, s.cropImageUrl]
|
|
657
657
|
]),
|
|
658
|
-
s.cropImageUrl ?
|
|
658
|
+
s.cropImageUrl ? V("", !0) : (u(), b("div", Gt, "请选择图片后进行裁剪"))
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
_: 1
|
|
662
662
|
}, 8, ["modelValue", "onClose"])
|
|
663
663
|
]);
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
let
|
|
665
|
+
const Zt = /* @__PURE__ */ G(Vt, [["render", Qt], ["__scopeId", "data-v-68531340"]]), en = ".mp4,.mov,.jpg,.jpeg,.m3u8,.png,.m4v,.doc,.docx,.xls,.xlsx,.pdf";
|
|
666
|
+
let Be = 0;
|
|
667
667
|
function we() {
|
|
668
|
-
return
|
|
668
|
+
return Be += 1, `mg-file-${Date.now()}-${Be}`;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function tn(e) {
|
|
671
671
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function nn(e) {
|
|
674
674
|
return Array.isArray(e) ? e.map((t) => {
|
|
675
675
|
if (!t) return null;
|
|
676
676
|
if (typeof t == "string")
|
|
@@ -682,7 +682,7 @@ function en(e) {
|
|
|
682
682
|
} : null;
|
|
683
683
|
}).filter(Boolean) : [];
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function ln(e = [], t = []) {
|
|
686
686
|
return e.length !== t.length ? !1 : e.every((n, r) => {
|
|
687
687
|
const s = t[r];
|
|
688
688
|
return n.fileUrl === s.fileUrl && n.fileName === s.fileName;
|
|
@@ -695,7 +695,7 @@ function oe(e = "") {
|
|
|
695
695
|
return "file";
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Ve(e) {
|
|
699
699
|
return e.map((t) => ({
|
|
700
700
|
uid: we(),
|
|
701
701
|
name: oe(t),
|
|
@@ -705,7 +705,7 @@ function De(e) {
|
|
|
705
705
|
raw: null
|
|
706
706
|
}));
|
|
707
707
|
}
|
|
708
|
-
function
|
|
708
|
+
function sn(e = []) {
|
|
709
709
|
return e.map((t) => ({
|
|
710
710
|
uid: we(),
|
|
711
711
|
name: t.fileName || oe(t.fileUrl),
|
|
@@ -715,14 +715,14 @@ function nn(e = []) {
|
|
|
715
715
|
raw: null
|
|
716
716
|
}));
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function an(e = "") {
|
|
719
719
|
const t = e.lastIndexOf(".");
|
|
720
720
|
return t > -1 ? e.slice(t + 1).toLowerCase() : "";
|
|
721
721
|
}
|
|
722
|
-
const
|
|
722
|
+
const rn = {
|
|
723
723
|
name: "MgFileUpload",
|
|
724
724
|
mixins: [Ye],
|
|
725
|
-
components: { CircleCheck: pt, CircleClose:
|
|
725
|
+
components: { CircleCheck: pt, CircleClose: De, Close: dt, Document: ct },
|
|
726
726
|
props: {
|
|
727
727
|
/** v-model:valueFormat=url 时为 string[];valueFormat=file 时为 { fileName, fileUrl }[] */
|
|
728
728
|
modelValue: { type: [Array, String], default: () => [] },
|
|
@@ -741,7 +741,7 @@ const sn = {
|
|
|
741
741
|
initFileList: { type: Array, default: () => [] },
|
|
742
742
|
/** 选满后是否清空再传 */
|
|
743
743
|
resetFilelist: Boolean,
|
|
744
|
-
accept: { type: String, default:
|
|
744
|
+
accept: { type: String, default: en },
|
|
745
745
|
foldName: { type: String, default: "portal_cms" },
|
|
746
746
|
disabled: Boolean,
|
|
747
747
|
buttonText: { type: String, default: "点击上传" },
|
|
@@ -798,7 +798,7 @@ const sn = {
|
|
|
798
798
|
deep: !0,
|
|
799
799
|
immediate: !0,
|
|
800
800
|
handler(e) {
|
|
801
|
-
e != null && e.length && (this.fileList =
|
|
801
|
+
e != null && e.length && (this.fileList = Ve(e));
|
|
802
802
|
}
|
|
803
803
|
},
|
|
804
804
|
modelValue: {
|
|
@@ -807,13 +807,13 @@ const sn = {
|
|
|
807
807
|
var r;
|
|
808
808
|
if ((r = this.initFileList) != null && r.length) return;
|
|
809
809
|
if (this.valueFormat === "file") {
|
|
810
|
-
const s =
|
|
811
|
-
if (
|
|
812
|
-
this.fileList =
|
|
810
|
+
const s = nn(e);
|
|
811
|
+
if (ln(s, this.modelOutputValue)) return;
|
|
812
|
+
this.fileList = sn(s);
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
|
-
const t =
|
|
816
|
-
t.length === n.length && t.every((s, o) => s === n[o]) || (this.fileList =
|
|
815
|
+
const t = tn(e), n = this.successUrls;
|
|
816
|
+
t.length === n.length && t.every((s, o) => s === n[o]) || (this.fileList = Ve(t));
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
819
|
},
|
|
@@ -832,7 +832,7 @@ const sn = {
|
|
|
832
832
|
handleUpload() {
|
|
833
833
|
if (!this.disabled) {
|
|
834
834
|
if (this.fileList.length >= this.fileNum) {
|
|
835
|
-
|
|
835
|
+
K.error(`文件数量不超过${this.fileNum}`);
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
838
|
this.openFilePicker();
|
|
@@ -847,12 +847,12 @@ const sn = {
|
|
|
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
|
+
K.error(`文件数量不超过${this.fileNum}个`);
|
|
851
851
|
return;
|
|
852
852
|
}
|
|
853
853
|
const r = [], s = [];
|
|
854
854
|
if (t.forEach((o) => {
|
|
855
|
-
this.acceptList.includes(
|
|
855
|
+
this.acceptList.includes(an(o.name)) ? r.push(o) : s.push(o);
|
|
856
856
|
}), s.length) {
|
|
857
857
|
const o = s.map((m) => m.name).join(",");
|
|
858
858
|
Oe.confirm(
|
|
@@ -874,7 +874,7 @@ const sn = {
|
|
|
874
874
|
const t = this.maxFileSize * 1024 * 1024, n = [];
|
|
875
875
|
return e.forEach((r) => {
|
|
876
876
|
if (r.size > t) {
|
|
877
|
-
|
|
877
|
+
K.error(`「${r.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
880
880
|
const s = {
|
|
@@ -903,27 +903,30 @@ const sn = {
|
|
|
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), K.error((n == null ? void 0 : n.message) || "上传失败"), this.$emit("error", n, e);
|
|
907
907
|
}
|
|
908
908
|
},
|
|
909
909
|
onFileClick(e) {
|
|
910
|
-
(e == null ? void 0 : e.status)
|
|
910
|
+
(e == null ? void 0 : e.status) !== "success" || !e.url || yt({
|
|
911
|
+
src: e.url,
|
|
912
|
+
name: e.name || ""
|
|
913
|
+
});
|
|
911
914
|
},
|
|
912
915
|
removeFile(e) {
|
|
913
916
|
const t = this.fileList[e];
|
|
914
917
|
!t || t.status === "uploading" || (this.fileList.splice(e, 1), this.emitFile());
|
|
915
918
|
}
|
|
916
919
|
}
|
|
917
|
-
},
|
|
920
|
+
}, on = { class: "mg-file-upload" }, un = ["multiple", "accept", "disabled"], cn = {
|
|
918
921
|
key: 1,
|
|
919
922
|
class: "el-upload__tip"
|
|
920
|
-
},
|
|
923
|
+
}, dn = {
|
|
921
924
|
key: 2,
|
|
922
925
|
class: "el-upload-list el-upload-list--text"
|
|
923
|
-
},
|
|
924
|
-
function
|
|
925
|
-
const m = F("el-button"), h = F("Document"), $ = F("el-icon"), _ = F("CircleCheck"),
|
|
926
|
-
return u(), b("div",
|
|
926
|
+
}, pn = { class: "el-upload-list__item-info" }, fn = ["href", "target", "onClick"], hn = { class: "el-upload-list__item-file-name" }, mn = { class: "el-upload-list__item-status-label" };
|
|
927
|
+
function gn(e, t, n, r, s, o) {
|
|
928
|
+
const m = F("el-button"), h = F("Document"), $ = F("el-icon"), _ = F("CircleCheck"), L = F("CircleClose"), g = F("Close"), p = F("el-progress");
|
|
929
|
+
return u(), b("div", on, [
|
|
927
930
|
w("input", {
|
|
928
931
|
ref: "fileInput",
|
|
929
932
|
type: "file",
|
|
@@ -932,7 +935,7 @@ function hn(e, t, n, r, s, o) {
|
|
|
932
935
|
accept: n.accept,
|
|
933
936
|
disabled: n.disabled,
|
|
934
937
|
onChange: t[0] || (t[0] = (...d) => o.onFileChange && o.onFileChange(...d))
|
|
935
|
-
}, null, 40,
|
|
938
|
+
}, null, 40, un),
|
|
936
939
|
n.showButton ? (u(), P(m, {
|
|
937
940
|
key: 0,
|
|
938
941
|
type: "primary",
|
|
@@ -940,18 +943,18 @@ function hn(e, t, n, r, s, o) {
|
|
|
940
943
|
onClick: o.handleUpload
|
|
941
944
|
}, {
|
|
942
945
|
default: S(() => [
|
|
943
|
-
|
|
946
|
+
j(T(n.buttonText), 1)
|
|
944
947
|
]),
|
|
945
948
|
_: 1
|
|
946
|
-
}, 8, ["disabled", "onClick"])) :
|
|
947
|
-
o.tipText ? (u(), b("div",
|
|
948
|
-
n.showFileList ? (u(), b("ul",
|
|
949
|
+
}, 8, ["disabled", "onClick"])) : V("", !0),
|
|
950
|
+
o.tipText ? (u(), b("div", cn, T(o.tipText), 1)) : V("", !0),
|
|
951
|
+
n.showFileList ? (u(), b("ul", dn, [
|
|
949
952
|
(u(!0), b(W, null, q(s.fileList, (d, c) => (u(), b("li", {
|
|
950
953
|
key: d.uid,
|
|
951
|
-
class:
|
|
954
|
+
class: H(["el-upload-list__item", [`is-${d.status}`]]),
|
|
952
955
|
tabindex: "0"
|
|
953
956
|
}, [
|
|
954
|
-
w("div",
|
|
957
|
+
w("div", pn, [
|
|
955
958
|
w("a", {
|
|
956
959
|
class: "el-upload-list__item-name",
|
|
957
960
|
href: d.url || void 0,
|
|
@@ -965,10 +968,10 @@ function hn(e, t, n, r, s, o) {
|
|
|
965
968
|
]),
|
|
966
969
|
_: 1
|
|
967
970
|
}),
|
|
968
|
-
w("span",
|
|
969
|
-
], 8,
|
|
971
|
+
w("span", hn, T(d.name), 1)
|
|
972
|
+
], 8, fn)
|
|
970
973
|
]),
|
|
971
|
-
w("label",
|
|
974
|
+
w("label", mn, [
|
|
972
975
|
d.status === "success" ? (u(), P($, {
|
|
973
976
|
key: 0,
|
|
974
977
|
class: "el-icon--upload-success el-icon--circle-check"
|
|
@@ -982,10 +985,10 @@ function hn(e, t, n, r, s, o) {
|
|
|
982
985
|
class: "el-icon--upload-fail"
|
|
983
986
|
}, {
|
|
984
987
|
default: S(() => [
|
|
985
|
-
U(
|
|
988
|
+
U(L)
|
|
986
989
|
]),
|
|
987
990
|
_: 1
|
|
988
|
-
})) :
|
|
991
|
+
})) : V("", !0)
|
|
989
992
|
]),
|
|
990
993
|
d.status !== "uploading" ? (u(), P($, {
|
|
991
994
|
key: 0,
|
|
@@ -997,19 +1000,19 @@ function hn(e, t, n, r, s, o) {
|
|
|
997
1000
|
U(g)
|
|
998
1001
|
]),
|
|
999
1002
|
_: 1
|
|
1000
|
-
}, 8, ["onClick"])) :
|
|
1003
|
+
}, 8, ["onClick"])) : V("", !0),
|
|
1001
1004
|
d.status === "uploading" ? (u(), P(p, {
|
|
1002
1005
|
key: 1,
|
|
1003
1006
|
class: "el-upload-list__item-progress",
|
|
1004
1007
|
type: "line",
|
|
1005
1008
|
percentage: d.percent,
|
|
1006
1009
|
"stroke-width": 2
|
|
1007
|
-
}, null, 8, ["percentage"])) :
|
|
1010
|
+
}, null, 8, ["percentage"])) : V("", !0)
|
|
1008
1011
|
], 2))), 128))
|
|
1009
|
-
])) :
|
|
1012
|
+
])) : V("", !0)
|
|
1010
1013
|
]);
|
|
1011
1014
|
}
|
|
1012
|
-
const
|
|
1015
|
+
const yn = /* @__PURE__ */ G(rn, [["render", gn], ["__scopeId", "data-v-0cf84609"]]), vn = {
|
|
1013
1016
|
__name: "DateRangePicker",
|
|
1014
1017
|
props: {
|
|
1015
1018
|
start: {
|
|
@@ -1085,7 +1088,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1085
1088
|
), ve(() => {
|
|
1086
1089
|
_.value = r.start || r.end ? [r.start, r.end] : [];
|
|
1087
1090
|
});
|
|
1088
|
-
function
|
|
1091
|
+
function L(g) {
|
|
1089
1092
|
n("update:start", g ? g[0] : ""), n("update:end", g ? g[1] : ""), n("change");
|
|
1090
1093
|
}
|
|
1091
1094
|
return (g, p) => {
|
|
@@ -1101,18 +1104,18 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1101
1104
|
"default-time": e.defaultTime,
|
|
1102
1105
|
shortcuts: $.value,
|
|
1103
1106
|
class: "date-range-picker",
|
|
1104
|
-
onChange:
|
|
1107
|
+
onChange: L,
|
|
1105
1108
|
clearable: e.canClearable
|
|
1106
1109
|
}, null, 8, ["modelValue", "type", "start-placeholder", "value-format", "default-time", "shortcuts", "clearable"]);
|
|
1107
1110
|
};
|
|
1108
1111
|
}
|
|
1109
|
-
}, Ge = /* @__PURE__ */ G(
|
|
1112
|
+
}, Ge = /* @__PURE__ */ G(vn, [["__scopeId", "data-v-88a05aae"]]), bn = { class: "common-search__body" }, _n = { class: "common-search__control-wrap" }, wn = ["onKeyup"], Cn = { class: "common-search__range-sep" }, kn = {
|
|
1110
1113
|
key: 5,
|
|
1111
1114
|
class: "common-search__range"
|
|
1112
|
-
},
|
|
1115
|
+
}, Un = {
|
|
1113
1116
|
key: 0,
|
|
1114
1117
|
class: "common-search__actions is-inline"
|
|
1115
|
-
},
|
|
1118
|
+
}, xn = { class: "common-search__actions-main" }, Sn = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
|
|
1116
1119
|
__name: "SearchForm",
|
|
1117
1120
|
props: {
|
|
1118
1121
|
modelValue: { type: Object, default: () => ({}) },
|
|
@@ -1120,14 +1123,14 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1120
1123
|
},
|
|
1121
1124
|
emits: ["change", "search", "reset", "update:modelValue"],
|
|
1122
1125
|
setup(e, { emit: t }) {
|
|
1123
|
-
const n = e, r = t, s = A({}), o =
|
|
1126
|
+
const n = e, r = t, s = A({}), o = Le({}), m = Le({});
|
|
1124
1127
|
let h = !1;
|
|
1125
1128
|
function $(l, i) {
|
|
1126
1129
|
return JSON.stringify(l ?? {}) === JSON.stringify(i ?? {});
|
|
1127
1130
|
}
|
|
1128
|
-
const _ = A(null),
|
|
1129
|
-
let
|
|
1130
|
-
const
|
|
1131
|
+
const _ = A(null), L = A(!1), g = A(!1), p = A(0), d = A(0), c = A(0), x = A(null);
|
|
1132
|
+
let N = null, y = !1, B = !1;
|
|
1133
|
+
const R = ye(() => {
|
|
1131
1134
|
if (!(!g.value || x.value == null))
|
|
1132
1135
|
return {
|
|
1133
1136
|
maxHeight: `${x.value}px`,
|
|
@@ -1137,20 +1140,20 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1137
1140
|
function X(l = {}) {
|
|
1138
1141
|
return String(l.label || l.title || "").trim();
|
|
1139
1142
|
}
|
|
1140
|
-
function
|
|
1143
|
+
function D(l = {}) {
|
|
1141
1144
|
return String(l.tip || X(l) || "").trim();
|
|
1142
1145
|
}
|
|
1143
|
-
function
|
|
1146
|
+
function z(l = "") {
|
|
1144
1147
|
const i = String(l).trim();
|
|
1145
1148
|
return !i || (/* @__PURE__ */ new Set(["全部", "或选择", "请输入或选择"])).has(i) ? "" : i.replace(/^请(输入|选择)/, "").trim() || i;
|
|
1146
1149
|
}
|
|
1147
1150
|
function J(l = {}, i = "") {
|
|
1148
1151
|
if (l.placeholder != null && l.placeholder !== "") {
|
|
1149
|
-
const k =
|
|
1152
|
+
const k = z(l.placeholder);
|
|
1150
1153
|
if (k) return k;
|
|
1151
1154
|
}
|
|
1152
1155
|
const f = X(l);
|
|
1153
|
-
return f ||
|
|
1156
|
+
return f || z(i) || i;
|
|
1154
1157
|
}
|
|
1155
1158
|
function Ce(l = {}, i = "min") {
|
|
1156
1159
|
const f = i === "min" ? l.minPlaceholder : l.maxPlaceholder, C = X(l), k = i === "min" ? "最小值" : "最大值", M = /* @__PURE__ */ new Set(["最小", "最大", "最小值", "最大值"]);
|
|
@@ -1173,18 +1176,18 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1173
1176
|
), se(
|
|
1174
1177
|
() => n.itemList,
|
|
1175
1178
|
() => {
|
|
1176
|
-
|
|
1179
|
+
L.value = !1, p.value = 0, Z(() => Q());
|
|
1177
1180
|
},
|
|
1178
1181
|
{ deep: !0 }
|
|
1179
1182
|
), ve(() => {
|
|
1180
|
-
Z(() => Q()), typeof ResizeObserver < "u" && (
|
|
1181
|
-
!y && !
|
|
1182
|
-
}), _.value &&
|
|
1183
|
-
}),
|
|
1184
|
-
|
|
1183
|
+
Z(() => Q()), typeof ResizeObserver < "u" && (N = new ResizeObserver(() => {
|
|
1184
|
+
!y && !B && Q();
|
|
1185
|
+
}), _.value && N.observe(_.value)), window.addEventListener("resize", ke);
|
|
1186
|
+
}), He(() => {
|
|
1187
|
+
N == null || N.disconnect(), window.removeEventListener("resize", ke);
|
|
1185
1188
|
});
|
|
1186
1189
|
function ke() {
|
|
1187
|
-
!y && !
|
|
1190
|
+
!y && !B && Q();
|
|
1188
1191
|
}
|
|
1189
1192
|
function Je(l) {
|
|
1190
1193
|
const i = n.itemList.length;
|
|
@@ -1252,7 +1255,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1252
1255
|
k != null && M != null && k > M && ([k, M] = [M, k]), s.value[i] = k, s.value[f] = M;
|
|
1253
1256
|
}
|
|
1254
1257
|
function tt(l) {
|
|
1255
|
-
fe(l),
|
|
1258
|
+
fe(l), E();
|
|
1256
1259
|
}
|
|
1257
1260
|
function nt(l) {
|
|
1258
1261
|
const { startKey: i, endKey: f } = pe(l), C = s.value[i], k = s.value[f];
|
|
@@ -1261,7 +1264,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1261
1264
|
function lt(l) {
|
|
1262
1265
|
if (l.disabled) return;
|
|
1263
1266
|
const { startKey: i, endKey: f } = pe(l);
|
|
1264
|
-
s.value[i] = void 0, s.value[f] = void 0,
|
|
1267
|
+
s.value[i] = void 0, s.value[f] = void 0, E();
|
|
1265
1268
|
}
|
|
1266
1269
|
async function st(l, i) {
|
|
1267
1270
|
if (typeof l.remoteMethod == "function") {
|
|
@@ -1282,7 +1285,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1282
1285
|
}
|
|
1283
1286
|
function Q() {
|
|
1284
1287
|
const l = _.value;
|
|
1285
|
-
if (!l || y ||
|
|
1288
|
+
if (!l || y || B) return;
|
|
1286
1289
|
y = !0;
|
|
1287
1290
|
const i = l.closest(".common-search"), f = Array.from(l.querySelectorAll(".common-search__field")), C = l.querySelector(".common-search__actions");
|
|
1288
1291
|
if (!f.length || !i) {
|
|
@@ -1296,15 +1299,15 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1296
1299
|
const le = p.value;
|
|
1297
1300
|
p.value = I;
|
|
1298
1301
|
const a = Y > 1, ue = g.value;
|
|
1299
|
-
g.value = a, a ?
|
|
1302
|
+
g.value = a, a ? L.value ? x.value = null : x.value = d.value : (L.value = !1, x.value = null), y = !1, (ue !== a || le !== I) && Z(() => Q());
|
|
1300
1303
|
}
|
|
1301
1304
|
function at() {
|
|
1302
1305
|
const l = _.value;
|
|
1303
|
-
if (!l ||
|
|
1304
|
-
|
|
1306
|
+
if (!l || B) return;
|
|
1307
|
+
B = !0;
|
|
1305
1308
|
const i = l.getBoundingClientRect().height || d.value;
|
|
1306
|
-
if (
|
|
1307
|
-
x.value = i || he(l),
|
|
1309
|
+
if (L.value)
|
|
1310
|
+
x.value = i || he(l), L.value = !1, requestAnimationFrame(() => {
|
|
1308
1311
|
requestAnimationFrame(() => {
|
|
1309
1312
|
x.value = d.value;
|
|
1310
1313
|
});
|
|
@@ -1312,14 +1315,14 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1312
1315
|
else {
|
|
1313
1316
|
x.value = i;
|
|
1314
1317
|
const f = he(l);
|
|
1315
|
-
c.value = f,
|
|
1318
|
+
c.value = f, L.value = !0, requestAnimationFrame(() => {
|
|
1316
1319
|
requestAnimationFrame(() => {
|
|
1317
1320
|
x.value = Math.max(f, d.value || 0);
|
|
1318
1321
|
});
|
|
1319
1322
|
});
|
|
1320
1323
|
}
|
|
1321
1324
|
window.setTimeout(() => {
|
|
1322
|
-
|
|
1325
|
+
B = !1, L.value && (x.value = null), Q();
|
|
1323
1326
|
}, 380);
|
|
1324
1327
|
}
|
|
1325
1328
|
function rt() {
|
|
@@ -1331,7 +1334,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1331
1334
|
function Se() {
|
|
1332
1335
|
r("update:modelValue", { ...s.value });
|
|
1333
1336
|
}
|
|
1334
|
-
function
|
|
1337
|
+
function E() {
|
|
1335
1338
|
Se(), r("change", { ...s.value }), r("search", { ...s.value });
|
|
1336
1339
|
}
|
|
1337
1340
|
function Fe() {
|
|
@@ -1340,35 +1343,35 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1340
1343
|
return (l, i) => {
|
|
1341
1344
|
const f = F("el-input"), C = F("el-option"), k = F("el-select"), M = F("el-input-number"), O = F("el-icon"), I = F("el-date-picker"), Y = F("el-tooltip"), le = F("el-button");
|
|
1342
1345
|
return ee((u(), b("div", {
|
|
1343
|
-
class:
|
|
1346
|
+
class: H(["common-search", {
|
|
1344
1347
|
"is-single-row": !g.value,
|
|
1345
1348
|
"is-multi-row": g.value,
|
|
1346
|
-
"is-expanded": g.value &&
|
|
1347
|
-
"is-collapsed": g.value && !
|
|
1349
|
+
"is-expanded": g.value && L.value,
|
|
1350
|
+
"is-collapsed": g.value && !L.value
|
|
1348
1351
|
}])
|
|
1349
1352
|
}, [
|
|
1350
|
-
w("div",
|
|
1353
|
+
w("div", bn, [
|
|
1351
1354
|
w("div", {
|
|
1352
1355
|
ref_key: "fieldsRef",
|
|
1353
1356
|
ref: _,
|
|
1354
1357
|
class: "common-search__fields",
|
|
1355
|
-
style: re(
|
|
1358
|
+
style: re(R.value)
|
|
1356
1359
|
}, [
|
|
1357
1360
|
(u(!0), b(W, null, q(e.itemList, (a, ue) => (u(), b(W, {
|
|
1358
1361
|
key: a.prop || a.start || ue
|
|
1359
1362
|
}, [
|
|
1360
1363
|
w("div", {
|
|
1361
|
-
class:
|
|
1364
|
+
class: H(["common-search__field", [`is-${a.type}`, a.className]]),
|
|
1362
1365
|
style: re(et(a))
|
|
1363
1366
|
}, [
|
|
1364
1367
|
U(Y, {
|
|
1365
|
-
content:
|
|
1366
|
-
disabled: !
|
|
1368
|
+
content: D(a),
|
|
1369
|
+
disabled: !D(a),
|
|
1367
1370
|
placement: "top",
|
|
1368
1371
|
"show-after": 280
|
|
1369
1372
|
}, {
|
|
1370
1373
|
default: S(() => [
|
|
1371
|
-
w("div",
|
|
1374
|
+
w("div", _n, [
|
|
1372
1375
|
a.type === "input" || a.type === "text" ? (u(), P(f, {
|
|
1373
1376
|
key: 0,
|
|
1374
1377
|
modelValue: s.value[a.prop],
|
|
@@ -1379,8 +1382,8 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1379
1382
|
maxlength: a.maxlength || 200,
|
|
1380
1383
|
disabled: a.disabled,
|
|
1381
1384
|
class: "common-search__control",
|
|
1382
|
-
onKeyup:
|
|
1383
|
-
onClear:
|
|
1385
|
+
onKeyup: Ne(E, ["enter"]),
|
|
1386
|
+
onClear: E
|
|
1384
1387
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (u(), P(k, {
|
|
1385
1388
|
key: 1,
|
|
1386
1389
|
modelValue: s.value[a.prop],
|
|
@@ -1393,7 +1396,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1393
1396
|
"collapse-tags-tooltip": a.multiple,
|
|
1394
1397
|
disabled: a.disabled,
|
|
1395
1398
|
class: "common-search__control",
|
|
1396
|
-
onChange:
|
|
1399
|
+
onChange: E
|
|
1397
1400
|
}, {
|
|
1398
1401
|
default: S(() => [
|
|
1399
1402
|
(u(!0), b(W, null, q(a.options || [], (v, me) => (u(), P(C, {
|
|
@@ -1421,7 +1424,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1421
1424
|
disabled: a.disabled,
|
|
1422
1425
|
class: "common-search__control",
|
|
1423
1426
|
onClear: (v) => o[a.prop] = [],
|
|
1424
|
-
onChange:
|
|
1427
|
+
onChange: E
|
|
1425
1428
|
}, {
|
|
1426
1429
|
default: S(() => [
|
|
1427
1430
|
(u(!0), b(W, null, q(o[a.prop] || a.options || [], (v, me) => (u(), P(C, {
|
|
@@ -1435,7 +1438,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1435
1438
|
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (u(), b("div", {
|
|
1436
1439
|
key: 3,
|
|
1437
1440
|
class: "common-search__range common-search__range--number",
|
|
1438
|
-
onKeyup:
|
|
1441
|
+
onKeyup: Ne((v) => tt(a), ["enter"])
|
|
1439
1442
|
}, [
|
|
1440
1443
|
U(M, {
|
|
1441
1444
|
modelValue: s.value[a.start || `${a.prop}Min`],
|
|
@@ -1448,7 +1451,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1448
1451
|
class: "common-search__range-input",
|
|
1449
1452
|
onBlur: (v) => fe(a)
|
|
1450
1453
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1451
|
-
w("span",
|
|
1454
|
+
w("span", Cn, T(a.separator || "至"), 1),
|
|
1452
1455
|
U(M, {
|
|
1453
1456
|
modelValue: s.value[a.end || `${a.prop}Max`],
|
|
1454
1457
|
"onUpdate:modelValue": (v) => s.value[a.end || `${a.prop}Max`] = v,
|
|
@@ -1468,11 +1471,11 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1468
1471
|
onClick: (v) => lt(a)
|
|
1469
1472
|
}, {
|
|
1470
1473
|
default: S(() => [
|
|
1471
|
-
U(ne(
|
|
1474
|
+
U(ne(De))
|
|
1472
1475
|
]),
|
|
1473
1476
|
_: 1
|
|
1474
|
-
}, 8, ["onClick"])) :
|
|
1475
|
-
], 40,
|
|
1477
|
+
}, 8, ["onClick"])) : V("", !0)
|
|
1478
|
+
], 40, wn)) : a.type === "date" ? (u(), P(I, {
|
|
1476
1479
|
key: 4,
|
|
1477
1480
|
modelValue: s.value[a.prop],
|
|
1478
1481
|
"onUpdate:modelValue": (v) => s.value[a.prop] = v,
|
|
@@ -1483,8 +1486,8 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1483
1486
|
clearable: a.clearable !== !1,
|
|
1484
1487
|
disabled: a.disabled,
|
|
1485
1488
|
class: "common-search__control",
|
|
1486
|
-
onChange:
|
|
1487
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (u(), b("div",
|
|
1489
|
+
onChange: E
|
|
1490
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (u(), b("div", kn, [
|
|
1488
1491
|
U(Ge, {
|
|
1489
1492
|
start: s.value[a.start || a.startProp],
|
|
1490
1493
|
"onUpdate:start": (v) => s.value[a.start || a.startProp] = v,
|
|
@@ -1497,7 +1500,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1497
1500
|
"show-shortcuts": a.showShortcuts !== !1,
|
|
1498
1501
|
shortcuts: a.shortcuts,
|
|
1499
1502
|
"can-clearable": a.clearable !== !1,
|
|
1500
|
-
onChange:
|
|
1503
|
+
onChange: E
|
|
1501
1504
|
}, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end", "title", "type", "value-format", "format", "show-shortcuts", "shortcuts", "can-clearable"])
|
|
1502
1505
|
])) : ae(l.$slots, a.slotName || a.prop, {
|
|
1503
1506
|
item: a,
|
|
@@ -1508,10 +1511,10 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1508
1511
|
_: 2
|
|
1509
1512
|
}, 1032, ["content", "disabled"])
|
|
1510
1513
|
], 6),
|
|
1511
|
-
Je(ue) ? (u(), b("div",
|
|
1512
|
-
w("div",
|
|
1514
|
+
Je(ue) ? (u(), b("div", Un, [
|
|
1515
|
+
w("div", xn, [
|
|
1513
1516
|
ae(l.$slots, "actions", {
|
|
1514
|
-
search:
|
|
1517
|
+
search: E,
|
|
1515
1518
|
reset: Fe,
|
|
1516
1519
|
form: s.value
|
|
1517
1520
|
}, () => [
|
|
@@ -1520,17 +1523,17 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1520
1523
|
onClick: Fe
|
|
1521
1524
|
}, {
|
|
1522
1525
|
default: S(() => [...i[1] || (i[1] = [
|
|
1523
|
-
|
|
1526
|
+
j("重置", -1)
|
|
1524
1527
|
])]),
|
|
1525
1528
|
_: 1
|
|
1526
1529
|
}),
|
|
1527
1530
|
U(le, {
|
|
1528
1531
|
type: "primary",
|
|
1529
1532
|
class: "common-search__submit",
|
|
1530
|
-
onClick:
|
|
1533
|
+
onClick: E
|
|
1531
1534
|
}, {
|
|
1532
1535
|
default: S(() => [...i[2] || (i[2] = [
|
|
1533
|
-
|
|
1536
|
+
j(" 搜索 ", -1)
|
|
1534
1537
|
])]),
|
|
1535
1538
|
_: 1
|
|
1536
1539
|
})
|
|
@@ -1542,18 +1545,18 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1542
1545
|
onClick: at
|
|
1543
1546
|
}, {
|
|
1544
1547
|
default: S(() => [
|
|
1545
|
-
|
|
1548
|
+
j(T(L.value ? "收起" : "展开") + " ", 1),
|
|
1546
1549
|
U(O, { class: "el-icon--right" }, {
|
|
1547
1550
|
default: S(() => [
|
|
1548
|
-
|
|
1551
|
+
L.value ? (u(), P(ne(ft), { key: 0 })) : (u(), P(ne(ht), { key: 1 }))
|
|
1549
1552
|
]),
|
|
1550
1553
|
_: 1
|
|
1551
1554
|
})
|
|
1552
1555
|
]),
|
|
1553
1556
|
_: 1
|
|
1554
|
-
})) :
|
|
1557
|
+
})) : V("", !0)
|
|
1555
1558
|
])
|
|
1556
|
-
])) :
|
|
1559
|
+
])) : V("", !0)
|
|
1557
1560
|
], 64))), 128))
|
|
1558
1561
|
], 4)
|
|
1559
1562
|
])
|
|
@@ -1562,7 +1565,7 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1562
1565
|
]);
|
|
1563
1566
|
};
|
|
1564
1567
|
}
|
|
1565
|
-
}),
|
|
1568
|
+
}), Fn = /* @__PURE__ */ G(Sn, [["__scopeId", "data-v-006c1ace"]]), $n = {
|
|
1566
1569
|
name: "MgOverflowHid",
|
|
1567
1570
|
props: {
|
|
1568
1571
|
label: String,
|
|
@@ -1585,10 +1588,10 @@ const mn = /* @__PURE__ */ G(sn, [["render", hn], ["__scopeId", "data-v-a13d2c98
|
|
|
1585
1588
|
return n && n.length > t && (n = n.slice(0, t) + "..."), n;
|
|
1586
1589
|
}
|
|
1587
1590
|
}
|
|
1588
|
-
},
|
|
1589
|
-
function
|
|
1591
|
+
}, Ln = { class: "tableOverflowHid" }, Nn = ["innerHTML"], Mn = { class: "name-wrapper" }, Pn = ["innerHTML"], Tn = { key: 1 }, Rn = ["innerHTML"];
|
|
1592
|
+
function Bn(e, t, n, r, s, o) {
|
|
1590
1593
|
const m = F("el-popover");
|
|
1591
|
-
return u(), b("div",
|
|
1594
|
+
return u(), b("div", Ln, [
|
|
1592
1595
|
n.value && n.value.length > n.maxLength ? (u(), P(m, {
|
|
1593
1596
|
key: 0,
|
|
1594
1597
|
trigger: "hover",
|
|
@@ -1596,54 +1599,54 @@ function Tn(e, t, n, r, s, o) {
|
|
|
1596
1599
|
width: "400"
|
|
1597
1600
|
}, {
|
|
1598
1601
|
reference: S(() => [
|
|
1599
|
-
w("div",
|
|
1602
|
+
w("div", Mn, [
|
|
1600
1603
|
ee(w("span", {
|
|
1601
|
-
class:
|
|
1604
|
+
class: H(n.labelClassName)
|
|
1602
1605
|
}, T(n.label) + ":", 3), [
|
|
1603
1606
|
[te, n.label]
|
|
1604
1607
|
]),
|
|
1605
1608
|
w("span", {
|
|
1606
|
-
class:
|
|
1609
|
+
class: H(n.valueClassName),
|
|
1607
1610
|
innerHTML: o.cutString(n.value, n.maxLength)
|
|
1608
|
-
}, null, 10,
|
|
1611
|
+
}, null, 10, Pn)
|
|
1609
1612
|
])
|
|
1610
1613
|
]),
|
|
1611
1614
|
default: S(() => [
|
|
1612
1615
|
ee(w("span", {
|
|
1613
|
-
class:
|
|
1616
|
+
class: H(n.labelClassName)
|
|
1614
1617
|
}, T(n.label) + ":", 3), [
|
|
1615
1618
|
[te, n.label]
|
|
1616
1619
|
]),
|
|
1617
|
-
w("span", { innerHTML: n.value }, null, 8,
|
|
1620
|
+
w("span", { innerHTML: n.value }, null, 8, Nn)
|
|
1618
1621
|
]),
|
|
1619
1622
|
_: 1
|
|
1620
|
-
})) : (u(), b("div",
|
|
1623
|
+
})) : (u(), b("div", Tn, [
|
|
1621
1624
|
ee(w("span", {
|
|
1622
|
-
class:
|
|
1625
|
+
class: H(n.labelClassName)
|
|
1623
1626
|
}, T(n.label) + ":", 3), [
|
|
1624
1627
|
[te, n.label]
|
|
1625
1628
|
]),
|
|
1626
1629
|
w("span", {
|
|
1627
|
-
class:
|
|
1630
|
+
class: H([n.valueClassName, "value"])
|
|
1628
1631
|
}, [
|
|
1629
|
-
w("span", { innerHTML: n.value }, null, 8,
|
|
1632
|
+
w("span", { innerHTML: n.value }, null, 8, Rn)
|
|
1630
1633
|
], 2)
|
|
1631
1634
|
]))
|
|
1632
1635
|
]);
|
|
1633
1636
|
}
|
|
1634
|
-
const Xe = /* @__PURE__ */ G(
|
|
1637
|
+
const Xe = /* @__PURE__ */ G($n, [["render", Bn], ["__scopeId", "data-v-ef86ea54"]]), Vn = { class: "common-table__main" }, Dn = { key: 0 }, On = { key: 1 }, In = {
|
|
1635
1638
|
key: 2,
|
|
1636
1639
|
class: "price-text"
|
|
1637
|
-
},
|
|
1640
|
+
}, An = {
|
|
1638
1641
|
key: 3,
|
|
1639
1642
|
class: "rate-text"
|
|
1640
|
-
},
|
|
1643
|
+
}, Hn = {
|
|
1641
1644
|
key: 4,
|
|
1642
1645
|
class: "bold-text"
|
|
1643
|
-
},
|
|
1646
|
+
}, zn = {
|
|
1644
1647
|
key: 0,
|
|
1645
1648
|
class: "common-table__pagination"
|
|
1646
|
-
},
|
|
1649
|
+
}, En = /* @__PURE__ */ Object.assign({ name: "MgDataTable" }, {
|
|
1647
1650
|
__name: "DataTable",
|
|
1648
1651
|
props: {
|
|
1649
1652
|
/** 列配置:el-table-column 属性 + slotName */
|
|
@@ -1726,9 +1729,9 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1726
1729
|
...n.tableBind
|
|
1727
1730
|
}));
|
|
1728
1731
|
function m(p) {
|
|
1729
|
-
const { slotName: d, headerSlotName: c, maxLength: x, ...
|
|
1732
|
+
const { slotName: d, headerSlotName: c, maxLength: x, ...N } = p || {};
|
|
1730
1733
|
return {
|
|
1731
|
-
...
|
|
1734
|
+
...N
|
|
1732
1735
|
};
|
|
1733
1736
|
}
|
|
1734
1737
|
function h(p) {
|
|
@@ -1742,24 +1745,24 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1742
1745
|
var d;
|
|
1743
1746
|
r("pageChange", { page: p, limit: (d = n.pagination) == null ? void 0 : d.limit });
|
|
1744
1747
|
}
|
|
1745
|
-
function
|
|
1748
|
+
function L(p, d, c, x) {
|
|
1746
1749
|
r("cellClick", p, d, c, x), n.canCellClick && (d == null ? void 0 : d.label) !== "操作" && window.getSelection().toString();
|
|
1747
1750
|
}
|
|
1748
1751
|
function g(p) {
|
|
1749
1752
|
r("selectionChange", p);
|
|
1750
1753
|
}
|
|
1751
1754
|
return (p, d) => {
|
|
1752
|
-
const c = F("el-table-column"), x = F("el-table"),
|
|
1755
|
+
const c = F("el-table-column"), x = F("el-table"), N = F("el-pagination");
|
|
1753
1756
|
return u(), b("div", {
|
|
1754
|
-
class:
|
|
1757
|
+
class: H(["common-table", { "is-fill-height": e.fillHeight }])
|
|
1755
1758
|
}, [
|
|
1756
|
-
w("div",
|
|
1759
|
+
w("div", Vn, [
|
|
1757
1760
|
U(x, Me({
|
|
1758
1761
|
data: e.dataList,
|
|
1759
1762
|
height: e.fillHeight ? "100%" : void 0,
|
|
1760
1763
|
class: { "common-pointer-table": e.canCellClick }
|
|
1761
1764
|
}, o.value, {
|
|
1762
|
-
onCellClick:
|
|
1765
|
+
onCellClick: L,
|
|
1763
1766
|
onSelectionChange: g
|
|
1764
1767
|
}), {
|
|
1765
1768
|
default: S(() => [
|
|
@@ -1770,7 +1773,7 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1770
1773
|
align: "center",
|
|
1771
1774
|
selectable: e.selectable,
|
|
1772
1775
|
fixed: "left"
|
|
1773
|
-
}, null, 8, ["width", "selectable"])) :
|
|
1776
|
+
}, null, 8, ["width", "selectable"])) : V("", !0),
|
|
1774
1777
|
e.showIndex ? (u(), P(c, {
|
|
1775
1778
|
key: 1,
|
|
1776
1779
|
type: "index",
|
|
@@ -1778,10 +1781,10 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1778
1781
|
width: e.indexWidth,
|
|
1779
1782
|
index: h,
|
|
1780
1783
|
align: "center"
|
|
1781
|
-
}, null, 8, ["label", "width"])) :
|
|
1782
|
-
(u(!0), b(W, null, q(e.propList, (y,
|
|
1783
|
-
key: y.prop || y.slotName ||
|
|
1784
|
-
}, { ref_for: !0 }, m(y)),
|
|
1784
|
+
}, null, 8, ["label", "width"])) : V("", !0),
|
|
1785
|
+
(u(!0), b(W, null, q(e.propList, (y, B) => (u(), P(c, Me({
|
|
1786
|
+
key: y.prop || y.slotName || B
|
|
1787
|
+
}, { ref_for: !0 }, m(y)), St({ _: 2 }, [
|
|
1785
1788
|
y.headerSlotName ? {
|
|
1786
1789
|
name: "header",
|
|
1787
1790
|
fn: S(() => [
|
|
@@ -1791,25 +1794,25 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1791
1794
|
} : void 0,
|
|
1792
1795
|
y.slotName ? {
|
|
1793
1796
|
name: "default",
|
|
1794
|
-
fn: S((
|
|
1795
|
-
y.slotName === "overtext" ? (u(), b("div",
|
|
1797
|
+
fn: S((R) => [
|
|
1798
|
+
y.slotName === "overtext" ? (u(), b("div", Dn, [
|
|
1796
1799
|
U(Xe, {
|
|
1797
|
-
value: String(
|
|
1800
|
+
value: String(R.row[y.prop] ?? ""),
|
|
1798
1801
|
"max-length": y.maxLength || 18
|
|
1799
1802
|
}, null, 8, ["value", "max-length"])
|
|
1800
|
-
])) : y.slotName === "whether" ? (u(), b("div",
|
|
1803
|
+
])) : y.slotName === "whether" ? (u(), b("div", On, [
|
|
1801
1804
|
w("span", {
|
|
1802
|
-
class:
|
|
1803
|
-
"whether-yes":
|
|
1804
|
-
"whether-no":
|
|
1805
|
+
class: H({
|
|
1806
|
+
"whether-yes": R.row[y.prop] == 1,
|
|
1807
|
+
"whether-no": R.row[y.prop] == 0
|
|
1805
1808
|
})
|
|
1806
|
-
}, T(
|
|
1807
|
-
])) : y.slotName === "price" ? (u(), b("div",
|
|
1808
|
-
row:
|
|
1809
|
-
index:
|
|
1809
|
+
}, T(R.row[y.prop] == 0 ? "否" : R.row[y.prop] == 1 ? "是" : ""), 3)
|
|
1810
|
+
])) : y.slotName === "price" ? (u(), b("div", In, T(ne(Ie)(R.row[y.prop], 2)), 1)) : y.slotName === "rate" ? (u(), b("div", An, T(ne(vt)(R.row[y.prop], 2, "toPercentText")), 1)) : y.slotName === "boldtext" ? (u(), b("div", Hn, T(R.row[y.prop]), 1)) : ae(p.$slots, y.slotName, {
|
|
1811
|
+
row: R.row,
|
|
1812
|
+
index: R.$index,
|
|
1810
1813
|
column: y
|
|
1811
1814
|
}, () => [
|
|
1812
|
-
|
|
1815
|
+
j(T(ne(bt)(R.row[y.prop])), 1)
|
|
1813
1816
|
], !0, 5)
|
|
1814
1817
|
]),
|
|
1815
1818
|
key: "1"
|
|
@@ -1820,8 +1823,8 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1820
1823
|
_: 3
|
|
1821
1824
|
}, 16, ["data", "height", "class"])
|
|
1822
1825
|
]),
|
|
1823
|
-
e.pagination ? (u(), b("div",
|
|
1824
|
-
U(
|
|
1826
|
+
e.pagination ? (u(), b("div", zn, [
|
|
1827
|
+
U(N, {
|
|
1825
1828
|
background: "",
|
|
1826
1829
|
"current-page": e.pagination.page,
|
|
1827
1830
|
"page-size": e.pagination.limit,
|
|
@@ -1831,14 +1834,14 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1831
1834
|
onSizeChange: $,
|
|
1832
1835
|
onCurrentChange: _
|
|
1833
1836
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"])
|
|
1834
|
-
])) :
|
|
1837
|
+
])) : V("", !0)
|
|
1835
1838
|
], 2);
|
|
1836
1839
|
};
|
|
1837
1840
|
}
|
|
1838
|
-
}),
|
|
1841
|
+
}), jn = /* @__PURE__ */ G(En, [["__scopeId", "data-v-bea5678b"]]), Kn = ["aria-checked", "disabled", "onClick"], Wn = { class: "segmented__label" }, Yn = {
|
|
1839
1842
|
key: 0,
|
|
1840
1843
|
class: "segmented__badge"
|
|
1841
|
-
},
|
|
1844
|
+
}, qn = {
|
|
1842
1845
|
__name: "SegmentedControl",
|
|
1843
1846
|
props: {
|
|
1844
1847
|
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
@@ -1855,7 +1858,7 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1855
1858
|
function _(c) {
|
|
1856
1859
|
return (c == null ? void 0 : c.count) != null || (c == null ? void 0 : c.badge) != null;
|
|
1857
1860
|
}
|
|
1858
|
-
function
|
|
1861
|
+
function L(c) {
|
|
1859
1862
|
return c.count != null ? c.count : c.badge;
|
|
1860
1863
|
}
|
|
1861
1864
|
function g(c, x) {
|
|
@@ -1864,15 +1867,15 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1864
1867
|
function p() {
|
|
1865
1868
|
const c = s.value;
|
|
1866
1869
|
if (!c) return;
|
|
1867
|
-
const x = n.options.findIndex((
|
|
1868
|
-
if (!
|
|
1870
|
+
const x = n.options.findIndex((R) => R.value === n.modelValue), N = o.value[x];
|
|
1871
|
+
if (!N) {
|
|
1869
1872
|
h.value = { width: "0px", transform: "translateX(0px)" };
|
|
1870
1873
|
return;
|
|
1871
1874
|
}
|
|
1872
|
-
const y = c.getBoundingClientRect(),
|
|
1875
|
+
const y = c.getBoundingClientRect(), B = N.getBoundingClientRect();
|
|
1873
1876
|
h.value = {
|
|
1874
|
-
width: `${
|
|
1875
|
-
transform: `translateX(${
|
|
1877
|
+
width: `${B.width}px`,
|
|
1878
|
+
transform: `translateX(${B.left - y.left}px)`
|
|
1876
1879
|
}, m.value = !0;
|
|
1877
1880
|
}
|
|
1878
1881
|
function d(c) {
|
|
@@ -1886,7 +1889,7 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1886
1889
|
{ deep: !0 }
|
|
1887
1890
|
), ve(async () => {
|
|
1888
1891
|
await Z(), p(), typeof ResizeObserver < "u" && s.value && ($ = new ResizeObserver(() => p()), $.observe(s.value));
|
|
1889
|
-
}),
|
|
1892
|
+
}), He(() => {
|
|
1890
1893
|
$ == null || $.disconnect(), $ = null;
|
|
1891
1894
|
}), (c, x) => (u(), b("div", {
|
|
1892
1895
|
ref_key: "rootRef",
|
|
@@ -1895,30 +1898,30 @@ const Xe = /* @__PURE__ */ G(Sn, [["render", Tn], ["__scopeId", "data-v-ef86ea54
|
|
|
1895
1898
|
role: "radiogroup"
|
|
1896
1899
|
}, [
|
|
1897
1900
|
w("div", {
|
|
1898
|
-
class:
|
|
1901
|
+
class: H(["segmented__thumb", { "is-ready": m.value }]),
|
|
1899
1902
|
style: re(h.value)
|
|
1900
1903
|
}, null, 6),
|
|
1901
|
-
(u(!0), b(W, null, q(e.options, (
|
|
1902
|
-
key: String(
|
|
1904
|
+
(u(!0), b(W, null, q(e.options, (N, y) => (u(), b("button", {
|
|
1905
|
+
key: String(N.value),
|
|
1903
1906
|
ref_for: !0,
|
|
1904
|
-
ref: (
|
|
1907
|
+
ref: (B) => g(B, y),
|
|
1905
1908
|
type: "button",
|
|
1906
|
-
class:
|
|
1909
|
+
class: H(["segmented__item", { "is-active": e.modelValue === N.value }]),
|
|
1907
1910
|
role: "radio",
|
|
1908
|
-
"aria-checked": e.modelValue ===
|
|
1909
|
-
disabled:
|
|
1910
|
-
onClick: (
|
|
1911
|
+
"aria-checked": e.modelValue === N.value,
|
|
1912
|
+
disabled: N.disabled,
|
|
1913
|
+
onClick: (B) => d(N)
|
|
1911
1914
|
}, [
|
|
1912
|
-
w("span",
|
|
1913
|
-
_(
|
|
1914
|
-
], 10,
|
|
1915
|
+
w("span", Wn, T(N.label), 1),
|
|
1916
|
+
_(N) ? (u(), b("span", Yn, T(L(N)), 1)) : V("", !0)
|
|
1917
|
+
], 10, Kn))), 128))
|
|
1915
1918
|
], 512));
|
|
1916
1919
|
}
|
|
1917
|
-
},
|
|
1918
|
-
function
|
|
1920
|
+
}, Gn = /* @__PURE__ */ G(qn, [["__scopeId", "data-v-b7b0abe9"]]);
|
|
1921
|
+
function Xn(e) {
|
|
1919
1922
|
return e == null || e === "" ? [] : Array.isArray(e) ? e.map((t) => String(t).trim()).filter(Boolean) : String(e).split(",").map((t) => t.trim()).filter(Boolean);
|
|
1920
1923
|
}
|
|
1921
|
-
function
|
|
1924
|
+
function Jn(e) {
|
|
1922
1925
|
if (!e.parentNode) {
|
|
1923
1926
|
e.style.display = "none";
|
|
1924
1927
|
return;
|
|
@@ -1930,12 +1933,12 @@ function Gn(e) {
|
|
|
1930
1933
|
e.parentNode.removeChild(e);
|
|
1931
1934
|
}
|
|
1932
1935
|
function ge(e, t, n, r = !1) {
|
|
1933
|
-
const s =
|
|
1936
|
+
const s = Xn(t.value);
|
|
1934
1937
|
if (!s.length) return;
|
|
1935
1938
|
let o = Ae(s, n);
|
|
1936
|
-
r && (o = !o), o ||
|
|
1939
|
+
r && (o = !o), o || Jn(e);
|
|
1937
1940
|
}
|
|
1938
|
-
function
|
|
1941
|
+
function Qn(e) {
|
|
1939
1942
|
e.directive("hasPermission", {
|
|
1940
1943
|
mounted(t, n) {
|
|
1941
1944
|
ge(t, n, "and");
|
|
@@ -1950,54 +1953,59 @@ function Xn(e) {
|
|
|
1950
1953
|
}
|
|
1951
1954
|
});
|
|
1952
1955
|
}
|
|
1953
|
-
const
|
|
1954
|
-
MgImageUpload:
|
|
1955
|
-
MgFileUpload:
|
|
1956
|
-
|
|
1957
|
-
|
|
1956
|
+
const Zn = {
|
|
1957
|
+
MgImageUpload: Zt,
|
|
1958
|
+
MgFileUpload: yn,
|
|
1959
|
+
MgFilePreview: _t,
|
|
1960
|
+
MgSearchForm: Fn,
|
|
1961
|
+
MgDataTable: jn,
|
|
1958
1962
|
MgDateRangePicker: Ge,
|
|
1959
|
-
MgSegmentedControl:
|
|
1963
|
+
MgSegmentedControl: Gn,
|
|
1960
1964
|
MgOverflowHid: Xe
|
|
1961
|
-
},
|
|
1962
|
-
Object.entries(
|
|
1965
|
+
}, el = (e, t = {}) => {
|
|
1966
|
+
Object.entries(Zn).forEach(([s, o]) => {
|
|
1963
1967
|
e.component(o.name || s, o);
|
|
1964
|
-
}), t.ossUrl &&
|
|
1965
|
-
const n =
|
|
1966
|
-
|
|
1967
|
-
},
|
|
1968
|
-
install:
|
|
1969
|
-
version: "1.
|
|
1968
|
+
}), t.ossUrl && $t(t.ossUrl), typeof t.getPermissions == "function" && wt(t.getPermissions), Qn(e);
|
|
1969
|
+
const n = Ct(t), r = kt(n);
|
|
1970
|
+
Ut(n), xt(r), e.config.globalProperties.$request = n, e.config.globalProperties.$api = r, e.config.globalProperties.$hasPermission = Ae;
|
|
1971
|
+
}, rl = {
|
|
1972
|
+
install: el,
|
|
1973
|
+
version: "1.2.2"
|
|
1970
1974
|
};
|
|
1971
1975
|
export {
|
|
1972
|
-
|
|
1976
|
+
jn as DataTable,
|
|
1973
1977
|
Ge as DateRangePicker,
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
+
ul as FILE_PREVIEW_ROUTE_PATH,
|
|
1979
|
+
_t as FilePreview,
|
|
1980
|
+
yn as FileUpload,
|
|
1981
|
+
Zt as ImageUpload,
|
|
1982
|
+
Fn as SearchForm,
|
|
1983
|
+
Gn as SegmentedControl,
|
|
1978
1984
|
Xe as TableOverflowHid,
|
|
1979
1985
|
Ye as aliOssMixin,
|
|
1980
|
-
|
|
1981
|
-
|
|
1986
|
+
cl as buildFilePreviewHref,
|
|
1987
|
+
dl as checkPermission,
|
|
1988
|
+
kt as createApi,
|
|
1982
1989
|
_e as createOssClient,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1990
|
+
Ct as createRequest,
|
|
1991
|
+
pl as createService,
|
|
1992
|
+
rl as default,
|
|
1986
1993
|
gt as getApi,
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1994
|
+
Ke as getOssSts,
|
|
1995
|
+
fl as getPermissionGetter,
|
|
1996
|
+
hl as getRequest,
|
|
1997
|
+
ml as getSystemId,
|
|
1998
|
+
gl as getUserId,
|
|
1992
1999
|
Ae as hasPermission,
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2000
|
+
el as install,
|
|
2001
|
+
Qn as installPermissionDirectives,
|
|
2002
|
+
yt as openFilePreview,
|
|
2003
|
+
xt as setApi,
|
|
2004
|
+
$t as setDefaultOssUrl,
|
|
2005
|
+
wt as setPermissionGetter,
|
|
2006
|
+
Ut as setRequest,
|
|
2007
|
+
yl as setSystemId,
|
|
2008
|
+
vl as setUserId,
|
|
2001
2009
|
We as uploadToOss,
|
|
2002
|
-
|
|
2010
|
+
bl as utils
|
|
2003
2011
|
};
|