@das-fed/utils 1.0.4 → 1.0.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.
Files changed (44) hide show
  1. package/api-services/src/create-service.js +669 -667
  2. package/common-info/index.js +63 -62
  3. package/common-tools/get-url-params.js +0 -1
  4. package/dimple-canvas/index.d.ts +2 -0
  5. package/dimple-canvas/index.js +5 -0
  6. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +28 -0
  7. package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +19946 -0
  8. package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +53 -0
  9. package/dimple-canvas/use-dimple-canvas/core/konva/index.js +119 -0
  10. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +101 -0
  11. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +17 -0
  12. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +7 -0
  13. package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +55 -0
  14. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +5 -0
  15. package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +14 -0
  16. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +4 -0
  17. package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +5 -0
  18. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +4 -0
  19. package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +181 -0
  20. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +3 -0
  21. package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +7374 -0
  22. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +6 -0
  23. package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +13 -0
  24. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +3 -0
  25. package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +7 -0
  26. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +8 -0
  27. package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +193 -0
  28. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +10 -0
  29. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +20 -0
  30. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +4 -0
  31. package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +52 -0
  32. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +2 -0
  33. package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +14 -0
  34. package/dimple-canvas/use-dimple-canvas/index.d.ts +8 -0
  35. package/dimple-canvas/use-dimple-canvas/index.js +10 -0
  36. package/micro-app/globalData.d.ts +3 -0
  37. package/micro-app/globalData.js +11 -0
  38. package/micro-app/index.d.ts +5 -0
  39. package/micro-app/index.js +3699 -0
  40. package/nextTiken/index.d.ts +13 -0
  41. package/nextTiken/index.js +62 -0
  42. package/package.json +5 -6
  43. package/panel/index.d.ts +31 -0
  44. package/panel/index.js +37 -0
@@ -0,0 +1,13 @@
1
+ import type { PersonalInfo, TenantInfo } from '@das-fed/utils/common-info/type';
2
+ /** 等待获取到token */
3
+ export declare const tokenNextTick_1: () => Promise<string>;
4
+ /** 等待获取到projectId */
5
+ export declare const projectNextTick: () => Promise<string>;
6
+ /** 等待获取到token和projectId */
7
+ export declare const tokenNextTick: () => Promise<boolean>;
8
+ /** 等待获取到userInfo */
9
+ export declare const userInfoNextTick: () => Promise<PersonalInfo>;
10
+ /** 等待获取到租户信息 */
11
+ export declare const tenantInfoNextTick: () => Promise<TenantInfo>;
12
+ /** 等待获取到默认页配置 */
13
+ export declare const defaultInfoNextTick: () => Promise<any>;
@@ -0,0 +1,62 @@
1
+ import { getToken as s, getProjectInfo as r, getPersonalInfo as i, getTenantInfo as u } from "@das-fed/utils/common-info";
2
+ const k = () => new Promise((n) => {
3
+ const t = () => {
4
+ const e = s();
5
+ if (e)
6
+ return n(e);
7
+ setTimeout(() => t(), 50);
8
+ };
9
+ t();
10
+ }), m = () => new Promise((n) => {
11
+ const t = () => {
12
+ var o;
13
+ const e = ((o = r()) == null ? void 0 : o.id) ?? "";
14
+ if (e)
15
+ return n(e);
16
+ setTimeout(() => t(), 50);
17
+ };
18
+ t();
19
+ }), T = () => new Promise((n) => {
20
+ const t = () => {
21
+ var c;
22
+ const e = s(), o = ((c = r()) == null ? void 0 : c.id) ?? "";
23
+ if (e && o)
24
+ return n(!0);
25
+ setTimeout(() => t(), 50);
26
+ };
27
+ t();
28
+ }), I = () => new Promise((n) => {
29
+ const t = () => {
30
+ const e = i();
31
+ if (e != null && e.id)
32
+ return n(e);
33
+ setTimeout(() => t(), 50);
34
+ };
35
+ t();
36
+ }), P = () => new Promise((n) => {
37
+ const t = () => {
38
+ var o;
39
+ const e = u();
40
+ if ((o = e == null ? void 0 : e.tenant) != null && o.id)
41
+ return n(e);
42
+ setTimeout(() => t(), 50);
43
+ };
44
+ t();
45
+ }), g = () => new Promise((n) => {
46
+ const t = () => {
47
+ var o, c;
48
+ const e = JSON.parse(sessionStorage.getItem("home-config") || "{}");
49
+ if (e != null && e.info && ((o = r()) == null ? void 0 : o.id) === ((c = e == null ? void 0 : e.info) == null ? void 0 : c.projectId))
50
+ return n(e.info);
51
+ setTimeout(() => t(), 50);
52
+ };
53
+ t();
54
+ });
55
+ export {
56
+ g as defaultInfoNextTick,
57
+ m as projectNextTick,
58
+ P as tenantInfoNextTick,
59
+ T as tokenNextTick,
60
+ k as tokenNextTick_1,
61
+ I as userInfoNextTick
62
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -8,12 +8,13 @@
8
8
  "author": "",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
+ "@antv/x6": "^2.18.1",
11
12
  "@das-fed/ui": "1.1.3",
12
- "@das-fed/utils": "1.0.4",
13
+ "@das-fed/utils": "1.0.6",
13
14
  "@vue/shared": "^3.4.21",
14
15
  "axios": "^1.6.7",
15
16
  "dayjs": "^1.11.10",
16
- "lodash": "^4.17.21",
17
+ "konva": "^9.3.6",
17
18
  "nanoid": "3.2.0",
18
19
  "pinyin-pro": "^3.19.6",
19
20
  "vue": "^3.4.21"
@@ -25,13 +26,11 @@
25
26
  "fast-glob": "^3.3.2",
26
27
  "fs-extra": "^11.2.0",
27
28
  "js-cookie": "^3.0.5",
29
+ "lodash": "^4.17.21",
28
30
  "qs": "^6.11.2",
29
31
  "vite": "^5.1.6",
30
32
  "vite-plugin-dts": "^3.7.3"
31
33
  },
