@xtctwins/tctwins-industry-engine 0.1.1 → 0.1.2

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 (29) hide show
  1. package/dist/{AnnotationTool-C5L5i2tf.mjs → AnnotationTool-DmR1FVnC.mjs} +2 -2
  2. package/dist/{CameraViewTool-CM0qckrp.mjs → CameraViewTool-r6cSaP1g.mjs} +1 -1
  3. package/dist/{CommentTool-B-6jkY8g.mjs → CommentTool-DSsUxXd3.mjs} +1 -1
  4. package/dist/{HiddenTool-CoiTnXX_.mjs → HiddenTool-BtwqlKjb.mjs} +1 -1
  5. package/dist/Industry_Viewer_Lib.es.js +1 -1
  6. package/dist/Industry_Viewer_Lib.umd.js +103 -103
  7. package/dist/{InspectorTool-D4XjJ3xE.mjs → InspectorTool-C1LD5P8c.mjs} +3 -3
  8. package/dist/{MeasureTool-DeguXY8Q.mjs → MeasureTool-BiIYol2o.mjs} +3 -3
  9. package/dist/{MouseTool-MBZQBiey.mjs → MouseTool-zXaLoVhr.mjs} +1 -1
  10. package/dist/{NavigateTool-CJ3Gcn7x.mjs → NavigateTool-Dm9XeTMn.mjs} +1 -1
  11. package/dist/{OperateTool-CMncJ40d.mjs → OperateTool-BHpG5L4i.mjs} +1 -1
  12. package/dist/{RoamTool-C56sheuh.mjs → RoamTool-C2Z6QuAO.mjs} +1 -1
  13. package/dist/{ScreenShotTool-PNCCVzI0.mjs → ScreenShotTool-pFW91aP4.mjs} +2 -2
  14. package/dist/{SectionTool-CWdsvIBB.mjs → SectionTool-DayaGJkQ.mjs} +3 -3
  15. package/dist/{SettingTool-CWmeVytp.mjs → SettingTool-PpDmUY66.mjs} +2 -2
  16. package/dist/{StructureTree-Cjqc9T7J.mjs → StructureTree-C2Jm05Mj.mjs} +3 -3
  17. package/dist/{alert-CYzWSnHi.mjs → alert-67kDCiVn.mjs} +1 -1
  18. package/dist/{index-DoJj-LVm.mjs → index-B1oouGms.mjs} +18045 -18007
  19. package/dist/{panel.vue_vue_type_style_index_0_lang-Cc0xV2N6.mjs → panel.vue_vue_type_style_index_0_lang-DGwOi2jH.mjs} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/{tallPanel-fxMO0U73.mjs → tallPanel-_IjvX2X6.mjs} +6 -6
  22. package/package.json +1 -1
  23. package/types/App.vue.d.ts +1 -3
  24. package/types/components/IndustryViewerComp.vue.d.ts +2 -0
  25. package/types/i18n/index.d.ts +16 -0
  26. package/types/i18n/locales/en-US.d.ts +4 -0
  27. package/types/i18n/locales/zh-CN.d.ts +4 -0
  28. package/types/pages/IndustryViewerEntry.vue.d.ts +4 -2
  29. package/types/viewerManager/load/loadModel.d.ts +28 -6
