@das-fed/utils 6.4.0-dev.53 → 6.4.0-dev.54.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 +59 -46
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +156 -143
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +200 -187
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +156 -143
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +200 -187
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +156 -143
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +200 -187
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +59 -46
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +200 -187
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +59 -46
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +156 -143
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +199 -186
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +156 -143
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +156 -143
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +200 -187
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +161 -148
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +200 -187
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +156 -143
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +199 -186
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +156 -143
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +156 -143
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +200 -187
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +200 -187
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +200 -187
- package/api-services/src/create-service/index.js.gz +0 -0
- package/create-api-service/index.js +200 -187
- package/create-api-service/index.js.gz +0 -0
- package/package.json +4 -4
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setI18nRule as jn, t as
|
|
1
|
+
import { setI18nRule as jn, t as C } from "@das-fed/web/packages/i18n/index";
|
|
2
2
|
import { curringHttp as qn } from "@das-fed/utils/curring-http";
|
|
3
3
|
import { getToken as zn, getQuery as Hn, login as Wn, getTokenParams as Kn, real_uri as Gn } from "@das-fed/utils/create-api-service/sso";
|
|
4
4
|
import Ze from "dayjs";
|
|
@@ -2844,7 +2844,7 @@ var Pn = Ae, Oe = Ti, as = ki, is = De, Ue = Pn("%WeakMap%", !0), Me = Pn("%Map%
|
|
|
2844
2844
|
}
|
|
2845
2845
|
var d = i.join(r.delimiter), g = r.addQueryPrefix === !0 ? "?" : "";
|
|
2846
2846
|
return r.charsetSentinel && (r.charset === "iso-8859-1" ? g += "utf8=%26%2310003%3B&" : g += "utf8=%E2%9C%93&"), d.length > 0 ? g + d : "";
|
|
2847
|
-
}, we = xn, Ut = Object.prototype.hasOwnProperty, Ls = Array.isArray,
|
|
2847
|
+
}, we = xn, Ut = Object.prototype.hasOwnProperty, Ls = Array.isArray, N = {
|
|
2848
2848
|
allowDots: !1,
|
|
2849
2849
|
allowEmptyArrays: !1,
|
|
2850
2850
|
allowPrototypes: !1,
|
|
@@ -2881,10 +2881,10 @@ var Pn = Ae, Oe = Ti, as = ki, is = De, Ue = Pn("%WeakMap%", !0), Me = Pn("%Map%
|
|
|
2881
2881
|
for (u = 0; u < i.length; ++u)
|
|
2882
2882
|
if (u !== s) {
|
|
2883
2883
|
var c = i[u], p = c.indexOf("]="), d = p === -1 ? c.indexOf("=") : p + 1, g, y;
|
|
2884
|
-
d === -1 ? (g = n.decoder(c,
|
|
2884
|
+
d === -1 ? (g = n.decoder(c, N.decoder, l, "key"), y = n.strictNullHandling ? null : "") : (g = n.decoder(c.slice(0, d), N.decoder, l, "key"), y = we.maybeMap(
|
|
2885
2885
|
Fn(c.slice(d + 1), n),
|
|
2886
2886
|
function(m) {
|
|
2887
|
-
return n.decoder(m,
|
|
2887
|
+
return n.decoder(m, N.decoder, l, "value");
|
|
2888
2888
|
}
|
|
2889
2889
|
)), y && n.interpretNumericEntities && l === "iso-8859-1" && (y = Us(y)), c.indexOf("[]=") > -1 && (y = Ls(y) ? [y] : y);
|
|
2890
2890
|
var h = Ut.call(r, g);
|
|
@@ -2926,7 +2926,7 @@ var Pn = Ae, Oe = Ti, as = ki, is = De, Ue = Pn("%WeakMap%", !0), Me = Pn("%Map%
|
|
|
2926
2926
|
}
|
|
2927
2927
|
}, Hs = function(e) {
|
|
2928
2928
|
if (!e)
|
|
2929
|
-
return
|
|
2929
|
+
return N;
|
|
2930
2930
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
2931
2931
|
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
2932
2932
|
if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
|
|
@@ -2935,32 +2935,32 @@ var Pn = Ae, Oe = Ti, as = ki, is = De, Ue = Pn("%WeakMap%", !0), Me = Pn("%Map%
|
|
|
2935
2935
|
throw new TypeError("Decoder has to be a function.");
|
|
2936
2936
|
if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
|
|
2937
2937
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
2938
|
-
var n = typeof e.charset > "u" ?
|
|
2938
|
+
var n = typeof e.charset > "u" ? N.charset : e.charset, r = typeof e.duplicates > "u" ? N.duplicates : e.duplicates;
|
|
2939
2939
|
if (r !== "combine" && r !== "first" && r !== "last")
|
|
2940
2940
|
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
2941
|
-
var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 :
|
|
2941
|
+
var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : N.allowDots : !!e.allowDots;
|
|
2942
2942
|
return {
|
|
2943
2943
|
allowDots: o,
|
|
2944
|
-
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays :
|
|
2945
|
-
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes :
|
|
2946
|
-
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse :
|
|
2947
|
-
arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit :
|
|
2944
|
+
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : N.allowEmptyArrays,
|
|
2945
|
+
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : N.allowPrototypes,
|
|
2946
|
+
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : N.allowSparse,
|
|
2947
|
+
arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : N.arrayLimit,
|
|
2948
2948
|
charset: n,
|
|
2949
|
-
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel :
|
|
2950
|
-
comma: typeof e.comma == "boolean" ? e.comma :
|
|
2951
|
-
decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys :
|
|
2952
|
-
decoder: typeof e.decoder == "function" ? e.decoder :
|
|
2953
|
-
delimiter: typeof e.delimiter == "string" || we.isRegExp(e.delimiter) ? e.delimiter :
|
|
2949
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : N.charsetSentinel,
|
|
2950
|
+
comma: typeof e.comma == "boolean" ? e.comma : N.comma,
|
|
2951
|
+
decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : N.decodeDotInKeys,
|
|
2952
|
+
decoder: typeof e.decoder == "function" ? e.decoder : N.decoder,
|
|
2953
|
+
delimiter: typeof e.delimiter == "string" || we.isRegExp(e.delimiter) ? e.delimiter : N.delimiter,
|
|
2954
2954
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2955
|
-
depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth :
|
|
2955
|
+
depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : N.depth,
|
|
2956
2956
|
duplicates: r,
|
|
2957
2957
|
ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
|
|
2958
|
-
interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities :
|
|
2959
|
-
parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit :
|
|
2958
|
+
interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : N.interpretNumericEntities,
|
|
2959
|
+
parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : N.parameterLimit,
|
|
2960
2960
|
parseArrays: e.parseArrays !== !1,
|
|
2961
|
-
plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects :
|
|
2962
|
-
strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth :
|
|
2963
|
-
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling :
|
|
2961
|
+
plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : N.plainObjects,
|
|
2962
|
+
strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : N.strictDepth,
|
|
2963
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : N.strictNullHandling
|
|
2964
2964
|
};
|
|
2965
2965
|
}, Ws = function(t, e) {
|
|
2966
2966
|
var n = Hs(e);
|
|
@@ -3070,18 +3070,31 @@ const Dn = Ke(), In = Dn.sso ?? !0, _n = Dn.noRedireLogin ?? !1, Bn = () => {
|
|
|
3070
3070
|
}, tl = async (t, e) => {
|
|
3071
3071
|
var u, l, c, p, d;
|
|
3072
3072
|
let n = ((u = t.response) == null ? void 0 : u.status) || 500, r = (l = t.response) == null ? void 0 : l.message, o = {};
|
|
3073
|
-
const a = { 400:
|
|
3073
|
+
const a = { 400: C("参数校验错误"), 404: C("接口地址未找到"), 500: C("服务器内部错误") };
|
|
3074
3074
|
let i = ((c = t == null ? void 0 : t.response) == null ? void 0 : c.data) || {};
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3075
|
+
if (!(Hn("code") || "") && !_n && (n === 401 || (i == null ? void 0 : i.code) === 401))
|
|
3076
|
+
In ? Wn({ ...Kn, redirect_uri: Gn }) : Bn(), o = i;
|
|
3077
|
+
else {
|
|
3078
|
+
if (t.response) {
|
|
3079
|
+
if (i instanceof Blob && (i = await new Promise((g) => {
|
|
3080
|
+
const y = new FileReader();
|
|
3081
|
+
y.readAsText(i, "utf-8"), y.onload = () => {
|
|
3082
|
+
try {
|
|
3083
|
+
g(JSON.parse(y.result || "{}"));
|
|
3084
|
+
} catch {
|
|
3085
|
+
g({ code: 400, msg: C("blob解析错误") });
|
|
3086
|
+
}
|
|
3087
|
+
};
|
|
3088
|
+
})), i.code) {
|
|
3089
|
+
n = i.code;
|
|
3090
|
+
const g = (i == null ? void 0 : i.status) ?? "错误提示";
|
|
3091
|
+
r = !(i != null && i.data) || !i.data.length ? C(g) : C(g, ...i.data), o = i;
|
|
3082
3092
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3093
|
+
r || (r = a[t.response.status] || t.message);
|
|
3094
|
+
} else t.request ? t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = C("网络异常,请检查您的网络情况") : t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = C("请求配置异常");
|
|
3095
|
+
e != null && e.customErrorMessage && (r = e == null ? void 0 : e.customErrorMessage(r, t)), !(e != null && e.ignoreErrorMessage) && r && ((d = (p = window.DasMessage) == null ? void 0 : p.error) == null || d.call(p, { message: r, showClose: !0 }));
|
|
3096
|
+
}
|
|
3097
|
+
return { ...o, code: n, msg: r, error: t };
|
|
3085
3098
|
}, b = (t, e) => {
|
|
3086
3099
|
const n = I.create();
|
|
3087
3100
|
return qn(n, async (r) => {
|
|
@@ -3156,7 +3169,7 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3156
3169
|
O(k);
|
|
3157
3170
|
}), P = async (E, O, $, T = !0, F = "", w = !1) => {
|
|
3158
3171
|
var tr, rr;
|
|
3159
|
-
d = F, g.value = "import", T && (r.value = "normal", n.value = 0, e.value =
|
|
3172
|
+
d = F, g.value = "import", T && (r.value = "normal", n.value = 0, e.value = C("导入进度"), t.value = !0, i.value = ""), y = O;
|
|
3160
3173
|
const k = await m();
|
|
3161
3174
|
if (!k.status) return;
|
|
3162
3175
|
let j = k.data, q = null, { autoContentType: ee, bucketName: te, importFileName: er } = $;
|
|
@@ -3188,7 +3201,7 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3188
3201
|
const ie = await yl(kn.data);
|
|
3189
3202
|
if ((ie == null ? void 0 : ie.statusCode) != 200) {
|
|
3190
3203
|
t.value = !1, (tr = window.DasMessage) == null || tr.error({
|
|
3191
|
-
message: (ie == null ? void 0 : ie.errorMsg) ||
|
|
3204
|
+
message: (ie == null ? void 0 : ie.errorMsg) || C("上传失败"),
|
|
3192
3205
|
grouping: !0,
|
|
3193
3206
|
repeatNum: 1
|
|
3194
3207
|
});
|
|
@@ -3200,17 +3213,17 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3200
3213
|
t.value = !1, r.value = "error";
|
|
3201
3214
|
return;
|
|
3202
3215
|
}
|
|
3203
|
-
e.value =
|
|
3216
|
+
e.value = C("导入进度"), t.value = !0, x(it.taskId, "import", "");
|
|
3204
3217
|
} else {
|
|
3205
3218
|
if (!it.status) return;
|
|
3206
3219
|
r.value = "success", (rr = window.DasMessage) == null || rr.success({
|
|
3207
|
-
message:
|
|
3220
|
+
message: C("导入成功"),
|
|
3208
3221
|
grouping: !0,
|
|
3209
3222
|
repeatNum: 1
|
|
3210
3223
|
});
|
|
3211
3224
|
}
|
|
3212
3225
|
}, v = async (E, O = "", $ = "") => {
|
|
3213
|
-
r.value = "normal", n.value = 0, e.value = $ ||
|
|
3226
|
+
r.value = "normal", n.value = 0, e.value = $ || C("导出进度"), t.value = !0;
|
|
3214
3227
|
const T = await (E == null ? void 0 : E());
|
|
3215
3228
|
if (!T.status) {
|
|
3216
3229
|
t.value = !1, r.value = "error";
|
|
@@ -3218,7 +3231,7 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3218
3231
|
}
|
|
3219
3232
|
x(T.taskId, "action", "");
|
|
3220
3233
|
}, D = async (E, O = "", $ = "", T = !0) => {
|
|
3221
|
-
g.value = "export", T && (r.value = "normal", n.value = 0, e.value =
|
|
3234
|
+
g.value = "export", T && (r.value = "normal", n.value = 0, e.value = C("导出进度"), t.value = !0);
|
|
3222
3235
|
const F = await (E == null ? void 0 : E());
|
|
3223
3236
|
if (!F.status) {
|
|
3224
3237
|
t.value = !1, r.value = "error";
|
|
@@ -3240,11 +3253,11 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3240
3253
|
return;
|
|
3241
3254
|
}
|
|
3242
3255
|
n.value = w.percentage;
|
|
3243
|
-
const k = O == "export" ?
|
|
3256
|
+
const k = O == "export" ? C("导出") : C("导入");
|
|
3244
3257
|
if (n.value == 100)
|
|
3245
3258
|
if (i.value = w, o.value = !1, L(), O == "export")
|
|
3246
|
-
w.status == 1 ? (r.value = "success", jr(`${Ke().baseURL}/oss${w.filePath}`, $, T), o.value = !1) : w.status == 2 && (l.value = w.message || `${k}${
|
|
3247
|
-
message: w.message || `${k}${
|
|
3259
|
+
w.status == 1 ? (r.value = "success", jr(`${Ke().baseURL}/oss${w.filePath}`, $, T), o.value = !1) : w.status == 2 && (l.value = w.message || `${k}${C("失败")}`, (j = window.DasMessage) == null || j.error({
|
|
3260
|
+
message: w.message || `${k}${C("失败")}`,
|
|
3248
3261
|
grouping: !0,
|
|
3249
3262
|
repeatNum: 1
|
|
3250
3263
|
}));
|
|
@@ -3253,7 +3266,7 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3253
3266
|
r.value = "error", c.value = !0;
|
|
3254
3267
|
let ee = await Zn(`/oss/${w == null ? void 0 : w.filePath}`);
|
|
3255
3268
|
const te = ((q = ee == null ? void 0 : ee.split("/")) == null ? void 0 : q.pop()) || "";
|
|
3256
|
-
s.value = d || te, u.value = y.sizeText, l.value =
|
|
3269
|
+
s.value = d || te, u.value = y.sizeText, l.value = C("部分数据校验不通过,请下载附件并修改,重新导入!"), p.value = `${Ke().baseURL}/oss/${w == null ? void 0 : w.filePath}`;
|
|
3257
3270
|
}
|
|
3258
3271
|
K(w.status, k, w.message);
|
|
3259
3272
|
} else O == "action" && (r.value = "success");
|
|
@@ -3264,15 +3277,15 @@ const cl = Yt.get("token"), ul = Yt.post("put-object", (t) => (t.headers || (t.h
|
|
|
3264
3277
|
}, K = (E, O, $) => {
|
|
3265
3278
|
var T, F, w;
|
|
3266
3279
|
E == 1 ? (r.value = "success", (T = window.DasMessage) == null || T.success({
|
|
3267
|
-
message: `${O}${
|
|
3280
|
+
message: `${O}${C("成功")}`,
|
|
3268
3281
|
grouping: !0,
|
|
3269
3282
|
repeatNum: 1
|
|
3270
3283
|
}), s.value = "", u.value = "", l.value = "") : E == 2 ? (r.value = "error", (F = window.DasMessage) == null || F.error({
|
|
3271
|
-
message: $ || `${O}${
|
|
3284
|
+
message: $ || `${O}${C("失败")}`,
|
|
3272
3285
|
grouping: !0,
|
|
3273
3286
|
repeatNum: 1
|
|
3274
|
-
}), l.value = $ ||
|
|
3275
|
-
message: `${
|
|
3287
|
+
}), l.value = $ || C("部分数据校验不通过,请下载附件并修改,重新导入!")) : E == 3 && (r.value = "error", (w = window.DasMessage) == null || w.error({
|
|
3288
|
+
message: `${C("部分")}${O}${C("失败")}`,
|
|
3276
3289
|
grouping: !0,
|
|
3277
3290
|
repeatNum: 1
|
|
3278
3291
|
}));
|
|
Binary file
|