@das-fed/utils 6.4.0-hot.20 → 6.4.0-hot.22

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 (77) hide show
  1. package/api-services/index.js +1684 -1368
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +1928 -1612
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +1928 -1612
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +1931 -1615
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +1928 -1612
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +1917 -1601
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +1928 -1612
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.js +119 -118
  16. package/api-services/modules/file/index.js.gz +0 -0
  17. package/api-services/modules/gateway-edge/index.js +1928 -1612
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/index.js +1683 -1367
  20. package/api-services/modules/index.js.gz +0 -0
  21. package/api-services/modules/iot/index.js +1940 -1624
  22. package/api-services/modules/iot/index.js.gz +0 -0
  23. package/api-services/modules/justauth/index.js +1914 -1598
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/index.js +1928 -1612
  26. package/api-services/modules/knowledge/index.js.gz +0 -0
  27. package/api-services/modules/link/index.js +1928 -1612
  28. package/api-services/modules/link/index.js.gz +0 -0
  29. package/api-services/modules/permission/index.js +1928 -1612
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/platformManage/index.js +1935 -1619
  32. package/api-services/modules/platformManage/index.js.gz +0 -0
  33. package/api-services/modules/portal/index.js +1928 -1612
  34. package/api-services/modules/portal/index.js.gz +0 -0
  35. package/api-services/modules/space-manage/index.js +1928 -1612
  36. package/api-services/modules/space-manage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/index.js +1916 -1600
  38. package/api-services/modules/super-admin/index.js.gz +0 -0
  39. package/api-services/modules/supplier/index.js +1930 -1614
  40. package/api-services/modules/supplier/index.js.gz +0 -0
  41. package/api-services/modules/supplychain-manage/index.js +1928 -1612
  42. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/index.js +1928 -1612
  44. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  45. package/api-services/modules/tool/index.js +1928 -1612
  46. package/api-services/modules/tool/index.js.gz +0 -0
  47. package/api-services/src/create-service/index.js +1912 -1596
  48. package/api-services/src/create-service/index.js.gz +0 -0
  49. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  50. package/common-info/index.js.gz +0 -0
  51. package/common-info/set-personal-info/index.js +837 -570
  52. package/common-info/set-personal-info/index.js.gz +0 -0
  53. package/common-info/type.d.ts +104 -104
  54. package/common-tools/extract-file-name/index.js +922 -655
  55. package/common-tools/extract-file-name/index.js.gz +0 -0
  56. package/common-tools/get-url-params/index.js.gz +0 -0
  57. package/create-api-service/index.js +1912 -1596
  58. package/create-api-service/index.js.gz +0 -0
  59. package/create-api-service/sso/index.js +968 -701
  60. package/create-api-service/sso/index.js.gz +0 -0
  61. package/curring-http/index.js +1364 -1097
  62. package/curring-http/index.js.gz +0 -0
  63. package/curring-http/type.d.ts +87 -87
  64. package/directive/auth/index.js.gz +0 -0
  65. package/hooks/use-get-auth/index.js.gz +0 -0
  66. package/nextTiken/index.js.gz +0 -0
  67. package/package.json +4 -3
  68. package/pinyin-first-character/index.js +19799 -20879
  69. package/pinyin-first-character/index.js.gz +0 -0
  70. package/style/index.js +4 -2
  71. package/style/index.js.gz +0 -0
  72. package/token-tools/index.js.gz +0 -0
  73. package/use-low-code/index.js +3 -3
  74. package/use-low-code/index.js.gz +0 -0
  75. package/use-low-code/style.css +1 -1
  76. package/webSocket-service/index.js.gz +0 -0
  77. package/webSocket-service/type.d.ts +28 -28
