@xtctwins/tctwins-bimx-engine 0.3.2 → 0.3.3

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 (170) hide show
  1. package/README.md +196 -193
  2. package/dist/AnnotationTool-C3o-nYdK.mjs +167 -0
  3. package/dist/BIMX_Viewer_Lib.es.js +3 -3
  4. package/dist/BIMX_Viewer_Lib.umd.js +165 -265
  5. package/dist/CameraViewTool-DaGFzAdV.mjs +164 -0
  6. package/dist/CommentTool-BuqyVt4A.mjs +1529 -0
  7. package/dist/{HiddenTool-rORoKTeD.mjs → HiddenTool-B20p_qDY.mjs} +16 -16
  8. package/dist/{InspectorTool-l4bDxTia.mjs → InspectorTool-ChM2elpV.mjs} +66 -66
  9. package/dist/{MeasureTool-d-EV6m2R.mjs → MeasureTool-BZF__yUT.mjs} +107 -131
  10. package/dist/{MouseTool-DKMcdeRD.mjs → MouseTool-Bhmif0vq.mjs} +32 -35
  11. package/dist/{NavigateTool-BNvZ8Oat.mjs → NavigateTool-DER-SD2Y.mjs} +13 -13
  12. package/dist/{RoamTool-DJu93SVl.mjs → RoamTool-B2fyUtKk.mjs} +14 -14
  13. package/dist/ScreenShotTool-C8iq1Ssm.mjs +357 -0
  14. package/dist/SectionTool-CL95rzx4.mjs +331 -0
  15. package/dist/SettingTool-b9HLJ1iu.mjs +657 -0
  16. package/dist/StructureTree-DlqVbX97.mjs +1583 -0
  17. package/dist/{Alert-5pEYzrMO.mjs → alert-DoM5CyWV.mjs} +8 -8
  18. package/dist/const-DOnRsYpZ.mjs +389 -0
  19. package/dist/el-input-number-Bj97l7q_.mjs +818 -0
  20. package/dist/index-Cslxj2q_.mjs +128302 -0
  21. package/dist/index.html +17 -17
  22. package/dist/{Panel.vue_vue_type_style_index_0_lang-C4tqfy-B.mjs → panel.vue_vue_type_style_index_0_lang-r40t3eim.mjs} +2 -2
  23. package/dist/style.css +1 -1
  24. package/dist/{TallPanel-DtXOSzmF.mjs → tallPanel-CdjNke7H.mjs} +14 -14
  25. package/package.json +3 -4
  26. package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +10 -38
  27. package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +22 -0
  28. package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +9 -37
  29. package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +7 -5
  30. package/types/components/BCFComponents/BCFFilter.vue.d.ts +7 -5
  31. package/types/components/BCFComponents/BCFTool.vue.d.ts +7 -4
  32. package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +7 -5
  33. package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +6 -5
  34. package/types/components/BCFComponents/commentInput.vue.d.ts +10 -36
  35. package/types/components/BCFComponents/commentsView.vue.d.ts +7 -36
  36. package/types/components/BCFComponents/dialogPanel.vue.d.ts +8 -5
  37. package/types/components/BCFComponents/imageView.vue.d.ts +7 -5
  38. package/types/components/BCFComponents/imageZoomIn.vue.d.ts +6 -5
  39. package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
  40. package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +1 -18
  41. package/types/components/{tools/NavigateTool.vue.d.ts → BimViewerComponents/CameraViewTool.vue.d.ts} +3 -1
  42. package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
  43. package/types/components/BimViewerComponents/CommentTool.vue.d.ts +1 -32
  44. package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
  45. package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +0 -2
  46. package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +0 -2
  47. package/types/components/BimViewerComponents/MobileCommentsTool/{MobileCommentAdd.vue.d.ts → add.vue.d.ts} +8 -6
  48. package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +5 -4
  49. package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
  50. package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +1 -478
  51. package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +7 -499
  52. package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +6 -5
  53. package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
  54. package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
  55. package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
  56. package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
  57. package/types/components/BimViewerComponents/SectionTool.vue.d.ts +0 -4
  58. package/types/components/BimViewerComponents/SettingTool.vue.d.ts +6 -4
  59. package/types/components/BimViewerComponents/StructureTree.vue.d.ts +1 -4026
  60. package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
  61. package/types/components/BimViewerComponents/emptyPage.vue.d.ts +8 -0
  62. package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +1 -18
  63. package/types/components/BimxViewerComp.vue.d.ts +14 -7
  64. package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +10 -37
  65. package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +9 -37
  66. package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +7 -499
  67. package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +1 -478
  68. package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +8 -5
  69. package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +12 -38
  70. package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +9 -7
  71. package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +7 -5
  72. package/types/components/bimxViewer.vue.d.ts +14 -7
  73. package/types/components/utilsComponents/alert.vue.d.ts +1 -1
  74. package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
  75. package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
  76. package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
  77. package/types/components/utilsComponents/loading.vue.d.ts +1 -1
  78. package/types/components/utilsComponents/panel.vue.d.ts +2 -8
  79. package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
  80. package/types/components/utilsComponents/rectangleButton.vue.d.ts +1 -3
  81. package/types/components/utilsComponents/tallPanel.vue.d.ts +3 -13
  82. package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +3 -13
  83. package/types/i18n/index.d.ts +5 -5
  84. package/types/i18n/locales/en-US.d.ts +1 -1
  85. package/types/i18n/locales/zh-CN.d.ts +1 -1
  86. package/types/pages/BimxViewerEntry.vue.d.ts +59 -5
  87. package/types/pages/viewerEntry.vue.d.ts +57 -7
  88. package/types/store/bcfReflect.d.ts +81 -13
  89. package/types/store/const.d.ts +228 -11
  90. package/types/store/initConfigs.d.ts +1 -1
  91. package/types/store/toolbars.d.ts +117 -69
  92. package/types/store/userInfoStore.d.ts +1 -1
  93. package/types/tests/cmt.d.ts +1 -0
  94. package/types/utils/OSSHelper.d.ts +0 -27
  95. package/types/utils/cacheInfo.d.ts +3 -26
  96. package/types/utils/eventBus.d.ts +87 -1
  97. package/types/viewerManager/viewerManager.d.ts +3 -53
  98. package/dist/AnnotationTool-B3tDIyWy.mjs +0 -239
  99. package/dist/CommentTool--UgPVIZZ.mjs +0 -1541
  100. package/dist/ScreenShotTool-D2h0Qjtv.mjs +0 -430
  101. package/dist/SectionTool-DHw2Zfzv.mjs +0 -343
  102. package/dist/SettingTool-D13GBT87.mjs +0 -747
  103. package/dist/StructureTree-DHaOzAP9.mjs +0 -1662
  104. package/dist/bimTools-D3TraX9d.mjs +0 -75
  105. package/dist/el-slider-CHaMBaUG.mjs +0 -1040
  106. package/dist/index-BDupeKSG.mjs +0 -127986
  107. package/types/components/bcf/AddObjectOrAnno.vue.d.ts +0 -16
  108. package/types/components/bcf/BCFAddPanel.vue.d.ts +0 -55
  109. package/types/components/bcf/BCFDetailPanel.vue.d.ts +0 -59
  110. package/types/components/bcf/BCFDisplayList.vue.d.ts +0 -18
  111. package/types/components/bcf/BCFFilter.vue.d.ts +0 -14
  112. package/types/components/bcf/BCFTool.vue.d.ts +0 -15
  113. package/types/components/bcf/CheckObjectPanel.vue.d.ts +0 -11
  114. package/types/components/bcf/CommentInput.vue.d.ts +0 -51
  115. package/types/components/bcf/CommentsView.vue.d.ts +0 -48
  116. package/types/components/bcf/DialogPanel.vue.d.ts +0 -15
  117. package/types/components/bcf/ImageView.vue.d.ts +0 -17
  118. package/types/components/bcf/ImageZoomIn.vue.d.ts +0 -9
  119. package/types/components/bcf/MobileBCFAdd.vue.d.ts +0 -56
  120. package/types/components/bcf/MobileBCFDetail.vue.d.ts +0 -55
  121. package/types/components/bcf/MobileBCFDisplayList.vue.d.ts +0 -498
  122. package/types/components/bcf/MobileBCFFilter.vue.d.ts +0 -475
  123. package/types/components/bcf/MobileBCFTool.vue.d.ts +0 -17
  124. package/types/components/bcf/MobileCommentInput.vue.d.ts +0 -54
  125. package/types/components/bcf/MobileCommentsView.vue.d.ts +0 -17
  126. package/types/components/bcf/SelectPanel.vue.d.ts +0 -12
  127. package/types/components/comment/mobile/MobileCommentAdd.vue.d.ts +0 -14
  128. package/types/components/comment/mobile/MobileDetail.vue.d.ts +0 -11
  129. package/types/components/comment/mobile/MobileDraw.vue.d.ts +0 -17
  130. package/types/components/comment/mobile/MobileFilter.vue.d.ts +0 -475
  131. package/types/components/comment/mobile/MobileList.vue.d.ts +0 -497
  132. package/types/components/comment/mobile/MobileZoomIn.vue.d.ts +0 -9
  133. package/types/components/comment/pc/PcDraw.vue.d.ts +0 -14
  134. package/types/components/shared/Alert.vue.d.ts +0 -32
  135. package/types/components/shared/CloseButton.vue.d.ts +0 -50
  136. package/types/components/shared/CloseButtonDark.vue.d.ts +0 -32
  137. package/types/components/shared/EmptyPage.vue.d.ts +0 -6
  138. package/types/components/shared/Loading.vue.d.ts +0 -2
  139. package/types/components/shared/Panel.vue.d.ts +0 -47
  140. package/types/components/shared/Prompt.vue.d.ts +0 -8
  141. package/types/components/shared/RectangleButton.vue.d.ts +0 -106
  142. package/types/components/shared/TallPanel.vue.d.ts +0 -69
  143. package/types/components/shared/TallPanelNoPos.vue.d.ts +0 -82
  144. package/types/components/tools/AnnotationTool.vue.d.ts +0 -14
  145. package/types/components/tools/AppToolbar.vue.d.ts +0 -27
  146. package/types/components/tools/ClickEvent.vue.d.ts +0 -6
  147. package/types/components/tools/CommentTool.vue.d.ts +0 -45
  148. package/types/components/tools/HiddenTool.vue.d.ts +0 -12
  149. package/types/components/tools/InspectorTool.vue.d.ts +0 -14
  150. package/types/components/tools/MeasureTool.vue.d.ts +0 -14
  151. package/types/components/tools/MouseTool.vue.d.ts +0 -6
  152. package/types/components/tools/RoamTool.vue.d.ts +0 -12
  153. package/types/components/tools/ScreenShotTool.vue.d.ts +0 -10
  154. package/types/components/tools/SectionTool.vue.d.ts +0 -14
  155. package/types/components/tools/SettingTool.vue.d.ts +0 -13
  156. package/types/components/tools/StructureTree.vue.d.ts +0 -11645
  157. package/types/components/tools/Toolbar.vue.d.ts +0 -10
  158. package/types/composables/useBimViewerEvent.d.ts +0 -44
  159. package/types/composables/useEmitHandler.d.ts +0 -2
  160. package/types/composables/useToolActive.d.ts +0 -1
  161. package/types/composables/useToolReady.d.ts +0 -1
  162. package/types/store/const/app.d.ts +0 -66
  163. package/types/store/const/bimTools.d.ts +0 -81
  164. package/types/store/const/project.d.ts +0 -48
  165. package/types/store/const/theme.d.ts +0 -16
  166. package/types/store/const/toolbar.d.ts +0 -26
  167. package/types/stores/viewerStore.d.ts +0 -112
  168. package/types/types/bcf.d.ts +0 -83
  169. package/types/types/events.d.ts +0 -88
  170. package/types/utils/dbscan.d.ts +0 -1
