mgacn-commonsdk 1.1.8 → 1.1.9

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