@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.
- package/README.md +196 -193
- package/dist/AnnotationTool-C3o-nYdK.mjs +167 -0
- package/dist/BIMX_Viewer_Lib.es.js +3 -3
- package/dist/BIMX_Viewer_Lib.umd.js +165 -265
- package/dist/CameraViewTool-DaGFzAdV.mjs +164 -0
- package/dist/CommentTool-BuqyVt4A.mjs +1529 -0
- package/dist/{HiddenTool-rORoKTeD.mjs → HiddenTool-B20p_qDY.mjs} +16 -16
- package/dist/{InspectorTool-l4bDxTia.mjs → InspectorTool-ChM2elpV.mjs} +66 -66
- package/dist/{MeasureTool-d-EV6m2R.mjs → MeasureTool-BZF__yUT.mjs} +107 -131
- package/dist/{MouseTool-DKMcdeRD.mjs → MouseTool-Bhmif0vq.mjs} +32 -35
- package/dist/{NavigateTool-BNvZ8Oat.mjs → NavigateTool-DER-SD2Y.mjs} +13 -13
- package/dist/{RoamTool-DJu93SVl.mjs → RoamTool-B2fyUtKk.mjs} +14 -14
- package/dist/ScreenShotTool-C8iq1Ssm.mjs +357 -0
- package/dist/SectionTool-CL95rzx4.mjs +331 -0
- package/dist/SettingTool-b9HLJ1iu.mjs +657 -0
- package/dist/StructureTree-DlqVbX97.mjs +1583 -0
- package/dist/{Alert-5pEYzrMO.mjs → alert-DoM5CyWV.mjs} +8 -8
- package/dist/const-DOnRsYpZ.mjs +389 -0
- package/dist/el-input-number-Bj97l7q_.mjs +818 -0
- package/dist/index-Cslxj2q_.mjs +128302 -0
- package/dist/index.html +17 -17
- 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
- package/dist/style.css +1 -1
- package/dist/{TallPanel-DtXOSzmF.mjs → tallPanel-CdjNke7H.mjs} +14 -14
- package/package.json +3 -4
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +10 -38
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +22 -0
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +9 -37
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +7 -5
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +7 -5
- package/types/components/BCFComponents/BCFTool.vue.d.ts +7 -4
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +7 -5
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +6 -5
- package/types/components/BCFComponents/commentInput.vue.d.ts +10 -36
- package/types/components/BCFComponents/commentsView.vue.d.ts +7 -36
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +8 -5
- package/types/components/BCFComponents/imageView.vue.d.ts +7 -5
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +6 -5
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +1 -18
- package/types/components/{tools/NavigateTool.vue.d.ts → BimViewerComponents/CameraViewTool.vue.d.ts} +3 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +1 -32
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +0 -2
- package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +0 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/{MobileCommentAdd.vue.d.ts → add.vue.d.ts} +8 -6
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +5 -4
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +1 -478
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +7 -499
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +6 -5
- package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/SectionTool.vue.d.ts +0 -4
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +6 -4
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +1 -4026
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +8 -0
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +1 -18
- package/types/components/BimxViewerComp.vue.d.ts +14 -7
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +10 -37
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +9 -37
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +7 -499
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +1 -478
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +8 -5
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +12 -38
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +9 -7
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +7 -5
- package/types/components/bimxViewer.vue.d.ts +14 -7
- package/types/components/utilsComponents/alert.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
- package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
- package/types/components/utilsComponents/loading.vue.d.ts +1 -1
- package/types/components/utilsComponents/panel.vue.d.ts +2 -8
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +1 -3
- package/types/components/utilsComponents/tallPanel.vue.d.ts +3 -13
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +3 -13
- package/types/i18n/index.d.ts +5 -5
- package/types/i18n/locales/en-US.d.ts +1 -1
- package/types/i18n/locales/zh-CN.d.ts +1 -1
- package/types/pages/BimxViewerEntry.vue.d.ts +59 -5
- package/types/pages/viewerEntry.vue.d.ts +57 -7
- package/types/store/bcfReflect.d.ts +81 -13
- package/types/store/const.d.ts +228 -11
- package/types/store/initConfigs.d.ts +1 -1
- package/types/store/toolbars.d.ts +117 -69
- package/types/store/userInfoStore.d.ts +1 -1
- package/types/tests/cmt.d.ts +1 -0
- package/types/utils/OSSHelper.d.ts +0 -27
- package/types/utils/cacheInfo.d.ts +3 -26
- package/types/utils/eventBus.d.ts +87 -1
- package/types/viewerManager/viewerManager.d.ts +3 -53
- package/dist/AnnotationTool-B3tDIyWy.mjs +0 -239
- package/dist/CommentTool--UgPVIZZ.mjs +0 -1541
- package/dist/ScreenShotTool-D2h0Qjtv.mjs +0 -430
- package/dist/SectionTool-DHw2Zfzv.mjs +0 -343
- package/dist/SettingTool-D13GBT87.mjs +0 -747
- package/dist/StructureTree-DHaOzAP9.mjs +0 -1662
- package/dist/bimTools-D3TraX9d.mjs +0 -75
- package/dist/el-slider-CHaMBaUG.mjs +0 -1040
- package/dist/index-BDupeKSG.mjs +0 -127986
- package/types/components/bcf/AddObjectOrAnno.vue.d.ts +0 -16
- package/types/components/bcf/BCFAddPanel.vue.d.ts +0 -55
- package/types/components/bcf/BCFDetailPanel.vue.d.ts +0 -59
- package/types/components/bcf/BCFDisplayList.vue.d.ts +0 -18
- package/types/components/bcf/BCFFilter.vue.d.ts +0 -14
- package/types/components/bcf/BCFTool.vue.d.ts +0 -15
- package/types/components/bcf/CheckObjectPanel.vue.d.ts +0 -11
- package/types/components/bcf/CommentInput.vue.d.ts +0 -51
- package/types/components/bcf/CommentsView.vue.d.ts +0 -48
- package/types/components/bcf/DialogPanel.vue.d.ts +0 -15
- package/types/components/bcf/ImageView.vue.d.ts +0 -17
- package/types/components/bcf/ImageZoomIn.vue.d.ts +0 -9
- package/types/components/bcf/MobileBCFAdd.vue.d.ts +0 -56
- package/types/components/bcf/MobileBCFDetail.vue.d.ts +0 -55
- package/types/components/bcf/MobileBCFDisplayList.vue.d.ts +0 -498
- package/types/components/bcf/MobileBCFFilter.vue.d.ts +0 -475
- package/types/components/bcf/MobileBCFTool.vue.d.ts +0 -17
- package/types/components/bcf/MobileCommentInput.vue.d.ts +0 -54
- package/types/components/bcf/MobileCommentsView.vue.d.ts +0 -17
- package/types/components/bcf/SelectPanel.vue.d.ts +0 -12
- package/types/components/comment/mobile/MobileCommentAdd.vue.d.ts +0 -14
- package/types/components/comment/mobile/MobileDetail.vue.d.ts +0 -11
- package/types/components/comment/mobile/MobileDraw.vue.d.ts +0 -17
- package/types/components/comment/mobile/MobileFilter.vue.d.ts +0 -475
- package/types/components/comment/mobile/MobileList.vue.d.ts +0 -497
- package/types/components/comment/mobile/MobileZoomIn.vue.d.ts +0 -9
- package/types/components/comment/pc/PcDraw.vue.d.ts +0 -14
- package/types/components/shared/Alert.vue.d.ts +0 -32
- package/types/components/shared/CloseButton.vue.d.ts +0 -50
- package/types/components/shared/CloseButtonDark.vue.d.ts +0 -32
- package/types/components/shared/EmptyPage.vue.d.ts +0 -6
- package/types/components/shared/Loading.vue.d.ts +0 -2
- package/types/components/shared/Panel.vue.d.ts +0 -47
- package/types/components/shared/Prompt.vue.d.ts +0 -8
- package/types/components/shared/RectangleButton.vue.d.ts +0 -106
- package/types/components/shared/TallPanel.vue.d.ts +0 -69
- package/types/components/shared/TallPanelNoPos.vue.d.ts +0 -82
- package/types/components/tools/AnnotationTool.vue.d.ts +0 -14
- package/types/components/tools/AppToolbar.vue.d.ts +0 -27
- package/types/components/tools/ClickEvent.vue.d.ts +0 -6
- package/types/components/tools/CommentTool.vue.d.ts +0 -45
- package/types/components/tools/HiddenTool.vue.d.ts +0 -12
- package/types/components/tools/InspectorTool.vue.d.ts +0 -14
- package/types/components/tools/MeasureTool.vue.d.ts +0 -14
- package/types/components/tools/MouseTool.vue.d.ts +0 -6
- package/types/components/tools/RoamTool.vue.d.ts +0 -12
- package/types/components/tools/ScreenShotTool.vue.d.ts +0 -10
- package/types/components/tools/SectionTool.vue.d.ts +0 -14
- package/types/components/tools/SettingTool.vue.d.ts +0 -13
- package/types/components/tools/StructureTree.vue.d.ts +0 -11645
- package/types/components/tools/Toolbar.vue.d.ts +0 -10
- package/types/composables/useBimViewerEvent.d.ts +0 -44
- package/types/composables/useEmitHandler.d.ts +0 -2
- package/types/composables/useToolActive.d.ts +0 -1
- package/types/composables/useToolReady.d.ts +0 -1
- package/types/store/const/app.d.ts +0 -66
- package/types/store/const/bimTools.d.ts +0 -81
- package/types/store/const/project.d.ts +0 -48
- package/types/store/const/theme.d.ts +0 -16
- package/types/store/const/toolbar.d.ts +0 -26
- package/types/stores/viewerStore.d.ts +0 -112
- package/types/types/bcf.d.ts +0 -83
- package/types/types/events.d.ts +0 -88
- 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
|
-
|
|
15
|
-
|
|
16
|
-
measureType: "distance" | "angle";
|
|
2
|
+
static viewerState: {
|
|
3
|
+
measureType: string;
|
|
17
4
|
};
|
|
18
|
-
static
|
|
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
|
-
};
|