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