@das-fed/utils 6.3.0-beta.9 → 6.4.0-dev.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.
Files changed (39) hide show
  1. package/api-services/modules/file/index.d.ts +1 -1
  2. package/api-services/modules/file/index.js +253 -244
  3. package/api-services/modules/file/index.js.gz +0 -0
  4. package/common-info/set-personal-info/index.js +591 -565
  5. package/common-info/set-personal-info/index.js.gz +0 -0
  6. package/common-tools/date-format/index.js +2 -1
  7. package/common-tools/get-url-params/index.d.ts +1 -1
  8. package/common-tools/get-url-params/index.js +49 -46
  9. package/common-tools/get-url-params/index.js.gz +0 -0
  10. package/common-tools/update-fav-icon/index.js +1 -1
  11. package/create-api-service/index.js +1405 -1371
  12. package/create-api-service/index.js.gz +0 -0
  13. package/create-api-service/sso/index.js +739 -714
  14. package/create-api-service/sso/index.js.gz +0 -0
  15. package/curring-http/index.js +856 -830
  16. package/curring-http/index.js.gz +0 -0
  17. package/directive/auth/index.d.ts +8 -0
  18. package/directive/auth/index.js +62 -0
  19. package/directive/auth/index.js.gz +0 -0
  20. package/directive/clickOutside/index.d.ts +6 -0
  21. package/directive/clickOutside/index.js +27 -0
  22. package/directive/hoverInside/index.d.ts +6 -0
  23. package/directive/hoverInside/index.js +21 -0
  24. package/directive/utils/index.d.ts +7 -0
  25. package/directive/utils/index.js +7 -0
  26. package/esm-map.json +135 -5
  27. package/hooks/popup-manager/use-zindex/index.d.ts +5 -0
  28. package/hooks/popup-manager/use-zindex/index.js +22 -0
  29. package/hooks/use-get-auth/apis.d.ts +4 -0
  30. package/hooks/use-get-auth/index.d.ts +9 -0
  31. package/hooks/use-get-auth/index.js +53 -0
  32. package/hooks/use-get-auth/index.js.gz +0 -0
  33. package/package.json +5 -3
  34. package/pinyin-first-character/index.js +142 -132
  35. package/pinyin-first-character/index.js.gz +0 -0
  36. package/style/index.js +1 -1
  37. package/style/index.js.gz +0 -0
  38. package/vue/hooks/use-model-value/index.d.ts +5 -0
  39. package/vue/hooks/use-model-value/index.js +10 -0
