@das-fed/utils 6.4.0-dev.55.21 → 6.4.0-dev.55.23

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, SubAppsInfo, TabInfo, permissionBtnInfo } from './type';
2
2
 
3
3
  /** 获取token */
4
4
  export declare const getToken: any;
@@ -15,6 +15,7 @@ export declare const getTenantInfo: () => TenantInfo;
15
15
  export declare const getProjectInfo: () => ProjectInfo;
16
16
  /** 获取首页信息 */
17
17
  export declare const getHomeInfo: () => HomeInfo;
18
+ export declare const getPersonalConfig: () => PersonalConfigInfo;
18
19
  /**
19
20
  * 可用于判断菜单或者按钮权限
20
21
  * @param menuCode 菜单编码
@@ -1,4 +1,4 @@
1
- import { getConfig as p } from "@das-fed/utils/config";
1
+ import { getConfig as l } from "@das-fed/utils/config";
2
2
  import { getUrlParams as g } from "@das-fed/utils/common-tools";
3
3
  import { getAccessToken as m } from "@das-fed/utils/token-tools";
4
4
  import { getTokenFromQuery as f, getProjectInfoFromQuery as d } from "@das-fed/utils/common-info/getInfoFromUrl";
@@ -13,7 +13,7 @@ const S = m, J = () => {
13
13
  };
14
14
  }, O = () => {
15
15
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
16
- const t = p();
16
+ const t = l();
17
17
  return JSON.stringify(e) === "{}" && t.personalInfo && (e = t.personalInfo), {
18
18
  id: e.id ?? "",
19
19
  name: e.name ?? "",
@@ -35,7 +35,7 @@ const S = m, J = () => {
35
35
  };
36
36
  }, b = () => {
37
37
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
38
- const t = p();
38
+ const t = l();
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,
@@ -59,14 +59,20 @@ const S = m, J = () => {
59
59
  routeUrl: (e == null ? void 0 : e.routeUrl) ?? "",
60
60
  type: (e == null ? void 0 : e.type) ?? null
61
61
  };
62
+ }, M = () => {
63
+ const e = JSON.parse(sessionStorage.getItem("personal-config") || "{}");
64
+ return {
65
+ style: (e == null ? void 0 : e.style) ?? "",
66
+ skinStyle: (e == null ? void 0 : e.skinStyle) ?? ""
67
+ };
62
68
  }, h = (e, t) => {
63
69
  const n = "permission-btn", s = I(), a = g(location.href, "app") || "", r = t || a || s.currentSubAppCode;
64
70
  if (!r) return;
65
- const o = g(location.href, "menu") || "", l = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
71
+ const o = g(location.href, "menu") || "", p = e || o || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
66
72
  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 = () => {
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 = () => {
70
76
  const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
71
77
  return {
72
78
  appcategorys: e.appcategorys ?? [],
@@ -75,7 +81,7 @@ const S = m, J = () => {
75
81
  subAppList: e.subAppList ?? [],
76
82
  menuCollapses: e.menuCollapses ?? []
77
83
  };
78
- }, j = (e, t = !1) => {
84
+ }, v = (e, t = !1) => {
79
85
  var s, a;
80
86
  const n = I().subAppList;
81
87
  if (e)
@@ -88,7 +94,7 @@ const S = m, J = () => {
88
94
  r[o.code] = o.menus ?? [];
89
95
  }), r;
90
96
  }
91
- }, v = () => {
97
+ }, U = () => {
92
98
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
93
99
  return {
94
100
  currentCode: e.currentCode ?? "",
@@ -96,27 +102,28 @@ const S = m, J = () => {
96
102
  tabMap: e.tabMap ?? {},
97
103
  preTab: e.preTab ?? {}
98
104
  };
99
- }, U = () => {
100
- const e = p(), t = sessionStorage.getItem("minioAddress");
105
+ }, k = () => {
106
+ const e = l(), t = sessionStorage.getItem("minioAddress");
101
107
  return t || (e.baseURL ? e.baseURL : location.origin);
102
- }, k = () => ({
108
+ }, E = () => ({
103
109
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
104
- }), E = () => localStorage.getItem("fav-icon") || "./logo.svg";
110
+ }), F = () => localStorage.getItem("fav-icon") || "./logo.svg";
105
111
  S() || f();
106
112
  var i;
107
113
  (i = b()) != null && i.id || d();
108
114
  export {
109
- E as getFavIcon,
115
+ F as getFavIcon,
110
116
  T as getHomeInfo,
111
- k as getInstanceInfo,
112
- j as getMenus,
113
- U as getMinioAddress,
117
+ E as getInstanceInfo,
118
+ v as getMenus,
119
+ k as getMinioAddress,
114
120
  h as getPageAuth,
115
- M as getPageAuthBtn,
121
+ j as getPageAuthBtn,
122
+ M as getPersonalConfig,
116
123
  O as getPersonalInfo,
117
124
  b as getProjectInfo,
118
125
  I as getSubApps,
119
- v as getTabInfo,
126
+ U as getTabInfo,
120
127
  P as getTenantInfo,
121
128
  S as getToken,
122
129
  J as getUserInfo
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: string
63
+ /** 皮肤风格 (default:默认皮肤;kjl:科技蓝;cjb:纯净白;ssl:深邃蓝)*/
64
+ skinStyle: string
65
+ }
66
+
57
67
  export interface ProjectInfo {
58
68
  /** 项目id */
59
69
  id: string
package/esm-map.json CHANGED
@@ -136,5 +136,6 @@
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"
140
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.4.0-dev.55.21",
3
+ "version": "6.4.0-dev.55.23",
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.21",
12
+ "@das-fed/utils": "6.4.0-dev.55.23",
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.21",
25
- "@das-fed/web": "6.4.0-dev.55.21",
24
+ "@das-fed/cli": "6.4.0-dev.55.23",
25
+ "@das-fed/web": "6.4.0-dev.55.23",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",