@xtctwins/tctwins-industry-engine 0.0.12 → 0.1.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 +196 -3
- package/dist/01.xtc +0 -0
- package/dist/02.xtc +0 -0
- package/dist/03.xtc +0 -0
- package/dist/AnnotationTool-C5L5i2tf.mjs +166 -0
- package/dist/CameraViewTool-CM0qckrp.mjs +164 -0
- package/dist/CommentTool-B-6jkY8g.mjs +1528 -0
- package/dist/HiddenTool-CoiTnXX_.mjs +56 -0
- package/dist/Industry_Viewer_Lib.es.js +10 -5
- package/dist/Industry_Viewer_Lib.umd.js +262 -235
- package/dist/InspectorTool-D4XjJ3xE.mjs +679 -0
- package/dist/MeasureTool-DeguXY8Q.mjs +593 -0
- package/dist/MouseTool-MBZQBiey.mjs +84 -0
- package/dist/NavigateTool-CJ3Gcn7x.mjs +51 -0
- package/dist/OperateTool-CMncJ40d.mjs +185 -0
- package/dist/RoamTool-C56sheuh.mjs +287 -0
- package/dist/ScreenShotTool-PNCCVzI0.mjs +429 -0
- package/dist/SectionTool-CWdsvIBB.mjs +241 -0
- package/dist/SettingTool-CWmeVytp.mjs +1787 -0
- package/dist/StructureTree-Cjqc9T7J.mjs +1685 -0
- package/dist/alert-CYzWSnHi.mjs +52 -0
- package/dist/index-DoJj-LVm.mjs +138727 -0
- package/dist/index.html +17 -0
- package/dist/{panel.vue_vue_type_style_index_0_lang-CCuIP-Pp.mjs → panel.vue_vue_type_style_index_0_lang-Cc0xV2N6.mjs} +3 -3
- package/dist/style.css +3 -1
- package/dist/{tallPanel-CqKqC6yK.mjs → tallPanel-fxMO0U73.mjs} +24 -24
- package/dist/timer-DoTiGoWP.mjs +30 -0
- package/package.json +85 -66
- package/types/App.vue.d.ts +3 -1
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +1 -1
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +1 -1
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +2 -2
- package/types/components/BCFComponents/commentInput.vue.d.ts +1 -1
- package/types/components/BCFComponents/commentsView.vue.d.ts +6 -6
- package/types/components/BCFComponents/imageView.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CameraViewTool.vue.d.ts +12 -0
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +34 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/add.vue.d.ts +14 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +11 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +17 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +275 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +297 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +9 -0
- package/types/components/BimViewerComponents/OperateTool.vue.d.ts +12 -0
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +14 -0
- package/types/components/BimViewerComponents/SectionModeBar.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +8035 -419
- package/types/components/{industryViewer.vue.d.ts → BimxViewerComp.vue.d.ts} +7 -0
- package/types/components/IndustryViewerComp.vue.d.ts +25 -0
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +1 -1
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +1 -1
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +100 -308
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +100 -308
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +2 -0
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +4 -4
- package/types/components/utilsComponents/alert.vue.d.ts +9 -0
- package/types/components/utilsComponents/prompt.vue.d.ts +8 -0
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +1 -1
- package/types/i18n/index.d.ts +1775 -0
- package/types/i18n/locales/en-US.d.ts +441 -0
- package/types/i18n/locales/zh-CN.d.ts +441 -0
- package/types/i18n/types.d.ts +144 -0
- package/types/index.d.ts +8 -5
- package/types/pages/{viewerEntry.vue.d.ts → BimxViewerEntry.vue.d.ts} +20 -8
- package/types/pages/IndustryViewerEntry.vue.d.ts +71 -0
- package/types/services/request/api.d.ts +3 -0
- package/types/services/request/index.d.ts +14 -0
- package/types/services/request/types.d.ts +12 -0
- package/types/store/bcfReflect.d.ts +8 -7
- package/types/store/const.d.ts +32 -3
- package/types/store/initConfigs.d.ts +3 -3
- package/types/store/localeStore.d.ts +12 -0
- package/types/store/propertyReflect.d.ts +1 -1
- package/types/store/toolbars.d.ts +596 -75
- package/types/store/userInfoStore.d.ts +32 -0
- package/types/tests/bcf.d.ts +8 -0
- package/types/utils/OSSHelper.d.ts +3 -0
- package/types/utils/eventBus.d.ts +23 -5
- package/types/utils/roles.d.ts +1 -1
- package/types/utils/splitType.d.ts +1 -0
- package/types/viewerManager/initial/viewerInitial.d.ts +14 -1
- package/types/viewerManager/load/loadModel.d.ts +122 -1
- package/types/viewerManager/sectionManager.d.ts +524 -0
- package/types/viewerManager/viewerManager.d.ts +19 -1
- package/dist/AnnotationTool-f7CrC7Dr.mjs +0 -131
- package/dist/BCFTool-CdN6SGDL.mjs +0 -25118
- package/dist/CommentTool-Cfht7mQS.mjs +0 -168
- package/dist/InspectorTool-M_oBYVQA.mjs +0 -674
- package/dist/MeasureTool-CxWeQFgY.mjs +0 -167
- package/dist/MouseTool-BHbi-fg3.mjs +0 -84
- package/dist/NavigateTool-BdUVi4Be.mjs +0 -52
- package/dist/RoamTool-Uuxa-94w.mjs +0 -212
- package/dist/ScreenShotTool-CZUm8l2Z.mjs +0 -445
- package/dist/SectionTool-DZToybAI.mjs +0 -217
- package/dist/SettingTool-CYM0qsUs.mjs +0 -770
- package/dist/StructureTree-DeXxENMk.mjs +0 -1824
- package/dist/XRayTool-Bug-FcKJ.mjs +0 -57
- package/dist/alert-DGyQ9rEq.mjs +0 -46
- package/dist/const-DeViLYl5.mjs +0 -266
- package/dist/el-checkbox-ClYe-8uK.mjs +0 -544
- package/dist/el-input-number-Df5HOHuh.mjs +0 -1028
- package/dist/index-BNrMlQLr.mjs +0 -101871
- /package/types/components/BimViewerComponents/{mobileToolbar.vue.d.ts → AppToolbar.vue.d.ts} +0 -0
- /package/types/components/BimViewerComponents/{XRayTool.vue.d.ts → HiddenTool.vue.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,196 @@
|
|
|
1
|
-
## @xtctwins/tctwins-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
## @xtctwins/tctwins-bimx-engine
|
|
2
|
+
|
|
3
|
+
# xtc 三维文件查看器
|
|
4
|
+
|
|
5
|
+
## 安装相关依赖
|
|
6
|
+
|
|
7
|
+
## UI element-plus
|
|
8
|
+
|
|
9
|
+
<https://www.npmjs.com/package/element-plus>
|
|
10
|
+
|
|
11
|
+
```ssh
|
|
12
|
+
npm i element-plus
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 事件总线 mitt
|
|
16
|
+
|
|
17
|
+
<https://www.npmjs.com/package/mitt>
|
|
18
|
+
|
|
19
|
+
```ssh
|
|
20
|
+
npm i mitt
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 状态管理 pinia
|
|
24
|
+
|
|
25
|
+
<https://www.npmjs.com/package/pinia>
|
|
26
|
+
|
|
27
|
+
```ssh
|
|
28
|
+
npm i pinia
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 文件获取 ali-oss
|
|
32
|
+
|
|
33
|
+
<https://www.npmjs.com/package/ali-oss>
|
|
34
|
+
|
|
35
|
+
```ssh
|
|
36
|
+
npm i ali-oss
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
# 安装依赖
|
|
40
|
+
|
|
41
|
+
```ssh
|
|
42
|
+
// 安装依赖
|
|
43
|
+
npm i @xtctwins/tctwins-bimx-engine
|
|
44
|
+
// 引入样式
|
|
45
|
+
import "@xtctwins/tctwins-bimx-engine/dist/style.css";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
# Example
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
<template>
|
|
52
|
+
<!-- 一个模型 -->
|
|
53
|
+
<!-- :model-buffer 和 :file-path 选一个使用即可-->
|
|
54
|
+
<!-- :model-buffer 是直接传入模型buffer数据-->
|
|
55
|
+
<!-- :file-path 是传入文件下载路径-->
|
|
56
|
+
<IndustryViewer
|
|
57
|
+
v-if="initialzed"
|
|
58
|
+
:load-meta="true"
|
|
59
|
+
:file-path="filePath"
|
|
60
|
+
:nav-cube-size="120"
|
|
61
|
+
:background-color="'#d0d0d0'"
|
|
62
|
+
@emit-handler="EmitHandler" />
|
|
63
|
+
|
|
64
|
+
<!-- 集成模型 -->
|
|
65
|
+
<!-- 请使用-->
|
|
66
|
+
<!--:file-paths="filePaths"-->
|
|
67
|
+
<!--:multi-model="true"-->
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script lang="ts" setup>
|
|
71
|
+
import { onMounted, ref } from "vue";
|
|
72
|
+
import { IndustryViewer } from "@xtctwins/tctwins-industry-engine";
|
|
73
|
+
import type { EventContent } from "@xtctwins/tctwins-industry-engine";
|
|
74
|
+
import "@xtctwins/tctwins-industry-engine/dist/style.css";
|
|
75
|
+
|
|
76
|
+
const initialzed = ref(false);
|
|
77
|
+
const filePath = ref(`https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/test/1公寓幕墙.xtc`);
|
|
78
|
+
const filePaths = [
|
|
79
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170745913287.xtc",
|
|
80
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170736552499.xtc",
|
|
81
|
+
"https://tctwins-oss-test.oss-cn-beijing.aliyuncs.com/tests/models/multiModel/model2/20250205170731500203.xtc"
|
|
82
|
+
];
|
|
83
|
+
const modelBuffer = ref<ArrayBuffer>();
|
|
84
|
+
|
|
85
|
+
onMounted(() => {
|
|
86
|
+
//如果选择直接传入模型modelBuffer,请在获取到buffer后再初始化IndustryViewer
|
|
87
|
+
// getModel(() => {
|
|
88
|
+
// initialzed.value = true;
|
|
89
|
+
// });
|
|
90
|
+
|
|
91
|
+
//如果使用filePath或者filePaths则直接初始化IndustryViewer即可
|
|
92
|
+
initialzed.value = true;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
//监听引擎传出的事件
|
|
96
|
+
const EmitHandler = (content: EventContent) => {
|
|
97
|
+
console.log(content);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
//xtc模型数据
|
|
101
|
+
const getModel = (callback: () => void) => {
|
|
102
|
+
// 自行填写获取模型文件的内容
|
|
103
|
+
// ...
|
|
104
|
+
// modelBuffer.value = ...
|
|
105
|
+
callback();
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style>
|
|
110
|
+
#app {
|
|
111
|
+
position: absolute;
|
|
112
|
+
left: 0;
|
|
113
|
+
right: 0;
|
|
114
|
+
top: 0;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 其他参数解释
|
|
124
|
+
|
|
125
|
+
### 基础设置
|
|
126
|
+
|
|
127
|
+
是否载入构件属性信息(xts文件),
|
|
128
|
+
如果要载入,在模型xtc文件相同路径下必须有同名xts文件
|
|
129
|
+
|
|
130
|
+
```ssh
|
|
131
|
+
:load-meta="true"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
是否显示导航盒
|
|
135
|
+
|
|
136
|
+
```ssh
|
|
137
|
+
:showNavCube="true"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
导航盒尺寸
|
|
141
|
+
|
|
142
|
+
```ssh
|
|
143
|
+
:nav-cube-size="120"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
背景颜色
|
|
147
|
+
|
|
148
|
+
```ssh
|
|
149
|
+
:background-color="#d0d0d0"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 功能
|
|
153
|
+
|
|
154
|
+
添加需要的即可
|
|
155
|
+
|
|
156
|
+
```ssh
|
|
157
|
+
inspector
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
inspector - 构建属性面板开启 (需要开启loadMeta)
|
|
161
|
+
|
|
162
|
+
```ssh
|
|
163
|
+
reseta
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
reseta - 重置模型视角
|
|
167
|
+
|
|
168
|
+
## 事件
|
|
169
|
+
|
|
170
|
+
```ssh
|
|
171
|
+
//监听引擎传出的事件
|
|
172
|
+
const EmitHandler = (content: EventContent) => {
|
|
173
|
+
console.log(content);
|
|
174
|
+
};
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
//事件内容
|
|
179
|
+
type EventContent = {
|
|
180
|
+
isTool: boolean;
|
|
181
|
+
event_target: ComponentName | "IndustryViewer" | "ToolBar";
|
|
182
|
+
event_name: string;
|
|
183
|
+
content: {};
|
|
184
|
+
};
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
事件内容包括:
|
|
188
|
+
|
|
189
|
+
```ssh
|
|
190
|
+
"pickedEntity" - 点击构件
|
|
191
|
+
"pickedNothing" - 点击空白处
|
|
192
|
+
...
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
##### 正式
|
package/dist/01.xtc
ADDED
|
Binary file
|
package/dist/02.xtc
ADDED
|
Binary file
|
package/dist/03.xtc
ADDED
|
Binary file
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { _ as D } from "./alert-CYzWSnHi.mjs";
|
|
2
|
+
import { defineComponent as H, ref as p, watch as O, onMounted as q, onBeforeUnmount as F, openBlock as i, createElementBlock as a, unref as n, createCommentVNode as b, createElementVNode as r, normalizeClass as f, Fragment as B, renderList as C, toDisplayString as R, withDirectives as U, createVNode as z, vShow as G } from "vue";
|
|
3
|
+
import { F as j, G as J, H as o, I as v, al as l, P as c, M as K } from "./index-DoJj-LVm.mjs";
|
|
4
|
+
const Q = { class: "annotation_component" }, Y = {
|
|
5
|
+
key: 0,
|
|
6
|
+
id: "annotation_toolbar",
|
|
7
|
+
class: "annotation_toolbar"
|
|
8
|
+
}, Z = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "toolbar_trangle"
|
|
11
|
+
}, ee = { class: "annotation_toolbar_group" }, ne = ["id", "disabled", "onClick"], te = ["src"], oe = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "toolbar_trangle"
|
|
14
|
+
}, ie = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "mobile_annotation_toolbar"
|
|
17
|
+
}, ae = { class: "anno_toolList" }, se = { class: "label-list" }, re = ["onClick"], le = { class: "item-img" }, ce = ["src"], _e = { class: "item-name" }, de = /* @__PURE__ */ H({
|
|
18
|
+
__name: "AnnotationTool",
|
|
19
|
+
props: ["componentId"],
|
|
20
|
+
emits: ["uploadImage", "clickAnnotation", "emitHandler"],
|
|
21
|
+
setup(y, { emit: P }) {
|
|
22
|
+
const $ = j(), T = J(), M = P, d = (e) => {
|
|
23
|
+
M("emitHandler", e);
|
|
24
|
+
};
|
|
25
|
+
let w;
|
|
26
|
+
const A = p(!0), s = p("");
|
|
27
|
+
let m;
|
|
28
|
+
const S = p(), h = y;
|
|
29
|
+
O(
|
|
30
|
+
() => T.isToolActive(h.componentId),
|
|
31
|
+
(e) => {
|
|
32
|
+
e || (s.value = "");
|
|
33
|
+
}
|
|
34
|
+
), q(() => {
|
|
35
|
+
S.value = o("annoLimit"), T.setReadyById(h.componentId);
|
|
36
|
+
});
|
|
37
|
+
const x = {
|
|
38
|
+
image: `${c}/BIMX_Website/main/mainView/function_icon/annotation_icons/image_active.png`,
|
|
39
|
+
file: `${c}/BIMX_Website/main/mainView/function_icon/annotation_icons/file_active.png`,
|
|
40
|
+
record: `${c}/BIMX_Website/main/mainView/function_icon/annotation_icons/record_active.png`,
|
|
41
|
+
text: `${c}/BIMX_Website/main/mainView/function_icon/annotation_icons/text_active.png`,
|
|
42
|
+
video: `${c}/BIMX_Website/main/mainView/function_icon/annotation_icons/video_active.png`
|
|
43
|
+
}, k = () => {
|
|
44
|
+
w = window.bimViewer.annotationTool, w.setTypeImage(x), m = window.bimViewer.eventTrigger, m.on("createAnnotation", (e) => {
|
|
45
|
+
d({
|
|
46
|
+
isTool: !0,
|
|
47
|
+
event_target: "AnnotationTool",
|
|
48
|
+
event_name: "createAnnotation",
|
|
49
|
+
content: {
|
|
50
|
+
currentAnnotation: e
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}), m.on("markerClicked", (e) => {
|
|
54
|
+
d({
|
|
55
|
+
isTool: !0,
|
|
56
|
+
event_target: "AnnotationTool",
|
|
57
|
+
event_name: "clickAnnotation",
|
|
58
|
+
content: {
|
|
59
|
+
targetAnno: e
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}), o("isMobile") || m.on("requestDeleteMarker", (e) => {
|
|
63
|
+
d({
|
|
64
|
+
isTool: !0,
|
|
65
|
+
event_target: "AnnotationTool",
|
|
66
|
+
event_name: "requestDelAnno",
|
|
67
|
+
content: {
|
|
68
|
+
msg: "请求删除指定标注",
|
|
69
|
+
annoId: e
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
v.on("BimViewer", k);
|
|
75
|
+
const I = (e) => {
|
|
76
|
+
g(L(e.type));
|
|
77
|
+
};
|
|
78
|
+
v.on("setAnnoStatus", I), F(() => {
|
|
79
|
+
v.off("BimViewer", k), v.off("setAnnoStatus", I);
|
|
80
|
+
});
|
|
81
|
+
const L = (e) => {
|
|
82
|
+
if (e === "image")
|
|
83
|
+
return l[0];
|
|
84
|
+
if (e === "record")
|
|
85
|
+
return l[1];
|
|
86
|
+
if (e === "video")
|
|
87
|
+
return l[2];
|
|
88
|
+
if (e === "file")
|
|
89
|
+
return l[3];
|
|
90
|
+
if (e === "text")
|
|
91
|
+
return l[4];
|
|
92
|
+
}, g = (e) => {
|
|
93
|
+
o("editPrivilege") != 1 && (s.value === e.code ? (s.value = "", V(e, !1)) : (s.value = e.code, V(e, !0)));
|
|
94
|
+
}, N = (e) => {
|
|
95
|
+
window.bimViewer.annotationTool.setEnabled(e);
|
|
96
|
+
}, V = (e, _) => {
|
|
97
|
+
N(_), E(e.code, _);
|
|
98
|
+
}, E = (e, _) => {
|
|
99
|
+
window.bimViewer.annotationTool.setCurrentType(e), d({
|
|
100
|
+
isTool: !0,
|
|
101
|
+
event_target: "AnnotationTool",
|
|
102
|
+
event_name: "clickAnnoTool",
|
|
103
|
+
content: {
|
|
104
|
+
active: _,
|
|
105
|
+
tool_type: e
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
return (e, _) => {
|
|
110
|
+
const W = D;
|
|
111
|
+
return i(), a("div", Q, [
|
|
112
|
+
n(o)("isMobile") ? (i(), a("div", ie, [
|
|
113
|
+
r("div", ae, [
|
|
114
|
+
r("div", se, [
|
|
115
|
+
(i(!0), a(B, null, C(n(l), (t, u) => (i(), a("div", {
|
|
116
|
+
key: u,
|
|
117
|
+
class: f(["label-item", { "label-item-active": s.value === t.code && n(o)("editPrivilege") == 0, noPermission: n(o)("editPrivilege") == 1 }]),
|
|
118
|
+
onClick: (X) => g(t)
|
|
119
|
+
}, [
|
|
120
|
+
r("div", le, [
|
|
121
|
+
r("img", {
|
|
122
|
+
class: "label-item-img",
|
|
123
|
+
src: n(c) + `/industry-viewer/annotation-bar/${s.value === t.code && n(o)("editPrivilege") == 0 ? t.imgActive : t.img}.svg`,
|
|
124
|
+
alt: ""
|
|
125
|
+
}, null, 8, ce),
|
|
126
|
+
r("div", _e, R(n($)(t.name)), 1)
|
|
127
|
+
])
|
|
128
|
+
], 10, re))), 128))
|
|
129
|
+
])
|
|
130
|
+
])
|
|
131
|
+
])) : (i(), a("div", Y, [
|
|
132
|
+
n(o)("annotationPos").pos.includes("top") ? (i(), a("div", Z)) : b("", !0),
|
|
133
|
+
r("div", {
|
|
134
|
+
class: f(["annotation_toolbar_wrapper", { annotation_toolbar_wrapper_disable: n(o)("editPrivilege") == 1 }])
|
|
135
|
+
}, [
|
|
136
|
+
r("div", ee, [
|
|
137
|
+
(i(!0), a(B, null, C(n(l), (t, u) => (i(), a("button", {
|
|
138
|
+
id: `annotation_tool_btn_${u}`,
|
|
139
|
+
key: u,
|
|
140
|
+
class: f(["annotation_tool_btn", { active: s.value === t.code }]),
|
|
141
|
+
disabled: n(o)("editPrivilege") == 1,
|
|
142
|
+
onClick: (X) => g(t)
|
|
143
|
+
}, [
|
|
144
|
+
b("", !0),
|
|
145
|
+
r("img", {
|
|
146
|
+
src: `${n(c)}/bim-viewer/action-bars/panno-${s.value !== t.code ? t.img : t.imgActive}.svg`
|
|
147
|
+
}, null, 8, te)
|
|
148
|
+
], 10, ne))), 128))
|
|
149
|
+
])
|
|
150
|
+
], 2),
|
|
151
|
+
n(o)("annotationPos").pos.includes("bottom") ? (i(), a("div", oe)) : b("", !0)
|
|
152
|
+
])),
|
|
153
|
+
U(z(W, {
|
|
154
|
+
"click-handle": () => {
|
|
155
|
+
A.value = !1;
|
|
156
|
+
}
|
|
157
|
+
}, null, 8, ["click-handle"]), [
|
|
158
|
+
[G, A.value && n(o)("editPrivilege") == 0]
|
|
159
|
+
])
|
|
160
|
+
]);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}), ge = /* @__PURE__ */ K(de, [["__scopeId", "data-v-0df82279"]]);
|
|
164
|
+
export {
|
|
165
|
+
ge as default
|
|
166
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { G as X, H as Y, I as x, W as z, P as y, M as A } from "./index-DoJj-LVm.mjs";
|
|
2
|
+
import { defineComponent as G, ref as l, watch as k, onMounted as O, onBeforeUnmount as j, openBlock as u, createElementBlock as g, normalizeClass as T, createElementVNode as t, createBlock as q, withCtx as F, unref as B, withDirectives as I, vModelText as N, createCommentVNode as J } from "vue";
|
|
3
|
+
const K = { class: "cameraView_tool_btn" }, Q = ["src"], Z = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "cameraView_tool_btn"
|
|
6
|
+
}, ee = ["src"], te = { class: "dialog-container" }, oe = { class: "dialog-header" }, ae = { class: "dialog-content" }, se = { class: "preview-shot" }, ne = ["src"], le = { class: "form-group" }, ie = { class: "form-group" }, ce = { class: "dialog-footer" }, re = /* @__PURE__ */ G({
|
|
7
|
+
__name: "CameraViewTool",
|
|
8
|
+
props: ["componentId", "instruction"],
|
|
9
|
+
emits: ["emitHandler"],
|
|
10
|
+
setup(E, { emit: S }) {
|
|
11
|
+
const _ = X();
|
|
12
|
+
let v;
|
|
13
|
+
const w = l(!Y("isMobile")), p = E;
|
|
14
|
+
k(
|
|
15
|
+
() => _.isToolActive(p.componentId),
|
|
16
|
+
(o) => {
|
|
17
|
+
}
|
|
18
|
+
), k(
|
|
19
|
+
() => p.instruction,
|
|
20
|
+
(o) => {
|
|
21
|
+
if (o && o.instruct_name == "setCameraView") {
|
|
22
|
+
const e = o.content.cameraView;
|
|
23
|
+
v.flyToNewView({ ...e, duration: 1 });
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{ deep: !0 }
|
|
27
|
+
), O(() => {
|
|
28
|
+
_.setReadyById(p.componentId);
|
|
29
|
+
});
|
|
30
|
+
const V = () => {
|
|
31
|
+
v = window.bimViewer, window.bimViewer.eventTrigger;
|
|
32
|
+
};
|
|
33
|
+
x.on("BimViewer", V);
|
|
34
|
+
const H = (o, e) => {
|
|
35
|
+
const a = document.getElementById("myCanvas"), s = document.createElement("a");
|
|
36
|
+
s.download = "screenshot.png";
|
|
37
|
+
const d = document.createElement("canvas"), i = d.getContext("2d");
|
|
38
|
+
if (a && i) {
|
|
39
|
+
d.width = o, d.height = e;
|
|
40
|
+
const D = o / a.width, L = e / a.height, b = Math.max(D, L), C = a.width * b, h = a.height * b, P = (o - C) / 2, W = (e - h) / 2;
|
|
41
|
+
return i.clearRect(0, 0, o, e), i.fillStyle = "transparent", i.fillRect(0, 0, o, e), i.drawImage(a, 0, 0, a.width, a.height, P, W, C, h), d.toDataURL("image/png");
|
|
42
|
+
} else
|
|
43
|
+
return "";
|
|
44
|
+
}, M = S, R = (o) => {
|
|
45
|
+
M("emitHandler", o);
|
|
46
|
+
}, c = l(""), r = l(""), n = l(!1), m = l(""), f = l(), U = () => {
|
|
47
|
+
n.value = !0, f.value = v.getCameraView(), m.value = H(220, 124);
|
|
48
|
+
}, $ = () => {
|
|
49
|
+
R({
|
|
50
|
+
isTool: !0,
|
|
51
|
+
event_target: "CameraViewTool",
|
|
52
|
+
event_name: "newCameraView",
|
|
53
|
+
content: {
|
|
54
|
+
cameraView: f.value,
|
|
55
|
+
title: c.value,
|
|
56
|
+
description: r.value,
|
|
57
|
+
img_data: m.value
|
|
58
|
+
}
|
|
59
|
+
}), n.value = !1, c.value = "", r.value = "", f.value = null, m.value = "";
|
|
60
|
+
};
|
|
61
|
+
return j(() => {
|
|
62
|
+
x.off("BimViewer", V);
|
|
63
|
+
}), (o, e) => {
|
|
64
|
+
const a = z;
|
|
65
|
+
return u(), g("div", {
|
|
66
|
+
class: T(["cameraView_component", { is_mobile: !w.value }])
|
|
67
|
+
}, [
|
|
68
|
+
t("div", {
|
|
69
|
+
class: "new_btn",
|
|
70
|
+
onClick: U
|
|
71
|
+
}, [
|
|
72
|
+
w.value ? (u(), q(a, {
|
|
73
|
+
key: 0,
|
|
74
|
+
content: "添加视角",
|
|
75
|
+
placement: "top",
|
|
76
|
+
effect: "light"
|
|
77
|
+
}, {
|
|
78
|
+
default: F(() => [
|
|
79
|
+
t("div", K, [
|
|
80
|
+
t("img", {
|
|
81
|
+
class: "img",
|
|
82
|
+
src: `${B(y)}/bim-viewer/cameraView/cameraViewNew.svg`,
|
|
83
|
+
alt: ""
|
|
84
|
+
}, null, 8, Q)
|
|
85
|
+
])
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
})) : (u(), g("div", Z, [
|
|
89
|
+
t("img", {
|
|
90
|
+
class: "img",
|
|
91
|
+
src: `${B(y)}/bim-viewer/cameraView/cameraViewNew.svg`,
|
|
92
|
+
alt: ""
|
|
93
|
+
}, null, 8, ee)
|
|
94
|
+
]))
|
|
95
|
+
]),
|
|
96
|
+
n.value ? (u(), g("div", {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: T(["newViewDialog", { mobile_dialog: !w.value }])
|
|
99
|
+
}, [
|
|
100
|
+
t("div", {
|
|
101
|
+
class: "dialog-overlay",
|
|
102
|
+
onClick: e[0] || (e[0] = (s) => n.value = !1)
|
|
103
|
+
}),
|
|
104
|
+
t("div", te, [
|
|
105
|
+
t("div", oe, [
|
|
106
|
+
e[6] || (e[6] = t("span", { class: "dialog-title" }, "添加视角", -1)),
|
|
107
|
+
t("button", {
|
|
108
|
+
class: "dialog-close",
|
|
109
|
+
onClick: e[1] || (e[1] = (s) => n.value = !1)
|
|
110
|
+
}, [...e[5] || (e[5] = [
|
|
111
|
+
t("span", null, "✕", -1)
|
|
112
|
+
])])
|
|
113
|
+
]),
|
|
114
|
+
t("div", ae, [
|
|
115
|
+
t("div", se, [
|
|
116
|
+
t("img", {
|
|
117
|
+
src: m.value,
|
|
118
|
+
alt: "视角预览"
|
|
119
|
+
}, null, 8, ne)
|
|
120
|
+
]),
|
|
121
|
+
t("div", le, [
|
|
122
|
+
e[7] || (e[7] = t("label", { class: "form-label" }, "视角名称", -1)),
|
|
123
|
+
I(t("input", {
|
|
124
|
+
"onUpdate:modelValue": e[2] || (e[2] = (s) => c.value = s),
|
|
125
|
+
type: "text",
|
|
126
|
+
class: "form-input",
|
|
127
|
+
placeholder: "请输入视角名称",
|
|
128
|
+
maxlength: "50"
|
|
129
|
+
}, null, 512), [
|
|
130
|
+
[N, c.value]
|
|
131
|
+
])
|
|
132
|
+
]),
|
|
133
|
+
t("div", ie, [
|
|
134
|
+
e[8] || (e[8] = t("label", { class: "form-label" }, "视角描述", -1)),
|
|
135
|
+
I(t("textarea", {
|
|
136
|
+
"onUpdate:modelValue": e[3] || (e[3] = (s) => r.value = s),
|
|
137
|
+
class: "form-textarea",
|
|
138
|
+
placeholder: "请输入视角描述",
|
|
139
|
+
maxlength: "200",
|
|
140
|
+
rows: "4"
|
|
141
|
+
}, null, 512), [
|
|
142
|
+
[N, r.value]
|
|
143
|
+
])
|
|
144
|
+
])
|
|
145
|
+
]),
|
|
146
|
+
t("div", ce, [
|
|
147
|
+
t("button", {
|
|
148
|
+
class: "btn btn-secondary",
|
|
149
|
+
onClick: e[4] || (e[4] = (s) => n.value = !1)
|
|
150
|
+
}, "取 消"),
|
|
151
|
+
t("button", {
|
|
152
|
+
class: "btn btn-primary",
|
|
153
|
+
onClick: $
|
|
154
|
+
}, "确 定")
|
|
155
|
+
])
|
|
156
|
+
])
|
|
157
|
+
], 2)) : J("", !0)
|
|
158
|
+
], 2);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}), ue = /* @__PURE__ */ A(re, [["__scopeId", "data-v-2c9174bb"]]);
|
|
162
|
+
export {
|
|
163
|
+
ue as default
|
|
164
|
+
};
|