@das-fed/utils 6.4.0-hot.21 → 6.4.0-hot.23
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.
- package/api-services/index.js +985 -984
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +725 -724
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +725 -724
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +728 -727
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +725 -724
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +729 -728
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +725 -724
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +119 -118
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +725 -724
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +985 -984
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +730 -729
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +726 -725
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +725 -724
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +725 -724
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +725 -724
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +728 -727
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +725 -724
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +725 -724
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +728 -727
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +727 -726
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +725 -724
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +725 -724
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +725 -724
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +724 -723
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +104 -104
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/common-tools/get-url-params/index.js.gz +0 -0
- package/create-api-service/index.js +724 -723
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js.gz +0 -0
- package/curring-http/type.d.ts +87 -87
- package/directive/auth/index.js.gz +0 -0
- package/hooks/use-get-auth/index.js.gz +0 -0
- package/nextTiken/index.js.gz +0 -0
- package/package.json +4 -3
- package/pinyin-first-character/index.js.gz +0 -0
- package/style/index.js.gz +0 -0
- package/token-tools/index.js.gz +0 -0
- package/use-low-code/index.js +3 -3
- package/use-low-code/index.js.gz +0 -0
- package/use-low-code/style.css +1 -1
- package/webSocket-service/index.js.gz +0 -0
- package/webSocket-service/type.d.ts +28 -28
|
Binary file
|
|
@@ -1,151 +1,152 @@
|
|
|
1
|
-
import { iotMinio as
|
|
2
|
-
import { extractFilename as
|
|
3
|
-
import { ref as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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 =
|
|
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
|
|
15
|
-
let e =
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
const [a, r] = await
|
|
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
|
-
},
|
|
22
|
-
const
|
|
22
|
+
}, I = (a) => new Promise((r, l) => {
|
|
23
|
+
const c = [];
|
|
23
24
|
let t = 0;
|
|
24
25
|
for (; t < a.size; ) {
|
|
25
|
-
const
|
|
26
|
-
|
|
26
|
+
const f = a.slice(t, t + 1048576);
|
|
27
|
+
c.push(f), t += 1048576;
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
-
r(
|
|
30
|
-
}),
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
let
|
|
36
|
-
const
|
|
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
|
|
41
|
-
M.push(
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
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
|
|
49
|
-
|
|
50
|
-
accessKeyId:
|
|
51
|
-
secretAccessKey:
|
|
52
|
-
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:
|
|
56
|
-
autoContentType:
|
|
56
|
+
filePath: z,
|
|
57
|
+
autoContentType: y
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
const [
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
if ((
|
|
63
|
-
e.value = !1, (
|
|
64
|
-
message: (
|
|
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
|
|
71
|
+
const U = await (a == null ? void 0 : a(x));
|
|
71
72
|
if (n) {
|
|
72
|
-
if (!
|
|
73
|
+
if (!U.status) {
|
|
73
74
|
e.value = !1, s.value = "error";
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
o.value = "导入进度", e.value = !0, k(
|
|
77
|
+
o.value = i("导入进度"), e.value = !0, k(U.taskId, "import", "");
|
|
77
78
|
} else {
|
|
78
|
-
if (!
|
|
79
|
-
s.value = "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
|
-
},
|
|
86
|
-
s.value = "normal",
|
|
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
|
-
},
|
|
94
|
-
n && (s.value = "normal",
|
|
95
|
-
const
|
|
96
|
-
if (!
|
|
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
|
-
|
|
101
|
+
F().format("YYYYMMDDHHmmss") + "", k(c.taskId, "export", r || "", l);
|
|
101
102
|
}, k = async (a, r, l, n = "") => {
|
|
102
|
-
|
|
103
|
+
g.value = !0, S(a, r, l, n), m = setTimeout(() => {
|
|
103
104
|
}, 50);
|
|
104
|
-
},
|
|
105
|
-
clearTimeout(
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
const [
|
|
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 (
|
|
112
|
-
|
|
112
|
+
if (c) {
|
|
113
|
+
g.value = !1;
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
if (
|
|
119
|
-
t.status == 1 ? (s.value = "success",
|
|
120
|
-
message: t.message || `${
|
|
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",
|
|
127
|
-
let
|
|
128
|
-
const j = ((
|
|
129
|
-
|
|
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
|
-
|
|
132
|
+
D(t.status, d, t.message);
|
|
132
133
|
} else r == "action" && (s.value = "success");
|
|
133
134
|
else
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, 50) : (
|
|
137
|
-
},
|
|
138
|
-
var n,
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
148
|
-
message:
|
|
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:
|
|
157
|
+
percent: u,
|
|
157
158
|
progressStatus: s,
|
|
158
|
-
progressLoading:
|
|
159
|
-
progressResult:
|
|
160
|
-
errorFileName:
|
|
161
|
-
errorFileSize:
|
|
162
|
-
errorMessage:
|
|
163
|
-
errorImport:
|
|
164
|
-
errorFilePath:
|
|
165
|
-
fileImport:
|
|
166
|
-
fileExport:
|
|
167
|
-
fileAction:
|
|
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}${
|
|
171
|
+
return `${r.length ? r[1] : a}${ee()}${l}`;
|
|
171
172
|
},
|
|
172
|
-
downloadFile:
|
|
173
|
-
resetStataus:
|
|
173
|
+
downloadFile: H,
|
|
174
|
+
resetStataus: q,
|
|
174
175
|
checkProgress: k
|
|
175
176
|
};
|
|
176
|
-
},
|
|
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
|
-
},
|
|
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(
|
|
208
|
-
const
|
|
209
|
-
type:
|
|
210
|
-
}),
|
|
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(
|
|
213
|
+
navigator.msSaveBlob(m, o);
|
|
213
214
|
else {
|
|
214
|
-
const
|
|
215
|
-
|
|
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
|
-
},
|
|
219
|
+
}, le = (e) => new Promise((o, u) => {
|
|
219
220
|
var s = new FileReader();
|
|
220
|
-
s.onload = function(
|
|
221
|
-
let
|
|
222
|
-
typeof s.result == "string" && (
|
|
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
|
-
|
|
227
|
-
|
|
227
|
+
H as downloadFile,
|
|
228
|
+
ve as useFile
|
|
228
229
|
};
|
|
Binary file
|