@@ -1,6 +1,9 @@
1
+ import { BcfTopic, BcfTopicTotal } from '../store/bcfReflect';
2
+ import { ToolDir } from '../store/initConfigs';
3
+ import { ComponentName } from '../store/toolbars';
4
+ import { InputComment } from '@xtctwins/tctwins-bimx-viewer/types/src/toolbar/BCFTool';
1
5
  declare const emitter: import('mitt').Emitter<Record<import('mitt').EventType, unknown>>;
2
6
  export default emitter;
3
- export type { AnnoType, RoamEvent, MeasureTool, EventContent, InstructionContent, } from '../types/events';
4
7
  export declare let EventMemory: {
5
8
  BIMX_CONFIGS: {
6
9
  viewerManager: boolean;
@@ -11,3 +14,86 @@ export declare let EventMemory: {
11
14
  viewerManager: boolean;
12
15
  };
13
16
  };
17
+ export type AnnoType = "file" | "image" | "record" | "text" | "video";
18
+ export type RoamEvent = "goUp" | "goDown" | "goLeft" | "goRight" | "goForward" | "goBackward" | "stop";
19
+ export type MeasureTool = "distance" | "angle";
20
+ export type EventContent = {
21
+ /**
22
+ * 是否是功能
23
+ */
24
+ isTool: boolean;
25
+ /**
26
+ * 触发的事件对象
27
+ */
28
+ event_target: ComponentName | "BimXViewer" | "ToolBar";
29
+ /**
30
+ * 事件名称
31
+ */
32
+ event_name: string;
33
+ /**
34
+ * 事件内容
35
+ */
36
+ content: {
37
+ content?: any;
38
+ id?: any;
39
+ msg?: string;
40
+ code?: 200 | -1;
41
+ item?: any;
42
+ type?: string;
43
+ toolId?: number;
44
+ toolKey?: string;
45
+ color?: string;
46
+ active?: boolean;
47
+ enable?: boolean;
48
+ tool_type?: AnnoType;
49
+ annoId?: string;
50
+ object?: any;
51
+ currentAnnotation?: any;
52
+ rawFile?: any;
53
+ targetAnno?: any;
54
+ status?: string | boolean;
55
+ nodeId?: string | number;
56
+ entityId?: string | number;
57
+ objectId?: string | number;
58
+ viewer_nodeId?: string | number;
59
+ active_tree?: number;
60
+ img_data?: string;
61
+ roam?: RoamEvent;
62
+ newSets?: any;
63
+ newComment?: any;
64
+ direction?: number;
65
+ measureTool?: MeasureTool;
66
+ newMeasure?: any;
67
+ measurePrefer?: any;
68
+ bcf?: BcfTopic | BcfTopicTotal;
69
+ bcfId?: number;
70
+ bcf_guid?: string;
71
+ bcf_cmt?: InputComment;
72
+ bcf_cmt_guid?: string;
73
+ title?: string;
74
+ cameraView?: any;
75
+ description?: string;
76
+ };
77
+ };
78
+ type instructionName = "updateCmtList" | "checkCmtDetail" | "newComment" | "updateBcfList" | "checkBcfDetail" | "changeBackgroundColor" | "setNavCube" | "setAnnoStatus" | "setCameraView" | "lastSetsContent";
79
+ export type InstructionContent = {
80
+ instruct_name: instructionName;
81
+ content: {
82
+ code?: any;
83
+ guid?: any;
84
+ msg?: any;
85
+ type?: any;
86
+ active?: boolean;
87
+ color?: string;
88
+ move?: boolean;
89
+ pos?: ToolDir;
90
+ posNum?: number[];
91
+ index?: number;
92
+ cmtList?: any;
93
+ cmtDetail?: any;
94
+ bcfList?: BcfTopicTotal[];
95
+ bcfDetail?: BcfTopicTotal;
96
+ lastSet?: any;
97
+ cameraView?: any;
98
+ };
99
+ };
@@ -1,69 +1,19 @@
1
- /**
2
- * ViewerManager — BIM 引擎与 Vue 组件之间的桥接层(兼容层)
3
- *
4
- * 从静态管理类重构为 Pinia Store 兼容层:
5
- * - viewerState / entityState 通过 getter 代理到 viewerStore 的响应式状态
6
- * - 所有方法委托给 viewerStore 执行核心逻辑
7
- * - 保留 window.bimViewer 以兼容底层引擎库 @xtctwins/tctwins-bimx-viewer
8
- *
9
- * @remarks
10
- * 通过 src/index.ts 导出为公共 API,保持向后兼容。
11
- * 新代码推荐直接使用 useViewerStore() 获取响应式 Store 实例。
12
- */
13
1
  export default class ViewerManager {
14
- /** 查看器运行时状态(代理到 viewerStore,保持响应式) */
15
- static get viewerState(): {
16
- measureType: "distance" | "angle";
2
+ static viewerState: {
3
+ measureType: string;
17
4
  };
18
- static set viewerState(val: {
19
- measureType: "distance" | "angle";
20
- });
21
- /** 引擎实体状态缓存(代理到 viewerStore,保持响应式) */
22
- static get entityState(): {
5
+ static entityState: {
23
6
  xrayedObjectIds: string[];
24
7
  highlightedObjectIds: string[];
25
8
  selectedObjectIds: string[];
26
9
  visibleObjectIds: string[];
27
10
  edgesObjectIds: string[];
28
11
  };
29
- static set entityState(val: {
30
- xrayedObjectIds: string[];
31
- highlightedObjectIds: string[];
32
- selectedObjectIds: string[];
33
- visibleObjectIds: string[];
34
- edgesObjectIds: string[];
35
- });
36
- /**
37
- * 将 BIMX_CONFIGS 配置同步到底层 BIM 引擎
38
- *
39
- * @param eventTarget - 配置项名称。传空字符串时全量同步所有配置;传具体名称时仅同步该项。
40
- */
41
12
  static ConfigViewer(eventTarget?: string): void;
42
- /**
43
- * 保存查看器运行时状态
44
- * @param content - 状态快照对象
45
- */
46
13
  static SaveViewerState(content: any): void;
47
- /**
48
- * 通过工具 ID 激活/关闭工具
49
- * @param id - 工具栏工具 ID
50
- * @param active - 目标激活状态,默认取反当前状态
51
- */
52
14
  static SetToolActiveById(id: number, active?: boolean): void;
53
- /**
54
- * 通过工具 key 激活/关闭工具
55
- * @param key - 工具 key(如 "measure" / "section" / "roam" 等)
56
- * @param active - 目标激活状态,默认取反当前状态
57
- */
58
15
  static SetToolActiveByKey(key: string, active?: boolean): void;
59
- /** 关闭所有已激活的工具 */
60
16
  static SetAllClose(): void;
61
- /** 销毁当前 BIM 查看器实例 */
62
17
  static DestroyViewer(): void;
63
- /**
64
- * 显示/隐藏加载中遮罩
65
- * @param show - true 显示加载中,false 隐藏
66
- * @param callback - 可选回调
67
- */
68
18
  static showRequestBusy(show: boolean, callback?: Function): void;
69
19
  }
@@ -1,239 +0,0 @@
1
- import { _ as F } from "./Alert-5pEYzrMO.mjs";
2
- import { defineComponent as Y, ref as V, watch as G, onMounted as J, onBeforeUnmount as K, openBlock as l, createElementBlock as d, unref as i, createCommentVNode as y, createElementVNode as u, normalizeClass as B, Fragment as S, renderList as N, toDisplayString as Q, withDirectives as Z, createVNode as nn, vShow as en } from "vue";
3
- import { A as on, B as tn, C as a, D as E, O as _, I as an } from "./index-BDupeKSG.mjs";
4
- import { A as f } from "./bimTools-D3TraX9d.mjs";
5
- const rn = { class: "annotation_component" }, cn = {
6
- key: 0,
7
- id: "annotation_toolbar",
8
- class: "annotation_toolbar"
9
- }, sn = {
10
- key: 0,
11
- class: "toolbar_trangle"
12
- }, ln = { class: "annotation_toolbar_group" }, dn = ["id", "disabled", "onClick"], mn = ["src"], un = {
13
- key: 1,
14
- class: "toolbar_trangle"
15
- }, _n = {
16
- key: 1,
17
- class: "mobile_annotation_toolbar"
18
- }, fn = { class: "anno_toolList" }, bn = { class: "label-list" }, vn = ["onClick"], wn = { class: "item-img" }, gn = ["src"], Tn = { class: "item-name" }, pn = /* @__PURE__ */ Y({
19
- __name: "AnnotationTool",
20
- props: ["componentId"],
21
- emits: ["uploadImage", "clickAnnotation", "emitHandler"],
22
- setup(M, { emit: j }) {
23
- const O = on(), C = tn(), I = M, D = j, x = V(!0), m = V(""), W = V();
24
- let s, $, v = !1, p = null, w = null;
25
- const X = {
26
- image: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/image_active.png`,
27
- file: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/file_active.png`,
28
- record: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/record_active.png`,
29
- text: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/text_active.png`,
30
- video: `${_}/BIMX_Website/main/mainView/function_icon/annotation_icons/video_active.png`
31
- }, h = (n) => {
32
- D("emitHandler", n);
33
- };
34
- G(
35
- () => C.isToolActive(I.componentId),
36
- (n) => {
37
- var o, t;
38
- if (n)
39
- !v && ((t = window.bimViewer) != null && t.annotationTool) && g();
40
- else if (m.value = "", (o = window.bimViewer) != null && o.annotationTool && typeof window.bimViewer.annotationTool.setEnabled == "function")
41
- try {
42
- window.bimViewer.annotationTool.setEnabled(!1);
43
- } catch (e) {
44
- console.warn("[Bimx Engine] setEnabled(false) on close failed:", e);
45
- }
46
- }
47
- ), J(() => {
48
- var n;
49
- W.value = a("annoLimit"), C.setReadyById(I.componentId), !v && ((n = window.bimViewer) != null && n.annotationTool) && g();
50
- }), K(() => {
51
- if (E.off("BimViewer", g), E.off("setAnnoStatus", P), p && w) {
52
- try {
53
- p.removeEventListener("click", w);
54
- } catch (n) {
55
- console.warn("[Bimx Engine] remove canvas click listener failed:", n);
56
- }
57
- p = null, w = null;
58
- }
59
- });
60
- function A(n) {
61
- var o;
62
- a("editPrivilege") != 1 && (!v && ((o = window.bimViewer) != null && o.annotationTool) && g(), m.value === n.code ? (m.value = "", L(n, !1)) : (m.value = n.code, L(n, !0)));
63
- }
64
- function P(n) {
65
- const o = U(n.type);
66
- o && A(o);
67
- }
68
- function g() {
69
- if (!window.bimViewer || !window.bimViewer.annotationTool || !window.bimViewer.eventTrigger) {
70
- console.warn("[Bimx Engine] bindEngineIntegration skipped: bimViewer/annotationTool/eventTrigger missing.");
71
- return;
72
- }
73
- if (v) return;
74
- s = window.bimViewer.annotationTool, $ = window.bimViewer.eventTrigger;
75
- try {
76
- s.setTypeImage(X);
77
- } catch (e) {
78
- console.warn("[Bimx Engine] setTypeImage failed:", e);
79
- }
80
- const n = (e, r) => {
81
- const b = [
82
- { label: "annotationTool", obj: s },
83
- { label: "annotationTool.eventTrigger", obj: s == null ? void 0 : s.eventTrigger },
84
- { label: "bimViewer.eventTrigger", obj: $ }
85
- ];
86
- let T = 0;
87
- for (const c of b)
88
- if (c.obj && typeof c.obj.on == "function")
89
- try {
90
- c.obj.on(e, r), T++;
91
- } catch (k) {
92
- console.warn(`[Bimx Engine] bind '${e}' on ${c.label} failed:`, k);
93
- }
94
- T === 0 && console.error(`[Bimx Engine] no emitter accepted '${e}' subscription!`);
95
- }, o = /* @__PURE__ */ new WeakSet(), t = (e) => !e || typeof e != "object" ? !1 : o.has(e) ? !0 : (o.add(e), !1);
96
- n("createAnnotation", (e) => {
97
- t(e) || h({
98
- isTool: !0,
99
- event_target: "AnnotationTool",
100
- event_name: "createAnnotation",
101
- content: { currentAnnotation: e }
102
- });
103
- }), n("markerClicked", (e) => {
104
- t(e) || h({
105
- isTool: !0,
106
- event_target: "AnnotationTool",
107
- event_name: "clickAnnotation",
108
- content: { targetAnno: e }
109
- });
110
- }), a("isMobile") || n("requestDeleteMarker", (e) => {
111
- h({
112
- isTool: !0,
113
- event_target: "AnnotationTool",
114
- event_name: "requestDelAnno",
115
- content: {
116
- msg: "请求删除指定标注",
117
- annoId: e
118
- }
119
- });
120
- }), v = !0, R();
121
- }
122
- function L(n, o) {
123
- q(o), H(n.code, o), h({
124
- isTool: !0,
125
- event_target: "AnnotationTool",
126
- event_name: "clickAnnoTool",
127
- content: {
128
- active: o,
129
- tool_type: n.code
130
- }
131
- });
132
- }
133
- function H(n, o) {
134
- var t;
135
- if ((t = window.bimViewer) != null && t.annotationTool)
136
- try {
137
- window.bimViewer.annotationTool.setCurrentType(n, o);
138
- } catch {
139
- try {
140
- window.bimViewer.annotationTool.setCurrentType(n);
141
- } catch (r) {
142
- console.error("[Bimx Engine] setCurrentType failed:", r);
143
- }
144
- }
145
- }
146
- function q(n) {
147
- var o;
148
- if ((o = window.bimViewer) != null && o.annotationTool)
149
- try {
150
- window.bimViewer.annotationTool.setEnabled(n);
151
- } catch (t) {
152
- console.error("[Bimx Engine] setEnabled error:", t);
153
- }
154
- }
155
- function R() {
156
- var n, o, t, e, r, b, T;
157
- try {
158
- const c = ((e = (t = (o = (n = window.bimViewer) == null ? void 0 : n.viewer) == null ? void 0 : o.scene) == null ? void 0 : t.canvas) == null ? void 0 : e.canvas) || ((T = (b = (r = window.bimViewer) == null ? void 0 : r.scene) == null ? void 0 : b.canvas) == null ? void 0 : T.canvas);
159
- if (!c || typeof c.addEventListener != "function") {
160
- console.warn("[Bimx Engine] cannot locate xeokit canvas element to attach click listener.");
161
- return;
162
- }
163
- p = c, w = (k) => {
164
- if (!(!s || typeof s.clickToCreateAnno != "function"))
165
- try {
166
- s.clickToCreateAnno(k);
167
- } catch (z) {
168
- console.error("[Bimx Engine] clickToCreateAnno(event) error:", z);
169
- }
170
- }, c.addEventListener("click", w);
171
- } catch (c) {
172
- console.warn("[Bimx Engine] attach canvas click listener failed:", c);
173
- }
174
- }
175
- function U(n) {
176
- if (n === "image") return f[0];
177
- if (n === "record") return f[1];
178
- if (n === "video") return f[2];
179
- if (n === "file") return f[3];
180
- if (n === "text") return f[4];
181
- }
182
- return E.on("BimViewer", g), E.on("setAnnoStatus", P), (n, o) => {
183
- const t = F;
184
- return l(), d("div", rn, [
185
- i(a)("isMobile") ? (l(), d("div", _n, [
186
- u("div", fn, [
187
- u("div", bn, [
188
- (l(!0), d(S, null, N(i(f), (e, r) => (l(), d("div", {
189
- key: r,
190
- class: B(["label-item", { "label-item-active": m.value === e.code && i(a)("editPrivilege") == 0, noPermission: i(a)("editPrivilege") == 1 }]),
191
- onClick: (b) => A(e)
192
- }, [
193
- u("div", wn, [
194
- u("img", {
195
- class: "label-item-img",
196
- src: i(_) + `/bim-viewer/annotation/new-icons/bimkk-mobile-anno-${m.value === e.code && i(a)("editPrivilege") == 0 ? e.imgActive : e.img}.svg`,
197
- alt: ""
198
- }, null, 8, gn),
199
- u("div", Tn, Q(i(O)(e.name)), 1)
200
- ])
201
- ], 10, vn))), 128))
202
- ])
203
- ])
204
- ])) : (l(), d("div", cn, [
205
- i(a)("annotationPos").pos.includes("top") ? (l(), d("div", sn)) : y("", !0),
206
- u("div", {
207
- class: B(["annotation_toolbar_wrapper", { annotation_toolbar_wrapper_disable: i(a)("editPrivilege") == 1 }])
208
- }, [
209
- u("div", ln, [
210
- (l(!0), d(S, null, N(i(f), (e, r) => (l(), d("button", {
211
- id: `annotation_tool_btn_${r}`,
212
- key: r,
213
- class: B(["annotation_tool_btn", { active: m.value === e.code }]),
214
- disabled: i(a)("editPrivilege") == 1,
215
- onClick: (b) => A(e)
216
- }, [
217
- y("", !0),
218
- u("img", {
219
- src: `${i(_)}/bim-viewer/action-bars/panno-${m.value !== e.code ? e.img : e.imgActive}.svg`
220
- }, null, 8, mn)
221
- ], 10, dn))), 128))
222
- ])
223
- ], 2),
224
- i(a)("annotationPos").pos.includes("bottom") ? (l(), d("div", un)) : y("", !0)
225
- ])),
226
- Z(nn(t, {
227
- "click-handle": () => {
228
- x.value = !1;
229
- }
230
- }, null, 8, ["click-handle"]), [
231
- [en, x.value && i(a)("editPrivilege") == 0]
232
- ])
233
- ]);
234
- };
235
- }
236
- }), Vn = /* @__PURE__ */ an(pn, [["__scopeId", "data-v-a8fb218b"]]);
237
- export {
238
- Vn as default
239
- };