hs-admin-ui 17.0.4 → 17.0.6

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.
@@ -0,0 +1,1026 @@
1
+ import { S as v, X as F, H as y, ax as P, J as L, dT as K, M as S, dU as ne, dV as C, dW as h, aa as R, T as le, be as re, ap as oe, ae as D, aj as se, b2 as ie, b3 as ue, dX as ce, W as de, b5 as fe, b6 as ge, b1 as me, dY as pe, aT as ye, aS as be, dZ as he, d_ as ve, d$ as _e, e0 as xe, e1 as we, e2 as De, e3 as Ce, e4 as Ee, e5 as Se, am as Ae, Z as Te, L as Ne, e6 as Be, e7 as Fe, a4 as Pe, e8 as Me, e9 as je, ea as Ie, eb as Le, ec as Re, K as Oe, ed as Ye, ee as $e, ef as ke, eg as Ue, eh as Ke, ei as He, ej as We, ek as qe, aw as Je, el as ze, em as Ze, ac as Qe, en as Xe, eo as Ge, ep as Ve, eq as et, er as tt, V as at, al as nt, N as lt, es as rt, et as ot, an as st, eu as it, ev as ut, at as ct, ew as dt, ex as ft, ey as gt, ez as mt, eA as pt, eB as yt, eC as bt, eD as ht, eE as vt, eF as _t, eG as xt, eH as wt, eI as Dt, eJ as Ct, eK as Et, eL as St, eM as At, eN as Tt, eO as Nt, eP as Bt, eQ as Ft, eR as Pt, eS as Mt, eT as jt, eU as It } from "./bcVisual.vue_vue_type_style_index_0_scoped_a917535e_lang-vyql0LvH.js";
2
+ import { ref as Lt, onBeforeUnmount as Rt, nextTick as Ot } from "vue";
3
+ function Yt(t, e) {
4
+ const n = M(t), a = M(e);
5
+ let l = 0;
6
+ const o = n.length;
7
+ for (let r in a)
8
+ for (let s in n)
9
+ a[r] === n[s] && l++;
10
+ return l === o;
11
+ }
12
+ function H(t, e) {
13
+ if (!t || !e)
14
+ return !1;
15
+ let n = Object.getOwnPropertyNames(t), a = Object.getOwnPropertyNames(e);
16
+ if (n.length != a.length)
17
+ return !1;
18
+ for (let l = 0; l < n.length; l++) {
19
+ let o = n[l], r = t[o], s = e[o];
20
+ if (!e.hasOwnProperty(o))
21
+ return !1;
22
+ if (r instanceof Object) {
23
+ if (!H(r, s))
24
+ return !1;
25
+ } else if (r !== s)
26
+ return !1;
27
+ }
28
+ return !0;
29
+ }
30
+ function M(t, e) {
31
+ if (Object.keys(t).length)
32
+ if (e) {
33
+ const n = {};
34
+ return t.reduce((a, l) => (n[l[e]] || (n[l[e]] = l[e] && a.push(l)), a), []);
35
+ } else
36
+ return [...new Set(t)];
37
+ else
38
+ return t;
39
+ }
40
+ let W = "127.0.0.1", q = 54321, f;
41
+ function $t(t, e, n = "ws") {
42
+ return f || (f = new ws(t, e, {
43
+ automaticOpen: !1,
44
+ //是否自动连接标志(true|false),默认为true
45
+ reconnectDecay: 1.5,
46
+ //自动重连延迟重连速度,数字,默认为1.5
47
+ output: "output",
48
+ //指定调试输出div
49
+ protocol: n
50
+ //指定通讯协议(ws|wss),默认为"ws"
51
+ }), f.onconnecting = function(a) {
52
+ f.log("正与服务器建立连接...", a);
53
+ }, f.onopen = function(a) {
54
+ f.log("与服务器连接成功。", a);
55
+ }, f.onclose = function(a) {
56
+ f.log("与打印服务器的连接已关闭", a);
57
+ }, f.onmessage = function(a) {
58
+ f.log('收到消息!"' + a.data + '"', a);
59
+ let l = JSON && JSON.parse(a.data);
60
+ l.result === 1 || v.error("Print failed: " + l.message);
61
+ }, f.onerror = function(a) {
62
+ typeof a.detail == "object" ? (typeof a.detail.message == "string" && f.log("遇到一个错误: " + a.detail.message, a), typeof a.detail.data == "string" && f.log("遇到一个错误: " + a.detail.message, a)) : typeof a.data == "string" ? f.log("遇到一个错误: " + a.data, a) : f.log("遇到一个错误", a);
63
+ }, f);
64
+ }
65
+ const O = () => $t(W, q);
66
+ function J() {
67
+ const t = O();
68
+ return t.open(), new Promise((e, n) => {
69
+ t.addEventListener("open", e), t.addEventListener("close", n);
70
+ });
71
+ }
72
+ function z(t) {
73
+ return J().then(() => {
74
+ const e = O(), n = function(l, o) {
75
+ e.protocol === "ws" && (e.setHost(W), e.setPort(q)), e.protocol, e.open();
76
+ }, a = function(l) {
77
+ e.log("SENT: <br/>" + l), e.log("正在发送消息..."), e.send(l);
78
+ };
79
+ e.state() !== e.OPEN ? (e.log("连接已断开,正在重新连接。"), e.onopen = function(l) {
80
+ e.log("与服务器连接成功。", l), a(t);
81
+ }, n()) : a(t);
82
+ }).catch(() => {
83
+ v.warning("请先启动康虎云打印服务器!");
84
+ });
85
+ }
86
+ async function Z(t, e) {
87
+ var x, g, T, N;
88
+ if (!t.config_info)
89
+ return v.warning("请先添加模板!"), Promise.reject();
90
+ const n = JSON.parse(t.config_info) || {};
91
+ let a = [], l = {}, o = [], r = [], s = [], u = [];
92
+ (x = n.formData) == null || x.map((i) => {
93
+ a.push({
94
+ type: "str",
95
+ size: 255,
96
+ name: i.name,
97
+ required: !1
98
+ }), i.name === "销售日期" || i.name === "移库日期" || i.name === "申请单单据日期" || i.name === "交易日期" ? l[i.name] = e[i.value] ? F(e[i.value]).format("YYYY-MM-DD HH:mm") : "" : y.endsWith(i.name, "日期") || i.name === "有效期" ? l[i.name] = e[i.value] ? F(e[i.value]).format("YYYY-MM-DD") : "" : y.endsWith(i.name, "金额") ? l[i.name] = P(e[i.value] || "") : l[i.name] = e[i.value] || "";
99
+ });
100
+ const c = await L.get("userInfo");
101
+ l.所属公司 = c.company_name;
102
+ const _ = ((g = e == null ? void 0 : e.detail) == null ? void 0 : g.reduce((i, p) => i += p.commodity_num || 0, 0)) || 0;
103
+ l.本单合计数量 = _, [
104
+ "repayment_sum",
105
+ //还款金额
106
+ "arrears_sum",
107
+ //欠款金额
108
+ "receipt_sum",
109
+ //收款金额
110
+ "refunds_sum",
111
+ //采购退款金额
112
+ "payment_sum",
113
+ //付款金额
114
+ "amount_sum",
115
+ //预付金额
116
+ "apply_sum",
117
+ //预付款申请单金额
118
+ "payment_app_sum",
119
+ //付款申请金额
120
+ "return_sum_total",
121
+ //销售合计金额
122
+ "return_sum",
123
+ //采购合计金额
124
+ "discount_after_sum",
125
+ //折后金额
126
+ "delivery_sum",
127
+ //配货合计金额
128
+ "commodity_sum",
129
+ //入库合计金额
130
+ "contract_sum",
131
+ "sum_of_reject",
132
+ //拒收单合金金额
133
+ "move_sum",
134
+ //合计
135
+ "real_amount"
136
+ //实收
137
+ ].forEach((i) => {
138
+ if (!e[i])
139
+ return;
140
+ let p = K(e[i]);
141
+ l.本单合计金额大写 = p, l.本单合计金额 = e.commodity_sum || e.delivery_sum;
142
+ }), o = ((T = n.tableData) == null ? void 0 : T.map((i) => ({
143
+ type: i.type,
144
+ size: i.type === "Str" ? 255 : 0,
145
+ name: i.name,
146
+ required: !1
147
+ }))) || [], r = ((N = e == null ? void 0 : e.detail) == null ? void 0 : N.map((i) => {
148
+ var w;
149
+ let p = {};
150
+ return (w = n.tableData) == null || w.forEach((b) => {
151
+ y.endsWith(b.name, "日期") || y.endsWith(b.name, "时间") || b.name === "有效期至" ? p[b.name] = i[b.value] ? F(i[b.value]).format("YYYY-MM-DD") : "" : y.endsWith(b.name, "金额") ? p[b.name] = P(i[b.value] || "") : p[b.name] = i[b.value] || "";
152
+ }), p;
153
+ })) || [], e.other_information && (s = n.otherData.map((i) => ({
154
+ type: i.type,
155
+ size: i.type === "Str" ? 255 : 0,
156
+ name: i.name,
157
+ required: !1
158
+ })), u = e.other_information.map((i) => {
159
+ let p = {};
160
+ return n.otherData.forEach((w) => {
161
+ p[w.name] = i[w.value] || "";
162
+ }), p;
163
+ }));
164
+ const m = {
165
+ template: `base64:${t.template_base64}`,
166
+ ver: 4,
167
+ Copies: t.copies,
168
+ Duplex: t.duplex || 0,
169
+ Printer: t.printer ? JSON.parse(t.printer).default : "",
170
+ Design: t.design || 0,
171
+ PageTop: t.page_top || 10,
172
+ PageLeft: t.page_left || 10,
173
+ Preview: t.preview,
174
+ Tables: [
175
+ {
176
+ Name: "表单信息",
177
+ Cols: a,
178
+ Data: [l]
179
+ },
180
+ {
181
+ Name: "销售配车单",
182
+ Cols: o,
183
+ Data: r.length ? r : [{}]
184
+ }
185
+ ]
186
+ };
187
+ return s.length && m.Tables.push({
188
+ Name: "其他信息",
189
+ Cols: s,
190
+ Data: u.length ? u : [{}]
191
+ }), console.log("trimPrintData整理打印数据=>>>>>", m), m;
192
+ }
193
+ function kt(t) {
194
+ return new Promise((e, n) => {
195
+ try {
196
+ let a = document.createElement("canvas"), l = a.getContext("2d"), o = new Image();
197
+ o.setAttribute("crossOrigin", "anonymous"), o.src = t, o.onload = function() {
198
+ a.height = o.height, a.width = o.width, l.drawImage(o, 0, 0);
199
+ let r = a.toDataURL("image/jpeg", 1);
200
+ a = null, e("base64/jpeg:" + r.split(",")[1]);
201
+ };
202
+ } catch {
203
+ n("");
204
+ }
205
+ });
206
+ }
207
+ async function Ut(t, e) {
208
+ const n = await L.get("userInfo"), a = await S({
209
+ url: `/${n.project_code}-web/pri/print_template/get_template_by_code`,
210
+ method: "get",
211
+ params: {
212
+ template_code: t
213
+ }
214
+ }).then((o) => y.get(o, "data", {}));
215
+ e || (e = {
216
+ detail: []
217
+ });
218
+ const l = await Z(a, e);
219
+ return z(JSON.stringify(l));
220
+ }
221
+ const Kt = (t) => ({
222
+ toClipboard(e, n) {
223
+ return new Promise((a, l) => {
224
+ const o = document.createElement("button"), r = new ne(o, {
225
+ text: () => e,
226
+ action: () => "copy",
227
+ container: n !== void 0 ? n : document.body
228
+ });
229
+ r.on("success", (s) => {
230
+ r.destroy(), a(s);
231
+ }), r.on("error", (s) => {
232
+ r.destroy(), l(s);
233
+ }), document.body.appendChild(o), o.click(), document.body.removeChild(o);
234
+ });
235
+ }
236
+ }), Ht = (t) => new Promise((e, n) => {
237
+ try {
238
+ Kt().toClipboard(t), v.success("复制成功!"), e(t);
239
+ } catch (a) {
240
+ v.error("复制失败!"), n(a);
241
+ }
242
+ });
243
+ function Q(t, e, n = ["id"]) {
244
+ for (let a in e)
245
+ Object.keys(t).includes(a) ? typeof e[a] == "object" && !Array.isArray(e[a]) ? Q(t[a], e[a]) : t[a] = e[a] : n.includes(a) && (t[a] = e[a]);
246
+ return t;
247
+ }
248
+ function Wt(t) {
249
+ const e = Lt(!1), n = () => {
250
+ e.value = C.isFullscreen;
251
+ };
252
+ C.on("change", n);
253
+ function a() {
254
+ if (!C.isEnabled)
255
+ return v.warning("暂不不支持全屏"), !1;
256
+ C.toggle(t);
257
+ }
258
+ return Rt(() => {
259
+ C.off("change", n);
260
+ }), { isFullPage: e, toggle: a };
261
+ }
262
+ function A(t, e) {
263
+ if (!t)
264
+ return "";
265
+ let n = t.getDay(), a = X(t), l = Math.floor((t.getMonth() + 3) / 3).toString();
266
+ const o = {
267
+ "Y+": t.getFullYear().toString(),
268
+ // 年
269
+ "m+": (t.getMonth() + 1).toString(),
270
+ // 月(月份从0开始,要+1)
271
+ "d+": t.getDate().toString(),
272
+ // 日
273
+ "H+": t.getHours().toString(),
274
+ // 时
275
+ "M+": t.getMinutes().toString(),
276
+ // 分
277
+ "S+": t.getSeconds().toString(),
278
+ // 秒
279
+ "q+": l
280
+ // 季度
281
+ }, r = {
282
+ 0: "日",
283
+ 1: "一",
284
+ 2: "二",
285
+ 3: "三",
286
+ 4: "四",
287
+ 5: "五",
288
+ 6: "六"
289
+ }, s = {
290
+ 1: "一",
291
+ 2: "二",
292
+ 3: "三",
293
+ 4: "四"
294
+ };
295
+ /(W+)/.test(e) && (e = e.replace(RegExp.$1, RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? "星期" + r[n] : "周" + r[n] : r[n])), /(Q+)/.test(e) && (e = e.replace(RegExp.$1, RegExp.$1.length == 4 ? "第" + s[l] + "季度" : s[l])), /(Z+)/.test(e) && (e = e.replace(RegExp.$1, RegExp.$1.length == 3 ? "第" + a + "周" : a + ""));
296
+ for (let u in o) {
297
+ let c = new RegExp("(" + u + ")").exec(e);
298
+ c && (e = e.replace(c[1], RegExp.$1.length == 1 ? o[u] : o[u].padStart(RegExp.$1.length, "0")));
299
+ }
300
+ return e;
301
+ }
302
+ function X(t) {
303
+ let e = new Date(t.getTime()), n = e.getDay() || 7;
304
+ e.setDate(e.getDate() - n + 1 + 5);
305
+ let a = new Date(e.getFullYear(), 0, 1), l = a.getDay(), o = 1;
306
+ l != 0 && (o = 7 - l + 1), a = new Date(e.getFullYear(), 0, 1 + o);
307
+ let r = Math.ceil((e.valueOf() - a.valueOf()) / 864e5);
308
+ return Math.ceil(r / 7);
309
+ }
310
+ function qt(t, e = "YYYY-mm-dd") {
311
+ let n, a, l = (/* @__PURE__ */ new Date()).getTime();
312
+ if (typeof t == "string" || typeof t == "object" ? n = new Date(t).getTime() : n = t, l = Number.parseInt(`${l - n}`), l < 1e4)
313
+ return "刚刚";
314
+ if (l < 6e4 && l >= 1e4)
315
+ return a = Math.floor(l / 1e3), `${a}秒前`;
316
+ if (l < 36e5 && l >= 6e4)
317
+ return a = Math.floor(l / 6e4), `${a}分钟前`;
318
+ if (l < 864e5 && l >= 36e5)
319
+ return a = Math.floor(l / 36e5), `${a}小时前`;
320
+ if (l < 2592e5 && l >= 864e5)
321
+ return a = Math.floor(l / 864e5), `${a}天前`;
322
+ {
323
+ let o = t;
324
+ return (typeof t == "string" || typeof t == "object") && (o = new Date(t)), A(o, e);
325
+ }
326
+ }
327
+ function Jt(t) {
328
+ let e = new Date(t).getHours();
329
+ return e < 6 ? "凌晨好" : e < 9 ? "早上好" : e < 12 ? "上午好" : e < 14 ? "中午好" : e < 17 ? "下午好" : e < 19 ? "傍晚好" : e < 22 ? "晚上好" : "夜里好";
330
+ }
331
+ const zt = (t, e, n) => n ? `${n}%` : "-", Zt = (t, e, n) => n ? A(new Date(n), "YYYY-mm-dd") : "-", Qt = (t, e, n) => n ? A(new Date(n), "YYYY-mm-dd HH:MM:SS") : "-", Xt = (t, e, n) => {
332
+ if (!n)
333
+ return "-";
334
+ let a = 0;
335
+ return typeof t == "number" && (a = t), typeof n == "number" && (a = n), A(new Date(a * 1e3), "HH:MM:SS");
336
+ }, Gt = (t = "0", e = 4) => Number.parseFloat(t).toFixed(e), Vt = (t = "0") => Number.parseFloat(t).toFixed(2), ea = (t) => {
337
+ let e = t && t.toUpperCase();
338
+ const n = {
339
+ 11: "北京",
340
+ 12: "天津",
341
+ 13: "河北",
342
+ 14: "山西",
343
+ 15: "内蒙古",
344
+ 21: "辽宁",
345
+ 22: "吉林",
346
+ 23: "黑龙江 ",
347
+ 31: "上海",
348
+ 32: "江苏",
349
+ 33: "浙江",
350
+ 34: "安徽",
351
+ 35: "福建",
352
+ 36: "江西",
353
+ 37: "山东",
354
+ 41: "河南",
355
+ 42: "湖北 ",
356
+ 43: "湖南",
357
+ 44: "广东",
358
+ 45: "广西",
359
+ 46: "海南",
360
+ 50: "重庆",
361
+ 51: "四川",
362
+ 52: "贵州",
363
+ 53: "云南",
364
+ 54: "西藏 ",
365
+ 61: "陕西",
366
+ 62: "甘肃",
367
+ 63: "青海",
368
+ 64: "宁夏",
369
+ 65: "新疆",
370
+ 71: "台湾",
371
+ 81: "香港",
372
+ 82: "澳门",
373
+ 91: "国外 "
374
+ };
375
+ let a = "", l = !0;
376
+ if (!e || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(e))
377
+ a = "身份证号格式错误", l = !1;
378
+ else if (!n[e.substr(0, 2)])
379
+ a = "身份证地址编码错误", l = !1;
380
+ else if (e.length == 18) {
381
+ e = e.split("");
382
+ for (var o = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], r = [1, 0, "X", 9, 8, 7, 6, 5, 4, 3, 2], s = 0, u = 0, c = 0, _ = 0; _ < 17; _++)
383
+ u = e[_], c = o[_], s += u * c;
384
+ r[s % 11], r[s % 11] != e[17] && (a = "身份证校验位错误", l = !1);
385
+ }
386
+ return {
387
+ tip: a,
388
+ pass: l
389
+ };
390
+ }, ta = (t, e, n) => {
391
+ e = e || "hskj20180614java", n = n || "hskj20180614java";
392
+ let a = h.enc.Utf8.parse(e), l = h.enc.Utf8.parse(n), o = h.enc.Utf8.parse(t), r = h.AES.encrypt(o, a, {
393
+ iv: l,
394
+ mode: h.mode.CBC,
395
+ padding: h.pad.ZeroPadding
396
+ });
397
+ return h.enc.Base64.stringify(r.ciphertext);
398
+ }, aa = (t, e, n) => {
399
+ e = e || "hskj20180614java", n = n || "hskj20180614java";
400
+ var a = h.enc.Utf8.parse(e);
401
+ let l = h.enc.Utf8.parse(n);
402
+ var o = h.AES.decrypt(t, a, {
403
+ iv: l,
404
+ mode: h.mode.CBC,
405
+ padding: h.pad.ZeroPadding
406
+ });
407
+ return h.enc.Base64.stringify(o.ciphertext);
408
+ };
409
+ function na({ uniqueId: t, projectCode: e, templateName: n, tableConfig: a, tableData: l }) {
410
+ const o = [];
411
+ if (a.filter((c) => R({ ...c.data, uniqueId: t })).map((c) => c.data).filter((c) => c.fieldExport == !0).forEach((c) => {
412
+ le.includes(c.type) || o.push(c);
413
+ }), y.isEmpty(o))
414
+ return v.warning("未配置导出字段"), Promise.reject();
415
+ const r = u({ templateArr: o, tableData: l });
416
+ return s(
417
+ {
418
+ template_name: n,
419
+ ...r
420
+ },
421
+ e
422
+ );
423
+ async function s(c, _) {
424
+ return S({
425
+ url: `/${_}-web/pub/excel/export_model_assign`,
426
+ responseType: "blob",
427
+ method: "post",
428
+ data: c,
429
+ timeout: 1e3 * 60 * 20
430
+ // 二十分钟
431
+ }).then((d) => {
432
+ const m = new Blob([d], {
433
+ type: "application/vnd.ms-excel"
434
+ }), x = c.template_name ? c.template_name : (/* @__PURE__ */ new Date()).getTime().toString();
435
+ let g = document.createElement("a");
436
+ return g.href = URL.createObjectURL(m), g.download = x + ".xlsx", document.body.appendChild(g), g.click(), document.body.removeChild(g), d;
437
+ });
438
+ }
439
+ function u({ templateArr: c, tableData: _ }) {
440
+ const d = { 序号: "A" }, m = [], x = [], g = [
441
+ "A",
442
+ "B",
443
+ "C",
444
+ "D",
445
+ "E",
446
+ "F",
447
+ "G",
448
+ "H",
449
+ "I",
450
+ "J",
451
+ "K",
452
+ "L",
453
+ "M",
454
+ "N",
455
+ "O",
456
+ "P",
457
+ "Q",
458
+ "R",
459
+ "S",
460
+ "T",
461
+ "U",
462
+ "V",
463
+ "W",
464
+ "X",
465
+ "Y",
466
+ "Z",
467
+ "AA",
468
+ "AB",
469
+ "AC",
470
+ "AD",
471
+ "AE",
472
+ "AF",
473
+ "AG",
474
+ "AH",
475
+ "AI",
476
+ "AJ",
477
+ "AK",
478
+ "AL",
479
+ "AM",
480
+ "AN",
481
+ "AO",
482
+ "AP",
483
+ "AQ",
484
+ "AR",
485
+ "AS",
486
+ "AT",
487
+ "AU",
488
+ "AV",
489
+ "AW",
490
+ "AX",
491
+ "AY",
492
+ "AZ",
493
+ "BA",
494
+ "BB",
495
+ "BC",
496
+ "BD",
497
+ "BE",
498
+ "BF",
499
+ "BG",
500
+ "BH",
501
+ "BI",
502
+ "BJ",
503
+ "BK",
504
+ "BL",
505
+ "BM",
506
+ "BN",
507
+ "BO",
508
+ "BP",
509
+ "BQ",
510
+ "BR",
511
+ "BS",
512
+ "BT",
513
+ "BU",
514
+ "BV",
515
+ "BW",
516
+ "BX",
517
+ "BY",
518
+ "BZ"
519
+ ];
520
+ let T = "";
521
+ c.forEach((i, p) => {
522
+ d[i.title] = g[p + 1], x.push(i.field);
523
+ }), _.forEach((i, p) => {
524
+ let w = { A: p + 1 };
525
+ x.forEach((b, ae) => {
526
+ w[g[ae + 1]] = N(i[b]);
527
+ }), m.push(w);
528
+ });
529
+ function N(i) {
530
+ return i == "1" ? "开启" : i == "0" ? "关闭" : i;
531
+ }
532
+ return {
533
+ titles_json_data: JSON.stringify(d),
534
+ infoData_json_data: JSON.stringify(m),
535
+ isNumerical: T
536
+ };
537
+ }
538
+ }
539
+ function la(t) {
540
+ return new Promise((e, n) => {
541
+ const a = {}, l = t.columnConfig.filter(
542
+ (r) => R({
543
+ ...r.data,
544
+ uniqueId: t.uniqueId
545
+ })
546
+ ).map((r) => r.data).filter((r) => r.fieldExport == !0).map((r) => (Object.keys(r).forEach((s) => {
547
+ const u = s;
548
+ typeof r[u] == "function" && (a[r.field] || (a[r.field] = []), a[r.field].push(r[u]));
549
+ }), { fieldName: r.field, title: r.title }));
550
+ if (y.isEmpty(l))
551
+ return v.warning("未配置导出字段"), n();
552
+ const o = t.data.map((r) => (Object.keys(a).forEach((s) => {
553
+ var u;
554
+ (u = a[s]) == null || u.forEach((c) => {
555
+ r[`_old_${s}`] = r[`_old_${s}`] || r[s], r[s] = r[`_old_${s}`], r[s] = c({ row: r, column: { field: s } }) || "";
556
+ });
557
+ }), r));
558
+ return S({
559
+ url: `/${t.projectCode}-web/pri/easyexcel/export_model_assign`,
560
+ responseType: "blob",
561
+ method: "post",
562
+ data: {
563
+ titles_json_data: l,
564
+ data_json_data: o,
565
+ template_name: t.template_name,
566
+ export_biz_type: t.export_biz_type
567
+ },
568
+ timeout: 1e3 * 60 * 20
569
+ // 二十分钟
570
+ }).then((r) => {
571
+ e();
572
+ const s = new Blob([r], {
573
+ type: "application/vnd.ms-excel"
574
+ });
575
+ Y(s, t.template_name + ".xlsx");
576
+ });
577
+ });
578
+ }
579
+ function ra(t, e = "/pri/easyexcel/export_model_all") {
580
+ return new Promise((n, a) => {
581
+ const l = t.columnConfig.filter(
582
+ (d) => R({
583
+ ...d.data,
584
+ uniqueId: t.uniqueId
585
+ })
586
+ ).map((d) => d.data).filter((d) => d.fieldExport == !0).map((d) => {
587
+ var x;
588
+ let m = d.field;
589
+ if (typeof d.formatter == "function") {
590
+ const g = (x = d.formatter_2) == null ? void 0 : x.match(new RegExp("(?<=row\\.)(\\w+)", "g"));
591
+ m = g ? String(g) : d.field;
592
+ }
593
+ return { fieldName: m, title: d.title };
594
+ });
595
+ if (y.isEmpty(l))
596
+ return v.warning("未配置导出字段"), a();
597
+ let s = (re(t.uniqueId) || {})[`${oe}${t.tableId}`] || {};
598
+ for (let d in t.search_json_data)
599
+ (t.search_json_data[d] || t.search_json_data[d] === 0) && (s[d] = t.search_json_data[d]);
600
+ const u = {
601
+ titles_json_data: l,
602
+ search_json_data: s,
603
+ template_name: t.template_name,
604
+ export_biz_type: t.export_biz_type
605
+ }, c = Object.keys(s).filter((d) => d.startsWith("_")).map((d) => {
606
+ const [m, x, g] = d.split("|");
607
+ return {
608
+ type: m.slice(1),
609
+ key: x,
610
+ code: g,
611
+ value: s[d]
612
+ };
613
+ });
614
+ c.length > 0 && (u.qry_json_data = JSON.stringify(c));
615
+ const _ = t.projectCode.replace("-web", "");
616
+ return S({
617
+ url: `/${_}-web${e}`,
618
+ responseType: "blob",
619
+ method: "post",
620
+ data: u,
621
+ timeout: 1e3 * 60 * 20
622
+ // 二十分钟
623
+ }).then((d) => {
624
+ n();
625
+ const m = new Blob([d], {
626
+ type: "application/vnd.ms-excel"
627
+ });
628
+ Y(m, t.template_name + ".xlsx");
629
+ });
630
+ });
631
+ }
632
+ function oa(t) {
633
+ const e = document.createElement("a");
634
+ e.href = t.url, e.download = t.name, e.style.display = "none", document.body.appendChild(e), e.click(), document.body.removeChild(e);
635
+ }
636
+ function Y(t, e) {
637
+ let n = document.createElement("a");
638
+ n.href = window.URL.createObjectURL(t), n.download = /\./.test(e) ? e : e + ".xlsx", document.body.appendChild(n), n.click(), document.body.removeChild(n);
639
+ }
640
+ function sa(t) {
641
+ const [e = "", n = ""] = t.split(","), a = e.match(/:(.*?);/)[1], l = atob(n);
642
+ let o = l.length, r = new Uint8Array(o);
643
+ for (; o--; )
644
+ r[o] = l.charCodeAt(o);
645
+ return new Blob([r], {
646
+ type: a
647
+ });
648
+ }
649
+ const ia = {
650
+ // 创建 loading
651
+ start: () => {
652
+ const t = document.body, e = document.createElement("div");
653
+ e.setAttribute("class", "loading-next");
654
+ const n = `
655
+ <div class="loading-next-box">
656
+ <div class="loading-next-box-warp">
657
+ <div class="loading-next-box-item"></div>
658
+ <div class="loading-next-box-item"></div>
659
+ <div class="loading-next-box-item"></div>
660
+ <div class="loading-next-box-item"></div>
661
+ <div class="loading-next-box-item"></div>
662
+ <div class="loading-next-box-item"></div>
663
+ <div class="loading-next-box-item"></div>
664
+ <div class="loading-next-box-item"></div>
665
+ <div class="loading-next-box-item"></div>
666
+ </div>
667
+ </div>
668
+ `;
669
+ e.innerHTML = n, t.insertBefore(e, t.childNodes[0]), window.nextLoading = !0;
670
+ },
671
+ // 移除 loading
672
+ done: (t = 0) => {
673
+ Ot(() => {
674
+ setTimeout(() => {
675
+ var n;
676
+ window.nextLoading = !1;
677
+ const e = document.querySelector(".loading-next");
678
+ (n = e == null ? void 0 : e.parentNode) == null || n.removeChild(e);
679
+ }, t);
680
+ });
681
+ }
682
+ }, ua = [
683
+ { label: "F1", value: "F1" },
684
+ { label: "F2", value: "F2" },
685
+ { label: "F3", value: "F3" },
686
+ { label: "F4", value: "F4" },
687
+ { label: "F5", value: "F5" },
688
+ { label: "F6", value: "F6" },
689
+ { label: "F7", value: "F7" },
690
+ { label: "F8", value: "F8" },
691
+ { label: "F9", value: "F9" },
692
+ { label: "F10", value: "F10" },
693
+ { label: "F11", value: "F11" },
694
+ { label: "F12", value: "F12" },
695
+ { label: "Q", value: "KeyQ" },
696
+ { label: "W", value: "KeyW" },
697
+ { label: "E", value: "KeyE" },
698
+ { label: "R", value: "KeyR" },
699
+ { label: "T", value: "KeyT" },
700
+ { label: "Y", value: "KeyY" },
701
+ { label: "U", value: "KeyU" },
702
+ { label: "I", value: "KeyI" },
703
+ { label: "O", value: "KeyO" },
704
+ { label: "P", value: "KeyP" },
705
+ { label: "A", value: "KeyA" },
706
+ { label: "S", value: "KeyS" },
707
+ { label: "D", value: "KeyD" },
708
+ { label: "F", value: "KeyF" },
709
+ { label: "G", value: "KeyG" },
710
+ { label: "H", value: "KeyH" },
711
+ { label: "J", value: "KeyJ" },
712
+ { label: "K", value: "KeyK" },
713
+ { label: "L", value: "KeyL" },
714
+ { label: "Z", value: "KeyZ" },
715
+ { label: "X", value: "KeyX" },
716
+ { label: "C", value: "KeyC" },
717
+ { label: "V", value: "KeyV" },
718
+ { label: "B", value: "KeyB" },
719
+ { label: "N", value: "KeyN" },
720
+ { label: "M", value: "KeyM" },
721
+ { label: "Tab", value: "Tab" },
722
+ { label: "Backspace", value: "Backspace" },
723
+ { label: "Enter", value: "Enter" },
724
+ { label: "NumpadEnter", value: "NumpadEnter" },
725
+ { label: "Delete", value: "Delete" },
726
+ { label: "左侧Shift", value: "ShiftLeft" },
727
+ { label: "左侧Alt", value: "AltLeft" },
728
+ { label: "左侧Ctrl", value: "ControlLeft" },
729
+ { label: "左侧Win", value: "MetaLeft" },
730
+ { label: "空格键", value: "Space" },
731
+ { label: "右侧Alt", value: "AltRight" },
732
+ { label: "右侧Win", value: "MetaRight" },
733
+ { label: "右侧Ctrl", value: "ControlRight" },
734
+ { label: "大键盘数字1", value: "Digit1" },
735
+ { label: "大键盘数字2", value: "Digit2" },
736
+ { label: "大键盘数字3", value: "Digit3" },
737
+ { label: "大键盘数字4", value: "Digit4" },
738
+ { label: "大键盘数字5", value: "Digit5" },
739
+ { label: "大键盘数字6", value: "Digit6" },
740
+ { label: "大键盘数字7", value: "Digit7" },
741
+ { label: "大键盘数字8", value: "Digit8" },
742
+ { label: "大键盘数字9", value: "Digit9" },
743
+ { label: "大键盘数字0", value: "Digit0" },
744
+ { label: "小键盘数字1", value: "Numpad1" },
745
+ { label: "小键盘数字2", value: "Numpad2" },
746
+ { label: "小键盘数字3", value: "Numpad3" },
747
+ { label: "小键盘数字4", value: "Numpad4" },
748
+ { label: "小键盘数字5", value: "Numpad5" },
749
+ { label: "小键盘数字6", value: "Numpad6" },
750
+ { label: "小键盘数字7", value: "Numpad7" },
751
+ { label: "小键盘数字8", value: "Numpad8" },
752
+ { label: "小键盘数字9", value: "Numpad9" },
753
+ { label: "小键盘数字0", value: "Numpad0" }
754
+ ];
755
+ function E() {
756
+ return {
757
+ hexToRgb: (l) => {
758
+ let o = "";
759
+ if (!/^\#?[0-9A-Fa-f]{6}$/.test(l))
760
+ return v.warning("输入错误的hex"), "";
761
+ l = l.replace("#", ""), o = l.match(/../g);
762
+ for (let s = 0; s < 3; s++)
763
+ o[s] = parseInt(o[s], 16);
764
+ return o;
765
+ },
766
+ rgbToHex: (l, o, r) => {
767
+ let s = /^\d{1,3}$/;
768
+ if (!s.test(String(l)) || !s.test(String(o)) || !s.test(String(r)))
769
+ return v.warning("输入错误的rgb颜色值"), "";
770
+ let u = [l.toString(16), o.toString(16), r.toString(16)];
771
+ for (let c = 0; c < 3; c++)
772
+ u[c].length == 1 && (u[c] = `0${u[c]}`);
773
+ return `#${u.join("")}`;
774
+ },
775
+ getDarkColor: (l, o) => {
776
+ if (!/^\#?[0-9A-Fa-f]{6}$/.test(l))
777
+ return v.warning("输入错误的hex颜色值"), "";
778
+ let s = E().hexToRgb(l);
779
+ for (let u = 0; u < 3; u++)
780
+ s[u] = Math.floor(s[u] * (1 - o));
781
+ return E().rgbToHex(s[0], s[1], s[2]);
782
+ },
783
+ getLightColor: (l, o) => {
784
+ if (!/^\#?[0-9A-Fa-f]{6}$/.test(l))
785
+ return v.warning("输入错误的hex颜色值"), "";
786
+ let s = E().hexToRgb(l);
787
+ for (let u = 0; u < 3; u++)
788
+ s[u] = Math.floor((255 - s[u]) * o + s[u]);
789
+ return E().rgbToHex(s[0], s[1], s[2]);
790
+ }
791
+ };
792
+ }
793
+ function ca(t, e = !0) {
794
+ const n = [];
795
+ function a(l, o = []) {
796
+ return l.reduce((r, s) => (r.push(s), s != null && s.children && s.children.length && r.push(...a(s.children)), r), o);
797
+ }
798
+ return a(e ? y.cloneDeep(t) : t, n), n;
799
+ }
800
+ function da(t) {
801
+ return t.reduce((e, n) => {
802
+ e[D] || (e[D] = []);
803
+ const a = e[D].concat(n[D] || []);
804
+ return Object.assign({}, e, n, {
805
+ [D]: [...new Set(a)]
806
+ });
807
+ }, {});
808
+ }
809
+ function fa(t, e = !1) {
810
+ const n = {}, a = (l) => Object.values(l).reduce((o, r) => (delete r[D], o = Object.assign(o, r), o), {});
811
+ return t.forEach((l) => {
812
+ const o = l.getData();
813
+ Object.assign(n, a(o));
814
+ }), e ? y.cloneDeep(n) : y.cloneDeep({
815
+ ...n,
816
+ [D]: Object.keys(n)
817
+ });
818
+ }
819
+ function ga(t) {
820
+ if (Array.isArray(t)) {
821
+ if (t.length === 0 || t.every((e) => typeof e == "string" || typeof e == "number"))
822
+ return String(t);
823
+ if (t.every((e) => typeof e == "object" && e !== null))
824
+ return JSON.stringify(t);
825
+ }
826
+ return typeof t == "object" && t !== null ? JSON.stringify(t) : t;
827
+ }
828
+ const ma = (t, e, n) => {
829
+ if (!e)
830
+ return t;
831
+ const a = e.toLowerCase();
832
+ return t.filter((l) => n(l).some((r) => r && r.toLowerCase().includes(a)));
833
+ };
834
+ let G;
835
+ const pa = 60 * 1e3;
836
+ let $ = !1, j = !1, B;
837
+ const ya = /<script.*?src=["'](.*?)["'].*?><\/script>/g, k = /index-(.*?)\.js/g, V = async () => fetch("/index.html?timestep=" + Date.now()).then((t) => t.text()).then((t) => {
838
+ var n, a;
839
+ const e = (n = t.match(ya)) == null ? void 0 : n.filter((l) => k.test(l));
840
+ return e && e.length > 0 ? y.get(((a = e[0]) == null ? void 0 : a.match(k)) || [], "0", "") : "";
841
+ }), ee = () => V().then((t) => {
842
+ t && t != G && !$ && ($ = !0, te(), se.confirm("系统版本更新了,是否立即刷新页面?", "提示", {
843
+ confirmButtonText: "立即刷新",
844
+ cancelButtonText: "稍后刷新",
845
+ type: "warning",
846
+ closeOnClickModal: !1
847
+ }).then(() => {
848
+ location.reload();
849
+ }));
850
+ }), I = async () => {
851
+ B = window.setTimeout(async () => {
852
+ j || ee(), I();
853
+ }, pa);
854
+ };
855
+ function te() {
856
+ B && (clearTimeout(B), B = 0);
857
+ }
858
+ async function ba() {
859
+ return V().then((t) => {
860
+ G = t, I(), document.addEventListener("visibilitychange", () => {
861
+ j = document.hidden, j ? te() : (ee(), I());
862
+ });
863
+ });
864
+ }
865
+ const U = (t) => {
866
+ const e = "1.23452384164.123412416";
867
+ document.getElementById(e) !== null && document.body.removeChild(document.getElementById(e));
868
+ const n = document.createElement("canvas");
869
+ n.width = 200, n.height = 130;
870
+ const a = n.getContext("2d");
871
+ a.rotate(-20 * Math.PI / 180), a.font = "12px Vedana", a.fillStyle = "rgba(200, 200, 200, 0.30)", a.textBaseline = "middle", a.fillText(t, n.width / 10, n.height / 2);
872
+ const l = document.createElement("div");
873
+ return l.id = e, l.style.pointerEvents = "none", l.style.top = "0px", l.style.left = "0px", l.style.position = "fixed", l.style.zIndex = "10000000", l.style.width = `${document.documentElement.clientWidth}px`, l.style.height = `${document.documentElement.clientHeight}px`, l.style.background = `url(${n.toDataURL("image/png")}) left top repeat`, document.body.appendChild(l), e;
874
+ }, ha = {
875
+ // 设置水印
876
+ set: (t) => {
877
+ let e = U(t);
878
+ document.getElementById(e) === null && (e = U(t));
879
+ },
880
+ // 删除水印
881
+ del: () => {
882
+ let t = "1.23452384164.123412416";
883
+ document.getElementById(t) !== null && document.body.removeChild(document.getElementById(t));
884
+ }
885
+ }, xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
886
+ __proto__: null,
887
+ CurrentRoute: ie,
888
+ CurrentRouter: ue,
889
+ CustomeStore: ce,
890
+ Download: oa,
891
+ HsMessage: de,
892
+ HsMessageBox: fe,
893
+ HsNotification: ge,
894
+ IS_DEV: me,
895
+ IsIdNumber: ea,
896
+ Local: pe,
897
+ NEXT_NAME: ye,
898
+ NextLoading: ia,
899
+ Session: be,
900
+ add: he,
901
+ addUrlParams: ve,
902
+ axiosInterceptors: _e,
903
+ cfprint: O,
904
+ checkPlugin: J,
905
+ clearAllIndexDB: xe,
906
+ convertCurrency: K,
907
+ copyText: Ht,
908
+ dataURLtoBlob: sa,
909
+ dateFormatHMS: Xt,
910
+ dateFormatYMD: Zt,
911
+ dateFormatYMDHMS: Qt,
912
+ decimalDigits: we,
913
+ decrypt: aa,
914
+ deepClone: De,
915
+ div: Ce,
916
+ downloadFile: Y,
917
+ elSvg: Ee,
918
+ encrypt: ta,
919
+ encryptionTool: Se,
920
+ exportAllData: ra,
921
+ exportSelectedData: la,
922
+ exportSelectedDownloadFile: na,
923
+ fixedNumAccuracy: P,
924
+ formatAxis: Jt,
925
+ formatDate: A,
926
+ formatPast: qt,
927
+ fuzzySearch: ma,
928
+ getAuthFieldsByMid: Ae,
929
+ getColumnWidthConfig: Te,
930
+ getConfig: Ne,
931
+ getDataDictListByMid: Be,
932
+ getDataType: Fe,
933
+ getDictListByMid: Pe,
934
+ getFormDataType: Me,
935
+ getFormInstanceData: fa,
936
+ getMergeData: da,
937
+ getNumbers: je,
938
+ getStoreSystemParams: Ie,
939
+ getSystemParams: Le,
940
+ getTableDataType: Re,
941
+ getUrlBase64: kt,
942
+ getUrlParams: Oe,
943
+ getWeek: X,
944
+ globalComponentSize: Ye,
945
+ handleEmpty: $e,
946
+ handleOpenLink: ke,
947
+ iframeMessage: Ue,
948
+ isLegalNumber: Ke,
949
+ isMobile: He,
950
+ isObjectValueEqual: H,
951
+ isToNumber: We,
952
+ isUpdate: ba,
953
+ judementSameArr: Yt,
954
+ lazyImg: qe,
955
+ lodash: y,
956
+ mathTool: Je,
957
+ message: ze,
958
+ messageBox: Ze,
959
+ mittBus: Qe,
960
+ notification: Xe,
961
+ numberToChinese: Ge,
962
+ other: Ve,
963
+ percentFormat: zt,
964
+ popupPlugin: et,
965
+ print: Ut,
966
+ processData: Q,
967
+ push: tt,
968
+ removeConfig: at,
969
+ removeDuplicate: M,
970
+ request: S,
971
+ scale2Format: Vt,
972
+ scaleFormat: Gt,
973
+ sendMsg: z,
974
+ setColumnWidthConfig: nt,
975
+ setConfig: lt,
976
+ setLocalSystemParams: rt,
977
+ setTagsViewNameI18n: ot,
978
+ shortcutList: ua,
979
+ showPopup: st,
980
+ sub: it,
981
+ systemStore: L,
982
+ times: ut,
983
+ transferString: ga,
984
+ treeToList: ca,
985
+ trimPrintData: Z,
986
+ useChangeColor: E,
987
+ useMittBus: ct,
988
+ useRequest: dt,
989
+ useTitle: ft,
990
+ useToggleFullPage: Wt,
991
+ verifiyNumberInteger: gt,
992
+ verifyAccount: mt,
993
+ verifyAndSpace: pt,
994
+ verifyCarNum: yt,
995
+ verifyCnAndSpace: bt,
996
+ verifyEmail: ht,
997
+ verifyEnAndSpace: vt,
998
+ verifyFullName: _t,
999
+ verifyIPAddress: xt,
1000
+ verifyIdCard: wt,
1001
+ verifyNumberCnUppercase: Dt,
1002
+ verifyNumberComma: Ct,
1003
+ verifyNumberIntegerAndFloat: Et,
1004
+ verifyNumberPercentage: St,
1005
+ verifyNumberPercentageFloat: At,
1006
+ verifyPassword: Tt,
1007
+ verifyPasswordPowerful: Nt,
1008
+ verifyPasswordStrength: Bt,
1009
+ verifyPhone: Ft,
1010
+ verifyPostalCode: Pt,
1011
+ verifyTelPhone: Mt,
1012
+ verifyTextColor: jt,
1013
+ verifyUrl: It,
1014
+ watermark: ha
1015
+ }, Symbol.toStringTag, { value: "Module" }));
1016
+ export {
1017
+ oa as D,
1018
+ la as a,
1019
+ ra as b,
1020
+ Ht as c,
1021
+ sa as d,
1022
+ na as e,
1023
+ fa as g,
1024
+ xa as i,
1025
+ Q as p
1026
+ };