@das-fed/utils 6.4.0-dev.55.24 → 6.4.0-dev.55.26

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.
@@ -1,4 +1,4 @@
1
- import { UserInfo, PersonalInfo, TenantInfo, HomeInfo, PersonalConfigInfo, 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,6 +13,11 @@ 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;
18
23
  export declare const getPersonalConfig: () => PersonalConfigInfo;
@@ -1,19 +1,19 @@
1
- import { getConfig as l } from "@das-fed/utils/config";
1
+ import { getConfig as u } from "@das-fed/utils/config";
2
2
  import { getUrlParams as g } from "@das-fed/utils/common-tools";
3
- import { getAccessToken as m } from "@das-fed/utils/token-tools";
4
- import { getTokenFromQuery as f, getProjectInfoFromQuery as d } from "@das-fed/utils/common-info/getInfoFromUrl";
5
- const S = m, J = () => {
6
- var n;
3
+ import { getAccessToken as i } from "@das-fed/utils/token-tools";
4
+ import { getTokenFromQuery as I, getProjectInfoFromQuery as S } from "@das-fed/utils/common-info/getInfoFromUrl";
5
+ const y = i, T = () => {
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: ((n = e == null ? void 0 : e.tenant) == null ? void 0 : n.id) ?? ""
12
+ tenantId: ((r = e == null ? void 0 : e.tenant) == null ? void 0 : r.id) ?? ""
13
13
  };
14
- }, O = () => {
14
+ }, A = () => {
15
15
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
16
- const t = l();
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 ?? "",
@@ -22,7 +22,7 @@ const S = m, J = () => {
22
22
  email: e.email ?? "",
23
23
  headPicture: e.headPicture ?? ""
24
24
  };
25
- }, P = () => {
25
+ }, J = () => {
26
26
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
27
27
  return {
28
28
  userId: e.id ?? "",
@@ -33,9 +33,9 @@ const S = m, J = () => {
33
33
  flag: e.flag ?? null,
34
34
  tenant: e.tenant ?? {}
35
35
  };
36
- }, b = () => {
36
+ }, C = () => {
37
37
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
38
- const t = l();
38
+ const t = u();
39
39
  return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
40
40
  id: (e == null ? void 0 : e.id) ?? 0,
41
41
  code: (e == null ? void 0 : e.code) ?? 0,
@@ -49,7 +49,32 @@ const S = m, J = () => {
49
49
  leaf: (e == null ? void 0 : e.leaf) ?? !1,
50
50
  optional: (e == null ? void 0 : e.leaf) ?? !0
51
51
  };
52
- }, T = () => {
52
+ }, O = () => {
53
+ let e = JSON.parse(sessionStorage.getItem("project-message") || "{}");
54
+ return {
55
+ id: (e == null ? void 0 : e.id) ?? 0,
56
+ projectName: (e == null ? void 0 : e.projectName) ?? "",
57
+ provinceCode: (e == null ? void 0 : e.provinceCode) ?? "",
58
+ cityCode: (e == null ? void 0 : e.cityCode) ?? "",
59
+ areaCode: (e == null ? void 0 : e.areaCode) ?? "",
60
+ address: (e == null ? void 0 : e.address) ?? "",
61
+ projectDesc: (e == null ? void 0 : e.projectDesc) ?? "",
62
+ logoPath: (e == null ? void 0 : e.logoPath) ?? "",
63
+ projectType: (e == null ? void 0 : e.projectType) ?? "",
64
+ projectTypeCode: (e == null ? void 0 : e.projectTypeCode) ?? "",
65
+ longitude: (e == null ? void 0 : e.longitude) ?? "",
66
+ latitude: (e == null ? void 0 : e.latitude) ?? "",
67
+ projectStartDate: (e == null ? void 0 : e.projectStartDate) ?? "",
68
+ projectExpiryDate: (e == null ? void 0 : e.projectExpiryDate) ?? "",
69
+ projectCode: (e == null ? void 0 : e.projectCode) ?? "",
70
+ mapConfiguration: (e == null ? void 0 : e.mapConfiguration) ?? !1,
71
+ cityName: (e == null ? void 0 : e.cityName) ?? "",
72
+ cityNamePinyin: (e == null ? void 0 : e.cityNamePinyin) ?? "",
73
+ timezone: (e == null ? void 0 : e.timezone) ?? "",
74
+ autoTimezone: (e == null ? void 0 : e.autoTimezone) ?? !1,
75
+ currency: (e == null ? void 0 : e.currency) ?? {}
76
+ };
77
+ }, M = () => {
53
78
  const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
54
79
  return {
55
80
  applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
@@ -59,20 +84,20 @@ const S = m, J = () => {
59
84
  routeUrl: (e == null ? void 0 : e.routeUrl) ?? "",
60
85
  type: (e == null ? void 0 : e.type) ?? null
61
86
  };
62
- }, M = () => {
87
+ }, f = () => {
63
88
  const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
64
89
  return {
65
90
  style: (e == null ? void 0 : e.style) ?? "",
66
91
  skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
67
92
  };
68
- }, h = (e, t) => {
69
- const n = "permission-btn", s = I(), a = g(location.href, "app") || "", r = t || a || s.currentSubAppCode;
70
- if (!r) return;
71
- const o = g(location.href, "menu") || "", p = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
93
+ }, N = (e, t) => {
94
+ const r = "permission-btn", o = m(), a = g(location.href, "app") || "", n = t || a || o.currentSubAppCode;
95
+ if (!n) return;
96
+ const s = g(location.href, "menu") || "", l = e || s || o.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(r) || "{}");
72
97
  if (!c || JSON.stringify(c) === "{}") return;
73
- const u = c[r][p];
74
- return u && u.length ? u : c[r]["origin-auth"] ? c[r]["origin-auth"][p] ?? [] : [];
75
- }, j = (e, t) => h(e, t) ?? [], I = () => {
98
+ const p = c[n][l];
99
+ return p && p.length ? p : c[n]["origin-auth"] ? c[n]["origin-auth"][l] ?? [] : [];
100
+ }, v = (e, t) => N(e, t) ?? [], m = () => {
76
101
  const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
77
102
  return {
78
103
  appcategorys: e.appcategorys ?? [],
@@ -81,18 +106,18 @@ const S = m, J = () => {
81
106
  subAppList: e.subAppList ?? [],
82
107
  menuCollapses: e.menuCollapses ?? []
83
108
  };
84
- }, v = (e, t = !1) => {
85
- var s, a;
86
- const n = I().subAppList;
109
+ }, D = (e, t = !1) => {
110
+ var o, a;
111
+ const r = m().subAppList;
87
112
  if (e)
88
- return t ? ((s = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : s.originalMenus) ?? [] : ((a = n == null ? void 0 : n.find((r) => r.code === e)) == null ? void 0 : a.menus) ?? [];
113
+ return t ? ((o = r == null ? void 0 : r.find((n) => n.code === e)) == null ? void 0 : o.originalMenus) ?? [] : ((a = r == null ? void 0 : r.find((n) => n.code === e)) == null ? void 0 : a.menus) ?? [];
89
114
  {
90
- let r = {};
91
- return t ? n == null || n.forEach((o) => {
92
- r[o.code] = o.originalMenus ?? [];
93
- }) : n == null || n.forEach((o) => {
94
- r[o.code] = o.menus ?? [];
95
- }), r;
115
+ let n = {};
116
+ return t ? r == null || r.forEach((s) => {
117
+ n[s.code] = s.originalMenus ?? [];
118
+ }) : r == null || r.forEach((s) => {
119
+ n[s.code] = s.menus ?? [];
120
+ }), n;
96
121
  }
97
122
  }, U = () => {
98
123
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
@@ -103,28 +128,29 @@ const S = m, J = () => {
103
128
  preTab: e.preTab ?? {}
104
129
  };
105
130
  }, k = () => {
106
- const e = l(), t = sessionStorage.getItem("minioAddress");
131
+ const e = u(), t = sessionStorage.getItem("minioAddress");
107
132
  return t || (e.baseURL ? e.baseURL : location.origin);
108
133
  }, E = () => ({
109
134
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
110
- }), F = () => localStorage.getItem("fav-icon") || "./logo.svg";
111
- S() || f();
112
- var i;
113
- (i = b()) != null && i.id || d();
135
+ }), z = () => localStorage.getItem("fav-icon") || "./logo.svg";
136
+ y() || I();
137
+ var d;
138
+ (d = C()) != null && d.id || S();
114
139
  export {
115
- F as getFavIcon,
116
- T as getHomeInfo,
140
+ z as getFavIcon,
141
+ M as getHomeInfo,
117
142
  E as getInstanceInfo,
118
- v as getMenus,
143
+ D as getMenus,
119
144
  k as getMinioAddress,
120
- h as getPageAuth,
121
- j as getPageAuthBtn,
122
- M as getPersonalConfig,
123
- O as getPersonalInfo,
124
- b as getProjectInfo,
125
- I as getSubApps,
145
+ N as getPageAuth,
146
+ v as getPageAuthBtn,
147
+ f as getPersonalConfig,
148
+ A as getPersonalInfo,
149
+ C as getProjectInfo,
150
+ O as getProjectMessage,
151
+ m as getSubApps,
126
152
  U as getTabInfo,
127
- P as getTenantInfo,
128
- S as getToken,
129
- J as getUserInfo
153
+ J as getTenantInfo,
154
+ y as getToken,
155
+ T as getUserInfo
130
156
  };
Binary file
@@ -58,9 +58,9 @@ export interface HomeInfo {
58
58
  }
59
59
 
60
60
  export interface PersonalConfigInfo {
61
- /** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
61
+ /** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
62
62
  style: string
63
- /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
63
+ /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
64
64
  skinStyle: string
65
65
  }
66
66
 
@@ -71,13 +71,13 @@ export interface ProjectInfo {
71
71
  code: string
72
72
  /** 项目名称 */
73
73
  name: string
74
- /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
74
+ /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
75
75
  type: string
76
76
  /** 父级id */
77
77
  parentId?: string
78
78
  /** 父级名称 */
79
79
  parentName?: string
80
- /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
80
+ /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
81
81
  parentType?: number
82
82
  /** 租户id */
83
83
  tenantId?: string
@@ -89,6 +89,51 @@ export interface ProjectInfo {
89
89
  optional?: boolean
90
90
  }
91
91
 
92
+ export interface ProjectMessage {
93
+ /** 主键id */
94
+ id: number | string
95
+ /** 项目名称 */
96
+ projectName: string
97
+ /** 省级(省份、直辖市、自治区)编码 */
98
+ provinceCode: string
99
+ /** 地级(城市)编码 */
100
+ cityCode: string
101
+ /** 县级(区县)编码 */
102
+ areaCode: string
103
+ /** 详细位置 */
104
+ address: string
105
+ /** 项目简介 */
106
+ projectDesc: string
107
+ /** 项目图片路径 */
108
+ logoPath: string
109
+ /** 项目类型 */
110
+ projectType: string
111
+ /** 项目类型code */
112
+ projectTypeCode: string
113
+ /** 经度 */
114
+ longitude: string
115
+ /** 纬度 */
116
+ latitude: string
117
+ /** 项目开始时间 */
118
+ projectStartDate: string
119
+ /** 项目有效期 */
120
+ projectExpiryDate: string
121
+ /** 项目编码 */
122
+ projectCode: string
123
+ /** 地图配置是否开启 */
124
+ mapConfiguration: boolean
125
+ /** 地级(城市)名称 */
126
+ cityName: string
127
+ /** 地级(城市)名称拼音 */
128
+ cityNamePinyin: string
129
+ /** 时区ID */
130
+ timezone: string
131
+ /** 是否自动设定时区 */
132
+ autoTimezone: boolean
133
+ /** 货币信息(currencyCode:ISO 4217货币编码(例:CNY);currencyUnit:货币单位,例:元(中文),CNY(英文);currencySymbol:货币符号,例:¥) */
134
+ currency: Record<'currencyCode' | 'currencyUnit' | 'currencySymbol', string>
135
+ }
136
+
92
137
  export interface SubAppsInfo {
93
138
  /** 所有应用信息 */
94
139
  appcategorys?: any[]
@@ -1,7 +1,7 @@
1
1
  const d = (e) => {
2
2
  const t = window.event;
3
- let i = Number(t.clientX), n = Number(t.clientY), l = Number(e.getBoundingClientRect().left), u = Number(l + e.clientWidth), r = Number(e.getBoundingClientRect().top), c = Number(r + e.clientHeight);
4
- return i > l && i < u && n > r && n < c;
3
+ let i = Number(t.clientX), n = Number(t.clientY), l = Number(e.getBoundingClientRect().left), r = Number(l + e.clientWidth), c = Number(e.getBoundingClientRect().top), u = Number(c + e.clientHeight);
4
+ return i > l && i < r && n > c && n < u;
5
5
  };
6
6
  export {
7
7
  d as domCheckIn
package/esm-map.json CHANGED
@@ -137,5 +137,6 @@
137
137
  "setShowWatermark": "/common-tools/platform-tools/index",
138
138
  "extractFilename": "/common-tools/extract-file-name/index",
139
139
  "setBrowseTitle": "/common-tools/update-browser-title/index",
140
- "getPersonalConfig": "/common-info/index"
140
+ "getPersonalConfig": "/common-info/index",
141
+ "getProjectMessage": "/common-info/index"
141
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.4.0-dev.55.24",
3
+ "version": "6.4.0-dev.55.26",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -9,7 +9,7 @@
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
11
  "@antv/x6": "^2.18.1",
12
- "@das-fed/utils": "6.4.0-dev.55.24",
12
+ "@das-fed/utils": "6.4.0-dev.55.26",
13
13
  "@vue/shared": "^3.4.21",
14
14
  "@vueuse/core": "^9.6.0",
15
15
  "axios": "^1.6.7",
@@ -21,8 +21,8 @@
21
21
  "vue": "^3.4.21"
22
22
  },
23
23
  "devDependencies": {
24
- "@das-fed/cli": "6.4.0-dev.55.24",
25
- "@das-fed/web": "6.4.0-dev.55.24",
24
+ "@das-fed/cli": "6.4.0-dev.55.26",
25
+ "@das-fed/web": "6.4.0-dev.55.26",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",