@@ -1,10 +1,10 @@
1
- import { G as g, H as t, T as r, Q as y, R as x, L as S, M as b } from "./index-DoJj-LVm.mjs";
2
- import { defineComponent as k, ref as c, onMounted as P, watch as W, openBlock as _, createElementBlock as f, normalizeStyle as w, createElementVNode as o, toDisplayString as C, createVNode as T, unref as h, renderSlot as N, createCommentVNode as E } from "vue";
1
+ import { G as g, H as t, T as r, Q as y, R as x, L as S, M as k } from "./index-B1oouGms.mjs";
2
+ import { defineComponent as P, ref as c, onMounted as W, watch as b, openBlock as _, createElementBlock as f, normalizeStyle as w, createElementVNode as o, toDisplayString as C, createVNode as T, unref as h, renderSlot as N, createCommentVNode as E } from "vue";
3
3
  const H = { class: "tall_panel_content" }, $ = { class: "panel_top" }, B = { class: "panel_title" }, L = { class: "panel_close" }, M = { class: "panel_content" }, V = {
4
4
  key: 0,
5
5
  class: "width-set",
6
6
  id: "lineWidthSet"
7
- }, X = /* @__PURE__ */ k({
7
+ }, X = /* @__PURE__ */ P({
8
8
  __name: "tallPanel",
9
9
  props: {
10
10
  panelTitle: {
@@ -31,7 +31,7 @@ const H = { class: "tall_panel_content" }, $ = { class: "panel_top" }, B = { cla
31
31
  },
32
32
  setup(a) {
33
33
  const m = g(), i = a, n = c(), l = c(i.width);
34
- P(() => {
34
+ W(() => {
35
35
  i.pos == "left" && (n.value.style.left = `${0 + t("leftWidth")}px`), i.pos == "right" && (n.value.style.right = `${0 + t("rightWidth")}px`), n.value.style.top = `${0 + t("topHeight")}px`, n.value.style.bottom = `${0 + t("bottomHeight")}px`;
36
36
  });
37
37
  let d, p = 0, u = 0;
@@ -42,7 +42,7 @@ const H = { class: "tall_panel_content" }, $ = { class: "panel_top" }, B = { cla
42
42
  d && (u = e.x - p, p = e.x, l.value += u, l.value < 286 && (l.value = 286), r.setProperty("--left-toggle-left", (14 + l.value).toString() + "px"));
43
43
  }), document.addEventListener("mouseup", (e) => {
44
44
  d = !1;
45
- }), W(
45
+ }), b(
46
46
  () => m.isToolActive(0),
47
47
  (e) => {
48
48
  t("navCubePos").pos.includes(t("treePos")) && y("navCubePos", { pos: t("navCubePos").pos, posNum: x(e, 286) }), r.setProperty("--left-toggle-left", e ? (14 + l.value).toString() + "px" : "14px");
@@ -78,7 +78,7 @@ const H = { class: "tall_panel_content" }, $ = { class: "panel_top" }, B = { cla
78
78
  ], 4);
79
79
  };
80
80
  }
81
- }), D = /* @__PURE__ */ b(X, [["__scopeId", "data-v-3e2b56c6"]]);
81
+ }), D = /* @__PURE__ */ k(X, [["__scopeId", "data-v-dc9568d4"]]);
82
82
  export {
83
83
  D as _
84
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtctwins/tctwins-industry-engine",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "main": "dist/Industry_Viewer_Lib.umd.js",
5
5
  "style": "dist/style.css",
6
6
  "module": "dist/Industry_Viewer_Lib.es.js",
@@ -1,4 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
2
- fileInputRef: HTMLInputElement;
3
- }, any>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
4
2
  export default _default;
@@ -14,6 +14,8 @@ type __VLS_Props = {
14
14
  modelOptions?: Record<string, any>[];
15
15
  loadSequential?: boolean;
16
16
  loadInterval?: number;
17
+ /** 是否显示模型加载遮罩(网络获取 / 模型加载)。默认 false,不显示 */
18
+ showModelLoading?: boolean;
17
19
  };
18
20
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
21
  emitHandler: (...args: any[]) => void;
@@ -2,6 +2,10 @@ export type Locale = "zh-CN" | "en-US";
2
2
  export declare const messages: {
3
3
  "zh-CN": {
4
4
  industryViewer: {
5
+ modelLoading: {
6
+ network: string;
7
+ model: string;
8
+ };
5
9
  common: {
6
10
  confirm: string;
7
11
  cancel: string;
@@ -442,6 +446,10 @@ export declare const messages: {
442
446
  };
443
447
  "en-US": {
444
448
  industryViewer: {
449
+ modelLoading: {
450
+ network: string;
451
+ model: string;
452
+ };
445
453
  common: {
446
454
  confirm: string;
447
455
  cancel: string;
@@ -888,6 +896,10 @@ export declare const defaultI18nConfig: {
888
896
  messages: {
889
897
  "zh-CN": {
890
898
  industryViewer: {
899
+ modelLoading: {
900
+ network: string;
901
+ model: string;
902
+ };
891
903
  common: {
892
904
  confirm: string;
893
905
  cancel: string;
@@ -1328,6 +1340,10 @@ export declare const defaultI18nConfig: {
1328
1340
  };
1329
1341
  "en-US": {
1330
1342
  industryViewer: {
1343
+ modelLoading: {
1344
+ network: string;
1345
+ model: string;
1346
+ };
1331
1347
  common: {
1332
1348
  confirm: string;
1333
1349
  cancel: string;
@@ -1,5 +1,9 @@
1
1
  declare const _default: {
2
2
  industryViewer: {
3
+ modelLoading: {
4
+ network: string;
5
+ model: string;
6
+ };
3
7
  common: {
4
8
  confirm: string;
5
9
  cancel: string;
@@ -1,5 +1,9 @@
1
1
  declare const _default: {
2
2
  industryViewer: {
3
+ modelLoading: {
4
+ network: string;
5
+ model: string;
6
+ };
3
7
  common: {
4
8
  confirm: string;
5
9
  cancel: string;
@@ -1,5 +1,5 @@
1
1
  import { InstructionContent } from '../utils/eventBus';
2
- import { NavCubePos, TallPanelPos, ThemeColor, Offset, ToolPos, EditPrivilege } from '../store/initConfigs';
2
+ import { TallPanelPos, ThemeColor, Offset, ToolPos, EditPrivilege, NavCubePosNum } from '../store/initConfigs';
3
3
  import { BcfContent } from '../store/bcfReflect';
4
4
  import { UserInfo } from '../store/userInfoStore';
5
5
  import { Locale } from '../i18n';
@@ -16,6 +16,8 @@ type __VLS_Props = {
16
16
  modelIds?: string[];
17
17
  loadSequential?: boolean;
18
18
  loadInterval?: number;
19
+ /** 是否显示模型加载遮罩(网络获取 / 模型加载)。默认 false,不显示 */
20
+ showModelLoading?: boolean;
19
21
  themeColor?: ThemeColor;
20
22
  topHeight?: number;
21
23
  bottomHeight?: number;
@@ -26,7 +28,7 @@ type __VLS_Props = {
26
28
  commentPos?: ToolPos;
27
29
  annotationPos?: ToolPos;
28
30
  roamPos?: ToolPos;
29
- navCubePos?: NavCubePos;
31
+ navCubePos?: NavCubePosNum;
30
32
  navCubeSize?: number;
31
33
  skyboxImg?: HTMLImageElement;
32
34
  commentOffset?: Offset;
@@ -58,8 +58,12 @@ export interface ModelLoaderConfig {
58
58
  * @param options 附加加载参数,透传给接口层 BIMXViewer.loadModel 的 cfg:
59
59
  * - brightness: 该模型的颜色亮度系数(1.0 原始,>1 提亮,<1 变暗),如 { brightness: 1.5 }
60
60
  * - position / rotation / scale / origin / alignTo: 多模型坐标对齐参数
61
+ * @param onEngineLoadStart 引擎真正开始载入模型(调用 window.bimViewer.loadModel)时触发,
62
+ * 供组件层把 loading 文案从「网络获取」切换到「模型加载」。
63
+ * 可返回 Promise:引擎会先 await(组件层用 requestAnimationFrame 等真实绘制)
64
+ * 再进入会阻塞主线程的 loadModel,确保「模型加载中」文案已上屏。
61
65
  */
62
- export default function viewerLoadModel(modelId: string, modelType: string, modelArrayBuffer: ArrayBuffer, callback?: Function, options?: Record<string, any>): void;
66
+ export default function viewerLoadModel(modelId: string, modelType: string, modelArrayBuffer: ArrayBuffer, callback?: Function, options?: Record<string, any>, onEngineLoadStart?: () => void | Promise<void>): Promise<void>;
63
67
  /**
64
68
  * 模型加载器:统一封装「下载 -> 引擎加载 -> meta 加载」。
65
69
  *
@@ -92,15 +96,28 @@ export declare class ModelLoader {
92
96
  private fetch;
93
97
  /** 模型主体下载路径:http 直接用原地址;OSS 补上 .xtc 等类型后缀 */
94
98
  private downloadModelPath;
95
- /** 加载单个已就绪 buffer 的模型到引擎,模型成功后自动处理 meta */
96
- loadSingle(modelId: string, buffer: ArrayBuffer, metaBuffer?: ArrayBuffer, options?: Record<string, any>): Promise<ModelLoadResult>;
99
+ /**
100
+ * 加载单个已就绪 buffer 的模型到引擎,模型成功后自动处理 meta。
101
+ *
102
+ * @param waitModelLoaded 为 true 时,Promise 会等到引擎真正抛出 modelLoaded 事件
103
+ * (模型解析并渲染完成)后才 resolve,供组件层精确控制 loading 遮罩的结束时机;
104
+ * 为 false(默认)时保持旧行为,引擎 loadModel 回调即 resolve。
105
+ * @param onEngineLoadStart 引擎真正开始载入模型(调用 window.bimViewer.loadModel)时触发,
106
+ * 供组件层把 loading 文案从「网络获取」切换到「模型加载」。可返回 Promise。
107
+ */
108
+ loadSingle(modelId: string, buffer: ArrayBuffer, metaBuffer?: ArrayBuffer, options?: Record<string, any>, waitModelLoaded?: boolean, onEngineLoadStart?: () => void | Promise<void>): Promise<ModelLoadResult>;
97
109
  /** 引擎模型加载成功后处理 meta:可用则立即加载,否则挂起等 setMetaBuffer */
98
110
  private handleMetaAfterModelLoad;
99
111
  private loadMetadata;
100
112
  /** 绑定引擎 meta 事件(只绑一次),转发给 emit */
101
113
  private bindMetaEvents;
102
- /** 按路径加载单个模型:并发下载 model + meta,下载完再引擎加载;下载失败不抛异常 */
103
- loadFromPath(modelId: string, filePath: string, options?: Record<string, any>): Promise<ModelLoadResult | undefined>;
114
+ /**
115
+ * 按路径加载单个模型:并发下载 model + meta,下载完再引擎加载;下载失败不抛异常。
116
+ *
117
+ * @param onDownloaded 下载完成(即将进入引擎加载)时触发。
118
+ * @param onEngineLoadStart 引擎真正开始载入模型(调用 window.bimViewer.loadModel)时触发。可返回 Promise。
119
+ */
120
+ loadFromPath(modelId: string, filePath: string, options?: Record<string, any>, waitModelLoaded?: boolean, onDownloaded?: () => void, onEngineLoadStart?: () => void | Promise<void>): Promise<ModelLoadResult | undefined>;
104
121
  /** 下载 meta(.xts);失败不阻断主流程 */
105
122
  private downloadMeta;
106
123
  /** 准备单个模型:并发下载 model + meta,返回可直接加载的数据;下载失败 buffer 为空(不抛异常) */
@@ -114,8 +131,13 @@ export declare class ModelLoader {
114
131
  * 这样下载与解析天然重叠,是引擎下最快的加载方式。
115
132
  *
116
133
  * loadInterval 仅作为可选的发起节流(默认 0 不节流)。
134
+ *
135
+ * @param waitModelLoaded 为 true 时,每个模型都等到引擎 modelLoaded 事件后才算完成,
136
+ * 供组件层精确控制 loading 遮罩的结束时机。
137
+ * @param onEngineLoadStart 引擎真正开始载入模型(调用 window.bimViewer.loadModel)时触发,
138
+ * 供组件层把 loading 文案从「网络获取」切换到「模型加载」。可返回 Promise。
117
139
  */
118
- loadMulti(items: ModelLoadItem[]): Promise<ModelLoadResult[]>;
140
+ loadMulti(items: ModelLoadItem[], waitModelLoaded?: boolean, onEngineLoadStart?: () => void | Promise<void>): Promise<ModelLoadResult[]>;
119
141
  /** 延迟指定毫秒数 */
120
142
  private sleep;
121
143
  }