mgacn-commonsdk 1.1.4 → 1.1.5
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-commonsdk.js +679 -645
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/mgacn-commonsdk.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { Plus as
|
|
2
|
-
import { ElMessage as
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import { g as
|
|
6
|
-
import { c as
|
|
7
|
-
import { resolveComponent as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
globalThis[
|
|
1
|
+
import { Plus as lt, Delete as nt, CircleCloseFilled as st, Document as at, Close as ot, CircleClose as Be, CircleCheck as it, ArrowDown as ke, ArrowUp as rt } from "@element-plus/icons-vue";
|
|
2
|
+
import { ElMessage as j, ElMessageBox as Pe } from "element-plus";
|
|
3
|
+
import ct from "cropperjs";
|
|
4
|
+
import * as Ue from "ali-oss";
|
|
5
|
+
import { g as ut, _ as G, h as Te, i as Ve, j as dt, k as pt, l as ft, m as ht, n as mt } from "./_plugin-vue_export-helper-CMKnyAmb.js";
|
|
6
|
+
import { c as Xl, o as Jl, p as Ql, b as Zl, q as en, r as tn, a as ln, s as nn, t as sn } from "./_plugin-vue_export-helper-CMKnyAmb.js";
|
|
7
|
+
import { resolveComponent as x, openBlock as c, createElementBlock as m, createElementVNode as y, toDisplayString as P, createCommentVNode as B, createTextVNode as A, Fragment as W, renderList as q, normalizeStyle as se, normalizeClass as R, createVNode as g, withCtx as k, withModifiers as ue, withDirectives as Q, vShow as Z, createBlock as F, ref as I, watch as le, onMounted as me, reactive as we, computed as Oe, nextTick as Y, onBeforeUnmount as Re, withKeys as xe, unref as te, renderSlot as ne, mergeProps as Se, createSlots as gt } from "vue";
|
|
8
|
+
const yt = Ue.default ?? Ue, De = "__MGACN_COMMONSDK_OSS_URL__";
|
|
9
|
+
function vt(e = "") {
|
|
10
|
+
globalThis[De] = String(e || "").replace(/\/$/, "");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return globalThis[
|
|
12
|
+
function Ie() {
|
|
13
|
+
return globalThis[De] || "";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function $e(e) {
|
|
16
16
|
return String(e).padStart(2, "0");
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function _t() {
|
|
19
19
|
const e = /* @__PURE__ */ new Date();
|
|
20
|
-
return `${e.getFullYear()}${
|
|
20
|
+
return `${e.getFullYear()}${$e(e.getMonth() + 1)}${$e(e.getDate())}`;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Ae(e = 10) {
|
|
23
23
|
const l = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
24
24
|
let t = "";
|
|
25
25
|
for (let s = 0; s < e; s++)
|
|
26
26
|
t += l[Math.floor(Math.random() * l.length)];
|
|
27
27
|
return t;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return `${e}/${
|
|
29
|
+
function ge(e = "portal_cms") {
|
|
30
|
+
return `${e}/${_t()}/`;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function He(e) {
|
|
33
|
+
return ut().getOssSts(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function bt(e = {}) {
|
|
36
36
|
const l = e.accessKeyId || e.AccessKeyId || e.accessKeyID || "", t = e.accessKeySecret || e.AccessKeySecret || "", s = e.securityToken || e.SecurityToken || e.stsToken || e.token || "", n = e.bucketName || e.bucket || e.BucketName || "";
|
|
37
|
-
let
|
|
38
|
-
n &&
|
|
39
|
-
const p = e.region || (
|
|
37
|
+
let i = String(e.endPoint || e.endpoint || e.EndPoint || "").replace(/^https?:\/\//i, "").replace(/\/$/, "");
|
|
38
|
+
n && i.startsWith(`${n}.`) && (i = i.slice(n.length + 1));
|
|
39
|
+
const p = e.region || (i.startsWith("oss-") ? i.replace(/\.aliyuncs\.com.*$/i, "") : ""), f = String(e.ossUrl || e.domain || e.cdnDomain || "").replace(/\/$/, ""), w = n && i ? `https://${n}.${i}` : Ie();
|
|
40
40
|
return {
|
|
41
41
|
accessKeyId: l,
|
|
42
42
|
accessKeySecret: t,
|
|
43
43
|
securityToken: s,
|
|
44
44
|
bucketName: n,
|
|
45
|
-
endPoint:
|
|
45
|
+
endPoint: i,
|
|
46
46
|
region: p,
|
|
47
|
-
ossUrl: f ||
|
|
47
|
+
ossUrl: f || w
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
const { dir: l, foldName: t, getOss: s, ossinfo: n } = e,
|
|
50
|
+
async function ye(e = {}) {
|
|
51
|
+
const { dir: l, foldName: t, getOss: s, ossinfo: n } = e, i = l || ge(t || "portal_cms"), p = n || (typeof s == "function" ? await s(i) : await He(i)), f = bt(p || {});
|
|
52
52
|
if (!f.accessKeyId || !f.accessKeySecret || !f.bucketName)
|
|
53
53
|
throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败:凭证字段不完整");
|
|
54
54
|
if (!f.securityToken)
|
|
55
55
|
throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败:缺少 securityToken");
|
|
56
|
-
const
|
|
56
|
+
const w = {
|
|
57
57
|
bucket: f.bucketName,
|
|
58
58
|
accessKeyId: f.accessKeyId,
|
|
59
59
|
accessKeySecret: f.accessKeySecret,
|
|
@@ -61,63 +61,63 @@ async function me(e = {}) {
|
|
|
61
61
|
secure: !0,
|
|
62
62
|
success_action_status: "200"
|
|
63
63
|
};
|
|
64
|
-
f.region && (
|
|
65
|
-
const v = new
|
|
66
|
-
return v.options.ossUrl = f.ossUrl ||
|
|
64
|
+
f.region && (w.region = f.region), f.endPoint && (w.endpoint = f.endPoint);
|
|
65
|
+
const v = new yt(w);
|
|
66
|
+
return v.options.ossUrl = f.ossUrl || Ie(), v.options.uploadDir = i, v;
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
69
|
-
var
|
|
70
|
-
const { client: l, file: t, dir: s, foldName: n, fileName:
|
|
68
|
+
async function ze(e = {}) {
|
|
69
|
+
var X, V;
|
|
70
|
+
const { client: l, file: t, dir: s, foldName: n, fileName: i, onProgress: p } = e;
|
|
71
71
|
if (!t)
|
|
72
72
|
throw new Error("[mgacn-commonsdk] uploadToOss 缺少 file");
|
|
73
|
-
const f = l || await
|
|
74
|
-
let v =
|
|
73
|
+
const f = l || await ye({ dir: s, foldName: n }), w = s || f.options.uploadDir || ge(n);
|
|
74
|
+
let v = i;
|
|
75
75
|
if (!v) {
|
|
76
|
-
const
|
|
77
|
-
v = `${
|
|
76
|
+
const T = t.name || "file", z = T.lastIndexOf("."), ae = z > -1 ? T.slice(z) : "";
|
|
77
|
+
v = `${w}${Ae(10)}${ae}`;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
typeof p == "function" && p(Math.min(100, Math.max(0, Math.floor(Number(
|
|
79
|
+
const U = (T) => {
|
|
80
|
+
typeof p == "function" && p(Math.min(100, Math.max(0, Math.floor(Number(T) * 100))));
|
|
81
81
|
}, L = t.size > 1 * 1024 * 1024, b = {
|
|
82
|
-
progress: async (
|
|
83
|
-
|
|
82
|
+
progress: async (T) => {
|
|
83
|
+
U(T);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
let
|
|
87
|
-
const
|
|
88
|
-
const
|
|
86
|
+
let u;
|
|
87
|
+
const d = async (T) => {
|
|
88
|
+
const z = T ? { "x-oss-object-acl": "public-read" } : void 0;
|
|
89
89
|
return L ? f.multipartUpload(v, t, {
|
|
90
90
|
...b,
|
|
91
|
-
...
|
|
91
|
+
...z ? { headers: z } : {}
|
|
92
92
|
}) : f.put(v, t, {
|
|
93
93
|
...b,
|
|
94
|
-
...
|
|
94
|
+
...z ? { headers: z } : {}
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
U(0.01), u = await d(!0);
|
|
99
99
|
} catch {
|
|
100
|
-
|
|
100
|
+
U(0.01), u = await d(!1);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
102
|
+
const S = ((X = u == null ? void 0 : u.res) == null ? void 0 : X.statusCode) ?? ((V = u == null ? void 0 : u.res) == null ? void 0 : V.status);
|
|
103
|
+
if (S && S !== 200)
|
|
104
104
|
throw new Error("[mgacn-commonsdk] 上传失败");
|
|
105
|
-
|
|
106
|
-
const $ = (f.options.ossUrl || "").replace(/\/$/, ""),
|
|
107
|
-
let
|
|
105
|
+
U(1);
|
|
106
|
+
const $ = (f.options.ossUrl || "").replace(/\/$/, ""), D = $ ? `${$}/${v}` : v;
|
|
107
|
+
let C = D;
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
C = f.signatureUrl(v, { expires: 3600 * 24 });
|
|
110
110
|
} catch {
|
|
111
111
|
}
|
|
112
112
|
return {
|
|
113
113
|
name: v,
|
|
114
|
-
url:
|
|
115
|
-
previewUrl:
|
|
116
|
-
raw:
|
|
114
|
+
url: D,
|
|
115
|
+
previewUrl: C,
|
|
116
|
+
raw: u,
|
|
117
117
|
client: f
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Ct(e = "", l = "") {
|
|
121
121
|
const t = String(e || "").trim();
|
|
122
122
|
if (!t) return "";
|
|
123
123
|
if (!/^https?:\/\//i.test(t)) return t.replace(/^\//, "");
|
|
@@ -125,16 +125,16 @@ function yt(e = "", l = "") {
|
|
|
125
125
|
const s = new URL(t);
|
|
126
126
|
let n = decodeURIComponent(s.pathname.replace(/^\//, ""));
|
|
127
127
|
if (l) {
|
|
128
|
-
const
|
|
129
|
-
t.startsWith(`${
|
|
128
|
+
const i = String(l).replace(/\/$/, "");
|
|
129
|
+
t.startsWith(`${i}/`) && (n = decodeURIComponent(t.slice(i.length + 1).split("?")[0]));
|
|
130
130
|
}
|
|
131
131
|
return n.split("?")[0];
|
|
132
132
|
} catch {
|
|
133
133
|
return "";
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
async function
|
|
137
|
-
const t = l.client || await
|
|
136
|
+
async function kt(e, l = {}) {
|
|
137
|
+
const t = l.client || await ye(l), s = Ct(e, t.options.ossUrl);
|
|
138
138
|
if (!s) return e;
|
|
139
139
|
try {
|
|
140
140
|
return t.signatureUrl(s, { expires: l.expires || 3600 * 24 });
|
|
@@ -142,53 +142,53 @@ async function vt(e, l = {}) {
|
|
|
142
142
|
return e;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
145
|
+
const je = {
|
|
146
146
|
methods: {
|
|
147
147
|
getDir() {
|
|
148
|
-
return
|
|
148
|
+
return ge(this.foldName || "portal_cms");
|
|
149
149
|
},
|
|
150
|
-
randomString:
|
|
150
|
+
randomString: Ae,
|
|
151
151
|
getOss() {
|
|
152
|
-
return
|
|
152
|
+
return He(this.getDir());
|
|
153
153
|
},
|
|
154
154
|
async createOssClient() {
|
|
155
|
-
return
|
|
155
|
+
return ye({
|
|
156
156
|
dir: this.getDir(),
|
|
157
157
|
getOss: () => this.getOss()
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
let
|
|
163
|
-
function
|
|
164
|
-
return
|
|
162
|
+
let Le = 0;
|
|
163
|
+
function Ee() {
|
|
164
|
+
return Le += 1, `mg-img-${Date.now()}-${Le}`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Ut(e) {
|
|
167
167
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Fe(e) {
|
|
170
170
|
return e.map((l) => ({
|
|
171
|
-
uid:
|
|
171
|
+
uid: Ee(),
|
|
172
172
|
url: l,
|
|
173
173
|
status: "success",
|
|
174
174
|
percent: 100,
|
|
175
175
|
previewUrl: ""
|
|
176
176
|
}));
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ce(e = "") {
|
|
179
179
|
return String(e).startsWith("blob:");
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function wt(e = "") {
|
|
182
182
|
return /[?&](Expires|Signature|OSSAccessKeyId)=/i.test(String(e));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function xt(e = "") {
|
|
185
185
|
const l = e.lastIndexOf(".");
|
|
186
186
|
return l > -1 ? e.slice(l + 1).toLowerCase() : "";
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const St = {
|
|
189
189
|
name: "MgImageUpload",
|
|
190
|
-
mixins: [
|
|
191
|
-
components: { CircleCloseFilled:
|
|
190
|
+
mixins: [je],
|
|
191
|
+
components: { CircleCloseFilled: st, Delete: nt, Plus: lt },
|
|
192
192
|
props: {
|
|
193
193
|
/** v-model 统一为 string[];入参兼容 string / string[] */
|
|
194
194
|
modelValue: { type: [Array, String], default: () => [] },
|
|
@@ -253,20 +253,20 @@ const kt = {
|
|
|
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(Fe(e)), this.ensureSignedPreviews());
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
modelValue: {
|
|
260
260
|
immediate: !0,
|
|
261
261
|
handler(e) {
|
|
262
|
-
var
|
|
263
|
-
if ((
|
|
264
|
-
const l =
|
|
262
|
+
var i;
|
|
263
|
+
if ((i = this.initFileList) != null && i.length) return;
|
|
264
|
+
const l = Ut(e), t = this.successUrls;
|
|
265
265
|
if (l.length === t.length && l.every((p, f) => p === t[f]))
|
|
266
266
|
return;
|
|
267
267
|
const s = new Map(
|
|
268
268
|
this.fileList.map((p) => [p.url, p.previewUrl]).filter(([p]) => p)
|
|
269
|
-
), n =
|
|
269
|
+
), n = Fe(l).map((p) => ({
|
|
270
270
|
...p,
|
|
271
271
|
previewUrl: s.get(p.url) || ""
|
|
272
272
|
}));
|
|
@@ -288,28 +288,28 @@ const kt = {
|
|
|
288
288
|
replaceList(e) {
|
|
289
289
|
const l = new Set(e.map((t) => t.previewUrl).filter(Boolean));
|
|
290
290
|
this.fileList.forEach((t) => {
|
|
291
|
-
|
|
291
|
+
ce(t.previewUrl) && !l.has(t.previewUrl) && URL.revokeObjectURL(t.previewUrl);
|
|
292
292
|
}), this.fileList = e;
|
|
293
293
|
},
|
|
294
294
|
revokePreview(e) {
|
|
295
|
-
|
|
295
|
+
ce(e == null ? void 0 : e.previewUrl) && URL.revokeObjectURL(e.previewUrl);
|
|
296
296
|
},
|
|
297
297
|
revokeAllPreviews() {
|
|
298
298
|
this.fileList.forEach((e) => {
|
|
299
|
-
|
|
299
|
+
ce(e.previewUrl) && URL.revokeObjectURL(e.previewUrl);
|
|
300
300
|
});
|
|
301
301
|
},
|
|
302
302
|
/** 私有桶回显:给已有 url 补签名预览 */
|
|
303
303
|
async ensureSignedPreviews() {
|
|
304
304
|
const e = this.fileList.filter(
|
|
305
|
-
(l) => l.status === "success" && l.url && !
|
|
305
|
+
(l) => l.status === "success" && l.url && !ce(l.previewUrl) && !wt(l.previewUrl || l.url)
|
|
306
306
|
);
|
|
307
307
|
if (e.length)
|
|
308
308
|
try {
|
|
309
309
|
const l = await this.createOssClient();
|
|
310
310
|
await Promise.all(
|
|
311
311
|
e.map(async (t) => {
|
|
312
|
-
const s = await
|
|
312
|
+
const s = await kt(t.url, { client: l });
|
|
313
313
|
s && (t.previewUrl = s);
|
|
314
314
|
})
|
|
315
315
|
);
|
|
@@ -346,7 +346,7 @@ const kt = {
|
|
|
346
346
|
handleUpload() {
|
|
347
347
|
if (!this.disabled) {
|
|
348
348
|
if (this.fileList.length >= this.fileNum) {
|
|
349
|
-
|
|
349
|
+
j.error(`文件数量不超过${this.fileNum}`);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
this.openFilePicker();
|
|
@@ -357,16 +357,16 @@ const kt = {
|
|
|
357
357
|
if (!l.length) return;
|
|
358
358
|
const t = this.dialogVisible || this.isCropper, s = this.fileNum - this.fileList.length;
|
|
359
359
|
if (!t && l.length > s) {
|
|
360
|
-
|
|
360
|
+
j.error(`文件数量不超过${this.fileNum}个`);
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
|
-
const n = [],
|
|
363
|
+
const n = [], i = [];
|
|
364
364
|
if (l.forEach((p) => {
|
|
365
|
-
this.acceptList.includes(
|
|
366
|
-
}),
|
|
367
|
-
const p =
|
|
368
|
-
|
|
369
|
-
`已过滤以下 ${
|
|
365
|
+
this.acceptList.includes(xt(p.name)) ? n.push(p) : i.push(p);
|
|
366
|
+
}), i.length) {
|
|
367
|
+
const p = i.map((f) => f.name).join(",");
|
|
368
|
+
Pe.confirm(
|
|
369
|
+
`已过滤以下 ${i.length} 个不符合要求的文件:<br/><p style="color:#f56c6c;font-size:12px;">${p}</p><br/>只接受:${this.acceptList.join("/")}`,
|
|
370
370
|
"提示",
|
|
371
371
|
{
|
|
372
372
|
confirmButtonText: "确认",
|
|
@@ -406,18 +406,18 @@ const kt = {
|
|
|
406
406
|
const l = this.maxFileSize * 1024 * 1024, t = [];
|
|
407
407
|
return e.forEach((s) => {
|
|
408
408
|
if (s.size > l) {
|
|
409
|
-
|
|
409
|
+
j.error(`「${s.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
|
-
const n = URL.createObjectURL(s),
|
|
413
|
-
uid:
|
|
412
|
+
const n = URL.createObjectURL(s), i = {
|
|
413
|
+
uid: Ee(),
|
|
414
414
|
url: n,
|
|
415
415
|
previewUrl: n,
|
|
416
416
|
status: "uploading",
|
|
417
417
|
percent: 0,
|
|
418
418
|
raw: s
|
|
419
419
|
};
|
|
420
|
-
this.fileList.push(
|
|
420
|
+
this.fileList.push(i), t.push(this.uploadOne(i));
|
|
421
421
|
}), Promise.all(t);
|
|
422
422
|
},
|
|
423
423
|
async uploadOne(e) {
|
|
@@ -428,19 +428,19 @@ const kt = {
|
|
|
428
428
|
this.activeUploadCount += 1, this.$emit("update:uploading", !0);
|
|
429
429
|
try {
|
|
430
430
|
t(0);
|
|
431
|
-
const s = await
|
|
431
|
+
const s = await ze({
|
|
432
432
|
file: e.raw,
|
|
433
433
|
dir: this.getDir(),
|
|
434
434
|
onProgress: t
|
|
435
435
|
});
|
|
436
436
|
e.url = s.url, e.previewUrl = l || s.previewUrl || s.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", s, e);
|
|
437
437
|
} catch (s) {
|
|
438
|
-
e.status = "fail", t(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0),
|
|
438
|
+
e.status = "fail", t(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), j.error((s == null ? void 0 : s.message) || "上传失败"), this.$emit("error", s, e);
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
initCropper() {
|
|
442
442
|
const e = this.$refs.cropImage;
|
|
443
|
-
!e || !this.cropImageUrl || (this.destroyCropper(), this.cropper = new
|
|
443
|
+
!e || !this.cropImageUrl || (this.destroyCropper(), this.cropper = new ct(e, {
|
|
444
444
|
aspectRatio: this.aspectRatio,
|
|
445
445
|
autoCropArea: 0.8,
|
|
446
446
|
viewMode: 1,
|
|
@@ -464,7 +464,7 @@ const kt = {
|
|
|
464
464
|
},
|
|
465
465
|
confirmCrop() {
|
|
466
466
|
if (this.uploadingCount) {
|
|
467
|
-
|
|
467
|
+
j.error("上传中,请稍后!");
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
if (!this.cropper) return;
|
|
@@ -472,8 +472,8 @@ const kt = {
|
|
|
472
472
|
this.handleBack(), this.$nextTick(() => this.startUpload([l]));
|
|
473
473
|
},
|
|
474
474
|
base64ToFile(e) {
|
|
475
|
-
const [l, t] = e.split(","), s = l.match(/:(.*?);/)[1], n = s.split("/")[1],
|
|
476
|
-
for (let f = 0; f <
|
|
475
|
+
const [l, t] = e.split(","), s = l.match(/:(.*?);/)[1], n = s.split("/")[1], i = atob(t), p = new Uint8Array(i.length);
|
|
476
|
+
for (let f = 0; f < i.length; f++) p[f] = i.charCodeAt(f);
|
|
477
477
|
return new File([p], `${Date.now()}.${n}`, { type: s });
|
|
478
478
|
},
|
|
479
479
|
handleBack() {
|
|
@@ -484,217 +484,217 @@ const kt = {
|
|
|
484
484
|
!l || l.status === "uploading" || (this.revokePreview(l), this.fileList.splice(e, 1), this.emitFile());
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
},
|
|
487
|
+
}, $t = { class: "upload-image-cropper" }, Lt = ["multiple", "accept"], Ft = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "grey-tips"
|
|
490
|
-
},
|
|
490
|
+
}, Nt = { key: 0 }, Mt = { class: "list-box" }, Bt = {
|
|
491
491
|
key: 0,
|
|
492
492
|
class: "status-mask is-uploading"
|
|
493
|
-
},
|
|
493
|
+
}, Pt = { class: "progress-wrap" }, Tt = { class: "percent-text" }, Vt = {
|
|
494
494
|
key: 1,
|
|
495
495
|
class: "status-mask is-fail"
|
|
496
|
-
},
|
|
496
|
+
}, Ot = ["onClick"], Rt = { class: "cropper-box" }, Dt = ["src"], It = {
|
|
497
497
|
key: 0,
|
|
498
498
|
class: "cropper-placeholder"
|
|
499
|
-
},
|
|
499
|
+
}, At = {
|
|
500
500
|
key: 0,
|
|
501
501
|
class: "btn-box btn-box--rotate"
|
|
502
|
-
},
|
|
503
|
-
function
|
|
504
|
-
const p =
|
|
505
|
-
return
|
|
506
|
-
|
|
502
|
+
}, Ht = { class: "btn-box" };
|
|
503
|
+
function zt(e, l, t, s, n, i) {
|
|
504
|
+
const p = x("el-image"), f = x("el-progress"), w = x("CircleCloseFilled"), v = x("el-icon"), U = x("Delete"), L = x("Plus"), b = x("el-button"), u = x("el-dialog");
|
|
505
|
+
return c(), m("div", $t, [
|
|
506
|
+
y("input", {
|
|
507
507
|
ref: "fileInput",
|
|
508
508
|
type: "file",
|
|
509
509
|
class: "file-input",
|
|
510
|
-
multiple:
|
|
510
|
+
multiple: i.multiple,
|
|
511
511
|
accept: t.accept,
|
|
512
|
-
onChange: l[0] || (l[0] = (...
|
|
513
|
-
}, null, 40,
|
|
514
|
-
t.greyTips ? (
|
|
515
|
-
t.otherTips ? (
|
|
516
|
-
|
|
517
|
-
])) :
|
|
518
|
-
|
|
519
|
-
(
|
|
520
|
-
key:
|
|
521
|
-
class:
|
|
512
|
+
onChange: l[0] || (l[0] = (...d) => i.onFileChange && i.onFileChange(...d))
|
|
513
|
+
}, null, 40, Lt),
|
|
514
|
+
t.greyTips ? (c(), m("div", Ft, [
|
|
515
|
+
t.otherTips ? (c(), m("div", Nt, P(t.otherTips), 1)) : B("", !0),
|
|
516
|
+
A(" " + P(t.greyTips), 1)
|
|
517
|
+
])) : B("", !0),
|
|
518
|
+
y("div", Mt, [
|
|
519
|
+
(c(!0), m(W, null, q(n.fileList, (d, S) => (c(), m("div", {
|
|
520
|
+
key: d.uid,
|
|
521
|
+
class: R(["image-box", [`is-${d.status}`]]),
|
|
522
522
|
style: se(t.imageStyle)
|
|
523
523
|
}, [
|
|
524
|
-
|
|
525
|
-
src:
|
|
524
|
+
g(p, {
|
|
525
|
+
src: d.previewUrl || d.url,
|
|
526
526
|
fit: "cover",
|
|
527
527
|
class: "img"
|
|
528
528
|
}, null, 8, ["src"]),
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
d.status === "uploading" ? (c(), m("div", Bt, [
|
|
530
|
+
y("div", Pt, [
|
|
531
|
+
g(f, {
|
|
532
532
|
type: "circle",
|
|
533
|
-
percentage:
|
|
533
|
+
percentage: d.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
|
+
y("span", Tt, P(d.percent) + "%", 1)
|
|
540
540
|
])
|
|
541
|
-
])) :
|
|
542
|
-
|
|
541
|
+
])) : d.status === "fail" ? (c(), m("div", Vt, [
|
|
542
|
+
g(v, {
|
|
543
543
|
class: "fail-icon",
|
|
544
544
|
size: 16
|
|
545
545
|
}, {
|
|
546
|
-
default:
|
|
547
|
-
|
|
546
|
+
default: k(() => [
|
|
547
|
+
g(w)
|
|
548
548
|
]),
|
|
549
549
|
_: 1
|
|
550
550
|
}),
|
|
551
|
-
l[5] || (l[5] =
|
|
552
|
-
|
|
551
|
+
l[5] || (l[5] = y("span", { class: "fail-text" }, "失败", -1)),
|
|
552
|
+
g(v, {
|
|
553
553
|
class: "remove-icon",
|
|
554
554
|
size: 14,
|
|
555
555
|
title: "删除",
|
|
556
|
-
onClick:
|
|
556
|
+
onClick: ue(($) => i.removeImg(S), ["stop"])
|
|
557
557
|
}, {
|
|
558
|
-
default:
|
|
559
|
-
|
|
558
|
+
default: k(() => [
|
|
559
|
+
g(U)
|
|
560
560
|
]),
|
|
561
561
|
_: 1
|
|
562
562
|
}, 8, ["onClick"])
|
|
563
|
-
])) : (
|
|
563
|
+
])) : (c(), m("div", {
|
|
564
564
|
key: 2,
|
|
565
565
|
class: "status-mask is-success",
|
|
566
|
-
onClick: ($) =>
|
|
566
|
+
onClick: ($) => i.removeImg(S)
|
|
567
567
|
}, [
|
|
568
|
-
|
|
568
|
+
g(v, {
|
|
569
569
|
class: "remove-icon",
|
|
570
570
|
size: 16
|
|
571
571
|
}, {
|
|
572
|
-
default:
|
|
573
|
-
|
|
572
|
+
default: k(() => [
|
|
573
|
+
g(U)
|
|
574
574
|
]),
|
|
575
575
|
_: 1
|
|
576
576
|
})
|
|
577
|
-
], 8,
|
|
577
|
+
], 8, Ot))
|
|
578
578
|
], 6))), 128)),
|
|
579
|
-
|
|
579
|
+
Q(y("div", {
|
|
580
580
|
class: "image-box upload-btn",
|
|
581
581
|
style: se(t.imageStyle),
|
|
582
|
-
onClick: l[1] || (l[1] = (...
|
|
582
|
+
onClick: l[1] || (l[1] = (...d) => i.handleUpload && i.handleUpload(...d))
|
|
583
583
|
}, [
|
|
584
|
-
|
|
584
|
+
g(v, {
|
|
585
585
|
class: "icon",
|
|
586
586
|
size: 14
|
|
587
587
|
}, {
|
|
588
|
-
default:
|
|
589
|
-
|
|
588
|
+
default: k(() => [
|
|
589
|
+
g(L)
|
|
590
590
|
]),
|
|
591
591
|
_: 1
|
|
592
592
|
}),
|
|
593
|
-
l[6] || (l[6] =
|
|
593
|
+
l[6] || (l[6] = y("div", null, "上传图片", -1))
|
|
594
594
|
], 4), [
|
|
595
|
-
[
|
|
595
|
+
[Z, i.showUploadBtn]
|
|
596
596
|
])
|
|
597
597
|
]),
|
|
598
|
-
|
|
598
|
+
g(u, {
|
|
599
599
|
modelValue: n.dialogVisible,
|
|
600
|
-
"onUpdate:modelValue": l[4] || (l[4] = (
|
|
600
|
+
"onUpdate:modelValue": l[4] || (l[4] = (d) => n.dialogVisible = d),
|
|
601
601
|
title: "裁剪图片",
|
|
602
602
|
width: "650px",
|
|
603
603
|
top: "5vh",
|
|
604
604
|
"append-to-body": "",
|
|
605
605
|
class: "mg-image-upload-dialog",
|
|
606
606
|
"close-on-click-modal": !1,
|
|
607
|
-
onClose:
|
|
607
|
+
onClose: i.handleBack
|
|
608
608
|
}, {
|
|
609
|
-
footer:
|
|
610
|
-
t.isDegree ? (
|
|
611
|
-
|
|
612
|
-
onClick: l[2] || (l[2] = (
|
|
609
|
+
footer: k(() => [
|
|
610
|
+
t.isDegree ? (c(), m("div", At, [
|
|
611
|
+
g(b, {
|
|
612
|
+
onClick: l[2] || (l[2] = (d) => i.rotate(-t.degree))
|
|
613
613
|
}, {
|
|
614
|
-
default:
|
|
615
|
-
|
|
614
|
+
default: k(() => [...l[7] || (l[7] = [
|
|
615
|
+
A("向左旋转", -1)
|
|
616
616
|
])]),
|
|
617
617
|
_: 1
|
|
618
618
|
}),
|
|
619
|
-
|
|
620
|
-
onClick: l[3] || (l[3] = (
|
|
619
|
+
g(b, {
|
|
620
|
+
onClick: l[3] || (l[3] = (d) => i.rotate(t.degree))
|
|
621
621
|
}, {
|
|
622
|
-
default:
|
|
623
|
-
|
|
622
|
+
default: k(() => [...l[8] || (l[8] = [
|
|
623
|
+
A("向右旋转", -1)
|
|
624
624
|
])]),
|
|
625
625
|
_: 1
|
|
626
626
|
})
|
|
627
|
-
])) :
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
])) : B("", !0),
|
|
628
|
+
y("div", Ht, [
|
|
629
|
+
g(b, {
|
|
630
630
|
type: "primary",
|
|
631
|
-
onClick:
|
|
631
|
+
onClick: i.openFilePicker
|
|
632
632
|
}, {
|
|
633
|
-
default:
|
|
634
|
-
|
|
633
|
+
default: k(() => [
|
|
634
|
+
A(P(n.cropImageUrl ? "重新上传" : "点击上传"), 1)
|
|
635
635
|
]),
|
|
636
636
|
_: 1
|
|
637
637
|
}, 8, ["onClick"]),
|
|
638
|
-
|
|
638
|
+
g(b, {
|
|
639
639
|
type: "primary",
|
|
640
|
-
onClick:
|
|
640
|
+
onClick: i.confirmCrop
|
|
641
641
|
}, {
|
|
642
|
-
default:
|
|
643
|
-
|
|
642
|
+
default: k(() => [...l[9] || (l[9] = [
|
|
643
|
+
A("确定", -1)
|
|
644
644
|
])]),
|
|
645
645
|
_: 1
|
|
646
646
|
}, 8, ["onClick"])
|
|
647
647
|
])
|
|
648
648
|
]),
|
|
649
|
-
default:
|
|
650
|
-
|
|
651
|
-
|
|
649
|
+
default: k(() => [
|
|
650
|
+
y("div", Rt, [
|
|
651
|
+
Q(y("img", {
|
|
652
652
|
ref: "cropImage",
|
|
653
653
|
src: n.cropImageUrl,
|
|
654
654
|
class: "cropper-img"
|
|
655
|
-
}, null, 8,
|
|
656
|
-
[
|
|
655
|
+
}, null, 8, Dt), [
|
|
656
|
+
[Z, n.cropImageUrl]
|
|
657
657
|
]),
|
|
658
|
-
n.cropImageUrl ?
|
|
658
|
+
n.cropImageUrl ? B("", !0) : (c(), m("div", It, "请选择图片后进行裁剪"))
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
_: 1
|
|
662
662
|
}, 8, ["modelValue", "onClose"])
|
|
663
663
|
]);
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
let
|
|
667
|
-
function
|
|
668
|
-
return
|
|
665
|
+
const jt = /* @__PURE__ */ G(St, [["render", zt], ["__scopeId", "data-v-68531340"]]), Et = ".mp4,.mov,.jpg,.jpeg,.m3u8,.png,.m4v,.doc,.docx,.xls,.xlsx,.pdf";
|
|
666
|
+
let Ne = 0;
|
|
667
|
+
function Ke() {
|
|
668
|
+
return Ne += 1, `mg-file-${Date.now()}-${Ne}`;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Kt(e) {
|
|
671
671
|
return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Ye(e = "") {
|
|
674
674
|
try {
|
|
675
675
|
return decodeURIComponent(String(e).split("?")[0]).split("/").filter(Boolean).pop() || "file";
|
|
676
676
|
} catch {
|
|
677
677
|
return "file";
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Me(e) {
|
|
681
681
|
return e.map((l) => ({
|
|
682
|
-
uid:
|
|
683
|
-
name:
|
|
682
|
+
uid: Ke(),
|
|
683
|
+
name: Ye(l),
|
|
684
684
|
url: l,
|
|
685
685
|
status: "success",
|
|
686
686
|
percent: 100,
|
|
687
687
|
raw: null
|
|
688
688
|
}));
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Yt(e = "") {
|
|
691
691
|
const l = e.lastIndexOf(".");
|
|
692
692
|
return l > -1 ? e.slice(l + 1).toLowerCase() : "";
|
|
693
693
|
}
|
|
694
|
-
const
|
|
694
|
+
const Wt = {
|
|
695
695
|
name: "MgFileUpload",
|
|
696
|
-
mixins: [
|
|
697
|
-
components: { CircleCheck:
|
|
696
|
+
mixins: [je],
|
|
697
|
+
components: { CircleCheck: it, CircleClose: Be, Close: ot, Document: at },
|
|
698
698
|
props: {
|
|
699
699
|
/** v-model 统一为 string[];入参兼容 string / string[] */
|
|
700
700
|
modelValue: { type: [Array, String], default: () => [] },
|
|
@@ -707,7 +707,7 @@ const Et = {
|
|
|
707
707
|
initFileList: { type: Array, default: () => [] },
|
|
708
708
|
/** 选满后是否清空再传 */
|
|
709
709
|
resetFilelist: Boolean,
|
|
710
|
-
accept: { type: String, default:
|
|
710
|
+
accept: { type: String, default: Et },
|
|
711
711
|
foldName: { type: String, default: "portal_cms" },
|
|
712
712
|
disabled: Boolean,
|
|
713
713
|
buttonText: { type: String, default: "点击上传" },
|
|
@@ -757,7 +757,7 @@ const Et = {
|
|
|
757
757
|
deep: !0,
|
|
758
758
|
immediate: !0,
|
|
759
759
|
handler(e) {
|
|
760
|
-
e != null && e.length && (this.fileList =
|
|
760
|
+
e != null && e.length && (this.fileList = Me(e));
|
|
761
761
|
}
|
|
762
762
|
},
|
|
763
763
|
modelValue: {
|
|
@@ -765,8 +765,8 @@ const Et = {
|
|
|
765
765
|
handler(e) {
|
|
766
766
|
var s;
|
|
767
767
|
if ((s = this.initFileList) != null && s.length) return;
|
|
768
|
-
const l =
|
|
769
|
-
l.length === t.length && l.every((n,
|
|
768
|
+
const l = Kt(e), t = this.successUrls;
|
|
769
|
+
l.length === t.length && l.every((n, i) => n === t[i]) || (this.fileList = Me(l));
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
},
|
|
@@ -785,7 +785,7 @@ const Et = {
|
|
|
785
785
|
handleUpload() {
|
|
786
786
|
if (!this.disabled) {
|
|
787
787
|
if (this.fileList.length >= this.fileNum) {
|
|
788
|
-
|
|
788
|
+
j.error(`文件数量不超过${this.fileNum}`);
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
791
|
this.openFilePicker();
|
|
@@ -800,16 +800,16 @@ const Et = {
|
|
|
800
800
|
if (!l.length || this.disabled) return;
|
|
801
801
|
const t = this.fileNum - this.fileList.length;
|
|
802
802
|
if (l.length > t && !(this.resetFilelist || this.fileNum === 1)) {
|
|
803
|
-
|
|
803
|
+
j.error(`文件数量不超过${this.fileNum}个`);
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
806
806
|
const s = [], n = [];
|
|
807
|
-
if (l.forEach((
|
|
808
|
-
this.acceptList.includes(
|
|
807
|
+
if (l.forEach((i) => {
|
|
808
|
+
this.acceptList.includes(Yt(i.name)) ? s.push(i) : n.push(i);
|
|
809
809
|
}), n.length) {
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
`已过滤以下 ${n.length} 个不符合要求的文件:<br/><p style="color:#f56c6c;font-size:12px;">${
|
|
810
|
+
const i = n.map((p) => p.name).join(",");
|
|
811
|
+
Pe.confirm(
|
|
812
|
+
`已过滤以下 ${n.length} 个不符合要求的文件:<br/><p style="color:#f56c6c;font-size:12px;">${i}</p><br/>只接受:${this.acceptList.join("/")}`,
|
|
813
813
|
"提示",
|
|
814
814
|
{
|
|
815
815
|
confirmButtonText: "确认",
|
|
@@ -827,11 +827,11 @@ const Et = {
|
|
|
827
827
|
const l = this.maxFileSize * 1024 * 1024, t = [];
|
|
828
828
|
return e.forEach((s) => {
|
|
829
829
|
if (s.size > l) {
|
|
830
|
-
|
|
830
|
+
j.error(`「${s.name}」超出 ${this.maxFileSize}MB 限制`);
|
|
831
831
|
return;
|
|
832
832
|
}
|
|
833
833
|
const n = {
|
|
834
|
-
uid:
|
|
834
|
+
uid: Ke(),
|
|
835
835
|
name: s.name,
|
|
836
836
|
url: "",
|
|
837
837
|
status: "uploading",
|
|
@@ -849,14 +849,14 @@ const Et = {
|
|
|
849
849
|
this.activeUploadCount += 1, this.$emit("update:uploading", !0);
|
|
850
850
|
try {
|
|
851
851
|
l(0);
|
|
852
|
-
const t = await
|
|
852
|
+
const t = await ze({
|
|
853
853
|
file: e.raw,
|
|
854
854
|
dir: this.getDir(),
|
|
855
855
|
onProgress: l
|
|
856
856
|
});
|
|
857
|
-
e.url = t.url, e.name = e.name ||
|
|
857
|
+
e.url = t.url, e.name = e.name || Ye(t.url), e.status = "success", l(100), e.raw = null, this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), this.emitFile(), this.$emit("success", t, e);
|
|
858
858
|
} catch (t) {
|
|
859
|
-
e.status = "fail", l(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0),
|
|
859
|
+
e.status = "fail", l(0), this.activeUploadCount = Math.max(0, this.activeUploadCount - 1), this.$emit("update:uploading", this.activeUploadCount > 0), j.error((t == null ? void 0 : t.message) || "上传失败"), this.$emit("error", t, e);
|
|
860
860
|
}
|
|
861
861
|
},
|
|
862
862
|
onFileClick(e) {
|
|
@@ -867,102 +867,102 @@ const Et = {
|
|
|
867
867
|
!l || l.status === "uploading" || (this.fileList.splice(e, 1), this.emitFile());
|
|
868
868
|
}
|
|
869
869
|
}
|
|
870
|
-
},
|
|
870
|
+
}, qt = { class: "mg-file-upload" }, Gt = ["multiple", "accept", "disabled"], Xt = {
|
|
871
871
|
key: 1,
|
|
872
872
|
class: "el-upload__tip"
|
|
873
|
-
},
|
|
873
|
+
}, Jt = {
|
|
874
874
|
key: 2,
|
|
875
875
|
class: "el-upload-list el-upload-list--text"
|
|
876
|
-
},
|
|
877
|
-
function
|
|
878
|
-
const p =
|
|
879
|
-
return
|
|
880
|
-
|
|
876
|
+
}, Qt = { class: "el-upload-list__item-info" }, Zt = ["href", "target", "onClick"], el = { class: "el-upload-list__item-file-name" }, tl = { class: "el-upload-list__item-status-label" };
|
|
877
|
+
function ll(e, l, t, s, n, i) {
|
|
878
|
+
const p = x("el-button"), f = x("Document"), w = x("el-icon"), v = x("CircleCheck"), U = x("CircleClose"), L = x("Close"), b = x("el-progress");
|
|
879
|
+
return c(), m("div", qt, [
|
|
880
|
+
y("input", {
|
|
881
881
|
ref: "fileInput",
|
|
882
882
|
type: "file",
|
|
883
883
|
class: "file-input",
|
|
884
|
-
multiple:
|
|
884
|
+
multiple: i.multiple,
|
|
885
885
|
accept: t.accept,
|
|
886
886
|
disabled: t.disabled,
|
|
887
|
-
onChange: l[0] || (l[0] = (...
|
|
888
|
-
}, null, 40,
|
|
889
|
-
t.showButton ? (
|
|
887
|
+
onChange: l[0] || (l[0] = (...u) => i.onFileChange && i.onFileChange(...u))
|
|
888
|
+
}, null, 40, Gt),
|
|
889
|
+
t.showButton ? (c(), F(p, {
|
|
890
890
|
key: 0,
|
|
891
891
|
type: "primary",
|
|
892
|
-
disabled: t.disabled || !
|
|
893
|
-
onClick:
|
|
892
|
+
disabled: t.disabled || !i.showUploadBtn,
|
|
893
|
+
onClick: i.handleUpload
|
|
894
894
|
}, {
|
|
895
|
-
default:
|
|
896
|
-
|
|
895
|
+
default: k(() => [
|
|
896
|
+
A(P(t.buttonText), 1)
|
|
897
897
|
]),
|
|
898
898
|
_: 1
|
|
899
|
-
}, 8, ["disabled", "onClick"])) :
|
|
900
|
-
|
|
901
|
-
t.showFileList ? (
|
|
902
|
-
(
|
|
903
|
-
key:
|
|
904
|
-
class:
|
|
899
|
+
}, 8, ["disabled", "onClick"])) : B("", !0),
|
|
900
|
+
i.tipText ? (c(), m("div", Xt, P(i.tipText), 1)) : B("", !0),
|
|
901
|
+
t.showFileList ? (c(), m("ul", Jt, [
|
|
902
|
+
(c(!0), m(W, null, q(n.fileList, (u, d) => (c(), m("li", {
|
|
903
|
+
key: u.uid,
|
|
904
|
+
class: R(["el-upload-list__item", [`is-${u.status}`]]),
|
|
905
905
|
tabindex: "0"
|
|
906
906
|
}, [
|
|
907
|
-
|
|
908
|
-
|
|
907
|
+
y("div", Qt, [
|
|
908
|
+
y("a", {
|
|
909
909
|
class: "el-upload-list__item-name",
|
|
910
|
-
href:
|
|
911
|
-
target:
|
|
910
|
+
href: u.url || void 0,
|
|
911
|
+
target: u.url ? "_blank" : void 0,
|
|
912
912
|
rel: "noopener noreferrer",
|
|
913
|
-
onClick:
|
|
913
|
+
onClick: ue((S) => i.onFileClick(u), ["prevent"])
|
|
914
914
|
}, [
|
|
915
|
-
|
|
916
|
-
default:
|
|
917
|
-
|
|
915
|
+
g(w, { class: "el-icon--document" }, {
|
|
916
|
+
default: k(() => [
|
|
917
|
+
g(f)
|
|
918
918
|
]),
|
|
919
919
|
_: 1
|
|
920
920
|
}),
|
|
921
|
-
|
|
922
|
-
], 8,
|
|
921
|
+
y("span", el, P(u.name), 1)
|
|
922
|
+
], 8, Zt)
|
|
923
923
|
]),
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
y("label", tl, [
|
|
925
|
+
u.status === "success" ? (c(), F(w, {
|
|
926
926
|
key: 0,
|
|
927
927
|
class: "el-icon--upload-success el-icon--circle-check"
|
|
928
928
|
}, {
|
|
929
|
-
default:
|
|
930
|
-
|
|
929
|
+
default: k(() => [
|
|
930
|
+
g(v)
|
|
931
931
|
]),
|
|
932
932
|
_: 1
|
|
933
|
-
})) :
|
|
933
|
+
})) : u.status === "fail" ? (c(), F(w, {
|
|
934
934
|
key: 1,
|
|
935
935
|
class: "el-icon--upload-fail"
|
|
936
936
|
}, {
|
|
937
|
-
default:
|
|
938
|
-
|
|
937
|
+
default: k(() => [
|
|
938
|
+
g(U)
|
|
939
939
|
]),
|
|
940
940
|
_: 1
|
|
941
|
-
})) :
|
|
941
|
+
})) : B("", !0)
|
|
942
942
|
]),
|
|
943
|
-
|
|
943
|
+
u.status !== "uploading" ? (c(), F(w, {
|
|
944
944
|
key: 0,
|
|
945
945
|
class: "el-icon--close",
|
|
946
946
|
title: "删除",
|
|
947
|
-
onClick:
|
|
947
|
+
onClick: ue((S) => i.removeFile(d), ["stop"])
|
|
948
948
|
}, {
|
|
949
|
-
default:
|
|
950
|
-
|
|
949
|
+
default: k(() => [
|
|
950
|
+
g(L)
|
|
951
951
|
]),
|
|
952
952
|
_: 1
|
|
953
|
-
}, 8, ["onClick"])) :
|
|
954
|
-
|
|
953
|
+
}, 8, ["onClick"])) : B("", !0),
|
|
954
|
+
u.status === "uploading" ? (c(), F(b, {
|
|
955
955
|
key: 1,
|
|
956
956
|
class: "el-upload-list__item-progress",
|
|
957
957
|
type: "line",
|
|
958
|
-
percentage:
|
|
958
|
+
percentage: u.percent,
|
|
959
959
|
"stroke-width": 2
|
|
960
|
-
}, null, 8, ["percentage"])) :
|
|
960
|
+
}, null, 8, ["percentage"])) : B("", !0)
|
|
961
961
|
], 2))), 128))
|
|
962
|
-
])) :
|
|
962
|
+
])) : B("", !0)
|
|
963
963
|
]);
|
|
964
964
|
}
|
|
965
|
-
const
|
|
965
|
+
const nl = /* @__PURE__ */ G(Wt, [["render", ll], ["__scopeId", "data-v-07dac048"]]), sl = {
|
|
966
966
|
__name: "DateRangePicker",
|
|
967
967
|
props: {
|
|
968
968
|
start: {
|
|
@@ -989,21 +989,21 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
989
989
|
},
|
|
990
990
|
emits: ["update:start", "update:end", "change"],
|
|
991
991
|
setup(e, { emit: l }) {
|
|
992
|
-
const t = l, s = e, n =
|
|
993
|
-
|
|
992
|
+
const t = l, s = e, n = I([]);
|
|
993
|
+
le(
|
|
994
994
|
() => s.start,
|
|
995
995
|
() => {
|
|
996
996
|
n.value = [s.start, s.end];
|
|
997
997
|
}
|
|
998
|
-
),
|
|
998
|
+
), me(() => {
|
|
999
999
|
n.value = [s.start, s.end];
|
|
1000
1000
|
});
|
|
1001
|
-
function
|
|
1001
|
+
function i(p) {
|
|
1002
1002
|
t("update:start", p ? p[0] : ""), t("update:end", p ? p[1] : ""), t("change");
|
|
1003
1003
|
}
|
|
1004
1004
|
return (p, f) => {
|
|
1005
|
-
const
|
|
1006
|
-
return
|
|
1005
|
+
const w = x("el-date-picker");
|
|
1006
|
+
return c(), F(w, {
|
|
1007
1007
|
modelValue: n.value,
|
|
1008
1008
|
"onUpdate:modelValue": f[0] || (f[0] = (v) => n.value = v),
|
|
1009
1009
|
type: e.type,
|
|
@@ -1013,24 +1013,28 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1013
1013
|
"value-format": e.valueFormat,
|
|
1014
1014
|
"default-time": e.defaultTime,
|
|
1015
1015
|
class: "date-range-picker",
|
|
1016
|
-
onChange:
|
|
1016
|
+
onChange: i,
|
|
1017
1017
|
clearable: e.canClearable
|
|
1018
1018
|
}, null, 8, ["modelValue", "type", "start-placeholder", "value-format", "default-time", "clearable"]);
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
|
-
},
|
|
1021
|
+
}, We = /* @__PURE__ */ G(sl, [["__scopeId", "data-v-47618fba"]]), al = { class: "common-search__body" }, ol = {
|
|
1022
1022
|
key: 0,
|
|
1023
1023
|
class: "common-search__label"
|
|
1024
|
-
},
|
|
1024
|
+
}, il = ["onKeyup"], rl = { class: "common-search__range-sep" }, cl = {
|
|
1025
1025
|
key: 6,
|
|
1026
1026
|
class: "common-search__range"
|
|
1027
|
-
},
|
|
1027
|
+
}, ul = {
|
|
1028
|
+
key: 0,
|
|
1029
|
+
class: "common-search__scroll-hint",
|
|
1030
|
+
"aria-hidden": "true"
|
|
1031
|
+
}, dl = {
|
|
1028
1032
|
key: 0,
|
|
1029
1033
|
class: "common-search__actions is-inline"
|
|
1030
|
-
},
|
|
1034
|
+
}, pl = { class: "common-search__actions-main" }, fl = {
|
|
1031
1035
|
key: 0,
|
|
1032
1036
|
class: "common-search__footer"
|
|
1033
|
-
},
|
|
1037
|
+
}, hl = { class: "common-search__actions is-bottom" }, ml = { class: "common-search__actions-main" }, gl = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
|
|
1034
1038
|
__name: "SearchForm",
|
|
1035
1039
|
props: {
|
|
1036
1040
|
modelValue: { type: Object, default: () => ({}) },
|
|
@@ -1038,198 +1042,219 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1038
1042
|
},
|
|
1039
1043
|
emits: ["change", "search", "reset", "update:modelValue"],
|
|
1040
1044
|
setup(e, { emit: l }) {
|
|
1041
|
-
const t = e, s = l, n =
|
|
1045
|
+
const t = e, s = l, n = I({}), i = we({}), p = we({});
|
|
1042
1046
|
let f = !1;
|
|
1043
|
-
function
|
|
1044
|
-
return JSON.stringify(
|
|
1047
|
+
function w(o, r) {
|
|
1048
|
+
return JSON.stringify(o ?? {}) === JSON.stringify(r ?? {});
|
|
1045
1049
|
}
|
|
1046
|
-
const v =
|
|
1047
|
-
let
|
|
1048
|
-
const
|
|
1049
|
-
if (!(!L.value ||
|
|
1050
|
+
const v = I(null), U = I(!1), L = I(!1), b = I(0), u = I(0), d = I(null), S = I(!1);
|
|
1051
|
+
let $ = null, D = !1, C = !1;
|
|
1052
|
+
const X = Oe(() => {
|
|
1053
|
+
if (!(!L.value || d.value == null))
|
|
1050
1054
|
return {
|
|
1051
|
-
maxHeight: `${
|
|
1052
|
-
|
|
1055
|
+
maxHeight: `${d.value}px`,
|
|
1056
|
+
// 展开且内容被限高时允许内部滚动,避免撑满视口把表格挤没
|
|
1057
|
+
overflow: U.value ? "auto" : "hidden"
|
|
1053
1058
|
};
|
|
1054
1059
|
});
|
|
1055
|
-
|
|
1060
|
+
function V(o) {
|
|
1061
|
+
const r = b.value || 0, M = r * 2 + 16 + 4, O = r > 0 ? r : 120, E = Math.max(O, M);
|
|
1062
|
+
return Math.min(o, E);
|
|
1063
|
+
}
|
|
1064
|
+
function T() {
|
|
1065
|
+
const o = v.value;
|
|
1066
|
+
if (!o || !U.value || !L.value) {
|
|
1067
|
+
S.value = !1;
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
S.value = o.scrollHeight - o.clientHeight - o.scrollTop > 6;
|
|
1071
|
+
}
|
|
1072
|
+
function z() {
|
|
1073
|
+
T();
|
|
1074
|
+
}
|
|
1075
|
+
le(
|
|
1056
1076
|
() => t.modelValue,
|
|
1057
|
-
(
|
|
1058
|
-
|
|
1077
|
+
(o) => {
|
|
1078
|
+
w(o, n.value) || (f = !0, n.value = { ...o || {} }, Y(() => {
|
|
1059
1079
|
f = !1;
|
|
1060
1080
|
}));
|
|
1061
1081
|
},
|
|
1062
1082
|
{ deep: !0, immediate: !0 }
|
|
1063
|
-
),
|
|
1083
|
+
), le(
|
|
1064
1084
|
n,
|
|
1065
1085
|
() => {
|
|
1066
1086
|
f || s("update:modelValue", { ...n.value });
|
|
1067
1087
|
},
|
|
1068
1088
|
{ deep: !0 }
|
|
1069
|
-
),
|
|
1089
|
+
), le(
|
|
1070
1090
|
() => t.itemList,
|
|
1071
1091
|
() => {
|
|
1072
|
-
|
|
1092
|
+
U.value = !1, Y(() => ee());
|
|
1073
1093
|
},
|
|
1074
1094
|
{ deep: !0 }
|
|
1075
|
-
),
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
}), v.value &&
|
|
1079
|
-
}),
|
|
1080
|
-
|
|
1095
|
+
), me(() => {
|
|
1096
|
+
Y(() => ee()), typeof ResizeObserver < "u" && ($ = new ResizeObserver(() => {
|
|
1097
|
+
!D && !C && ee();
|
|
1098
|
+
}), v.value && $.observe(v.value)), window.addEventListener("resize", ae);
|
|
1099
|
+
}), Re(() => {
|
|
1100
|
+
$ == null || $.disconnect(), window.removeEventListener("resize", ae);
|
|
1081
1101
|
});
|
|
1082
|
-
function
|
|
1083
|
-
|
|
1102
|
+
function ae() {
|
|
1103
|
+
!D && !C && ee();
|
|
1084
1104
|
}
|
|
1085
|
-
function
|
|
1086
|
-
if (!
|
|
1087
|
-
const
|
|
1088
|
-
return { width:
|
|
1105
|
+
function Ge(o) {
|
|
1106
|
+
if (!o.width) return;
|
|
1107
|
+
const r = typeof o.width == "number" ? `${o.width}px` : o.width;
|
|
1108
|
+
return { width: r, minWidth: r };
|
|
1089
1109
|
}
|
|
1090
|
-
function
|
|
1091
|
-
if (
|
|
1092
|
-
if (typeof
|
|
1093
|
-
const _ =
|
|
1094
|
-
return typeof _ == "string" ?
|
|
1110
|
+
function ve(o, r) {
|
|
1111
|
+
if (o == null) return "";
|
|
1112
|
+
if (typeof o != "object") return String(o);
|
|
1113
|
+
const _ = r.optionsLabel || "label";
|
|
1114
|
+
return typeof _ == "string" ? o[_] : Array.isArray(_) ? `${o[_[0]]}(${o[_[1]]})` : o.label;
|
|
1095
1115
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
1116
|
+
function oe(o, r) {
|
|
1117
|
+
return o == null || typeof o != "object" ? o : o[r.optionsValue || "value"];
|
|
1098
1118
|
}
|
|
1099
|
-
function
|
|
1119
|
+
function de(o) {
|
|
1100
1120
|
return {
|
|
1101
|
-
startKey:
|
|
1102
|
-
endKey:
|
|
1121
|
+
startKey: o.start || `${o.prop}Min`,
|
|
1122
|
+
endKey: o.end || `${o.prop}Max`
|
|
1103
1123
|
};
|
|
1104
1124
|
}
|
|
1105
|
-
function
|
|
1106
|
-
if (
|
|
1107
|
-
const _ =
|
|
1125
|
+
function _e(o, r = 2) {
|
|
1126
|
+
if (o == null || o === "") return;
|
|
1127
|
+
const _ = Te(o, r);
|
|
1108
1128
|
if (_ == null || _ === "") return;
|
|
1109
|
-
const
|
|
1110
|
-
return Number.isFinite(
|
|
1129
|
+
const N = Number(String(_).replace(/,/g, ""));
|
|
1130
|
+
return Number.isFinite(N) ? N : void 0;
|
|
1111
1131
|
}
|
|
1112
|
-
function
|
|
1113
|
-
const { startKey:
|
|
1114
|
-
let
|
|
1115
|
-
|
|
1132
|
+
function pe(o) {
|
|
1133
|
+
const { startKey: r, endKey: _ } = de(o), N = o.precision ?? 2;
|
|
1134
|
+
let M = _e(n.value[r], N), O = _e(n.value[_], N);
|
|
1135
|
+
M != null && O != null && M > O && ([M, O] = [O, M]), n.value[r] = M, n.value[_] = O;
|
|
1116
1136
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1137
|
+
function Xe(o) {
|
|
1138
|
+
pe(o), H();
|
|
1119
1139
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const { startKey:
|
|
1122
|
-
return
|
|
1140
|
+
function Je(o) {
|
|
1141
|
+
const { startKey: r, endKey: _ } = de(o), N = n.value[r], M = n.value[_];
|
|
1142
|
+
return N != null && N !== "" || M != null && M !== "";
|
|
1123
1143
|
}
|
|
1124
|
-
function
|
|
1125
|
-
if (
|
|
1126
|
-
const { startKey:
|
|
1127
|
-
n.value[
|
|
1144
|
+
function Qe(o) {
|
|
1145
|
+
if (o.disabled) return;
|
|
1146
|
+
const { startKey: r, endKey: _ } = de(o);
|
|
1147
|
+
n.value[r] = void 0, n.value[_] = void 0, H();
|
|
1128
1148
|
}
|
|
1129
|
-
async function
|
|
1130
|
-
if (typeof
|
|
1131
|
-
p[
|
|
1149
|
+
async function Ze(o, r) {
|
|
1150
|
+
if (typeof o.remoteMethod == "function") {
|
|
1151
|
+
p[o.prop] = !0;
|
|
1132
1152
|
try {
|
|
1133
|
-
const _ = await
|
|
1134
|
-
o
|
|
1153
|
+
const _ = await o.remoteMethod(r);
|
|
1154
|
+
i[o.prop] = Array.isArray(_) ? _ : [];
|
|
1135
1155
|
} finally {
|
|
1136
|
-
p[
|
|
1156
|
+
p[o.prop] = !1;
|
|
1137
1157
|
}
|
|
1138
1158
|
}
|
|
1139
1159
|
}
|
|
1140
|
-
function
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
const
|
|
1144
|
-
return
|
|
1160
|
+
function be(o) {
|
|
1161
|
+
const r = o.style.maxHeight, _ = o.style.overflow, N = o.style.transition;
|
|
1162
|
+
o.style.transition = "none", o.style.maxHeight = "none", o.style.overflow = "visible";
|
|
1163
|
+
const M = o.scrollHeight;
|
|
1164
|
+
return o.style.maxHeight = r, o.style.overflow = _, o.offsetHeight, o.style.transition = N, M;
|
|
1145
1165
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const
|
|
1148
|
-
if (!
|
|
1149
|
-
|
|
1150
|
-
const
|
|
1151
|
-
if (!_.length || !
|
|
1152
|
-
L.value = !1, b.value = 0,
|
|
1166
|
+
function ee() {
|
|
1167
|
+
const o = v.value;
|
|
1168
|
+
if (!o || D || C) return;
|
|
1169
|
+
D = !0;
|
|
1170
|
+
const r = o.closest(".common-search"), _ = o.querySelectorAll(".common-search__field");
|
|
1171
|
+
if (!_.length || !r) {
|
|
1172
|
+
L.value = !1, b.value = 0, u.value = 0, d.value = null, D = !1;
|
|
1153
1173
|
return;
|
|
1154
1174
|
}
|
|
1155
|
-
b.value = _[0].offsetHeight,
|
|
1156
|
-
const
|
|
1157
|
-
let
|
|
1175
|
+
b.value = _[0].offsetHeight, u.value = be(o);
|
|
1176
|
+
const N = r.clientWidth, M = 20;
|
|
1177
|
+
let O = 0, E = 1;
|
|
1158
1178
|
Array.from(_).forEach((K, a) => {
|
|
1159
|
-
const
|
|
1179
|
+
const J = K.offsetWidth;
|
|
1160
1180
|
if (a === 0) {
|
|
1161
|
-
|
|
1181
|
+
O = J;
|
|
1162
1182
|
return;
|
|
1163
1183
|
}
|
|
1164
|
-
|
|
1184
|
+
O + M + J > N ? (E += 1, O = J) : O += M + J;
|
|
1165
1185
|
});
|
|
1166
|
-
const
|
|
1167
|
-
L.value =
|
|
1186
|
+
const re = E > 1;
|
|
1187
|
+
L.value = re, re ? U.value ? d.value = V(u.value) : d.value = b.value : (U.value = !1, d.value = null), D = !1, Y(() => T());
|
|
1168
1188
|
}
|
|
1169
|
-
function
|
|
1170
|
-
const
|
|
1171
|
-
if (!
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1189
|
+
function et() {
|
|
1190
|
+
const o = v.value;
|
|
1191
|
+
if (!o || C) return;
|
|
1192
|
+
C = !0;
|
|
1193
|
+
const r = o.getBoundingClientRect().height || b.value;
|
|
1194
|
+
if (U.value)
|
|
1195
|
+
S.value = !1, d.value = r, U.value = !1, requestAnimationFrame(() => {
|
|
1176
1196
|
requestAnimationFrame(() => {
|
|
1177
|
-
|
|
1197
|
+
d.value = b.value;
|
|
1178
1198
|
});
|
|
1179
1199
|
});
|
|
1180
1200
|
else {
|
|
1181
|
-
|
|
1182
|
-
const _ =
|
|
1183
|
-
|
|
1201
|
+
d.value = r;
|
|
1202
|
+
const _ = be(o);
|
|
1203
|
+
u.value = _;
|
|
1204
|
+
const N = V(_);
|
|
1205
|
+
U.value = !0, requestAnimationFrame(() => {
|
|
1184
1206
|
requestAnimationFrame(() => {
|
|
1185
|
-
|
|
1207
|
+
d.value = N;
|
|
1186
1208
|
});
|
|
1187
1209
|
});
|
|
1188
1210
|
}
|
|
1189
1211
|
window.setTimeout(() => {
|
|
1190
|
-
|
|
1212
|
+
C = !1, ee(), Y(() => T());
|
|
1191
1213
|
}, 380);
|
|
1192
1214
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const
|
|
1195
|
-
return t.itemList.forEach((
|
|
1196
|
-
|
|
1197
|
-
}),
|
|
1215
|
+
function tt() {
|
|
1216
|
+
const o = {};
|
|
1217
|
+
return t.itemList.forEach((r) => {
|
|
1218
|
+
r.type === "daterange" || r.type === "dateRange" ? (o[r.start] = void 0, o[r.end] = void 0) : r.type === "number-range" || r.type === "numberRange" ? (o[r.start || `${r.prop}Min`] = void 0, o[r.end || `${r.prop}Max`] = void 0) : r.multiple ? o[r.prop] = [] : r.prop && (o[r.prop] = void 0);
|
|
1219
|
+
}), o;
|
|
1198
1220
|
}
|
|
1199
|
-
function
|
|
1221
|
+
function Ce() {
|
|
1200
1222
|
s("update:modelValue", { ...n.value });
|
|
1201
1223
|
}
|
|
1202
|
-
function
|
|
1203
|
-
|
|
1224
|
+
function H() {
|
|
1225
|
+
Ce(), s("change", { ...n.value }), s("search", { ...n.value });
|
|
1204
1226
|
}
|
|
1205
|
-
function
|
|
1206
|
-
n.value =
|
|
1227
|
+
function ie() {
|
|
1228
|
+
n.value = tt(), Ce(), s("reset", { ...n.value }), s("change", { ...n.value });
|
|
1207
1229
|
}
|
|
1208
|
-
return (
|
|
1209
|
-
const _ =
|
|
1210
|
-
return
|
|
1211
|
-
class:
|
|
1230
|
+
return (o, r) => {
|
|
1231
|
+
const _ = x("el-input"), N = x("el-option"), M = x("el-select"), O = x("el-input-number"), E = x("el-icon"), re = x("el-date-picker"), K = x("el-button");
|
|
1232
|
+
return Q((c(), m("div", {
|
|
1233
|
+
class: R(["common-search", {
|
|
1212
1234
|
"is-single-row": !L.value,
|
|
1213
1235
|
"is-multi-row": L.value,
|
|
1214
|
-
"is-expanded": L.value &&
|
|
1215
|
-
"is-collapsed": L.value && !
|
|
1236
|
+
"is-expanded": L.value && U.value,
|
|
1237
|
+
"is-collapsed": L.value && !U.value
|
|
1216
1238
|
}])
|
|
1217
1239
|
}, [
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1240
|
+
y("div", al, [
|
|
1241
|
+
y("div", {
|
|
1242
|
+
class: R(["common-search__fields-wrap", { "has-more-below": S.value }])
|
|
1243
|
+
}, [
|
|
1244
|
+
y("div", {
|
|
1221
1245
|
ref_key: "fieldsRef",
|
|
1222
1246
|
ref: v,
|
|
1223
1247
|
class: "common-search__fields",
|
|
1224
|
-
style: se(
|
|
1248
|
+
style: se(X.value),
|
|
1249
|
+
onScrollPassive: z
|
|
1225
1250
|
}, [
|
|
1226
|
-
(
|
|
1227
|
-
key: a.prop || a.start ||
|
|
1228
|
-
class:
|
|
1229
|
-
style: se(
|
|
1251
|
+
(c(!0), m(W, null, q(e.itemList, (a, J) => (c(), m("div", {
|
|
1252
|
+
key: a.prop || a.start || J,
|
|
1253
|
+
class: R(["common-search__field", [`is-${a.type}`, a.className]]),
|
|
1254
|
+
style: se(Ge(a))
|
|
1230
1255
|
}, [
|
|
1231
|
-
a.label ? (
|
|
1232
|
-
a.type === "input" || a.type === "text" ? (
|
|
1256
|
+
a.label ? (c(), m("label", ol, P(a.label), 1)) : B("", !0),
|
|
1257
|
+
a.type === "input" || a.type === "text" ? (c(), F(_, {
|
|
1233
1258
|
key: 1,
|
|
1234
1259
|
modelValue: n.value[a.prop],
|
|
1235
1260
|
"onUpdate:modelValue": (h) => n.value[a.prop] = h,
|
|
@@ -1238,8 +1263,8 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1238
1263
|
placeholder: a.placeholder || `请输入${a.label || ""}`,
|
|
1239
1264
|
maxlength: a.maxlength || 200,
|
|
1240
1265
|
disabled: a.disabled,
|
|
1241
|
-
onKeyup:
|
|
1242
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (
|
|
1266
|
+
onKeyup: xe(H, ["enter"])
|
|
1267
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (c(), F(M, {
|
|
1243
1268
|
key: 2,
|
|
1244
1269
|
modelValue: n.value[a.prop],
|
|
1245
1270
|
"onUpdate:modelValue": (h) => n.value[a.prop] = h,
|
|
@@ -1251,18 +1276,18 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1251
1276
|
"collapse-tags-tooltip": a.multiple,
|
|
1252
1277
|
disabled: a.disabled,
|
|
1253
1278
|
class: "common-search__control",
|
|
1254
|
-
onChange:
|
|
1279
|
+
onChange: H
|
|
1255
1280
|
}, {
|
|
1256
|
-
default:
|
|
1257
|
-
(
|
|
1258
|
-
key: `${
|
|
1259
|
-
label:
|
|
1260
|
-
value:
|
|
1281
|
+
default: k(() => [
|
|
1282
|
+
(c(!0), m(W, null, q(a.options || [], (h, fe) => (c(), F(N, {
|
|
1283
|
+
key: `${oe(h, a)}-${fe}`,
|
|
1284
|
+
label: ve(h, a),
|
|
1285
|
+
value: oe(h, a),
|
|
1261
1286
|
disabled: typeof h == "object" && (h == null ? void 0 : h.disabled)
|
|
1262
1287
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1263
1288
|
]),
|
|
1264
1289
|
_: 2
|
|
1265
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : a.type === "remote-select" || a.type === "remoteSelect" ? (
|
|
1290
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : a.type === "remote-select" || a.type === "remoteSelect" ? (c(), F(M, {
|
|
1266
1291
|
key: 3,
|
|
1267
1292
|
modelValue: n.value[a.prop],
|
|
1268
1293
|
"onUpdate:modelValue": (h) => n.value[a.prop] = h,
|
|
@@ -1274,28 +1299,28 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1274
1299
|
"collapse-tags": a.multiple,
|
|
1275
1300
|
"collapse-tags-tooltip": a.multiple,
|
|
1276
1301
|
"reserve-keyword": !1,
|
|
1277
|
-
"remote-method": (h) =>
|
|
1302
|
+
"remote-method": (h) => Ze(a, h),
|
|
1278
1303
|
loading: !!p[a.prop],
|
|
1279
1304
|
disabled: a.disabled,
|
|
1280
1305
|
class: "common-search__control",
|
|
1281
|
-
onClear: (h) =>
|
|
1282
|
-
onChange:
|
|
1306
|
+
onClear: (h) => i[a.prop] = [],
|
|
1307
|
+
onChange: H
|
|
1283
1308
|
}, {
|
|
1284
|
-
default:
|
|
1285
|
-
(
|
|
1286
|
-
key: `${
|
|
1287
|
-
label:
|
|
1288
|
-
value:
|
|
1309
|
+
default: k(() => [
|
|
1310
|
+
(c(!0), m(W, null, q(i[a.prop] || a.options || [], (h, fe) => (c(), F(N, {
|
|
1311
|
+
key: `${oe(h, a)}-${fe}`,
|
|
1312
|
+
label: ve(h, a),
|
|
1313
|
+
value: oe(h, a),
|
|
1289
1314
|
disabled: typeof h == "object" && (h == null ? void 0 : h.disabled)
|
|
1290
1315
|
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1291
1316
|
]),
|
|
1292
1317
|
_: 2
|
|
1293
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (
|
|
1318
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (c(), m("div", {
|
|
1294
1319
|
key: 4,
|
|
1295
1320
|
class: "common-search__range common-search__range--number",
|
|
1296
|
-
onKeyup:
|
|
1321
|
+
onKeyup: xe((h) => Xe(a), ["enter"])
|
|
1297
1322
|
}, [
|
|
1298
|
-
|
|
1323
|
+
g(O, {
|
|
1299
1324
|
modelValue: n.value[a.start || `${a.prop}Min`],
|
|
1300
1325
|
"onUpdate:modelValue": (h) => n.value[a.start || `${a.prop}Min`] = h,
|
|
1301
1326
|
controls: !1,
|
|
@@ -1304,10 +1329,10 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1304
1329
|
placeholder: a.minPlaceholder || "最小值",
|
|
1305
1330
|
disabled: a.disabled,
|
|
1306
1331
|
class: "common-search__range-input",
|
|
1307
|
-
onBlur: (h) =>
|
|
1332
|
+
onBlur: (h) => pe(a)
|
|
1308
1333
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1309
|
-
|
|
1310
|
-
|
|
1334
|
+
y("span", rl, P(a.separator || "至"), 1),
|
|
1335
|
+
g(O, {
|
|
1311
1336
|
modelValue: n.value[a.end || `${a.prop}Max`],
|
|
1312
1337
|
"onUpdate:modelValue": (h) => n.value[a.end || `${a.prop}Max`] = h,
|
|
1313
1338
|
controls: !1,
|
|
@@ -1316,21 +1341,21 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1316
1341
|
placeholder: a.maxPlaceholder || "最大值",
|
|
1317
1342
|
disabled: a.disabled,
|
|
1318
1343
|
class: "common-search__range-input",
|
|
1319
|
-
onBlur: (h) =>
|
|
1344
|
+
onBlur: (h) => pe(a)
|
|
1320
1345
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1321
|
-
a.clearable !== !1 &&
|
|
1346
|
+
a.clearable !== !1 && Je(a) ? (c(), F(E, {
|
|
1322
1347
|
key: 0,
|
|
1323
1348
|
class: "common-search__range-clear",
|
|
1324
|
-
onMousedown:
|
|
1349
|
+
onMousedown: r[0] || (r[0] = ue(() => {
|
|
1325
1350
|
}, ["prevent"])),
|
|
1326
|
-
onClick: (h) =>
|
|
1351
|
+
onClick: (h) => Qe(a)
|
|
1327
1352
|
}, {
|
|
1328
|
-
default:
|
|
1329
|
-
|
|
1353
|
+
default: k(() => [
|
|
1354
|
+
g(te(Be))
|
|
1330
1355
|
]),
|
|
1331
1356
|
_: 1
|
|
1332
|
-
}, 8, ["onClick"])) :
|
|
1333
|
-
], 40,
|
|
1357
|
+
}, 8, ["onClick"])) : B("", !0)
|
|
1358
|
+
], 40, il)) : a.type === "date" ? (c(), F(re, {
|
|
1334
1359
|
key: 5,
|
|
1335
1360
|
modelValue: n.value[a.prop],
|
|
1336
1361
|
"onUpdate:modelValue": (h) => n.value[a.prop] = h,
|
|
@@ -1341,48 +1366,57 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1341
1366
|
clearable: a.clearable !== !1,
|
|
1342
1367
|
disabled: a.disabled,
|
|
1343
1368
|
class: "common-search__control"
|
|
1344
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (
|
|
1345
|
-
|
|
1369
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (c(), m("div", cl, [
|
|
1370
|
+
g(We, {
|
|
1346
1371
|
start: n.value[a.start],
|
|
1347
1372
|
"onUpdate:start": (h) => n.value[a.start] = h,
|
|
1348
1373
|
end: n.value[a.end],
|
|
1349
1374
|
"onUpdate:end": (h) => n.value[a.end] = h,
|
|
1350
|
-
onChange:
|
|
1375
|
+
onChange: H
|
|
1351
1376
|
}, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end"])
|
|
1352
|
-
])) : ne(
|
|
1377
|
+
])) : ne(o.$slots, a.slotName || a.prop, {
|
|
1353
1378
|
item: a,
|
|
1354
1379
|
form: n.value
|
|
1355
1380
|
}, void 0, !0, 7)
|
|
1356
1381
|
], 6))), 128))
|
|
1357
|
-
],
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1382
|
+
], 36),
|
|
1383
|
+
S.value ? (c(), m("div", ul, [
|
|
1384
|
+
g(E, { size: 12 }, {
|
|
1385
|
+
default: k(() => [
|
|
1386
|
+
g(te(ke))
|
|
1387
|
+
]),
|
|
1388
|
+
_: 1
|
|
1389
|
+
}),
|
|
1390
|
+
r[1] || (r[1] = y("span", null, "向下滑动查看更多", -1))
|
|
1391
|
+
])) : B("", !0)
|
|
1392
|
+
], 2),
|
|
1393
|
+
L.value ? B("", !0) : (c(), m("div", dl, [
|
|
1394
|
+
r[4] || (r[4] = y("span", {
|
|
1361
1395
|
class: "common-search__label common-search__label--spacer",
|
|
1362
1396
|
"aria-hidden": "true"
|
|
1363
1397
|
}, " ", -1)),
|
|
1364
|
-
|
|
1365
|
-
ne(
|
|
1366
|
-
search:
|
|
1367
|
-
reset:
|
|
1398
|
+
y("div", pl, [
|
|
1399
|
+
ne(o.$slots, "actions", {
|
|
1400
|
+
search: H,
|
|
1401
|
+
reset: ie,
|
|
1368
1402
|
form: n.value
|
|
1369
1403
|
}, () => [
|
|
1370
|
-
|
|
1404
|
+
g(K, {
|
|
1371
1405
|
class: "common-search__reset",
|
|
1372
|
-
onClick:
|
|
1406
|
+
onClick: ie
|
|
1373
1407
|
}, {
|
|
1374
|
-
default:
|
|
1375
|
-
|
|
1408
|
+
default: k(() => [...r[2] || (r[2] = [
|
|
1409
|
+
A("重置", -1)
|
|
1376
1410
|
])]),
|
|
1377
1411
|
_: 1
|
|
1378
1412
|
}),
|
|
1379
|
-
|
|
1413
|
+
g(K, {
|
|
1380
1414
|
type: "primary",
|
|
1381
1415
|
class: "common-search__submit",
|
|
1382
|
-
onClick:
|
|
1416
|
+
onClick: H
|
|
1383
1417
|
}, {
|
|
1384
|
-
default:
|
|
1385
|
-
|
|
1418
|
+
default: k(() => [...r[3] || (r[3] = [
|
|
1419
|
+
A(" 搜索 ", -1)
|
|
1386
1420
|
])]),
|
|
1387
1421
|
_: 1
|
|
1388
1422
|
})
|
|
@@ -1390,45 +1424,45 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1390
1424
|
])
|
|
1391
1425
|
]))
|
|
1392
1426
|
]),
|
|
1393
|
-
L.value ? (
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
ne(
|
|
1397
|
-
search:
|
|
1398
|
-
reset:
|
|
1427
|
+
L.value ? (c(), m("div", fl, [
|
|
1428
|
+
y("div", hl, [
|
|
1429
|
+
y("div", ml, [
|
|
1430
|
+
ne(o.$slots, "actions", {
|
|
1431
|
+
search: H,
|
|
1432
|
+
reset: ie,
|
|
1399
1433
|
form: n.value
|
|
1400
1434
|
}, () => [
|
|
1401
|
-
|
|
1435
|
+
g(K, {
|
|
1402
1436
|
class: "common-search__reset",
|
|
1403
|
-
onClick:
|
|
1437
|
+
onClick: ie
|
|
1404
1438
|
}, {
|
|
1405
|
-
default:
|
|
1406
|
-
|
|
1439
|
+
default: k(() => [...r[5] || (r[5] = [
|
|
1440
|
+
A("重置", -1)
|
|
1407
1441
|
])]),
|
|
1408
1442
|
_: 1
|
|
1409
1443
|
}),
|
|
1410
|
-
|
|
1444
|
+
g(K, {
|
|
1411
1445
|
type: "primary",
|
|
1412
1446
|
class: "common-search__submit",
|
|
1413
|
-
onClick:
|
|
1447
|
+
onClick: H
|
|
1414
1448
|
}, {
|
|
1415
|
-
default:
|
|
1416
|
-
|
|
1449
|
+
default: k(() => [...r[6] || (r[6] = [
|
|
1450
|
+
A(" 搜索 ", -1)
|
|
1417
1451
|
])]),
|
|
1418
1452
|
_: 1
|
|
1419
1453
|
})
|
|
1420
1454
|
], !0)
|
|
1421
1455
|
]),
|
|
1422
|
-
|
|
1423
|
-
onClick:
|
|
1456
|
+
g(K, {
|
|
1457
|
+
onClick: et,
|
|
1424
1458
|
type: "primary",
|
|
1425
1459
|
plain: ""
|
|
1426
1460
|
}, {
|
|
1427
|
-
default:
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
default:
|
|
1431
|
-
|
|
1461
|
+
default: k(() => [
|
|
1462
|
+
A(P(U.value ? "收起" : "展开") + " ", 1),
|
|
1463
|
+
g(E, { class: "el-icon--right" }, {
|
|
1464
|
+
default: k(() => [
|
|
1465
|
+
U.value ? (c(), F(te(rt), { key: 0 })) : (c(), F(te(ke), { key: 1 }))
|
|
1432
1466
|
]),
|
|
1433
1467
|
_: 1
|
|
1434
1468
|
})
|
|
@@ -1436,13 +1470,13 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1436
1470
|
_: 1
|
|
1437
1471
|
})
|
|
1438
1472
|
])
|
|
1439
|
-
])) :
|
|
1473
|
+
])) : B("", !0)
|
|
1440
1474
|
], 2)), [
|
|
1441
|
-
[
|
|
1475
|
+
[Z, e.itemList.length]
|
|
1442
1476
|
]);
|
|
1443
1477
|
};
|
|
1444
1478
|
}
|
|
1445
|
-
}),
|
|
1479
|
+
}), yl = /* @__PURE__ */ G(gl, [["__scopeId", "data-v-b98e91f6"]]), vl = {
|
|
1446
1480
|
name: "MgOverflowHid",
|
|
1447
1481
|
props: {
|
|
1448
1482
|
label: String,
|
|
@@ -1465,62 +1499,62 @@ const Zt = /* @__PURE__ */ q(Et, [["render", Qt], ["__scopeId", "data-v-07dac048
|
|
|
1465
1499
|
return t && t.length > l && (t = t.slice(0, l) + "..."), t;
|
|
1466
1500
|
}
|
|
1467
1501
|
}
|
|
1468
|
-
},
|
|
1469
|
-
function
|
|
1470
|
-
const p =
|
|
1471
|
-
return
|
|
1472
|
-
t.value && t.value.length > t.maxLength ? (
|
|
1502
|
+
}, _l = { class: "tableOverflowHid" }, bl = ["innerHTML"], Cl = { class: "name-wrapper" }, kl = ["innerHTML"], Ul = { key: 1 }, wl = ["innerHTML"];
|
|
1503
|
+
function xl(e, l, t, s, n, i) {
|
|
1504
|
+
const p = x("el-popover");
|
|
1505
|
+
return c(), m("div", _l, [
|
|
1506
|
+
t.value && t.value.length > t.maxLength ? (c(), F(p, {
|
|
1473
1507
|
key: 0,
|
|
1474
1508
|
trigger: "hover",
|
|
1475
1509
|
placement: "bottom",
|
|
1476
1510
|
width: "400"
|
|
1477
1511
|
}, {
|
|
1478
|
-
reference:
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
class:
|
|
1482
|
-
},
|
|
1483
|
-
[
|
|
1512
|
+
reference: k(() => [
|
|
1513
|
+
y("div", Cl, [
|
|
1514
|
+
Q(y("span", {
|
|
1515
|
+
class: R(t.labelClassName)
|
|
1516
|
+
}, P(t.label) + ":", 3), [
|
|
1517
|
+
[Z, t.label]
|
|
1484
1518
|
]),
|
|
1485
|
-
|
|
1486
|
-
class:
|
|
1487
|
-
innerHTML:
|
|
1488
|
-
}, null, 10,
|
|
1519
|
+
y("span", {
|
|
1520
|
+
class: R(t.valueClassName),
|
|
1521
|
+
innerHTML: i.cutString(t.value, t.maxLength)
|
|
1522
|
+
}, null, 10, kl)
|
|
1489
1523
|
])
|
|
1490
1524
|
]),
|
|
1491
|
-
default:
|
|
1492
|
-
|
|
1493
|
-
class:
|
|
1494
|
-
},
|
|
1495
|
-
[
|
|
1525
|
+
default: k(() => [
|
|
1526
|
+
Q(y("span", {
|
|
1527
|
+
class: R(t.labelClassName)
|
|
1528
|
+
}, P(t.label) + ":", 3), [
|
|
1529
|
+
[Z, t.label]
|
|
1496
1530
|
]),
|
|
1497
|
-
|
|
1531
|
+
y("span", { innerHTML: t.value }, null, 8, bl)
|
|
1498
1532
|
]),
|
|
1499
1533
|
_: 1
|
|
1500
|
-
})) : (
|
|
1501
|
-
|
|
1502
|
-
class:
|
|
1503
|
-
},
|
|
1504
|
-
[
|
|
1534
|
+
})) : (c(), m("div", Ul, [
|
|
1535
|
+
Q(y("span", {
|
|
1536
|
+
class: R(t.labelClassName)
|
|
1537
|
+
}, P(t.label) + ":", 3), [
|
|
1538
|
+
[Z, t.label]
|
|
1505
1539
|
]),
|
|
1506
|
-
|
|
1507
|
-
class:
|
|
1540
|
+
y("span", {
|
|
1541
|
+
class: R([t.valueClassName, "value"])
|
|
1508
1542
|
}, [
|
|
1509
|
-
|
|
1543
|
+
y("span", { innerHTML: t.value }, null, 8, wl)
|
|
1510
1544
|
], 2)
|
|
1511
1545
|
]))
|
|
1512
1546
|
]);
|
|
1513
1547
|
}
|
|
1514
|
-
const
|
|
1548
|
+
const qe = /* @__PURE__ */ G(vl, [["render", xl], ["__scopeId", "data-v-ef86ea54"]]), Sl = { class: "common-table__main" }, $l = { key: 0 }, Ll = { key: 1 }, Fl = {
|
|
1515
1549
|
key: 2,
|
|
1516
1550
|
class: "price-text"
|
|
1517
|
-
},
|
|
1551
|
+
}, Nl = {
|
|
1518
1552
|
key: 3,
|
|
1519
1553
|
class: "bold-text"
|
|
1520
|
-
},
|
|
1554
|
+
}, Ml = {
|
|
1521
1555
|
key: 0,
|
|
1522
1556
|
class: "common-table__pagination"
|
|
1523
|
-
},
|
|
1557
|
+
}, Bl = /* @__PURE__ */ Object.assign({ name: "MgDataTable" }, {
|
|
1524
1558
|
__name: "DataTable",
|
|
1525
1559
|
props: {
|
|
1526
1560
|
/** 列配置:el-table-column 属性 + slotName */
|
|
@@ -1598,103 +1632,103 @@ const He = /* @__PURE__ */ q(hl, [["render", Cl], ["__scopeId", "data-v-ef86ea54
|
|
|
1598
1632
|
color: "var(--brand-text-primary)",
|
|
1599
1633
|
fontWeight: 600,
|
|
1600
1634
|
fontSize: "13px"
|
|
1601
|
-
},
|
|
1635
|
+
}, i = Oe(() => ({
|
|
1602
1636
|
headerCellStyle: n,
|
|
1603
1637
|
...t.tableBind
|
|
1604
1638
|
}));
|
|
1605
|
-
function p(
|
|
1606
|
-
const { slotName:
|
|
1639
|
+
function p(u) {
|
|
1640
|
+
const { slotName: d, maxLength: S, ...$ } = u || {};
|
|
1607
1641
|
return {
|
|
1608
1642
|
...$
|
|
1609
1643
|
};
|
|
1610
1644
|
}
|
|
1611
|
-
function f(
|
|
1612
|
-
return
|
|
1645
|
+
function f(u) {
|
|
1646
|
+
return u == null || u === "" ? "-" : u;
|
|
1613
1647
|
}
|
|
1614
|
-
function
|
|
1615
|
-
return t.pagination ? (t.pagination.page - 1) * t.pagination.limit +
|
|
1648
|
+
function w(u) {
|
|
1649
|
+
return t.pagination ? (t.pagination.page - 1) * t.pagination.limit + u + 1 : u + 1;
|
|
1616
1650
|
}
|
|
1617
|
-
function v(
|
|
1618
|
-
var
|
|
1619
|
-
s("pageChange", { page: (
|
|
1651
|
+
function v(u) {
|
|
1652
|
+
var d;
|
|
1653
|
+
s("pageChange", { page: (d = t.pagination) == null ? void 0 : d.page, limit: u });
|
|
1620
1654
|
}
|
|
1621
|
-
function
|
|
1622
|
-
var
|
|
1623
|
-
s("pageChange", { page:
|
|
1655
|
+
function U(u) {
|
|
1656
|
+
var d;
|
|
1657
|
+
s("pageChange", { page: u, limit: (d = t.pagination) == null ? void 0 : d.limit });
|
|
1624
1658
|
}
|
|
1625
|
-
function L(
|
|
1626
|
-
s("cellClick",
|
|
1659
|
+
function L(u, d, S, $) {
|
|
1660
|
+
s("cellClick", u, d, S, $), t.canCellClick && (d == null ? void 0 : d.label) !== "操作" && window.getSelection().toString();
|
|
1627
1661
|
}
|
|
1628
|
-
function b(
|
|
1629
|
-
s("selectionChange",
|
|
1662
|
+
function b(u) {
|
|
1663
|
+
s("selectionChange", u);
|
|
1630
1664
|
}
|
|
1631
|
-
return (
|
|
1632
|
-
const
|
|
1633
|
-
return
|
|
1634
|
-
class:
|
|
1665
|
+
return (u, d) => {
|
|
1666
|
+
const S = x("el-table-column"), $ = x("el-table"), D = x("el-pagination");
|
|
1667
|
+
return c(), m("div", {
|
|
1668
|
+
class: R(["common-table", { "is-fill-height": e.fillHeight }])
|
|
1635
1669
|
}, [
|
|
1636
|
-
|
|
1637
|
-
|
|
1670
|
+
y("div", Sl, [
|
|
1671
|
+
g($, Se({
|
|
1638
1672
|
data: e.dataList,
|
|
1639
1673
|
height: e.fillHeight ? "100%" : void 0,
|
|
1640
1674
|
class: { "common-pointer-table": e.canCellClick }
|
|
1641
|
-
},
|
|
1675
|
+
}, i.value, {
|
|
1642
1676
|
onCellClick: L,
|
|
1643
1677
|
onSelectionChange: b
|
|
1644
1678
|
}), {
|
|
1645
|
-
default:
|
|
1646
|
-
e.showSelection ? (
|
|
1679
|
+
default: k(() => [
|
|
1680
|
+
e.showSelection ? (c(), F(S, {
|
|
1647
1681
|
key: 0,
|
|
1648
1682
|
type: "selection",
|
|
1649
1683
|
width: e.selectionWidth,
|
|
1650
1684
|
align: "center",
|
|
1651
1685
|
selectable: e.selectable,
|
|
1652
1686
|
fixed: "left"
|
|
1653
|
-
}, null, 8, ["width", "selectable"])) :
|
|
1654
|
-
e.showIndex ? (
|
|
1687
|
+
}, null, 8, ["width", "selectable"])) : B("", !0),
|
|
1688
|
+
e.showIndex ? (c(), F(S, {
|
|
1655
1689
|
key: 1,
|
|
1656
1690
|
type: "index",
|
|
1657
1691
|
label: e.indexLabel,
|
|
1658
1692
|
width: e.indexWidth,
|
|
1659
|
-
index:
|
|
1693
|
+
index: w,
|
|
1660
1694
|
align: "center"
|
|
1661
|
-
}, null, 8, ["label", "width"])) :
|
|
1662
|
-
(
|
|
1663
|
-
key:
|
|
1664
|
-
}, { ref_for: !0 }, p(
|
|
1665
|
-
|
|
1695
|
+
}, null, 8, ["label", "width"])) : B("", !0),
|
|
1696
|
+
(c(!0), m(W, null, q(e.propList, (C, X) => (c(), F(S, Se({
|
|
1697
|
+
key: C.prop || C.slotName || X
|
|
1698
|
+
}, { ref_for: !0 }, p(C)), gt({ _: 2 }, [
|
|
1699
|
+
C.slotName ? {
|
|
1666
1700
|
name: "default",
|
|
1667
|
-
fn:
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
value: String(V[
|
|
1671
|
-
"max-length":
|
|
1701
|
+
fn: k(({ row: V, $index: T }) => [
|
|
1702
|
+
C.slotName === "overtext" ? (c(), m("div", $l, [
|
|
1703
|
+
g(qe, {
|
|
1704
|
+
value: String(V[C.prop] ?? ""),
|
|
1705
|
+
"max-length": C.maxLength || 18
|
|
1672
1706
|
}, null, 8, ["value", "max-length"])
|
|
1673
|
-
])) :
|
|
1674
|
-
|
|
1675
|
-
class:
|
|
1676
|
-
"whether-yes": V[
|
|
1677
|
-
"whether-no": V[
|
|
1707
|
+
])) : C.slotName === "whether" ? (c(), m("div", Ll, [
|
|
1708
|
+
y("span", {
|
|
1709
|
+
class: R({
|
|
1710
|
+
"whether-yes": V[C.prop] == 1,
|
|
1711
|
+
"whether-no": V[C.prop] == 0
|
|
1678
1712
|
})
|
|
1679
|
-
},
|
|
1680
|
-
])) :
|
|
1713
|
+
}, P(V[C.prop] == 0 ? "否" : V[C.prop] == 1 ? "是" : ""), 3)
|
|
1714
|
+
])) : C.slotName === "price" ? (c(), m("div", Fl, P(te(Te)(V[C.prop], 0)), 1)) : C.slotName === "boldtext" ? (c(), m("div", Nl, P(V[C.prop]), 1)) : ne(u.$slots, C.slotName, {
|
|
1681
1715
|
row: V,
|
|
1682
|
-
index:
|
|
1683
|
-
column:
|
|
1716
|
+
index: T,
|
|
1717
|
+
column: C
|
|
1684
1718
|
}, () => [
|
|
1685
|
-
|
|
1719
|
+
A(P(f(V[C.prop])), 1)
|
|
1686
1720
|
], !0, 4)
|
|
1687
1721
|
]),
|
|
1688
1722
|
key: "0"
|
|
1689
1723
|
} : void 0
|
|
1690
1724
|
]), 1040))), 128)),
|
|
1691
|
-
ne(
|
|
1725
|
+
ne(u.$slots, "default", {}, void 0, !0)
|
|
1692
1726
|
]),
|
|
1693
1727
|
_: 3
|
|
1694
1728
|
}, 16, ["data", "height", "class"])
|
|
1695
1729
|
]),
|
|
1696
|
-
e.pagination ? (
|
|
1697
|
-
|
|
1730
|
+
e.pagination ? (c(), m("div", Ml, [
|
|
1731
|
+
g(D, {
|
|
1698
1732
|
background: "",
|
|
1699
1733
|
"current-page": e.pagination.page,
|
|
1700
1734
|
"page-size": e.pagination.limit,
|
|
@@ -1702,13 +1736,13 @@ const He = /* @__PURE__ */ q(hl, [["render", Cl], ["__scopeId", "data-v-ef86ea54
|
|
|
1702
1736
|
total: e.pagination.total,
|
|
1703
1737
|
layout: e.paginationLayout,
|
|
1704
1738
|
onSizeChange: v,
|
|
1705
|
-
onCurrentChange:
|
|
1739
|
+
onCurrentChange: U
|
|
1706
1740
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"])
|
|
1707
|
-
])) :
|
|
1741
|
+
])) : B("", !0)
|
|
1708
1742
|
], 2);
|
|
1709
1743
|
};
|
|
1710
1744
|
}
|
|
1711
|
-
}),
|
|
1745
|
+
}), Pl = /* @__PURE__ */ G(Bl, [["__scopeId", "data-v-16d5165c"]]), Tl = ["aria-checked", "disabled", "onClick"], Vl = {
|
|
1712
1746
|
__name: "SegmentedControl",
|
|
1713
1747
|
props: {
|
|
1714
1748
|
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
@@ -1717,69 +1751,69 @@ const He = /* @__PURE__ */ q(hl, [["render", Cl], ["__scopeId", "data-v-ef86ea54
|
|
|
1717
1751
|
},
|
|
1718
1752
|
emits: ["update:modelValue", "change"],
|
|
1719
1753
|
setup(e, { emit: l }) {
|
|
1720
|
-
const t = e, s = l, n =
|
|
1754
|
+
const t = e, s = l, n = I(null), i = I([]), p = I(!1), f = I({
|
|
1721
1755
|
width: "0px",
|
|
1722
1756
|
transform: "translateX(0px)"
|
|
1723
1757
|
});
|
|
1724
|
-
let
|
|
1725
|
-
function v(b,
|
|
1726
|
-
b && (
|
|
1758
|
+
let w = null;
|
|
1759
|
+
function v(b, u) {
|
|
1760
|
+
b && (i.value[u] = b);
|
|
1727
1761
|
}
|
|
1728
|
-
function
|
|
1762
|
+
function U() {
|
|
1729
1763
|
const b = n.value;
|
|
1730
1764
|
if (!b) return;
|
|
1731
|
-
const
|
|
1732
|
-
if (!
|
|
1765
|
+
const u = t.options.findIndex((D) => D.value === t.modelValue), d = i.value[u];
|
|
1766
|
+
if (!d) {
|
|
1733
1767
|
f.value = { width: "0px", transform: "translateX(0px)" };
|
|
1734
1768
|
return;
|
|
1735
1769
|
}
|
|
1736
|
-
const
|
|
1770
|
+
const S = b.getBoundingClientRect(), $ = d.getBoundingClientRect();
|
|
1737
1771
|
f.value = {
|
|
1738
1772
|
width: `${$.width}px`,
|
|
1739
|
-
transform: `translateX(${$.left -
|
|
1773
|
+
transform: `translateX(${$.left - S.left}px)`
|
|
1740
1774
|
}, p.value = !0;
|
|
1741
1775
|
}
|
|
1742
1776
|
function L(b) {
|
|
1743
1777
|
b.disabled || (s("update:modelValue", b.value), s("change", b.value));
|
|
1744
1778
|
}
|
|
1745
|
-
return
|
|
1779
|
+
return le(
|
|
1746
1780
|
() => [t.modelValue, t.options],
|
|
1747
1781
|
async () => {
|
|
1748
|
-
await
|
|
1782
|
+
await Y(), U();
|
|
1749
1783
|
},
|
|
1750
1784
|
{ deep: !0 }
|
|
1751
|
-
),
|
|
1752
|
-
await
|
|
1753
|
-
}),
|
|
1754
|
-
|
|
1755
|
-
}), (b,
|
|
1785
|
+
), me(async () => {
|
|
1786
|
+
await Y(), U(), typeof ResizeObserver < "u" && n.value && (w = new ResizeObserver(() => U()), w.observe(n.value));
|
|
1787
|
+
}), Re(() => {
|
|
1788
|
+
w == null || w.disconnect(), w = null;
|
|
1789
|
+
}), (b, u) => (c(), m("div", {
|
|
1756
1790
|
ref_key: "rootRef",
|
|
1757
1791
|
ref: n,
|
|
1758
1792
|
class: "segmented",
|
|
1759
1793
|
role: "radiogroup"
|
|
1760
1794
|
}, [
|
|
1761
|
-
|
|
1762
|
-
class:
|
|
1795
|
+
y("div", {
|
|
1796
|
+
class: R(["segmented__thumb", { "is-ready": p.value }]),
|
|
1763
1797
|
style: se(f.value)
|
|
1764
1798
|
}, null, 6),
|
|
1765
|
-
(
|
|
1766
|
-
key: String(
|
|
1799
|
+
(c(!0), m(W, null, q(e.options, (d, S) => (c(), m("button", {
|
|
1800
|
+
key: String(d.value),
|
|
1767
1801
|
ref_for: !0,
|
|
1768
|
-
ref: ($) => v($,
|
|
1802
|
+
ref: ($) => v($, S),
|
|
1769
1803
|
type: "button",
|
|
1770
|
-
class:
|
|
1804
|
+
class: R(["segmented__item", { "is-active": e.modelValue === d.value }]),
|
|
1771
1805
|
role: "radio",
|
|
1772
|
-
"aria-checked": e.modelValue ===
|
|
1773
|
-
disabled:
|
|
1774
|
-
onClick: ($) => L(
|
|
1775
|
-
},
|
|
1806
|
+
"aria-checked": e.modelValue === d.value,
|
|
1807
|
+
disabled: d.disabled,
|
|
1808
|
+
onClick: ($) => L(d)
|
|
1809
|
+
}, P(d.label), 11, Tl))), 128))
|
|
1776
1810
|
], 512));
|
|
1777
1811
|
}
|
|
1778
|
-
},
|
|
1779
|
-
function
|
|
1812
|
+
}, Ol = /* @__PURE__ */ G(Vl, [["__scopeId", "data-v-8bff3e5b"]]);
|
|
1813
|
+
function Rl(e) {
|
|
1780
1814
|
return e == null || e === "" ? [] : Array.isArray(e) ? e.map((l) => String(l).trim()).filter(Boolean) : String(e).split(",").map((l) => l.trim()).filter(Boolean);
|
|
1781
1815
|
}
|
|
1782
|
-
function
|
|
1816
|
+
function Dl(e) {
|
|
1783
1817
|
if (!e.parentNode) {
|
|
1784
1818
|
e.style.display = "none";
|
|
1785
1819
|
return;
|
|
@@ -1790,75 +1824,75 @@ function Tl(e) {
|
|
|
1790
1824
|
}
|
|
1791
1825
|
e.parentNode.removeChild(e);
|
|
1792
1826
|
}
|
|
1793
|
-
function
|
|
1794
|
-
const n =
|
|
1827
|
+
function he(e, l, t, s = !1) {
|
|
1828
|
+
const n = Rl(l.value);
|
|
1795
1829
|
if (!n.length) return;
|
|
1796
|
-
let
|
|
1797
|
-
s && (
|
|
1830
|
+
let i = Ve(n, t);
|
|
1831
|
+
s && (i = !i), i || Dl(e);
|
|
1798
1832
|
}
|
|
1799
|
-
function
|
|
1833
|
+
function Il(e) {
|
|
1800
1834
|
e.directive("hasPermission", {
|
|
1801
1835
|
mounted(l, t) {
|
|
1802
|
-
|
|
1836
|
+
he(l, t, "and");
|
|
1803
1837
|
}
|
|
1804
1838
|
}), e.directive("hasAnyPermission", {
|
|
1805
1839
|
mounted(l, t) {
|
|
1806
|
-
|
|
1840
|
+
he(l, t, "or");
|
|
1807
1841
|
}
|
|
1808
1842
|
}), e.directive("hasNoPermission", {
|
|
1809
1843
|
mounted(l, t) {
|
|
1810
|
-
|
|
1844
|
+
he(l, t, "or", !0);
|
|
1811
1845
|
}
|
|
1812
1846
|
});
|
|
1813
1847
|
}
|
|
1814
|
-
const
|
|
1815
|
-
MgImageUpload:
|
|
1816
|
-
MgFileUpload:
|
|
1817
|
-
MgSearchForm:
|
|
1818
|
-
MgDataTable:
|
|
1819
|
-
MgDateRangePicker:
|
|
1820
|
-
MgSegmentedControl:
|
|
1821
|
-
MgOverflowHid:
|
|
1822
|
-
},
|
|
1823
|
-
Object.entries(
|
|
1824
|
-
e.component(
|
|
1825
|
-
}), l.ossUrl &&
|
|
1826
|
-
const t =
|
|
1827
|
-
|
|
1828
|
-
},
|
|
1829
|
-
install:
|
|
1848
|
+
const Al = {
|
|
1849
|
+
MgImageUpload: jt,
|
|
1850
|
+
MgFileUpload: nl,
|
|
1851
|
+
MgSearchForm: yl,
|
|
1852
|
+
MgDataTable: Pl,
|
|
1853
|
+
MgDateRangePicker: We,
|
|
1854
|
+
MgSegmentedControl: Ol,
|
|
1855
|
+
MgOverflowHid: qe
|
|
1856
|
+
}, Hl = (e, l = {}) => {
|
|
1857
|
+
Object.entries(Al).forEach(([n, i]) => {
|
|
1858
|
+
e.component(i.name || n, i);
|
|
1859
|
+
}), l.ossUrl && vt(l.ossUrl), typeof l.getPermissions == "function" && dt(l.getPermissions), Il(e);
|
|
1860
|
+
const t = pt(l), s = ft(t);
|
|
1861
|
+
ht(t), mt(s), e.config.globalProperties.$request = t, e.config.globalProperties.$api = s, e.config.globalProperties.$hasPermission = Ve;
|
|
1862
|
+
}, Wl = {
|
|
1863
|
+
install: Hl,
|
|
1830
1864
|
version: "1.0.5"
|
|
1831
1865
|
};
|
|
1832
1866
|
export {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1867
|
+
Pl as DataTable,
|
|
1868
|
+
We as DateRangePicker,
|
|
1869
|
+
nl as FileUpload,
|
|
1870
|
+
jt as ImageUpload,
|
|
1871
|
+
yl as SearchForm,
|
|
1872
|
+
Ol as SegmentedControl,
|
|
1873
|
+
qe as TableOverflowHid,
|
|
1874
|
+
je as aliOssMixin,
|
|
1875
|
+
Xl as checkPermission,
|
|
1876
|
+
ft as createApi,
|
|
1877
|
+
ye as createOssClient,
|
|
1878
|
+
pt as createRequest,
|
|
1879
|
+
Jl as createService,
|
|
1880
|
+
Wl as default,
|
|
1881
|
+
ut as getApi,
|
|
1882
|
+
He as getOssSts,
|
|
1883
|
+
Ql as getPermissionGetter,
|
|
1884
|
+
Zl as getRequest,
|
|
1885
|
+
en as getSystemId,
|
|
1886
|
+
tn as getUserId,
|
|
1887
|
+
Ve as hasPermission,
|
|
1888
|
+
Hl as install,
|
|
1889
|
+
Il as installPermissionDirectives,
|
|
1890
|
+
mt as setApi,
|
|
1891
|
+
vt as setDefaultOssUrl,
|
|
1892
|
+
dt as setPermissionGetter,
|
|
1893
|
+
ht as setRequest,
|
|
1894
|
+
ln as setSystemId,
|
|
1895
|
+
nn as setUserId,
|
|
1896
|
+
ze as uploadToOss,
|
|
1897
|
+
sn as utils
|
|
1864
1898
|
};
|