yahee-components 0.0.85 → 0.0.86

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,10 +1,10 @@
1
- import { defineComponent as Ge, mergeDefaults as Le, toRefs as Pe, ref as c, watch as We, reactive as ze, onMounted as qe, onUnmounted as Ae, createElementBlock as y, openBlock as d, Fragment as ae, createVNode as n, unref as l, isRef as Ve, withCtx as r, withDirectives as re, createElementVNode as T, createCommentVNode as h, renderSlot as se, createTextVNode as g, toDisplayString as i, renderList as Je, createBlock as w } from "vue";
1
+ import { defineComponent as Ge, mergeDefaults as Le, toRefs as Pe, ref as p, watch as We, reactive as ze, onMounted as qe, onUnmounted as Ae, createElementBlock as y, openBlock as c, Fragment as ae, createVNode as s, unref as l, isRef as Ve, withCtx as r, withDirectives as re, createElementVNode as T, createCommentVNode as h, renderSlot as ne, createTextVNode as g, toDisplayString as i, renderList as Je, createBlock as w } from "vue";
2
2
  import { M2 as u, translateEmployeeName as je } from "../utils/translate.js";
3
3
  import { get as He } from "../packages/components/api/log-server.js";
4
4
  import { getDomainBaseUrl as Xe } from "../utils/get-domain-base-url.js";
5
5
  import { getUploadRecord as Ye } from "../packages/components/api/common-import/index.js";
6
6
  import { defaultCommonImportProps as Ze } from "./props.js";
7
- import { ElDialog as ne, ElRow as I, ElUpload as Qe, ElButton as W, ElCol as b, ElLink as z, ElProgress as Ke, ElCard as et, vLoading as ie, ElTable as tt, ElTableColumn as R, ElPagination as ot, ElMessage as S, ElMessageBox as ue } from "element-plus";
7
+ import { ElDialog as se, ElRow as I, ElUpload as Qe, ElButton as W, ElCol as b, ElLink as z, ElProgress as Ke, ElCard as et, vLoading as ie, ElTable as tt, ElTableColumn as R, ElPagination as ot, ElMessage as S, ElMessageBox as ue } from "element-plus";
8
8
  import "element-plus/theme-chalk/src/base.scss";
9
9
  import "element-plus/theme-chalk/src/dialog.scss";
10
10
  import "element-plus/theme-chalk/src/overlay.scss";
@@ -30,7 +30,7 @@ import "element-plus/theme-chalk/src/input.scss";
30
30
  import "element-plus/theme-chalk/src/badge.scss";
31
31
  import "element-plus/theme-chalk/src/message.scss";
32
32
  import "element-plus/theme-chalk/src/message-box.scss";
