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