@das-fed/ui 6.4.0-dev.60 → 6.4.0-dev.61

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.
Files changed (35) hide show
  1. package/package.json +5 -5
  2. package/packages/business-components/import-button/hooks/file.d.ts +1 -0
  3. package/packages/business-components/import-button/hooks/useImport.d.ts +1 -0
  4. package/packages/business-components/import-button/index.js +292 -287
  5. package/packages/business-components/import-button/index.js.gz +0 -0
  6. package/packages/business-components/import-button/src/type.d.ts +2 -0
  7. package/packages/business-components/import-button/style.css +1 -1
  8. package/packages/components/date-picker/index.d.ts +5 -0
  9. package/packages/components/date-picker/index.js +543 -525
  10. package/packages/components/date-picker/index.js.gz +0 -0
  11. package/packages/components/date-picker/src/DateRangePicker.vue.d.ts +2 -0
  12. package/packages/components/date-picker/style.css +1 -1
  13. package/packages/components/date-picker/style.css.gz +0 -0
  14. package/packages/components/map/index.js +82 -85
  15. package/packages/components/map/index.js.gz +0 -0
  16. package/packages/components/map/style.css +1 -1
  17. package/packages/components/menu-aside/index.js +154 -153
  18. package/packages/components/menu-aside/index.js.gz +0 -0
  19. package/packages/components/menu-aside/style.css +1 -1
  20. package/packages/components/menu-aside/style.css.gz +0 -0
  21. package/packages/components/menu-header/index.js +24 -23
  22. package/packages/components/menu-header/index.js.gz +0 -0
  23. package/packages/components/select-list/index.js +176 -174
  24. package/packages/components/select-list/index.js.gz +0 -0
  25. package/packages/components/select-list/style.css +1 -1
  26. package/packages/components/select-list/style.css.gz +0 -0
  27. package/packages/components/select-list/theme/index.d.ts +2 -0
  28. package/packages/components/table/index.js +79 -78
  29. package/packages/components/table/index.js.gz +0 -0
  30. package/packages/components/table/style.css +1 -1
  31. package/packages/components/table/style.css.gz +0 -0
  32. package/packages/components/tabs/index.js +61 -60
  33. package/packages/components/tabs/index.js.gz +0 -0
  34. package/packages/components/tabs/style.css +1 -1
  35. package/packages/components/tabs/style.css.gz +0 -0
@@ -1,182 +1,183 @@
1
1
  import '@das-fed/ui/packages/business-components/import-button/style.css';
2
2
  import { withInstall as fe } from "@das-fed/utils/with-install/index";
3
- import { ref as w, defineComponent as ge, watch as ve, openBlock as he, createElementBlock as we, createElementVNode as O, unref as o, renderSlot as re, createVNode as D, withCtx as L, createTextVNode as K, toDisplayString as H, createCommentVNode as se, isRef as Q } from "vue";
4
- import { t as c, i18n as U, setI18nRule as Ce } from "@das-fed/web/packages/i18n/index";
3
+ import { ref as k, defineComponent as ge, computed as ve, watch as he, openBlock as we, createElementBlock as Ce, createElementVNode as q, unref as o, renderSlot as re, createVNode as D, withCtx as j, createTextVNode as Y, toDisplayString as H, createCommentVNode as se, isRef as Q } from "vue";
4
+ import { t as u, i18n as L, setI18nRule as xe } from "@das-fed/web/packages/i18n/index";
5
5
  import { DasDialog as le } from "@das-fed/ui/packages/components/dialog/index";
6
- import { DasUpload as xe } from "@das-fed/ui/packages/components/upload/index";
7
- import { DasProgress as ke } from "@das-fed/ui/packages/components/progress/index";
6
+ import { DasUpload as ke } from "@das-fed/ui/packages/components/upload/index";
7
+ import { DasProgress as be } from "@das-fed/ui/packages/components/progress/index";
8
8
  import { DasButton as W } from "@das-fed/ui/packages/components/button/index";
9
9
  import { iotMinio as ae, iotProgress as ye } from "@das-fed/utils/api-services/modules/iot";
10
- import { DasMessage as M } from "@das-fed/ui/packages/components/message/index";
10
+ import { DasMessage as U } from "@das-fed/ui/packages/components/message/index";
11
11
  import Ne from "dayjs";
12
12
  import { getConfig as ne } from "@das-fed/utils/config";
13
- import { extractFilename as be } from "@das-fed/utils/common-tools";
14
- import { getUserInfo as ze } from "@das-fed/utils/common-info/index";
13
+ import { extractFilename as ze } from "@das-fed/utils/common-tools";
14
+ import { getUserInfo as Te } from "@das-fed/utils/common-info/index";
15
15
  import { pureImageSrc as ie } from "@das-fed/utils/pure-image-src";