Binary file
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 权限控制工具
3
+ * @param el 绑定的dom
4
+ * @param binding 使用指令时对应binding,使用函数时对应options
5
+ * @param vnode
6
+ * @returns 是否有权限
7
+ */
8
+ export declare const vAuth: (el: any, binding: any) => boolean;
@@ -0,0 +1,62 @@
1
+ import { getUrlParams as i, flatTree as P } from "@das-fed/utils/common-tools";
2
+ import { getSubApps as v, getPageAuth as o } from "@das-fed/utils/common-info";
3
+ import { getEl as h } from "@das-fed/utils/directive/utils";
4
+ const A = (e, t) => {
5
+ if (!e || !t) return !1;
6
+ if (typeof t == "string")
7
+ return !!e.find((s) => s.code === t);
8
+ {
9
+ let r = !1;
10
+ for (let s of t)
11
+ if (e.find((a) => a.code === s)) {
12
+ r = !0;
13
+ break;
14
+ }
15
+ return r;
16
+ }
17
+ }, m = (e) => {
18
+ var n;
19
+ const t = (e == null ? void 0 : e.code) ?? "", r = (e == null ? void 0 : e.path) ?? (location == null ? void 0 : location.pathname) ?? "", s = (e == null ? void 0 : e.applicationCode) ?? i(location.href, "app");
20
+ let l = "";
21
+ if (l = e != null && e.menuCode ? e.menuCode : i(location.href, "menu"), !l) {
22
+ const c = ((n = v().currentSubApp) == null ? void 0 : n.menus) ?? [];
23
+ if (c && c.length) {
24
+ const d = P(c).filter((f) => f == null ? void 0 : f.routeUrl);
25
+ if (d && d.length) {
26
+ const f = d.find((u) => u != null && u.applicationPath ? r == null ? void 0 : r.includes("/" + u.applicationPath + u.routeUrl) : r == null ? void 0 : r.includes(u.routeUrl));
27
+ f && (l = (f == null ? void 0 : f.code) ?? "");
28
+ }
29
+ }
30
+ }
31
+ let a = !1;
32
+ if (t) {
33
+ const c = o(l, s) ?? [];
34
+ a = A(c, t);
35
+ } else
36
+ a = !!o(l, s);
37
+ return a;
38
+ }, g = (e, t) => {
39
+ t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
40
+ }, b = (e, t) => {
41
+ t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
42
+ }, U = (e, t) => {
43
+ let r = (e ? t.value : t) || {};
44
+ typeof r == "string" && (r = { code: r });
45
+ const s = (r == null ? void 0 : r.type) ?? "hide", l = m(r);
46
+ if (e)
47
+ if (!t.oldValue)
48
+ l || h(e, r).then((a) => {
49
+ g(a, s);
50
+ });
51
+ else {
52
+ const a = m(t.oldValue), n = l;
53
+ if (a === n) return;
54
+ h(e, r).then((c) => {
55
+ n ? b(c, s) : g(c, s);
56
+ });
57
+ }
58
+ return l;
59
+ };
60
+ export {
61
+ U as vAuth
62
+ };
Binary file
@@ -0,0 +1,6 @@
1
+ import { Directive } from 'vue';
2
+
3
+ /**
4
+ * 点击当前区域或者指定区域之外的位置
5
+ */
6
+ export declare const vClickOutside: Directive<HTMLElement>;
@@ -0,0 +1,27 @@
1
+ import { getEl as r } from "@das-fed/utils/directive/utils";
2
+ const f = {
3
+ mounted: async (i, _) => {
4
+ const e = _.value, t = await r(i, e);
5
+ function c(n) {
6
+ let l = !0;
7
+ if (Array.isArray(t))
8
+ for (let o of t)
9
+ o.__click_outside__ = c, o.contains(n.target) && (l = !1);
10
+ else
11
+ t.contains(n.target) && (l = !1), t.__click_outside__ = c;
12
+ l && e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(n));
13
+ }
14
+ document.addEventListener("click", c);
15
+ },
16
+ beforeUnmount: async (i, _) => {
17
+ const e = _.value, t = await r(i, e);
18
+ if (Array.isArray(t))
19
+ for (let c of t)
20
+ document.removeEventListener("click", c.__click_outside__), delete c.__click_outside__;
21
+ else
22
+ document.removeEventListener("click", t.__click_outside__), delete t.__click_outside__;
23
+ }
24
+ };
25
+ export {
26
+ f as vClickOutside
27
+ };
@@ -0,0 +1,6 @@
1
+ import { Directive } from 'vue';
2
+
3
+ /**
4
+ * 指令:鼠标移入移除dom事件
5
+ */
6
+ export declare const vHoverInside: Directive<HTMLElement>;
@@ -0,0 +1,21 @@
1
+ import { getEl as r } from "@das-fed/utils/directive/utils";
2
+ const o = {
3
+ mounted: async (s, a) => {
4
+ const e = a.value, n = await r(s, e);
5
+ function i(t, d) {
6
+ n._inside_event = i, typeof e == "function" ? e(t, d) : e != null && e.fn && typeof (e == null ? void 0 : e.fn) == "function" && (e == null || e.fn(t, d));
7
+ }
8
+ n.addEventListener("mouseenter", (t) => {
9
+ i(!0, t);
10
+ }), n.addEventListener("mouseleave", (t) => {
11
+ i(!1, t);
12
+ });
13
+ },
14
+ beforeUnmount: async (s, a) => {
15
+ const e = a.value, n = await r(s, e);
16
+ n.addEventListener("mouseenter", n._inside_event), n.addEventListener("mouseleave", n._inside_event), delete n._inside_event;
17
+ }
18
+ };
19
+ export {
20
+ o as vHoverInside
21
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 获取指定dom
3
+ * @param el
4
+ * @param options
5
+ * @returns
6
+ */
7
+ export declare const getEl: (el: HTMLElement, options: any) => Promise<HTMLElement>;
@@ -0,0 +1,7 @@
1
+ const a = async (r, t) => {
2
+ let e = r;
3
+ return t != null && t.target && (typeof t.target == "string" && (e = t.target), typeof t.target == "function" && (e = await t.target(r))), e;
4
+ };
5
+ export {
6
+ a as getEl
7
+ };
package/esm-map.json CHANGED
@@ -1,8 +1,138 @@
1
1
  {
2
- "SFCWithInstall": "/with-install/index",
3
2
  "withInstall": "/with-install/index",
4
- "vClickOutside": "/directive/index",
5
- "vHoverInside": "/directive/index",
6
- "getEl": "/directive/utils",
7
- "vAuth": "/directive/auth"
3
+ "vAuth": "/directive/auth/index",
4
+ "vHoverInside": "/directive/hoverInside/index",
5
+ "vClickOutside": "/directive/clickOutside/index",
6
+ "getEl": "/directive/utils/index",
7
+ "createService": "/api-services/src/create-service/index",
8
+ "appManage": "/api-services/modules/app-manage/index",
9
+ "authentication": "/api-services/modules/authentication/index",
10
+ "bemsModules": "/api-services/modules/bems/index",
11
+ "contract": "/api-services/modules/contract/index",
12
+ "dutyModules": "/api-services/modules/duty-manage/index",
13
+ "enterpriseright": "/api-services/modules/enterpriseright/index",
14
+ "downloadFile": "/api-services/modules/file/index",
15
+ "useFile": "/api-services/modules/file/index",
16
+ "gatewayEdge": "/api-services/modules/gateway-edge/index",
17
+ "iot": "/api-services/modules/iot/index",
18
+ "iotMinio": "/api-services/modules/iot/index",
19
+ "iotModules": "/api-services/modules/iot/index",
20
+ "iotProgress": "/api-services/modules/iot/index",
21
+ "iotRelationModules": "/api-services/modules/iot/index",
22
+ "justauth": "/api-services/modules/justauth/index",
23
+ "oauthServer": "/api-services/modules/justauth/index",
24
+ "knowledgeBase": "/api-services/modules/knowledge/index",
25
+ "daslink": "/api-services/modules/link/index",
26
+ "permission": "/api-services/modules/permission/index",
27
+ "company": "/api-services/modules/platformManage/index",
28
+ "customer": "/api-services/modules/platformManage/index",
29
+ "customerGrade": "/api-services/modules/platformManage/index",
30
+ "customerType": "/api-services/modules/platformManage/index",
31
+ "projectManage": "/api-services/modules/platformManage/index",
32
+ "portal": "/api-services/modules/portal/index",
33
+ "spaceManage": "/api-services/modules/space-manage/index",
34
+ "superadminLicense": "/api-services/modules/super-admin/index",
35
+ "superadminPermission": "/api-services/modules/super-admin/index",
36
+ "superadminPortal": "/api-services/modules/super-admin/index",
37
+ "superadminResource": "/api-services/modules/super-admin/index",
38
+ "supplier": "/api-services/modules/supplier/index",
39
+ "supplierClassification": "/api-services/modules/supplier/index",
40
+ "supplierManage": "/api-services/modules/supplier/index",
41
+ "enterpriseadminBrandModel": "/api-services/modules/supplychain-manage/index",
42
+ "tool": "/api-services/modules/tool/index",
43
+ "systemConfiguration": "/api-services/modules/systemConfiguration/index",
44
+ "getToken": "/create-api-service/sso/index",
45
+ "getUserInfo": "/common-info/index",
46
+ "getPersonalInfo": "/common-info/index",
47
+ "getTenantInfo": "/common-info/index",
48
+ "getProjectInfo": "/common-info/index",
49
+ "getHomeInfo": "/common-info/index",
50
+ "getPageAuth": "/common-info/index",
51
+ "getPageAuthBtn": "/common-info/index",
52
+ "getSubApps": "/common-info/index",
53
+ "getMenus": "/common-info/index",
54
+ "getTabInfo": "/common-info/index",
55
+ "getMinioAddress": "/common-info/index",
56
+ "getInstanceInfo": "/common-info/index",
57
+ "getFavIcon": "/common-info/index",
58
+ "dateFormat": "/common-tools/date-format/index",
59
+ "getOriginFromUrl": "/common-tools/get-url-params/index",
60
+ "getUrlParams": "/common-tools/get-url-params/index",
61
+ "getFullPath": "/common-tools/get-url-params/index",
62
+ "funcUrlDel": "/common-tools/get-url-params/index",
63
+ "urlParamsToObject": "/common-tools/get-url-params/index",
64
+ "objectToUrlparams": "/common-tools/get-url-params/index",
65
+ "addPathParamsToUrl": "/common-tools/get-url-params/index",
66
+ "findNonEmptyChildrenItems": "/common-tools/nest-tree-format/index",
67
+ "flatTree": "/common-tools/nest-tree-format/index",
68
+ "filterTreeArray": "/common-tools/nest-tree-format/index",
69
+ "treeFind": "/common-tools/nest-tree-format/index",
70
+ "objEqual": "/common-tools/obj-tools/index",
71
+ "arrEqual": "/common-tools/arr-tools/index",
72
+ "arrUnique": "/common-tools/arr-tools/index",
73
+ "isEmpty": "/common-tools/handle-data/index",
74
+ "setHtmlMinWH": "/common-tools/setHtmlMinWH/index",
75
+ "runPromiseByQueue": "/common-tools/queue-promise/index",
76
+ "isRelativeOrSameDomain": "/common-tools/platform-tools/index",
77
+ "setShowLayout": "/common-tools/platform-tools/index",
78
+ "withToken": "/common-tools/platform-tools/index",
79
+ "updateFavIcon": "/common-tools/update-fav-icon/index",
80
+ "setDasHtmlIcon": "/common-tools/update-fav-icon/index",
81
+ "encryption": "/atob/index",
82
+ "decrypt": "/atob/index",
83
+ "getConfig": "/config/index",
84
+ "curringHttp": "/curring-http/index",
85
+ "oss": "/oss/index",
86
+ "DomWatcher": "/dom-watcher/index",
87
+ "setProcessEngineToken": "/process-engine-info/index",
88
+ "removeProcessEngineToken": "/process-engine-info/index",
89
+ "setProcessEngineProject": "/process-engine-info/index",
90
+ "removeProcessEngineProject": "/process-engine-info/index",
91
+ "tokenNextTick_1": "/nextTiken/index",
92
+ "projectNextTick": "/nextTiken/index",
93
+ "tokenNextTick": "/nextTiken/index",
94
+ "userInfoNextTick": "/nextTiken/index",
95
+ "tenantInfoNextTick": "/nextTiken/index",
96
+ "useDimpleCanvas": "/dimple-canvas/use-dimple-canvas/index",
97
+ "Konva": "/dimple-canvas/use-dimple-canvas/core/konva/index",
98
+ "loadJs": "/load-js/index",
99
+ "pureImageSrc": "/pure-image-src/index",
100
+ "SizeWatcher": "/size-watcher/index",
101
+ "useSizeWatcher": "/size-watcher/index",
102
+ "hasClass": "/style/index",
103
+ "addClass": "/style/index",
104
+ "removeClass": "/style/index",
105
+ "getStyle": "/style/index",
106
+ "getCSS": "/style/index",
107
+ "createStyle": "/style/index",
108
+ "updateStyle": "/style/index",
109
+ "curringMath": "/style/index",
110
+ "useModelValue": "/vue/hooks/use-model-value/index",
111
+ "getAccessToken": "/token-tools/index",
112
+ "getAccessTokenInfo": "/token-tools/index",
113
+ "setAccessToken": "/token-tools/index",
114
+ "removeAccessToken": "/token-tools/index",
115
+ "clearAllCookies": "/token-tools/index",
116
+ "socketService": "/webSocket-service/index",
117
+ "getTokenFromQuery": "/common-info/getInfoFromUrl/index",
118
+ "getProjectInfoFromQuery": "/common-info/getInfoFromUrl/index",
119
+ "getIframeUrl": "/common-info/getIframeUrl/index",
120
+ "LowCode": "/use-low-code/index",
121
+ "domCheckIn": "/dom-check-in/index",
122
+ "setPersonalInfo": "/common-info/set-personal-info/index",
123
+ "proxySso": "/create-api-service/proxy-sso/index",
124
+ "addMicroAppProxySsoEvent": "/create-api-service/proxy-sso/index",
125
+ "getTokenParams": "/create-api-service/sso/index",
126
+ "getTokenFromCode": "/create-api-service/sso/index",
127
+ "real_uri": "/create-api-service/sso/index",
128
+ "getQuery": "/create-api-service/sso/index",
129
+ "tokenStorage": "/create-api-service/sso/index",
130
+ "login": "/create-api-service/sso/index",
131
+ "useGetAuth": "/hooks/use-get-auth/index",
132
+ "getPinyinFirstCharacter": "/pinyin-first-character/index",
133
+ "useZIndex": "/hooks/popup-manager/use-zindex/index",
134
+ "Graph": "/dimple-canvas/use-dimple-canvas/core/antv-x6/index",
135
+ "useAntvX6": "/dimple-canvas/use-dimple-canvas/core/antv-x6/index",
136
+ "addObject": "/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index",
137
+ "useKonva": "/dimple-canvas/use-dimple-canvas/core/konva/index"
8
138
  }
@@ -0,0 +1,5 @@
1
+ export declare const useZIndex: () => {
2
+ initialZIndex: any;
3
+ currentZIndex: any;
4
+ nextZIndex: () => any;
5
+ };
@@ -0,0 +1,22 @@
1
+ import { ref as I, getCurrentInstance as u, inject as s, computed as e, unref as i } from "vue";
2
+ const Z = (n) => typeof n == "number", c = I(0), l = 2e3, a = Symbol("zIndexContextKey"), v = (n) => {
3
+ const t = u() ? s(a, void 0) : void 0, r = e(() => {
4
+ const d = i(t);
5
+ return Z(d) ? d : l;
6
+ }), x = e(() => r.value + c.value);
7
+ return {
8
+ initialZIndex: r,
9
+ currentZIndex: x,
10
+ nextZIndex: () => (c.value++, x.value)
11
+ };
12
+ }, o = v(), f = () => {
13
+ const n = e(() => o.initialZIndex.value), t = e(() => o.currentZIndex.value);
14
+ return {
15
+ initialZIndex: n,
16
+ currentZIndex: t,
17
+ nextZIndex: () => o.nextZIndex()
18
+ };
19
+ };
20
+ export {
21
+ f as useZIndex
22
+ };
@@ -0,0 +1,4 @@
1
+ export declare const appcategory: any;
2
+ export declare const superadminAppcategory: any;
3
+ export declare const enterpriserightQueryportalmenu: any;
4
+ export declare const superadminQuerymenu: any;
@@ -0,0 +1,9 @@
1
+ export declare const useGetAuth: () => {
2
+ getApplication: (code?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
3
+ getMenu: (code: string, menuCode?: string, path?: string, appName?: "superadmin" | "enterpriseadmin") => unknown;
4
+ getAuth: (options: {
5
+ applicationCode: string;
6
+ menuCode: string;
7
+ code: string;
8
+ }, appName?: "superadmin" | "enterpriseadmin") => unknown;
9
+ };
@@ -0,0 +1,53 @@
1
+ import { flatTree as w } from "@das-fed/utils/common-tools";
2
+ import { projectNextTick as A } from "@das-fed/utils/nextTiken";
3
+ import { vAuth as M } from "@das-fed/utils/directive/auth";
4
+ import { portal as T, superadminPortal as y, enterpriseright as U } from "@das-fed/utils/api-services/modules";
5
+ const v = T.get("/appcategory"), B = y.get("/appcategory"), C = U.get("/permissionset/user-portal-menu"), L = y.get("/user-menu"), k = () => {
6
+ const d = async (r, i = "enterpriseadmin") => {
7
+ let t = null, s = {};
8
+ await A(), i === "superadmin" ? t = B().run : (s = { userType: 1 }, t = v().run);
9
+ const [a, l] = await t(s);
10
+ if (a || !l || !l.length) return null;
11
+ const f = l.map((o) => o.apps).flat();
12
+ return r ? f.find((o) => o.code === r) : f;
13
+ }, g = async (r, i, t, s = "enterpriseadmin") => {
14
+ var c;
15
+ await A();
16
+ let a = null, l = {
17
+ code: r,
18
+ showBtn: !0
19
+ };
20
+ s === "superadmin" ? a = L().run : (l.userType = 1, a = C().run);
21
+ const [f, e] = await a(l);
22
+ if (f || !e || !e.length)
23
+ return i || t ? void 0 : [];
24
+ if (!i && !t) return e;
25
+ const o = e != null && e.length ? e.filter((n) => n.routeUrl) : [], m = e != null && e.length ? e.filter((n) => !n.routeUrl && n.children).map((n) => n.children).flat() : [], p = [...o, ...m];
26
+ let u;
27
+ if (i)
28
+ u = p.find((n) => n.code === i || n.originalCode === i);
29
+ else if (t) {
30
+ const n = t.replace(((c = p[0]) == null ? void 0 : c.applicationPath) ?? "", "").replace(/\/\//g, "/");
31
+ u = p.find((h) => h.routeUrl && h.routeUrl === n);
32
+ }
33
+ return u;
34
+ };
35
+ return {
36
+ getApplication: d,
37
+ getMenu: g,
38
+ getAuth: async (r, i = "enterpriseadmin") => {
39
+ var p;
40
+ const t = (r == null ? void 0 : r.applicationCode) ?? "", s = (r == null ? void 0 : r.menuCode) ?? "", a = (r == null ? void 0 : r.code) ?? "";
41
+ if (JSON.parse(sessionStorage.getItem("permission-btn") || "{}")[s]) return M(null, { applicationCode: t, menuCode: s, code: a });
42
+ if (!await d(t, i)) return !1;
43
+ const e = await g(t, s, i);
44
+ return !e || !(e != null && e.children) || !((p = e.children) != null && p.length) ? !1 : !!w(e.children).find((u) => {
45
+ let c = (u == null ? void 0 : u.originalCode) ?? u.code;
46
+ return c.includes(s + ".") && (c = c.replace(s + ".", "").replaceAll(".", "-")), c === a;
47
+ });
48
+ }
49
+ };
50
+ };
51
+ export {
52
+ k as useGetAuth
53
+ };
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "6.3.0-beta.9",
3
+ "version": "6.4.0-dev.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.3.0-beta.9",
12
+ "@das-fed/utils": "6.4.0-dev.2",
13
13
  "@vue/shared": "^3.4.21",
14
14
  "@vueuse/core": "^9.6.0",
15
15
  "axios": "^1.6.7",
@@ -21,8 +21,10 @@
21
21
  "vue": "^3.4.21"
22
22
  },
23
23
  "devDependencies": {
24
- "@das-fed/cli": "6.3.0-beta.9",
24
+ "@das-fed/cli": "6.4.0-dev.2",
25
+ "@types/js-cookie": "^3.0.6",
25
26
  "@types/lodash-es": "^4.17.12",
27
+ "@types/qs": "^6.9.15",
26
28
  "@vitejs/plugin-vue": "^5.0.4",
27
29
  "@vitejs/plugin-vue-jsx": "^3.1.0",
28
30
  "ant-design-vue": "3.2.20",