@vsleem-realsee-viewer/shared 2.0.12 → 2.0.13
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/dist/index.d.ts +155 -132
- package/dist/index.mjs +56 -56
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare namespace api {
|
|
|
11
11
|
}
|
|
12
12
|
export { api }
|
|
13
13
|
|
|
14
|
+
/** 全局默认配置 */
|
|
14
15
|
export declare const APP_SETTING: {
|
|
15
16
|
baseUrl: string;
|
|
16
17
|
obsType: string;
|
|
@@ -58,19 +59,20 @@ export declare enum AppErrorCode {
|
|
|
58
59
|
RequestUnknownError = 9032
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/** obs类型枚举 */
|
|
61
63
|
export declare enum AppObsType {
|
|
62
|
-
Hw = "huawei"
|
|
63
|
-
Ali = "aliyun"
|
|
64
|
-
Hs = "hs"
|
|
65
|
-
Aws = "amazon"
|
|
66
|
-
Minio = "minio"
|
|
64
|
+
Hw = "huawei" /** 华为云 */,
|
|
65
|
+
Ali = "aliyun" /** 阿里云 */,
|
|
66
|
+
Hs = "hs" /** 火山引擎 */,
|
|
67
|
+
Aws = "amazon" /** AWS S3 */,
|
|
68
|
+
Minio = "minio" /** MinIO */
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
export declare type AppSetting = {
|
|
70
|
-
baseUrl?: string
|
|
71
|
-
authorizeCode: string
|
|
72
|
-
obsPrefix?: string
|
|
73
|
-
obsType?: string
|
|
72
|
+
baseUrl?: string /**用于配置应用后端服务的根路径 */;
|
|
73
|
+
authorizeCode: string /**用于API身份验证和授权的凭证 */;
|
|
74
|
+
obsPrefix?: string /**用于在对象存储中组织文件的目录路径(不可用) */;
|
|
75
|
+
obsType?: string /**指定使用的对象存储服务提供商 huawei | aliyun | hs 等 */;
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
declare abstract class BaseAsyncElement {
|
|
@@ -91,21 +93,21 @@ declare abstract class BaseElement {
|
|
|
91
93
|
declare function bindCoordinate(data: CoordinateModel[], options?: RequestOptions): Promise<CoordinateModel[]>;
|
|
92
94
|
|
|
93
95
|
export declare type CADModel = {
|
|
94
|
-
bindCsIds?: string
|
|
95
|
-
createBy?: string
|
|
96
|
-
createTime?: number
|
|
97
|
-
updateBy?: string
|
|
98
|
-
updateTime?: number
|
|
99
|
-
id?: number
|
|
100
|
-
no?: string
|
|
101
|
-
projectId?: number
|
|
102
|
-
renderType?: number
|
|
103
|
-
rawType?: string
|
|
104
|
-
name?: string
|
|
105
|
-
modelKey?: string
|
|
106
|
-
rawUrl?: string
|
|
107
|
-
length?: number
|
|
108
|
-
mappingRecords?: MappingRecord[]
|
|
96
|
+
bindCsIds?: string /** 绑定坐标系id集合 */;
|
|
97
|
+
createBy?: string /** 创建者ID */;
|
|
98
|
+
createTime?: number /** 创建时间戳(毫秒) */;
|
|
99
|
+
updateBy?: string /** 最后更新者ID */;
|
|
100
|
+
updateTime?: number /** 最后更新时间戳(毫秒) */;
|
|
101
|
+
id?: number /** 唯一标识符 */;
|
|
102
|
+
no?: string /** 模型编号/代码 */;
|
|
103
|
+
projectId?: number /** 所属项目ID */;
|
|
104
|
+
renderType?: number /** 模型渲染类型 */;
|
|
105
|
+
rawType?: string /** 模型原始文件类型 */;
|
|
106
|
+
name?: string /** 模型名称/描述 */;
|
|
107
|
+
modelKey?: string /** 模型关键标识符 */;
|
|
108
|
+
rawUrl?: string /** 原始模型文件URL */;
|
|
109
|
+
length?: number /** 模型文件大小(字节) */;
|
|
110
|
+
mappingRecords?: MappingRecord[] /** 映射记录 */;
|
|
109
111
|
};
|
|
110
112
|
|
|
111
113
|
export declare class CanvasElement {
|
|
@@ -288,36 +290,44 @@ export declare class CanvasRegionElement implements BaseElement {
|
|
|
288
290
|
declare function cloneDeep<T>(value: T): T;
|
|
289
291
|
|
|
290
292
|
export declare class Coordinate {
|
|
291
|
-
id: number;
|
|
292
|
-
type: number;
|
|
293
|
-
children: Coordinate[];
|
|
294
|
-
level?: number;
|
|
295
|
-
relativeMap?: RelativeMap;
|
|
296
|
-
no?: string;
|
|
297
|
-
name?: string;
|
|
298
|
-
shortName?: string;
|
|
299
|
-
status?: number;
|
|
300
|
-
modelId?: number;
|
|
301
|
-
modelType?: number;
|
|
302
|
-
modelValue?: string;
|
|
303
|
-
projectId?: number;
|
|
304
|
-
parentId?: number;
|
|
305
|
-
parent?: Coordinate;
|
|
306
|
-
groupUuid?: string;
|
|
307
|
-
z?: number;
|
|
308
|
-
createTime?: number;
|
|
293
|
+
id: number; /** id */
|
|
294
|
+
type: number; /** 0空间,1模型 */
|
|
295
|
+
children: Coordinate[]; /** 子节点 */
|
|
296
|
+
level?: number; /** 空间的层级 */
|
|
297
|
+
relativeMap?: RelativeMap; /** 相对位置关系 */
|
|
298
|
+
no?: string; /** 坐标系编号 */
|
|
299
|
+
name?: string; /** 名称 */
|
|
300
|
+
shortName?: string; /** 简称 */
|
|
301
|
+
status?: number; /** 使用状态 */
|
|
302
|
+
modelId?: number; /** 模型ID */
|
|
303
|
+
modelType?: number; /** 模型的类型 */
|
|
304
|
+
modelValue?: string; /** 模型value */
|
|
305
|
+
projectId?: number; /** 项目id */
|
|
306
|
+
parentId?: number; /** 父节点id */
|
|
307
|
+
parent?: Coordinate; /** 父节点 */
|
|
308
|
+
groupUuid?: string; /** 分组uuid */
|
|
309
|
+
z?: number; /** 坐标系高度 */
|
|
310
|
+
createTime?: number; /** 创建时间 */
|
|
309
311
|
disabled?: boolean;
|
|
310
312
|
constructor(options?: Partial<Coordinate>);
|
|
311
313
|
get spaceList(): Coordinate[];
|
|
312
314
|
get modelList(): Coordinate[];
|
|
313
315
|
get fullName(): string;
|
|
316
|
+
/** 设置参数 */
|
|
314
317
|
setOptions(options?: Partial<Coordinate>): void;
|
|
318
|
+
/** 添加子节点 */
|
|
315
319
|
addChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
320
|
+
/** 删除子节点 */
|
|
316
321
|
removeChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
322
|
+
/** 更新子节点 */
|
|
317
323
|
updateChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
324
|
+
/** 绑定子节点,不建立映射关系 */
|
|
318
325
|
bindChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
326
|
+
/** 合并子节点,没有查询到节点就插入 */
|
|
319
327
|
mergeChild(result?: Coordinate[]): Promise<void>;
|
|
328
|
+
/** 映射到(模型映射到空间,空间映射到空间) */
|
|
320
329
|
mappingTo(result: ProjectionModel[]): Promise<void>;
|
|
330
|
+
/** 来自映射(被映射过的源坐标系关系) */
|
|
321
331
|
fromMapping(): Promise<ProjectionModel | undefined>;
|
|
322
332
|
/**
|
|
323
333
|
* 递归寻找到根坐标系
|
|
@@ -334,7 +344,7 @@ export declare class Coordinate {
|
|
|
334
344
|
/**
|
|
335
345
|
* 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
|
|
336
346
|
* @param type 允许的模型类型
|
|
337
|
-
* @param excludeNodes
|
|
347
|
+
* @param excludeNodes 排除的坐标系
|
|
338
348
|
* @returns
|
|
339
349
|
*/
|
|
340
350
|
findClosestModel(type?: number | number[], excludeNodes?: Coordinate[]): Coordinate | undefined;
|
|
@@ -349,10 +359,11 @@ export declare class Coordinate {
|
|
|
349
359
|
* @returns
|
|
350
360
|
*/
|
|
351
361
|
findParentSpaceNames(level?: number): string[];
|
|
362
|
+
/** 寻找坐标系组, 有groupUuid表示坐标系组 */
|
|
352
363
|
findCsGroup(): Coordinate[];
|
|
353
364
|
/**
|
|
354
365
|
* 递归寻找到相应的层级
|
|
355
|
-
* @param level
|
|
366
|
+
* @param level 坐标系的层级
|
|
356
367
|
* @returns
|
|
357
368
|
*/
|
|
358
369
|
findCsByLevel(level: number): Coordinate | undefined;
|
|
@@ -406,53 +417,57 @@ export declare class Coordinate {
|
|
|
406
417
|
private static checkSameCoordinate;
|
|
407
418
|
}
|
|
408
419
|
|
|
420
|
+
/** 坐标系空间层级枚举 */
|
|
409
421
|
export declare enum CoordinateLevel {
|
|
410
|
-
Global = 0
|
|
422
|
+
Global = 0 /** 地图 */
|
|
411
423
|
}
|
|
412
424
|
|
|
413
425
|
export declare type CoordinateModel = {
|
|
414
|
-
coordinateType?: number
|
|
415
|
-
renderType?: number
|
|
416
|
-
createBy?: string
|
|
417
|
-
createTime?: number
|
|
418
|
-
groupUuid?: string
|
|
419
|
-
id?: number
|
|
420
|
-
modelId?: number
|
|
421
|
-
modelKey?: string
|
|
422
|
-
name?: string
|
|
423
|
-
no?: string
|
|
424
|
-
parentId?: number
|
|
425
|
-
projectId?: number
|
|
426
|
-
relativePosition?: string
|
|
427
|
-
shortName?: string
|
|
428
|
-
status?: number
|
|
429
|
-
thirdId?: string
|
|
430
|
-
type?: number
|
|
431
|
-
updateBy?: string
|
|
432
|
-
updateTime?: number
|
|
433
|
-
uuid?: string
|
|
434
|
-
z?: number
|
|
426
|
+
coordinateType?: number /** 坐标系分类 0空间 1模型 */;
|
|
427
|
+
renderType?: number /** 模型类型 */;
|
|
428
|
+
createBy?: string /** 创建者 */;
|
|
429
|
+
createTime?: number /** 创建时间 */;
|
|
430
|
+
groupUuid?: string /** 组UUID 多楼层前端传入时需保持一致 */;
|
|
431
|
+
id?: number /** 唯一 ID */;
|
|
432
|
+
modelId?: number /** 模型 ID */;
|
|
433
|
+
modelKey?: string /** 模型键 */;
|
|
434
|
+
name?: string /** 名称 */;
|
|
435
|
+
no?: string /** 编号 */;
|
|
436
|
+
parentId?: number /** 父节点 ID */;
|
|
437
|
+
projectId?: number /** 项目 ID */;
|
|
438
|
+
relativePosition?: string /** 位置关系 */;
|
|
439
|
+
shortName?: string /** 短名称 */;
|
|
440
|
+
status?: number /** 状态 0:使用 1:激活 2:未使用 */;
|
|
441
|
+
thirdId?: string /** 第三方 ID */;
|
|
442
|
+
type?: number /** 层级类型 0-global-全局坐标系 |1-field-场布图|2-building-建筑|3-floor-楼层|4-room-房间 | 5-cad位图图纸 | 6-bim | 7-forge | 8-3DGS| 9-天地图模型 */;
|
|
443
|
+
updateBy?: string /** 更新者 */;
|
|
444
|
+
updateTime?: number /** 更新时间 */;
|
|
445
|
+
uuid?: string /** UUID */;
|
|
446
|
+
z?: number /** z坐标 */;
|
|
435
447
|
};
|
|
436
448
|
|
|
449
|
+
/** 坐标系模型类型枚举 */
|
|
437
450
|
export declare enum CoordinateModelType {
|
|
438
|
-
CADModel = 5
|
|
439
|
-
BIMModel = 6
|
|
440
|
-
ForgeModel = 7
|
|
441
|
-
ThreeDModel = 8
|
|
442
|
-
SkyMapModel = 9
|
|
443
|
-
ScaleModel = 10
|
|
451
|
+
CADModel = 5 /** cad图片模型 */,
|
|
452
|
+
BIMModel = 6 /** bim模型 */,
|
|
453
|
+
ForgeModel = 7 /** forge模型 */,
|
|
454
|
+
ThreeDModel = 8 /** 3d模型 */,
|
|
455
|
+
SkyMapModel = 9 /** 天地图模型 */,
|
|
456
|
+
ScaleModel = 10 /** 比例尺模型-前端自定义 */
|
|
444
457
|
}
|
|
445
458
|
|
|
459
|
+
/** 坐标系使用状态 */
|
|
446
460
|
export declare enum CoordinateStatus {
|
|
447
|
-
Used = 0
|
|
448
|
-
Enabled = 1
|
|
449
|
-
Disabled = 2
|
|
461
|
+
Used = 0 /** 当前使用 */,
|
|
462
|
+
Enabled = 1 /** 可使用 */,
|
|
463
|
+
Disabled = 2 /** 无法使用 */
|
|
450
464
|
}
|
|
451
465
|
|
|
466
|
+
/** 坐标系类型 */
|
|
452
467
|
export declare enum CoordinateType {
|
|
453
|
-
Space = 0
|
|
454
|
-
Model = 1
|
|
455
|
-
Data = 2
|
|
468
|
+
Space = 0 /** 空间 */,
|
|
469
|
+
Model = 1 /** 模型 */,
|
|
470
|
+
Data = 2 /** 数据 */
|
|
456
471
|
}
|
|
457
472
|
|
|
458
473
|
export declare class DataHelper {
|
|
@@ -521,14 +536,14 @@ export declare class DataSource {
|
|
|
521
536
|
static flattenCoordinateTree(tree: Coordinate | Coordinate[]): Coordinate[];
|
|
522
537
|
/**
|
|
523
538
|
* 递归函数将扁平列表转化为树形结构
|
|
524
|
-
* @param flatNodes
|
|
525
|
-
* @param rootId
|
|
539
|
+
* @param flatNodes 扁平列表
|
|
540
|
+
* @param rootId 根id
|
|
526
541
|
* @returns
|
|
527
542
|
*/
|
|
528
543
|
static buildCoordinateTree(flatNodes: Coordinate[], rootId?: number): Coordinate;
|
|
529
544
|
/**
|
|
530
545
|
* 对子节点进行排序,首先按 status=0 升序,然后按 type=0 升序,最后按 createTime 降序
|
|
531
|
-
* @param node
|
|
546
|
+
* @param node 节点
|
|
532
547
|
* @returns 无返回值
|
|
533
548
|
*/
|
|
534
549
|
static sortCoordinateTree(node: Coordinate): void;
|
|
@@ -573,9 +588,9 @@ declare type DeepPartial<T> = {
|
|
|
573
588
|
declare function error(message: string): void;
|
|
574
589
|
|
|
575
590
|
export declare class GeoPoint {
|
|
576
|
-
lat: number;
|
|
577
|
-
lon: number;
|
|
578
|
-
alt: number;
|
|
591
|
+
lat: number; /** 经度 */
|
|
592
|
+
lon: number; /** 纬度 */
|
|
593
|
+
alt: number; /** 高度 */
|
|
579
594
|
constructor(options?: Partial<GeoPoint>);
|
|
580
595
|
static XYZToLLH(p: Point, refPoint: GeoPoint): GeoPoint;
|
|
581
596
|
static LLHToXYZ(p: Point, refPoint: GeoPoint): Point;
|
|
@@ -684,13 +699,14 @@ declare function loadScript(src: string, attributes?: Record<string, string | bo
|
|
|
684
699
|
*/
|
|
685
700
|
declare function mapingCoordinate(data: ProjectionModel[], options?: RequestOptions): Promise<any>;
|
|
686
701
|
|
|
702
|
+
/** 映射记录 */
|
|
687
703
|
declare type MappingRecord = {
|
|
688
|
-
dstCsGroupUuid: string
|
|
689
|
-
dstCsId: number
|
|
690
|
-
dstCsName: string
|
|
691
|
-
dstCsShortName: string
|
|
692
|
-
dstParentCsName: string
|
|
693
|
-
srcCsId: number
|
|
704
|
+
dstCsGroupUuid: string /** 目标坐标系组的UUID */;
|
|
705
|
+
dstCsId: number /** 目标坐标系ID */;
|
|
706
|
+
dstCsName: string /** 目标坐标系名称 */;
|
|
707
|
+
dstCsShortName: string /** 目标坐标系简称 */;
|
|
708
|
+
dstParentCsName: string /** 目标父坐标系名称 */;
|
|
709
|
+
srcCsId: number /** 源坐标系ID */;
|
|
694
710
|
};
|
|
695
711
|
|
|
696
712
|
/**
|
|
@@ -698,19 +714,23 @@ declare type MappingRecord = {
|
|
|
698
714
|
* 支持直角坐标系(x,y,z)和地理坐标系(经度,纬度,高度)
|
|
699
715
|
*/
|
|
700
716
|
export declare class Point {
|
|
717
|
+
/** 直角坐标系坐标 */
|
|
701
718
|
x: number;
|
|
702
719
|
y: number;
|
|
703
720
|
z: number;
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
721
|
+
/** 地理坐标系坐标 */
|
|
722
|
+
lat: number; /** 经度 (longitude) */
|
|
723
|
+
lon: number; /** 纬度 (latitude) */
|
|
724
|
+
alt: number; /** 高度 (altitude) */
|
|
725
|
+
/** 欧拉角 */
|
|
726
|
+
yaw: number; /** 偏航角 */
|
|
727
|
+
pitch: number; /** 俯仰角 */
|
|
728
|
+
roll: number; /** 翻滚角 */
|
|
729
|
+
/** 状态标志 */
|
|
730
|
+
hasXYZ: boolean; /** 是否有直角坐标 */
|
|
731
|
+
hasGeo: boolean; /** 是否有地理坐标 */
|
|
732
|
+
hasAngle: boolean; /** 是否有角度信息 */
|
|
733
|
+
plane: string; /** 默认平面 ('xy' 或 'xz') */
|
|
714
734
|
constructor(options?: Partial<Point>);
|
|
715
735
|
/**
|
|
716
736
|
* 计算两点之间的三维距离
|
|
@@ -796,27 +816,27 @@ export declare class Point {
|
|
|
796
816
|
}
|
|
797
817
|
|
|
798
818
|
export declare class Position {
|
|
799
|
-
yaw: number;
|
|
800
|
-
pitch: number;
|
|
801
|
-
roll: number;
|
|
819
|
+
yaw: number; /** 偏航角 */
|
|
820
|
+
pitch: number; /** 俯仰角 */
|
|
821
|
+
roll: number; /** 横滚角 */
|
|
802
822
|
constructor(options?: Partial<Position>);
|
|
803
823
|
static toParse(position?: string): Position | undefined;
|
|
804
824
|
static toStringify(position?: Position): string;
|
|
805
825
|
}
|
|
806
826
|
|
|
807
827
|
export declare type ProjectionModel = {
|
|
808
|
-
mappingType?: number
|
|
809
|
-
projectId?: number
|
|
810
|
-
srcCsId?: number
|
|
811
|
-
srcModelCsId?: number
|
|
812
|
-
srcModelId?: number
|
|
813
|
-
srcCsPointA?: string
|
|
814
|
-
srcCsPointB?: string
|
|
815
|
-
dstCsId?: number
|
|
816
|
-
dstModelCsId?: number
|
|
817
|
-
dstModelId?: number
|
|
818
|
-
dstPointA?: string
|
|
819
|
-
dstPointB?: string
|
|
828
|
+
mappingType?: number /** 映射类型 */;
|
|
829
|
+
projectId?: number /** 项目ID */;
|
|
830
|
+
srcCsId?: number /** 源坐标系ID(被映射的模型/空间) */;
|
|
831
|
+
srcModelCsId?: number /** 源模型坐标系ID(左侧视图模型) */;
|
|
832
|
+
srcModelId?: number /** 源模型 ID(非坐标系id,是模型自身的原始id) */;
|
|
833
|
+
srcCsPointA?: string /** 源坐标系点A(左侧视图点A) */;
|
|
834
|
+
srcCsPointB?: string /** 源坐标系点B(左侧视图点B) */;
|
|
835
|
+
dstCsId?: number /** 目标坐标系ID(映射目标-空间) */;
|
|
836
|
+
dstModelCsId?: number /** 目标模型坐标系ID(右侧视图模型) */;
|
|
837
|
+
dstModelId?: number /** 目标模型 ID(非坐标系id,是模型自身的原始id) */;
|
|
838
|
+
dstPointA?: string /** 目标坐标系点A(右侧视图点A) */;
|
|
839
|
+
dstPointB?: string /** 目标坐标系点B(右侧视图点B) */;
|
|
820
840
|
};
|
|
821
841
|
|
|
822
842
|
export declare class RelativeMap {
|
|
@@ -828,7 +848,7 @@ export declare class RelativeMap {
|
|
|
828
848
|
start: number;
|
|
829
849
|
end: number;
|
|
830
850
|
plane: string;
|
|
831
|
-
refPoint?: GeoPoint;
|
|
851
|
+
refPoint?: GeoPoint; /** 参考点 */
|
|
832
852
|
constructor(options?: Partial<RelativeMap>);
|
|
833
853
|
/**
|
|
834
854
|
* 合并两个相对坐标系的映射关系
|
|
@@ -859,14 +879,15 @@ declare function removeCoordinate(data: number[], options?: RequestOptions): Pro
|
|
|
859
879
|
*/
|
|
860
880
|
declare function request<T = any>(config: RequestConfig, options?: Partial<RequestOptions>): Promise<T>;
|
|
861
881
|
|
|
882
|
+
/** 请求配置 */
|
|
862
883
|
export declare type RequestConfig = {
|
|
863
|
-
url: string
|
|
864
|
-
method?: string
|
|
865
|
-
params?: Record<string, any
|
|
866
|
-
data?: Record<string, any
|
|
867
|
-
body?: any
|
|
868
|
-
mode?: any
|
|
869
|
-
headers?: Record<string, string
|
|
884
|
+
url: string /** 请求URL */;
|
|
885
|
+
method?: string /** 请求方法(GET/POST等) */;
|
|
886
|
+
params?: Record<string, any> /** URL参数(通常用于GET请求) */;
|
|
887
|
+
data?: Record<string, any> /** 请求体数据(通常用于POST/PUT) */;
|
|
888
|
+
body?: any /** 原始请求体内容 */;
|
|
889
|
+
mode?: any /** 请求模式(如cors/no-cors等) */;
|
|
890
|
+
headers?: Record<string, string> /** 请求头配置 */;
|
|
870
891
|
};
|
|
871
892
|
|
|
872
893
|
/**
|
|
@@ -887,10 +908,11 @@ export declare enum RequestMethod {
|
|
|
887
908
|
POST = "POST"
|
|
888
909
|
}
|
|
889
910
|
|
|
911
|
+
/** 请求选项 */
|
|
890
912
|
export declare type RequestOptions = {
|
|
891
|
-
isTransformResponse?: boolean
|
|
892
|
-
joinBaseUrl?: boolean
|
|
893
|
-
withAuthorize?: boolean
|
|
913
|
+
isTransformResponse?: boolean /** 是否需要对返回数据进行处理 */;
|
|
914
|
+
joinBaseUrl?: boolean /** 是否加入基础URL */;
|
|
915
|
+
withAuthorize?: boolean /** 是否携带授权码 */;
|
|
894
916
|
};
|
|
895
917
|
|
|
896
918
|
/**
|
|
@@ -902,10 +924,11 @@ export declare enum RequestResultCode {
|
|
|
902
924
|
TIMEOUT = 401
|
|
903
925
|
}
|
|
904
926
|
|
|
927
|
+
/** 响应结果 */
|
|
905
928
|
export declare type ResponseResult = {
|
|
906
|
-
code: number
|
|
907
|
-
msg: string
|
|
908
|
-
data: any
|
|
929
|
+
code: number /** 状态码 */;
|
|
930
|
+
msg: string /** 消息提示 */;
|
|
931
|
+
data: any /** 返回数据 */;
|
|
909
932
|
};
|
|
910
933
|
|
|
911
934
|
/**
|
|
@@ -998,9 +1021,9 @@ declare namespace utils {
|
|
|
998
1021
|
export { utils }
|
|
999
1022
|
|
|
1000
1023
|
export declare class Vector3 {
|
|
1001
|
-
x: number;
|
|
1002
|
-
y: number;
|
|
1003
|
-
z: number;
|
|
1024
|
+
x: number; /** x轴 */
|
|
1025
|
+
y: number; /** y轴 */
|
|
1026
|
+
z: number; /** z轴 */
|
|
1004
1027
|
constructor(options?: Partial<Vector3>);
|
|
1005
1028
|
static toParse(position?: string): Vector3 | undefined;
|
|
1006
1029
|
static toStringify(position?: Vector3): string;
|
package/dist/index.mjs
CHANGED
|
@@ -438,33 +438,33 @@ const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
438
438
|
warn: Ct
|
|
439
439
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
440
440
|
class f {
|
|
441
|
-
|
|
441
|
+
/** 直角坐标系坐标 */
|
|
442
442
|
x = 0;
|
|
443
443
|
y = 0;
|
|
444
444
|
z = 0;
|
|
445
|
-
|
|
445
|
+
/** 地理坐标系坐标 */
|
|
446
446
|
lat = 0;
|
|
447
|
-
|
|
447
|
+
/** 经度 (longitude) */
|
|
448
448
|
lon = 0;
|
|
449
|
-
|
|
449
|
+
/** 纬度 (latitude) */
|
|
450
450
|
alt = 0;
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
/** 高度 (altitude) */
|
|
452
|
+
/** 欧拉角 */
|
|
453
453
|
yaw = 0;
|
|
454
|
-
|
|
454
|
+
/** 偏航角 */
|
|
455
455
|
pitch = 0;
|
|
456
|
-
|
|
456
|
+
/** 俯仰角 */
|
|
457
457
|
roll = 0;
|
|
458
|
-
|
|
459
|
-
|
|
458
|
+
/** 翻滚角 */
|
|
459
|
+
/** 状态标志 */
|
|
460
460
|
hasXYZ = !1;
|
|
461
|
-
|
|
461
|
+
/** 是否有直角坐标 */
|
|
462
462
|
hasGeo = !1;
|
|
463
|
-
|
|
463
|
+
/** 是否有地理坐标 */
|
|
464
464
|
hasAngle = !1;
|
|
465
|
-
|
|
465
|
+
/** 是否有角度信息 */
|
|
466
466
|
plane = "xy";
|
|
467
|
-
|
|
467
|
+
/** 默认平面 ('xy' 或 'xz') */
|
|
468
468
|
constructor(t) {
|
|
469
469
|
const { x: e, y: i, z: n, lat: o, lon: r, alt: a, yaw: h, pitch: l, roll: c, plane: u = "xy" } = t || {};
|
|
470
470
|
this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0, (this.x !== 0 || this.y !== 0 || this.z !== 0) && (this.plane = u, this.hasXYZ = !0), this.lat = Number(o) || 0, this.lon = Number(r) || 0, this.alt = Number(a) || 0, (this.lat !== 0 || this.lon !== 0 || this.alt !== 0) && (this.hasGeo = !0), this.yaw = Number(h) || 0, this.pitch = Number(l) || 0, this.roll = Number(c) || 0, (N(h) || N(l) || N(c)) && (this.hasAngle = !0);
|
|
@@ -621,11 +621,11 @@ class f {
|
|
|
621
621
|
}
|
|
622
622
|
class D {
|
|
623
623
|
lat = 0;
|
|
624
|
-
|
|
624
|
+
/** 经度 */
|
|
625
625
|
lon = 0;
|
|
626
|
-
|
|
626
|
+
/** 纬度 */
|
|
627
627
|
alt = 0;
|
|
628
|
-
|
|
628
|
+
/** 高度 */
|
|
629
629
|
constructor(t) {
|
|
630
630
|
const { lat: e = 0, lon: i = 0, alt: n = 0 } = t || {};
|
|
631
631
|
this.lat = e, this.lon = i, this.alt = n;
|
|
@@ -676,7 +676,7 @@ class p {
|
|
|
676
676
|
end = -1;
|
|
677
677
|
plane = "xy";
|
|
678
678
|
refPoint;
|
|
679
|
-
|
|
679
|
+
/** 参考点 */
|
|
680
680
|
constructor(t) {
|
|
681
681
|
const { refPoint: e, ...i } = t || {};
|
|
682
682
|
e && (this.refPoint = new D(e)), Object.assign(this, i);
|
|
@@ -870,8 +870,8 @@ class m {
|
|
|
870
870
|
}
|
|
871
871
|
/**
|
|
872
872
|
* 递归函数将扁平列表转化为树形结构
|
|
873
|
-
* @param flatNodes
|
|
874
|
-
* @param rootId
|
|
873
|
+
* @param flatNodes 扁平列表
|
|
874
|
+
* @param rootId 根id
|
|
875
875
|
* @returns
|
|
876
876
|
*/
|
|
877
877
|
static buildCoordinateTree(t, e = 0) {
|
|
@@ -891,7 +891,7 @@ class m {
|
|
|
891
891
|
}
|
|
892
892
|
/**
|
|
893
893
|
* 对子节点进行排序,首先按 status=0 升序,然后按 type=0 升序,最后按 createTime 降序
|
|
894
|
-
* @param node
|
|
894
|
+
* @param node 节点
|
|
895
895
|
* @returns 无返回值
|
|
896
896
|
*/
|
|
897
897
|
static sortCoordinateTree(t) {
|
|
@@ -917,41 +917,41 @@ class m {
|
|
|
917
917
|
}
|
|
918
918
|
class A {
|
|
919
919
|
id = 0;
|
|
920
|
-
|
|
920
|
+
/** id */
|
|
921
921
|
type = 0;
|
|
922
|
-
|
|
922
|
+
/** 0空间,1模型 */
|
|
923
923
|
children = [];
|
|
924
|
-
|
|
924
|
+
/** 子节点 */
|
|
925
925
|
level;
|
|
926
|
-
|
|
926
|
+
/** 空间的层级 */
|
|
927
927
|
relativeMap;
|
|
928
|
-
|
|
928
|
+
/** 相对位置关系 */
|
|
929
929
|
no;
|
|
930
|
-
|
|
930
|
+
/** 坐标系编号 */
|
|
931
931
|
name;
|
|
932
|
-
|
|
932
|
+
/** 名称 */
|
|
933
933
|
shortName;
|
|
934
|
-
|
|
934
|
+
/** 简称 */
|
|
935
935
|
status;
|
|
936
|
-
|
|
936
|
+
/** 使用状态 */
|
|
937
937
|
modelId;
|
|
938
|
-
|
|
938
|
+
/** 模型ID */
|
|
939
939
|
modelType;
|
|
940
|
-
|
|
940
|
+
/** 模型的类型 */
|
|
941
941
|
modelValue;
|
|
942
|
-
|
|
942
|
+
/** 模型value */
|
|
943
943
|
projectId;
|
|
944
|
-
|
|
944
|
+
/** 项目id */
|
|
945
945
|
parentId;
|
|
946
|
-
|
|
946
|
+
/** 父节点id */
|
|
947
947
|
parent;
|
|
948
|
-
|
|
948
|
+
/** 父节点 */
|
|
949
949
|
groupUuid;
|
|
950
|
-
|
|
950
|
+
/** 分组uuid */
|
|
951
951
|
z;
|
|
952
|
-
|
|
952
|
+
/** 坐标系高度 */
|
|
953
953
|
createTime;
|
|
954
|
-
|
|
954
|
+
/** 创建时间 */
|
|
955
955
|
disabled;
|
|
956
956
|
constructor(t) {
|
|
957
957
|
this.setOptions(t);
|
|
@@ -966,17 +966,17 @@ class A {
|
|
|
966
966
|
const t = this.name ? `(${this.name})` : "";
|
|
967
967
|
return this.shortName ? `${this.shortName}${t}` : this.name ?? "";
|
|
968
968
|
}
|
|
969
|
-
|
|
969
|
+
/** 设置参数 */
|
|
970
970
|
setOptions(t) {
|
|
971
971
|
const { relativeMap: e, parent: i, children: n, ...o } = t || {};
|
|
972
972
|
e && (this.relativeMap = new p(e)), i && (this.parent = i), n?.length && (this.children = n), Object.assign(this, o);
|
|
973
973
|
}
|
|
974
|
-
|
|
974
|
+
/** 添加子节点 */
|
|
975
975
|
async addChild(t) {
|
|
976
976
|
const e = x(t) ? t : [t], i = await m.addCoordinate(this, e);
|
|
977
977
|
return this.mergeChild(i), i;
|
|
978
978
|
}
|
|
979
|
-
|
|
979
|
+
/** 删除子节点 */
|
|
980
980
|
async removeChild(t) {
|
|
981
981
|
const e = x(t) ? t : [t];
|
|
982
982
|
await m.removeCoordinate(this, e);
|
|
@@ -985,17 +985,17 @@ class A {
|
|
|
985
985
|
n !== -1 && this.children.splice(n, 1);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
|
|
988
|
+
/** 更新子节点 */
|
|
989
989
|
async updateChild(t) {
|
|
990
990
|
const e = x(t) ? t : [t], i = await m.updateCoordinate(this, e);
|
|
991
991
|
return this.mergeChild(i), i;
|
|
992
992
|
}
|
|
993
|
-
|
|
993
|
+
/** 绑定子节点,不建立映射关系 */
|
|
994
994
|
async bindChild(t) {
|
|
995
995
|
const e = x(t) ? t : [t], i = await m.bindCoordinate(this, e);
|
|
996
996
|
return this.mergeChild(i), i;
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
/** 合并子节点,没有查询到节点就插入 */
|
|
999
999
|
async mergeChild(t) {
|
|
1000
1000
|
t?.length && t.forEach((e) => {
|
|
1001
1001
|
const i = this.children.find((n) => n.id === e.id);
|
|
@@ -1013,11 +1013,11 @@ class A {
|
|
|
1013
1013
|
} else this.id === e.parentId && (e.parent = this, this.children.unshift(e));
|
|
1014
1014
|
});
|
|
1015
1015
|
}
|
|
1016
|
-
|
|
1016
|
+
/** 映射到(模型映射到空间,空间映射到空间) */
|
|
1017
1017
|
async mappingTo(t) {
|
|
1018
1018
|
await _(t);
|
|
1019
1019
|
}
|
|
1020
|
-
|
|
1020
|
+
/** 来自映射(被映射过的源坐标系关系) */
|
|
1021
1021
|
async fromMapping() {
|
|
1022
1022
|
const t = await Z({ srcCsId: this.id });
|
|
1023
1023
|
return t[t.length - 1];
|
|
@@ -1045,7 +1045,7 @@ class A {
|
|
|
1045
1045
|
/**
|
|
1046
1046
|
* 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
|
|
1047
1047
|
* @param type 允许的模型类型
|
|
1048
|
-
* @param excludeNodes
|
|
1048
|
+
* @param excludeNodes 排除的坐标系
|
|
1049
1049
|
* @returns
|
|
1050
1050
|
*/
|
|
1051
1051
|
findClosestModel(t = E.CADModel, e) {
|
|
@@ -1101,14 +1101,14 @@ class A {
|
|
|
1101
1101
|
i.type === v.Space && (e.unshift(i.fullName), t--), i = i.parent;
|
|
1102
1102
|
return e;
|
|
1103
1103
|
}
|
|
1104
|
-
|
|
1104
|
+
/** 寻找坐标系组, 有groupUuid表示坐标系组 */
|
|
1105
1105
|
findCsGroup() {
|
|
1106
1106
|
const { groupUuid: t, parent: e } = this;
|
|
1107
1107
|
return t ? e?.children?.filter((i) => i.groupUuid === t) || [] : [this];
|
|
1108
1108
|
}
|
|
1109
1109
|
/**
|
|
1110
1110
|
* 递归寻找到相应的层级
|
|
1111
|
-
* @param level
|
|
1111
|
+
* @param level 坐标系的层级
|
|
1112
1112
|
* @returns
|
|
1113
1113
|
*/
|
|
1114
1114
|
findCsByLevel(t) {
|
|
@@ -1235,11 +1235,11 @@ class A {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
class K {
|
|
1237
1237
|
yaw = 0;
|
|
1238
|
-
|
|
1238
|
+
/** 偏航角 */
|
|
1239
1239
|
pitch = 0;
|
|
1240
|
-
|
|
1240
|
+
/** 俯仰角 */
|
|
1241
1241
|
roll = 0;
|
|
1242
|
-
|
|
1242
|
+
/** 横滚角 */
|
|
1243
1243
|
constructor(t) {
|
|
1244
1244
|
const { yaw: e = 0, pitch: i = 0, roll: n = 0 } = t || {};
|
|
1245
1245
|
this.yaw = Number(e) || 0, this.pitch = Number(i) || 0, this.roll = Number(n) || 0;
|
|
@@ -1256,11 +1256,11 @@ class K {
|
|
|
1256
1256
|
}
|
|
1257
1257
|
class tt {
|
|
1258
1258
|
x = 0;
|
|
1259
|
-
|
|
1259
|
+
/** x轴 */
|
|
1260
1260
|
y = 0;
|
|
1261
|
-
|
|
1261
|
+
/** y轴 */
|
|
1262
1262
|
z = 0;
|
|
1263
|
-
|
|
1263
|
+
/** z轴 */
|
|
1264
1264
|
constructor(t) {
|
|
1265
1265
|
const { x: e = 0, y: i = 0, z: n = 0 } = t || {};
|
|
1266
1266
|
this.x = Number(e) || 0, this.y = Number(i) || 0, this.z = Number(n) || 0;
|