16
16
  let te = (e = 21) => {
17
- let m = "", u = crypto.getRandomValues(new Uint8Array(e));
17
+ let m = "", p = crypto.getRandomValues(new Uint8Array(e));
18
18
  for (; e--; ) {
19
- let n = u[e] & 63;
20
- n < 36 ? m += n.toString(36) : n < 62 ? m += (n - 26).toString(36).toUpperCase() : n < 63 ? m += "_" : m += "-";
19
+ let s = p[e] & 63;
20
+ s < 36 ? m += s.toString(36) : s < 62 ? m += (s - 26).toString(36).toUpperCase() : s < 63 ? m += "_" : m += "-";
21
21
  }
22
22
  return m;
23
23
  };
24
- const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), Fe = ae.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), Ie = ye.get("progress"), $e = (e) => {
25
- let m = w(!1), u = w(!1), n = w(""), h = w(0), p = w("normal"), C = w(!1), g, z = w(""), P = w(""), F = w(""), b = w(""), I = w(!1), E = w(""), T = "", _ = w(""), $;
26
- const x = () => {
27
- P.value = "", F.value = "", b.value = "", I.value = !1, E.value = "";
28
- }, j = async () => {
29
- const [r, s] = await Te().run();
30
- return r ? { stauts: !1 } : { status: !0, data: s };
31
- }, R = (r) => new Promise((s, a) => {
24
+ const _e = ae.get("token"), Fe = ae.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), Ie = ae.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), $e = ye.get("progress"), Pe = (e) => {
25
+ let m = k(!1), p = k(!1), s = k(""), C = k(0), n = k("normal"), v = k(!1), b, y = k(""), I = k(""), $ = k(""), z = k(""), P = k(!1), M = k(""), _ = "", F = k(""), S;
26
+ const E = () => {
27
+ I.value = "", $.value = "", z.value = "", P.value = !1, M.value = "";
28
+ }, N = async () => {
29
+ const [r, l] = await _e().run();
30
+ return r ? { stauts: !1 } : { status: !0, data: l };
31
+ }, B = (r) => new Promise((l, g) => {
32
32
  const i = [];
33
33
  let t = 0;
34
34
  for (; t < r.size; ) {
35
- const y = r.slice(t, t + 1048576);
36
- i.push(y), t += 1048576;
35
+ const w = r.slice(t, t + 1048576);
36
+ i.push(w), t += 1048576;
37
37
  }
38
- const k = new Blob(i, { type: r.type });
39
- s(k);
40
- }), V = async (r, s, a, l = !1, i = !0, t = "") => {
41
- T = t, _.value = "import", i && (p.value = "normal", h.value = 0, n.value = c("导入进度"), u.value = !0, z.value = ""), $ = s;
42
- const k = await j();
43
- if (!k.status) return;
44
- let y = k.data, N = null, { autoContentType: Y, bucketName: B, importFileName: J } = a;
45
- const ue = l ? Fe : _e;
46
- if (l) {
38
+ const c = new Blob(i, { type: r.type });
39
+ l(c);
40
+ }), A = async (r, l, g, a = !1, i = !0, t = "") => {
41
+ _ = t, F.value = "import", i && (n.value = "normal", C.value = 0, s.value = u("导入进度"), p.value = !0, y.value = ""), S = l;
42
+ const c = await N();
43
+ if (!c.status) return;
44
+ let w = c.data, x = null, { autoContentType: K, bucketName: V, importFileName: J } = g;
45
+ const ue = a ? Ie : Fe;
46
+ if (a) {
47
47
  let X = [];
48
- await s.forEach(async (G) => {
49
- let ee = await R(G);
48
+ await l.forEach(async (G) => {
49
+ let ee = await B(G);
50
50
  X.push(ee);
51
- }), N = new FormData(), N.append("accessKeyId", y.accessKeyId), N.append("secretAccessKey", y.secretAccessKey), N.append("sessionToken", y.sessionToken), N.append("bucketName", B), s.forEach((G, ee) => {
52
- N.append("file", X[ee]);
51
+ }), x = new FormData(), x.append("accessKeyId", w.accessKeyId), x.append("secretAccessKey", w.secretAccessKey), x.append("sessionToken", w.sessionToken), x.append("bucketName", V), l.forEach((G, ee) => {
52
+ x.append("file", X[ee]);
53
53
  }), J.forEach((G) => {
54
- N.append("filePaths", G);
54
+ x.append("filePaths", G);
55
55
  });
56
56
  } else {
57
- const X = await R(s);
58
- N = {
59
- accessKeyId: y.accessKeyId,
60
- secretAccessKey: y.secretAccessKey,
61
- sessionToken: y.sessionToken,
57
+ const X = await B(l);
58
+ x = {
59
+ accessKeyId: w.accessKeyId,
60
+ secretAccessKey: w.secretAccessKey,
61
+ sessionToken: w.sessionToken,
62
62
  file: X,
63
- bucketName: B,
63
+ bucketName: V,
64
64
  filePath: J,
65
- autoContentType: Y
65
+ autoContentType: K
66
66
  };
67
67
  }
68
- const [me, ce] = await ue(N).run();
68
+ const [me, ce] = await ue(x).run();
69
69
  if (me) return;
70
- const de = await Se(ce.data), Z = await (r == null ? void 0 : r(de));
70
+ const de = await De(ce.data), Z = await (r == null ? void 0 : r(de));
71
71
  if (i) {
72
72
  if (!Z.status) {
73
- u.value = !1, p.value = "error";
73
+ p.value = !1, n.value = "error";
74
74
  return;
75
75
  }
76
- n.value = c("导入进度"), u.value = !0, d(Z.taskId, "import", "");
76
+ s.value = u("导入进度"), p.value = !0, T(Z.taskId, "import", "");
77
77
  } else {
78
78
  if (!Z.status) return;
79
- p.value = "success", M.success({
80
- message: c("导入成功"),
79
+ n.value = "success", U.success({
80
+ message: u("导入成功"),
81
81
  grouping: !0,
82
82
  repeatNum: 1
83
83
  });
84
84
  }
85
- }, A = async (r, s = "", a = "") => {
86
- p.value = "normal", h.value = 0, n.value = a || c("导出进度"), u.value = !0;
87
- const l = await (r == null ? void 0 : r());
88
- if (!l.status) {
89
- u.value = !1, p.value = "error";
85
+ }, R = async (r, l = "", g = "") => {
86
+ n.value = "normal", C.value = 0, s.value = g || u("导出进度"), p.value = !0;
87
+ const a = await (r == null ? void 0 : r());
88
+ if (!a.status) {
89
+ p.value = !1, n.value = "error";
90
90
  return;
91
91
  }
92
- d(l.taskId, "action", "");
93
- }, S = async (r, s = "", a = "xlsx") => {
94
- _.value = "export", p.value = "normal", h.value = 0, n.value = c("导出进度"), u.value = !0;
95
- const l = await (r == null ? void 0 : r());
96
- if (!l.status) {
97
- u.value = !1, p.value = "error";
92
+ T(a.taskId, "action", "");
93
+ }, O = async (r, l = "", g = "xlsx") => {
94
+ F.value = "export", n.value = "normal", C.value = 0, s.value = u("导出进度"), p.value = !0;
95
+ const a = await (r == null ? void 0 : r());
96
+ if (!a.status) {
97
+ p.value = !1, n.value = "error";
98
98
  return;
99
99
  }
100
- Ne().format("YYYYMMDDHHmmss") + "", d(l.taskId, "export", s || "", a);
101
- }, d = async (r, s, a, l = "") => {
102
- C.value = !0, v(r, s, a, l), g = setTimeout(() => {
100
+ Ne().format("YYYYMMDDHHmmss") + "", T(a.taskId, "export", l || "", g);
101
+ }, T = async (r, l, g, a = "") => {
102
+ v.value = !0, f(r, l, g, a), b = setTimeout(() => {
103
103
  }, 50);
104
- }, f = () => {
105
- clearTimeout(g), g = null, u.value = !1;
106
- }, v = async (r, s = "export", a, l = "") => {
107
- var y, N;
108
- const [i, t] = await Ie("", {
104
+ }, d = () => {
105
+ clearTimeout(b), b = null, p.value = !1;
106
+ }, f = async (r, l = "export", g, a = "") => {
107
+ var w, x;
108
+ const [i, t] = await $e("", {
109
109
  url: `progress/${r}`
110
110
  }).run();
111
111
  if (i) {
112
- C.value = !1;
112
+ v.value = !1;
113
113
  return;
114
114
  }
115
- h.value = t.percentage;
116
- const k = s == "export" ? c("导出") : c("导入");
117
- if (h.value == 100)
118
- if (z.value = t, C.value = !1, f(), s == "export")
119
- t.status == 1 ? (p.value = "success", pe(`${ne().baseURL}/oss${t.filePath}`, a, l), C.value = !1) : t.status == 2 && (b.value = t.message || `${k}${c("失败")}`, M.error({
120
- message: t.message || `${k}${c("失败")}`,
115
+ C.value = t.percentage;
116
+ const c = l == "export" ? u("导出") : u("导入");
117
+ if (C.value == 100)
118
+ if (y.value = t, v.value = !1, d(), l == "export")
119
+ t.status == 1 ? (n.value = "success", pe(`${ne().baseURL}/oss${t.filePath}`, g, a), v.value = !1) : t.status == 2 && (z.value = t.message || `${c}${u("失败")}`, U.error({
120
+ message: t.message || `${c}${u("失败")}`,
121
121
  grouping: !0,
122
122
  repeatNum: 1
123
123
  }));
124
- else if (s == "import") {
124
+ else if (l == "import") {
125
125
  if (t.filePath) {
126
- p.value = "error";
127
- const Y = (y = $.name) == null ? void 0 : y.match(/(.*?)(\.[^.]*$|$)/);
128
- Y.length && Y[2], I.value = !0;
129
- let B = await be(`/oss/${t == null ? void 0 : t.filePath}`);
130
- const J = ((N = B == null ? void 0 : B.split("/")) == null ? void 0 : N.pop()) || "";
131
- P.value = T || J, F.value = $.sizeText, b.value = c("部分数据校验不通过,请下载附件并修改,重新导入!"), E.value = `${ne().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
126
+ n.value = "error";
127
+ const K = (w = S.name) == null ? void 0 : w.match(/(.*?)(\.[^.]*$|$)/);
128
+ K.length && K[2], P.value = !0;
129
+ let V = await ze(`/oss/${t == null ? void 0 : t.filePath}`);
130
+ const J = ((x = V == null ? void 0 : V.split("/")) == null ? void 0 : x.pop()) || "";
131
+ I.value = _ || J, $.value = S.sizeText, z.value = u("部分数据校验不通过,请下载附件并修改,重新导入!"), M.value = `${ne().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
132
132
  }
133
- q(t.status, k, t.message), t.status == 1 && (m.value = !1), e("success");
134
- } else s == "action" && (p.value = "success");
133
+ h(t.status, c, t.message), t.status == 1 && (m.value = !1), e("success");
134
+ } else l == "action" && (n.value = "success");
135
135
  else
136
- g && t.status != 2 ? g = setTimeout(() => {
137
- v(r, s, a, l);
138
- }, 50) : (z.value = t, C.value = !1, q(t.status, k, t.message), f(), I.value = !0, b.value = (t == null ? void 0 : t.message) || "", e("error", t));
139
- }, q = (r, s, a) => {
140
- r == 1 ? (p.value = "success", M.success({
141
- message: c("business-components_export-success-tip", s),
136
+ b && t.status != 2 ? b = setTimeout(() => {
137
+ f(r, l, g, a);
138
+ }, 50) : (y.value = t, v.value = !1, h(t.status, c, t.message), d(), P.value = !0, z.value = (t == null ? void 0 : t.message) || "", e("error", t));
139
+ }, h = (r, l, g) => {
140
+ r == 1 ? (n.value = "success", U.success({
141
+ message: u("business-components_export-success-tip", l),
142
142
  grouping: !0,
143
143
  repeatNum: 1
144
- }), P.value = "", F.value = "", b.value = "") : r == 2 ? (p.value = "error", M.error({
145
- message: c("business-components_export-failure-tip", s),
144
+ }), I.value = "", $.value = "", z.value = "") : r == 2 ? (n.value = "error", U.error({
145
+ message: u("business-components_export-failure-tip", l),
146
146
  grouping: !0,
147
147
  repeatNum: 1
148
- })) : r == 3 && (p.value = "error", M.error({
149
- message: c("business-components_export-partially-failure-tip", s),
148
+ })) : r == 3 && (n.value = "error", U.error({
149
+ message: u("business-components_export-partially-failure-tip", l),
150
150
  grouping: !0,
151
151
  repeatNum: 1
152
152
  }));
153
153
  };
154
154
  return {
155
155
  importDialog: m,
156
- showProgressDialog: u,
157
- progressTitle: n,
158
- percent: h,
159
- progressStatus: p,
160
- progressLoading: C,
161
- progressResult: z,
162
- errorFileName: P,
163
- errorFileSize: F,
164
- errorMessage: b,
165
- errorImport: I,
166
- errorFilePath: E,
167
- fileHandleType: _,
168
- fileImport: V,
169
- fileExport: S,
170
- fileAction: A,
156
+ showProgressDialog: p,
157
+ progressTitle: s,
158
+ percent: C,
159
+ progressStatus: n,
160
+ progressLoading: v,
161
+ progressResult: y,
162
+ errorFileName: I,
163
+ errorFileSize: $,
164
+ errorMessage: z,
165
+ errorImport: P,
166
+ errorFilePath: M,
167
+ fileHandleType: F,
168
+ fileImport: A,
169
+ fileExport: O,
170
+ fileAction: R,
171
171
  generateUniqueName: (r) => {
172
- const s = r == null ? void 0 : r.match(/(.*?)(\.[^.]*$|$)/), a = s.length ? s[2] : "";
173
- return `${s.length ? s[1] : r}${te()}${a}`;
172
+ const l = r == null ? void 0 : r.match(/(.*?)(\.[^.]*$|$)/), g = l.length ? l[2] : "";
173
+ return `${l.length ? l[1] : r}${te()}${g}`;
174
174
  },
175
175
  downloadFile: pe,
176
- resetStataus: x,
177
- checkProgress: d
176
+ resetStataus: E,
177
+ checkProgress: T,
178
+ clearTimer: d
178
179
  };
179
- }, Pe = (e) => {
180
+ }, Se = (e) => {
180
181
  let m = e == null ? void 0 : e.toLocaleLowerCase();
181
182
  return {
182
183
  excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -205,131 +206,134 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
205
206
  der: "application/x-x509-ca-cert",
206
207
  cer: "application/pkix-cert"
207
208
  }[m];
208
- }, pe = (e, m, u = "excel") => {
209
- const n = new XMLHttpRequest();
210
- n.open("get", e), n.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), n.responseType = "blob", n.onload = function(h) {
211
- const p = new Blob([this.response], {
212
- type: Pe(u)
213
- }), C = URL.createObjectURL(p);
209
+ }, pe = (e, m, p = "excel") => {
210
+ const s = new XMLHttpRequest();
211
+ s.open("get", e), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(C) {
212
+ const n = new Blob([this.response], {
213
+ type: Se(p)
214
+ }), v = URL.createObjectURL(n);
214
215
  if (window.navigator.msSaveOrOpenBlob)
215
- navigator.msSaveBlob(p, m);
216
+ navigator.msSaveBlob(n, m);
216
217
  else {
217
- const g = document.createElement("a");
218
- g.href = C, g.download = m, g.click(), window.URL.revokeObjectURL(C);
218
+ const b = document.createElement("a");
219
+ b.href = v, b.download = m, b.click(), window.URL.revokeObjectURL(v);
219
220
  }
220
- }, n.send();
221
- }, Se = (e) => new Promise((m, u) => {
222
- var n = new FileReader();
223
- n.onload = function(h) {
224
- let p = "";
225
- typeof n.result == "string" && (p = JSON.parse(n.result)), m(p);
226
- }, n.readAsText(e);
227
- }), De = (e, m) => {
228
- var s;
221
+ }, s.send();
222
+ }, De = (e) => new Promise((m, p) => {
223
+ var s = new FileReader();
224
+ s.onload = function(C) {
225
+ let n = "";
226
+ typeof s.result == "string" && (n = JSON.parse(s.result)), m(n);
227
+ }, s.readAsText(e);
228
+ }), Ue = (e, m) => {
229
+ var g;
229
230
  const {
230
- importDialog: u,
231
- showProgressDialog: n,
232
- progressTitle: h,
233
- percent: p,
234
- progressStatus: C,
235
- progressLoading: g,
236
- errorFileName: z,
237
- errorFileSize: P,
238
- errorMessage: F,
239
- errorImport: b,
240
- errorFilePath: I,
241
- fileHandleType: E,
242
- fileImport: T,
243
- fileExport: _,
244
- downloadFile: $
245
- } = $e(m);
246
- let x = w([]), j = (s = ze()) == null ? void 0 : s.tenantId;
247
- const R = () => {
248
- x.value = [], b.value = !1, z.value = "", P.value = "", F.value = "", u.value = !0, I.value = "", m("open");
231
+ importDialog: p,
232
+ showProgressDialog: s,
233
+ progressTitle: C,
234
+ percent: n,
235
+ progressStatus: v,
236
+ progressLoading: b,
237
+ errorFileName: y,
238
+ errorFileSize: I,
239
+ errorMessage: $,
240
+ errorImport: z,
241
+ errorFilePath: P,
242
+ fileHandleType: M,
243
+ fileImport: _,
244
+ fileExport: F,
245
+ downloadFile: S,
246
+ clearTimer: E
247
+ } = Pe(m);
248
+ let N = k([]), B = (g = Te()) == null ? void 0 : g.tenantId;
249
+ const A = () => {
250
+ N.value = [], z.value = !1, y.value = "", I.value = "", $.value = "", p.value = !0, P.value = "", m("open");
249
251
  };
250
- let V;
251
- const A = (a) => {
252
- const l = e.fileType.split(","), i = a.name.substring(a.name.lastIndexOf(".")), t = S(a.sizeText), k = S(e.fileMaxSize);
253
- if (!l.includes(i)) {
254
- M.warning(c("文件格式错误,请重新上传!")), setTimeout(() => {
255
- x.value = [];
252
+ let R;
253
+ const O = (a) => {
254
+ const i = e.fileType.split(","), t = a.name.substring(a.name.lastIndexOf(".")), c = T(a.sizeText), w = T(e.fileMaxSize);
255
+ if (!i.includes(t)) {
256
+ U.warning(u("文件格式错误,请重新上传!")), setTimeout(() => {
257
+ N.value = [];
256
258
  });
257
259
  return;
258
260
  }
259
- if (t > k) {
260
- M.warning(`${c("文件大小不超过")}${e.fileMaxSize}`), setTimeout(() => {
261
- x.value = [];
261
+ if (c > w) {
262
+ U.warning(`${u("文件大小不超过")}${e.fileMaxSize}`), setTimeout(() => {
263
+ N.value = [];
262
264
  });
263
265
  return;
264
266
  }
265
- V = a.name;
266
- }, S = (a) => {
267
- let l = a.match(/\d+(\.\d+)?/)[0], i = a.match(/[a-zA-z]+/gi)[0], t = 0;
268
- return l = parseFloat(l), i = i.toLowerCase(), i === "gb" || i === "g" ? t = (l * 1024 * 1024 * 1024).toFixed(2) : i === "mb" || i === "m" ? t = (l * 1024 * 1024).toFixed(2) : i === "kb" || i === "k" ? t = (l * 1024).toFixed(2) : i === "b" && (t = l), parseFloat(t);
267
+ R = a.name;
268
+ }, T = (a) => {
269
+ let i = a.match(/\d+(\.\d+)?/)[0], t = a.match(/[a-zA-z]+/gi)[0], c = 0;
270
+ return i = parseFloat(i), t = t.toLowerCase(), t === "gb" || t === "g" ? c = (i * 1024 * 1024 * 1024).toFixed(2) : t === "mb" || t === "m" ? c = (i * 1024 * 1024).toFixed(2) : t === "kb" || t === "k" ? c = (i * 1024).toFixed(2) : t === "b" && (c = i), parseFloat(c);
269
271
  }, d = async (a) => {
270
- const l = a.value.split("/");
271
- let i = te();
272
- const t = {
273
- fileName: l[l.length - 1],
272
+ const i = a.value.split("/");
273
+ let t = te();
274
+ const c = {
275
+ fileName: i[i.length - 1],
274
276
  filePath: a.value,
275
- taskId: i,
277
+ taskId: t,
276
278
  ...e.importParams
277
- }, k = e.importParamsPosition === "params" ? e.importFun("", { params: t }) : e.importFun(t), [y, N] = await k.run();
278
- return y ? { status: !1 } : { status: !0, taskId: i };
279
+ }, w = e.importParamsPosition === "params" ? e.importFun("", { params: c }) : e.importFun(c), [x, K] = await w.run();
280
+ return x ? { status: !1 } : { status: !0, taskId: t };
279
281
  }, f = async () => {
280
- if (!x.value.length) return M.warning(c("请上传文件"));
282
+ if (!N.value.length) return U.warning(u("请上传文件"));
281
283
  const a = {
282
284
  bucketName: e.bucketName,
283
- importFileName: `${j}/${e.ossName}/${V}`
284
- }, l = e.maxCount > 1, i = e.maxCount > 1 ? x.value : x.value[0];
285
- await T(d, i, a, l);
286
- }, v = () => {
287
- $(I.value, z.value);
288
- }, q = () => {
289
- _(oe, e.templateName);
290
- }, oe = async () => {
285
+ importFileName: `${B}/${e.ossName}/${R}`
286
+ }, i = e.maxCount > 1, t = e.maxCount > 1 ? N.value : N.value[0];
287
+ await _(d, t, a, i);
288
+ }, h = () => {
289
+ S(P.value, y.value);
290
+ }, oe = () => {
291
+ F(r, e.templateName);
292
+ }, r = async () => {
291
293
  let a = te();
292
- const [l, i] = await e.templateFun({ taskId: a }).run();
293
- return l ? { status: !1 } : { status: !0, taskId: a };
294
+ const [i, t] = await e.templateFun({ taskId: a }).run();
295
+ return i ? { status: !1 } : { status: !0, taskId: a };
294
296
  };
295
297
  return {
296
- showProgressDialog: n,
297
- progressTitle: h,
298
- percent: p,
299
- progressStatus: C,
300
- progressLoading: g,
301
- errorFileName: z,
302
- errorFileSize: P,
303
- errorMessage: F,
304
- errorImport: b,
305
- importDialog: u,
306
- fileList: x,
307
- fileHandleType: E,
308
- showImportHandle: R,
298
+ showProgressDialog: s,
299
+ progressTitle: C,
300
+ percent: n,
301
+ progressStatus: v,
302
+ progressLoading: b,
303
+ errorFileName: y,
304
+ errorFileSize: I,
305
+ errorMessage: $,
306
+ errorImport: z,
307
+ importDialog: p,
308
+ fileList: N,
309
+ fileHandleType: M,
310
+ showImportHandle: A,
309
311
  confirmImport: f,
310
- fileUpload: A,
311
- errorFileDownload: v,
312
+ fileUpload: O,
313
+ errorFileDownload: h,
312
314
  downTemplate: async () => {
313
315
  let a = "";
314
316
  if (e.templateUrl)
315
- a = e.templateUrl, $(ie(a), e.templateName);
317
+ a = e.templateUrl, S(ie(a), e.templateName);
316
318
  else if (e.templateFun) {
317
319
  if (e.templateType === "static") {
318
320
  if (e.templateUrl)
319
321
  a = e.templateUrl;
320
322
  else if (e.templateFun) {
321
- const [l, i] = await e.templateFun().run();
322
- a = i;
323
+ const [i, t] = await e.templateFun().run();
324
+ a = t;
323
325
  }
324
- $(ie(a), e.templateName);
326
+ S(ie(a), e.templateName);
325
327
  }
326
- e.templateType === "dynamic" && e.templateFun && q();
328
+ e.templateType === "dynamic" && e.templateFun && oe();
327
329
  }
328
- }
330
+ },
331
+ clearTimer: E
329
332
  };
330
- }, Ue = { class: "das-import-button" }, Me = { class: "tip-box" }, Ee = { class: "first-line" }, Le = { class: "second-line" }, je = /* @__PURE__ */ ge({
333
+ }, Me = { class: "das-import-button" }, Ee = { class: "tip-box" }, je = { class: "first-line" }, Le = { class: "second-line" }, Be = /* @__PURE__ */ ge({
331
334
  __name: "App",
332
335
  props: {
336
+ btnText: {},
333
337
  importFun: {},
334
338
  ossName: {},
335
339
  templateName: { default: "导入模板" },
@@ -348,45 +352,45 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
348
352
  multiple: { type: Boolean, default: !1 }
349
353
  },
350
354
  emits: ["open", "success", "error"],
351
- setup(e, { expose: m, emit: u }) {
352
- const n = e, h = u, {
353
- showProgressDialog: p,
354
- progressTitle: C,
355
- percent: g,
356
- progressStatus: z,
357
- progressLoading: P,
358
- errorFileName: F,
359
- errorFileSize: b,
360
- errorMessage: I,
361
- errorImport: E,
362
- importDialog: T,
363
- fileList: _,
364
- fileHandleType: $,
365
- showImportHandle: x,
366
- confirmImport: j,
367
- fileUpload: R,
368
- errorFileDownload: V,
369
- downTemplate: A
370
- } = De(n, h);
371
- let S;
372
- return ve($, (d) => {
373
- d.includes("import") ? S = [c("正在导入中..."), c("导入失败"), c("导入成功")] : S = [c("正在导出中..."), c("导出失败"), c("导出成功")];
355
+ setup(e, { expose: m, emit: p }) {
356
+ const s = e, C = p, n = ve(() => s.btnText ? s.btnText : u("导入")), {
357
+ showProgressDialog: v,
358
+ progressTitle: b,
359
+ percent: y,
360
+ progressStatus: I,
361
+ errorFileName: $,
362
+ errorFileSize: z,
363
+ errorMessage: P,
364
+ errorImport: M,
365
+ importDialog: _,
366
+ fileList: F,
367
+ fileHandleType: S,
368
+ showImportHandle: E,
369
+ confirmImport: N,
370
+ fileUpload: B,
371
+ errorFileDownload: A,
372
+ downTemplate: R,
373
+ clearTimer: O
374
+ } = Ue(s, C);
375
+ let T;
376
+ return he(S, (d) => {
377
+ d.includes("import") ? T = [u("正在导入中..."), u("导入失败"), u("导入成功")] : T = [u("正在导出中..."), u("导出失败"), u("导出成功")];
374
378
  }), m({
375
- confirmImport: j,
376
- showImportHandle: x
377
- }), (d, f) => (he(), we("div", Ue, [
378
- O("div", {
379
+ confirmImport: N,
380
+ showImportHandle: E
381
+ }), (d, f) => (we(), Ce("div", Me, [
382
+ q("div", {
379
383
  onClick: f[0] || (f[0] = //@ts-ignore
380
- (...v) => o(x) && o(x)(...v))
384
+ (...h) => o(E) && o(E)(...h))
381
385
  }, [
382
386
  re(d.$slots, "default", {}, () => [
383
387
  D(o(W), {
384
388
  size: "middle",
385
389
  "btn-type": "primary"
386
390
  }, {
387
- default: L(() => [
388
- K(
389
- H(o(U)("导入").value),
391
+ default: j(() => [
392
+ Y(
393
+ H(n.value),
390
394
  1
391
395
  /* TEXT */
392
396
  )
@@ -398,22 +402,22 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
398
402
  ]),
399
403
  se(" 导入弹窗 "),
400
404
  D(o(le), {
401
- title: o(U)(d.importDialogName).value,
402
- modelValue: o(T),
403
- "onUpdate:modelValue": f[3] || (f[3] = (v) => Q(T) ? T.value = v : null),
405
+ title: o(L)(d.importDialogName).value,
406
+ modelValue: o(_),
407
+ "onUpdate:modelValue": f[3] || (f[3] = (h) => Q(_) ? _.value = h : null),
404
408
  customClass: "upload-dialog",
405
409
  width: "610px",
406
410
  height: "500px"
407
411
  }, {
408
- footer: L(() => [
409
- O("div", null, [
412
+ footer: j(() => [
413
+ q("div", null, [
410
414
  D(o(W), {
411
415
  size: "middle",
412
- onClick: f[2] || (f[2] = (v) => T.value = !1)
416
+ onClick: f[2] || (f[2] = (h) => _.value = !1)
413
417
  }, {
414
- default: L(() => [
415
- K(
416
- H(o(U)("取消").value),
418
+ default: j(() => [
419
+ Y(
420
+ H(o(L)("取消").value),
417
421
  1
418
422
  /* TEXT */
419
423
  )
@@ -424,13 +428,13 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
424
428
  D(o(W), {
425
429
  size: "middle",
426
430
  "btn-type": "primary",
427
- disabled: d.openDisabled && o(_).length === 0,
431
+ disabled: d.openDisabled && o(F).length === 0,
428
432
  style: { "margin-left": "12px", width: "100%" },
429
- onClick: o(j)
433
+ onClick: o(N)
430
434
  }, {
431
- default: L(() => [
432
- K(
433
- H(o(U)(`${d.confirmButtonName}`).value),
435
+ default: j(() => [
436
+ Y(
437
+ H(o(L)(`${d.confirmButtonName}`).value),
434
438
  1
435
439
  /* TEXT */
436
440
  )
@@ -440,12 +444,12 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
440
444
  }, 8, ["disabled", "onClick"])
441
445
  ])
442
446
  ]),
443
- default: L(() => [
447
+ default: j(() => [
444
448
  re(d.$slots, "tip", {}, () => [
445
- O("div", Me, [
446
- O("div", Ee, [
447
- K(
448
- H(o(U)("1、点击下载 ").value),
449
+ q("div", Ee, [
450
+ q("div", je, [
451
+ Y(
452
+ H(o(L)("1、点击下载 ").value),
449
453
  1
450
454
  /* TEXT */
451
455
  ),
@@ -453,11 +457,11 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
453
457
  size: "large",
454
458
  btnType: "primary-text",
455
459
  block: "",
456
- onClick: o(A)
460
+ onClick: o(R)
457
461
  }, {
458
- default: L(() => [
459
- K(
460
- H(o(U)(`${d.templateName}`).value),
462
+ default: j(() => [
463
+ Y(
464
+ H(o(L)(`${d.templateName}`).value),
461
465
  1
462
466
  /* TEXT */
463
467
  )
@@ -466,27 +470,27 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
466
470
  /* STABLE */
467
471
  }, 8, ["onClick"])
468
472
  ]),
469
- O(
473
+ q(
470
474
  "div",
471
475
  Le,
472
- H(o(U)("2、仅支持上传Excel文件,重复数据以最后一条为准").value),
476
+ H(o(L)("2、仅支持上传Excel文件,重复数据以最后一条为准").value),
473
477
  1
474
478
  /* TEXT */
475
479
  )
476
480
  ])
477
481
  ], !0),
478
- D(o(xe), {
479
- modelValue: o(_),
480
- "onUpdate:modelValue": f[1] || (f[1] = (v) => Q(_) ? _.value = v : null),
481
- error: o(E),
482
- "error-file-name": o(F),
483
- "error-file-size": o(b),
484
- "error-message": o(I),
482
+ D(o(ke), {
483
+ modelValue: o(F),
484
+ "onUpdate:modelValue": f[1] || (f[1] = (h) => Q(F) ? F.value = h : null),
485
+ error: o(M),
486
+ "error-file-name": o($),
487
+ "error-file-size": o(z),
488
+ "error-message": o(P),
485
489
  accept: d.fileType,
486
490
  maxCount: d.maxCount,
487
491
  multiple: d.multiple,
488
- onErrorFileDownload: o(V),
489
- onFileUpload: o(R)
492
+ onErrorFileDownload: o(A),
493
+ onFileUpload: o(B)
490
494
  }, null, 8, ["modelValue", "error", "error-file-name", "error-file-size", "error-message", "accept", "maxCount", "multiple", "onErrorFileDownload", "onFileUpload"])
491
495
  ]),
492
496
  _: 3
@@ -495,33 +499,34 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
495
499
  se(" 进度弹窗 "),
496
500
  D(o(le), {
497
501
  size: "mini",
498
- title: o(U)(o(C)).value,
502
+ title: o(L)(o(b)).value,
499
503
  "is-feedback-img": !1,
500
- modelValue: o(p),
501
- "onUpdate:modelValue": f[5] || (f[5] = (v) => Q(p) ? p.value = v : null),
502
- type: "feedback"
504
+ modelValue: o(v),
505
+ "onUpdate:modelValue": f[5] || (f[5] = (h) => Q(v) ? v.value = h : null),
506
+ type: "feedback",
507
+ onClose: o(O)
503
508
  }, {
504
- default: L(() => [
505
- D(o(ke), {
506
- modelValue: o(g),
507
- "onUpdate:modelValue": f[4] || (f[4] = (v) => Q(g) ? g.value = v : null),
509
+ default: j(() => [
510
+ D(o(be), {
511
+ modelValue: o(y),
512
+ "onUpdate:modelValue": f[4] || (f[4] = (h) => Q(y) ? y.value = h : null),
508
513
  style: { "margin-top": "35px" },
509
514
  type: "circle",
510
- status: o(z),
511
- textMap: o(S)
515
+ status: o(I),
516
+ textMap: o(T)
512
517
  }, null, 8, ["modelValue", "status", "textMap"])
513
518
  ]),
514
519
  _: 1
515
520
  /* STABLE */
516
- }, 8, ["title", "modelValue"])
521
+ }, 8, ["title", "modelValue", "onClose"])
517
522
  ]));
518
523
  }
519
524
  }), Re = (e, m) => {
520
- const u = e.__vccOpts || e;
521
- for (const [n, h] of m)
522
- u[n] = h;
523
- return u;
524
- }, Ve = /* @__PURE__ */ Re(je, [["__scopeId", "data-v-85787da8"]]), Be = {
525
+ const p = e.__vccOpts || e;
526
+ for (const [s, C] of m)
527
+ p[s] = C;
528
+ return p;
529
+ }, Ve = /* @__PURE__ */ Re(Be, [["__scopeId", "data-v-89d6ab48"]]), He = {
525
530
  "1、点击下载 ": { "zh-CN": "1、点击下载 ", en: "1、Click to Download ", _appCode: "framework" },
526
531
  "2、仅支持上传Excel文件,重复数据以最后一条为准": {
527
532
  "zh-CN": "2、仅支持上传Excel文件,重复数据以最后一条为准",
@@ -567,9 +572,9 @@ const Te = ae.get("token"), _e = ae.post("put-object", (e) => (e.headers || (e.h
567
572
  _appCode: "framework"
568
573
  }
569
574
  };
570
- Ce(Be);
571
- const at = fe(Ve);
575
+ xe(He);
576
+ const ot = fe(Ve);
572
577
  export {
573
- at as DasImportButton,
574
- at as default
578
+ ot as DasImportButton,
579
+ ot as default
575
580
  };