@@ -1,151 +1,152 @@
1
- import { iotMinio as C, iotProgress as Q } from "@das-fed/utils/api-services/modules/iot";
2
- import { extractFilename as W } from "@das-fed/utils/common-tools";
3
- import { ref as f } from "vue";
4
- import Z from "dayjs";
5
- import { getConfig as O } from "@das-fed/utils/config";
6
- let F = (e = 21) => {
7
- let o = "", i = crypto.getRandomValues(new Uint8Array(e));
1
+ import { iotMinio as N, iotProgress as W } from "@das-fed/utils/api-services/modules/iot";
2
+ import { extractFilename as Z } from "@das-fed/utils/common-tools";
3
+ import { ref as v } from "vue";
4
+ import F from "dayjs";
5
+ import { t as i } from "@das-fed/web/packages/i18n/index";
6
+ import { getConfig as B } from "@das-fed/utils/config";
7
+ let ee = (e = 21) => {
8
+ let o = "", u = crypto.getRandomValues(new Uint8Array(e));
8
9
  for (; e--; ) {
9
- let s = i[e] & 63;
10
+ let s = u[e] & 63;
10
11
  s < 36 ? o += s.toString(36) : s < 62 ? o += (s - 26).toString(36).toUpperCase() : s < 63 ? o += "_" : o += "-";
11
12
  }
12
13
  return o;
13
14
  };
14
- const ee = C.get("token"), te = C.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), se = C.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), ae = Q.get("progress"), me = () => {
15
- let e = f(!1), o = f(""), i = f(0), s = f("normal"), d = f(!1), p, w = f(""), g = f(""), y = f(""), h = f(""), T = f(!1), R = f(""), L = "", N;
16
- const H = () => {
17
- g.value = "", y.value = "", h.value = "", T.value = !1, R.value = "";
18
- }, q = async () => {
19
- const [a, r] = await ee().run();
15
+ const te = N.get("token"), se = N.post("put-object", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), ae = N.post("upload-objects", (e) => (e.headers || (e.headers = {}), e.headers["Content-Type"] = "multipart/form-data", e.responseType = "blob", e)), re = W.get("progress"), ve = () => {
16
+ let e = v(!1), o = v(""), u = v(0), s = v("normal"), g = v(!1), m, h = v(""), w = v(""), T = v(""), b = v(""), $ = v(!1), L = v(""), P = "", A;
17
+ const q = () => {
18
+ w.value = "", T.value = "", b.value = "", $.value = !1, L.value = "";
19
+ }, Y = async () => {
20
+ const [a, r] = await te().run();
20
21
  return a ? { stauts: !1 } : { status: !0, data: r };
21
- }, A = (a) => new Promise((r, l) => {
22
- const u = [];
22
+ }, I = (a) => new Promise((r, l) => {
23
+ const c = [];
23
24
  let t = 0;
24
25
  for (; t < a.size; ) {
25
- const m = a.slice(t, t + 1048576);
26
- u.push(m), t += 1048576;
26
+ const f = a.slice(t, t + 1048576);
27
+ c.push(f), t += 1048576;
27
28
  }
28
- const v = new Blob(u, { type: a.type });
29
- r(v);
30
- }), Y = async (a, r, l, n = !0, u = "", t = !1) => {
31
- var z, E;
32
- L = u, n && (s.value = "normal", i.value = 0, o.value = "导入进度", e.value = !0, w.value = ""), N = r;
33
- const v = await q();
34
- if (!v.status) return;
35
- let m = v.data, c = null, { autoContentType: x, bucketName: j, importFileName: D } = l;
36
- const X = t ? se : te;
29
+ const d = new Blob(c, { type: a.type });
30
+ r(d);
31
+ }), J = async (a, r, l, n = !0, c = "", t = !1) => {
32
+ var E, O;
33
+ P = c, n && (s.value = "normal", u.value = 0, o.value = i("导入进度"), e.value = !0, h.value = ""), A = r;
34
+ const d = await Y();
35
+ if (!d.status) return;
36
+ let f = d.data, p = null, { autoContentType: y, bucketName: j, importFileName: z } = l;
37
+ const _ = t ? ae : se;
37
38
  if (t) {
38
39
  let M = [];
39
- await r.forEach(async ($) => {
40
- let U = await A($);
41
- M.push(U);
42
- }), c = new FormData(), c.append("accessKeyId", m.accessKeyId), c.append("secretAccessKey", m.secretAccessKey), c.append("sessionToken", m.sessionToken), c.append("bucketName", j), r.forEach(($, U) => {
43
- c.append("file", M[U]);
44
- }), D.forEach(($) => {
45
- c.append("filePaths", $);
40
+ await r.forEach(async (R) => {
41
+ let C = await I(R);
42
+ M.push(C);
43
+ }), p = new FormData(), p.append("accessKeyId", f.accessKeyId), p.append("secretAccessKey", f.secretAccessKey), p.append("sessionToken", f.sessionToken), p.append("bucketName", j), r.forEach((R, C) => {
44
+ p.append("file", M[C]);
45
+ }), z.forEach((R) => {
46
+ p.append("filePaths", R);
46
47
  });
47
48
  } else {
48
- const M = await A(r);
49
- c = {
50
- accessKeyId: m.accessKeyId,
51
- secretAccessKey: m.secretAccessKey,
52
- sessionToken: m.sessionToken,
49
+ const M = await I(r);
50
+ p = {
51
+ accessKeyId: f.accessKeyId,
52
+ secretAccessKey: f.secretAccessKey,
53
+ sessionToken: f.sessionToken,
53
54
  file: M,
54
55
  bucketName: j,
55
- filePath: D,
56
- autoContentType: x
56
+ filePath: z,
57
+ autoContentType: y
57
58
  };
58
59
  }
59
- const [_, G] = await X(c).run();
60
- if (_) return e.value = !1;
61
- const b = await oe(G.data);
62
- if ((b == null ? void 0 : b.statusCode) != 200) {
63
- e.value = !1, (z = window.DasMessage) == null || z.error({
64
- message: (b == null ? void 0 : b.errorMsg) || "上传失败",
60
+ const [G, Q] = await _(p).run();
61
+ if (G) return e.value = !1;
62
+ const x = await le(Q.data);
63
+ if ((x == null ? void 0 : x.statusCode) != 200) {
64
+ e.value = !1, (E = window.DasMessage) == null || E.error({
65
+ message: (x == null ? void 0 : x.errorMsg) || i("上传失败"),
65
66
  grouping: !0,
66
67
  repeatNum: 1
67
68
  });
68
69
  return;
69
70
  }
70
- const P = await (a == null ? void 0 : a(b));
71
+ const U = await (a == null ? void 0 : a(x));
71
72
  if (n) {
72
- if (!P.status) {
73
+ if (!U.status) {
73
74
  e.value = !1, s.value = "error";
74
75
  return;
75
76
  }
76
- o.value = "导入进度", e.value = !0, k(P.taskId, "import", "");
77
+ o.value = i("导入进度"), e.value = !0, k(U.taskId, "import", "");
77
78
  } else {
78
- if (!P.status) return;
79
- s.value = "success", (E = window.DasMessage) == null || E.success({
80
- message: "导入成功",
79
+ if (!U.status) return;
80
+ s.value = "success", (O = window.DasMessage) == null || O.success({
81
+ message: i("导入成功"),
81
82
  grouping: !0,
82
83
  repeatNum: 1
83
84
  });
84
85
  }
85
- }, J = async (a, r = "", l = "") => {
86
- s.value = "normal", i.value = 0, o.value = l || "导出进度", e.value = !0;
86
+ }, V = async (a, r = "", l = "") => {
87
+ s.value = "normal", u.value = 0, o.value = l || i("导出进度"), e.value = !0;
87
88
  const n = await (a == null ? void 0 : a());
88
89
  if (!n.status) {
89
90
  e.value = !1, s.value = "error";
90
91
  return;
91
92
  }
92
93
  k(n.taskId, "action", "");
93
- }, V = async (a, r = "", l = "", n = !0) => {
94
- n && (s.value = "normal", i.value = 0, o.value = "导出进度", e.value = !0);
95
- const u = await (a == null ? void 0 : a());
96
- if (!u.status) {
94
+ }, X = async (a, r = "", l = "", n = !0) => {
95
+ n && (s.value = "normal", u.value = 0, o.value = i("导出进度"), e.value = !0);
96
+ const c = await (a == null ? void 0 : a());
97
+ if (!c.status) {
97
98
  e.value = !1, s.value = "error";
98
99
  return;
99
100
  }
100
- Z().format("YYYYMMDDHHmmss") + "", k(u.taskId, "export", r || "", l);
101
+ F().format("YYYYMMDDHHmmss") + "", k(c.taskId, "export", r || "", l);
101
102
  }, k = async (a, r, l, n = "") => {
102
- d.value = !0, K(a, r, l, n), p = setTimeout(() => {
103
+ g.value = !0, S(a, r, l, n), m = setTimeout(() => {
103
104
  }, 50);
104
- }, I = () => {
105
- clearTimeout(p), p = null, e.value = !1;
106
- }, K = async (a, r = "export", l, n = "") => {
107
- var m, c;
108
- const [u, t] = await ae("", {
105
+ }, K = () => {
106
+ clearTimeout(m), m = null, e.value = !1;
107
+ }, S = async (a, r = "export", l, n = "") => {
108
+ var f, p;
109
+ const [c, t] = await re("", {
109
110
  url: `progress/${a}`
110
111
  }).run();
111
- if (u) {
112
- d.value = !1;
112
+ if (c) {
113
+ g.value = !1;
113
114
  return;
114
115
  }
115
- i.value = t.percentage;
116
- const v = r == "export" ? "导出" : "导入";
117
- if (i.value == 100)
118
- if (w.value = t, d.value = !1, I(), r == "export")
119
- t.status == 1 ? (s.value = "success", B(`${O().baseURL}/oss${t.filePath}`, l, n), d.value = !1) : t.status == 2 && (h.value = t.message || `${v}失败`, (m = window.DasMessage) == null || m.error({
120
- message: t.message || `${v}失败`,
116
+ u.value = t.percentage;
117
+ const d = r == "export" ? i("导出") : i("导入");
118
+ if (u.value == 100)
119
+ if (h.value = t, g.value = !1, K(), r == "export")
120
+ t.status == 1 ? (s.value = "success", H(`${B().baseURL}/oss${t.filePath}`, l, n), g.value = !1) : t.status == 2 && (b.value = t.message || `${d}${i("失败")}`, (f = window.DasMessage) == null || f.error({
121
+ message: t.message || `${d}${i("失败")}`,
121
122
  grouping: !0,
122
123
  repeatNum: 1
123
124
  }));
124
125
  else if (r == "import") {
125
126
  if (t.filePath) {
126
- s.value = "error", T.value = !0;
127
- let x = await W(`/oss/${t == null ? void 0 : t.filePath}`);
128
- const j = ((c = x == null ? void 0 : x.split("/")) == null ? void 0 : c.pop()) || "";
129
- g.value = L || j, y.value = N.sizeText, h.value = "部分数据校验不通过,请下载附件并修改,重新导入!", R.value = `${O().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
127
+ s.value = "error", $.value = !0;
128
+ let y = await Z(`/oss/${t == null ? void 0 : t.filePath}`);
129
+ const j = ((p = y == null ? void 0 : y.split("/")) == null ? void 0 : p.pop()) || "";
130
+ w.value = P || j, T.value = A.sizeText, b.value = i("部分数据校验不通过,请下载附件并修改,重新导入!"), L.value = `${B().baseURL}/oss/${t == null ? void 0 : t.filePath}`;
130
131
  }
131
- S(t.status, v, t.message);
132
+ D(t.status, d, t.message);
132
133
  } else r == "action" && (s.value = "success");
133
134
  else
134
- p && t.status != 2 ? p = setTimeout(() => {
135
- K(a, r, l, n);
136
- }, 50) : (w.value = t, d.value = !1, S(t.status, v, t.message), I(), T.value = !0, h.value = (t == null ? void 0 : t.message) || "");
137
- }, S = (a, r, l) => {
138
- var n, u, t;
135
+ m && t.status != 2 ? m = setTimeout(() => {
136
+ S(a, r, l, n);
137
+ }, 50) : (h.value = t, g.value = !1, D(t.status, d, t.message), K(), $.value = !0, b.value = (t == null ? void 0 : t.message) || "");
138
+ }, D = (a, r, l) => {
139
+ var n, c, t;
139
140
  a == 1 ? (s.value = "success", (n = window.DasMessage) == null || n.success({
140
- message: `${r}成功`,
141
+ message: `${r}${i("成功")}`,
141
142
  grouping: !0,
142
143
  repeatNum: 1
143
- }), g.value = "", y.value = "", h.value = "") : a == 2 ? (s.value = "error", (u = window.DasMessage) == null || u.error({
144
- message: l || `${r}失败`,
144
+ }), w.value = "", T.value = "", b.value = "") : a == 2 ? (s.value = "error", (c = window.DasMessage) == null || c.error({
145
+ message: l || `${r}${i("失败")}`,
145
146
  grouping: !0,
146
147
  repeatNum: 1
147
- }), h.value = l || "部分数据校验不通过,请下载附件并修改,重新导入!") : a == 3 && (s.value = "error", (t = window.DasMessage) == null || t.error({
148
- message: `部分${r}失败`,
148
+ }), b.value = l || i("部分数据校验不通过,请下载附件并修改,重新导入!")) : a == 3 && (s.value = "error", (t = window.DasMessage) == null || t.error({
149
+ message: `${i("部分")}${r}${i("失败")}`,
149
150
  grouping: !0,
150
151
  repeatNum: 1
151
152
  }));
@@ -153,27 +154,27 @@ const ee = C.get("token"), te = C.post("put-object", (e) => (e.headers || (e.hea
153
154
  return {
154
155
  showProgressDialog: e,
155
156
  progressTitle: o,
156
- percent: i,
157
+ percent: u,
157
158
  progressStatus: s,
158
- progressLoading: d,
159
- progressResult: w,
160
- errorFileName: g,
161
- errorFileSize: y,
162
- errorMessage: h,
163
- errorImport: T,
164
- errorFilePath: R,
165
- fileImport: Y,
166
- fileExport: V,
167
- fileAction: J,
159
+ progressLoading: g,
160
+ progressResult: h,
161
+ errorFileName: w,
162
+ errorFileSize: T,
163
+ errorMessage: b,
164
+ errorImport: $,
165
+ errorFilePath: L,
166
+ fileImport: J,
167
+ fileExport: X,
168
+ fileAction: V,
168
169
  generateUniqueName: (a) => {
169
170
  const r = a == null ? void 0 : a.match(/(.*?)(\.[^.]*$|$)/), l = r.length ? r[2] : "";
170
- return `${r.length ? r[1] : a}${F()}${l}`;
171
+ return `${r.length ? r[1] : a}${ee()}${l}`;
171
172
  },
172
- downloadFile: B,
173
- resetStataus: H,
173
+ downloadFile: H,
174
+ resetStataus: q,
174
175
  checkProgress: k
175
176
  };
176
- }, re = (e) => {
177
+ }, oe = (e) => {
177
178
  let o = e == null ? void 0 : e.toLocaleLowerCase();
178
179
  return {
179
180
  excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -202,27 +203,27 @@ const ee = C.get("token"), te = C.post("put-object", (e) => (e.headers || (e.hea
202
203
  der: "application/x-x509-ca-cert",
203
204
  cer: "application/pkix-cert"
204
205
  }[o];
205
- }, B = (e, o, i = "excel") => {
206
+ }, H = (e, o, u = "excel") => {
206
207
  const s = new XMLHttpRequest();
207
- s.open("get", e), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(d) {
208
- const p = new Blob([this.response], {
209
- type: re(i)
210
- }), w = URL.createObjectURL(p);
208
+ s.open("get", e), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(g) {
209
+ const m = new Blob([this.response], {
210
+ type: oe(u)
211
+ }), h = URL.createObjectURL(m);
211
212
  if (window.navigator.msSaveOrOpenBlob)
212
- navigator.msSaveBlob(p, o);
213
+ navigator.msSaveBlob(m, o);
213
214
  else {
214
- const g = document.createElement("a");
215
- g.href = w, g.download = o, g.click(), window.URL.revokeObjectURL(w);
215
+ const w = document.createElement("a");
216
+ w.href = h, w.download = o, w.click(), window.URL.revokeObjectURL(h);
216
217
  }
217
218
  }, s.send();
218
- }, oe = (e) => new Promise((o, i) => {
219
+ }, le = (e) => new Promise((o, u) => {
219
220
  var s = new FileReader();
220
- s.onload = function(d) {
221
- let p = "";
222
- typeof s.result == "string" && (p = JSON.parse(s.result)), o(p);
221
+ s.onload = function(g) {
222
+ let m = "";
223
+ typeof s.result == "string" && (m = JSON.parse(s.result)), o(m);
223
224
  }, s.readAsText(e);
224
225
  });
225
226
  export {
226
- B as downloadFile,
227
- me as useFile
227
+ H as downloadFile,
228
+ ve as useFile
228
229
  };