33
- const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key: 1 }, nt = { style: { color: "red" } }, it = { class: "form-slot" }, ut = {
33
+ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, nt = { key: 1 }, st = { style: { color: "red" } }, it = { class: "form-slot" }, ut = {
34
34
  key: 0,
35
35
  class: "card-header"
36
36
  }, dt = ["innerHTML"], ct = {
@@ -75,7 +75,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
75
75
  requestData: X,
76
76
  processFiles: fe,
77
77
  filePath: ve
78
- } = Pe(pe), M = c(!1), he = c(!1), N = c(!1), Y = c([]), p = c({}), Z = c(1), Q = c(1), A = c(50), _ = c({}), $ = c({}), K = c({}), C = {}, k = c({}), x = c({}), U = c({}), V = c(""), B = c(!1), O = c({
78
+ } = Pe(pe), M = p(!1), he = p(!1), N = p(!1), Y = p([]), m = p({}), Z = p(1), Q = p(1), A = p(50), _ = p({}), $ = p({}), K = p({}), C = {}, k = p({}), x = p({}), U = p({}), V = p(""), B = p(!1), O = p({
79
79
  siteId: null,
80
80
  reportTime: null,
81
81
  fileName: ""
@@ -88,7 +88,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
88
88
  }, be = (e) => {
89
89
  var t, o, a;
90
90
  return Number(
91
- ((((t = p.value[e]) == null ? void 0 : t.successRowCount) + ((o = p.value[e]) == null ? void 0 : o.failedRowCount)) / ((a = p.value[e]) == null ? void 0 : a.totalRowCount) * 100).toFixed(0)
91
+ ((((t = m.value[e]) == null ? void 0 : t.successRowCount) + ((o = m.value[e]) == null ? void 0 : o.failedRowCount)) / ((a = m.value[e]) == null ? void 0 : a.totalRowCount) * 100).toFixed(0)
92
92
  );
93
93
  }, Ce = (e) => {
94
94
  const t = e == null ? void 0 : e.CreateOn;
@@ -97,10 +97,10 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
97
97
  if (!o) return "---";
98
98
  const a = Number(o[1]);
99
99
  if (Number.isNaN(a)) return "---";
100
- const s = new Date(a);
101
- if (Number.isNaN(s.getTime())) return "---";
102
- const v = s.getFullYear(), m = String(s.getMonth() + 1).padStart(2, "0"), L = String(s.getDate()).padStart(2, "0"), f = String(s.getHours()).padStart(2, "0"), P = String(s.getMinutes()).padStart(2, "0"), Oe = String(s.getSeconds()).padStart(2, "0");
103
- return `${v}-${m}-${L} ${f}:${P}:${Oe}`;
100
+ const n = new Date(a);
101
+ if (Number.isNaN(n.getTime())) return "---";
102
+ const v = n.getFullYear(), d = String(n.getMonth() + 1).padStart(2, "0"), L = String(n.getDate()).padStart(2, "0"), f = String(n.getHours()).padStart(2, "0"), P = String(n.getMinutes()).padStart(2, "0"), Oe = String(n.getSeconds()).padStart(2, "0");
103
+ return `${v}-${d}-${L} ${f}:${P}:${Oe}`;
104
104
  }, ke = () => {
105
105
  if (!k.value) return;
106
106
  let e = "";
@@ -172,7 +172,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
172
172
  } catch (t) {
173
173
  N.value = !1, console.error("GetWebRoot 失败", t);
174
174
  }
175
- }, D = c(/* @__PURE__ */ new Set()), E = ze({}), Te = (e) => {
175
+ }, D = p(/* @__PURE__ */ new Set()), E = ze({}), Te = (e) => {
176
176
  B.value = !0;
177
177
  const { file: t } = e, o = 100 * 1024 * 1024;
178
178
  if (t.size > o) {
@@ -184,19 +184,19 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
184
184
  });
185
185
  }, $e = (e) => new Promise((t, o) => {
186
186
  const a = new FileReader();
187
- a.onload = () => t(a.result), a.onerror = (s) => o(s), a.readAsDataURL(e);
187
+ a.onload = () => t(a.result), a.onerror = (n) => o(n), a.readAsDataURL(e);
188
188
  }), xe = (e, t) => {
189
- we(), D.value.has(e.name) ? (delete E[e.name], delete p.value[e.name], delete _.value[e.name], delete $.value[e.name], delete C[e.name], delete x.value[e.name]) : D.value.add(e.name);
189
+ we(), D.value.has(e.name) ? (delete E[e.name], delete m.value[e.name], delete _.value[e.name], delete $.value[e.name], delete C[e.name], delete x.value[e.name]) : D.value.add(e.name);
190
190
  const o = new FormData();
191
191
  o.append("FileType", "115"), o.append("FileName", e.name), o.append("Base64Content", t), o.append("CreatedBy", "0"), o.append("Offset", "0"), o.append("IsOver", "true");
192
192
  const a = new XMLHttpRequest();
193
- a.open("POST", `${le("fragmentupload?t=")}${Math.random()}`, !0), a.upload.onprogress = (s) => {
194
- s.lengthComputable && (E[e.name] = Math.round(s.loaded / s.total * 100));
193
+ a.open("POST", `${le("fragmentupload?t=")}${Math.random()}`, !0), a.upload.onprogress = (n) => {
194
+ n.lengthComputable && (E[e.name] = Math.round(n.loaded / n.total * 100));
195
195
  }, a.onload = () => {
196
196
  if (a.status === 200)
197
197
  try {
198
- const s = JSON.parse(a.responseText);
199
- if (console.log("服务器返回值:", s), s.ACK !== "Success" || !s.FileId) {
198
+ const n = JSON.parse(a.responseText);
199
+ if (console.log("服务器返回值:", n), n.ACK !== "Success" || !n.FileId) {
200
200
  S.error(`${e.name} 上传失败`);
201
201
  return;
202
202
  }
@@ -208,14 +208,14 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
208
208
  // ES6可选链避免报错
209
209
  }, _.value[e.name] || (_.value[e.name] = Me(20)), Fe({
210
210
  importId: F.value,
211
- fileId: s.FileId,
211
+ fileId: n.FileId,
212
212
  wsSessionId: _.value[e.name],
213
213
  file: e,
214
214
  requestData: O.value
215
215
  });
216
216
  }, 500);
217
- } catch (s) {
218
- console.error("解析服务器返回值失败:", s), S.error(`${e.name} 上传完成,但解析返回值失败`);
217
+ } catch (n) {
218
+ console.error("解析服务器返回值失败:", n), S.error(`${e.name} 上传完成,但解析返回值失败`);
219
219
  }
220
220
  else
221
221
  S.error(`${e.name} 上传失败`);
@@ -224,13 +224,14 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
224
224
  }, a.send(o);
225
225
  }, Fe = (e) => {
226
226
  fe.value(H.value, e, {}).then((t) => {
227
- var s;
227
+ var n;
228
228
  if (B.value = !1, console.log("processFiles 返回值:", t), t != null && t.success) {
229
- ue.alert("文件导入成功", "操作成功", {
229
+ let v = "文件导入成功";
230
+ t != null && t.fileId && (v = "存在失败的条目,详情请查看输出文件"), ue.alert(v, "操作成功", {
230
231
  confirmButtonText: "确定",
231
232
  callback: () => {
232
- var v;
233
- t != null && t.fileId && ($.value[(v = e == null ? void 0 : e.file) == null ? void 0 : v.name] = t.fileId, K.value = t.data, me.value && ye());
233
+ var d;
234
+ t != null && t.fileId && ($.value[(d = e == null ? void 0 : e.file) == null ? void 0 : d.name] = t.fileId, K.value = t.data, me.value && ye());
234
235
  }
235
236
  });
236
237
  return;
@@ -243,7 +244,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
243
244
  confirmButtonText: "知道了",
244
245
  customClass: "custom-common-import-alert",
245
246
  dangerouslyUseHTMLString: !0
246
- }), t != null && t.fileId && ($.value[(s = e == null ? void 0 : e.file) == null ? void 0 : s.name] = t.fileId);
247
+ }), t != null && t.fileId && ($.value[(n = e == null ? void 0 : e.file) == null ? void 0 : n.name] = t.fileId);
247
248
  }).catch((t) => {
248
249
  var a;
249
250
  console.error("processFiles 失败", t);
@@ -262,23 +263,23 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
262
263
  return o.indexOf("localhost") >= 0 || o.indexOf("yahee.com") >= 0 ? t = "ws://qas-newerp.yahee.com.cn:8306" : t = "wss://websocket.yaheecloud.com:10001", t + e;
263
264
  }, Ue = async () => await He(j("/Common/GetWsAuthCode")), Be = (e) => {
264
265
  C[e] = new WebSocket(Ne("/excel-import/")), C[e].onmessage = (t) => {
265
- var a, s;
266
+ var a, n;
266
267
  if (t.data == "get-auth") {
267
268
  Ue().then((v) => {
268
- var m;
269
- console.log("发送authCode:", v), (m = C[e]) == null || m.send(`auth:${v}`);
269
+ var d;
270
+ console.log("发送authCode:", v), (d = C[e]) == null || d.send(`auth:${v}`);
270
271
  });
271
272
  return;
272
273
  }
273
274
  const o = JSON.parse(t.data);
274
275
  if (console.log("接收普通消息", o), !!o)
275
276
  if (o.MessageType === 0) {
276
- const v = o.MessageIndex || 0, m = JSON.parse(o == null ? void 0 : o.Content);
277
- if ((m == null ? void 0 : m.error) == !0) {
278
- x.value[e] = m.message;
277
+ const v = o.MessageIndex || 0, d = JSON.parse(o == null ? void 0 : o.Content);
278
+ if ((d == null ? void 0 : d.error) == !0) {
279
+ x.value[e] = d.message;
279
280
  return;
280
281
  }
281
- (!p.value[e] || v > ((a = p.value[e]) == null ? void 0 : a.MessageIndex)) && (p.value[e] = m, p.value[e].MessageIndex = v, m != null && m.finished && ((s = C[e]) == null || s.close()));
282
+ (!m.value[e] || v > ((a = m.value[e]) == null ? void 0 : a.MessageIndex)) && (m.value[e] = d, m.value[e].MessageIndex = v, d != null && d.finished && ((n = C[e]) == null || n.close()));
282
283
  } else o.MessageType === 1 ? _.value[e] = o.Content : console.log("进度:", o);
283
284
  }, C[e].onerror = (t) => {
284
285
  console.error("WebSocket 错误:", t), t instanceof ErrorEvent ? console.error("Error message:", t.message) : console.error("Unknown WebSocket error:", t);
@@ -305,8 +306,8 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
305
306
  var t;
306
307
  (t = C[e]) == null || t.close();
307
308
  });
308
- }), (e, t) => (d(), y(ae, null, [
309
- n(l(ne), {
309
+ }), (e, t) => (c(), y(ae, null, [
310
+ s(l(se), {
310
311
  modelValue: l(q),
311
312
  "onUpdate:modelValue": t[1] || (t[1] = (o) => Ve(q) ? q.value = o : null),
312
313
  title: l(u)(l(ge)),
@@ -318,13 +319,13 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
318
319
  default: r(() => {
319
320
  var o;
320
321
  return [
321
- re((d(), y("div", null, [
322
+ re((c(), y("div", null, [
322
323
  T("div", lt, [
323
- se(e.$slots, "form")
324
+ ne(e.$slots, "form")
324
325
  ]),
325
- n(l(I), null, {
326
+ s(l(I), null, {
326
327
  default: r(() => [
327
- n(l(Qe), {
328
+ s(l(Qe), {
328
329
  class: "upload-record",
329
330
  "http-request": Te,
330
331
  accept: ".xls,.xlsx,.txt,.csv",
@@ -335,7 +336,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
335
336
  disabled: e.uploadDisabled || B.value
336
337
  }, {
337
338
  default: r(() => [
338
- n(l(W), {
339
+ s(l(W), {
339
340
  style: { "background-color": "rgba(0, 183, 238, 1)", "font-weight": "bold" },
340
341
  size: "large",
341
342
  type: "primary",
@@ -353,22 +354,22 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
353
354
  ]),
354
355
  _: 1
355
356
  }),
356
- (o = D.value) != null && o.size ? (d(), y("div", at, [
357
- (d(!0), y(ae, null, Je(D.value, (a) => {
358
- var s, v;
359
- return d(), y("div", {
357
+ (o = D.value) != null && o.size ? (c(), y("div", at, [
358
+ (c(!0), y(ae, null, Je(D.value, (a) => {
359
+ var n, v;
360
+ return c(), y("div", {
360
361
  key: a,
361
362
  class: "uploadProgress"
362
363
  }, [
363
- n(l(I), { style: { "margin-bottom": "5px" } }, {
364
+ s(l(I), { style: { "margin-bottom": "5px" } }, {
364
365
  default: r(() => [
365
- n(l(b), { span: 18 }, {
366
+ s(l(b), { span: 18 }, {
366
367
  default: r(() => [
367
- n(l(z), {
368
+ s(l(z), {
368
369
  type: "primary",
369
370
  underline: !1,
370
371
  style: { font: "inherit" },
371
- onClick: t[0] || (t[0] = (m) => G(k.value.Template))
372
+ onClick: t[0] || (t[0] = (d) => G(k.value.Template))
372
373
  }, {
373
374
  default: r(() => [
374
375
  g(i(a), 1)
@@ -378,19 +379,19 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
378
379
  ]),
379
380
  _: 2
380
381
  }, 1024),
381
- E[a] ? (d(), w(l(b), {
382
+ E[a] ? (c(), w(l(b), {
382
383
  key: 0,
383
384
  span: 6
384
385
  }, {
385
386
  default: r(() => [
386
- E[a] == 100 ? (d(), y("span", rt, i(l(u)("文件上传完成")), 1)) : (d(), y("span", st, i(l(u)("文件正在上传,进度") + `${E[a]}% ...`), 1))
387
+ E[a] == 100 ? (c(), y("span", rt, i(l(u)("文件上传完成")), 1)) : (c(), y("span", nt, i(l(u)("文件正在上传,进度") + `${E[a]}% ...`), 1))
387
388
  ]),
388
389
  _: 2
389
390
  }, 1024)) : h("", !0)
390
391
  ]),
391
392
  _: 2
392
393
  }, 1024),
393
- _.value[a] ? (d(), w(l(I), {
394
+ _.value[a] ? (c(), w(l(I), {
394
395
  key: 0,
395
396
  style: { "margin-bottom": "5px" }
396
397
  }, {
@@ -399,50 +400,50 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
399
400
  ]),
400
401
  _: 2
401
402
  }, 1024)) : h("", !0),
402
- x.value[a] ? (d(), w(l(I), {
403
+ x.value[a] ? (c(), w(l(I), {
403
404
  key: 1,
404
405
  style: { "margin-bottom": "5px" }
405
406
  }, {
406
407
  default: r(() => [
407
- T("span", nt, i(l(u)(x.value[a])), 1)
408
+ T("span", st, i(l(u)(x.value[a])), 1)
408
409
  ]),
409
410
  _: 2
410
411
  }, 1024)) : h("", !0),
411
- (s = p.value[a]) != null && s.totalRowCount ? (d(), w(l(I), {
412
+ (n = m.value[a]) != null && n.totalRowCount ? (c(), w(l(I), {
412
413
  key: 2,
413
414
  style: { "margin-bottom": "5px" }
414
415
  }, {
415
416
  default: r(() => {
416
- var m, L;
417
+ var d, L;
417
418
  return [
418
- n(l(b), { span: 6 }, {
419
+ s(l(b), { span: 6 }, {
419
420
  default: r(() => {
420
421
  var f, P;
421
422
  return [
422
- g(i(l(u)("工作簿")) + ":" + i((f = p.value[a]) == null ? void 0 : f.currentSheet) + "/" + i((P = p.value[a]) == null ? void 0 : P.sheetCount), 1)
423
+ g(i(l(u)("工作簿")) + ":" + i((f = m.value[a]) == null ? void 0 : f.currentSheet) + "/" + i((P = m.value[a]) == null ? void 0 : P.sheetCount), 1)
423
424
  ];
424
425
  }),
425
426
  _: 2
426
427
  }, 1024),
427
- n(l(b), { span: 6 }, {
428
+ s(l(b), { span: 6 }, {
428
429
  default: r(() => {
429
430
  var f;
430
431
  return [
431
- g(i(l(u)("总行数")) + ":" + i((f = p.value[a]) == null ? void 0 : f.totalRowCount), 1)
432
+ g(i(l(u)("总行数")) + ":" + i((f = m.value[a]) == null ? void 0 : f.totalRowCount), 1)
432
433
  ];
433
434
  }),
434
435
  _: 2
435
436
  }, 1024),
436
- n(l(b), { span: 6 }, {
437
+ s(l(b), { span: 6 }, {
437
438
  default: r(() => {
438
439
  var f;
439
440
  return [
440
- g(i(l(u)("成功行数")) + ":" + i((f = p.value[a]) == null ? void 0 : f.successRowCount), 1)
441
+ g(i(l(u)("成功行数")) + ":" + i((f = m.value[a]) == null ? void 0 : f.successRowCount), 1)
441
442
  ];
442
443
  }),
443
444
  _: 2
444
445
  }, 1024),
445
- (m = p.value[a]) != null && m.failedRowCount ? h("", !0) : (d(), w(l(b), {
446
+ (d = m.value[a]) != null && d.failedRowCount ? h("", !0) : (c(), w(l(b), {
446
447
  key: 0,
447
448
  span: 6
448
449
  }, {
@@ -451,14 +452,14 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
451
452
  ]),
452
453
  _: 1
453
454
  })),
454
- (L = p.value[a]) != null && L.failedRowCount ? (d(), w(l(b), {
455
+ (L = m.value[a]) != null && L.failedRowCount ? (c(), w(l(b), {
455
456
  key: 1,
456
457
  span: 6,
457
458
  style: { display: "flex" }
458
459
  }, {
459
460
  default: r(() => [
460
461
  g(i(l(u)("失败行数")) + ": ", 1),
461
- n(l(z), {
462
+ s(l(z), {
462
463
  type: "primary",
463
464
  underline: !1,
464
465
  title: $.value[a],
@@ -467,7 +468,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
467
468
  default: r(() => {
468
469
  var f;
469
470
  return [
470
- g(i((f = p.value[a]) == null ? void 0 : f.failedRowCount), 1)
471
+ g(i((f = m.value[a]) == null ? void 0 : f.failedRowCount), 1)
471
472
  ];
472
473
  }),
473
474
  _: 2
@@ -480,34 +481,34 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
480
481
  _: 2
481
482
  }, 1024)) : h("", !0),
482
483
  t[3] || (t[3] = T("br", null, null, -1)),
483
- (v = p.value[a]) != null && v.totalRowCount ? (d(), w(l(Ke), {
484
+ (v = m.value[a]) != null && v.totalRowCount ? (c(), w(l(Ke), {
484
485
  key: 3,
485
486
  percentage: be(a)
486
487
  }, null, 8, ["percentage"])) : h("", !0),
487
488
  T("div", it, [
488
- se(e.$slots, "resultMessage")
489
+ ne(e.$slots, "resultMessage")
489
490
  ])
490
491
  ]);
491
492
  }), 128))
492
493
  ])) : h("", !0),
493
- n(l(I), { style: { "margin-top": "10px" } }, {
494
+ s(l(I), { style: { "margin-top": "10px" } }, {
494
495
  default: r(() => [
495
- n(l(et), { style: { width: "860px" } }, {
496
+ s(l(et), { style: { width: "860px" } }, {
496
497
  header: r(() => [
497
- e.displayGetTemplate ? (d(), y("div", ut, [
498
+ e.displayGetTemplate ? (c(), y("div", ut, [
498
499
  T("span", null, i(l(u)("说明")), 1)
499
500
  ])) : h("", !0)
500
501
  ]),
501
502
  footer: r(() => [
502
- n(l(I), null, {
503
+ s(l(I), null, {
503
504
  default: r(() => [
504
- n(l(b), { span: 10 }),
505
- n(l(b), {
505
+ s(l(b), { span: 10 }),
506
+ s(l(b), {
506
507
  span: 14,
507
508
  style: { display: "flex", "justify-content": "flex-end" }
508
509
  }, {
509
510
  default: r(() => [
510
- e.displayGetTemplate && k.value.TemplateType != 0 ? (d(), w(l(W), {
511
+ e.displayGetTemplate && k.value.TemplateType != 0 ? (c(), w(l(W), {
511
512
  key: 0,
512
513
  style: { "background-color": "rgba(89, 191, 87, 1)", color: "white", "font-weight": "bold" },
513
514
  size: "large",
@@ -518,7 +519,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
518
519
  ]),
519
520
  _: 1
520
521
  })) : h("", !0),
521
- n(l(W), {
522
+ s(l(W), {
522
523
  style: { "background-color": "rgba(89, 191, 87, 1)", color: "white", "font-weight": "bold" },
523
524
  size: "large",
524
525
  onClick: Se
@@ -528,7 +529,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
528
529
  ]),
529
530
  _: 1
530
531
  }),
531
- n(l(W), {
532
+ s(l(W), {
532
533
  style: { color: "#949592", "font-weight": "bold" },
533
534
  size: "large",
534
535
  onClick: ee
@@ -546,7 +547,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
546
547
  })
547
548
  ]),
548
549
  default: r(() => [
549
- e.displayGetTemplate ? (d(), y("div", {
550
+ e.displayGetTemplate ? (c(), y("div", {
550
551
  key: 0,
551
552
  innerHTML: k.value.Description
552
553
  }, null, 8, dt)) : h("", !0)
@@ -563,7 +564,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
563
564
  }),
564
565
  _: 3
565
566
  }, 8, ["modelValue", "title"]),
566
- n(l(ne), {
567
+ s(l(se), {
567
568
  modelValue: M.value,
568
569
  "onUpdate:modelValue": t[2] || (t[2] = (o) => M.value = o),
569
570
  title: l(u)("导入记录"),
@@ -573,7 +574,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
573
574
  }, {
574
575
  default: r(() => [
575
576
  T("div", null, [
576
- re((d(), w(l(tt), {
577
+ re((c(), w(l(tt), {
577
578
  border: "",
578
579
  "row-key": "id",
579
580
  data: Y.value,
@@ -582,13 +583,13 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
582
583
  "empty-text": l(u)("暂无数据")
583
584
  }, {
584
585
  default: r(() => [
585
- n(l(R), {
586
+ s(l(R), {
586
587
  align: "center",
587
588
  label: l(u)("记录ID"),
588
589
  "min-width": "220",
589
590
  prop: "TaskId"
590
591
  }, null, 8, ["label"]),
591
- n(l(R), {
592
+ s(l(R), {
592
593
  align: "center",
593
594
  label: l(u)("导入时间"),
594
595
  "min-width": "100"
@@ -598,7 +599,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
598
599
  ]),
599
600
  _: 1
600
601
  }, 8, ["label"]),
601
- n(l(R), {
602
+ s(l(R), {
602
603
  align: "center",
603
604
  label: l(u)("导入人")
604
605
  }, {
@@ -607,13 +608,13 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
607
608
  ]),
608
609
  _: 1
609
610
  }, 8, ["label"]),
610
- n(l(R), {
611
+ s(l(R), {
611
612
  align: "center",
612
613
  label: l(u)("上传文件"),
613
614
  "min-width": "160"
614
615
  }, {
615
616
  default: r((o) => [
616
- n(l(z), {
617
+ s(l(z), {
617
618
  type: "primary",
618
619
  underline: !1,
619
620
  style: { font: "inherit" },
@@ -627,13 +628,13 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
627
628
  ]),
628
629
  _: 1
629
630
  }, 8, ["label"]),
630
- n(l(R), {
631
+ s(l(R), {
631
632
  align: "center",
632
633
  label: l(u)("输出文件"),
633
634
  "min-width": "160"
634
635
  }, {
635
636
  default: r((o) => [
636
- n(l(z), {
637
+ s(l(z), {
637
638
  type: "primary",
638
639
  underline: !1,
639
640
  style: { font: "inherit" },
@@ -647,18 +648,18 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
647
648
  ]),
648
649
  _: 1
649
650
  }, 8, ["label"]),
650
- n(l(R), {
651
+ s(l(R), {
651
652
  align: "center",
652
653
  label: l(u)("错误信息"),
653
654
  prop: "ErrorMessage",
654
655
  width: "200"
655
656
  }, {
656
657
  default: r((o) => [
657
- o.row.ErrorMessage ? (d(), y("div", ct, i(o.row.ErrorMessage), 1)) : h("", !0)
658
+ o.row.ErrorMessage ? (c(), y("div", ct, i(o.row.ErrorMessage), 1)) : h("", !0)
658
659
  ]),
659
660
  _: 1
660
661
  }, 8, ["label"]),
661
- n(l(R), {
662
+ s(l(R), {
662
663
  align: "center",
663
664
  label: l(u)("备注"),
664
665
  prop: "Remark"
@@ -668,7 +669,7 @@ const lt = { class: "form-slot" }, at = { key: 0 }, rt = { key: 0 }, st = { key:
668
669
  }, 8, ["data", "empty-text"])), [
669
670
  [l(ie), he.value]
670
671
  ]),
671
- n(l(ot), {
672
+ s(l(ot), {
672
673
  "current-page": Z.value,
673
674
  "page-sizes": [50, 100, 150, 200],
674
675
  "page-size": A.value,
@@ -1,7 +1,7 @@
1
- import { defineComponent as K, toRefs as D, ref as s } from "vue";
1
+ import { defineComponent as K, toRefs as D, ref as c } from "vue";
2
2
  import S from "../_virtual/lodash.js";
3
- import { defaultComplexSearchProps as t } from "./props.js";
4
- import { ElLink as G, ElOption as H, ElButton as V, ElRow as _, ElFormItem as L, ElForm as P, ElIcon as q, ElDialog as j, ElSelect as Y, ElCheckbox as z, ElInput as J } from "element-plus";
3
+ import { defaultComplexSearchProps as r } from "./props.js";
4
+ import { ElLink as G, ElOption as H, ElButton as V, ElRow as _, ElFormItem as L, ElForm as P, ElIcon as q, ElDialog as j, ElSelect as Y, ElCheckbox as $, ElInput as z } from "element-plus";
5
5
  import "element-plus/theme-chalk/src/base.scss";
6
6
  import "element-plus/theme-chalk/src/input.scss";
7
7
  import "element-plus/theme-chalk/src/checkbox.scss";
@@ -18,13 +18,13 @@ import "element-plus/theme-chalk/src/form-item.scss";
18
18
  import "element-plus/theme-chalk/src/row.scss";
19
19
  import "element-plus/theme-chalk/src/button.scss";
20
20
  import "element-plus/theme-chalk/src/link.scss";
21
- import { Search as M } from "@element-plus/icons-vue";
21
+ import { Search as J } from "@element-plus/icons-vue";
22
22
  const Se = K({
23
23
  name: "YaheeComplexSearch",
24
24
  // 使用 components 选项注册所有 Element Plus 组件
25
25
  components: {
26
- ElInput: J,
27
- ElCheckbox: z,
26
+ ElInput: z,
27
+ ElCheckbox: $,
28
28
  ElSelect: Y,
29
29
  ElDialog: j,
30
30
  ElIcon: q,
@@ -34,57 +34,57 @@ const Se = K({
34
34
  ElButton: V,
35
35
  ElOption: H,
36
36
  ElLink: G,
37
- Search: M
37
+ Search: J
38
38
  },
39
39
  props: {
40
40
  defaultSearch: {
41
41
  type: String,
42
- default: t().defaultSearch
42
+ default: r().defaultSearch
43
43
  },
44
44
  options: {
45
45
  type: Array,
46
- default: t().options
46
+ default: r().options
47
47
  },
48
48
  placeholderText: {
49
49
  type: String,
50
- default: t().placeholderText
50
+ default: r().placeholderText
51
51
  },
52
52
  showPatchSearch: {
53
53
  type: Boolean,
54
- default: t().showPatchSearch
54
+ default: r().showPatchSearch
55
55
  },
56
56
  showWithinFilterCheckbox: {
57
57
  type: Boolean,
58
- default: t().showWithinFilterCheckbox
58
+ default: r().showWithinFilterCheckbox
59
59
  },
60
60
  specialOptions: {
61
61
  type: Array,
62
- default: t().specialOptions
62
+ default: r().specialOptions
63
63
  },
64
64
  normalOptions: {
65
65
  type: Array,
66
- default: t().normalOptions
66
+ default: r().normalOptions
67
67
  },
68
68
  showSelect: {
69
69
  type: Boolean,
70
- default: t().showSelect
70
+ default: r().showSelect
71
71
  },
72
72
  searchItem: {
73
73
  type: Object,
74
- default: t().searchItem
74
+ default: r().searchItem
75
75
  },
76
76
  isBatchSelectOptionsSameWithInput: {
77
77
  type: Boolean,
78
- default: t().isBatchSelectOptionsSameWithInput
78
+ default: r().isBatchSelectOptionsSameWithInput
79
79
  },
80
80
  batchOptions: {
81
81
  type: Array,
82
- default: t().batchOptions
82
+ default: r().batchOptions
83
83
  }
84
84
  },
85
85
  emits: ["filterChangeGrandson"],
86
- setup(y, { emit: u }) {
87
- const { specialOptions: v, normalOptions: w, searchItem: n } = D(y), r = s(y.defaultSearch || "WHOLE_SEARCH"), i = s(""), h = s(!1), f = s(!1), p = s(!1), m = s(null), o = s({ searchType: "WHOLE_SEARCH", searchContent: "" }), C = {
86
+ setup(v, { emit: u }) {
87
+ const { specialOptions: y, normalOptions: F, searchItem: s } = D(v), l = c(v.defaultSearch || "WHOLE_SEARCH"), i = c(""), h = c(!1), f = c(!1), p = c(!1), m = c(null), o = c({ searchType: "WHOLE_SEARCH", searchContent: "" }), C = {
88
88
  selectedSearchType: [{ required: !0, message: "请输入查询类型", trigger: "blur" }],
89
89
  searchContent: [{ required: !0, message: "请输入查询内容", trigger: "blur" }]
90
90
  }, g = [{ value: "WHOLE_SEARCH", label: "综合搜索" }], E = () => {
@@ -92,38 +92,42 @@ const Se = K({
92
92
  }, O = () => {
93
93
  p.value = !1;
94
94
  }, b = () => {
95
- h.value || (delete n.value.putSearch, u("filterChangeGrandson", n.value, r.value));
96
- }, W = () => n.value, I = () => {
97
- i.value ? A() : u("filterChangeGrandson", W(), r.value);
98
- }, R = (e, l) => {
99
- const a = { ...e };
100
- return S.map(v.value, (c) => c.key).includes(l.filterKey) ? v.value.forEach((c) => delete a[c.key]) : delete a[l.filterKey], a;
101
- }, k = (e) => {
102
- S.forEach(e, (l) => {
103
- const a = R(n.value, l), { checkedValues: c, filterKey: d } = l;
104
- S.isEmpty(c) || (w.value.includes(d) ? a[d] = c[0] : a[d] = c), n.value = a;
105
- }), u("filterChangeGrandson", n.value, r.value);
106
- }, T = (e) => {
107
- i.value = B(e) || "";
108
- }, x = (e) => {
109
- o.value.searchContent = B(e) || "";
110
- }, B = (e) => {
111
- var a;
112
- e.preventDefault();
113
- const l = (a = e.clipboardData) == null ? void 0 : a.getData("text/plain");
114
- return l == null ? void 0 : l.replace(/[\n\r\t]+/g, ",");
95
+ h.value || (delete s.value.putSearch, u("filterChangeGrandson", s.value, l.value));
96
+ }, W = () => s.value, I = () => {
97
+ i.value ? A() : u("filterChangeGrandson", W(), l.value);
98
+ }, R = (a, e) => {
99
+ const t = { ...a };
100
+ return S.map(y.value, (n) => n.key).includes(e.filterKey) ? y.value.forEach((n) => delete t[n.key]) : delete t[e.filterKey], t;
101
+ }, k = (a) => {
102
+ S.forEach(a, (e) => {
103
+ const t = R(s.value, e), { checkedValues: n, filterKey: d } = e;
104
+ S.isEmpty(n) || (F.value.includes(d) ? t[d] = n[0] : t[d] = n), s.value = t;
105
+ }), u("filterChangeGrandson", s.value, l.value);
106
+ }, T = (a) => {
107
+ i.value = x(a) || "";
108
+ }, w = (a) => {
109
+ const e = x(a);
110
+ if (e) {
111
+ const t = o.value.searchContent || "";
112
+ t ? o.value.searchContent = `${t},${e}` : o.value.searchContent = e;
113
+ }
114
+ }, x = (a) => {
115
+ var t;
116
+ a.preventDefault();
117
+ const e = (t = a.clipboardData) == null ? void 0 : t.getData("text/plain");
118
+ return e == null ? void 0 : e.replace(/[\n\r\t]+/g, ",");
115
119
  }, A = () => {
116
120
  h.value ? k([
117
121
  { filterKey: "putSearch", checkedValues: i.value },
118
- { filterKey: "searchType", checkedValues: r.value }
122
+ { filterKey: "searchType", checkedValues: l.value }
119
123
  ]) : u(
120
124
  "filterChangeGrandson",
121
- { putSearch: i.value, searchType: r.value },
122
- r.value
125
+ { putSearch: i.value, searchType: l.value },
126
+ l.value
123
127
  );
124
- }, F = () => {
125
- m.value && m.value.validate((e) => {
126
- e && (f.value = !0, h.value ? k([
128
+ }, B = () => {
129
+ m.value && m.value.validate((a) => {
130
+ a && (f.value = !0, h.value ? k([
127
131
  { filterKey: "putSearch", checkedValues: o.value.searchContent },
128
132
  { filterKey: "searchType", checkedValues: o.value.searchType }
129
133
  ]) : u(
@@ -132,13 +136,13 @@ const Se = K({
132
136
  putSearch: o.value.searchContent,
133
137
  searchType: o.value.searchType
134
138
  },
135
- r.value
139
+ l.value
136
140
  ), p.value = !1, f.value = !1);
137
141
  });
138
142
  };
139
143
  return {
140
144
  ...{
141
- selectedSearchType: r,
145
+ selectedSearchType: l,
142
146
  putSearch: i,
143
147
  isWithinFilterOptions: h,
144
148
  confirmLoading: f,
@@ -152,10 +156,10 @@ const Se = K({
152
156
  searchWithinFilterOptions: b,
153
157
  handleSearch: I,
154
158
  pasteFormatInput: T,
155
- confirmSearch: F,
156
- pasteFormat: x
159
+ confirmSearch: B,
160
+ pasteFormat: w
157
161
  },
158
- selectedSearchType: r,
162
+ selectedSearchType: l,
159
163
  putSearch: i,
160
164
  isWithinFilterOptions: h,
161
165
  confirmLoading: f,
@@ -169,8 +173,8 @@ const Se = K({
169
173
  searchWithinFilterOptions: b,
170
174
  handleSearch: I,
171
175
  pasteFormatInput: T,
172
- confirmSearch: F,
173
- pasteFormat: x
176
+ confirmSearch: B,
177
+ pasteFormat: w
174
178
  };
175
179
  }
176
180
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.85",
4
+ "version": "0.0.86",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",