@das-fed/utils 7.0.0-zhaohang.4 → 7.0.0-zhaohang.5
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 +88 -84
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +705 -683
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +39 -35
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +735 -713
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +39 -35
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +38 -34
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +39 -35
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +114 -110
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +687 -701
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +88 -84
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +689 -703
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +704 -686
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +705 -683
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +39 -35
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +39 -35
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +42 -38
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +39 -35
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +639 -639
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +698 -712
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +734 -712
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +39 -35
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +705 -683
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +703 -685
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +38 -34
- package/api-services/src/create-service/index.js.gz +0 -0
- package/create-api-service/index.js +704 -682
- package/create-api-service/index.js.gz +0 -0
- package/curring-http/index.js +1 -1
- package/curring-http/index.js.gz +0 -0
- package/package.json +4 -4
|
Binary file
|
|
@@ -1688,22 +1688,22 @@ N.getAdapter = $n.getAdapter;
|
|
|
1688
1688
|
N.HttpStatusCode = Kt;
|
|
1689
1689
|
N.default = N;
|
|
1690
1690
|
const {
|
|
1691
|
-
Axios:
|
|
1692
|
-
AxiosError:
|
|
1693
|
-
CanceledError:
|
|
1694
|
-
isCancel:
|
|
1695
|
-
CancelToken:
|
|
1696
|
-
VERSION:
|
|
1697
|
-
all:
|
|
1698
|
-
Cancel:
|
|
1699
|
-
isAxiosError:
|
|
1700
|
-
spread:
|
|
1701
|
-
toFormData:
|
|
1702
|
-
AxiosHeaders:
|
|
1703
|
-
HttpStatusCode:
|
|
1704
|
-
formToJSON:
|
|
1705
|
-
getAdapter:
|
|
1706
|
-
mergeConfig:
|
|
1691
|
+
Axios: Lc,
|
|
1692
|
+
AxiosError: Bc,
|
|
1693
|
+
CanceledError: Uc,
|
|
1694
|
+
isCancel: kc,
|
|
1695
|
+
CancelToken: jc,
|
|
1696
|
+
VERSION: qc,
|
|
1697
|
+
all: Hc,
|
|
1698
|
+
Cancel: zc,
|
|
1699
|
+
isAxiosError: Wc,
|
|
1700
|
+
spread: Gc,
|
|
1701
|
+
toFormData: Kc,
|
|
1702
|
+
AxiosHeaders: Jc,
|
|
1703
|
+
HttpStatusCode: Vc,
|
|
1704
|
+
formToJSON: Qc,
|
|
1705
|
+
getAdapter: Xc,
|
|
1706
|
+
mergeConfig: Yc
|
|
1707
1707
|
} = N;
|
|
1708
1708
|
var Cr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1709
1709
|
function ti(t) {
|
|
@@ -3202,26 +3202,30 @@ const ao = ur.noRedireLogin ?? !1, io = () => {
|
|
|
3202
3202
|
if (ao) return;
|
|
3203
3203
|
const t = "/login";
|
|
3204
3204
|
location.pathname !== t && (sessionStorage.clear(), window.__isAutoCloseApp = !1, location.replace(t));
|
|
3205
|
-
}, an = "SUC0000", Zl = async (t) => {
|
|
3206
|
-
var i, s, u, l, c
|
|
3205
|
+
}, an = "SUC0000", Zl = "AUM0020401", ec = async (t) => {
|
|
3206
|
+
var a, i, s, u, l, c;
|
|
3207
3207
|
let e = t.data || {};
|
|
3208
3208
|
const n = (e == null ? void 0 : e.returnCode) || an;
|
|
3209
|
-
let r =
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
}
|
|
3209
|
+
let r = {};
|
|
3210
|
+
if (n !== an) {
|
|
3211
|
+
let p = e.errorMsg ?? "";
|
|
3212
|
+
return !(ho("code") || "") && !ao && n === Zl ? (oo ? go({ ...wo, redirect_uri: vo }) : io(), r = e) : (e instanceof Blob && (e = await new Promise((g) => {
|
|
3213
|
+
const y = new FileReader();
|
|
3214
|
+
y.readAsText(e, "utf-8"), y.onload = () => {
|
|
3215
|
+
try {
|
|
3216
|
+
g(JSON.parse(y.result || "{}"));
|
|
3217
|
+
} catch {
|
|
3218
|
+
g({ code: 400, msg: D("blob解析错误") });
|
|
3219
|
+
}
|
|
3220
|
+
};
|
|
3221
|
+
})), r = e), (a = t.config) != null && a.customErrorMessage && (p = (i = t.config) == null ? void 0 : i.customErrorMessage(p, n)), !((s = t.config) != null && s.ignoreErrorMessage) && p && ((l = (u = window.DasMessage) == null ? void 0 : u.error) == null || l.call(u, { message: p, showClose: !0 })), { data: r, code: n, msg: p };
|
|
3222
|
+
}
|
|
3223
|
+
return ((c = t.config) == null ? void 0 : c.responseType) === "blob" ? t : { data: t.data ?? {}, code: n };
|
|
3224
|
+
}, tc = async (t, e) => {
|
|
3221
3225
|
var o, a, i, s;
|
|
3222
3226
|
let n = ((o = t == null ? void 0 : t.response) == null ? void 0 : o.data) || {}, r = (a = t.response) == null ? void 0 : a.message;
|
|
3223
3227
|
if (!t.response)
|
|
3224
|
-
return t.request ? t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = D("网络异常,请检查您的网络情况") : t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = D("请求配置异常"), !(e != null && e.ignoreErrorMessage) && r && ((s = (i = window.DasMessage) == null ? void 0 : i.error) == null || s.call(i, { message: r, showClose: !0 })), {
|
|
3228
|
+
return t.request ? t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = D("网络异常,请检查您的网络情况") : t.code === "ERR_CANCELED" ? t.abortReason && (r = t.abortReason) : r = D("请求配置异常"), !(e != null && e.ignoreErrorMessage) && r && ((s = (i = window.DasMessage) == null ? void 0 : i.error) == null || s.call(i, { message: r, showClose: !0 })), { data: n, code: t.code, msg: r, error: t };
|
|
3225
3229
|
}, b = (t, e) => {
|
|
3226
3230
|
const n = N.create();
|
|
3227
3231
|
return yo(n, async (r) => {
|
|
@@ -3234,7 +3238,7 @@ const ao = ur.noRedireLogin ?? !1, io = () => {
|
|
|
3234
3238
|
}
|
|
3235
3239
|
oo ? l || (l = await mo(r)) : (l || (l = Oo()), l || io()), l && !r.headers.Authorization && (r.headers.Authorization = `Bearer ${l}`);
|
|
3236
3240
|
}
|
|
3237
|
-
r.baseURL || (r.baseURL = o.baseURL || ""), r.urlPrefix || (r.urlPrefix = t), r.paramsSerializer || (r.paramsSerializer = { serialize: (l) => Vl.stringify(l, { indices: !1 }) }), r.onSuccess || (r.onSuccess =
|
|
3241
|
+
r.baseURL || (r.baseURL = o.baseURL || ""), r.urlPrefix || (r.urlPrefix = t), r.paramsSerializer || (r.paramsSerializer = { serialize: (l) => Vl.stringify(l, { indices: !1 }) }), r.onSuccess || (r.onSuccess = ec), r.onError || (r.onError = tc), (r.csrf ?? !1) && (r.headers["csrf-token"] = Xl.get("csrf-token"));
|
|
3238
3242
|
const s = r.params || {};
|
|
3239
3243
|
if (s.project === void 0) {
|
|
3240
3244
|
let l = 0;
|
|
@@ -3247,11 +3251,11 @@ const ao = ur.noRedireLogin ?? !1, io = () => {
|
|
|
3247
3251
|
}
|
|
3248
3252
|
return r.params = s, r.headers.Timezone = rt.tz.guess(), r.headers["X-Origin"] = location.origin, r.headers["Accept-Language"] = po.value, r;
|
|
3249
3253
|
});
|
|
3250
|
-
},
|
|
3254
|
+
}, rc = "v1", Zc = b(`/api/app-manager/application/${rc}`), nc = "v1", eu = b(`/api/license/admin/${nc}`), oc = "v1", jt = `/api/bems/data-manage/${oc}`, tu = {
|
|
3251
3255
|
energyType: b(`${jt}/energy-type`),
|
|
3252
3256
|
energyObject: b(`${jt}/energy-object`),
|
|
3253
3257
|
energyDimension: b(`${jt}/energy-dimension`)
|
|
3254
|
-
},
|
|
3258
|
+
}, ac = "v1", ru = b(`/api/supply/contract/${ac}`), qe = "v1", nu = {
|
|
3255
3259
|
classes: b(`/api/duty-manage/classes/${qe}`),
|
|
3256
3260
|
// 班次管理
|
|
3257
3261
|
group: b(`/api/duty-manage/group/${qe}`),
|
|
@@ -3260,17 +3264,17 @@ const ao = ur.noRedireLogin ?? !1, io = () => {
|
|
|
3260
3264
|
// 排班管理
|
|
3261
3265
|
shift: b(`/api/duty-manage/shift/${qe}`)
|
|
3262
3266
|
// 交接班管理
|
|
3263
|
-
},
|
|
3267
|
+
}, ic = "v1", ou = b(`/api/enterpriseright/permission/${ic}`), V = "v1", au = b(`/api/iot/${V}`), iu = {
|
|
3264
3268
|
thingmodel: b(`/api/iot-device/thingmodel/${V}`),
|
|
3265
3269
|
deviceManage: b(`/api/iot-device/devicemanage/${V}`),
|
|
3266
3270
|
product: b(`/api/iot-device/product/${V}`),
|
|
3267
3271
|
productStorage: b(`/api/iot-device/product-storage/${V}`)
|
|
3268
|
-
},
|
|
3272
|
+
}, su = {
|
|
3269
3273
|
projectDevice: b(`/api/device-relation/deviceproject/${V}`),
|
|
3270
3274
|
deviceRules: b(`/api/device-relation/devicerule/${V}`),
|
|
3271
3275
|
project: b(`/api/device-relation/project/${V}`)
|
|
3272
|
-
}, fr = b(`/api/oss/minio/${V}`),
|
|
3273
|
-
let
|
|
3276
|
+
}, fr = b(`/api/oss/minio/${V}`), sc = b(`/api/progress/accessor/${V}`), lu = b(`/api/dms/analysis/${V}`);
|
|
3277
|
+
let lc = (t = 21) => {
|
|
3274
3278
|
let e = "", n = crypto.getRandomValues(new Uint8Array(t));
|
|
3275
3279
|
for (; t--; ) {
|
|
3276
3280
|
let r = n[t] & 63;
|
|
@@ -3278,12 +3282,12 @@ let sc = (t = 21) => {
|
|
|
3278
3282
|
}
|
|
3279
3283
|
return e;
|
|
3280
3284
|
};
|
|
3281
|
-
const
|
|
3285
|
+
const cc = fr.get("token"), uc = fr.post("put-object", (t) => (t.headers || (t.headers = {}), t.headers["Content-Type"] = "multipart/form-data", t.responseType = "blob", t)), fc = fr.post("upload-objects", (t) => (t.headers || (t.headers = {}), t.headers["Content-Type"] = "multipart/form-data", t.responseType = "blob", t)), pc = sc.get("progress"), cu = () => {
|
|
3282
3286
|
let t = K(!1), e = K(""), n = K(0), r = K("normal"), o = K(!1), a, i = K(""), s = K(""), u = K(""), l = K(""), c = K(!1), p = K(""), d = "", g = K(""), y;
|
|
3283
3287
|
const h = () => {
|
|
3284
3288
|
s.value = "", u.value = "", l.value = "", c.value = !1, p.value = "";
|
|
3285
3289
|
}, m = async () => {
|
|
3286
|
-
const [E, O] = await
|
|
3290
|
+
const [E, O] = await cc().run();
|
|
3287
3291
|
return E ? { stauts: !1 } : { status: !0, data: O };
|
|
3288
3292
|
}, A = (E) => new Promise((O, $) => {
|
|
3289
3293
|
const _ = [];
|
|
@@ -3300,7 +3304,7 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3300
3304
|
const H = await m();
|
|
3301
3305
|
if (!H.status) return;
|
|
3302
3306
|
let k = H.data, j = null, { autoContentType: G, bucketName: X, importFileName: Le } = $;
|
|
3303
|
-
const lo = w ?
|
|
3307
|
+
const lo = w ? fc : uc;
|
|
3304
3308
|
if (w) {
|
|
3305
3309
|
let oe = [];
|
|
3306
3310
|
await O.forEach(async (Be) => {
|
|
@@ -3325,7 +3329,7 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3325
3329
|
}
|
|
3326
3330
|
const [co, uo] = await lo(j).run();
|
|
3327
3331
|
if (co) return t.value = !1;
|
|
3328
|
-
const Y = await
|
|
3332
|
+
const Y = await yc(uo.data);
|
|
3329
3333
|
if (!w && (Y == null ? void 0 : Y.statusCode) != 200 || w && (Y != null && Y.some((oe) => (oe == null ? void 0 : oe.statusCode) != 200))) {
|
|
3330
3334
|
t.value = !1, (dr = window.DasMessage) == null || dr.error({
|
|
3331
3335
|
message: (Y == null ? void 0 : Y.errorMsg) || D("上传失败"),
|
|
@@ -3372,7 +3376,7 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3372
3376
|
clearTimeout(a), a = null, t.value = !1;
|
|
3373
3377
|
}, B = async (E, O = "export", $, T = "") => {
|
|
3374
3378
|
var H, k, j;
|
|
3375
|
-
const [_, w] = await
|
|
3379
|
+
const [_, w] = await pc("", {
|
|
3376
3380
|
url: `progress/${E}`
|
|
3377
3381
|
}).run();
|
|
3378
3382
|
if (_) {
|
|
@@ -3438,14 +3442,14 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3438
3442
|
fileAction: v,
|
|
3439
3443
|
generateUniqueName: (E) => {
|
|
3440
3444
|
const O = E == null ? void 0 : E.match(/(.*?)(\.[^.]*$|$)/), $ = O.length ? O[2] : "";
|
|
3441
|
-
return `${O.length ? O[1] : E}${
|
|
3445
|
+
return `${O.length ? O[1] : E}${lc()}${$}`;
|
|
3442
3446
|
},
|
|
3443
3447
|
downloadFile: sn,
|
|
3444
3448
|
resetStataus: h,
|
|
3445
3449
|
checkProgress: x,
|
|
3446
3450
|
fileHandleType: g
|
|
3447
3451
|
};
|
|
3448
|
-
},
|
|
3452
|
+
}, dc = (t) => {
|
|
3449
3453
|
let e = t == null ? void 0 : t.toLocaleLowerCase();
|
|
3450
3454
|
return {
|
|
3451
3455
|
excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
@@ -3478,7 +3482,7 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3478
3482
|
const r = new XMLHttpRequest();
|
|
3479
3483
|
r.open("get", t), r.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), r.responseType = "blob", r.onload = function(o) {
|
|
3480
3484
|
const a = new Blob([this.response], {
|
|
3481
|
-
type:
|
|
3485
|
+
type: dc(n)
|
|
3482
3486
|
}), i = URL.createObjectURL(a);
|
|
3483
3487
|
if (window.navigator.msSaveOrOpenBlob)
|
|
3484
3488
|
navigator.msSaveBlob(a, e);
|
|
@@ -3487,53 +3491,53 @@ const lc = fr.get("token"), cc = fr.post("put-object", (t) => (t.headers || (t.h
|
|
|
3487
3491
|
s.href = i, s.download = e, s.click(), window.URL.revokeObjectURL(i);
|
|
3488
3492
|
}
|
|
3489
3493
|
}, r.send();
|
|
3490
|
-
},
|
|
3494
|
+
}, yc = (t) => new Promise((e, n) => {
|
|
3491
3495
|
var r = new FileReader();
|
|
3492
3496
|
r.onload = function(o) {
|
|
3493
3497
|
let a = "";
|
|
3494
3498
|
typeof r.result == "string" && (a = JSON.parse(r.result)), e(a);
|
|
3495
3499
|
}, r.readAsText(t);
|
|
3496
|
-
}),
|
|
3500
|
+
}), mc = "v2", uu = b(`/api/edge/${mc}`), so = "v1", fu = b(`/api/justauth/oauth-server/${so}/visitor`), pu = b(`/api/justauth/oauth-server/${so}`), hc = "v1", du = b(`/api/knowledge-base/knowledge/${hc}`), gc = "v1", yu = b(`/api/custom-datasource/custom/${gc}`), vc = "v1", mu = b(`/api/permission/${vc}`), fe = "v1", hu = b(`/api/customer/customer/${fe}`), gu = b(`/api/customer/company/${fe}`), vu = b(`/api/customer/customer-grade/${fe}`), wu = b(`/api/customer/customer-type/${fe}`), bu = {
|
|
3497
3501
|
list: b(`/api/project/${fe}/list`),
|
|
3498
3502
|
app: b(`/api/project/${fe}/app`),
|
|
3499
3503
|
people: b(`/api/project/${fe}/people`)
|
|
3500
|
-
},
|
|
3504
|
+
}, wc = "v1", Su = b(`/api/portal/user/${wc}`), bc = "v1", Eu = b(`/api/space-manage/space-tree/${bc}`), dt = "v1", Au = b(`/api/superadmin/portal/${dt}`), Ou = b(`/api/superadmin/permission/${dt}`), Ru = b(`/api/superadmin/resource/${dt}`), Pu = b(`/api/superadmin/license/${dt}`), pr = "v1", Tu = b(`/api/supply/supplier/${pr}`), xu = b(`/api/supplier/${pr}`), $u = b(`/api/supplier/${pr}/classification`), Sc = "v1", Cu = b(`/api/supply/brand/${Sc}`), Ec = "v2", _u = b(`/api/tool/${Ec}`), Ac = "v1", Nu = b(`/api/system-config/${Ac}`);
|
|
3501
3505
|
export {
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3506
|
+
lu as analyApi,
|
|
3507
|
+
Zc as appManage,
|
|
3508
|
+
eu as authentication,
|
|
3509
|
+
tu as bemsModules,
|
|
3510
|
+
gu as company,
|
|
3511
|
+
ru as contract,
|
|
3512
|
+
hu as customer,
|
|
3513
|
+
vu as customerGrade,
|
|
3514
|
+
wu as customerType,
|
|
3515
|
+
yu as daslink,
|
|
3512
3516
|
sn as downloadFile,
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3517
|
+
nu as dutyModules,
|
|
3518
|
+
Cu as enterpriseadminBrandModel,
|
|
3519
|
+
ou as enterpriseright,
|
|
3520
|
+
uu as gatewayEdge,
|
|
3521
|
+
au as iot,
|
|
3518
3522
|
fr as iotMinio,
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3523
|
+
iu as iotModules,
|
|
3524
|
+
sc as iotProgress,
|
|
3525
|
+
su as iotRelationModules,
|
|
3526
|
+
fu as justauth,
|
|
3527
|
+
du as knowledgeBase,
|
|
3528
|
+
pu as oauthServer,
|
|
3529
|
+
mu as permission,
|
|
3530
|
+
Su as portal,
|
|
3531
|
+
bu as projectManage,
|
|
3532
|
+
Eu as spaceManage,
|
|
3533
|
+
Pu as superadminLicense,
|
|
3534
|
+
Ou as superadminPermission,
|
|
3535
|
+
Au as superadminPortal,
|
|
3536
|
+
Ru as superadminResource,
|
|
3537
|
+
Tu as supplier,
|
|
3538
|
+
$u as supplierClassification,
|
|
3539
|
+
xu as supplierManage,
|
|
3540
|
+
Nu as systemConfiguration,
|
|
3541
|
+
_u as tool,
|
|
3542
|
+
cu as useFile
|
|
3539
3543
|
};
|
|
Binary file
|