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