@das-fed/utils 6.4.0-test.2 → 6.4.0-test.20
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/i18n/index.d.ts +53 -0
- package/api-services/i18n/index.js +27 -0
- package/api-services/i18n/index.js.gz +0 -0
- package/api-services/index.js +1051 -986
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +896 -861
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +896 -861
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +893 -858
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +896 -861
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +765 -730
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +896 -861
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.d.ts +1 -0
- package/api-services/modules/file/index.js +2978 -154
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +896 -861
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1022 -982
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.d.ts +1 -0
- package/api-services/modules/iot/index.js +837 -801
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +770 -735
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +901 -866
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +896 -861
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +896 -861
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +768 -733
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +896 -861
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +896 -861
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +764 -729
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +898 -863
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +896 -861
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +896 -861
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +896 -861
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +764 -729
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/index.d.ts +9 -3
- package/common-info/index.js +110 -55
- package/common-info/index.js.gz +0 -0
- package/common-info/set-personal-info/index.js +16 -12
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-info/type.d.ts +116 -6
- package/common-tools/calc-text-width/index.d.ts +1 -0
- package/common-tools/calc-text-width/index.js +10 -0
- package/common-tools/index.d.ts +2 -0
- package/common-tools/index.js +2 -0
- package/common-tools/nest-tree-format/index.d.ts +1 -1
- package/common-tools/nest-tree-format/index.js +15 -15
- package/common-tools/update-browser-title/index.d.ts +1 -0
- package/common-tools/update-browser-title/index.js +12 -0
- package/create-api-service/i18n/index.d.ts +33 -0
- package/create-api-service/i18n/index.js +15 -0
- package/create-api-service/index.js +764 -729
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.d.ts +0 -2
- package/create-api-service/sso/index.js +716 -620
- package/create-api-service/sso/index.js.gz +0 -0
- package/directive/hoverInside/index.d.ts +1 -1
- package/dom-check-in/index.js +2 -2
- package/dom-watcher/index.d.ts +1 -1
- package/esm-map.json +6 -2
- package/package.json +4 -3
- package/token-tools/index.d.ts +6 -6
- package/token-tools/index.js +8 -84
- package/token-tools/index.js.gz +0 -0
|
Binary file
|
package/common-info/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, ProjectInfo, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
|
|
1
|
+
import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, ProjectInfo, ProjectMessage, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
|
|
2
2
|
|
|
3
3
|
/** 获取token */
|
|
4
4
|
export declare const getToken: any;
|
|
@@ -13,15 +13,21 @@ export declare const getTenantInfo: () => TenantInfo;
|
|
|
13
13
|
* @returns 项目信息
|
|
14
14
|
*/
|
|
15
15
|
export declare const getProjectInfo: () => ProjectInfo;
|
|
16
|
+
/**
|
|
17
|
+
* 获取项目信息
|
|
18
|
+
* @returns 项目信息
|
|
19
|
+
*/
|
|
20
|
+
export declare const getProjectMessage: () => ProjectMessage;
|
|
16
21
|
/** 获取首页信息 */
|
|
17
22
|
export declare const getHomeInfo: () => HomeInfo;
|
|
23
|
+
export declare const getPersonalConfig: () => PersonalConfigInfo;
|
|
18
24
|
/**
|
|
19
25
|
* 可用于判断菜单或者按钮权限
|
|
20
26
|
* @param menuCode 菜单编码
|
|
21
27
|
* @param applicationCode 应用编码
|
|
22
|
-
* @returns undefined
|
|
28
|
+
* @returns 无菜单权限返回undefined,有菜单权限但是没有任何按钮权限返回空数组
|
|
23
29
|
*/
|
|
24
|
-
export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => any;
|
|
30
|
+
export declare const getPageAuth: (menuCode?: string, applicationCode?: string) => undefined | any[];
|
|
25
31
|
/**
|
|
26
32
|
* 获取指定菜单的按钮权限数据
|
|
27
33
|
* @param menuCode 菜单编码
|
package/common-info/index.js
CHANGED
|
@@ -1,48 +1,91 @@
|
|
|
1
|
-
import { getConfig as
|
|
2
|
-
import { getUrlParams as
|
|
1
|
+
import { getConfig as u } from "@das-fed/utils/config";
|
|
2
|
+
import { getUrlParams as d } from "@das-fed/utils/common-tools";
|
|
3
3
|
import { getAccessToken as I } from "@das-fed/utils/token-tools";
|
|
4
|
-
import { getTokenFromQuery as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
4
|
+
import { getTokenFromQuery as S, getProjectInfoFromQuery as y } from "@das-fed/utils/common-info/getInfoFromUrl";
|
|
5
|
+
const N = I, A = () => {
|
|
6
|
+
var r;
|
|
7
7
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
8
8
|
return {
|
|
9
9
|
id: e.id ?? "",
|
|
10
10
|
name: e.userName ?? "",
|
|
11
11
|
flag: e.flag ?? null,
|
|
12
|
-
tenantId: ((
|
|
12
|
+
tenantId: ((r = e == null ? void 0 : e.tenant) == null ? void 0 : r.id) ?? ""
|
|
13
13
|
};
|
|
14
|
-
},
|
|
14
|
+
}, J = () => {
|
|
15
15
|
let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
|
|
16
|
-
const t =
|
|
16
|
+
const t = u();
|
|
17
17
|
return JSON.stringify(e) === "{}" && t.personalInfo && (e = t.personalInfo), {
|
|
18
18
|
id: e.id ?? "",
|
|
19
19
|
name: e.name ?? "",
|
|
20
|
-
phone: e.phone ?? "",
|
|
21
20
|
userName: e.userName ?? "",
|
|
21
|
+
phone: e.phone ?? "",
|
|
22
22
|
email: e.email ?? "",
|
|
23
23
|
headPicture: e.headPicture ?? ""
|
|
24
24
|
};
|
|
25
|
-
},
|
|
25
|
+
}, O = () => {
|
|
26
26
|
let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
|
|
27
27
|
return {
|
|
28
28
|
userId: e.id ?? "",
|
|
29
29
|
userName: e.userName ?? "",
|
|
30
30
|
name: e.name ?? "",
|
|
31
31
|
areaCode: e.areaCode ?? "",
|
|
32
|
+
region: e.region ?? "",
|
|
32
33
|
phone: e.phone ?? "",
|
|
34
|
+
email: e.email ?? "",
|
|
33
35
|
flag: e.flag ?? null,
|
|
34
|
-
tenant: e.tenant ?? {}
|
|
36
|
+
tenant: e.tenant ?? {},
|
|
37
|
+
headPicture: e.headPicture ?? "",
|
|
38
|
+
nickName: e.nickName ?? "",
|
|
39
|
+
gender: e.gender ?? null,
|
|
40
|
+
status: e.status ?? null,
|
|
41
|
+
statusName: e.statusName ?? null,
|
|
42
|
+
tags: e.tags ?? [],
|
|
43
|
+
type: e.type ?? null,
|
|
44
|
+
address: e.address ?? "",
|
|
45
|
+
description: e.description ?? ""
|
|
35
46
|
};
|
|
36
|
-
},
|
|
47
|
+
}, C = () => {
|
|
37
48
|
let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
|
|
38
|
-
const t =
|
|
49
|
+
const t = u();
|
|
39
50
|
return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
|
|
40
51
|
id: (e == null ? void 0 : e.id) ?? 0,
|
|
41
|
-
|
|
52
|
+
code: (e == null ? void 0 : e.code) ?? 0,
|
|
42
53
|
name: (e == null ? void 0 : e.name) ?? "",
|
|
43
|
-
|
|
54
|
+
type: (e == null ? void 0 : e.type) ?? null,
|
|
55
|
+
parentId: (e == null ? void 0 : e.parentId) ?? "",
|
|
56
|
+
parentName: (e == null ? void 0 : e.parentName) ?? "",
|
|
57
|
+
parentType: (e == null ? void 0 : e.parentType) ?? null,
|
|
58
|
+
tenantId: (e == null ? void 0 : e.tenant) ?? "",
|
|
59
|
+
isParent: (e == null ? void 0 : e.isParent) ?? !1,
|
|
60
|
+
leaf: (e == null ? void 0 : e.leaf) ?? !1,
|
|
61
|
+
optional: (e == null ? void 0 : e.leaf) ?? !0
|
|
44
62
|
};
|
|
45
63
|
}, M = () => {
|
|
64
|
+
let e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
|
|
65
|
+
return {
|
|
66
|
+
id: (e == null ? void 0 : e.id) ?? 0,
|
|
67
|
+
projectName: (e == null ? void 0 : e.projectName) ?? "",
|
|
68
|
+
provinceCode: (e == null ? void 0 : e.provinceCode) ?? "",
|
|
69
|
+
cityCode: (e == null ? void 0 : e.cityCode) ?? "",
|
|
70
|
+
areaCode: (e == null ? void 0 : e.areaCode) ?? "",
|
|
71
|
+
address: (e == null ? void 0 : e.address) ?? "",
|
|
72
|
+
projectDesc: (e == null ? void 0 : e.projectDesc) ?? "",
|
|
73
|
+
logoPath: (e == null ? void 0 : e.logoPath) ?? "",
|
|
74
|
+
projectType: (e == null ? void 0 : e.projectType) ?? "",
|
|
75
|
+
projectTypeCode: (e == null ? void 0 : e.projectTypeCode) ?? "",
|
|
76
|
+
longitude: (e == null ? void 0 : e.longitude) ?? "",
|
|
77
|
+
latitude: (e == null ? void 0 : e.latitude) ?? "",
|
|
78
|
+
projectStartDate: (e == null ? void 0 : e.projectStartDate) ?? "",
|
|
79
|
+
projectExpiryDate: (e == null ? void 0 : e.projectExpiryDate) ?? "",
|
|
80
|
+
projectCode: (e == null ? void 0 : e.projectCode) ?? "",
|
|
81
|
+
mapConfiguration: (e == null ? void 0 : e.mapConfiguration) ?? !1,
|
|
82
|
+
cityName: (e == null ? void 0 : e.cityName) ?? "",
|
|
83
|
+
cityNamePinyin: (e == null ? void 0 : e.cityNamePinyin) ?? "",
|
|
84
|
+
timezone: (e == null ? void 0 : e.timezone) ?? "",
|
|
85
|
+
autoTimezone: (e == null ? void 0 : e.autoTimezone) ?? !1,
|
|
86
|
+
currency: (e == null ? void 0 : e.currency) ?? {}
|
|
87
|
+
};
|
|
88
|
+
}, v = () => {
|
|
46
89
|
const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
|
|
47
90
|
return {
|
|
48
91
|
applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
|
|
@@ -50,37 +93,47 @@ const S = I, C = () => {
|
|
|
50
93
|
enable: (e == null ? void 0 : e.enable) ?? !1,
|
|
51
94
|
originalCode: (e == null ? void 0 : e.originalCode) ?? "",
|
|
52
95
|
routeUrl: (e == null ? void 0 : e.routeUrl) ?? "",
|
|
96
|
+
displayPosition: (e == null ? void 0 : e.displayPosition) ?? 1,
|
|
53
97
|
type: (e == null ? void 0 : e.type) ?? null
|
|
54
98
|
};
|
|
55
|
-
},
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
99
|
+
}, f = () => {
|
|
100
|
+
const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
|
|
101
|
+
return {
|
|
102
|
+
style: (e == null ? void 0 : e.style) ?? "",
|
|
103
|
+
skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
|
|
104
|
+
};
|
|
105
|
+
}, j = (e, t) => {
|
|
106
|
+
var g;
|
|
107
|
+
const r = "permission-btn", a = m(), o = d(location.href, "app") || "", s = t || o || a.currentSubAppCode;
|
|
108
|
+
if (!s) return;
|
|
109
|
+
const n = d(location.href, "menu") || "", l = e || n || a.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(r) || "{}");
|
|
59
110
|
if (!c || JSON.stringify(c) === "{}") return;
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
111
|
+
const p = (g = c[s]) == null ? void 0 : g[l];
|
|
112
|
+
if (p)
|
|
113
|
+
return p.length ? p : c[s]["origin-auth"] ? c[s]["origin-auth"][l] ?? [] : [];
|
|
114
|
+
}, k = (e, t) => j(e, t) ?? [], m = () => {
|
|
63
115
|
const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
|
|
64
116
|
return {
|
|
65
117
|
appcategorys: e.appcategorys ?? [],
|
|
66
118
|
currentSubApp: e.currentSubApp ?? {},
|
|
67
119
|
currentSubAppCode: e.currentSubAppCode ?? "",
|
|
68
|
-
subAppList: e.subAppList ?? []
|
|
120
|
+
subAppList: e.subAppList ?? [],
|
|
121
|
+
menuCollapses: e.menuCollapses ?? []
|
|
69
122
|
};
|
|
70
|
-
},
|
|
71
|
-
var
|
|
72
|
-
const
|
|
123
|
+
}, D = (e, t = !1) => {
|
|
124
|
+
var a, o;
|
|
125
|
+
const r = m().subAppList;
|
|
73
126
|
if (e)
|
|
74
|
-
return t ? ((
|
|
127
|
+
return t ? ((a = r == null ? void 0 : r.find((s) => s.code === e)) == null ? void 0 : a.originalMenus) ?? [] : ((o = r == null ? void 0 : r.find((s) => s.code === e)) == null ? void 0 : o.menus) ?? [];
|
|
75
128
|
{
|
|
76
|
-
let
|
|
77
|
-
return t ?
|
|
78
|
-
|
|
79
|
-
}) :
|
|
80
|
-
|
|
81
|
-
}),
|
|
129
|
+
let s = {};
|
|
130
|
+
return t ? r == null || r.forEach((n) => {
|
|
131
|
+
s[n.code] = n.originalMenus ?? [];
|
|
132
|
+
}) : r == null || r.forEach((n) => {
|
|
133
|
+
s[n.code] = n.menus ?? [];
|
|
134
|
+
}), s;
|
|
82
135
|
}
|
|
83
|
-
},
|
|
136
|
+
}, U = () => {
|
|
84
137
|
const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
|
|
85
138
|
return {
|
|
86
139
|
currentCode: e.currentCode ?? "",
|
|
@@ -88,28 +141,30 @@ const S = I, C = () => {
|
|
|
88
141
|
tabMap: e.tabMap ?? {},
|
|
89
142
|
preTab: e.preTab ?? {}
|
|
90
143
|
};
|
|
91
|
-
},
|
|
92
|
-
const e =
|
|
144
|
+
}, E = () => {
|
|
145
|
+
const e = u(), t = sessionStorage.getItem("minioAddress");
|
|
93
146
|
return t || (e.baseURL ? e.baseURL : location.origin);
|
|
94
|
-
},
|
|
147
|
+
}, z = () => ({
|
|
95
148
|
instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
|
|
96
|
-
}),
|
|
97
|
-
|
|
98
|
-
var
|
|
99
|
-
(
|
|
149
|
+
}), x = () => localStorage.getItem("fav-icon") || "./logo.svg";
|
|
150
|
+
N() || S();
|
|
151
|
+
var i;
|
|
152
|
+
(i = C()) != null && i.id || y();
|
|
100
153
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
154
|
+
x as getFavIcon,
|
|
155
|
+
v as getHomeInfo,
|
|
156
|
+
z as getInstanceInfo,
|
|
157
|
+
D as getMenus,
|
|
158
|
+
E as getMinioAddress,
|
|
159
|
+
j as getPageAuth,
|
|
160
|
+
k as getPageAuthBtn,
|
|
161
|
+
f as getPersonalConfig,
|
|
162
|
+
J as getPersonalInfo,
|
|
163
|
+
C as getProjectInfo,
|
|
164
|
+
M as getProjectMessage,
|
|
165
|
+
m as getSubApps,
|
|
166
|
+
U as getTabInfo,
|
|
167
|
+
O as getTenantInfo,
|
|
168
|
+
N as getToken,
|
|
169
|
+
A as getUserInfo
|
|
115
170
|
};
|
package/common-info/index.js.gz
CHANGED
|
Binary file
|
|
@@ -1430,20 +1430,24 @@ y.getAdapter = Fe.getAdapter;
|
|
|
1430
1430
|
y.HttpStatusCode = v;
|
|
1431
1431
|
y.default = y;
|
|
1432
1432
|
const Zt = async (e) => {
|
|
1433
|
-
var
|
|
1433
|
+
var n;
|
|
1434
1434
|
const t = {
|
|
1435
1435
|
personalInfo: "/api/personal-center/personal-server/v1/info"
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1436
|
+
};
|
|
1437
|
+
try {
|
|
1438
|
+
const r = await y.create().get(t.personalInfo, {
|
|
1439
|
+
baseURL: Ue().baseURL,
|
|
1440
|
+
params: {
|
|
1441
|
+
project: (n = Le()) == null ? void 0 : n.id,
|
|
1442
|
+
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
1443
|
+
},
|
|
1444
|
+
headers: {
|
|
1445
|
+
Authorization: `Bearer ${e}`
|
|
1446
|
+
}
|
|
1447
|
+
});
|
|
1448
|
+
r != null && r.data && sessionStorage.setItem("userInfo", JSON.stringify(r.data));
|
|
1449
|
+
} catch {
|
|
1450
|
+
}
|
|
1447
1451
|
};
|
|
1448
1452
|
export {
|
|
1449
1453
|
Zt as setPersonalInfo
|
|
Binary file
|
package/common-info/type.d.ts
CHANGED
|
@@ -29,40 +29,148 @@ export interface TenantInfo {
|
|
|
29
29
|
userId: string
|
|
30
30
|
/** 用户名 */
|
|
31
31
|
userName: string
|
|
32
|
+
/** 用户名称 */
|
|
32
33
|
name: string
|
|
34
|
+
/** 昵称 */
|
|
35
|
+
nickName: string
|
|
36
|
+
/** 手机号 */
|
|
37
|
+
phone: string
|
|
38
|
+
/** 邮箱 */
|
|
39
|
+
email: string
|
|
40
|
+
/** 性别 1 男 2 女 */
|
|
41
|
+
gender: number
|
|
42
|
+
/** 用户状态 1 正常 2 锁定 3 禁用*/
|
|
43
|
+
status: number
|
|
44
|
+
/** 状态名称 */
|
|
45
|
+
statusName: string
|
|
46
|
+
/** 用户类型。0:普通 1:管理员 */
|
|
47
|
+
type: number
|
|
33
48
|
/** 租户信息 */
|
|
34
49
|
tenant: {
|
|
50
|
+
/** 租户ID */
|
|
35
51
|
id: string
|
|
52
|
+
/** 租户名 */
|
|
36
53
|
name: string
|
|
54
|
+
/** 域,如:qq,das */
|
|
55
|
+
domain: string
|
|
56
|
+
/** 管理员用户ID */
|
|
37
57
|
adminUserId: string
|
|
58
|
+
/** 租户描述 */
|
|
38
59
|
description: string
|
|
39
|
-
|
|
60
|
+
/** 是否开通三员权限管理,0表示未开通,1表示已开通。 */
|
|
61
|
+
thirdManaged: number
|
|
40
62
|
}
|
|
41
63
|
/** 用户标识 2 - B端身份, 4 - C 端身份, 6 - B+C 端身份 */
|
|
42
64
|
flag: number
|
|
65
|
+
/** 当前区号 */
|
|
43
66
|
areaCode: string
|
|
44
|
-
/**
|
|
45
|
-
|
|
67
|
+
/** 地区 */
|
|
68
|
+
region: string
|
|
69
|
+
/** 地址 */
|
|
70
|
+
address: string
|
|
71
|
+
/** 描述 */
|
|
72
|
+
description: string
|
|
73
|
+
|
|
74
|
+
/** 头像 */
|
|
75
|
+
headPicture: string
|
|
76
|
+
/** 用户标签 */
|
|
77
|
+
tags: {
|
|
78
|
+
id: number
|
|
79
|
+
key: string
|
|
80
|
+
value: string
|
|
81
|
+
desc: string
|
|
82
|
+
}[]
|
|
46
83
|
}
|
|
47
84
|
|
|
48
85
|
export interface HomeInfo {
|
|
86
|
+
/** 应用code */
|
|
49
87
|
applicationCode: string
|
|
88
|
+
/** 应用path */
|
|
50
89
|
applicationPath: string
|
|
90
|
+
/** 是否启用 */
|
|
51
91
|
enable: boolean
|
|
52
92
|
originalCode: string
|
|
53
93
|
routeUrl: string
|
|
94
|
+
/** 首页展示位置 1在应用中心左侧 2在应用中心右侧 */
|
|
95
|
+
displayPosition: 1 | 2
|
|
54
96
|
type: number | null
|
|
55
97
|
}
|
|
56
98
|
|
|
99
|
+
export interface PersonalConfigInfo {
|
|
100
|
+
/** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
|
|
101
|
+
style: 1 | 2
|
|
102
|
+
/** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
|
|
103
|
+
skinStyle: 'default' | 'kjl' | 'cjb' | 'ssl'
|
|
104
|
+
}
|
|
105
|
+
|
|
57
106
|
export interface ProjectInfo {
|
|
58
107
|
/** 项目id */
|
|
59
|
-
id: string
|
|
60
|
-
/**
|
|
61
|
-
|
|
108
|
+
id: string
|
|
109
|
+
/** 项目编码 */
|
|
110
|
+
code: string
|
|
62
111
|
/** 项目名称 */
|
|
63
112
|
name: string
|
|
113
|
+
/** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
|
|
114
|
+
type: string
|
|
115
|
+
/** 父级id */
|
|
116
|
+
parentId?: string
|
|
117
|
+
/** 父级名称 */
|
|
118
|
+
parentName?: string
|
|
119
|
+
/** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
|
|
120
|
+
parentType?: number
|
|
64
121
|
/** 租户id */
|
|
65
122
|
tenantId?: string
|
|
123
|
+
/** 是否父级节点 */
|
|
124
|
+
isParent?: boolean
|
|
125
|
+
/** 是否叶子节点 */
|
|
126
|
+
leaf?: boolean
|
|
127
|
+
/** 是否可用 */
|
|
128
|
+
optional?: boolean
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ProjectMessage {
|
|
132
|
+
/** 主键id */
|
|
133
|
+
id: number | string
|
|
134
|
+
/** 项目名称 */
|
|
135
|
+
projectName: string
|
|
136
|
+
/** 省级(省份、直辖市、自治区)编码 */
|
|
137
|
+
provinceCode: string
|
|
138
|
+
/** 地级(城市)编码 */
|
|
139
|
+
cityCode: string
|
|
140
|
+
/** 县级(区县)编码 */
|
|
141
|
+
areaCode: string
|
|
142
|
+
/** 详细位置 */
|
|
143
|
+
address: string
|
|
144
|
+
/** 项目简介 */
|
|
145
|
+
projectDesc: string
|
|
146
|
+
/** 项目图片路径 */
|
|
147
|
+
logoPath: string
|
|
148
|
+
/** 项目类型 */
|
|
149
|
+
projectType: string
|
|
150
|
+
/** 项目类型code */
|
|
151
|
+
projectTypeCode: string
|
|
152
|
+
/** 经度 */
|
|
153
|
+
longitude: string
|
|
154
|
+
/** 纬度 */
|
|
155
|
+
latitude: string
|
|
156
|
+
/** 项目开始时间 */
|
|
157
|
+
projectStartDate: string
|
|
158
|
+
/** 项目有效期 */
|
|
159
|
+
projectExpiryDate: string
|
|
160
|
+
/** 项目编码 */
|
|
161
|
+
projectCode: string
|
|
162
|
+
/** 地图配置是否开启 */
|
|
163
|
+
mapConfiguration: boolean
|
|
164
|
+
/** 地级(城市)名称 */
|
|
165
|
+
cityName: string
|
|
166
|
+
/** 地级(城市)名称拼音 */
|
|
167
|
+
cityNamePinyin: string
|
|
168
|
+
/** 时区ID */
|
|
169
|
+
timezone: string
|
|
170
|
+
/** 是否自动设定时区 */
|
|
171
|
+
autoTimezone: boolean
|
|
172
|
+
/** 货币信息(currencyCode:ISO 4217货币编码(例:CNY);currencyUnit:货币单位,例:元(中文),CNY(英文);currencySymbol:货币符号,例:¥) */
|
|
173
|
+
currency: Record<'currencyCode' | 'currencyUnit' | 'currencySymbol', string>
|
|
66
174
|
}
|
|
67
175
|
|
|
68
176
|
export interface SubAppsInfo {
|
|
@@ -76,6 +184,8 @@ export interface SubAppsInfo {
|
|
|
76
184
|
currentSubAppCode?: string
|
|
77
185
|
/** 当前打开的应用 */
|
|
78
186
|
subAppList?: any[]
|
|
187
|
+
/** 当前菜单折叠的应用key集合 */
|
|
188
|
+
menuCollapses?: any[]
|
|
79
189
|
}
|
|
80
190
|
|
|
81
191
|
interface TabItem {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calcTextWidth: (text: string, fontSize: number) => any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const n = (t, i) => {
|
|
2
|
+
if (!t) return 0;
|
|
3
|
+
const e = document.createElement("div");
|
|
4
|
+
e.style.visibility = "hidden", e.style.whiteSpace = "pre", e.style.display = "inline-block", e.style.fontSize = i + "px", e.textContent = t, document.body.appendChild(e);
|
|
5
|
+
const d = e.offsetWidth;
|
|
6
|
+
return document.body.removeChild(e), d;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
n as calcTextWidth
|
|
10
|
+
};
|
package/common-tools/index.d.ts
CHANGED
|
@@ -8,4 +8,6 @@ export * from '@das-fed/utils/common-tools/setHtmlMinWH';
|
|
|
8
8
|
export * from '@das-fed/utils/common-tools/queue-promise';
|
|
9
9
|
export * from '@das-fed/utils/common-tools/platform-tools';
|
|
10
10
|
export * from '@das-fed/utils/common-tools/update-fav-icon';
|
|
11
|
+
export * from '@das-fed/utils/common-tools/update-browser-title';
|
|
11
12
|
export * from '@das-fed/utils/common-tools/extract-file-name';
|
|
13
|
+
export * from '@das-fed/utils/common-tools/calc-text-width';
|
package/common-tools/index.js
CHANGED
|
@@ -8,4 +8,6 @@ export * from "@das-fed/utils/common-tools/setHtmlMinWH";
|
|
|
8
8
|
export * from "@das-fed/utils/common-tools/queue-promise";
|
|
9
9
|
export * from "@das-fed/utils/common-tools/platform-tools";
|
|
10
10
|
export * from "@das-fed/utils/common-tools/update-fav-icon";
|
|
11
|
+
export * from "@das-fed/utils/common-tools/update-browser-title";
|
|
11
12
|
export * from "@das-fed/utils/common-tools/extract-file-name";
|
|
13
|
+
export * from "@das-fed/utils/common-tools/calc-text-width";
|
|
@@ -27,4 +27,4 @@ export declare const filterTreeArray: (tree: any[], predicate: (node: any) => bo
|
|
|
27
27
|
* @param func 过滤条件,符合条件的节点保留(参数为函数,返回值为布尔值)
|
|
28
28
|
* @returns 查找到的节点
|
|
29
29
|
*/
|
|
30
|
-
export declare const treeFind: (tree: any[], func: (node: any) => boolean) => any;
|
|
30
|
+
export declare const treeFind: (tree: any[], func: (node: any) => boolean, children?: string) => any;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = (n, t = "children") => {
|
|
2
2
|
let r = [];
|
|
3
3
|
for (let e = 0; e < n.length; e++)
|
|
4
|
-
n[e][t] && n[e][t].length > 0 && (r.push(n[e]), r = r.concat(
|
|
4
|
+
n[e][t] && n[e][t].length > 0 && (r.push(n[e]), r = r.concat(s(n[e][t])));
|
|
5
5
|
return r;
|
|
6
|
-
},
|
|
7
|
-
let
|
|
8
|
-
return r && delete
|
|
9
|
-
}, []) : [],
|
|
10
|
-
for (const
|
|
11
|
-
if (t(
|
|
12
|
-
if (
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
6
|
+
}, l = (n, t = "children", r = !0) => Array.isArray(n) && n.length ? n.reduce((e, u) => {
|
|
7
|
+
let f = u[t], o = { ...u };
|
|
8
|
+
return r && delete o[t], f && f.length ? e.concat(o, l(f, t, r)) : e.concat(o);
|
|
9
|
+
}, []) : [], c = (n, t, r = "children") => n.filter((e) => t(e)).map((e) => (e = Object.assign({}, e), e[r] && (e[r] = c(e[r], t)), e)), g = (n, t, r = "children") => {
|
|
10
|
+
for (const e of n) {
|
|
11
|
+
if (t(e)) return e;
|
|
12
|
+
if (e != null && e[r] && e[r].length) {
|
|
13
|
+
const u = g(e[r], t, r = "children");
|
|
14
|
+
if (u) return u;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
c as filterTreeArray,
|
|
21
|
+
s as findNonEmptyChildrenItems,
|
|
22
|
+
l as flatTree,
|
|
23
|
+
g as treeFind
|
|
24
24
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setBrowseTitle: (defaultTitle?: string) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { systemConfiguration as l } from "@das-fed/utils/api-services/modules";
|
|
2
|
+
const n = async (o = "AIoT智能物联网管控平台") => {
|
|
3
|
+
let t = localStorage.getItem("browser-title") ?? "";
|
|
4
|
+
if (!t) {
|
|
5
|
+
const i = l.get("/visitor/appearance/with-default", (r) => (r.public = !0, r)), [s, e] = await i().run();
|
|
6
|
+
e != null && e.browserTitle && (t = e.browserTitle);
|
|
7
|
+
}
|
|
8
|
+
document.title = t || o;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
n as setBrowseTitle
|
|
12
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
参数校验错误: {
|
|
3
|
+
'zh-CN': string;
|
|
4
|
+
en: string;
|
|
5
|
+
_appCode: string;
|
|
6
|
+
};
|
|
7
|
+
接口地址未找到: {
|
|
8
|
+
'zh-CN': string;
|
|
9
|
+
en: string;
|
|
10
|
+
_appCode: string;
|
|
11
|
+
};
|
|
12
|
+
服务器内部错误: {
|
|
13
|
+
'zh-CN': string;
|
|
14
|
+
en: string;
|
|
15
|
+
_appCode: string;
|
|
16
|
+
};
|
|
17
|
+
解析错误: {
|
|
18
|
+
'zh-CN': string;
|
|
19
|
+
en: string;
|
|
20
|
+
_appCode: string;
|
|
21
|
+
};
|
|
22
|
+
请求配置异常: {
|
|
23
|
+
'zh-CN': string;
|
|
24
|
+
en: string;
|
|
25
|
+
_appCode: string;
|
|
26
|
+
};
|
|
27
|
+
'\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u60A8\u7684\u7F51\u7EDC\u60C5\u51B5': {
|
|
28
|
+
'zh-CN': string;
|
|
29
|
+
en: string;
|
|
30
|
+
_appCode: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
参数校验错误: { "zh-CN": "参数校验错误", en: "Parameter Validation Error", _appCode: "framework" },
|
|
3
|
+
接口地址未找到: { "zh-CN": "接口地址未找到", en: "Api endpoint not found", _appCode: "framework" },
|
|
4
|
+
服务器内部错误: { "zh-CN": "服务器内部错误", en: "Internal Server Error", _appCode: "framework" },
|
|
5
|
+
解析错误: { "zh-CN": "解析错误", en: "Parsing Error", _appCode: "framework" },
|
|
6
|
+
请求配置异常: { "zh-CN": "请求配置异常", en: "Request Configuration Error", _appCode: "framework" },
|
|
7
|
+
"网络异常,请检查您的网络情况": {
|
|
8
|
+
"zh-CN": "网络异常,请检查您的网络情况",
|
|
9
|
+
en: "Network error, please check your network status",
|
|
10
|
+
_appCode: "framework"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
r as default
|
|
15
|
+
};
|