32
- "peerDependencies": {
33
- "@das-fed/ui": "^1.0.0"
34
- },
35
34
  "publishConfig": {
36
35
  "access": "public",
37
36
  "registry": "https://registry.npmjs.org"
@@ -0,0 +1,31 @@
1
+ declare const getDevicePanelRef: (_devicePanelRef: any) => void;
2
+ /**
3
+ * 设备面板
4
+ * @param deviceId 必填,设备id
5
+ * @param panelCode 必填,设备面板code
6
+ * @param deviceName 选填,设备名称
7
+ * @param x 选填,x方向偏移量
8
+ * @param y 选填,y方向偏移量
9
+ * @param isCenter 选填,是否中心
10
+ * @returns
11
+ */
12
+ declare const devicePanelShow: (deviceId: any, panelCode: any, deviceName?: any, x?: any, y?: any, isCenter?: boolean) => void;
13
+ /**
14
+ * 关闭设备面板
15
+ * @returns
16
+ */
17
+ declare const closeDevicePanel: () => void;
18
+ /**
19
+ * 告警面板
20
+ * @param deviceId 必填,设备id
21
+ * @param panelCode 必填,设备面板code
22
+ * @param deviceName 选填,设备名称
23
+ * @returns
24
+ */
25
+ declare const alarmDevicePanelShow: (deviceId: any, panelCode: any, deviceName?: any) => void;
26
+ /**
27
+ * 关闭告警面板
28
+ * @returns
29
+ */
30
+ declare const closeAlarmPanel: () => void;
31
+ export { getDevicePanelRef, devicePanelShow, alarmDevicePanelShow, closeDevicePanel, closeAlarmPanel };
package/panel/index.js ADDED
@@ -0,0 +1,37 @@
1
+ import { ref as f, watch as t } from "vue";
2
+ const l = f(null), h = (e) => {
3
+ e.value && (l.value = e.value);
4
+ }, w = (e, a, o, c, n, s) => {
5
+ var v;
6
+ if (l.value)
7
+ (v = l.value) == null || v.devicePanelShow(e, a, o, c, n, s);
8
+ else {
9
+ const P = t(() => l.value, (i) => {
10
+ var u;
11
+ i && ((u = l.value) == null || u.devicePanelShow(e, a, o, c, n, s), P());
12
+ });
13
+ }
14
+ }, D = () => {
15
+ var e;
16
+ (e = l.value) == null || e.closeDevicePanel();
17
+ }, S = (e, a, o) => {
18
+ var c;
19
+ if (l.value)
20
+ (c = l.value) == null || c.alarmDevicePanelShow(e, a, o);
21
+ else {
22
+ const n = t(() => l.value, (s) => {
23
+ var v;
24
+ s && ((v = l.value) == null || v.alarmDevicePanelShow(e, a, o), n());
25
+ });
26
+ }
27
+ }, m = () => {
28
+ var e;
29
+ (e = l.value) == null || e.closeAlarmPanel();
30
+ };
31
+ export {
32
+ S as alarmDevicePanelShow,
33
+ m as closeAlarmPanel,
34
+ D as closeDevicePanel,
35
+ w as devicePanelShow,
36
+ h as getDevicePanelRef
37
+ };