mgacn-commonsdk 1.1.7 → 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 +916 -927
- 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 $, openBlock as d, createElementBlock 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
|
-
function
|
|
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 || "",
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
const h = e.region || (
|
|
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
|
+
let o = String(e.endPoint || e.endpoint || e.EndPoint || "").replace(/^https?:\/\//i, "").replace(/\/$/, "");
|
|
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:
|
|
45
|
-
endPoint:
|
|
43
|
+
securityToken: r,
|
|
44
|
+
bucketName: a,
|
|
45
|
+
endPoint: o,
|
|
46
46
|
region: h,
|
|
47
|
-
ossUrl:
|
|
47
|
+
ossUrl: f || F
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
51
|
-
const { dir: n, foldName: t, getOss:
|
|
52
|
-
if (!
|
|
50
|
+
async function be(e = {}) {
|
|
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
|
|
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 h == "function" && h(Math.min(100, Math.max(0, Math.floor(Number(
|
|
81
|
-
},
|
|
82
|
-
progress: async (
|
|
83
|
-
|
|
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
|
+
progress: async (V) => {
|
|
83
|
+
L(V);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
let u;
|
|
87
|
-
const
|
|
88
|
-
const z =
|
|
89
|
-
return
|
|
90
|
-
...
|
|
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
91
|
...z ? { headers: z } : {}
|
|
92
|
-
}) :
|
|
93
|
-
...
|
|
92
|
+
}) : f.put(_, t, {
|
|
93
|
+
...v,
|
|
94
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:
|
|
113
|
+
name: _,
|
|
114
114
|
url: B,
|
|
115
|
-
previewUrl:
|
|
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
|
-
const
|
|
129
|
-
t.startsWith(`${
|
|
128
|
+
const o = String(n).replace(/\/$/, "");
|
|
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
|
|
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,50 +145,50 @@ async function wt(e, n = {}) {
|
|
|
145
145
|
const Ee = {
|
|
146
146
|
methods: {
|
|
147
147
|
getDir() {
|
|
148
|
-
return
|
|
148
|
+
return ve(this.foldName || "portal_cms");
|
|
149
149
|
},
|
|
150
|
-
randomString:
|
|
150
|
+
randomString: ze,
|
|
151
151
|
getOss() {
|
|
152
|
-
return
|
|
152
|
+
return je(this.getDir());
|
|
153
153
|
},
|
|
154
154
|
async createOssClient() {
|
|
155
|
-
return
|
|
155
|
+
return be({
|
|
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 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,24 +253,24 @@ const xt = {
|
|
|
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: {
|
|
260
260
|
immediate: !0,
|
|
261
261
|
handler(e) {
|
|
262
|
-
var
|
|
263
|
-
if ((
|
|
264
|
-
const n =
|
|
265
|
-
if (n.length === t.length && n.every((h,
|
|
262
|
+
var o;
|
|
263
|
+
if ((o = this.initFileList) != null && o.length) return;
|
|
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
|
|
267
|
+
const r = new Map(
|
|
268
268
|
this.fileList.map((h) => [h.url, h.previewUrl]).filter(([h]) => h)
|
|
269
|
-
),
|
|
269
|
+
), a = Pe(n).map((h) => ({
|
|
270
270
|
...h,
|
|
271
|
-
previewUrl:
|
|
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 xt = {
|
|
|
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 xt = {
|
|
|
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 xt = {
|
|
|
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
|
|
363
|
+
const a = [], o = [];
|
|
364
364
|
if (n.forEach((h) => {
|
|
365
|
-
this.acceptList.includes(
|
|
366
|
-
}),
|
|
367
|
-
const h =
|
|
368
|
-
|
|
369
|
-
`已过滤以下 ${
|
|
365
|
+
this.acceptList.includes(Mt(h.name)) ? a.push(h) : o.push(h);
|
|
366
|
+
}), o.length) {
|
|
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 xt = {
|
|
|
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 xt = {
|
|
|
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
|
-
this.fileList.push(
|
|
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 xt = {
|
|
|
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 xt = {
|
|
|
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([h], `${Date.now()}.${
|
|
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,217 +484,217 @@ const xt = {
|
|
|
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 h = $("el-image"),
|
|
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
|
-
multiple:
|
|
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: ue((
|
|
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",
|
|
604
604
|
"append-to-body": "",
|
|
605
605
|
class: "mg-image-upload-dialog",
|
|
606
606
|
"close-on-click-modal": !1,
|
|
607
|
-
onClose:
|
|
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
|
-
onClick:
|
|
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
|
-
onClick:
|
|
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
|
|
666
|
-
let
|
|
667
|
-
function
|
|
668
|
-
return
|
|
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
|
+
let Te = 0;
|
|
667
|
+
function Ye() {
|
|
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
|
-
uid:
|
|
683
|
-
name:
|
|
682
|
+
uid: Ye(),
|
|
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 Wt = {
|
|
|
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 Wt = {
|
|
|
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 Wt = {
|
|
|
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 Wt = {
|
|
|
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
|
|
807
|
-
if (n.forEach((
|
|
808
|
-
this.acceptList.includes(
|
|
809
|
-
}),
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
`已过滤以下 ${
|
|
806
|
+
const r = [], a = [];
|
|
807
|
+
if (n.forEach((o) => {
|
|
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 Wt = {
|
|
|
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
|
|
834
|
-
uid:
|
|
835
|
-
name:
|
|
833
|
+
const a = {
|
|
834
|
+
uid: Ye(),
|
|
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,102 +867,102 @@ const Wt = {
|
|
|
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 h = $("el-button"),
|
|
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",
|
|
884
|
-
multiple:
|
|
884
|
+
multiple: o.multiple,
|
|
885
885
|
accept: t.accept,
|
|
886
886
|
disabled: t.disabled,
|
|
887
|
-
onChange: n[0] || (n[0] = (...u) =>
|
|
888
|
-
}, null, 40,
|
|
889
|
-
t.showButton ? (d(),
|
|
887
|
+
onChange: n[0] || (n[0] = (...u) => o.onFileChange && o.onFileChange(...u))
|
|
888
|
+
}, null, 40, tn),
|
|
889
|
+
t.showButton ? (d(), P(h, {
|
|
890
890
|
key: 0,
|
|
891
891
|
type: "primary",
|
|
892
|
-
disabled: t.disabled || !
|
|
893
|
-
onClick:
|
|
892
|
+
disabled: t.disabled || !o.showUploadBtn,
|
|
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
|
-
|
|
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: ue((
|
|
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(), F
|
|
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(), F
|
|
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(), F
|
|
943
|
+
u.status !== "uploading" ? (d(), P(F, {
|
|
944
944
|
key: 0,
|
|
945
945
|
class: "el-icon--close",
|
|
946
946
|
title: "删除",
|
|
947
|
-
onClick: ue((
|
|
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: {
|
|
@@ -988,94 +988,84 @@ const ln = /* @__PURE__ */ X(Wt, [["render", nn], ["__scopeId", "data-v-07dac048
|
|
|
988
988
|
canClearable: { type: Boolean, default: !0 },
|
|
989
989
|
/** 是否展示快捷区间;默认开启 */
|
|
990
990
|
showShortcuts: { type: Boolean, default: !0 },
|
|
991
|
-
/**
|
|
991
|
+
/** 自定义快捷项;不传则使用内置:七天内 / 一个月内 / 一年内 */
|
|
992
992
|
shortcuts: { type: Array, default: void 0 }
|
|
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
|
|
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 h(
|
|
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
|
-
text: "
|
|
1012
|
-
value: () => h((
|
|
1013
|
-
|
|
1011
|
+
text: "七天内",
|
|
1012
|
+
value: () => h((g) => {
|
|
1013
|
+
g.setDate(g.getDate() - 6);
|
|
1014
1014
|
})
|
|
1015
1015
|
},
|
|
1016
1016
|
{
|
|
1017
1017
|
text: "一个月内",
|
|
1018
|
-
value: () => h((
|
|
1019
|
-
|
|
1018
|
+
value: () => h((g) => {
|
|
1019
|
+
g.setMonth(g.getMonth() - 1);
|
|
1020
1020
|
})
|
|
1021
1021
|
},
|
|
1022
1022
|
{
|
|
1023
1023
|
text: "一年内",
|
|
1024
|
-
value: () => h((
|
|
1025
|
-
|
|
1024
|
+
value: () => h((g) => {
|
|
1025
|
+
g.setFullYear(g.getFullYear() - 1);
|
|
1026
1026
|
})
|
|
1027
1027
|
}
|
|
1028
|
-
],
|
|
1029
|
-
var
|
|
1030
|
-
if (
|
|
1031
|
-
return (
|
|
1032
|
-
}),
|
|
1028
|
+
], F = me(() => {
|
|
1029
|
+
var g;
|
|
1030
|
+
if (r.showShortcuts)
|
|
1031
|
+
return (g = r.shortcuts) != null && g.length ? r.shortcuts : f;
|
|
1032
|
+
}), _ = A([]);
|
|
1033
1033
|
le(
|
|
1034
|
-
() => [
|
|
1035
|
-
([
|
|
1036
|
-
|
|
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 (
|
|
1044
|
+
return (g, v) => {
|
|
1045
1045
|
const u = $("el-date-picker");
|
|
1046
|
-
return d(),
|
|
1047
|
-
modelValue:
|
|
1048
|
-
"onUpdate:modelValue":
|
|
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
|
-
"start-placeholder": `${e.title}
|
|
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
|
-
},
|
|
1063
|
-
key:
|
|
1064
|
-
class: "common-search__label"
|
|
1065
|
-
}, rn = ["onKeyup"], cn = { class: "common-search__range-sep" }, un = {
|
|
1066
|
-
key: 6,
|
|
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
|
+
key: 5,
|
|
1067
1064
|
class: "common-search__range"
|
|
1068
|
-
},
|
|
1069
|
-
key: 0,
|
|
1070
|
-
class: "common-search__scroll-hint",
|
|
1071
|
-
"aria-hidden": "true"
|
|
1072
|
-
}, pn = {
|
|
1065
|
+
}, yn = {
|
|
1073
1066
|
key: 0,
|
|
1074
1067
|
class: "common-search__actions is-inline"
|
|
1075
|
-
},
|
|
1076
|
-
key: 0,
|
|
1077
|
-
class: "common-search__footer"
|
|
1078
|
-
}, mn = { class: "common-search__actions is-bottom" }, gn = { class: "common-search__actions-main" }, yn = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
|
|
1068
|
+
}, vn = { class: "common-search__actions-main" }, bn = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
|
|
1079
1069
|
__name: "SearchForm",
|
|
1080
1070
|
props: {
|
|
1081
1071
|
modelValue: { type: Object, default: () => ({}) },
|
|
@@ -1083,448 +1073,447 @@ const ln = /* @__PURE__ */ X(Wt, [["render", nn], ["__scopeId", "data-v-07dac048
|
|
|
1083
1073
|
},
|
|
1084
1074
|
emits: ["change", "search", "reset", "update:modelValue"],
|
|
1085
1075
|
setup(e, { emit: n }) {
|
|
1086
|
-
const t = e,
|
|
1087
|
-
let
|
|
1088
|
-
function
|
|
1089
|
-
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 ?? {});
|
|
1090
1080
|
}
|
|
1091
|
-
const
|
|
1092
|
-
let
|
|
1093
|
-
const
|
|
1094
|
-
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))
|
|
1095
1085
|
return {
|
|
1096
|
-
maxHeight: `${
|
|
1097
|
-
|
|
1098
|
-
overflow: U.value ? "auto" : "hidden"
|
|
1086
|
+
maxHeight: `${U.value}px`,
|
|
1087
|
+
overflow: "hidden"
|
|
1099
1088
|
};
|
|
1100
1089
|
});
|
|
1101
|
-
function D(
|
|
1102
|
-
|
|
1103
|
-
return Math.min(o, K);
|
|
1090
|
+
function D(l = {}) {
|
|
1091
|
+
return String(l.label || l.title || "").trim();
|
|
1104
1092
|
}
|
|
1105
|
-
function
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1093
|
+
function V(l = {}) {
|
|
1094
|
+
return String(l.tip || D(l) || "").trim();
|
|
1095
|
+
}
|
|
1096
|
+
function z(l = "") {
|
|
1097
|
+
const i = String(l).trim();
|
|
1098
|
+
return !i || (/* @__PURE__ */ new Set(["全部", "或选择", "请输入或选择"])).has(i) ? "" : i.replace(/^请(输入|选择)/, "").trim() || i;
|
|
1099
|
+
}
|
|
1100
|
+
function J(l = {}, i = "") {
|
|
1101
|
+
if (l.placeholder != null && l.placeholder !== "") {
|
|
1102
|
+
const k = z(l.placeholder);
|
|
1103
|
+
if (k) return k;
|
|
1110
1104
|
}
|
|
1111
|
-
|
|
1105
|
+
const p = D(l);
|
|
1106
|
+
return p || z(i) || i;
|
|
1112
1107
|
}
|
|
1113
|
-
function
|
|
1114
|
-
|
|
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;
|
|
1115
1111
|
}
|
|
1116
1112
|
le(
|
|
1117
1113
|
() => t.modelValue,
|
|
1118
|
-
(
|
|
1119
|
-
|
|
1120
|
-
|
|
1114
|
+
(l) => {
|
|
1115
|
+
F(l, a.value) || (f = !0, a.value = { ...l || {} }, Z(() => {
|
|
1116
|
+
f = !1;
|
|
1121
1117
|
}));
|
|
1122
1118
|
},
|
|
1123
1119
|
{ deep: !0, immediate: !0 }
|
|
1124
1120
|
), le(
|
|
1125
|
-
|
|
1121
|
+
a,
|
|
1126
1122
|
() => {
|
|
1127
|
-
|
|
1123
|
+
f || r("update:modelValue", { ...a.value });
|
|
1128
1124
|
},
|
|
1129
1125
|
{ deep: !0 }
|
|
1130
1126
|
), le(
|
|
1131
1127
|
() => t.itemList,
|
|
1132
1128
|
() => {
|
|
1133
|
-
|
|
1129
|
+
L.value = !1, v.value = 0, Z(() => Q());
|
|
1134
1130
|
},
|
|
1135
1131
|
{ deep: !0 }
|
|
1136
|
-
),
|
|
1137
|
-
|
|
1138
|
-
!B && !
|
|
1139
|
-
}),
|
|
1140
|
-
}),
|
|
1141
|
-
|
|
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);
|
|
1142
1138
|
});
|
|
1143
|
-
function
|
|
1144
|
-
!B && !
|
|
1139
|
+
function we() {
|
|
1140
|
+
!B && !m && Q();
|
|
1145
1141
|
}
|
|
1146
|
-
function
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
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;
|
|
1147
|
+
}
|
|
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;
|
|
1155
|
+
}
|
|
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;
|
|
1166
|
+
}
|
|
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 };
|
|
1150
1179
|
}
|
|
1151
|
-
function
|
|
1152
|
-
if (
|
|
1153
|
-
if (typeof
|
|
1154
|
-
const
|
|
1155
|
-
return typeof
|
|
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;
|
|
1156
1185
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1186
|
+
function re(l, i) {
|
|
1187
|
+
return l == null || typeof l != "object" ? l : l[i.optionsValue || "value"];
|
|
1159
1188
|
}
|
|
1160
|
-
function de(
|
|
1189
|
+
function de(l) {
|
|
1161
1190
|
return {
|
|
1162
|
-
startKey:
|
|
1163
|
-
endKey:
|
|
1191
|
+
startKey: l.start || `${l.prop}Min`,
|
|
1192
|
+
endKey: l.end || `${l.prop}Max`
|
|
1164
1193
|
};
|
|
1165
1194
|
}
|
|
1166
|
-
function
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
const
|
|
1171
|
-
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;
|
|
1172
1201
|
}
|
|
1173
|
-
function pe(
|
|
1174
|
-
const { startKey:
|
|
1175
|
-
let
|
|
1176
|
-
|
|
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;
|
|
1177
1206
|
}
|
|
1178
|
-
function
|
|
1179
|
-
pe(
|
|
1207
|
+
function tt(l) {
|
|
1208
|
+
pe(l), W();
|
|
1180
1209
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const { startKey:
|
|
1183
|
-
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 !== "";
|
|
1184
1213
|
}
|
|
1185
|
-
function
|
|
1186
|
-
if (
|
|
1187
|
-
const { startKey:
|
|
1188
|
-
|
|
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();
|
|
1189
1218
|
}
|
|
1190
|
-
async function
|
|
1191
|
-
if (typeof
|
|
1192
|
-
h[
|
|
1219
|
+
async function st(l, i) {
|
|
1220
|
+
if (typeof l.remoteMethod == "function") {
|
|
1221
|
+
h[l.prop] = !0;
|
|
1193
1222
|
try {
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1223
|
+
const p = await l.remoteMethod(i);
|
|
1224
|
+
o[l.prop] = Array.isArray(p) ? p : [];
|
|
1196
1225
|
} finally {
|
|
1197
|
-
h[
|
|
1226
|
+
h[l.prop] = !1;
|
|
1198
1227
|
}
|
|
1199
1228
|
}
|
|
1200
1229
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
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;
|
|
1206
1235
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const
|
|
1209
|
-
if (!
|
|
1236
|
+
function Q() {
|
|
1237
|
+
const l = _.value;
|
|
1238
|
+
if (!l || B || m) return;
|
|
1210
1239
|
B = !0;
|
|
1211
|
-
const
|
|
1212
|
-
if (!
|
|
1213
|
-
|
|
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;
|
|
1214
1243
|
return;
|
|
1215
1244
|
}
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
let
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
}
|
|
1225
|
-
V + T + J > P ? (K += 1, V = J) : V += T + J;
|
|
1226
|
-
});
|
|
1227
|
-
const ie = K > 1;
|
|
1228
|
-
f.value = ie, ie ? U.value ? i.value = D(u.value) : i.value = _.value : (U.value = !1, i.value = null), B = !1, W(() => O());
|
|
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());
|
|
1229
1253
|
}
|
|
1230
|
-
function
|
|
1231
|
-
const
|
|
1232
|
-
if (!
|
|
1233
|
-
|
|
1234
|
-
const
|
|
1235
|
-
if (
|
|
1236
|
-
|
|
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(() => {
|
|
1237
1261
|
requestAnimationFrame(() => {
|
|
1238
|
-
|
|
1262
|
+
U.value = u.value;
|
|
1239
1263
|
});
|
|
1240
1264
|
});
|
|
1241
1265
|
else {
|
|
1242
|
-
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
const P = D(w);
|
|
1246
|
-
U.value = !0, requestAnimationFrame(() => {
|
|
1266
|
+
U.value = i;
|
|
1267
|
+
const p = fe(l);
|
|
1268
|
+
c.value = p, L.value = !0, requestAnimationFrame(() => {
|
|
1247
1269
|
requestAnimationFrame(() => {
|
|
1248
|
-
|
|
1270
|
+
U.value = Math.max(p, u.value || 0);
|
|
1249
1271
|
});
|
|
1250
1272
|
});
|
|
1251
1273
|
}
|
|
1252
1274
|
window.setTimeout(() => {
|
|
1253
|
-
|
|
1275
|
+
m = !1, L.value && (U.value = null), Q();
|
|
1254
1276
|
}, 380);
|
|
1255
1277
|
}
|
|
1256
|
-
function
|
|
1257
|
-
const
|
|
1258
|
-
return t.itemList.forEach((
|
|
1259
|
-
|
|
1260
|
-
}),
|
|
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;
|
|
1261
1283
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1284
|
+
function Ue() {
|
|
1285
|
+
r("update:modelValue", { ...a.value });
|
|
1264
1286
|
}
|
|
1265
|
-
function
|
|
1266
|
-
|
|
1287
|
+
function W() {
|
|
1288
|
+
Ue(), r("change", { ...a.value }), r("search", { ...a.value });
|
|
1267
1289
|
}
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1290
|
+
function xe() {
|
|
1291
|
+
a.value = rt(), Ue(), r("reset", { ...a.value }), r("change", { ...a.value });
|
|
1270
1292
|
}
|
|
1271
|
-
return (
|
|
1272
|
-
const
|
|
1273
|
-
return
|
|
1274
|
-
class:
|
|
1275
|
-
"is-single-row": !
|
|
1276
|
-
"is-multi-row":
|
|
1277
|
-
"is-expanded":
|
|
1278
|
-
"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
|
|
1279
1301
|
}])
|
|
1280
1302
|
}, [
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1303
|
+
w("div", pn, [
|
|
1304
|
+
w("div", {
|
|
1305
|
+
ref_key: "fieldsRef",
|
|
1306
|
+
ref: _,
|
|
1307
|
+
class: "common-search__fields",
|
|
1308
|
+
style: ae(E.value)
|
|
1284
1309
|
}, [
|
|
1285
|
-
b(
|
|
1286
|
-
|
|
1287
|
-
ref: v,
|
|
1288
|
-
class: "common-search__fields",
|
|
1289
|
-
style: se(j.value),
|
|
1290
|
-
onScrollPassive: z
|
|
1310
|
+
(d(!0), b(Y, null, G(e.itemList, (s, oe) => (d(), b(Y, {
|
|
1311
|
+
key: s.prop || s.start || oe
|
|
1291
1312
|
}, [
|
|
1292
|
-
(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
style: se(Ge(l))
|
|
1313
|
+
w("div", {
|
|
1314
|
+
class: H(["common-search__field", [`is-${s.type}`, s.className]]),
|
|
1315
|
+
style: ae(et(s))
|
|
1296
1316
|
}, [
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
"
|
|
1302
|
-
modelModifiers: { trim: !0 },
|
|
1303
|
-
clearable: "",
|
|
1304
|
-
placeholder: l.placeholder || `请输入${l.label || ""}`,
|
|
1305
|
-
maxlength: l.maxlength || 200,
|
|
1306
|
-
disabled: l.disabled,
|
|
1307
|
-
onKeyup: xe(H, ["enter"])
|
|
1308
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : l.type === "select" ? (d(), F(T, {
|
|
1309
|
-
key: 2,
|
|
1310
|
-
modelValue: s.value[l.prop],
|
|
1311
|
-
"onUpdate:modelValue": (y) => s.value[l.prop] = y,
|
|
1312
|
-
placeholder: l.placeholder || `请选择${l.label || ""}`,
|
|
1313
|
-
clearable: "",
|
|
1314
|
-
filterable: l.filterable !== !1,
|
|
1315
|
-
multiple: l.multiple,
|
|
1316
|
-
"collapse-tags": l.multiple,
|
|
1317
|
-
"collapse-tags-tooltip": l.multiple,
|
|
1318
|
-
disabled: l.disabled,
|
|
1319
|
-
class: "common-search__control",
|
|
1320
|
-
onChange: H
|
|
1321
|
-
}, {
|
|
1322
|
-
default: k(() => [
|
|
1323
|
-
(d(!0), m(q, null, G(l.options || [], (y, fe) => (d(), F(P, {
|
|
1324
|
-
key: `${oe(y, l)}-${fe}`,
|
|
1325
|
-
label: _e(y, l),
|
|
1326
|
-
value: oe(y, l),
|
|
1327
|
-
disabled: typeof y == "object" && (y == null ? void 0 : y.disabled)
|
|
1328
|
-
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1329
|
-
]),
|
|
1330
|
-
_: 2
|
|
1331
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : l.type === "remote-select" || l.type === "remoteSelect" ? (d(), F(T, {
|
|
1332
|
-
key: 3,
|
|
1333
|
-
modelValue: s.value[l.prop],
|
|
1334
|
-
"onUpdate:modelValue": (y) => s.value[l.prop] = y,
|
|
1335
|
-
placeholder: l.placeholder || "请输入关键词搜索",
|
|
1336
|
-
clearable: "",
|
|
1337
|
-
filterable: "",
|
|
1338
|
-
remote: "",
|
|
1339
|
-
multiple: l.multiple,
|
|
1340
|
-
"collapse-tags": l.multiple,
|
|
1341
|
-
"collapse-tags-tooltip": l.multiple,
|
|
1342
|
-
"reserve-keyword": !1,
|
|
1343
|
-
"remote-method": (y) => Ze(l, y),
|
|
1344
|
-
loading: !!h[l.prop],
|
|
1345
|
-
disabled: l.disabled,
|
|
1346
|
-
class: "common-search__control",
|
|
1347
|
-
onClear: (y) => r[l.prop] = [],
|
|
1348
|
-
onChange: H
|
|
1317
|
+
x(q, {
|
|
1318
|
+
content: V(s),
|
|
1319
|
+
disabled: !V(s),
|
|
1320
|
+
placement: "top",
|
|
1321
|
+
"show-after": 280
|
|
1349
1322
|
}, {
|
|
1350
|
-
default:
|
|
1351
|
-
(
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1323
|
+
default: S(() => [
|
|
1324
|
+
w("div", fn, [
|
|
1325
|
+
s.type === "input" || s.type === "text" ? (d(), P(p, {
|
|
1326
|
+
key: 0,
|
|
1327
|
+
modelValue: a.value[s.prop],
|
|
1328
|
+
"onUpdate:modelValue": (y) => a.value[s.prop] = y,
|
|
1329
|
+
modelModifiers: { trim: !0 },
|
|
1330
|
+
clearable: "",
|
|
1331
|
+
placeholder: J(s, "请输入"),
|
|
1332
|
+
maxlength: s.maxlength || 200,
|
|
1333
|
+
disabled: s.disabled,
|
|
1334
|
+
class: "common-search__control",
|
|
1335
|
+
onKeyup: Fe(W, ["enter"])
|
|
1336
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : s.type === "select" ? (d(), P(k, {
|
|
1337
|
+
key: 1,
|
|
1338
|
+
modelValue: a.value[s.prop],
|
|
1339
|
+
"onUpdate:modelValue": (y) => a.value[s.prop] = y,
|
|
1340
|
+
placeholder: J(s, "请选择"),
|
|
1341
|
+
clearable: "",
|
|
1342
|
+
filterable: s.filterable !== !1,
|
|
1343
|
+
multiple: s.multiple,
|
|
1344
|
+
"collapse-tags": s.multiple,
|
|
1345
|
+
"collapse-tags-tooltip": s.multiple,
|
|
1346
|
+
disabled: s.disabled,
|
|
1347
|
+
class: "common-search__control",
|
|
1348
|
+
onChange: W
|
|
1349
|
+
}, {
|
|
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)
|
|
1356
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1357
|
+
]),
|
|
1358
|
+
_: 2
|
|
1359
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : s.type === "remote-select" || s.type === "remoteSelect" ? (d(), P(k, {
|
|
1360
|
+
key: 2,
|
|
1361
|
+
modelValue: a.value[s.prop],
|
|
1362
|
+
"onUpdate:modelValue": (y) => a.value[s.prop] = y,
|
|
1363
|
+
placeholder: J(s, "请输入关键词搜索"),
|
|
1364
|
+
clearable: "",
|
|
1365
|
+
filterable: "",
|
|
1366
|
+
remote: "",
|
|
1367
|
+
multiple: s.multiple,
|
|
1368
|
+
"collapse-tags": s.multiple,
|
|
1369
|
+
"collapse-tags-tooltip": s.multiple,
|
|
1370
|
+
"reserve-keyword": !1,
|
|
1371
|
+
"remote-method": (y) => st(s, y),
|
|
1372
|
+
loading: !!h[s.prop],
|
|
1373
|
+
disabled: s.disabled,
|
|
1374
|
+
class: "common-search__control",
|
|
1375
|
+
onClear: (y) => o[s.prop] = [],
|
|
1376
|
+
onChange: W
|
|
1377
|
+
}, {
|
|
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)
|
|
1384
|
+
}, null, 8, ["label", "value", "disabled"]))), 128))
|
|
1385
|
+
]),
|
|
1386
|
+
_: 2
|
|
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", {
|
|
1388
|
+
key: 3,
|
|
1389
|
+
class: "common-search__range common-search__range--number",
|
|
1390
|
+
onKeyup: Fe((y) => tt(s), ["enter"])
|
|
1391
|
+
}, [
|
|
1392
|
+
x(M, {
|
|
1393
|
+
modelValue: a.value[s.start || `${s.prop}Min`],
|
|
1394
|
+
"onUpdate:modelValue": (y) => a.value[s.start || `${s.prop}Min`] = y,
|
|
1395
|
+
controls: !1,
|
|
1396
|
+
min: s.min,
|
|
1397
|
+
max: s.max,
|
|
1398
|
+
placeholder: _e(s, "min"),
|
|
1399
|
+
disabled: s.disabled,
|
|
1400
|
+
class: "common-search__range-input",
|
|
1401
|
+
onBlur: (y) => pe(s)
|
|
1402
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
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,
|
|
1407
|
+
controls: !1,
|
|
1408
|
+
min: s.min,
|
|
1409
|
+
max: s.max,
|
|
1410
|
+
placeholder: _e(s, "max"),
|
|
1411
|
+
disabled: s.disabled,
|
|
1412
|
+
class: "common-search__range-input",
|
|
1413
|
+
onBlur: (y) => pe(s)
|
|
1414
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "placeholder", "disabled", "onBlur"]),
|
|
1415
|
+
s.clearable !== !1 && nt(s) ? (d(), P(O, {
|
|
1416
|
+
key: 0,
|
|
1417
|
+
class: "common-search__range-clear",
|
|
1418
|
+
onMousedown: i[0] || (i[0] = ue(() => {
|
|
1419
|
+
}, ["prevent"])),
|
|
1420
|
+
onClick: (y) => lt(s)
|
|
1421
|
+
}, {
|
|
1422
|
+
default: S(() => [
|
|
1423
|
+
x(ce(De))
|
|
1424
|
+
]),
|
|
1425
|
+
_: 1
|
|
1426
|
+
}, 8, ["onClick"])) : R("", !0)
|
|
1427
|
+
], 40, hn)) : s.type === "date" ? (d(), P(I, {
|
|
1428
|
+
key: 4,
|
|
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,
|
|
1437
|
+
class: "common-search__control"
|
|
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
|
|
1452
|
+
}, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end", "title", "type", "value-format", "format", "show-shortcuts", "shortcuts", "can-clearable"])
|
|
1453
|
+
])) : se(l.$slots, s.slotName || s.prop, {
|
|
1454
|
+
item: s,
|
|
1455
|
+
form: a.value
|
|
1456
|
+
}, void 0, !0, 6)
|
|
1457
|
+
])
|
|
1357
1458
|
]),
|
|
1358
1459
|
_: 2
|
|
1359
|
-
}, 1032, ["
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1460
|
+
}, 1032, ["content", "disabled"])
|
|
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, {
|
|
1388
1490
|
key: 0,
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
onClick: (y) => Qe(l)
|
|
1491
|
+
link: "",
|
|
1492
|
+
type: "primary",
|
|
1493
|
+
onClick: at
|
|
1393
1494
|
}, {
|
|
1394
|
-
default:
|
|
1395
|
-
|
|
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
|
+
})
|
|
1396
1503
|
]),
|
|
1397
1504
|
_: 1
|
|
1398
|
-
}
|
|
1399
|
-
]
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
placeholder: l.placeholder || "年/月/日",
|
|
1405
|
-
"value-format": l.valueFormat || "YYYY-MM-DD",
|
|
1406
|
-
format: l.format || "YYYY/MM/DD",
|
|
1407
|
-
clearable: l.clearable !== !1,
|
|
1408
|
-
disabled: l.disabled,
|
|
1409
|
-
class: "common-search__control"
|
|
1410
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : l.type === "daterange" || l.type === "dateRange" ? (d(), m("div", un, [
|
|
1411
|
-
C(We, {
|
|
1412
|
-
start: s.value[l.start || l.startProp],
|
|
1413
|
-
"onUpdate:start": (y) => s.value[l.start || l.startProp] = y,
|
|
1414
|
-
end: s.value[l.end || l.endProp],
|
|
1415
|
-
"onUpdate:end": (y) => s.value[l.end || l.endProp] = y,
|
|
1416
|
-
title: l.label || l.title || "",
|
|
1417
|
-
type: l.dateType || l.pickerType || "daterange",
|
|
1418
|
-
"value-format": l.valueFormat || "YYYY-MM-DD HH:mm:ss",
|
|
1419
|
-
format: l.format,
|
|
1420
|
-
"show-shortcuts": l.showShortcuts !== !1,
|
|
1421
|
-
shortcuts: l.shortcuts,
|
|
1422
|
-
"can-clearable": l.clearable !== !1,
|
|
1423
|
-
onChange: H
|
|
1424
|
-
}, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end", "title", "type", "value-format", "format", "show-shortcuts", "shortcuts", "can-clearable"])
|
|
1425
|
-
])) : ee(o.$slots, l.slotName || l.prop, {
|
|
1426
|
-
item: l,
|
|
1427
|
-
form: s.value
|
|
1428
|
-
}, void 0, !0, 7)
|
|
1429
|
-
], 6))), 128))
|
|
1430
|
-
], 36),
|
|
1431
|
-
L.value ? (d(), m("div", dn, [
|
|
1432
|
-
C(K, { size: 12 }, {
|
|
1433
|
-
default: k(() => [
|
|
1434
|
-
C(ne(ke))
|
|
1435
|
-
]),
|
|
1436
|
-
_: 1
|
|
1437
|
-
}),
|
|
1438
|
-
c[1] || (c[1] = b("span", null, "向下滑动查看更多", -1))
|
|
1439
|
-
])) : N("", !0)
|
|
1440
|
-
], 2),
|
|
1441
|
-
f.value ? N("", !0) : (d(), m("div", pn, [
|
|
1442
|
-
c[4] || (c[4] = b("span", {
|
|
1443
|
-
class: "common-search__label common-search__label--spacer",
|
|
1444
|
-
"aria-hidden": "true"
|
|
1445
|
-
}, " ", -1)),
|
|
1446
|
-
b("div", fn, [
|
|
1447
|
-
ee(o.$slots, "actions", {
|
|
1448
|
-
search: H,
|
|
1449
|
-
reset: re,
|
|
1450
|
-
form: s.value
|
|
1451
|
-
}, () => [
|
|
1452
|
-
C(Y, {
|
|
1453
|
-
class: "common-search__reset",
|
|
1454
|
-
onClick: re
|
|
1455
|
-
}, {
|
|
1456
|
-
default: k(() => [...c[2] || (c[2] = [
|
|
1457
|
-
A("重置", -1)
|
|
1458
|
-
])]),
|
|
1459
|
-
_: 1
|
|
1460
|
-
}),
|
|
1461
|
-
C(Y, {
|
|
1462
|
-
type: "primary",
|
|
1463
|
-
class: "common-search__submit",
|
|
1464
|
-
onClick: H
|
|
1465
|
-
}, {
|
|
1466
|
-
default: k(() => [...c[3] || (c[3] = [
|
|
1467
|
-
A(" 搜索 ", -1)
|
|
1468
|
-
])]),
|
|
1469
|
-
_: 1
|
|
1470
|
-
})
|
|
1471
|
-
], !0)
|
|
1472
|
-
])
|
|
1473
|
-
]))
|
|
1474
|
-
]),
|
|
1475
|
-
f.value ? (d(), m("div", hn, [
|
|
1476
|
-
b("div", mn, [
|
|
1477
|
-
b("div", gn, [
|
|
1478
|
-
ee(o.$slots, "actions", {
|
|
1479
|
-
search: H,
|
|
1480
|
-
reset: re,
|
|
1481
|
-
form: s.value
|
|
1482
|
-
}, () => [
|
|
1483
|
-
C(Y, {
|
|
1484
|
-
class: "common-search__reset",
|
|
1485
|
-
onClick: re
|
|
1486
|
-
}, {
|
|
1487
|
-
default: k(() => [...c[5] || (c[5] = [
|
|
1488
|
-
A("重置", -1)
|
|
1489
|
-
])]),
|
|
1490
|
-
_: 1
|
|
1491
|
-
}),
|
|
1492
|
-
C(Y, {
|
|
1493
|
-
type: "primary",
|
|
1494
|
-
class: "common-search__submit",
|
|
1495
|
-
onClick: H
|
|
1496
|
-
}, {
|
|
1497
|
-
default: k(() => [...c[6] || (c[6] = [
|
|
1498
|
-
A(" 搜索 ", -1)
|
|
1499
|
-
])]),
|
|
1500
|
-
_: 1
|
|
1501
|
-
})
|
|
1502
|
-
], !0)
|
|
1503
|
-
]),
|
|
1504
|
-
C(Y, {
|
|
1505
|
-
onClick: et,
|
|
1506
|
-
type: "primary",
|
|
1507
|
-
plain: ""
|
|
1508
|
-
}, {
|
|
1509
|
-
default: k(() => [
|
|
1510
|
-
A(M(U.value ? "收起" : "展开") + " ", 1),
|
|
1511
|
-
C(K, { class: "el-icon--right" }, {
|
|
1512
|
-
default: k(() => [
|
|
1513
|
-
U.value ? (d(), F(ne(it), { key: 0 })) : (d(), F(ne(ke), { key: 1 }))
|
|
1514
|
-
]),
|
|
1515
|
-
_: 1
|
|
1516
|
-
})
|
|
1517
|
-
]),
|
|
1518
|
-
_: 1
|
|
1519
|
-
})
|
|
1520
|
-
])
|
|
1521
|
-
])) : N("", !0)
|
|
1505
|
+
})) : R("", !0)
|
|
1506
|
+
])
|
|
1507
|
+
])) : R("", !0)
|
|
1508
|
+
], 64))), 128))
|
|
1509
|
+
], 4)
|
|
1510
|
+
])
|
|
1522
1511
|
], 2)), [
|
|
1523
|
-
[
|
|
1512
|
+
[te, e.itemList.length]
|
|
1524
1513
|
]);
|
|
1525
1514
|
};
|
|
1526
1515
|
}
|
|
1527
|
-
}),
|
|
1516
|
+
}), _n = /* @__PURE__ */ X(bn, [["__scopeId", "data-v-e2d328a8"]]), wn = {
|
|
1528
1517
|
name: "MgOverflowHid",
|
|
1529
1518
|
props: {
|
|
1530
1519
|
label: String,
|
|
@@ -1547,62 +1536,62 @@ const ln = /* @__PURE__ */ X(Wt, [["render", nn], ["__scopeId", "data-v-07dac048
|
|
|
1547
1536
|
return t && t.length > n && (t = t.slice(0, n) + "..."), t;
|
|
1548
1537
|
}
|
|
1549
1538
|
}
|
|
1550
|
-
},
|
|
1551
|
-
function
|
|
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) {
|
|
1552
1541
|
const h = $("el-popover");
|
|
1553
|
-
return d(),
|
|
1554
|
-
t.value && t.value.length > t.maxLength ? (d(),
|
|
1542
|
+
return d(), b("div", Cn, [
|
|
1543
|
+
t.value && t.value.length > t.maxLength ? (d(), P(h, {
|
|
1555
1544
|
key: 0,
|
|
1556
1545
|
trigger: "hover",
|
|
1557
1546
|
placement: "bottom",
|
|
1558
1547
|
width: "400"
|
|
1559
1548
|
}, {
|
|
1560
|
-
reference:
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
class:
|
|
1564
|
-
},
|
|
1565
|
-
[
|
|
1549
|
+
reference: S(() => [
|
|
1550
|
+
w("div", Un, [
|
|
1551
|
+
ee(w("span", {
|
|
1552
|
+
class: H(t.labelClassName)
|
|
1553
|
+
}, T(t.label) + ":", 3), [
|
|
1554
|
+
[te, t.label]
|
|
1566
1555
|
]),
|
|
1567
|
-
|
|
1568
|
-
class:
|
|
1569
|
-
innerHTML:
|
|
1570
|
-
}, null, 10,
|
|
1556
|
+
w("span", {
|
|
1557
|
+
class: H(t.valueClassName),
|
|
1558
|
+
innerHTML: o.cutString(t.value, t.maxLength)
|
|
1559
|
+
}, null, 10, xn)
|
|
1571
1560
|
])
|
|
1572
1561
|
]),
|
|
1573
|
-
default:
|
|
1574
|
-
|
|
1575
|
-
class:
|
|
1576
|
-
},
|
|
1577
|
-
[
|
|
1562
|
+
default: S(() => [
|
|
1563
|
+
ee(w("span", {
|
|
1564
|
+
class: H(t.labelClassName)
|
|
1565
|
+
}, T(t.label) + ":", 3), [
|
|
1566
|
+
[te, t.label]
|
|
1578
1567
|
]),
|
|
1579
|
-
|
|
1568
|
+
w("span", { innerHTML: t.value }, null, 8, kn)
|
|
1580
1569
|
]),
|
|
1581
1570
|
_: 1
|
|
1582
|
-
})) : (d(),
|
|
1583
|
-
|
|
1584
|
-
class:
|
|
1585
|
-
},
|
|
1586
|
-
[
|
|
1571
|
+
})) : (d(), b("div", Sn, [
|
|
1572
|
+
ee(w("span", {
|
|
1573
|
+
class: H(t.labelClassName)
|
|
1574
|
+
}, T(t.label) + ":", 3), [
|
|
1575
|
+
[te, t.label]
|
|
1587
1576
|
]),
|
|
1588
|
-
|
|
1589
|
-
class:
|
|
1577
|
+
w("span", {
|
|
1578
|
+
class: H([t.valueClassName, "value"])
|
|
1590
1579
|
}, [
|
|
1591
|
-
|
|
1580
|
+
w("span", { innerHTML: t.value }, null, 8, $n)
|
|
1592
1581
|
], 2)
|
|
1593
1582
|
]))
|
|
1594
1583
|
]);
|
|
1595
1584
|
}
|
|
1596
|
-
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 = {
|
|
1597
1586
|
key: 2,
|
|
1598
1587
|
class: "price-text"
|
|
1599
|
-
},
|
|
1588
|
+
}, Tn = {
|
|
1600
1589
|
key: 3,
|
|
1601
1590
|
class: "bold-text"
|
|
1602
|
-
},
|
|
1591
|
+
}, Bn = {
|
|
1603
1592
|
key: 0,
|
|
1604
1593
|
class: "common-table__pagination"
|
|
1605
|
-
},
|
|
1594
|
+
}, Dn = /* @__PURE__ */ Object.assign({ name: "MgDataTable" }, {
|
|
1606
1595
|
__name: "DataTable",
|
|
1607
1596
|
props: {
|
|
1608
1597
|
/** 列配置:el-table-column 属性 + slotName */
|
|
@@ -1675,132 +1664,132 @@ const qe = /* @__PURE__ */ X(_n, [["render", xn], ["__scopeId", "data-v-ef86ea54
|
|
|
1675
1664
|
},
|
|
1676
1665
|
emits: ["pageChange", "cellClick", "edit", "delete", "selectionChange"],
|
|
1677
1666
|
setup(e, { emit: n }) {
|
|
1678
|
-
const t = e,
|
|
1667
|
+
const t = e, r = n, a = {
|
|
1679
1668
|
background: "var(--brand-secondary)",
|
|
1680
1669
|
color: "var(--brand-text-regular)",
|
|
1681
1670
|
fontWeight: 600,
|
|
1682
1671
|
fontSize: "13px"
|
|
1683
|
-
},
|
|
1684
|
-
headerCellStyle:
|
|
1672
|
+
}, o = me(() => ({
|
|
1673
|
+
headerCellStyle: a,
|
|
1685
1674
|
...t.tableBind
|
|
1686
1675
|
}));
|
|
1687
1676
|
function h(u) {
|
|
1688
|
-
const { slotName:
|
|
1677
|
+
const { slotName: c, headerSlotName: U, maxLength: N, ...B } = u || {};
|
|
1689
1678
|
return {
|
|
1690
1679
|
...B
|
|
1691
1680
|
};
|
|
1692
1681
|
}
|
|
1693
|
-
function
|
|
1682
|
+
function f(u) {
|
|
1694
1683
|
return u == null || u === "" ? "-" : u;
|
|
1695
1684
|
}
|
|
1696
|
-
function
|
|
1685
|
+
function F(u) {
|
|
1697
1686
|
return t.pagination ? (t.pagination.page - 1) * t.pagination.limit + u + 1 : u + 1;
|
|
1698
1687
|
}
|
|
1699
|
-
function
|
|
1700
|
-
var
|
|
1701
|
-
|
|
1688
|
+
function _(u) {
|
|
1689
|
+
var c;
|
|
1690
|
+
r("pageChange", { page: (c = t.pagination) == null ? void 0 : c.page, limit: u });
|
|
1702
1691
|
}
|
|
1703
|
-
function
|
|
1704
|
-
var
|
|
1705
|
-
|
|
1692
|
+
function L(u) {
|
|
1693
|
+
var c;
|
|
1694
|
+
r("pageChange", { page: u, limit: (c = t.pagination) == null ? void 0 : c.limit });
|
|
1706
1695
|
}
|
|
1707
|
-
function
|
|
1708
|
-
|
|
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();
|
|
1709
1698
|
}
|
|
1710
|
-
function
|
|
1711
|
-
|
|
1699
|
+
function v(u) {
|
|
1700
|
+
r("selectionChange", u);
|
|
1712
1701
|
}
|
|
1713
|
-
return (u,
|
|
1714
|
-
const
|
|
1715
|
-
return d(),
|
|
1716
|
-
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 }])
|
|
1717
1706
|
}, [
|
|
1718
|
-
|
|
1719
|
-
|
|
1707
|
+
w("div", Ln, [
|
|
1708
|
+
x(N, Le({
|
|
1720
1709
|
data: e.dataList,
|
|
1721
1710
|
height: e.fillHeight ? "100%" : void 0,
|
|
1722
1711
|
class: { "common-pointer-table": e.canCellClick }
|
|
1723
|
-
},
|
|
1724
|
-
onCellClick:
|
|
1725
|
-
onSelectionChange:
|
|
1712
|
+
}, o.value, {
|
|
1713
|
+
onCellClick: g,
|
|
1714
|
+
onSelectionChange: v
|
|
1726
1715
|
}), {
|
|
1727
|
-
default:
|
|
1728
|
-
e.showSelection ? (d(),
|
|
1716
|
+
default: S(() => [
|
|
1717
|
+
e.showSelection ? (d(), P(U, {
|
|
1729
1718
|
key: 0,
|
|
1730
1719
|
type: "selection",
|
|
1731
1720
|
width: e.selectionWidth,
|
|
1732
1721
|
align: "center",
|
|
1733
1722
|
selectable: e.selectable,
|
|
1734
1723
|
fixed: "left"
|
|
1735
|
-
}, null, 8, ["width", "selectable"])) :
|
|
1736
|
-
e.showIndex ? (d(),
|
|
1724
|
+
}, null, 8, ["width", "selectable"])) : R("", !0),
|
|
1725
|
+
e.showIndex ? (d(), P(U, {
|
|
1737
1726
|
key: 1,
|
|
1738
1727
|
type: "index",
|
|
1739
1728
|
label: e.indexLabel,
|
|
1740
1729
|
width: e.indexWidth,
|
|
1741
|
-
index:
|
|
1730
|
+
index: F,
|
|
1742
1731
|
align: "center"
|
|
1743
|
-
}, null, 8, ["label", "width"])) :
|
|
1744
|
-
(d(!0),
|
|
1745
|
-
key:
|
|
1746
|
-
}, { ref_for: !0 }, h(
|
|
1747
|
-
|
|
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 ? {
|
|
1748
1737
|
name: "header",
|
|
1749
|
-
fn:
|
|
1750
|
-
|
|
1738
|
+
fn: S(() => [
|
|
1739
|
+
se(u.$slots, m.headerSlotName, { column: m }, void 0, !0)
|
|
1751
1740
|
]),
|
|
1752
1741
|
key: "0"
|
|
1753
1742
|
} : void 0,
|
|
1754
|
-
|
|
1743
|
+
m.slotName ? {
|
|
1755
1744
|
name: "default",
|
|
1756
|
-
fn:
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
value: String(D.row[
|
|
1760
|
-
"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
|
|
1761
1750
|
}, null, 8, ["value", "max-length"])
|
|
1762
|
-
])) :
|
|
1763
|
-
|
|
1764
|
-
class:
|
|
1765
|
-
"whether-yes": D.row[
|
|
1766
|
-
"whether-no": D.row[
|
|
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
|
|
1767
1756
|
})
|
|
1768
|
-
},
|
|
1769
|
-
])) :
|
|
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, {
|
|
1770
1759
|
row: D.row,
|
|
1771
1760
|
index: D.$index,
|
|
1772
|
-
column:
|
|
1761
|
+
column: m
|
|
1773
1762
|
}, () => [
|
|
1774
|
-
|
|
1763
|
+
j(T(f(D.row[m.prop])), 1)
|
|
1775
1764
|
], !0, 4)
|
|
1776
1765
|
]),
|
|
1777
1766
|
key: "1"
|
|
1778
1767
|
} : void 0
|
|
1779
1768
|
]), 1040))), 128)),
|
|
1780
|
-
|
|
1769
|
+
se(u.$slots, "default", {}, void 0, !0)
|
|
1781
1770
|
]),
|
|
1782
1771
|
_: 3
|
|
1783
1772
|
}, 16, ["data", "height", "class"])
|
|
1784
1773
|
]),
|
|
1785
|
-
e.pagination ? (d(),
|
|
1786
|
-
|
|
1774
|
+
e.pagination ? (d(), b("div", Bn, [
|
|
1775
|
+
x(B, {
|
|
1787
1776
|
background: "",
|
|
1788
1777
|
"current-page": e.pagination.page,
|
|
1789
1778
|
"page-size": e.pagination.limit,
|
|
1790
1779
|
"page-sizes": e.pageSizes,
|
|
1791
1780
|
total: e.pagination.total,
|
|
1792
1781
|
layout: e.paginationLayout,
|
|
1793
|
-
onSizeChange:
|
|
1794
|
-
onCurrentChange:
|
|
1782
|
+
onSizeChange: _,
|
|
1783
|
+
onCurrentChange: L
|
|
1795
1784
|
}, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"])
|
|
1796
|
-
])) :
|
|
1785
|
+
])) : R("", !0)
|
|
1797
1786
|
], 2);
|
|
1798
1787
|
};
|
|
1799
1788
|
}
|
|
1800
|
-
}),
|
|
1789
|
+
}), Rn = /* @__PURE__ */ X(Dn, [["__scopeId", "data-v-a5939cb8"]]), Vn = ["aria-checked", "disabled", "onClick"], On = { class: "segmented__label" }, In = {
|
|
1801
1790
|
key: 0,
|
|
1802
1791
|
class: "segmented__badge"
|
|
1803
|
-
},
|
|
1792
|
+
}, An = {
|
|
1804
1793
|
__name: "SegmentedControl",
|
|
1805
1794
|
props: {
|
|
1806
1795
|
modelValue: { type: [String, Number, Boolean], default: void 0 },
|
|
@@ -1809,157 +1798,157 @@ const qe = /* @__PURE__ */ X(_n, [["render", xn], ["__scopeId", "data-v-ef86ea54
|
|
|
1809
1798
|
},
|
|
1810
1799
|
emits: ["update:modelValue", "change"],
|
|
1811
1800
|
setup(e, { emit: n }) {
|
|
1812
|
-
const t = e,
|
|
1801
|
+
const t = e, r = n, a = A(null), o = A([]), h = A(!1), f = A({
|
|
1813
1802
|
width: "0px",
|
|
1814
1803
|
transform: "translateX(0px)"
|
|
1815
1804
|
});
|
|
1816
|
-
let
|
|
1817
|
-
function
|
|
1818
|
-
return (
|
|
1805
|
+
let F = null;
|
|
1806
|
+
function _(c) {
|
|
1807
|
+
return (c == null ? void 0 : c.count) != null || (c == null ? void 0 : c.badge) != null;
|
|
1819
1808
|
}
|
|
1820
|
-
function
|
|
1821
|
-
return
|
|
1809
|
+
function L(c) {
|
|
1810
|
+
return c.count != null ? c.count : c.badge;
|
|
1822
1811
|
}
|
|
1823
|
-
function
|
|
1824
|
-
|
|
1812
|
+
function g(c, U) {
|
|
1813
|
+
c && (o.value[U] = c);
|
|
1825
1814
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const
|
|
1828
|
-
if (!
|
|
1829
|
-
const
|
|
1830
|
-
if (!
|
|
1831
|
-
|
|
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)" };
|
|
1832
1821
|
return;
|
|
1833
1822
|
}
|
|
1834
|
-
const B =
|
|
1835
|
-
|
|
1836
|
-
width: `${
|
|
1837
|
-
transform: `translateX(${
|
|
1823
|
+
const B = c.getBoundingClientRect(), m = N.getBoundingClientRect();
|
|
1824
|
+
f.value = {
|
|
1825
|
+
width: `${m.width}px`,
|
|
1826
|
+
transform: `translateX(${m.left - B.left}px)`
|
|
1838
1827
|
}, h.value = !0;
|
|
1839
1828
|
}
|
|
1840
|
-
function u(
|
|
1841
|
-
|
|
1829
|
+
function u(c) {
|
|
1830
|
+
c.disabled || (r("update:modelValue", c.value), r("change", c.value));
|
|
1842
1831
|
}
|
|
1843
1832
|
return le(
|
|
1844
1833
|
() => [t.modelValue, t.options],
|
|
1845
1834
|
async () => {
|
|
1846
|
-
await
|
|
1835
|
+
await Z(), v();
|
|
1847
1836
|
},
|
|
1848
1837
|
{ deep: !0 }
|
|
1849
|
-
),
|
|
1850
|
-
await
|
|
1851
|
-
}),
|
|
1852
|
-
|
|
1853
|
-
}), (
|
|
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", {
|
|
1854
1843
|
ref_key: "rootRef",
|
|
1855
|
-
ref:
|
|
1844
|
+
ref: a,
|
|
1856
1845
|
class: "segmented",
|
|
1857
1846
|
role: "radiogroup"
|
|
1858
1847
|
}, [
|
|
1859
|
-
|
|
1860
|
-
class:
|
|
1861
|
-
style:
|
|
1848
|
+
w("div", {
|
|
1849
|
+
class: H(["segmented__thumb", { "is-ready": h.value }]),
|
|
1850
|
+
style: ae(f.value)
|
|
1862
1851
|
}, null, 6),
|
|
1863
|
-
(d(!0),
|
|
1864
|
-
key: String(
|
|
1852
|
+
(d(!0), b(Y, null, G(e.options, (N, B) => (d(), b("button", {
|
|
1853
|
+
key: String(N.value),
|
|
1865
1854
|
ref_for: !0,
|
|
1866
|
-
ref: (
|
|
1855
|
+
ref: (m) => g(m, B),
|
|
1867
1856
|
type: "button",
|
|
1868
|
-
class:
|
|
1857
|
+
class: H(["segmented__item", { "is-active": e.modelValue === N.value }]),
|
|
1869
1858
|
role: "radio",
|
|
1870
|
-
"aria-checked": e.modelValue ===
|
|
1871
|
-
disabled:
|
|
1872
|
-
onClick: (
|
|
1859
|
+
"aria-checked": e.modelValue === N.value,
|
|
1860
|
+
disabled: N.disabled,
|
|
1861
|
+
onClick: (m) => u(N)
|
|
1873
1862
|
}, [
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
], 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))
|
|
1877
1866
|
], 512));
|
|
1878
1867
|
}
|
|
1879
|
-
},
|
|
1880
|
-
function
|
|
1868
|
+
}, Hn = /* @__PURE__ */ X(An, [["__scopeId", "data-v-b7b0abe9"]]);
|
|
1869
|
+
function zn(e) {
|
|
1881
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);
|
|
1882
1871
|
}
|
|
1883
|
-
function
|
|
1872
|
+
function jn(e) {
|
|
1884
1873
|
if (!e.parentNode) {
|
|
1885
1874
|
e.style.display = "none";
|
|
1886
1875
|
return;
|
|
1887
1876
|
}
|
|
1888
1877
|
if ((typeof e.className == "string" ? e.className : "").includes("el-tab-pane") && e.id) {
|
|
1889
|
-
const t = e.id.split("-")[1],
|
|
1890
|
-
|
|
1878
|
+
const t = e.id.split("-")[1], r = t ? document.getElementById(`tab-${t}`) : null;
|
|
1879
|
+
r && (r.style.display = "none");
|
|
1891
1880
|
}
|
|
1892
1881
|
e.parentNode.removeChild(e);
|
|
1893
1882
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const
|
|
1896
|
-
if (!
|
|
1897
|
-
let
|
|
1898
|
-
|
|
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);
|
|
1899
1888
|
}
|
|
1900
|
-
function
|
|
1889
|
+
function Kn(e) {
|
|
1901
1890
|
e.directive("hasPermission", {
|
|
1902
1891
|
mounted(n, t) {
|
|
1903
|
-
|
|
1892
|
+
ge(n, t, "and");
|
|
1904
1893
|
}
|
|
1905
1894
|
}), e.directive("hasAnyPermission", {
|
|
1906
1895
|
mounted(n, t) {
|
|
1907
|
-
|
|
1896
|
+
ge(n, t, "or");
|
|
1908
1897
|
}
|
|
1909
1898
|
}), e.directive("hasNoPermission", {
|
|
1910
1899
|
mounted(n, t) {
|
|
1911
|
-
|
|
1900
|
+
ge(n, t, "or", !0);
|
|
1912
1901
|
}
|
|
1913
1902
|
});
|
|
1914
1903
|
}
|
|
1915
1904
|
const En = {
|
|
1916
|
-
MgImageUpload:
|
|
1917
|
-
MgFileUpload:
|
|
1918
|
-
MgSearchForm:
|
|
1919
|
-
MgDataTable:
|
|
1920
|
-
MgDateRangePicker:
|
|
1921
|
-
MgSegmentedControl:
|
|
1922
|
-
MgOverflowHid:
|
|
1923
|
-
},
|
|
1924
|
-
Object.entries(En).forEach(([
|
|
1925
|
-
e.component(
|
|
1926
|
-
}), n.ossUrl &&
|
|
1927
|
-
const t =
|
|
1928
|
-
|
|
1929
|
-
},
|
|
1930
|
-
install:
|
|
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,
|
|
1931
1920
|
version: "1.0.5"
|
|
1932
1921
|
};
|
|
1933
1922
|
export {
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
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,
|
|
1941
1930
|
Ee as aliOssMixin,
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1931
|
+
tl as checkPermission,
|
|
1932
|
+
bt as createApi,
|
|
1933
|
+
be as createOssClient,
|
|
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,
|
|
1943
|
+
Oe as hasPermission,
|
|
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
|
|
1965
1954
|
};
|