mgacn-commonsdk 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,337 +1,137 @@
1
- import { Plus as Ae, Delete as Oe, CircleCloseFilled as xe } from "@element-plus/icons-vue";
2
- import { ElMessage as Q, ElMessageBox as Ue } from "element-plus";
3
- import De from "cropperjs";
4
- import Pe from "ali-oss";
5
- import { resolveComponent as k, openBlock as c, createElementBlock as y, createElementVNode as S, toDisplayString as x, createCommentVNode as I, createTextVNode as D, Fragment as N, renderList as H, normalizeStyle as q, normalizeClass as $, createVNode as b, withCtx as C, withModifiers as Le, withDirectives as j, vShow as z, ref as U, watch as Z, onMounted as se, createBlock as L, reactive as ce, computed as ge, nextTick as ee, onBeforeUnmount as ye, withKeys as $e, renderSlot as K, resolveDynamicComponent as Ee, mergeProps as pe, createSlots as Me } from "vue";
6
- import Ie from "axios";
7
- function Ve(e) {
1
+ import { Plus as Ve, Delete as Oe, CircleCloseFilled as Ae } from "@element-plus/icons-vue";
2
+ import { ElMessage as te, ElMessageBox as Re } from "element-plus";
3
+ import Fe from "cropperjs";
4
+ import He from "ali-oss";
5
+ import { resolveComponent as N, openBlock as m, createElementBlock as b, createElementVNode as _, toDisplayString as D, createCommentVNode as F, createTextVNode as $, Fragment as P, renderList as Y, normalizeStyle as X, normalizeClass as V, createVNode as v, withCtx as S, withModifiers as Ee, withDirectives as j, vShow as z, ref as L, watch as W, onMounted as ie, createBlock as T, reactive as fe, computed as ve, nextTick as G, onBeforeUnmount as _e, withKeys as Pe, renderSlot as Q, resolveDynamicComponent as Ie, mergeProps as me, createSlots as Be } from "vue";
6
+ import Ye from "axios";
7
+ function je(e) {
8
8
  if (!e)
9
9
  throw new Error("[mgacn-commonsdk] createApi 需要传入 request 实例");
10
10
  return {
11
- // ---------- 用户 ----------
12
- getUserInfo(t) {
13
- return e.GET("/yhAdmin/user/queryUserById", { params: { id: t } });
14
- },
15
- editUser(t) {
16
- return e.POST("/yhAdmin/user/edit", t);
17
- },
18
- editPersonal(t) {
19
- return e.POST("/yhAdmin/user/edit/personal", t);
20
- },
21
- setUserPwd(t) {
22
- return e.POST("/yhAdmin/user/setUserPwd", t);
23
- },
24
- modifyPassword(t) {
25
- return e.POST("/yhAdmin/user/password/modify", t);
26
- },
27
- weChatBind(t) {
28
- return e.GET("/yhAdmin/user/weChatBind", { params: { uuid: t } });
29
- },
30
- queryPortalUsers(t) {
31
- return e.POST("/yhAdmin/portal/queryPortalAllUsers", t);
32
- },
33
- loadAllUsers(t) {
34
- return e.POST("/yhAdmin/portal/queryAllUsers", t);
35
- },
36
- resetPassword(t) {
37
- return e.POST("/yhAdmin/user/password/reset", t);
38
- },
39
- clearUser(t) {
40
- return e.GET("/yhAdmin/user/clearUser", { params: { userId: t } });
41
- },
42
- queryWxUsers(t = { username: "" }) {
43
- return e.POST("/auth/wx/queryUsers", t);
44
- },
45
- adminBindWeChat(t) {
46
- return e.POST("/auth/oauth/adminBindWeChat", t);
47
- },
48
- // ---------- 门户 ----------
49
- getGroupSystem(t) {
50
- return e.GET(`/yhAdmin/portal/getGroupSystem/${t}`);
51
- },
52
- getLastTime() {
53
- return e.GET("/yhAdmin/portal/getLastTime");
54
- },
55
- queryPortalManagers(t, a) {
56
- return e.GET("/yhAdmin/portal/queryPortalManages", { params: { page: t, limit: a } });
57
- },
58
- addPortalManager(t) {
59
- return e.POST("/yhAdmin/portal/addProtalManager", t);
60
- },
61
- deleteManager(t) {
62
- return e.DELETE(`/yhAdmin/portal/deleteManager/${t}`);
63
- },
64
- addPortalManagerById(t) {
65
- return e.GET("/yhAdmin/portal/addProtalManager", { params: { userId: t } });
66
- },
67
- // ---------- 部门 ----------
68
- getDepts() {
69
- return e.POST("/yhAdmin/dept/depts", {});
70
- },
71
- // ---------- 资讯栏目 ----------
72
- queryColumnNames() {
73
- return e.GET("/yhAdmin/columnConfig/queryAllName");
74
- },
75
- queryInformation(t) {
76
- return e.POST("/yhAdmin/columnConfig/queryInformation", t);
77
- },
78
- queryInformationById(t) {
79
- return e.GET(`/yhAdmin/columnConfig/queryInformationById/${t}`);
80
- },
81
- saveConsult(t) {
82
- return e.POST("/yhAdmin/columnConfig/saveConsult", t);
83
- },
84
- deleteInformation(t) {
85
- return e.GET(`/yhAdmin/columnConfig/deleteInformationById/${t}`);
86
- },
87
- draftColumnSort(t) {
88
- return e.POST("/yhAdmin/columnConfig/draftSort", t);
89
- },
90
- deleteColumn(t) {
91
- return e.GET(`/yhAdmin/columnConfig/delete/${t}`);
92
- },
93
- addOrUpdateColumnName(t) {
94
- return e.POST("/yhAdmin/columnConfig/addOrUpdateName", t);
95
- },
96
- // ---------- 子系统 / 应用 ----------
97
- queryAllApplicationType() {
98
- return e.GET("/yhAdmin/applicationType/queryAllApplicationType");
99
- },
100
- queryByApplicationTypeId(t) {
101
- return e.GET("/yhAdmin/applicationType/queryByApplicationTypeId", {
102
- params: { typeId: t }
103
- });
104
- },
105
- addOrUpdateApplicationType(t) {
106
- return e.POST("/yhAdmin/applicationType/addOrUpdate", t);
107
- },
108
- draftApplicationSort(t) {
109
- return e.POST("/yhAdmin/applicationType/draftSort", t);
110
- },
111
- deleteApplicationType(t) {
112
- return e.GET(`/yhAdmin/applicationType/delete/${t}`);
113
- },
114
- queryAllPortalSystems() {
115
- return e.GET("/yhAdmin/portalSystem/queryAll");
116
- },
117
- addPortalSystem(t) {
118
- return e.POST("/yhAdmin/portalSystem/addProtalSystem", t);
119
- },
120
- editPortalSystem(t) {
121
- return e.POST("/yhAdmin/portalSystem/edit", t);
122
- },
123
- deletePortalSystem(t) {
124
- return e.DELETE(`/yhAdmin/portalSystem/delete/${t}`);
125
- },
126
- // ---------- 首页 / 数据中心 ----------
127
- queryAllColumnAndType() {
128
- return e.GET("/project/columnConfig/queryAllColumnAndType");
129
- },
130
- queryInformationGroup(t) {
131
- return e.POST("/project/information/queryInformationGroup", t);
132
- },
133
- querySightWords(t) {
134
- return e.GET(`/datacenter/hotRank/querySightWords/${t}`);
135
- },
136
- queryPageOrgData() {
137
- return e.GET("/datacenter/org/queryPageOrgData");
138
- },
139
- // ---------- 人员变更 ----------
140
- queryDemandAmount(t) {
141
- return e.GET("/qmxc/changeData/queryDemandAmount", { params: { userId: t } });
142
- },
143
- queryCommerceOrderAmount(t, a) {
144
- return e.GET("/commerce/commerce/order/queryCommerceOrderAmount", {
145
- params: { userId: t, type: a }
146
- });
147
- },
148
- queryUsersByRoleType(t) {
149
- return e.GET(`/commerce/changeData/queryUsersByRoleType/${t}`);
150
- },
151
- queryChangeSystemUser(t) {
152
- return e.GET("/commerce/changeData/querySystemUser", { params: { queryName: t } });
153
- },
154
- queryByRoleName(t) {
155
- return e.GET("/commerce/changeData/queryByRoleName", { params: { roleName: t } });
156
- },
157
- queryChangeCustomerInfo(t) {
158
- return e.GET("/qmxc/changeData/queryCustomerInfo", { params: { queryType: t } });
159
- },
160
- postChangeData(t, a) {
161
- return e.POST(t, a);
162
- },
163
- // ---------- 系统日志 / 埋点 ----------
164
- queryTraceTotalData(t) {
165
- return e.POST("/yhAdmin/trace/queryTotalData", t);
11
+ // ---------- 注销登录 ----------
12
+ logout(n) {
13
+ return e.GET(`/yhAdmin/login/exit/${n}`);
166
14
  },
167
- queryTraceData(t) {
168
- return e.POST("/yhAdmin/trace/queryTraceData", t);
169
- },
170
- exportTrace(t) {
171
- return e.POST("/yhAdmin/trace/export", t, { responseType: "arraybuffer" });
172
- },
173
- addOrUpdateTraceConfig(t) {
174
- return e.POST("/yhAdmin/trace/addOrUpdateConfig", t);
175
- },
176
- deleteTrace(t) {
177
- return e.GET(`/yhAdmin/trace/delete/${t}`);
178
- },
179
- // ---------- 首页数据 ----------
180
- getHotRank(t = 1) {
181
- return e.GET("/yhAdmin/wechat/hotRank/hotRank", { params: { type: t } });
15
+ // ---------- 用户 ----------
16
+ getUserInfo(n) {
17
+ return e.GET(`/yhAdmin/user/queryUser/${n}`);
182
18
  },
183
19
  // ---------- OSS ----------
184
- getOssSts(t) {
185
- return e.GET("/yhAdmin/wechat/oss/fileUploadSts", { params: { dir: t } });
186
- },
187
- // ---------- 数据同步 ----------
188
- querySupplierData(t) {
189
- return e.POST("/syncData/supplier/querySupplierData", t);
190
- },
191
- deleteSupplierData(t) {
192
- return e.GET(`/syncData/supplier/deleteSupplierData/${t}`);
193
- },
194
- queryCommerceOrder(t) {
195
- return e.POST("/syncData/commerce/queryCommerceOrderInfo", t);
196
- },
197
- deleteCommerceOrder(t) {
198
- return e.GET(`/syncData/commerce/deleteCommerceOrderById/${t}`);
199
- },
200
- queryTalentInfo(t) {
201
- return e.POST("/syncData/commerce/queryTalentInfo", t);
202
- },
203
- deleteTalentInfo(t) {
204
- return e.GET(`/syncData/commerce/deleteTalentInfo/${t}`);
205
- },
206
- queryOtherCoopOrder(t) {
207
- return e.POST("/syncData/otherCoop/queryOtherCoopOrderInfo", t);
208
- },
209
- deleteOtherCoopOrder(t) {
210
- return e.GET(`/syncData/otherCoop/deleteOtherCoopOrder/${t}`);
211
- },
212
- queryOtherSupplierFee(t) {
213
- return e.POST("/syncData/otherCoop/queryOtherSupplierFee", t);
214
- },
215
- deleteOtherSupplierFee(t) {
216
- return e.GET(`/syncData/otherCoop/deleteOtherSupplierFee/${t}`);
217
- },
218
- querySupplierFeeDetail(t) {
219
- return e.POST("/syncData/otherCoop/querySupplierFeeDetail", t);
220
- },
221
- deleteSupplierFeeDetail(t) {
222
- return e.GET(`/syncData/otherCoop/deleteSupplierFeeDetail/${t}`);
20
+ getOssSts(n) {
21
+ return e.GET("/yhAdmin/oss/fileUploadSts", { params: { dir: n } });
223
22
  }
224
23
  };
225
24
  }
226
- let re = null;
227
- function Be(e) {
228
- re = e;
25
+ const we = "__MGACN_COMMONSDK_API__";
26
+ function ze(e) {
27
+ globalThis[we] = e;
229
28
  }
230
- function Ne() {
231
- if (!re)
29
+ function Ke() {
30
+ const e = globalThis[we];
31
+ if (!e)
232
32
  throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
233
- return re;
33
+ return e;
234
34
  }
235
- function me(e) {
35
+ function ge(e) {
236
36
  return String(e).padStart(2, "0");
237
37
  }
238
- function Re() {
38
+ function qe() {
239
39
  const e = /* @__PURE__ */ new Date();
240
- return `${e.getFullYear()}${me(e.getMonth() + 1)}${me(e.getDate())}`;
40
+ return `${e.getFullYear()}${ge(e.getMonth() + 1)}${ge(e.getDate())}`;
241
41
  }
242
- function ve(e = 10) {
243
- const t = "0123456789abcdefghijklmnopqrstuvwxyz";
244
- let a = "";
245
- for (let l = 0; l < e; l++)
246
- a += t[Math.floor(Math.random() * t.length)];
247
- return a;
42
+ function ke(e = 10) {
43
+ const n = "0123456789abcdefghijklmnopqrstuvwxyz";
44
+ let t = "";
45
+ for (let r = 0; r < e; r++)
46
+ t += n[Math.floor(Math.random() * n.length)];
47
+ return t;
248
48
  }
249
- function ie(e = "portal_cms") {
250
- return `${e}/${Re()}/`;
49
+ function ue(e = "portal_cms") {
50
+ return `${e}/${qe()}/`;
251
51
  }
252
- function be(e) {
253
- return Ne().getOssSts(e);
52
+ function Ce(e) {
53
+ return Ke().getOssSts(e);
254
54
  }
255
- async function _e(e = {}) {
256
- const { dir: t, foldName: a, getOss: l, ossinfo: r } = e, o = t || ie(a || "portal_cms"), d = r || (typeof l == "function" ? await l(o) : await be(o));
257
- if (!d)
55
+ async function Se(e = {}) {
56
+ const { dir: n, foldName: t, getOss: r, ossinfo: l } = e, o = n || ue(t || "portal_cms"), i = l || (typeof r == "function" ? await r(o) : await Ce(o));
57
+ if (!i)
258
58
  throw new Error("[mgacn-commonsdk] 获取 OSS STS 失败");
259
- const h = new Pe({
260
- bucket: d.bucketName,
261
- accessKeyId: d.accessKeyId,
262
- accessKeySecret: d.accessKeySecret,
59
+ const g = new He({
60
+ bucket: i.bucketName,
61
+ accessKeyId: i.accessKeyId,
62
+ accessKeySecret: i.accessKeySecret,
263
63
  success_action_status: "200",
264
- stsToken: d.securityToken,
265
- endpoint: d.endPoint
64
+ stsToken: i.securityToken,
65
+ endpoint: i.endPoint
266
66
  });
267
- return h.options.ossUrl = d.ossUrl || d.domain || (d.bucketName && d.endPoint ? `https://${d.bucketName}.${d.endPoint}` : ""), h.options.uploadDir = o, h;
67
+ return g.options.ossUrl = i.ossUrl || i.domain || (i.bucketName && i.endPoint ? `https://${i.bucketName}.${i.endPoint}` : ""), g.options.uploadDir = o, g;
268
68
  }
269
- async function Fe(e = {}) {
270
- const { client: t, file: a, dir: l, foldName: r, fileName: o, onProgress: d } = e;
271
- if (!a)
69
+ async function We(e = {}) {
70
+ const { client: n, file: t, dir: r, foldName: l, fileName: o, onProgress: i } = e;
71
+ if (!t)
272
72
  throw new Error("[mgacn-commonsdk] uploadToOss 缺少 file");
273
- const h = t || await _e({ dir: l, foldName: r }), _ = l || h.options.uploadDir || ie(r);
274
- let p = o;
275
- if (!p) {
276
- const g = a.name || "file", u = g.indexOf("."), T = u > -1 ? g.slice(u) : "";
277
- p = `${_}${ve(10)}${T}`;
73
+ const g = n || await Se({ dir: r, foldName: l }), k = r || g.options.uploadDir || ue(l);
74
+ let u = o;
75
+ if (!u) {
76
+ const h = t.name || "file", c = h.indexOf("."), x = c > -1 ? h.slice(c) : "";
77
+ u = `${k}${ke(10)}${x}`;
278
78
  }
279
- const f = await h.multipartUpload(p, a, {
280
- progress: (g) => {
281
- typeof d == "function" && d(Math.floor(g * 100));
79
+ const p = await g.multipartUpload(u, t, {
80
+ progress: (h) => {
81
+ typeof i == "function" && i(Math.floor(h * 100));
282
82
  }
283
83
  });
284
- if (f.res && f.res.statusCode !== 200)
84
+ if (p.res && p.res.statusCode !== 200)
285
85
  throw new Error("[mgacn-commonsdk] 上传失败");
286
- const O = (h.options.ossUrl || "").replace(/\/$/, ""), i = O ? `${O}/${p}` : p;
287
- return { name: p, url: i, raw: f, client: h };
86
+ const w = (g.options.ossUrl || "").replace(/\/$/, ""), d = w ? `${w}/${u}` : u;
87
+ return { name: u, url: d, raw: p, client: g };
288
88
  }
289
89
  const Ge = {
290
90
  methods: {
291
91
  getDir() {
292
- return ie(this.foldName || "portal_cms");
92
+ return ue(this.foldName || "portal_cms");
293
93
  },
294
- randomString: ve,
94
+ randomString: ke,
295
95
  getOss() {
296
- return be(this.getDir());
96
+ return Ce(this.getDir());
297
97
  },
298
98
  async createOssClient() {
299
- return _e({
99
+ return Se({
300
100
  dir: this.getDir(),
301
101
  getOss: () => this.getOss()
302
102
  });
303
103
  }
304
104
  }
305
- }, Y = (e, t) => {
306
- const a = e.__vccOpts || e;
307
- for (const [l, r] of t)
308
- a[l] = r;
309
- return a;
105
+ }, K = (e, n) => {
106
+ const t = e.__vccOpts || e;
107
+ for (const [r, l] of n)
108
+ t[r] = l;
109
+ return t;
310
110
  };
311
- let fe = 0;
312
- function Se() {
313
- return fe += 1, `mg-img-${Date.now()}-${fe}`;
111
+ let he = 0;
112
+ function xe() {
113
+ return he += 1, `mg-img-${Date.now()}-${he}`;
314
114
  }
315
- function He(e) {
115
+ function Qe(e) {
316
116
  return Array.isArray(e) ? e.filter(Boolean) : e ? [e] : [];
317
117
  }
318
- function he(e) {
319
- return e.map((t) => ({
320
- uid: Se(),
321
- url: t,
118
+ function ye(e) {
119
+ return e.map((n) => ({
120
+ uid: xe(),
121
+ url: n,
322
122
  status: "success",
323
123
  percent: 100,
324
124
  previewUrl: ""
325
125
  }));
326
126
  }
327
- function je(e = "") {
328
- const t = e.lastIndexOf(".");
329
- return t > -1 ? e.slice(t + 1).toLowerCase() : "";
127
+ function Xe(e = "") {
128
+ const n = e.lastIndexOf(".");
129
+ return n > -1 ? e.slice(n + 1).toLowerCase() : "";
330
130
  }
331
- const ze = {
131
+ const Je = {
332
132
  name: "MgImageUpload",
333
133
  mixins: [Ge],
334
- components: { CircleCloseFilled: xe, Delete: Oe, Plus: Ae },
134
+ components: { CircleCloseFilled: Ae, Delete: Oe, Plus: Ve },
335
135
  props: {
336
136
  /** v-model 统一为 string[];入参兼容 string / string[] */
337
137
  modelValue: { type: [Array, String], default: () => [] },
@@ -394,16 +194,16 @@ const ze = {
394
194
  deep: !0,
395
195
  immediate: !0,
396
196
  handler(e) {
397
- e != null && e.length && this.replaceList(he(e));
197
+ e != null && e.length && this.replaceList(ye(e));
398
198
  }
399
199
  },
400
200
  modelValue: {
401
201
  immediate: !0,
402
202
  handler(e) {
403
- var l;
404
- if ((l = this.initFileList) != null && l.length) return;
405
- const t = He(e), a = this.successUrls;
406
- t.length === a.length && t.every((r, o) => r === a[o]) || this.replaceList(he(t));
203
+ var r;
204
+ if ((r = this.initFileList) != null && r.length) return;
205
+ const n = Qe(e), t = this.successUrls;
206
+ n.length === t.length && n.every((l, o) => l === t[o]) || this.replaceList(ye(n));
407
207
  }
408
208
  },
409
209
  cropImageUrl(e) {
@@ -438,27 +238,27 @@ const ze = {
438
238
  handleUpload() {
439
239
  if (!this.disabled) {
440
240
  if (this.fileList.length >= this.fileNum) {
441
- Q.error(`文件数量不超过${this.fileNum}`);
241
+ te.error(`文件数量不超过${this.fileNum}`);
442
242
  return;
443
243
  }
444
244
  this.openFilePicker();
445
245
  }
446
246
  },
447
247
  onFileChange(e) {
448
- const t = [...e.target.files || []];
449
- if (!t.length) return;
450
- const a = this.fileNum - this.fileList.length;
451
- if (t.length > a) {
452
- Q.error(`文件数量不超过${this.fileNum}个`);
248
+ const n = [...e.target.files || []];
249
+ if (!n.length) return;
250
+ const t = this.fileNum - this.fileList.length;
251
+ if (n.length > t) {
252
+ te.error(`文件数量不超过${this.fileNum}个`);
453
253
  return;
454
254
  }
455
- const l = [], r = [];
456
- if (t.forEach((o) => {
457
- this.acceptList.includes(je(o.name)) ? l.push(o) : r.push(o);
458
- }), r.length) {
459
- const o = r.map((d) => d.name).join(",");
460
- Ue.confirm(
461
- `已过滤以下 ${r.length} 个不符合要求的文件:<br/><p style="color:#f56c6c;font-size:12px;">${o}</p><br/>只接受:${this.acceptList.join("/")}`,
255
+ const r = [], l = [];
256
+ if (n.forEach((o) => {
257
+ this.acceptList.includes(Xe(o.name)) ? r.push(o) : l.push(o);
258
+ }), l.length) {
259
+ const o = l.map((i) => i.name).join(",");
260
+ Re.confirm(
261
+ `已过滤以下 ${l.length} 个不符合要求的文件:<br/><p style="color:#f56c6c;font-size:12px;">${o}</p><br/>只接受:${this.acceptList.join("/")}`,
462
262
  "提示",
463
263
  {
464
264
  confirmButtonText: "确认",
@@ -469,59 +269,59 @@ const ze = {
469
269
  ).catch(() => {
470
270
  });
471
271
  }
472
- if (l.length) {
272
+ if (r.length) {
473
273
  if (this.isCropper) {
474
- this.openCropper(l[0]);
274
+ this.openCropper(r[0]);
475
275
  return;
476
276
  }
477
- this.startUpload(l);
277
+ this.startUpload(r);
478
278
  }
479
279
  },
480
280
  openCropper(e) {
481
- const t = new FileReader();
482
- t.onloadend = (a) => {
483
- this.cropImageUrl = a.target.result, this.dialogVisible = !0, this.cropper || this.$nextTick(() => this.initCropper());
484
- }, t.readAsDataURL(e);
281
+ const n = new FileReader();
282
+ n.onloadend = (t) => {
283
+ this.cropImageUrl = t.target.result, this.dialogVisible = !0, this.cropper || this.$nextTick(() => this.initCropper());
284
+ }, n.readAsDataURL(e);
485
285
  },
486
286
  /** 先预览,再逐张上传;每张图独立进度蒙层 */
487
287
  startUpload(e) {
488
288
  this.resetFilelist && this.replaceList([]);
489
- const t = this.maxFileSize * 1024 * 1024, a = [];
490
- return e.forEach((l) => {
491
- if (l.size > t) {
492
- Q.error(`「${l.name}」超出 ${this.maxFileSize}MB 限制`);
289
+ const n = this.maxFileSize * 1024 * 1024, t = [];
290
+ return e.forEach((r) => {
291
+ if (r.size > n) {
292
+ te.error(`「${r.name}」超出 ${this.maxFileSize}MB 限制`);
493
293
  return;
494
294
  }
495
- const r = URL.createObjectURL(l), o = {
496
- uid: Se(),
497
- url: r,
498
- previewUrl: r,
295
+ const l = URL.createObjectURL(r), o = {
296
+ uid: xe(),
297
+ url: l,
298
+ previewUrl: l,
499
299
  status: "uploading",
500
300
  percent: 0,
501
- raw: l
301
+ raw: r
502
302
  };
503
- this.fileList.push(o), a.push(this.uploadOne(o));
504
- }), Promise.all(a);
303
+ this.fileList.push(o), t.push(this.uploadOne(o));
304
+ }), Promise.all(t);
505
305
  },
506
306
  async uploadOne(e) {
507
307
  try {
508
- const t = await Fe({
308
+ const n = await We({
509
309
  file: e.raw,
510
310
  dir: this.getDir(),
511
- onProgress: (a) => {
512
- e.percent = a, this.$emit("progress", a, e.raw);
311
+ onProgress: (t) => {
312
+ e.percent = t, this.$emit("progress", t, e.raw);
513
313
  }
514
314
  });
515
- this.revokePreview(e), e.url = t.url, e.status = "success", e.percent = 100, e.raw = null, this.emitFile(), this.$emit("success", t, e);
516
- } catch (t) {
517
- e.status = "fail", e.percent = 0, this.$emit("error", t, e);
315
+ this.revokePreview(e), e.url = n.url, e.status = "success", e.percent = 100, e.raw = null, this.emitFile(), this.$emit("success", n, e);
316
+ } catch (n) {
317
+ e.status = "fail", e.percent = 0, this.$emit("error", n, e);
518
318
  } finally {
519
319
  this.dialogVisible && this.handleBack();
520
320
  }
521
321
  },
522
322
  initCropper() {
523
323
  const e = this.$refs.cropImage;
524
- e && (this.cropper = new De(e, {
324
+ e && (this.cropper = new Fe(e, {
525
325
  aspectRatio: this.aspectRatio,
526
326
  autoCropArea: 0.8,
527
327
  viewMode: 1,
@@ -540,12 +340,12 @@ const ze = {
540
340
  this.cropper && (this.cropper.destroy(), this.cropper = null);
541
341
  },
542
342
  rotate(e) {
543
- var t;
544
- (t = this.cropper) == null || t.rotate(e);
343
+ var n;
344
+ (n = this.cropper) == null || n.rotate(e);
545
345
  },
546
346
  confirmCrop() {
547
347
  if (this.uploadingCount) {
548
- Q.error("上传中,请稍后!");
348
+ te.error("上传中,请稍后!");
549
349
  return;
550
350
  }
551
351
  if (!this.cropper) return;
@@ -553,126 +353,126 @@ const ze = {
553
353
  this.startUpload([this.base64ToFile(e)]);
554
354
  },
555
355
  base64ToFile(e) {
556
- const [t, a] = e.split(","), l = t.match(/:(.*?);/)[1], r = l.split("/")[1], o = atob(a), d = new Uint8Array(o.length);
557
- for (let h = 0; h < o.length; h++) d[h] = o.charCodeAt(h);
558
- return new File([d], `${Date.now()}.${r}`, { type: l });
356
+ const [n, t] = e.split(","), r = n.match(/:(.*?);/)[1], l = r.split("/")[1], o = atob(t), i = new Uint8Array(o.length);
357
+ for (let g = 0; g < o.length; g++) i[g] = o.charCodeAt(g);
358
+ return new File([i], `${Date.now()}.${l}`, { type: r });
559
359
  },
560
360
  handleBack() {
561
361
  this.cropImageUrl = "", this.dialogVisible = !1;
562
362
  },
563
363
  removeImg(e) {
564
- const t = this.fileList[e];
565
- !t || t.status === "uploading" || (this.revokePreview(t), this.fileList.splice(e, 1), this.emitFile());
364
+ const n = this.fileList[e];
365
+ !n || n.status === "uploading" || (this.revokePreview(n), this.fileList.splice(e, 1), this.emitFile());
566
366
  }
567
367
  }
568
- }, Ye = { class: "upload-image-cropper" }, We = ["multiple", "accept"], Ke = {
368
+ }, Ze = { class: "upload-image-cropper" }, et = ["multiple", "accept"], tt = {
569
369
  key: 0,
570
370
  class: "grey-tips"
571
- }, qe = { key: 0 }, Xe = { class: "list-box" }, Je = {
371
+ }, nt = { key: 0 }, lt = { class: "list-box" }, at = {
572
372
  key: 0,
573
373
  class: "status-mask is-uploading"
574
- }, Qe = { class: "progress-wrap" }, Ze = { class: "percent-text" }, et = {
374
+ }, rt = { class: "progress-wrap" }, ot = { class: "percent-text" }, st = {
575
375
  key: 1,
576
376
  class: "status-mask is-fail"
577
- }, tt = ["onClick"], at = { class: "cropper-box" }, nt = ["src"], rt = { class: "btn-box" }, lt = { class: "btn-box" };
578
- function ot(e, t, a, l, r, o) {
579
- const d = k("el-image"), h = k("el-progress"), _ = k("CircleCloseFilled"), p = k("el-icon"), f = k("Delete"), O = k("Plus"), i = k("el-button"), g = k("el-dialog");
580
- return c(), y("div", Ye, [
581
- S("input", {
377
+ }, it = ["onClick"], ut = { class: "cropper-box" }, ct = ["src"], dt = { class: "btn-box" }, pt = { class: "btn-box" };
378
+ function ft(e, n, t, r, l, o) {
379
+ const i = N("el-image"), g = N("el-progress"), k = N("CircleCloseFilled"), u = N("el-icon"), p = N("Delete"), w = N("Plus"), d = N("el-button"), h = N("el-dialog");
380
+ return m(), b("div", Ze, [
381
+ _("input", {
582
382
  ref: "fileInput",
583
383
  type: "file",
584
384
  class: "file-input",
585
385
  multiple: o.multiple,
586
- accept: a.accept,
587
- onChange: t[0] || (t[0] = (...u) => o.onFileChange && o.onFileChange(...u))
588
- }, null, 40, We),
589
- a.greyTips ? (c(), y("div", Ke, [
590
- a.otherTips ? (c(), y("div", qe, x(a.otherTips), 1)) : I("", !0),
591
- D(" " + x(a.greyTips), 1)
592
- ])) : I("", !0),
593
- S("div", Xe, [
594
- (c(!0), y(N, null, H(r.fileList, (u, T) => (c(), y("div", {
595
- key: u.uid,
596
- class: $(["image-box", [`is-${u.status}`]]),
597
- style: q(a.imageStyle)
386
+ accept: t.accept,
387
+ onChange: n[0] || (n[0] = (...c) => o.onFileChange && o.onFileChange(...c))
388
+ }, null, 40, et),
389
+ t.greyTips ? (m(), b("div", tt, [
390
+ t.otherTips ? (m(), b("div", nt, D(t.otherTips), 1)) : F("", !0),
391
+ $(" " + D(t.greyTips), 1)
392
+ ])) : F("", !0),
393
+ _("div", lt, [
394
+ (m(!0), b(P, null, Y(l.fileList, (c, x) => (m(), b("div", {
395
+ key: c.uid,
396
+ class: V(["image-box", [`is-${c.status}`]]),
397
+ style: X(t.imageStyle)
598
398
  }, [
599
- b(d, {
600
- src: u.url,
399
+ v(i, {
400
+ src: c.url,
601
401
  fit: "cover",
602
402
  class: "img"
603
403
  }, null, 8, ["src"]),
604
- u.status === "uploading" ? (c(), y("div", Je, [
605
- S("div", Qe, [
606
- b(h, {
404
+ c.status === "uploading" ? (m(), b("div", at, [
405
+ _("div", rt, [
406
+ v(g, {
607
407
  type: "circle",
608
- percentage: u.percent,
408
+ percentage: c.percent,
609
409
  width: 30,
610
410
  "stroke-width": 3,
611
411
  "show-text": !1,
612
412
  color: "var(--mg-primary, #ff5722)"
613
413
  }, null, 8, ["percentage"]),
614
- S("span", Ze, x(u.percent) + "%", 1)
414
+ _("span", ot, D(c.percent) + "%", 1)
615
415
  ])
616
- ])) : u.status === "fail" ? (c(), y("div", et, [
617
- b(p, {
416
+ ])) : c.status === "fail" ? (m(), b("div", st, [
417
+ v(u, {
618
418
  class: "fail-icon",
619
419
  size: 16
620
420
  }, {
621
- default: C(() => [
622
- b(_)
421
+ default: S(() => [
422
+ v(k)
623
423
  ]),
624
424
  _: 1
625
425
  }),
626
- t[5] || (t[5] = S("span", { class: "fail-text" }, "失败", -1)),
627
- b(p, {
426
+ n[5] || (n[5] = _("span", { class: "fail-text" }, "失败", -1)),
427
+ v(u, {
628
428
  class: "remove-icon",
629
429
  size: 14,
630
430
  title: "删除",
631
- onClick: Le((P) => o.removeImg(T), ["stop"])
431
+ onClick: Ee((M) => o.removeImg(x), ["stop"])
632
432
  }, {
633
- default: C(() => [
634
- b(f)
433
+ default: S(() => [
434
+ v(p)
635
435
  ]),
636
436
  _: 1
637
437
  }, 8, ["onClick"])
638
- ])) : (c(), y("div", {
438
+ ])) : (m(), b("div", {
639
439
  key: 2,
640
440
  class: "status-mask is-success",
641
- onClick: (P) => o.removeImg(T)
441
+ onClick: (M) => o.removeImg(x)
642
442
  }, [
643
- b(p, {
443
+ v(u, {
644
444
  class: "remove-icon",
645
445
  size: 16
646
446
  }, {
647
- default: C(() => [
648
- b(f)
447
+ default: S(() => [
448
+ v(p)
649
449
  ]),
650
450
  _: 1
651
451
  })
652
- ], 8, tt))
452
+ ], 8, it))
653
453
  ], 6))), 128)),
654
- j(S("div", {
454
+ j(_("div", {
655
455
  class: "image-box upload-btn",
656
- style: q(a.imageStyle),
657
- onClick: t[1] || (t[1] = (...u) => o.handleUpload && o.handleUpload(...u))
456
+ style: X(t.imageStyle),
457
+ onClick: n[1] || (n[1] = (...c) => o.handleUpload && o.handleUpload(...c))
658
458
  }, [
659
- b(p, {
459
+ v(u, {
660
460
  class: "icon",
661
461
  size: 14
662
462
  }, {
663
- default: C(() => [
664
- b(O)
463
+ default: S(() => [
464
+ v(w)
665
465
  ]),
666
466
  _: 1
667
467
  }),
668
- t[6] || (t[6] = S("div", null, "上传图片", -1))
468
+ n[6] || (n[6] = _("div", null, "上传图片", -1))
669
469
  ], 4), [
670
470
  [z, o.showUploadBtn]
671
471
  ])
672
472
  ]),
673
- b(g, {
674
- modelValue: r.dialogVisible,
675
- "onUpdate:modelValue": t[4] || (t[4] = (u) => r.dialogVisible = u),
473
+ v(h, {
474
+ modelValue: l.dialogVisible,
475
+ "onUpdate:modelValue": n[4] || (n[4] = (c) => l.dialogVisible = c),
676
476
  title: "裁剪图片",
677
477
  width: "600px",
678
478
  top: "5vh",
@@ -680,58 +480,58 @@ function ot(e, t, a, l, r, o) {
680
480
  "close-on-click-modal": !1,
681
481
  onClose: o.handleBack
682
482
  }, {
683
- default: C(() => [
684
- S("div", at, [
685
- j(S("img", {
483
+ default: S(() => [
484
+ _("div", ut, [
485
+ j(_("img", {
686
486
  ref: "cropImage",
687
- src: r.cropImageUrl,
487
+ src: l.cropImageUrl,
688
488
  class: "cropper-img"
689
- }, null, 8, nt), [
690
- [z, r.cropImageUrl]
489
+ }, null, 8, ct), [
490
+ [z, l.cropImageUrl]
691
491
  ])
692
492
  ]),
693
- S("div", rt, [
694
- a.isDegree ? (c(), y(N, { key: 0 }, [
695
- b(i, {
696
- onClick: t[2] || (t[2] = (u) => o.rotate(-a.degree))
493
+ _("div", dt, [
494
+ t.isDegree ? (m(), b(P, { key: 0 }, [
495
+ v(d, {
496
+ onClick: n[2] || (n[2] = (c) => o.rotate(-t.degree))
697
497
  }, {
698
- default: C(() => [...t[7] || (t[7] = [
699
- D("向左旋转", -1)
498
+ default: S(() => [...n[7] || (n[7] = [
499
+ $("向左旋转", -1)
700
500
  ])]),
701
501
  _: 1
702
502
  }),
703
- b(i, {
704
- onClick: t[3] || (t[3] = (u) => o.rotate(a.degree))
503
+ v(d, {
504
+ onClick: n[3] || (n[3] = (c) => o.rotate(t.degree))
705
505
  }, {
706
- default: C(() => [...t[8] || (t[8] = [
707
- D("向右旋转", -1)
506
+ default: S(() => [...n[8] || (n[8] = [
507
+ $("向右旋转", -1)
708
508
  ])]),
709
509
  _: 1
710
510
  })
711
- ], 64)) : I("", !0),
712
- b(i, {
511
+ ], 64)) : F("", !0),
512
+ v(d, {
713
513
  type: "primary",
714
514
  onClick: o.openFilePicker
715
515
  }, {
716
- default: C(() => [
717
- D(x(r.cropImageUrl ? "重新上传" : "点击上传"), 1)
516
+ default: S(() => [
517
+ $(D(l.cropImageUrl ? "重新上传" : "点击上传"), 1)
718
518
  ]),
719
519
  _: 1
720
520
  }, 8, ["onClick"])
721
521
  ]),
722
- S("div", lt, [
723
- b(i, { onClick: o.handleBack }, {
724
- default: C(() => [...t[9] || (t[9] = [
725
- D("取 消", -1)
522
+ _("div", pt, [
523
+ v(d, { onClick: o.handleBack }, {
524
+ default: S(() => [...n[9] || (n[9] = [
525
+ $("取 消", -1)
726
526
  ])]),
727
527
  _: 1
728
528
  }, 8, ["onClick"]),
729
- b(i, {
529
+ v(d, {
730
530
  type: "primary",
731
531
  onClick: o.confirmCrop
732
532
  }, {
733
- default: C(() => [...t[10] || (t[10] = [
734
- D("确定", -1)
533
+ default: S(() => [...n[10] || (n[10] = [
534
+ $("确定", -1)
735
535
  ])]),
736
536
  _: 1
737
537
  }, 8, ["onClick"])
@@ -741,7 +541,7 @@ function ot(e, t, a, l, r, o) {
741
541
  }, 8, ["modelValue", "onClose"])
742
542
  ]);
743
543
  }
744
- const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986"]]), it = {
544
+ const mt = /* @__PURE__ */ K(Je, [["render", ft], ["__scopeId", "data-v-27d5f986"]]), gt = {
745
545
  __name: "DateRangePicker",
746
546
  props: {
747
547
  start: {
@@ -767,24 +567,24 @@ const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986
767
567
  canClearable: { type: Boolean, default: !0 }
768
568
  },
769
569
  emits: ["update:start", "update:end", "change"],
770
- setup(e, { emit: t }) {
771
- const a = t, l = e, r = U([]);
772
- Z(
773
- () => l.start,
570
+ setup(e, { emit: n }) {
571
+ const t = n, r = e, l = L([]);
572
+ W(
573
+ () => r.start,
774
574
  () => {
775
- r.value = [l.start, l.end];
575
+ l.value = [r.start, r.end];
776
576
  }
777
- ), se(() => {
778
- r.value = [l.start, l.end];
577
+ ), ie(() => {
578
+ l.value = [r.start, r.end];
779
579
  });
780
- function o(d) {
781
- a("update:start", d ? d[0] : ""), a("update:end", d ? d[1] : ""), a("change");
580
+ function o(i) {
581
+ t("update:start", i ? i[0] : ""), t("update:end", i ? i[1] : ""), t("change");
782
582
  }
783
- return (d, h) => {
784
- const _ = k("el-date-picker");
785
- return c(), L(_, {
786
- modelValue: r.value,
787
- "onUpdate:modelValue": h[0] || (h[0] = (p) => r.value = p),
583
+ return (i, g) => {
584
+ const k = N("el-date-picker");
585
+ return m(), T(k, {
586
+ modelValue: l.value,
587
+ "onUpdate:modelValue": g[0] || (g[0] = (u) => l.value = u),
788
588
  type: e.type,
789
589
  "range-separator": "至",
790
590
  "start-placeholder": `${e.title} 开始`,
@@ -797,22 +597,22 @@ const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986
797
597
  }, null, 8, ["modelValue", "type", "start-placeholder", "value-format", "default-time", "clearable"]);
798
598
  };
799
599
  }
800
- }, Ce = /* @__PURE__ */ Y(it, [["__scopeId", "data-v-47618fba"]]), dt = { class: "common-search__body" }, ut = { class: "common-search__fields-wrap" }, ct = {
600
+ }, Ne = /* @__PURE__ */ K(gt, [["__scopeId", "data-v-47618fba"]]), ht = { class: "common-search__body" }, yt = { class: "common-search__fields-wrap" }, bt = {
801
601
  key: 0,
802
602
  class: "common-search__label"
803
- }, pt = {
603
+ }, vt = {
804
604
  key: 4,
805
605
  class: "common-search__range"
806
- }, mt = { class: "common-search__range-sep" }, ft = {
606
+ }, _t = { class: "common-search__range-sep" }, wt = {
807
607
  key: 6,
808
608
  class: "common-search__range"
809
- }, ht = {
609
+ }, kt = {
810
610
  key: 0,
811
611
  class: "common-search__actions is-inline"
812
- }, gt = {
612
+ }, Ct = {
813
613
  key: 0,
814
614
  class: "common-search__footer"
815
- }, yt = { class: "common-search__actions is-bottom" }, vt = { class: "common-search__actions-main" }, bt = {
615
+ }, St = { class: "common-search__actions is-bottom" }, xt = { class: "common-search__actions-main" }, Nt = /* @__PURE__ */ Object.assign({ name: "MgSearchForm" }, {
816
616
  __name: "SearchForm",
817
617
  props: {
818
618
  modelValue: { type: Object, default: () => ({}) },
@@ -820,328 +620,348 @@ const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986
820
620
  loading: { type: Boolean, default: !1 }
821
621
  },
822
622
  emits: ["change", "search", "reset", "update:modelValue"],
823
- setup(e, { emit: t }) {
824
- const a = e, l = t, r = U({}), o = ce({}), d = ce({}), h = U(null), _ = U(!1), p = U(!1), f = U(0), O = U(0), i = U(null);
825
- let g = null, u = !1, T = !1;
826
- const P = ge(() => {
827
- if (!(!p.value || i.value == null))
623
+ setup(e, { emit: n }) {
624
+ const t = e, r = n, l = L({}), o = fe({}), i = fe({});
625
+ let g = !1;
626
+ function k(s, f) {
627
+ return JSON.stringify(s ?? {}) === JSON.stringify(f ?? {});
628
+ }
629
+ const u = L(null), p = L(!1), w = L(!1), d = L(0), h = L(0), c = L(null);
630
+ let x = null, M = !1, C = !1;
631
+ const ne = ve(() => {
632
+ if (!(!w.value || c.value == null))
828
633
  return {
829
- maxHeight: `${i.value}px`,
634
+ maxHeight: `${c.value}px`,
830
635
  overflow: "hidden"
831
636
  };
832
637
  });
833
- Z(
834
- () => a.modelValue,
638
+ W(
639
+ () => t.modelValue,
835
640
  (s) => {
836
- r.value = { ...s || {} };
641
+ k(s, l.value) || (g = !0, l.value = { ...s || {} }, G(() => {
642
+ g = !1;
643
+ }));
837
644
  },
838
645
  { deep: !0, immediate: !0 }
839
- ), Z(
840
- () => a.itemList,
646
+ ), W(
647
+ l,
648
+ () => {
649
+ g || r("update:modelValue", { ...l.value });
650
+ },
651
+ { deep: !0 }
652
+ ), W(
653
+ () => t.itemList,
841
654
  () => {
842
- _.value = !1, ee(() => W());
655
+ p.value = !1, G(() => q());
843
656
  },
844
657
  { deep: !0 }
845
- ), se(() => {
846
- ee(() => W()), typeof ResizeObserver < "u" && (g = new ResizeObserver(() => {
847
- !u && !T && W();
848
- }), h.value && g.observe(h.value)), window.addEventListener("resize", w);
849
- }), ye(() => {
850
- g == null || g.disconnect(), window.removeEventListener("resize", w);
658
+ ), ie(() => {
659
+ G(() => q()), typeof ResizeObserver < "u" && (x = new ResizeObserver(() => {
660
+ !M && !C && q();
661
+ }), u.value && x.observe(u.value)), window.addEventListener("resize", O);
662
+ }), _e(() => {
663
+ x == null || x.disconnect(), window.removeEventListener("resize", O);
851
664
  });
852
- function w() {
853
- !u && !T && W();
665
+ function O() {
666
+ !M && !C && q();
854
667
  }
855
- function te(s) {
668
+ function le(s) {
856
669
  if (!s.width) return;
857
- const m = typeof s.width == "number" ? `${s.width}px` : s.width;
858
- return { width: m, minWidth: m };
670
+ const f = typeof s.width == "number" ? `${s.width}px` : s.width;
671
+ return { width: f, minWidth: f };
859
672
  }
860
- function E(s, m) {
861
- const A = m.optionsLabel || "label";
862
- return typeof A == "string" ? s[A] : Array.isArray(A) ? `${s[A[0]]}(${s[A[1]]})` : s.label;
673
+ function ce(s, f) {
674
+ if (s == null) return "";
675
+ if (typeof s != "object") return String(s);
676
+ const U = f.optionsLabel || "label";
677
+ return typeof U == "string" ? s[U] : Array.isArray(U) ? `${s[U[0]]}(${s[U[1]]})` : s.label;
863
678
  }
864
- async function ae(s, m) {
679
+ function J(s, f) {
680
+ return s == null || typeof s != "object" ? s : s[f.optionsValue || "value"];
681
+ }
682
+ async function Le(s, f) {
865
683
  if (typeof s.remoteMethod == "function") {
866
- d[s.prop] = !0;
684
+ i[s.prop] = !0;
867
685
  try {
868
- const A = await s.remoteMethod(m);
869
- o[s.prop] = Array.isArray(A) ? A : [];
686
+ const U = await s.remoteMethod(f);
687
+ o[s.prop] = Array.isArray(U) ? U : [];
870
688
  } finally {
871
- d[s.prop] = !1;
689
+ i[s.prop] = !1;
872
690
  }
873
691
  }
874
692
  }
875
693
  function de(s) {
876
- const m = s.style.maxHeight, A = s.style.overflow, F = s.style.transition;
694
+ const f = s.style.maxHeight, U = s.style.overflow, I = s.style.transition;
877
695
  s.style.transition = "none", s.style.maxHeight = "none", s.style.overflow = "visible";
878
- const V = s.scrollHeight;
879
- return s.style.maxHeight = m, s.style.overflow = A, s.offsetHeight, s.style.transition = F, V;
696
+ const H = s.scrollHeight;
697
+ return s.style.maxHeight = f, s.style.overflow = U, s.offsetHeight, s.style.transition = I, H;
880
698
  }
881
- function W() {
882
- const s = h.value;
883
- if (!s || u || T) return;
884
- u = !0;
885
- const m = s.closest(".common-search"), A = s.querySelectorAll(".common-search__field");
886
- if (!A.length || !m) {
887
- p.value = !1, f.value = 0, O.value = 0, i.value = null, u = !1;
699
+ function q() {
700
+ const s = u.value;
701
+ if (!s || M || C) return;
702
+ M = !0;
703
+ const f = s.closest(".common-search"), U = s.querySelectorAll(".common-search__field");
704
+ if (!U.length || !f) {
705
+ w.value = !1, d.value = 0, h.value = 0, c.value = null, M = !1;
888
706
  return;
889
707
  }
890
- f.value = A[0].offsetHeight, O.value = de(s);
891
- const F = m.clientWidth, V = 20;
892
- let B = 0, J = 1;
893
- Array.from(A).forEach((ne, n) => {
894
- const G = ne.offsetWidth;
895
- if (n === 0) {
896
- B = G;
708
+ d.value = U[0].offsetHeight, h.value = de(s);
709
+ const I = f.clientWidth, H = 20;
710
+ let E = 0, ee = 1;
711
+ Array.from(U).forEach((ae, a) => {
712
+ const B = ae.offsetWidth;
713
+ if (a === 0) {
714
+ E = B;
897
715
  return;
898
716
  }
899
- B + V + G > F ? (J += 1, B = G) : B += V + G;
717
+ E + H + B > I ? (ee += 1, E = B) : E += H + B;
900
718
  });
901
- const M = J > 1;
902
- p.value = M, M ? _.value ? i.value = O.value : i.value = f.value : (_.value = !1, i.value = null), u = !1;
719
+ const R = ee > 1;
720
+ w.value = R, R ? p.value ? c.value = h.value : c.value = d.value : (p.value = !1, c.value = null), M = !1;
903
721
  }
904
- function we() {
905
- const s = h.value;
906
- if (!s || T) return;
907
- T = !0;
908
- const m = s.getBoundingClientRect().height || f.value;
909
- if (_.value)
910
- i.value = m, _.value = !1, requestAnimationFrame(() => {
722
+ function $e() {
723
+ const s = u.value;
724
+ if (!s || C) return;
725
+ C = !0;
726
+ const f = s.getBoundingClientRect().height || d.value;
727
+ if (p.value)
728
+ c.value = f, p.value = !1, requestAnimationFrame(() => {
911
729
  requestAnimationFrame(() => {
912
- i.value = f.value;
730
+ c.value = d.value;
913
731
  });
914
732
  });
915
733
  else {
916
- i.value = m;
917
- const A = de(s);
918
- O.value = A, _.value = !0, requestAnimationFrame(() => {
734
+ c.value = f;
735
+ const U = de(s);
736
+ h.value = U, p.value = !0, requestAnimationFrame(() => {
919
737
  requestAnimationFrame(() => {
920
- i.value = A;
738
+ c.value = U;
921
739
  });
922
740
  });
923
741
  }
924
742
  window.setTimeout(() => {
925
- T = !1, W();
743
+ C = !1, q();
926
744
  }, 380);
927
745
  }
928
- function ke() {
746
+ function Te() {
929
747
  const s = {};
930
- return a.itemList.forEach((m) => {
931
- m.type === "daterange" || m.type === "dateRange" ? (s[m.start] = void 0, s[m.end] = void 0) : m.type === "number-range" || m.type === "numberRange" ? (s[m.start || `${m.prop}Min`] = void 0, s[m.end || `${m.prop}Max`] = void 0) : m.multiple ? s[m.prop] = [] : m.prop && (s[m.prop] = void 0);
748
+ return t.itemList.forEach((f) => {
749
+ f.type === "daterange" || f.type === "dateRange" ? (s[f.start] = void 0, s[f.end] = void 0) : f.type === "number-range" || f.type === "numberRange" ? (s[f.start || `${f.prop}Min`] = void 0, s[f.end || `${f.prop}Max`] = void 0) : f.multiple ? s[f.prop] = [] : f.prop && (s[f.prop] = void 0);
932
750
  }), s;
933
751
  }
934
- function ue() {
935
- l("update:modelValue", { ...r.value });
752
+ function pe() {
753
+ r("update:modelValue", { ...l.value });
936
754
  }
937
- function R() {
938
- ue(), l("change", { ...r.value }), l("search", { ...r.value });
755
+ function A() {
756
+ pe(), r("change", { ...l.value }), r("search", { ...l.value });
939
757
  }
940
- function X() {
941
- r.value = ke(), ue(), l("reset", { ...r.value }), l("change", { ...r.value });
758
+ function Z() {
759
+ l.value = Te(), pe(), r("reset", { ...l.value }), r("change", { ...l.value });
942
760
  }
943
- return (s, m) => {
944
- const A = k("el-input"), F = k("el-option"), V = k("el-select"), B = k("el-input-number"), J = k("el-date-picker"), M = k("el-button"), ne = k("el-icon");
945
- return j((c(), y("div", {
946
- class: $(["common-search", {
947
- "is-single-row": !p.value,
948
- "is-multi-row": p.value,
949
- "is-expanded": p.value && _.value,
950
- "is-collapsed": p.value && !_.value
761
+ return (s, f) => {
762
+ const U = N("el-input"), I = N("el-option"), H = N("el-select"), E = N("el-input-number"), ee = N("el-date-picker"), R = N("el-button"), ae = N("el-icon");
763
+ return j((m(), b("div", {
764
+ class: V(["common-search", {
765
+ "is-single-row": !w.value,
766
+ "is-multi-row": w.value,
767
+ "is-expanded": w.value && p.value,
768
+ "is-collapsed": w.value && !p.value
951
769
  }])
952
770
  }, [
953
- S("div", dt, [
954
- S("div", ut, [
955
- S("div", {
771
+ _("div", ht, [
772
+ _("div", yt, [
773
+ _("div", {
956
774
  ref_key: "fieldsRef",
957
- ref: h,
775
+ ref: u,
958
776
  class: "common-search__fields",
959
- style: q(P.value)
777
+ style: X(ne.value)
960
778
  }, [
961
- (c(!0), y(N, null, H(e.itemList, (n, G) => (c(), y("div", {
962
- key: n.prop || n.start || G,
963
- class: $(["common-search__field", [`is-${n.type}`, n.className]]),
964
- style: q(te(n))
779
+ (m(!0), b(P, null, Y(e.itemList, (a, B) => (m(), b("div", {
780
+ key: a.prop || a.start || B,
781
+ class: V(["common-search__field", [`is-${a.type}`, a.className]]),
782
+ style: X(le(a))
965
783
  }, [
966
- n.label ? (c(), y("label", ct, x(n.label), 1)) : I("", !0),
967
- n.type === "input" || n.type === "text" ? (c(), L(A, {
784
+ a.label ? (m(), b("label", bt, D(a.label), 1)) : F("", !0),
785
+ a.type === "input" || a.type === "text" ? (m(), T(U, {
968
786
  key: 1,
969
- modelValue: r.value[n.prop],
970
- "onUpdate:modelValue": (v) => r.value[n.prop] = v,
787
+ modelValue: l.value[a.prop],
788
+ "onUpdate:modelValue": (y) => l.value[a.prop] = y,
971
789
  modelModifiers: { trim: !0 },
972
790
  clearable: "",
973
- placeholder: n.placeholder || `请输入${n.label || ""}`,
974
- maxlength: n.maxlength || 200,
975
- disabled: n.disabled,
976
- onKeyup: $e(R, ["enter"])
977
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : n.type === "select" ? (c(), L(V, {
791
+ placeholder: a.placeholder || `请输入${a.label || ""}`,
792
+ maxlength: a.maxlength || 200,
793
+ disabled: a.disabled,
794
+ onKeyup: Pe(A, ["enter"])
795
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "disabled"])) : a.type === "select" ? (m(), T(H, {
978
796
  key: 2,
979
- modelValue: r.value[n.prop],
980
- "onUpdate:modelValue": (v) => r.value[n.prop] = v,
981
- placeholder: n.placeholder || `请选择${n.label || ""}`,
797
+ modelValue: l.value[a.prop],
798
+ "onUpdate:modelValue": (y) => l.value[a.prop] = y,
799
+ placeholder: a.placeholder || `请选择${a.label || ""}`,
982
800
  clearable: "",
983
- filterable: n.filterable !== !1,
984
- multiple: n.multiple,
985
- "collapse-tags": n.multiple,
986
- "collapse-tags-tooltip": n.multiple,
987
- disabled: n.disabled,
988
- class: "common-search__control"
801
+ filterable: a.filterable !== !1,
802
+ multiple: a.multiple,
803
+ "collapse-tags": a.multiple,
804
+ "collapse-tags-tooltip": a.multiple,
805
+ disabled: a.disabled,
806
+ class: "common-search__control",
807
+ onChange: A
989
808
  }, {
990
- default: C(() => [
991
- (c(!0), y(N, null, H(n.options || [], (v) => (c(), L(F, {
992
- key: String(v[n.optionsValue || "value"]),
993
- label: E(v, n),
994
- value: v[n.optionsValue || "value"],
995
- disabled: v.disabled
809
+ default: S(() => [
810
+ (m(!0), b(P, null, Y(a.options || [], (y, re) => (m(), T(I, {
811
+ key: `${J(y, a)}-${re}`,
812
+ label: ce(y, a),
813
+ value: J(y, a),
814
+ disabled: typeof y == "object" && (y == null ? void 0 : y.disabled)
996
815
  }, null, 8, ["label", "value", "disabled"]))), 128))
997
816
  ]),
998
817
  _: 2
999
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : n.type === "remote-select" || n.type === "remoteSelect" ? (c(), L(V, {
818
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "filterable", "multiple", "collapse-tags", "collapse-tags-tooltip", "disabled"])) : a.type === "remote-select" || a.type === "remoteSelect" ? (m(), T(H, {
1000
819
  key: 3,
1001
- modelValue: r.value[n.prop],
1002
- "onUpdate:modelValue": (v) => r.value[n.prop] = v,
1003
- placeholder: n.placeholder || "请输入关键词搜索",
820
+ modelValue: l.value[a.prop],
821
+ "onUpdate:modelValue": (y) => l.value[a.prop] = y,
822
+ placeholder: a.placeholder || "请输入关键词搜索",
1004
823
  clearable: "",
1005
824
  filterable: "",
1006
825
  remote: "",
1007
- multiple: n.multiple,
1008
- "collapse-tags": n.multiple,
1009
- "collapse-tags-tooltip": n.multiple,
826
+ multiple: a.multiple,
827
+ "collapse-tags": a.multiple,
828
+ "collapse-tags-tooltip": a.multiple,
1010
829
  "reserve-keyword": !1,
1011
- "remote-method": (v) => ae(n, v),
1012
- loading: !!d[n.prop],
1013
- disabled: n.disabled,
830
+ "remote-method": (y) => Le(a, y),
831
+ loading: !!i[a.prop],
832
+ disabled: a.disabled,
1014
833
  class: "common-search__control",
1015
- onClear: (v) => o[n.prop] = []
834
+ onClear: (y) => o[a.prop] = [],
835
+ onChange: A
1016
836
  }, {
1017
- default: C(() => [
1018
- (c(!0), y(N, null, H(o[n.prop] || n.options || [], (v) => (c(), L(F, {
1019
- key: String(v[n.optionsValue || "value"]),
1020
- label: E(v, n),
1021
- value: v[n.optionsValue || "value"],
1022
- disabled: v.disabled
837
+ default: S(() => [
838
+ (m(!0), b(P, null, Y(o[a.prop] || a.options || [], (y, re) => (m(), T(I, {
839
+ key: `${J(y, a)}-${re}`,
840
+ label: ce(y, a),
841
+ value: J(y, a),
842
+ disabled: typeof y == "object" && (y == null ? void 0 : y.disabled)
1023
843
  }, null, 8, ["label", "value", "disabled"]))), 128))
1024
844
  ]),
1025
845
  _: 2
1026
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : n.type === "number-range" || n.type === "numberRange" ? (c(), y("div", pt, [
1027
- b(B, {
1028
- modelValue: r.value[n.start || `${n.prop}Min`],
1029
- "onUpdate:modelValue": (v) => r.value[n.start || `${n.prop}Min`] = v,
846
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "collapse-tags", "collapse-tags-tooltip", "remote-method", "loading", "disabled", "onClear"])) : a.type === "number-range" || a.type === "numberRange" ? (m(), b("div", vt, [
847
+ v(E, {
848
+ modelValue: l.value[a.start || `${a.prop}Min`],
849
+ "onUpdate:modelValue": (y) => l.value[a.start || `${a.prop}Min`] = y,
1030
850
  controls: !1,
1031
- min: n.min,
1032
- max: n.max,
1033
- precision: n.precision,
1034
- placeholder: n.minPlaceholder || "最小值",
1035
- disabled: n.disabled,
851
+ min: a.min,
852
+ max: a.max,
853
+ precision: a.precision,
854
+ placeholder: a.minPlaceholder || "最小值",
855
+ disabled: a.disabled,
1036
856
  class: "common-search__range-input"
1037
857
  }, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "placeholder", "disabled"]),
1038
- S("span", mt, x(n.separator || "至"), 1),
1039
- b(B, {
1040
- modelValue: r.value[n.end || `${n.prop}Max`],
1041
- "onUpdate:modelValue": (v) => r.value[n.end || `${n.prop}Max`] = v,
858
+ _("span", _t, D(a.separator || "至"), 1),
859
+ v(E, {
860
+ modelValue: l.value[a.end || `${a.prop}Max`],
861
+ "onUpdate:modelValue": (y) => l.value[a.end || `${a.prop}Max`] = y,
1042
862
  controls: !1,
1043
- min: n.min,
1044
- max: n.max,
1045
- precision: n.precision,
1046
- placeholder: n.maxPlaceholder || "最大值",
1047
- disabled: n.disabled,
863
+ min: a.min,
864
+ max: a.max,
865
+ precision: a.precision,
866
+ placeholder: a.maxPlaceholder || "最大值",
867
+ disabled: a.disabled,
1048
868
  class: "common-search__range-input"
1049
869
  }, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "precision", "placeholder", "disabled"])
1050
- ])) : n.type === "date" ? (c(), L(J, {
870
+ ])) : a.type === "date" ? (m(), T(ee, {
1051
871
  key: 5,
1052
- modelValue: r.value[n.prop],
1053
- "onUpdate:modelValue": (v) => r.value[n.prop] = v,
1054
- type: n.dateType || "date",
1055
- placeholder: n.placeholder || "年/月/日",
1056
- "value-format": n.valueFormat || "YYYY-MM-DD",
1057
- format: n.format || "YYYY/MM/DD",
1058
- clearable: n.clearable !== !1,
1059
- disabled: n.disabled,
872
+ modelValue: l.value[a.prop],
873
+ "onUpdate:modelValue": (y) => l.value[a.prop] = y,
874
+ type: a.dateType || "date",
875
+ placeholder: a.placeholder || "年/月/日",
876
+ "value-format": a.valueFormat || "YYYY-MM-DD",
877
+ format: a.format || "YYYY/MM/DD",
878
+ clearable: a.clearable !== !1,
879
+ disabled: a.disabled,
1060
880
  class: "common-search__control"
1061
- }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : n.type === "daterange" || n.type === "dateRange" ? (c(), y("div", ft, [
1062
- b(Ce, {
1063
- start: r.value[n.start],
1064
- "onUpdate:start": (v) => r.value[n.start] = v,
1065
- end: r.value[n.end],
1066
- "onUpdate:end": (v) => r.value[n.end] = v,
1067
- onChange: R
881
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "value-format", "format", "clearable", "disabled"])) : a.type === "daterange" || a.type === "dateRange" ? (m(), b("div", wt, [
882
+ v(Ne, {
883
+ start: l.value[a.start],
884
+ "onUpdate:start": (y) => l.value[a.start] = y,
885
+ end: l.value[a.end],
886
+ "onUpdate:end": (y) => l.value[a.end] = y,
887
+ onChange: A
1068
888
  }, null, 8, ["start", "onUpdate:start", "end", "onUpdate:end"])
1069
- ])) : K(s.$slots, n.slotName || n.prop, {
1070
- item: n,
1071
- form: r.value
889
+ ])) : Q(s.$slots, a.slotName || a.prop, {
890
+ item: a,
891
+ form: l.value
1072
892
  }, void 0, !0, 7)
1073
893
  ], 6))), 128))
1074
894
  ], 4)
1075
895
  ]),
1076
- p.value ? I("", !0) : (c(), y("div", ht, [
1077
- K(s.$slots, "actions", {
1078
- search: R,
1079
- reset: X,
1080
- form: r.value
896
+ w.value ? F("", !0) : (m(), b("div", kt, [
897
+ Q(s.$slots, "actions", {
898
+ search: A,
899
+ reset: Z,
900
+ form: l.value
1081
901
  }, () => [
1082
- b(M, {
902
+ v(R, {
1083
903
  class: "common-search__reset",
1084
- onClick: X
904
+ onClick: Z
1085
905
  }, {
1086
- default: C(() => [...m[0] || (m[0] = [
1087
- D("重置", -1)
906
+ default: S(() => [...f[0] || (f[0] = [
907
+ $("重置", -1)
1088
908
  ])]),
1089
909
  _: 1
1090
910
  }),
1091
- b(M, {
911
+ v(R, {
1092
912
  type: "primary",
1093
913
  class: "common-search__submit",
1094
914
  loading: e.loading,
1095
- onClick: R
915
+ onClick: A
1096
916
  }, {
1097
- default: C(() => [...m[1] || (m[1] = [
1098
- D(" 搜索 ", -1)
917
+ default: S(() => [...f[1] || (f[1] = [
918
+ $(" 搜索 ", -1)
1099
919
  ])]),
1100
920
  _: 1
1101
921
  }, 8, ["loading"])
1102
922
  ], !0)
1103
923
  ]))
1104
924
  ]),
1105
- p.value ? (c(), y("div", gt, [
1106
- S("div", yt, [
1107
- S("div", vt, [
1108
- K(s.$slots, "actions", {
1109
- search: R,
1110
- reset: X,
1111
- form: r.value
925
+ w.value ? (m(), b("div", Ct, [
926
+ _("div", St, [
927
+ _("div", xt, [
928
+ Q(s.$slots, "actions", {
929
+ search: A,
930
+ reset: Z,
931
+ form: l.value
1112
932
  }, () => [
1113
- b(M, {
933
+ v(R, {
1114
934
  class: "common-search__reset",
1115
- onClick: X
935
+ onClick: Z
1116
936
  }, {
1117
- default: C(() => [...m[2] || (m[2] = [
1118
- D("重置", -1)
937
+ default: S(() => [...f[2] || (f[2] = [
938
+ $("重置", -1)
1119
939
  ])]),
1120
940
  _: 1
1121
941
  }),
1122
- b(M, {
942
+ v(R, {
1123
943
  type: "primary",
1124
944
  class: "common-search__submit",
1125
945
  loading: e.loading,
1126
- onClick: R
946
+ onClick: A
1127
947
  }, {
1128
- default: C(() => [...m[3] || (m[3] = [
1129
- D(" 搜索 ", -1)
948
+ default: S(() => [...f[3] || (f[3] = [
949
+ $(" 搜索 ", -1)
1130
950
  ])]),
1131
951
  _: 1
1132
952
  }, 8, ["loading"])
1133
953
  ], !0)
1134
954
  ]),
1135
- b(M, {
1136
- onClick: we,
955
+ v(R, {
956
+ onClick: $e,
1137
957
  type: "primary",
1138
958
  plain: ""
1139
959
  }, {
1140
- default: C(() => [
1141
- D(x(_.value ? "收起" : "展开") + " ", 1),
1142
- b(ne, { class: "el-icon--right" }, {
1143
- default: C(() => [
1144
- (c(), L(Ee(_.value ? "ArrowUp" : "ArrowDown")))
960
+ default: S(() => [
961
+ $(D(p.value ? "收起" : "展开") + " ", 1),
962
+ v(ae, { class: "el-icon--right" }, {
963
+ default: S(() => [
964
+ (m(), T(Ie(p.value ? "ArrowUp" : "ArrowDown")))
1145
965
  ]),
1146
966
  _: 1
1147
967
  })
@@ -1149,13 +969,13 @@ const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986
1149
969
  _: 1
1150
970
  })
1151
971
  ])
1152
- ])) : I("", !0)
972
+ ])) : F("", !0)
1153
973
  ], 2)), [
1154
974
  [z, e.itemList.length]
1155
975
  ]);
1156
976
  };
1157
977
  }
1158
- }, _t = /* @__PURE__ */ Y(bt, [["__scopeId", "data-v-02dd2350"]]), St = {
978
+ }), Ut = /* @__PURE__ */ K(Nt, [["__scopeId", "data-v-08ffb41c"]]), Mt = {
1159
979
  name: "MgOverflowHid",
1160
980
  props: {
1161
981
  label: String,
@@ -1173,64 +993,64 @@ const st = /* @__PURE__ */ Y(ze, [["render", ot], ["__scopeId", "data-v-27d5f986
1173
993
  return {};
1174
994
  },
1175
995
  methods: {
1176
- cutString(e, t) {
1177
- let a = e || "";
1178
- return a && a.length > t && (a = a.slice(0, t) + "..."), a;
996
+ cutString(e, n) {
997
+ let t = e || "";
998
+ return t && t.length > n && (t = t.slice(0, n) + "..."), t;
1179
999
  }
1180
1000
  }
1181
- }, Ct = { class: "tableOverflowHid" }, Tt = ["innerHTML"], wt = { class: "name-wrapper" }, kt = ["innerHTML"], At = { key: 1 }, Ot = ["innerHTML"];
1182
- function xt(e, t, a, l, r, o) {
1183
- const d = k("el-popover");
1184
- return c(), y("div", Ct, [
1185
- a.value && a.value.length > a.maxLength ? (c(), L(d, {
1001
+ }, Dt = { class: "tableOverflowHid" }, Lt = ["innerHTML"], $t = { class: "name-wrapper" }, Tt = ["innerHTML"], Vt = { key: 1 }, Ot = ["innerHTML"];
1002
+ function At(e, n, t, r, l, o) {
1003
+ const i = N("el-popover");
1004
+ return m(), b("div", Dt, [
1005
+ t.value && t.value.length > t.maxLength ? (m(), T(i, {
1186
1006
  key: 0,
1187
1007
  trigger: "hover",
1188
1008
  placement: "bottom",
1189
1009
  width: "400"
1190
1010
  }, {
1191
- reference: C(() => [
1192
- S("div", wt, [
1193
- j(S("span", {
1194
- class: $(a.labelClassName)
1195
- }, x(a.label) + ":", 3), [
1196
- [z, a.label]
1011
+ reference: S(() => [
1012
+ _("div", $t, [
1013
+ j(_("span", {
1014
+ class: V(t.labelClassName)
1015
+ }, D(t.label) + ":", 3), [
1016
+ [z, t.label]
1197
1017
  ]),
1198
- S("span", {
1199
- class: $(a.valueClassName),
1200
- innerHTML: o.cutString(a.value, a.maxLength)
1201
- }, null, 10, kt)
1018
+ _("span", {
1019
+ class: V(t.valueClassName),
1020
+ innerHTML: o.cutString(t.value, t.maxLength)
1021
+ }, null, 10, Tt)
1202
1022
  ])
1203
1023
  ]),
1204
- default: C(() => [
1205
- j(S("span", {
1206
- class: $(a.labelClassName)
1207
- }, x(a.label) + ":", 3), [
1208
- [z, a.label]
1024
+ default: S(() => [
1025
+ j(_("span", {
1026
+ class: V(t.labelClassName)
1027
+ }, D(t.label) + ":", 3), [
1028
+ [z, t.label]
1209
1029
  ]),
1210
- S("span", { innerHTML: a.value }, null, 8, Tt)
1030
+ _("span", { innerHTML: t.value }, null, 8, Lt)
1211
1031
  ]),
1212
1032
  _: 1
1213
- })) : (c(), y("div", At, [
1214
- j(S("span", {
1215
- class: $(a.labelClassName)
1216
- }, x(a.label) + ":", 3), [
1217
- [z, a.label]
1033
+ })) : (m(), b("div", Vt, [
1034
+ j(_("span", {
1035
+ class: V(t.labelClassName)
1036
+ }, D(t.label) + ":", 3), [
1037
+ [z, t.label]
1218
1038
  ]),
1219
- S("span", {
1220
- class: $([a.valueClassName, "value"])
1039
+ _("span", {
1040
+ class: V([t.valueClassName, "value"])
1221
1041
  }, [
1222
- S("span", { innerHTML: a.value }, null, 8, Ot)
1042
+ _("span", { innerHTML: t.value }, null, 8, Ot)
1223
1043
  ], 2)
1224
1044
  ]))
1225
1045
  ]);
1226
1046
  }
1227
- const Te = /* @__PURE__ */ Y(St, [["render", xt], ["__scopeId", "data-v-ef86ea54"]]), Ut = { class: "common-table__main" }, Dt = { key: 0 }, Pt = { key: 1 }, Lt = {
1047
+ const Ue = /* @__PURE__ */ K(Mt, [["render", At], ["__scopeId", "data-v-ef86ea54"]]), Rt = { class: "common-table__main" }, Ft = { key: 0 }, Ht = { key: 1 }, Et = {
1228
1048
  key: 2,
1229
1049
  class: "bold-text"
1230
- }, $t = {
1050
+ }, Pt = {
1231
1051
  key: 0,
1232
1052
  class: "common-table__pagination"
1233
- }, Et = {
1053
+ }, It = /* @__PURE__ */ Object.assign({ name: "MgDataTable" }, {
1234
1054
  __name: "DataTable",
1235
1055
  props: {
1236
1056
  /** 列配置:el-table-column 属性 + slotName */
@@ -1288,102 +1108,102 @@ const Te = /* @__PURE__ */ Y(St, [["render", xt], ["__scopeId", "data-v-ef86ea54
1288
1108
  }
1289
1109
  },
1290
1110
  emits: ["pageChange", "cellClick", "edit", "delete"],
1291
- setup(e, { emit: t }) {
1292
- const a = e, l = t, r = {
1111
+ setup(e, { emit: n }) {
1112
+ const t = e, r = n, l = {
1293
1113
  background: "var(--brand-secondary-pale)",
1294
1114
  color: "var(--brand-text-primary)",
1295
1115
  fontWeight: 600,
1296
1116
  fontSize: "13px"
1297
- }, o = ge(() => ({
1298
- headerCellStyle: r,
1299
- ...a.tableBind
1117
+ }, o = ve(() => ({
1118
+ headerCellStyle: l,
1119
+ ...t.tableBind
1300
1120
  }));
1301
- function d(i) {
1302
- const { slotName: g, maxLength: u, ...T } = i || {};
1121
+ function i(d) {
1122
+ const { slotName: h, maxLength: c, ...x } = d || {};
1303
1123
  return {
1304
- ...T
1124
+ ...x
1305
1125
  };
1306
1126
  }
1307
- function h(i) {
1308
- return i == null || i === "" ? "-" : i;
1127
+ function g(d) {
1128
+ return d == null || d === "" ? "-" : d;
1309
1129
  }
1310
- function _(i) {
1311
- return a.pagination ? (a.pagination.page - 1) * a.pagination.limit + i + 1 : i + 1;
1130
+ function k(d) {
1131
+ return t.pagination ? (t.pagination.page - 1) * t.pagination.limit + d + 1 : d + 1;
1312
1132
  }
1313
- function p(i) {
1314
- var g;
1315
- l("pageChange", { page: (g = a.pagination) == null ? void 0 : g.page, limit: i });
1133
+ function u(d) {
1134
+ var h;
1135
+ r("pageChange", { page: (h = t.pagination) == null ? void 0 : h.page, limit: d });
1316
1136
  }
1317
- function f(i) {
1318
- var g;
1319
- l("pageChange", { page: i, limit: (g = a.pagination) == null ? void 0 : g.limit });
1137
+ function p(d) {
1138
+ var h;
1139
+ r("pageChange", { page: d, limit: (h = t.pagination) == null ? void 0 : h.limit });
1320
1140
  }
1321
- function O(i, g, u, T) {
1322
- l("cellClick", i, g, u, T), a.canCellClick && (g == null ? void 0 : g.label) !== "操作" && window.getSelection().toString();
1141
+ function w(d, h, c, x) {
1142
+ r("cellClick", d, h, c, x), t.canCellClick && (h == null ? void 0 : h.label) !== "操作" && window.getSelection().toString();
1323
1143
  }
1324
- return (i, g) => {
1325
- const u = k("el-table-column"), T = k("el-table"), P = k("el-pagination");
1326
- return c(), y("div", {
1327
- class: $(["common-table", { "is-fill-height": e.fillHeight }])
1144
+ return (d, h) => {
1145
+ const c = N("el-table-column"), x = N("el-table"), M = N("el-pagination");
1146
+ return m(), b("div", {
1147
+ class: V(["common-table", { "is-fill-height": e.fillHeight }])
1328
1148
  }, [
1329
- S("div", Ut, [
1330
- b(T, pe({
1149
+ _("div", Rt, [
1150
+ v(x, me({
1331
1151
  data: e.dataList,
1332
1152
  height: e.fillHeight ? "100%" : void 0,
1333
1153
  class: { "common-pointer-table": e.canCellClick }
1334
- }, o.value, { onCellClick: O }), {
1335
- default: C(() => [
1336
- e.showIndex ? (c(), L(u, {
1154
+ }, o.value, { onCellClick: w }), {
1155
+ default: S(() => [
1156
+ e.showIndex ? (m(), T(c, {
1337
1157
  key: 0,
1338
1158
  type: "index",
1339
1159
  label: e.indexLabel,
1340
1160
  width: e.indexWidth,
1341
- index: _,
1161
+ index: k,
1342
1162
  align: "center"
1343
- }, null, 8, ["label", "width"])) : I("", !0),
1344
- (c(!0), y(N, null, H(e.propList, (w, te) => (c(), L(u, pe({
1345
- key: w.prop || w.slotName || te
1346
- }, { ref_for: !0 }, d(w)), Me({ _: 2 }, [
1347
- w.slotName ? {
1163
+ }, null, 8, ["label", "width"])) : F("", !0),
1164
+ (m(!0), b(P, null, Y(e.propList, (C, ne) => (m(), T(c, me({
1165
+ key: C.prop || C.slotName || ne
1166
+ }, { ref_for: !0 }, i(C)), Be({ _: 2 }, [
1167
+ C.slotName ? {
1348
1168
  name: "default",
1349
- fn: C(({ row: E, $index: ae }) => [
1350
- w.slotName === "overtext" ? (c(), y("div", Dt, [
1351
- b(Te, {
1352
- value: String(E[w.prop] ?? ""),
1353
- "max-length": w.maxLength || 18
1169
+ fn: S(({ row: O, $index: le }) => [
1170
+ C.slotName === "overtext" ? (m(), b("div", Ft, [
1171
+ v(Ue, {
1172
+ value: String(O[C.prop] ?? ""),
1173
+ "max-length": C.maxLength || 18
1354
1174
  }, null, 8, ["value", "max-length"])
1355
- ])) : w.slotName === "whether" ? (c(), y("div", Pt, x(E[w.prop] == 0 ? "否" : E[w.prop] == 1 ? "是" : ""), 1)) : w.slotName === "boldtext" ? (c(), y("div", Lt, x(E[w.prop]), 1)) : K(i.$slots, w.slotName, {
1356
- row: E,
1357
- index: ae,
1358
- column: w
1175
+ ])) : C.slotName === "whether" ? (m(), b("div", Ht, D(O[C.prop] == 0 ? "否" : O[C.prop] == 1 ? "是" : ""), 1)) : C.slotName === "boldtext" ? (m(), b("div", Et, D(O[C.prop]), 1)) : Q(d.$slots, C.slotName, {
1176
+ row: O,
1177
+ index: le,
1178
+ column: C
1359
1179
  }, () => [
1360
- D(x(h(E[w.prop])), 1)
1180
+ $(D(g(O[C.prop])), 1)
1361
1181
  ], !0, 3)
1362
1182
  ]),
1363
1183
  key: "0"
1364
1184
  } : void 0
1365
1185
  ]), 1040))), 128)),
1366
- K(i.$slots, "default", {}, void 0, !0)
1186
+ Q(d.$slots, "default", {}, void 0, !0)
1367
1187
  ]),
1368
1188
  _: 3
1369
1189
  }, 16, ["data", "height", "class"])
1370
1190
  ]),
1371
- e.pagination ? (c(), y("div", $t, [
1372
- b(P, {
1191
+ e.pagination ? (m(), b("div", Pt, [
1192
+ v(M, {
1373
1193
  background: "",
1374
1194
  "current-page": e.pagination.page,
1375
1195
  "page-size": e.pagination.limit,
1376
1196
  "page-sizes": e.pageSizes,
1377
1197
  total: e.pagination.total,
1378
1198
  layout: e.paginationLayout,
1379
- onSizeChange: p,
1380
- onCurrentChange: f
1199
+ onSizeChange: u,
1200
+ onCurrentChange: p
1381
1201
  }, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout"])
1382
- ])) : I("", !0)
1202
+ ])) : F("", !0)
1383
1203
  ], 2);
1384
1204
  };
1385
1205
  }
1386
- }, Mt = /* @__PURE__ */ Y(Et, [["__scopeId", "data-v-56028833"]]), It = ["aria-checked", "disabled", "onClick"], Vt = {
1206
+ }), Bt = /* @__PURE__ */ K(It, [["__scopeId", "data-v-5f80313c"]]), Yt = ["aria-checked", "disabled", "onClick"], jt = {
1387
1207
  __name: "SegmentedControl",
1388
1208
  props: {
1389
1209
  modelValue: { type: [String, Number, Boolean], default: void 0 },
@@ -1391,220 +1211,309 @@ const Te = /* @__PURE__ */ Y(St, [["render", xt], ["__scopeId", "data-v-ef86ea54
1391
1211
  options: { type: Array, default: () => [] }
1392
1212
  },
1393
1213
  emits: ["update:modelValue", "change"],
1394
- setup(e, { emit: t }) {
1395
- const a = e, l = t, r = U(null), o = U([]), d = U(!1), h = U({
1214
+ setup(e, { emit: n }) {
1215
+ const t = e, r = n, l = L(null), o = L([]), i = L(!1), g = L({
1396
1216
  width: "0px",
1397
1217
  transform: "translateX(0px)"
1398
1218
  });
1399
- let _ = null;
1400
- function p(i, g) {
1401
- i && (o.value[g] = i);
1219
+ let k = null;
1220
+ function u(d, h) {
1221
+ d && (o.value[h] = d);
1402
1222
  }
1403
- function f() {
1404
- const i = r.value;
1405
- if (!i) return;
1406
- const g = a.options.findIndex((w) => w.value === a.modelValue), u = o.value[g];
1407
- if (!u) {
1408
- h.value = { width: "0px", transform: "translateX(0px)" };
1223
+ function p() {
1224
+ const d = l.value;
1225
+ if (!d) return;
1226
+ const h = t.options.findIndex((C) => C.value === t.modelValue), c = o.value[h];
1227
+ if (!c) {
1228
+ g.value = { width: "0px", transform: "translateX(0px)" };
1409
1229
  return;
1410
1230
  }
1411
- const T = i.getBoundingClientRect(), P = u.getBoundingClientRect();
1412
- h.value = {
1413
- width: `${P.width}px`,
1414
- transform: `translateX(${P.left - T.left}px)`
1415
- }, d.value = !0;
1231
+ const x = d.getBoundingClientRect(), M = c.getBoundingClientRect();
1232
+ g.value = {
1233
+ width: `${M.width}px`,
1234
+ transform: `translateX(${M.left - x.left}px)`
1235
+ }, i.value = !0;
1416
1236
  }
1417
- function O(i) {
1418
- i.disabled || (l("update:modelValue", i.value), l("change", i.value));
1237
+ function w(d) {
1238
+ d.disabled || (r("update:modelValue", d.value), r("change", d.value));
1419
1239
  }
1420
- return Z(
1421
- () => [a.modelValue, a.options],
1240
+ return W(
1241
+ () => [t.modelValue, t.options],
1422
1242
  async () => {
1423
- await ee(), f();
1243
+ await G(), p();
1424
1244
  },
1425
1245
  { deep: !0 }
1426
- ), se(async () => {
1427
- await ee(), f(), typeof ResizeObserver < "u" && r.value && (_ = new ResizeObserver(() => f()), _.observe(r.value));
1428
- }), ye(() => {
1429
- _ == null || _.disconnect(), _ = null;
1430
- }), (i, g) => (c(), y("div", {
1246
+ ), ie(async () => {
1247
+ await G(), p(), typeof ResizeObserver < "u" && l.value && (k = new ResizeObserver(() => p()), k.observe(l.value));
1248
+ }), _e(() => {
1249
+ k == null || k.disconnect(), k = null;
1250
+ }), (d, h) => (m(), b("div", {
1431
1251
  ref_key: "rootRef",
1432
- ref: r,
1252
+ ref: l,
1433
1253
  class: "segmented",
1434
1254
  role: "radiogroup"
1435
1255
  }, [
1436
- S("div", {
1437
- class: $(["segmented__thumb", { "is-ready": d.value }]),
1438
- style: q(h.value)
1256
+ _("div", {
1257
+ class: V(["segmented__thumb", { "is-ready": i.value }]),
1258
+ style: X(g.value)
1439
1259
  }, null, 6),
1440
- (c(!0), y(N, null, H(e.options, (u, T) => (c(), y("button", {
1441
- key: String(u.value),
1260
+ (m(!0), b(P, null, Y(e.options, (c, x) => (m(), b("button", {
1261
+ key: String(c.value),
1442
1262
  ref_for: !0,
1443
- ref: (P) => p(P, T),
1263
+ ref: (M) => u(M, x),
1444
1264
  type: "button",
1445
- class: $(["segmented__item", { "is-active": e.modelValue === u.value }]),
1265
+ class: V(["segmented__item", { "is-active": e.modelValue === c.value }]),
1446
1266
  role: "radio",
1447
- "aria-checked": e.modelValue === u.value,
1448
- disabled: u.disabled,
1449
- onClick: (P) => O(u)
1450
- }, x(u.label), 11, It))), 128))
1267
+ "aria-checked": e.modelValue === c.value,
1268
+ disabled: c.disabled,
1269
+ onClick: (M) => w(c)
1270
+ }, D(c.label), 11, Yt))), 128))
1451
1271
  ], 512));
1452
1272
  }
1453
- }, Bt = /* @__PURE__ */ Y(Vt, [["__scopeId", "data-v-4c522659"]]);
1454
- function Nt(e) {
1273
+ }, zt = /* @__PURE__ */ K(jt, [["__scopeId", "data-v-8bff3e5b"]]);
1274
+ function Kt(e) {
1455
1275
  return !!(e == null || typeof e == "string" && e.trim() === "" || Array.isArray(e) && e.length === 0 || typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0);
1456
1276
  }
1457
- function le(e) {
1277
+ function oe(e) {
1458
1278
  if (e === null || typeof e != "object") return e;
1459
1279
  if (e instanceof Date) return new Date(e.getTime());
1460
- if (Array.isArray(e)) return e.map((a) => le(a));
1461
- const t = {};
1462
- return Object.keys(e).forEach((a) => {
1463
- t[a] = le(e[a]);
1464
- }), t;
1280
+ if (Array.isArray(e)) return e.map((t) => oe(t));
1281
+ const n = {};
1282
+ return Object.keys(e).forEach((t) => {
1283
+ n[t] = oe(e[t]);
1284
+ }), n;
1465
1285
  }
1466
- function Rt(e, t = 300) {
1467
- let a = null;
1468
- return function(...r) {
1469
- a && clearTimeout(a), a = setTimeout(() => {
1470
- e.apply(this, r);
1471
- }, t);
1286
+ function qt(e, n = 300) {
1287
+ let t = null;
1288
+ return function(...l) {
1289
+ t && clearTimeout(t), t = setTimeout(() => {
1290
+ e.apply(this, l);
1291
+ }, n);
1472
1292
  };
1473
1293
  }
1474
- function Ft(e, t = 300) {
1475
- let a = 0;
1476
- return function(...r) {
1294
+ function Wt(e, n = 300) {
1295
+ let t = 0;
1296
+ return function(...l) {
1477
1297
  const o = Date.now();
1478
- o - a >= t && (a = o, e.apply(this, r));
1298
+ o - t >= n && (t = o, e.apply(this, l));
1479
1299
  };
1480
1300
  }
1481
- function Gt(e, t = "YYYY-MM-DD HH:mm:ss") {
1482
- const a = e instanceof Date ? e : new Date(e);
1483
- if (Number.isNaN(a.getTime())) return "";
1484
- const l = {
1485
- YYYY: String(a.getFullYear()),
1486
- MM: String(a.getMonth() + 1).padStart(2, "0"),
1487
- DD: String(a.getDate()).padStart(2, "0"),
1488
- HH: String(a.getHours()).padStart(2, "0"),
1489
- mm: String(a.getMinutes()).padStart(2, "0"),
1490
- ss: String(a.getSeconds()).padStart(2, "0")
1301
+ function Me(e) {
1302
+ if (e == null || e === "") return null;
1303
+ if (e instanceof Date)
1304
+ return Number.isNaN(e.getTime()) ? null : e;
1305
+ if (typeof e == "number") {
1306
+ const l = new Date(e);
1307
+ return Number.isNaN(l.getTime()) ? null : l;
1308
+ }
1309
+ const n = String(e).trim();
1310
+ if (!n) return null;
1311
+ if (/^\d{10,13}$/.test(n)) {
1312
+ const l = n.length === 10 ? Number(n) * 1e3 : Number(n), o = new Date(l);
1313
+ return Number.isNaN(o.getTime()) ? null : o;
1314
+ }
1315
+ if (/[Zz]$|[+-]\d{2}:?\d{2}$/.test(n)) {
1316
+ const l = new Date(n);
1317
+ return Number.isNaN(l.getTime()) ? null : l;
1318
+ }
1319
+ const t = n.match(
1320
+ /^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
1321
+ );
1322
+ if (t) {
1323
+ const [, l, o, i, g = "0", k = "0", u = "0", p = "0"] = t, w = new Date(
1324
+ Number(l),
1325
+ Number(o) - 1,
1326
+ Number(i),
1327
+ Number(g),
1328
+ Number(k),
1329
+ Number(u),
1330
+ Number(String(p).padEnd(3, "0"))
1331
+ );
1332
+ return Number.isNaN(w.getTime()) ? null : w;
1333
+ }
1334
+ const r = new Date(n);
1335
+ return Number.isNaN(r.getTime()) ? null : r;
1336
+ }
1337
+ function se(e, n = "YYYY-MM-DD HH:mm:ss") {
1338
+ const t = Me(e);
1339
+ if (!t) return "";
1340
+ const r = t.getFullYear(), l = t.getMonth() + 1, o = t.getDate(), i = t.getHours(), g = t.getMinutes(), k = t.getSeconds(), u = {
1341
+ YYYY: String(r),
1342
+ MM: String(l).padStart(2, "0"),
1343
+ DD: String(o).padStart(2, "0"),
1344
+ HH: String(i).padStart(2, "0"),
1345
+ mm: String(g).padStart(2, "0"),
1346
+ ss: String(k).padStart(2, "0"),
1347
+ M: String(l),
1348
+ D: String(o),
1349
+ H: String(i),
1350
+ m: String(g),
1351
+ s: String(k)
1352
+ };
1353
+ return n.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (p) => u[p]);
1354
+ }
1355
+ function Gt() {
1356
+ const e = /* @__PURE__ */ new Date();
1357
+ e.setHours(23, 59, 59, 0);
1358
+ const n = /* @__PURE__ */ new Date();
1359
+ return n.setDate(n.getDate() - 30), n.setHours(0, 0, 0, 0), {
1360
+ start: se(n, "YYYY-MM-DD HH:mm:ss"),
1361
+ end: se(e, "YYYY-MM-DD HH:mm:ss")
1491
1362
  };
1492
- return Object.keys(l).reduce((r, o) => r.replace(o, l[o]), t);
1493
1363
  }
1494
- function Ht(e = "id") {
1364
+ function Qt(e) {
1365
+ const n = {};
1366
+ return Object.keys(e || {}).forEach((t) => {
1367
+ const r = e[t];
1368
+ r == null || r === "" || Array.isArray(r) && r.length === 0 || (n[t] = r);
1369
+ }), n;
1370
+ }
1371
+ function Xt(e, n = 2) {
1372
+ if (e == null || e === "") return e;
1373
+ const t = Number(e);
1374
+ if (Number.isNaN(t)) return e;
1375
+ const r = t.toFixed(n), [l, o] = r.split("."), i = l.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1376
+ if (o == null) return i;
1377
+ const g = o.replace(/0+$/, "");
1378
+ return g ? `${i}.${g}` : i;
1379
+ }
1380
+ function Jt(e = "id") {
1495
1381
  return `${e}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
1496
1382
  }
1497
- const ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1383
+ const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1498
1384
  __proto__: null,
1499
- debounce: Rt,
1500
- deepClone: le,
1501
- formatDate: Gt,
1502
- isEmpty: Nt,
1503
- throttle: Ft,
1504
- uniqueId: Ht
1385
+ cleanParams: Qt,
1386
+ debounce: qt,
1387
+ deepClone: oe,
1388
+ formatDate: se,
1389
+ formatNum: Xt,
1390
+ getRecentMonthRange: Gt,
1391
+ isEmpty: Kt,
1392
+ parseDate: Me,
1393
+ throttle: Wt,
1394
+ uniqueId: Jt
1505
1395
  }, Symbol.toStringTag, { value: "Module" }));
1506
- function jt(e = {}) {
1396
+ function Zt(e = {}) {
1507
1397
  const {
1508
- baseURL: t = "",
1509
- timeout: a = 6e4,
1510
- tokenKey: l,
1511
- systemIdKey: r,
1398
+ baseURL: n = "",
1399
+ timeout: t = 6e4,
1400
+ tokenKey: r,
1401
+ systemIdKey: l,
1512
1402
  loginUrl: o = "/login"
1513
- } = e, d = Ie.create({ baseURL: t, timeout: a });
1514
- let h = !1;
1515
- function _() {
1516
- typeof localStorage < "u" && localStorage.clear(), !h && (h = !0, setTimeout(() => {
1403
+ } = e, i = Ye.create({ baseURL: n, timeout: t });
1404
+ let g = !1;
1405
+ function k() {
1406
+ typeof localStorage < "u" && localStorage.clear(), !g && (g = !0, setTimeout(() => {
1517
1407
  typeof window < "u" && window.location.replace(o);
1518
1408
  }, 1500));
1519
1409
  }
1520
- return d.interceptors.request.use(
1521
- (p) => {
1522
- if (p.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u") {
1523
- if (l) {
1524
- const f = localStorage.getItem(l);
1525
- f && (p.headers.Authorization = f);
1526
- }
1410
+ return i.interceptors.request.use(
1411
+ (u) => {
1412
+ if (u.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u") {
1527
1413
  if (r) {
1528
- const f = localStorage.getItem(r);
1529
- f && (p.headers.systemId = f);
1414
+ const p = localStorage.getItem(r);
1415
+ p && (u.headers.Authorization = p);
1416
+ }
1417
+ if (l) {
1418
+ const p = localStorage.getItem(l);
1419
+ p && (u.headers.systemId = p);
1530
1420
  }
1531
1421
  }
1532
- return p;
1533
- },
1534
- (p) => Promise.reject(p)
1535
- ), d.interceptors.response.use(
1536
- (p) => {
1537
- if (p.status !== 200)
1538
- return Promise.reject(new Error(`请求发生错误,状态码 ${p.status}`));
1539
- const { data: f, config: O } = p;
1540
- if (O.responseType === "arraybuffer") return f;
1541
- if (f && f.code === 0) return f.data;
1542
- if (f && (f.code === 401 || f.code === 403))
1543
- return _(), Promise.reject(new Error("登录失效,请重新登录"));
1544
- const i = f && (f.data || f.message || f.msg) || "请求失败";
1545
- return Promise.reject(new Error(String(i)));
1546
- },
1547
- (p) => Promise.reject(p)
1548
- ), d;
1422
+ return u;
1423
+ },
1424
+ (u) => Promise.reject(u)
1425
+ ), i.interceptors.response.use(
1426
+ (u) => {
1427
+ if (u.status !== 200)
1428
+ return Promise.reject(new Error(`请求发生错误,状态码 ${u.status}`));
1429
+ const { data: p, config: w } = u;
1430
+ if (w.responseType === "arraybuffer") return p;
1431
+ if (p && p.code === 0) return p.data;
1432
+ const d = Number(p == null ? void 0 : p.code);
1433
+ if (d === 401 || d === 403)
1434
+ return k(), Promise.reject(new Error("登录失效,请重新登录"));
1435
+ const h = be(p) || "请求失败";
1436
+ return Promise.reject(new Error(h));
1437
+ },
1438
+ (u) => {
1439
+ var h, c;
1440
+ const p = (h = u == null ? void 0 : u.response) == null ? void 0 : h.status;
1441
+ if (p === 401 || p === 403)
1442
+ return k(), Promise.reject(new Error("登录失效,请重新登录"));
1443
+ const w = (c = u == null ? void 0 : u.response) == null ? void 0 : c.data, d = be(w) || (u == null ? void 0 : u.message) || "请求失败";
1444
+ return Promise.reject(new Error(String(d)));
1445
+ }
1446
+ ), i;
1549
1447
  }
1550
- function zt(e = {}) {
1551
- const t = jt(e);
1448
+ function be(e) {
1449
+ if (e == null) return "";
1450
+ if (typeof e == "string") return e;
1451
+ if (typeof e != "object") return String(e);
1452
+ const n = [e.message, e.msg, e.data, e.error];
1453
+ for (const t of n)
1454
+ if (!(t == null || t === "") && (typeof t == "string" || typeof t == "number"))
1455
+ return String(t);
1456
+ return "";
1457
+ }
1458
+ function en(e = {}) {
1459
+ const n = Zt(e);
1552
1460
  return {
1553
- GET(a, l = {}) {
1554
- return t({ method: "get", url: a, ...l });
1461
+ GET(t, r = {}) {
1462
+ return n({ method: "get", url: t, ...r });
1555
1463
  },
1556
- POST(a, l, r = {}) {
1557
- return t({ method: "post", url: a, data: l, ...r });
1464
+ POST(t, r, l = {}) {
1465
+ return n({ method: "post", url: t, data: r, ...l });
1558
1466
  },
1559
- DELETE(a, l = {}) {
1560
- return t({ method: "delete", url: a, ...l });
1467
+ DELETE(t, r = {}) {
1468
+ return n({ method: "delete", url: t, ...r });
1561
1469
  }
1562
1470
  };
1563
1471
  }
1564
- let oe = null;
1565
- function Yt(e) {
1566
- oe = e;
1472
+ const De = "__MGACN_COMMONSDK_REQUEST__";
1473
+ function tn(e) {
1474
+ globalThis[De] = e;
1567
1475
  }
1568
- function aa() {
1569
- if (!oe)
1476
+ function pn() {
1477
+ const e = globalThis[De];
1478
+ if (!e)
1570
1479
  throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
1571
- return oe;
1480
+ return e;
1572
1481
  }
1573
- const Wt = {
1574
- MgImageUpload: st,
1575
- MgSearchForm: _t,
1576
- MgDataTable: Mt,
1577
- MgDateRangePicker: Ce,
1578
- MgSegmentedControl: Bt,
1579
- MgOverflowHid: Te
1580
- }, Kt = (e, t = {}) => {
1581
- Object.entries(Wt).forEach(([r, o]) => {
1582
- e.component(o.name || r, o);
1482
+ const nn = {
1483
+ MgImageUpload: mt,
1484
+ MgSearchForm: Ut,
1485
+ MgDataTable: Bt,
1486
+ MgDateRangePicker: Ne,
1487
+ MgSegmentedControl: zt,
1488
+ MgOverflowHid: Ue
1489
+ }, ln = (e, n = {}) => {
1490
+ Object.entries(nn).forEach(([l, o]) => {
1491
+ e.component(o.name || l, o);
1583
1492
  });
1584
- const a = zt(t), l = Ve(a);
1585
- Yt(a), Be(l), e.config.globalProperties.$request = a, e.config.globalProperties.$api = l;
1586
- }, na = {
1587
- install: Kt,
1493
+ const t = en(n), r = je(t);
1494
+ tn(t), ze(r), e.config.globalProperties.$request = t, e.config.globalProperties.$api = r;
1495
+ }, fn = {
1496
+ install: ln,
1588
1497
  version: "1.0.0"
1589
1498
  };
1590
1499
  export {
1591
- Mt as DataTable,
1592
- Ce as DateRangePicker,
1593
- st as ImageUpload,
1594
- _t as SearchForm,
1595
- Bt as SegmentedControl,
1596
- Te as TableOverflowHid,
1500
+ Bt as DataTable,
1501
+ Ne as DateRangePicker,
1502
+ mt as ImageUpload,
1503
+ Ut as SearchForm,
1504
+ zt as SegmentedControl,
1505
+ Ue as TableOverflowHid,
1597
1506
  Ge as aliOssMixin,
1598
- Ve as createApi,
1599
- _e as createOssClient,
1600
- zt as createRequest,
1601
- jt as createService,
1602
- na as default,
1603
- Ne as getApi,
1604
- be as getOssSts,
1605
- aa as getRequest,
1606
- Kt as install,
1607
- Be as setApi,
1608
- Fe as uploadToOss,
1609
- ta as utils
1507
+ je as createApi,
1508
+ Se as createOssClient,
1509
+ en as createRequest,
1510
+ Zt as createService,
1511
+ fn as default,
1512
+ Ke as getApi,
1513
+ Ce as getOssSts,
1514
+ pn as getRequest,
1515
+ ln as install,
1516
+ ze as setApi,
1517
+ We as uploadToOss,
1518
+ dn as utils
1610
1519
  };