@xtctwins/tctwins-bimx-engine 0.3.0 → 0.3.1
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 +193 -196
- package/dist/{alert-ChDNxVgQ.mjs → Alert-CSiEPFGt.mjs} +8 -8
- package/dist/AnnotationTool-CKzHkqWM.mjs +239 -0
- package/dist/BIMX_Viewer_Lib.es.js +3 -3
- package/dist/BIMX_Viewer_Lib.umd.js +222 -175
- package/dist/CommentTool-5HhGDqpg.mjs +1541 -0
- package/dist/{HiddenTool-CoPawMRd.mjs → HiddenTool-BGFoHMWC.mjs} +16 -16
- package/dist/{InspectorTool-BIvnydPf.mjs → InspectorTool-DD3w7k07.mjs} +66 -66
- package/dist/{MeasureTool-BUi0QI_R.mjs → MeasureTool-COR8QLDf.mjs} +126 -102
- package/dist/{MouseTool-CdVwRiX1.mjs → MouseTool-OxODcO4X.mjs} +35 -32
- package/dist/{NavigateTool-DoP9z3yP.mjs → NavigateTool-Bw6GFzsg.mjs} +13 -13
- package/dist/{panel.vue_vue_type_style_index_0_lang-BaSZShh_.mjs → Panel.vue_vue_type_style_index_0_lang-DgM_qGLO.mjs} +2 -2
- package/dist/{RoamTool-POFy076i.mjs → RoamTool-X-b0hsmJ.mjs} +14 -14
- package/dist/ScreenShotTool-0xSJZBBw.mjs +430 -0
- package/dist/SectionTool-BqI2Qnk5.mjs +343 -0
- package/dist/SettingTool-CGkRGfZH.mjs +747 -0
- package/dist/StructureTree-CWAXoI0r.mjs +1662 -0
- package/dist/{tallPanel-DKlcFjrl.mjs → TallPanel-CR5vNQ4c.mjs} +14 -14
- package/dist/bimTools-D3TraX9d.mjs +75 -0
- package/dist/el-slider-CBVU9_og.mjs +1040 -0
- package/dist/{index-Dsq1epCY.mjs → index-CwRGVhoT.mjs} +55597 -53543
- package/dist/index.html +17 -17
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
- package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
- package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
- package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/{add.vue.d.ts → MobileCommentAdd.vue.d.ts} +6 -8
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +478 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +499 -7
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
- 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 +4 -0
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +4026 -1
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +18 -1
- package/types/components/BimxViewerComp.vue.d.ts +7 -14
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +499 -7
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +478 -1
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
- package/types/components/bcf/AddObjectOrAnno.vue.d.ts +16 -0
- package/types/components/bcf/BCFAddPanel.vue.d.ts +55 -0
- package/types/components/bcf/BCFDetailPanel.vue.d.ts +59 -0
- package/types/components/bcf/BCFDisplayList.vue.d.ts +18 -0
- package/types/components/bcf/BCFFilter.vue.d.ts +14 -0
- package/types/components/bcf/BCFTool.vue.d.ts +15 -0
- package/types/components/bcf/CheckObjectPanel.vue.d.ts +11 -0
- package/types/components/bcf/CommentInput.vue.d.ts +51 -0
- package/types/components/bcf/CommentsView.vue.d.ts +48 -0
- package/types/components/bcf/DialogPanel.vue.d.ts +15 -0
- package/types/components/bcf/ImageView.vue.d.ts +17 -0
- package/types/components/bcf/ImageZoomIn.vue.d.ts +9 -0
- package/types/components/bcf/MobileBCFAdd.vue.d.ts +56 -0
- package/types/components/bcf/MobileBCFDetail.vue.d.ts +55 -0
- package/types/components/bcf/MobileBCFDisplayList.vue.d.ts +498 -0
- package/types/components/bcf/MobileBCFFilter.vue.d.ts +475 -0
- package/types/components/bcf/MobileBCFTool.vue.d.ts +17 -0
- package/types/components/bcf/MobileCommentInput.vue.d.ts +54 -0
- package/types/components/bcf/MobileCommentsView.vue.d.ts +17 -0
- package/types/components/bcf/SelectPanel.vue.d.ts +12 -0
- package/types/components/bimxViewer.vue.d.ts +7 -14
- package/types/components/comment/mobile/MobileCommentAdd.vue.d.ts +14 -0
- package/types/components/comment/mobile/MobileDetail.vue.d.ts +11 -0
- package/types/components/comment/mobile/MobileDraw.vue.d.ts +17 -0
- package/types/components/comment/mobile/MobileFilter.vue.d.ts +475 -0
- package/types/components/comment/mobile/MobileList.vue.d.ts +497 -0
- package/types/components/comment/mobile/MobileZoomIn.vue.d.ts +9 -0
- package/types/components/comment/pc/PcDraw.vue.d.ts +14 -0
- package/types/components/shared/Alert.vue.d.ts +32 -0
- package/types/components/shared/CloseButton.vue.d.ts +50 -0
- package/types/components/shared/CloseButtonDark.vue.d.ts +32 -0
- package/types/components/shared/EmptyPage.vue.d.ts +6 -0
- package/types/components/shared/Loading.vue.d.ts +2 -0
- package/types/components/shared/Panel.vue.d.ts +47 -0
- package/types/components/shared/Prompt.vue.d.ts +8 -0
- package/types/components/shared/RectangleButton.vue.d.ts +106 -0
- package/types/components/shared/TallPanel.vue.d.ts +69 -0
- package/types/components/shared/TallPanelNoPos.vue.d.ts +82 -0
- package/types/components/tools/AnnotationTool.vue.d.ts +14 -0
- package/types/components/tools/AppToolbar.vue.d.ts +27 -0
- package/types/components/tools/ClickEvent.vue.d.ts +6 -0
- package/types/components/tools/CommentTool.vue.d.ts +45 -0
- package/types/components/tools/HiddenTool.vue.d.ts +12 -0
- package/types/components/tools/InspectorTool.vue.d.ts +14 -0
- package/types/components/tools/MeasureTool.vue.d.ts +14 -0
- package/types/components/tools/MouseTool.vue.d.ts +6 -0
- package/types/components/tools/NavigateTool.vue.d.ts +10 -0
- package/types/components/tools/RoamTool.vue.d.ts +12 -0
- package/types/components/tools/ScreenShotTool.vue.d.ts +10 -0
- package/types/components/tools/SectionTool.vue.d.ts +14 -0
- package/types/components/tools/SettingTool.vue.d.ts +13 -0
- package/types/components/tools/StructureTree.vue.d.ts +11645 -0
- package/types/components/tools/Toolbar.vue.d.ts +10 -0
- 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 +8 -2
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
- package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
- package/types/composables/useBimViewerEvent.d.ts +44 -0
- package/types/composables/useEmitHandler.d.ts +2 -0
- package/types/composables/useToolActive.d.ts +1 -0
- package/types/composables/useToolReady.d.ts +1 -0
- package/types/i18n/index.d.ts +5 -1
- package/types/i18n/locales/en-US.d.ts +1 -0
- package/types/i18n/locales/zh-CN.d.ts +1 -0
- package/types/pages/BimxViewerEntry.vue.d.ts +5 -57
- package/types/pages/viewerEntry.vue.d.ts +7 -57
- package/types/store/bcfReflect.d.ts +13 -81
- package/types/store/const/app.d.ts +66 -0
- package/types/store/const/bimTools.d.ts +81 -0
- package/types/store/const/project.d.ts +48 -0
- package/types/store/const/theme.d.ts +16 -0
- package/types/store/const/toolbar.d.ts +26 -0
- package/types/store/const.d.ts +11 -228
- package/types/store/initConfigs.d.ts +1 -1
- package/types/store/toolbars.d.ts +68 -46
- package/types/store/userInfoStore.d.ts +1 -1
- package/types/stores/viewerStore.d.ts +112 -0
- package/types/types/bcf.d.ts +83 -0
- package/types/types/events.d.ts +88 -0
- package/types/utils/OSSHelper.d.ts +27 -0
- package/types/utils/cacheInfo.d.ts +26 -3
- package/types/utils/dbscan.d.ts +1 -0
- package/types/utils/eventBus.d.ts +1 -83
- package/types/viewerManager/viewerManager.d.ts +53 -3
- package/dist/AnnotationTool-CGRte6Cc.mjs +0 -167
- package/dist/CommentTool-CT3wFozB.mjs +0 -1529
- package/dist/ScreenShotTool-CcUyU0g7.mjs +0 -357
- package/dist/SectionTool-DGjjH3JO.mjs +0 -331
- package/dist/SettingTool-CjXfbX5r.mjs +0 -657
- package/dist/StructureTree-DdRX-y-V.mjs +0 -1583
- package/dist/const-DOnRsYpZ.mjs +0 -389
- package/dist/el-input-number-CK5d8pzH.mjs +0 -818
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
- package/types/tests/cmt.d.ts +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ComponentName } from '../store/toolbars';
|
|
2
|
+
import { BcfTopic, BcfTopicTotal, BcfInputComment } from './bcf';
|
|
3
|
+
import { ToolDir } from '../store/initConfigs';
|
|
4
|
+
/** 标注附件类型 */
|
|
5
|
+
export type AnnoType = "file" | "image" | "record" | "text" | "video";
|
|
6
|
+
/** 漫游事件类型 */
|
|
7
|
+
export type RoamEvent = "goUp" | "goDown" | "goLeft" | "goRight" | "goForward" | "goBackward" | "stop";
|
|
8
|
+
/** 测量工具类型 */
|
|
9
|
+
export type MeasureTool = "distance" | "angle";
|
|
10
|
+
/**
|
|
11
|
+
* 组件间事件通信的载荷结构
|
|
12
|
+
*
|
|
13
|
+
* @remarks 通过 mitt emitter 发送,event_target 标识事件来源组件,event_name 标识事件名。
|
|
14
|
+
*/
|
|
15
|
+
export type EventContent = {
|
|
16
|
+
/** 是否来自工具(true)还是 UI 组件(false) */
|
|
17
|
+
isTool: boolean;
|
|
18
|
+
/** 触发事件的目标组件 */
|
|
19
|
+
event_target: ComponentName | "BimXViewer" | "ToolBar";
|
|
20
|
+
/** 事件名称 */
|
|
21
|
+
event_name: string;
|
|
22
|
+
/** 事件载荷 */
|
|
23
|
+
content: {
|
|
24
|
+
content?: any;
|
|
25
|
+
id?: any;
|
|
26
|
+
msg?: string;
|
|
27
|
+
code?: 200 | -1;
|
|
28
|
+
item?: any;
|
|
29
|
+
type?: string;
|
|
30
|
+
toolId?: number;
|
|
31
|
+
toolKey?: string;
|
|
32
|
+
color?: string;
|
|
33
|
+
active?: boolean;
|
|
34
|
+
enable?: boolean;
|
|
35
|
+
tool_type?: AnnoType;
|
|
36
|
+
annoId?: string;
|
|
37
|
+
object?: any;
|
|
38
|
+
currentAnnotation?: any;
|
|
39
|
+
rawFile?: any;
|
|
40
|
+
targetAnno?: any;
|
|
41
|
+
status?: string | boolean;
|
|
42
|
+
nodeId?: string | number;
|
|
43
|
+
entityId?: string | number;
|
|
44
|
+
objectId?: string | number;
|
|
45
|
+
viewer_nodeId?: string | number;
|
|
46
|
+
active_tree?: number;
|
|
47
|
+
img_data?: string;
|
|
48
|
+
roam?: RoamEvent;
|
|
49
|
+
newSets?: any;
|
|
50
|
+
newComment?: any;
|
|
51
|
+
direction?: number;
|
|
52
|
+
measureTool?: MeasureTool;
|
|
53
|
+
newMeasure?: any;
|
|
54
|
+
measurePrefer?: any;
|
|
55
|
+
bcf?: BcfTopic | BcfTopicTotal;
|
|
56
|
+
bcfId?: number;
|
|
57
|
+
bcf_guid?: string;
|
|
58
|
+
bcf_cmt?: BcfInputComment;
|
|
59
|
+
bcf_cmt_guid?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
type InstructionName = "updateCmtList" | "checkCmtDetail" | "newComment" | "updateBcfList" | "checkBcfDetail" | "changeBackgroundColor" | "setNavCube" | "setAnnoStatus" | "lastSetsContent";
|
|
63
|
+
/**
|
|
64
|
+
* 跨组件指令通信结构
|
|
65
|
+
*
|
|
66
|
+
* @remarks 用于父子组件间的指令传递,如更新列表、检查详情等。
|
|
67
|
+
*/
|
|
68
|
+
export type InstructionContent = {
|
|
69
|
+
instruct_name: InstructionName;
|
|
70
|
+
content: {
|
|
71
|
+
code?: any;
|
|
72
|
+
guid?: any;
|
|
73
|
+
msg?: any;
|
|
74
|
+
type?: any;
|
|
75
|
+
active?: boolean;
|
|
76
|
+
color?: string;
|
|
77
|
+
move?: boolean;
|
|
78
|
+
pos?: ToolDir;
|
|
79
|
+
posNum?: number[];
|
|
80
|
+
index?: number;
|
|
81
|
+
cmtList?: any;
|
|
82
|
+
cmtDetail?: any;
|
|
83
|
+
bcfList?: BcfTopicTotal[];
|
|
84
|
+
bcfDetail?: BcfTopicTotal;
|
|
85
|
+
lastSet?: any;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export {};
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSHelper — 阿里云 OSS 文件操作辅助类
|
|
3
|
+
*
|
|
4
|
+
* 提供从 OSS 读取文件、下载 Buffer、获取 JSON 元数据等能力。
|
|
5
|
+
* 内部通过 STS 临时凭证自动创建 OSSClient 实例。
|
|
6
|
+
*/
|
|
1
7
|
export default class OSSHelper {
|
|
8
|
+
/**
|
|
9
|
+
* 从 OSS 获取文件的 ArrayBuffer
|
|
10
|
+
*
|
|
11
|
+
* @param filePath - OSS 文件路径
|
|
12
|
+
* @param done - 成功回调,接收 Buffer 数据
|
|
13
|
+
* @param error - 可选,失败回调
|
|
14
|
+
*/
|
|
2
15
|
static getBuffer(filePath: string, done: Function, error?: Function): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* 从 OSS 请求文件(支持单文件和多文件模式)
|
|
18
|
+
*
|
|
19
|
+
* @param filePath - OSS 目录路径
|
|
20
|
+
* @param isFile - true 读取 metadata.json,false 读取 index.json
|
|
21
|
+
* @param done - 成功回调,接收解析后的 JSON 对象
|
|
22
|
+
* @param error - 失败回调
|
|
23
|
+
*/
|
|
3
24
|
static requestFileFromOSS(filePath: string, isFile: boolean, done: Function, error: Function): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* 通过 HTTP 下载文件(非 OSS)
|
|
27
|
+
*
|
|
28
|
+
* @param filePath - 文件的完整 HTTP URL
|
|
29
|
+
* @returns 文件的 ArrayBuffer
|
|
30
|
+
*/
|
|
4
31
|
static downloadFile(filePath: string): Promise<ArrayBuffer>;
|
|
5
32
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* 本地缓存封装
|
|
3
|
+
*
|
|
4
|
+
* 基于 localStorage / sessionStorage,支持过期时间自动清除。
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import { LStorage, SStorage } from "@/utils/cacheInfo";
|
|
8
|
+
* LStorage.set("key", data, 3600); // 1 小时后过期
|
|
9
|
+
* const val = LStorage.get("key"); // 过期自动返回 null
|
|
5
10
|
*/
|
|
6
11
|
declare enum StorageType {
|
|
7
12
|
l = "localStorage",
|
|
@@ -9,10 +14,28 @@ declare enum StorageType {
|
|
|
9
14
|
}
|
|
10
15
|
declare class MyStorage {
|
|
11
16
|
storage: Storage;
|
|
17
|
+
/**
|
|
18
|
+
* @param type - StorageType.l 为 localStorage,StorageType.s 为 sessionStorage
|
|
19
|
+
*/
|
|
12
20
|
constructor(type: StorageType);
|
|
21
|
+
/**
|
|
22
|
+
* 写入缓存
|
|
23
|
+
*
|
|
24
|
+
* @param key - 缓存键
|
|
25
|
+
* @param value - 缓存值(会被 JSON.stringify)
|
|
26
|
+
* @param expires - false 永不过期;true 默认 1 小时;number 为秒数
|
|
27
|
+
*/
|
|
13
28
|
set(key: string, value: any, expires?: boolean | number): void;
|
|
29
|
+
/**
|
|
30
|
+
* 读取缓存,过期自动清除并返回 null
|
|
31
|
+
*
|
|
32
|
+
* @param key - 缓存键
|
|
33
|
+
* @returns 缓存值(JSON 解析后),过期或不存在时返回 null
|
|
34
|
+
*/
|
|
14
35
|
get(key: string): any;
|
|
36
|
+
/** 删除指定缓存 */
|
|
15
37
|
remove(key: string): void;
|
|
38
|
+
/** 清空所有缓存 */
|
|
16
39
|
clear(): void;
|
|
17
40
|
}
|
|
18
41
|
declare const LStorage: MyStorage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function startDBSCAN(modelId: string): void;
|
|
@@ -1,9 +1,6 @@
|
|
|
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';
|
|
5
1
|
declare const emitter: import('mitt').Emitter<Record<import('mitt').EventType, unknown>>;
|
|
6
2
|
export default emitter;
|
|
3
|
+
export type { AnnoType, RoamEvent, MeasureTool, EventContent, InstructionContent, } from '../types/events';
|
|
7
4
|
export declare let EventMemory: {
|
|
8
5
|
BIMX_CONFIGS: {
|
|
9
6
|
viewerManager: boolean;
|
|
@@ -14,82 +11,3 @@ export declare let EventMemory: {
|
|
|
14
11
|
viewerManager: boolean;
|
|
15
12
|
};
|
|
16
13
|
};
|
|
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
|
-
};
|
|
74
|
-
};
|
|
75
|
-
type instructionName = "updateCmtList" | "checkCmtDetail" | "newComment" | "updateBcfList" | "checkBcfDetail" | "changeBackgroundColor" | "setNavCube" | "setAnnoStatus" | "lastSetsContent";
|
|
76
|
-
export type InstructionContent = {
|
|
77
|
-
instruct_name: instructionName;
|
|
78
|
-
content: {
|
|
79
|
-
code?: any;
|
|
80
|
-
guid?: any;
|
|
81
|
-
msg?: any;
|
|
82
|
-
type?: any;
|
|
83
|
-
active?: boolean;
|
|
84
|
-
color?: string;
|
|
85
|
-
move?: boolean;
|
|
86
|
-
pos?: ToolDir;
|
|
87
|
-
posNum?: number[];
|
|
88
|
-
index?: number;
|
|
89
|
-
cmtList?: any;
|
|
90
|
-
cmtDetail?: any;
|
|
91
|
-
bcfList?: BcfTopicTotal[];
|
|
92
|
-
bcfDetail?: BcfTopicTotal;
|
|
93
|
-
lastSet?: any;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
@@ -1,19 +1,69 @@
|
|
|
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
|
+
*/
|
|
1
13
|
export default class ViewerManager {
|
|
2
|
-
|
|
3
|
-
|
|
14
|
+
/** 查看器运行时状态(代理到 viewerStore,保持响应式) */
|
|
15
|
+
static get viewerState(): {
|
|
16
|
+
measureType: "distance" | "angle";
|
|
4
17
|
};
|
|
5
|
-
static
|
|
18
|
+
static set viewerState(val: {
|
|
19
|
+
measureType: "distance" | "angle";
|
|
20
|
+
});
|
|
21
|
+
/** 引擎实体状态缓存(代理到 viewerStore,保持响应式) */
|
|
22
|
+
static get entityState(): {
|
|
6
23
|
xrayedObjectIds: string[];
|
|
7
24
|
highlightedObjectIds: string[];
|
|
8
25
|
selectedObjectIds: string[];
|
|
9
26
|
visibleObjectIds: string[];
|
|
10
27
|
edgesObjectIds: string[];
|
|
11
28
|
};
|
|
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
|
+
*/
|
|
12
41
|
static ConfigViewer(eventTarget?: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* 保存查看器运行时状态
|
|
44
|
+
* @param content - 状态快照对象
|
|
45
|
+
*/
|
|
13
46
|
static SaveViewerState(content: any): void;
|
|
47
|
+
/**
|
|
48
|
+
* 通过工具 ID 激活/关闭工具
|
|
49
|
+
* @param id - 工具栏工具 ID
|
|
50
|
+
* @param active - 目标激活状态,默认取反当前状态
|
|
51
|
+
*/
|
|
14
52
|
static SetToolActiveById(id: number, active?: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* 通过工具 key 激活/关闭工具
|
|
55
|
+
* @param key - 工具 key(如 "measure" / "section" / "roam" 等)
|
|
56
|
+
* @param active - 目标激活状态,默认取反当前状态
|
|
57
|
+
*/
|
|
15
58
|
static SetToolActiveByKey(key: string, active?: boolean): void;
|
|
59
|
+
/** 关闭所有已激活的工具 */
|
|
16
60
|
static SetAllClose(): void;
|
|
61
|
+
/** 销毁当前 BIM 查看器实例 */
|
|
17
62
|
static DestroyViewer(): void;
|
|
63
|
+
/**
|
|
64
|
+
* 显示/隐藏加载中遮罩
|
|
65
|
+
* @param show - true 显示加载中,false 隐藏
|
|
66
|
+
* @param callback - 可选回调
|
|
67
|
+
*/
|
|
18
68
|
static showRequestBusy(show: boolean, callback?: Function): void;
|
|
19
69
|
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { _ as D } from "./alert-ChDNxVgQ.mjs";
|
|
2
|
-
import { defineComponent as O, ref as p, watch as q, onMounted as H, onBeforeUnmount as R, openBlock as i, createElementBlock as a, unref as n, createCommentVNode as b, createElementVNode as c, normalizeClass as f, Fragment as B, renderList as C, toDisplayString as U, withDirectives as z, createVNode as F, vShow as j } from "vue";
|
|
3
|
-
import { n as G, o as J, p as t, q as v, O as r, y as K } from "./index-Dsq1epCY.mjs";
|
|
4
|
-
import { A as l } from "./const-DOnRsYpZ.mjs";
|
|
5
|
-
const Q = { class: "annotation_component" }, Y = {
|
|
6
|
-
key: 0,
|
|
7
|
-
id: "annotation_toolbar",
|
|
8
|
-
class: "annotation_toolbar"
|
|
9
|
-
}, Z = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "toolbar_trangle"
|
|
12
|
-
}, ee = { class: "annotation_toolbar_group" }, ne = ["id", "disabled", "onClick"], oe = ["src"], te = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "toolbar_trangle"
|
|
15
|
-
}, ie = {
|
|
16
|
-
key: 1,
|
|
17
|
-
class: "mobile_annotation_toolbar"
|
|
18
|
-
}, ae = { class: "anno_toolList" }, se = { class: "label-list" }, ce = ["onClick"], re = { class: "item-img" }, le = ["src"], _e = { class: "item-name" }, de = /* @__PURE__ */ O({
|
|
19
|
-
__name: "AnnotationTool",
|
|
20
|
-
props: ["componentId"],
|
|
21
|
-
emits: ["uploadImage", "clickAnnotation", "emitHandler"],
|
|
22
|
-
setup(y, { emit: $ }) {
|
|
23
|
-
const P = G(), w = J(), S = $, d = (e) => {
|
|
24
|
-
S("emitHandler", e);
|
|
25
|
-
};
|
|
26
|
-
let T;
|
|
27
|
-
const A = p(!0), s = p("");
|
|
28
|
-
let m;
|
|
29
|
-
const M = p(), h = y;
|
|
30
|
-
q(
|
|
31
|
-
() => w.isToolActive(h.componentId),
|
|
32
|
-
(e) => {
|
|
33
|
-
e || (s.value = "");
|
|
34
|
-
}
|
|
35
|
-
), H(() => {
|
|
36
|
-
M.value = t("annoLimit"), w.setReadyById(h.componentId);
|
|
37
|
-
});
|
|
38
|
-
const x = {
|
|
39
|
-
image: `${r}/BIMX_Website/main/mainView/function_icon/annotation_icons/image_active.png`,
|
|
40
|
-
file: `${r}/BIMX_Website/main/mainView/function_icon/annotation_icons/file_active.png`,
|
|
41
|
-
record: `${r}/BIMX_Website/main/mainView/function_icon/annotation_icons/record_active.png`,
|
|
42
|
-
text: `${r}/BIMX_Website/main/mainView/function_icon/annotation_icons/text_active.png`,
|
|
43
|
-
video: `${r}/BIMX_Website/main/mainView/function_icon/annotation_icons/video_active.png`
|
|
44
|
-
}, k = () => {
|
|
45
|
-
T = window.bimViewer.annotationTool, T.setTypeImage(x), m = window.bimViewer.eventTrigger, m.on("createAnnotation", (e) => {
|
|
46
|
-
d({
|
|
47
|
-
isTool: !0,
|
|
48
|
-
event_target: "AnnotationTool",
|
|
49
|
-
event_name: "createAnnotation",
|
|
50
|
-
content: {
|
|
51
|
-
currentAnnotation: e
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}), m.on("markerClicked", (e) => {
|
|
55
|
-
d({
|
|
56
|
-
isTool: !0,
|
|
57
|
-
event_target: "AnnotationTool",
|
|
58
|
-
event_name: "clickAnnotation",
|
|
59
|
-
content: {
|
|
60
|
-
targetAnno: e
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}), t("isMobile") || m.on("requestDeleteMarker", (e) => {
|
|
64
|
-
d({
|
|
65
|
-
isTool: !0,
|
|
66
|
-
event_target: "AnnotationTool",
|
|
67
|
-
event_name: "requestDelAnno",
|
|
68
|
-
content: {
|
|
69
|
-
msg: "请求删除指定标注",
|
|
70
|
-
annoId: e
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
v.on("BimViewer", k);
|
|
76
|
-
const I = (e) => {
|
|
77
|
-
g(L(e.type));
|
|
78
|
-
};
|
|
79
|
-
v.on("setAnnoStatus", I), R(() => {
|
|
80
|
-
v.off("BimViewer", k), v.off("setAnnoStatus", I);
|
|
81
|
-
});
|
|
82
|
-
const L = (e) => {
|
|
83
|
-
if (e === "image")
|
|
84
|
-
return l[0];
|
|
85
|
-
if (e === "record")
|
|
86
|
-
return l[1];
|
|
87
|
-
if (e === "video")
|
|
88
|
-
return l[2];
|
|
89
|
-
if (e === "file")
|
|
90
|
-
return l[3];
|
|
91
|
-
if (e === "text")
|
|
92
|
-
return l[4];
|
|
93
|
-
}, g = (e) => {
|
|
94
|
-
t("editPrivilege") != 1 && (s.value === e.code ? (s.value = "", V(e, !1)) : (s.value = e.code, V(e, !0)));
|
|
95
|
-
}, N = (e) => {
|
|
96
|
-
window.bimViewer.annotationTool.setEnabled(e);
|
|
97
|
-
}, V = (e, _) => {
|
|
98
|
-
N(_), E(e.code, _);
|
|
99
|
-
}, E = (e, _) => {
|
|
100
|
-
window.bimViewer.annotationTool.setCurrentType(e), d({
|
|
101
|
-
isTool: !0,
|
|
102
|
-
event_target: "AnnotationTool",
|
|
103
|
-
event_name: "clickAnnoTool",
|
|
104
|
-
content: {
|
|
105
|
-
active: _,
|
|
106
|
-
tool_type: e
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
return (e, _) => {
|
|
111
|
-
const W = D;
|
|
112
|
-
return i(), a("div", Q, [
|
|
113
|
-
n(t)("isMobile") ? (i(), a("div", ie, [
|
|
114
|
-
c("div", ae, [
|
|
115
|
-
c("div", se, [
|
|
116
|
-
(i(!0), a(B, null, C(n(l), (o, u) => (i(), a("div", {
|
|
117
|
-
key: u,
|
|
118
|
-
class: f(["label-item", { "label-item-active": s.value === o.code && n(t)("editPrivilege") == 0, noPermission: n(t)("editPrivilege") == 1 }]),
|
|
119
|
-
onClick: (X) => g(o)
|
|
120
|
-
}, [
|
|
121
|
-
c("div", re, [
|
|
122
|
-
c("img", {
|
|
123
|
-
class: "label-item-img",
|
|
124
|
-
src: n(r) + `/bim-viewer/annotation/new-icons/bimkk-mobile-anno-${s.value === o.code && n(t)("editPrivilege") == 0 ? o.imgActive : o.img}.svg`,
|
|
125
|
-
alt: ""
|
|
126
|
-
}, null, 8, le),
|
|
127
|
-
c("div", _e, U(n(P)(o.name)), 1)
|
|
128
|
-
])
|
|
129
|
-
], 10, ce))), 128))
|
|
130
|
-
])
|
|
131
|
-
])
|
|
132
|
-
])) : (i(), a("div", Y, [
|
|
133
|
-
n(t)("annotationPos").pos.includes("top") ? (i(), a("div", Z)) : b("", !0),
|
|
134
|
-
c("div", {
|
|
135
|
-
class: f(["annotation_toolbar_wrapper", { annotation_toolbar_wrapper_disable: n(t)("editPrivilege") == 1 }])
|
|
136
|
-
}, [
|
|
137
|
-
c("div", ee, [
|
|
138
|
-
(i(!0), a(B, null, C(n(l), (o, u) => (i(), a("button", {
|
|
139
|
-
id: `annotation_tool_btn_${u}`,
|
|
140
|
-
key: u,
|
|
141
|
-
class: f(["annotation_tool_btn", { active: s.value === o.code }]),
|
|
142
|
-
disabled: n(t)("editPrivilege") == 1,
|
|
143
|
-
onClick: (X) => g(o)
|
|
144
|
-
}, [
|
|
145
|
-
b("", !0),
|
|
146
|
-
c("img", {
|
|
147
|
-
src: `${n(r)}/bim-viewer/action-bars/panno-${s.value !== o.code ? o.img : o.imgActive}.svg`
|
|
148
|
-
}, null, 8, oe)
|
|
149
|
-
], 10, ne))), 128))
|
|
150
|
-
])
|
|
151
|
-
], 2),
|
|
152
|
-
n(t)("annotationPos").pos.includes("bottom") ? (i(), a("div", te)) : b("", !0)
|
|
153
|
-
])),
|
|
154
|
-
z(F(W, {
|
|
155
|
-
"click-handle": () => {
|
|
156
|
-
A.value = !1;
|
|
157
|
-
}
|
|
158
|
-
}, null, 8, ["click-handle"]), [
|
|
159
|
-
[j, A.value && n(t)("editPrivilege") == 0]
|
|
160
|
-
])
|
|
161
|
-
]);
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}), pe = /* @__PURE__ */ K(de, [["__scopeId", "data-v-7c08da5a"]]);
|
|
165
|
-
export {
|
|
166
|
-
pe as default
|
|
167
|
-
};
|