@das-fed/utils 6.4.0-test.5.1 → 6.4.0-test.6

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, 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,8 +13,14 @@ 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 菜单编码
@@ -1,19 +1,19 @@
1
- import { getConfig as p } 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 = p();
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 = p();
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,14 +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
- }, h = (e, t) => {
63
- const n = "permission-btn", s = I(), a = g(location.href, "app") || "", r = t || a || s.currentSubAppCode;
64
- if (!r) return;
65
- const o = g(location.href, "menu") || "", l = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
87
+ }, f = () => {
88
+ const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
89
+ return {
90
+ style: (e == null ? void 0 : e.style) ?? "",
91
+ skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
92
+ };
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) || "{}");
66
97
  if (!c || JSON.stringify(c) === "{}") return;
67
- const u = c[r][l];
68
- return u && u.length ? u : c[r]["origin-auth"] ? c[r]["origin-auth"][l] ?? [] : [];
69
- }, M = (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 = () => {
70
101
  const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
71
102
  return {
72
103
  appcategorys: e.appcategorys ?? [],
@@ -75,20 +106,20 @@ const S = m, J = () => {
75
106
  subAppList: e.subAppList ?? [],
76
107
  menuCollapses: e.menuCollapses ?? []
77
108
  };
78
- }, j = (e, t = !1) => {
79
- var s, a;
80
- const n = I().subAppList;
109
+ }, D = (e, t = !1) => {
110
+ var o, a;
111
+ const r = m().subAppList;
81
112
  if (e)
82
- 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) ?? [];
83
114
  {
84
- let r = {};
85
- return t ? n == null || n.forEach((o) => {
86
- r[o.code] = o.originalMenus ?? [];
87
- }) : n == null || n.forEach((o) => {
88
- r[o.code] = o.menus ?? [];
89
- }), 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;
90
121
  }
91
- }, v = () => {
122
+ }, U = () => {
92
123
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
93
124
  return {
94
125
  currentCode: e.currentCode ?? "",
@@ -96,28 +127,30 @@ const S = m, J = () => {
96
127
  tabMap: e.tabMap ?? {},
97
128
  preTab: e.preTab ?? {}
98
129
  };
99
- }, U = () => {
100
- const e = p(), t = sessionStorage.getItem("minioAddress");
130
+ }, k = () => {
131
+ const e = u(), t = sessionStorage.getItem("minioAddress");
101
132
  return t || (e.baseURL ? e.baseURL : location.origin);
102
- }, k = () => ({
133
+ }, E = () => ({
103
134
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
104
- }), E = () => localStorage.getItem("fav-icon") || "./logo.svg";
105
- S() || f();
106
- var i;
107
- (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();
108
139
  export {
109
- E as getFavIcon,
110
- T as getHomeInfo,
111
- k as getInstanceInfo,
112
- j as getMenus,
113
- U as getMinioAddress,
114
- h as getPageAuth,
115
- M as getPageAuthBtn,
116
- O as getPersonalInfo,
117
- b as getProjectInfo,
118
- I as getSubApps,
119
- v as getTabInfo,
120
- P as getTenantInfo,
121
- S as getToken,
122
- J as getUserInfo
140
+ z as getFavIcon,
141
+ M as getHomeInfo,
142
+ E as getInstanceInfo,
143
+ D as getMenus,
144
+ k as getMinioAddress,
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,
152
+ U as getTabInfo,
153
+ J as getTenantInfo,
154
+ y as getToken,
155
+ T as getUserInfo
123
156
  };
Binary file
@@ -46,14 +46,24 @@ export interface TenantInfo {
46
46
  }
47
47
 
48
48
  export interface HomeInfo {
49
+ /** 应用code */
49
50
  applicationCode: string
51
+ /** 应用path */
50
52
  applicationPath: string
53
+ /** 是否启用 */
51
54
  enable: boolean
52
55
  originalCode: string
53
56
  routeUrl: string
54
57
  type: number | null
55
58
  }
56
59
 
60
+ export interface PersonalConfigInfo {
61
+ /** 侧边栏菜单风格(1:弹出式;2:内嵌式 )*/
62
+ style: 1 | 2
63
+ /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
64
+ skinStyle: 'default' | 'kjl' | 'cjb' | 'ssl'
65
+ }
66
+
57
67
  export interface ProjectInfo {
58
68
  /** 项目id */
59
69
  id: string
@@ -61,13 +71,13 @@ export interface ProjectInfo {
61
71
  code: string
62
72
  /** 项目名称 */
63
73
  name: string
64
- /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
74
+ /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
65
75
  type: string
66
76
  /** 父级id */
67
77
  parentId?: string
68
78
  /** 父级名称 */
69
79
  parentName?: string
70
- /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
80
+ /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
71
81
  parentType?: number
72
82
  /** 租户id */
73
83
  tenantId?: string
@@ -79,6 +89,51 @@ export interface ProjectInfo {
79
89
  optional?: boolean
80
90
  }
81
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
+
82
137
  export interface SubAppsInfo {
83
138
  /** 所有应用信息 */
84
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
@@ -136,5 +136,7 @@
136
136
  "useKonva": "/dimple-canvas/use-dimple-canvas/core/konva/index",
137
137
  "setShowWatermark": "/common-tools/platform-tools/index",
138
138
  "extractFilename": "/common-tools/extract-file-name/index",
139
- "setBrowseTitle": "/common-tools/update-browser-title/index"
139
+ "setBrowseTitle": "/common-tools/update-browser-title/index",
140
+ "getPersonalConfig": "/common-info/index",
141
+ "getProjectMessage": "/common-info/index"
140
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.4.0-test.5.1",
3
+ "version": "6.4.0-test.6",
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-test.5.1",
12
+ "@das-fed/utils": "6.4.0-test.6",
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-test.5.1",
25
- "@das-fed/web": "6.4.0-test.5.1",
24
+ "@das-fed/cli": "6.4.0-test.6",
25
+ "@das-fed/web": "6.4.0-test.6",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",