@das-fed/utils 6.4.0-test.3 → 6.4.0-test.3.2

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,8 +1,8 @@
1
- import { getConfig as i } from "@das-fed/utils/config";
2
- import { getUrlParams as p } from "@das-fed/utils/common-tools";
3
- import { getAccessToken as I } from "@das-fed/utils/token-tools";
4
- import { getTokenFromQuery as m, getProjectInfoFromQuery as d } from "@das-fed/utils/common-info/getInfoFromUrl";
5
- const S = I, O = () => {
1
+ import { getConfig as p } from "@das-fed/utils/config";
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
6
  var n;
7
7
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
8
8
  return {
@@ -11,9 +11,9 @@ const S = I, O = () => {
11
11
  flag: e.flag ?? null,
12
12
  tenantId: ((n = e == null ? void 0 : e.tenant) == null ? void 0 : n.id) ?? ""
13
13
  };
14
- }, P = () => {
14
+ }, O = () => {
15
15
  let e = JSON.parse(sessionStorage.getItem("userInfo") || "{}");
16
- const t = i();
16
+ const t = p();
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 = I, O = () => {
22
22
  email: e.email ?? "",
23
23
  headPicture: e.headPicture ?? ""
24
24
  };
25
- }, y = () => {
25
+ }, P = () => {
26
26
  let e = JSON.parse(sessionStorage.getItem("tenantInfo") || "{}");
27
27
  return {
28
28
  userId: e.id ?? "",
@@ -35,14 +35,21 @@ const S = I, O = () => {
35
35
  };
36
36
  }, b = () => {
37
37
  let e = JSON.parse(sessionStorage.getItem("projectInfo") || "{}");
38
- const t = i();
38
+ const t = p();
39
39
  return JSON.stringify(e) === "{}" && t.projectInfo && (e = t.projectInfo), {
40
40
  id: (e == null ? void 0 : e.id) ?? 0,
41
- parentId: (e == null ? void 0 : e.parentId) ?? "",
41
+ code: (e == null ? void 0 : e.code) ?? 0,
42
42
  name: (e == null ? void 0 : e.name) ?? "",
43
- tenantId: (e == null ? void 0 : e.tenant) ?? ""
43
+ type: (e == null ? void 0 : e.type) ?? null,
44
+ parentId: (e == null ? void 0 : e.parentId) ?? "",
45
+ parentName: (e == null ? void 0 : e.parentName) ?? "",
46
+ parentType: (e == null ? void 0 : e.parentType) ?? null,
47
+ tenantId: (e == null ? void 0 : e.tenant) ?? "",
48
+ isParent: (e == null ? void 0 : e.isParent) ?? !1,
49
+ leaf: (e == null ? void 0 : e.leaf) ?? !1,
50
+ optional: (e == null ? void 0 : e.leaf) ?? !0
44
51
  };
45
- }, M = () => {
52
+ }, T = () => {
46
53
  const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
47
54
  return {
48
55
  applicationCode: (e == null ? void 0 : e.applicationCode) ?? "",
@@ -53,13 +60,13 @@ const S = I, O = () => {
53
60
  type: (e == null ? void 0 : e.type) ?? null
54
61
  };
55
62
  }, h = (e, t) => {
56
- const n = "permission-btn", s = f(), a = p(location.href, "app") || "", o = t || a || s.currentSubAppCode;
57
- if (!o) return;
58
- const r = p(location.href, "menu") || "", g = e || r || s.currentSubApp.currentMenuCode, c = JSON.parse(sessionStorage.getItem(n) || "{}");
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) || "{}");
59
66
  if (!c || JSON.stringify(c) === "{}") return;
60
- const u = c[o][g];
61
- return u && u.length ? u : c[o]["origin-auth"] ? c[o]["origin-auth"][g] ?? [] : [];
62
- }, T = (e, t) => h(e, t) ?? [], f = () => {
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 = () => {
63
70
  const e = JSON.parse(sessionStorage.getItem("subApps") || "{}");
64
71
  return {
65
72
  appcategorys: e.appcategorys ?? [],
@@ -70,16 +77,16 @@ const S = I, O = () => {
70
77
  };
71
78
  }, j = (e, t = !1) => {
72
79
  var s, a;
73
- const n = f().subAppList;
80
+ const n = I().subAppList;
74
81
  if (e)
75
- return t ? ((s = n == null ? void 0 : n.find((o) => o.code === e)) == null ? void 0 : s.originalMenus) ?? [] : ((a = n == null ? void 0 : n.find((o) => o.code === e)) == null ? void 0 : a.menus) ?? [];
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) ?? [];
76
83
  {
77
- let o = {};
78
- return t ? n == null || n.forEach((r) => {
79
- o[r.code] = r.originalMenus ?? [];
80
- }) : n == null || n.forEach((r) => {
81
- o[r.code] = r.menus ?? [];
82
- }), o;
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;
83
90
  }
84
91
  }, v = () => {
85
92
  const e = JSON.parse(sessionStorage.getItem("tabs") || "{}");
@@ -90,27 +97,27 @@ const S = I, O = () => {
90
97
  preTab: e.preTab ?? {}
91
98
  };
92
99
  }, U = () => {
93
- const e = i(), t = sessionStorage.getItem("minioAddress");
100
+ const e = p(), t = sessionStorage.getItem("minioAddress");
94
101
  return t || (e.baseURL ? e.baseURL : location.origin);
95
102
  }, k = () => ({
96
103
  instanceInfo: JSON.parse(sessionStorage.getItem("instance") || "{}").instanceInfo ?? {}
97
104
  }), E = () => localStorage.getItem("fav-icon") || "./logo.svg";
98
- S() || m();
99
- var l;
100
- (l = b()) != null && l.id || d();
105
+ S() || f();
106
+ var i;
107
+ (i = b()) != null && i.id || d();
101
108
  export {
102
109
  E as getFavIcon,
103
- M as getHomeInfo,
110
+ T as getHomeInfo,
104
111
  k as getInstanceInfo,
105
112
  j as getMenus,
106
113
  U as getMinioAddress,
107
114
  h as getPageAuth,
108
- T as getPageAuthBtn,
109
- P as getPersonalInfo,
115
+ M as getPageAuthBtn,
116
+ O as getPersonalInfo,
110
117
  b as getProjectInfo,
111
- f as getSubApps,
118
+ I as getSubApps,
112
119
  v as getTabInfo,
113
- y as getTenantInfo,
120
+ P as getTenantInfo,
114
121
  S as getToken,
115
- O as getUserInfo
122
+ J as getUserInfo
116
123
  };
Binary file
@@ -56,13 +56,27 @@ export interface HomeInfo {
56
56
 
57
57
  export interface ProjectInfo {
58
58
  /** 项目id */
59
- id: string | number
60
- /** 父级id */
61
- parentId?: string
59
+ id: string
60
+ /** 项目编码 */
61
+ code: string
62
62
  /** 项目名称 */
63
63
  name: string
64
+ /** 项目类型: 1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
65
+ type: string
66
+ /** 父级id */
67
+ parentId?: string
68
+ /** 父级名称 */
69
+ parentName?: string
70
+ /** 父级项目类型:1: 集团、 2:公司、3: 区域、4: 分公司、 5: 子公司、6: 管理中心、 7: 项目、8: 部门、 9: 组 */
71
+ parentType?: number
64
72
  /** 租户id */
65
73
  tenantId?: string
74
+ /** 是否父级节点 */
75
+ isParent?: boolean
76
+ /** 是否叶子节点 */
77
+ leaf?: boolean
78
+ /** 是否可用 */
79
+ optional?: boolean
66
80
  }
67
81
 
68
82
  export interface SubAppsInfo {
@@ -1,21 +1,21 @@
1
1
  export default {
2
- 导入进度: "",
3
- 上传失败: "",
4
- 导入成功: "",
5
- 导出进度: "",
6
- 导出: "",
7
- 导入: "",
8
- 失败: "",
9
- 部分数据校验不通过: "",
10
- 请下载附件并修改: "",
11
- 重新导入: "",
12
- 成功: "",
13
- 部分: "",
14
- 参数校验错误: "",
15
- 接口地址未找到: "",
16
- 服务器内部错误: "",
17
- 解析错误: "",
18
- 网络异常: "",
19
- 请检查您的网络情况: "",
20
- 请求配置异常: "",
2
+ 导入进度: "导入进度",
3
+ 上传失败: "上传失败",
4
+ 导入成功: "导入成功",
5
+ 导出进度: "导出进度",
6
+ 导出: "导出",
7
+ 导入: "导入",
8
+ 失败: "失败",
9
+ 部分数据校验不通过: "部分数据校验不通过",
10
+ 请下载附件并修改: "请下载附件并修改",
11
+ 重新导入: "重新导入",
12
+ 成功: "成功",
13
+ 部分: "部分",
14
+ 参数校验错误: "参数校验错误",
15
+ 接口地址未找到: "接口地址未找到",
16
+ 服务器内部错误: "服务器内部错误",
17
+ 解析错误: "解析错误",
18
+ 网络异常: "网络异常",
19
+ 请检查您的网络情况: "请检查您的网络情况",
20
+ 请求配置异常: "请求配置异常",
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.4.0-test.3",
3
+ "version": "6.4.0-test.3.2",
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.3",
12
+ "@das-fed/utils": "6.4.0-test.3.2",
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.3",
25
- "@das-fed/web": "6.4.0-test.3",
24
+ "@das-fed/cli": "6.4.0-test.3.2",
25
+ "@das-fed/web": "6.4.0-test.3.2",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",