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