@jnrs/lingshu-smart 2.2.33 → 2.2.35
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/AGENTS.md +60 -4
- package/README.md +141 -0
- package/dist/components/debug/DataLogPanel.vue.d.ts +44 -0
- package/dist/components/debug/DebugPanel.vue.d.ts +61 -0
- package/dist/components/debug/PerformanceStats.vue.d.ts +42 -0
- package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +39 -0
- package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +50 -0
- package/dist/components/debug/ScriptRunner/index.vue.d.ts +16 -0
- package/dist/components/debug/ScriptRunner/script.d.ts +100 -0
- package/dist/components/debug/WsProxy/ConfigEditor.vue.d.ts +18 -0
- package/dist/components/debug/WsProxy/ConnPanel.vue.d.ts +24 -0
- package/dist/components/debug/WsProxy/WsProxyPage.vue.d.ts +14 -0
- package/dist/components/debug/WsProxy/broadcast.d.ts +31 -0
- package/dist/components/debug/WsProxy/index.vue.d.ts +39 -0
- package/dist/components/debug/WsProxy/proxy.d.ts +159 -0
- package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +100 -100
- package/dist/components/editor/DrawingBoard.vue.d.ts +3 -1
- package/dist/components/editor/OptionCard/Equipment/models/PartConfig.vue.d.ts +2 -0
- package/dist/components/editor/index.vue.d.ts +3 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +31930 -2056
- package/dist/components/preview/index.vue.d.ts +1859 -3
- package/dist/composables/useDebugEasterEgg.d.ts +2 -0
- package/dist/controller/AppController.d.ts +11 -0
- package/dist/controller/EditorController.d.ts +1 -1
- package/dist/index.js +153 -17
- package/dist/lingshu-smart/wsProxyConfig.json +495 -0
- package/dist/locales/en.d.ts +45 -0
- package/dist/locales/i18next.d.ts +102 -1
- package/dist/locales/index.js +94 -4
- package/dist/locales/zhCn.d.ts +45 -0
- package/dist/playground/ViewPageDemo.vue.d.ts +3802 -6
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/useAppStore.d.ts +5565 -3
- package/dist/stores/useDataStore.d.ts +5565 -3
- package/dist/stores/useDebugStore.d.ts +485 -0
- package/dist/stores/useEditorStore.d.ts +5 -2
- package/dist/types/app.types.d.ts +3 -0
- package/dist/types/components/config.types.d.ts +1 -0
- package/dist/types/components/operating.types.d.ts +1 -0
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/guards.d.ts +1 -0
- package/dist/types/models/config.types.d.ts +9 -1
- package/dist/types/models/operating.types.d.ts +21 -1
- package/dist/ui/abstract/BaseAbs.d.ts +23 -0
- package/dist/ui/abstract/ComponentAbs.d.ts +3 -15
- package/dist/ui/abstract/ModelAbs.d.ts +17 -17
- package/dist/ui/components/Light.d.ts +5 -0
- package/dist/ui/components/StationSlot.d.ts +7 -2
- package/dist/ui/components/StationSlotGroup.d.ts +5 -0
- package/dist/ui/models/CleaningMachine.d.ts +2 -0
- package/dist/ui/models/DoubleJointRobot.d.ts +2 -0
- package/dist/ui/models/LoadingStation.d.ts +2 -0
- package/dist/ui/models/MachineTool.d.ts +2 -0
- package/dist/ui/models/MarkingMachine.d.ts +2 -0
- package/dist/ui/models/ResourceStore.d.ts +7 -0
- package/dist/ui/models/Rgv.d.ts +2 -0
- package/dist/ui/models/ShuttleStation.d.ts +21 -0
- package/dist/ui/models/SingleJointRobot.d.ts +2 -0
- package/dist/utils/debug-flags.d.ts +9 -0
- package/dist/utils/formatOperating.d.ts +7 -0
- package/dist/utils/index.d.ts +19 -15
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/performance-stats.d.ts +38 -0
- package/package.json +5 -3
- package/dist/index-g6O0IWAC.js +0 -24879
- package/dist/playground/mockWebSocketData.d.ts +0 -23
- /package/dist/{json → lingshu-smart}/cases.json +0 -0
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { IComponent, IComponentOperating } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
export declare abstract class ComponentAbs<T extends IComponent = IComponent> {
|
|
4
|
-
|
|
5
|
-
private _config;
|
|
6
|
-
private _initialized;
|
|
7
|
-
constructor(options: T);
|
|
8
|
-
get ui(): UI<import('leafer').IUIInputData>;
|
|
9
|
-
get config(): T;
|
|
10
|
-
protected get width_05(): number;
|
|
11
|
-
protected get height_05(): number;
|
|
12
|
-
protected abstract createUi(): UI;
|
|
13
|
-
protected operating(data: IComponentOperating): void;
|
|
14
|
-
init(): this;
|
|
2
|
+
import { BaseAbs } from './BaseAbs';
|
|
3
|
+
export declare abstract class ComponentAbs<T extends IComponent = IComponent> extends BaseAbs<T> {
|
|
4
|
+
protected operating(_data: IComponentOperating): void;
|
|
15
5
|
handleOperation: (data: IComponentOperating) => void;
|
|
16
|
-
destroyUI(): void;
|
|
17
|
-
destroy(): void;
|
|
18
6
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { ILayer, IEventHandler, ILayerOperating } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
private _config;
|
|
2
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
3
|
+
import { BaseAbs } from './BaseAbs';
|
|
4
|
+
export declare abstract class ModelAbs<T extends ILayer = ILayer> extends BaseAbs<T> {
|
|
6
5
|
private eventHandler;
|
|
7
|
-
private _initialized;
|
|
8
|
-
constructor(options: T);
|
|
9
|
-
get ui(): UI<import('leafer').IUIInputData>;
|
|
10
|
-
get config(): T;
|
|
11
|
-
protected get width_05(): number;
|
|
12
|
-
protected get width_02(): number;
|
|
13
|
-
protected get width_08(): number;
|
|
14
|
-
protected get height_05(): number;
|
|
15
|
-
protected get height_02(): number;
|
|
16
|
-
protected get height_08(): number;
|
|
17
|
-
protected abstract createUi(): UI;
|
|
18
6
|
protected abstract operating(data: ILayerOperating): void;
|
|
19
|
-
init(): this;
|
|
20
7
|
handleOperation: (data: ILayerOperating) => void;
|
|
21
8
|
private shouldHandleInteraction;
|
|
22
9
|
private tapCallback;
|
|
23
10
|
private menuTapCallback;
|
|
24
11
|
private dragCallback;
|
|
25
12
|
setEventHandler(handler: IEventHandler): void;
|
|
13
|
+
/**
|
|
14
|
+
* 判断模型是否包含指定工位号
|
|
15
|
+
* 默认返回 false,由支持工位号的子类(如 ResourceStore)覆盖
|
|
16
|
+
*/
|
|
17
|
+
containsStationIndex(_index: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 收集模型下所有工位槽组实例(子类覆盖;默认无)
|
|
20
|
+
*/
|
|
21
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
22
|
+
/**
|
|
23
|
+
* 按 resourceId 移除模型下匹配的资源(供全局批量移除调用)
|
|
24
|
+
* @returns 是否至少移除了一个资源
|
|
25
|
+
*/
|
|
26
|
+
removeResourceById(resourceId: string): boolean;
|
|
26
27
|
destroyUI(): void;
|
|
27
|
-
destroy(): void;
|
|
28
28
|
}
|
|
@@ -10,6 +10,9 @@ export interface IRectLightOperating extends Omit<ILightOperating, 'rotating'> {
|
|
|
10
10
|
* 圆形灯
|
|
11
11
|
*/
|
|
12
12
|
export declare class EllipseLight extends ComponentAbs<IEllipseLight> {
|
|
13
|
+
private lastColor?;
|
|
14
|
+
private lastBlinking?;
|
|
15
|
+
private lastRotating?;
|
|
13
16
|
constructor(options: IEllipseLight);
|
|
14
17
|
protected createUi(): Box;
|
|
15
18
|
operating(val: ILightOperating): void;
|
|
@@ -18,6 +21,8 @@ export declare class EllipseLight extends ComponentAbs<IEllipseLight> {
|
|
|
18
21
|
* 矩形灯
|
|
19
22
|
*/
|
|
20
23
|
export declare class RectLight extends ComponentAbs<ILightConfig> {
|
|
24
|
+
private lastColor?;
|
|
25
|
+
private lastBlinking?;
|
|
21
26
|
constructor(options: ILightConfig);
|
|
22
27
|
protected createUi(): Box;
|
|
23
28
|
operating(val: IRectLightOperating): void;
|
|
@@ -3,6 +3,7 @@ import { Box } from 'leafer';
|
|
|
3
3
|
import { ComponentAbs } from '../abstract/ComponentAbs';
|
|
4
4
|
export declare class StationSlot extends ComponentAbs<IStationSlotConfig> {
|
|
5
5
|
private children;
|
|
6
|
+
private pendingDestroy;
|
|
6
7
|
constructor(options: IStationSlotConfig);
|
|
7
8
|
protected createUi(): Box;
|
|
8
9
|
private get autoFixRotation();
|
|
@@ -13,10 +14,14 @@ export declare class StationSlot extends ComponentAbs<IStationSlotConfig> {
|
|
|
13
14
|
*/
|
|
14
15
|
addPallet(d: IResourceOperating): void;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param d
|
|
17
|
+
* 移除托盘:先播放退场动画,动画结束后再销毁资源对象
|
|
18
18
|
*/
|
|
19
19
|
removeAllPallet(d?: IResourceOperating): void;
|
|
20
|
+
/**
|
|
21
|
+
* 按 resourceId 精确移除指定资源(同槽可含多个资源时使用)
|
|
22
|
+
* 仅移除匹配的资源,不影响同槽内其他资源;动画逻辑与 removeAllPallet 一致
|
|
23
|
+
*/
|
|
24
|
+
removePalletById(resourceId: string): boolean;
|
|
20
25
|
/**
|
|
21
26
|
* 设置工位是否正在使用
|
|
22
27
|
* @param flag
|
|
@@ -21,4 +21,9 @@ export declare class StationSlotGroup extends ComponentAbs<IStationSlotGroupConf
|
|
|
21
21
|
* 操作方法:处理资源新增/移除
|
|
22
22
|
*/
|
|
23
23
|
operating(val: IResourceOperating): void;
|
|
24
|
+
/**
|
|
25
|
+
* 按 resourceId 遍历所有工位槽,精确移除匹配的资源
|
|
26
|
+
* @returns 是否至少移除了一个资源
|
|
27
|
+
*/
|
|
28
|
+
removeResourceById(resourceId: string): boolean;
|
|
24
29
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ICleaningMachineConfig, ICleaningMachineOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 清洗机
|
|
6
7
|
*/
|
|
@@ -11,4 +12,5 @@ export declare class CleaningMachine extends ModelAbs<ICleaningMachineConfig> {
|
|
|
11
12
|
private stationSlotGroup;
|
|
12
13
|
protected createUi(): Box;
|
|
13
14
|
protected operating(data: ICleaningMachineOperating): void;
|
|
15
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
14
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IDoubleJointRobotConfig, IDoubleJointRobotOperating, EnumResourceType } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 双关节机器人(DoubleJointRobot)
|
|
6
7
|
*/
|
|
@@ -17,6 +18,7 @@ export declare class DoubleJointRobot extends ModelAbs<IDoubleJointRobotConfig>
|
|
|
17
18
|
set currentFixture(type: EnumResourceType);
|
|
18
19
|
protected createUi(): Box;
|
|
19
20
|
protected operating(data: IDoubleJointRobotOperating): void;
|
|
21
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
20
22
|
private handleRotateR1;
|
|
21
23
|
private handleRotateR2;
|
|
22
24
|
private moveX;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ILoadingStationConfig, ILoadingStationOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 装载站(LoadingStation)
|
|
6
7
|
*/
|
|
@@ -13,4 +14,5 @@ export declare class LoadingStation extends ModelAbs<ILoadingStationConfig> {
|
|
|
13
14
|
private stationSlotGroup;
|
|
14
15
|
protected createUi(): Box;
|
|
15
16
|
protected operating(data: ILoadingStationOperating): void;
|
|
17
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
16
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IMachineToolConfig, IMachineToolOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 机床
|
|
6
7
|
*/
|
|
@@ -15,5 +16,6 @@ export declare class MachineTool extends ModelAbs<IMachineToolConfig> {
|
|
|
15
16
|
private animating;
|
|
16
17
|
protected createUi(): Box;
|
|
17
18
|
protected operating(data: IMachineToolOperating): void;
|
|
19
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
18
20
|
private rotateStationContainerWithAnimation;
|
|
19
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IMarkingMachineConfig, IMarkingMachineOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 打标机
|
|
6
7
|
*/
|
|
@@ -11,6 +12,7 @@ export declare class MarkingMachine extends ModelAbs<IMarkingMachineConfig> {
|
|
|
11
12
|
private stationSlotGroup;
|
|
12
13
|
protected createUi(): Box;
|
|
13
14
|
protected operating(data: IMarkingMachineOperating): void;
|
|
15
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
14
16
|
private renderLaser;
|
|
15
17
|
private setLaserWorking;
|
|
16
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IResourceStoreConfig, IResourceStoreOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 资源库
|
|
6
7
|
*/
|
|
@@ -10,6 +11,12 @@ export declare class ResourceStore extends ModelAbs<IResourceStoreConfig> {
|
|
|
10
11
|
private stationSlotGroupPallet;
|
|
11
12
|
private stationSlotGroupTool;
|
|
12
13
|
protected createUi(): Box;
|
|
14
|
+
/**
|
|
15
|
+
* 判断本资源库是否包含指定工位号
|
|
16
|
+
* 用于同一 id 的 ResourceStore 被拆分为多个 UI 时的三级匹配
|
|
17
|
+
*/
|
|
18
|
+
containsStationIndex(index: number): boolean;
|
|
13
19
|
private moveX;
|
|
14
20
|
protected operating(data: IResourceStoreOperating): void;
|
|
21
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
15
22
|
}
|
package/dist/ui/models/Rgv.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IRGVConfig, IRGVOperating } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* RGV(轨道导引车)
|
|
6
7
|
*/
|
|
@@ -15,6 +16,7 @@ export declare class Rgv extends ModelAbs<IRGVConfig> {
|
|
|
15
16
|
private stationSlotGroupTool;
|
|
16
17
|
protected createUi(): Box;
|
|
17
18
|
protected operating(data: IRGVOperating): void;
|
|
19
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
18
20
|
private handleRotate;
|
|
19
21
|
private moveX;
|
|
20
22
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IShuttleStationConfig, IShuttleStationOperating } from '../../types';
|
|
2
|
+
import { Box } from 'leafer';
|
|
3
|
+
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
/**
|
|
5
|
+
* 接驳站(ShuttleStation)
|
|
6
|
+
* 整体为 U 型结构,通过单个 Path 元素一体化绘制,内部透明;
|
|
7
|
+
* U 型下方底部区域较宽大,用于放置铭牌与长条状态灯;
|
|
8
|
+
* 该模型仅支持 light 运转状态
|
|
9
|
+
*/
|
|
10
|
+
export declare class ShuttleStation extends ModelAbs<IShuttleStationConfig> {
|
|
11
|
+
private static readonly WALL_THICKNESS;
|
|
12
|
+
private static readonly BASE_HEIGHT;
|
|
13
|
+
private static readonly BOTTOM_RADIUS;
|
|
14
|
+
private static readonly LIGHT_Y_OFFSET;
|
|
15
|
+
private static readonly NAME_PLATE_Y_OFFSET;
|
|
16
|
+
private light;
|
|
17
|
+
private buildUPath;
|
|
18
|
+
private buildOutlinePath;
|
|
19
|
+
protected createUi(): Box;
|
|
20
|
+
protected operating(data: IShuttleStationOperating): void;
|
|
21
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ISingleJointRobotConfig, ISingleJointRobotOperating, EnumResourceType } from '../../types';
|
|
2
2
|
import { Box } from 'leafer';
|
|
3
3
|
import { ModelAbs } from '../abstract/ModelAbs';
|
|
4
|
+
import { StationSlotGroup } from '../components/StationSlotGroup';
|
|
4
5
|
/**
|
|
5
6
|
* 单关节机器人
|
|
6
7
|
*/
|
|
@@ -17,6 +18,7 @@ export declare class SingleJointRobot extends ModelAbs<ISingleJointRobotConfig>
|
|
|
17
18
|
set currentFixture(type: EnumResourceType);
|
|
18
19
|
protected createUi(): Box;
|
|
19
20
|
protected operating(data: ISingleJointRobotOperating): void;
|
|
21
|
+
protected collectStationSlotGroups(): StationSlotGroup[];
|
|
20
22
|
private handleRotate;
|
|
21
23
|
private moveX;
|
|
22
24
|
private switchFork;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @File : debug-flags.ts
|
|
3
|
+
* @Desc. : 调试标志位工具,提供模块级动画开关状态
|
|
4
|
+
* 供 UI 组件直接导入使用,无需依赖 Pinia store
|
|
5
|
+
*/
|
|
6
|
+
/** 设置全局动画开关状态 */
|
|
7
|
+
export declare function setAnimationsEnabled(enabled: boolean): void;
|
|
8
|
+
/** 获取当前动画开关状态 */
|
|
9
|
+
export declare function isAnimationsEnabled(): boolean;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* @WeChat : Tan578853789
|
|
4
|
-
* @File : index.ts
|
|
5
|
-
* @Date : 2025/04/29
|
|
6
|
-
* @Desc. : 工具类
|
|
7
|
-
*/
|
|
1
|
+
import { IScene } from '../types';
|
|
2
|
+
export * from './logger';
|
|
8
3
|
/**
|
|
9
4
|
* 数字生成器
|
|
10
5
|
* @param {*} start 起始值
|
|
@@ -18,11 +13,11 @@ export declare function numberLoopGenerator(start: number, end: number, shouldLo
|
|
|
18
13
|
* @param {*} x 初始值
|
|
19
14
|
* @param {*} y 结束值
|
|
20
15
|
* @param {*} n 递增时长
|
|
21
|
-
* @param {*} rate 帧率(别低于100否则进度条动画来不及显示)
|
|
16
|
+
* @param {*} rate 帧率(别低于100否则进度条动画来不及显示),仅作为兼容参数保留,实际使用 rAF
|
|
22
17
|
* @param {*} callback 回调函数
|
|
23
18
|
* @returns
|
|
24
19
|
*/
|
|
25
|
-
export declare const linearIncrease: (x: number | undefined, y: number | undefined, n: number | undefined,
|
|
20
|
+
export declare const linearIncrease: (x: number | undefined, y: number | undefined, n: number | undefined, _rate: number | undefined, callback: (val: number | string) => void) => false | Promise<void>;
|
|
26
21
|
/**
|
|
27
22
|
* 根据百分比数字转换为像素,或者根据像素转换为百分比
|
|
28
23
|
* @param {number} val - 百分比数字(范围 0 ~ 1),或者像素数字
|
|
@@ -33,12 +28,21 @@ export declare const linearIncrease: (x: number | undefined, y: number | undefin
|
|
|
33
28
|
*/
|
|
34
29
|
export declare function transPercentAndPixel(val?: number, size?: number, precision?: number, getPercent?: boolean): number;
|
|
35
30
|
export declare function transFraction(val?: number, size?: number): number;
|
|
36
|
-
|
|
31
|
+
/**
|
|
32
|
+
* 将运行时百分比数值转换为像素数值
|
|
33
|
+
* @param val - 运行时百分比数值(范围 [0,1])
|
|
34
|
+
* @param scene - 场景配置,用于计算转换比例
|
|
35
|
+
* @param precision - 保留的小数位数
|
|
36
|
+
* @param type - 转换类型,'width' 或 'height'
|
|
37
|
+
* @returns 转换后的像素值
|
|
38
|
+
*/
|
|
39
|
+
export declare function transRuntimeToPixel(val: number, scene: IScene | null | undefined, precision: number, type: 'width' | 'height'): number;
|
|
37
40
|
/**
|
|
38
41
|
* 百分比转换为像素数值
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @
|
|
42
|
+
* @param percent - 百分比数字(范围 [0,1])
|
|
43
|
+
* @param scene - 场景配置,用于计算转换比例
|
|
44
|
+
* @param precision - 保留的小数位数
|
|
45
|
+
* @param type - 转换类型,'width' 或 'height'
|
|
46
|
+
* @returns 转换后的像素值
|
|
43
47
|
*/
|
|
44
|
-
export declare function transPercentToPixel(percent: number, precision
|
|
48
|
+
export declare function transPercentToPixel(percent: number, scene: IScene | null | undefined, precision: number, type: 'width' | 'height'): number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @File : logger.ts
|
|
3
|
+
* @Desc. : 统一日志工具,按环境控制输出,支持 tag 着色 / LogLevel 过滤
|
|
4
|
+
*/
|
|
5
|
+
/** 日志方法类型(对应 console 方法,operating 为自定义追踪级别) */
|
|
6
|
+
type LogMethod = 'log' | 'info' | 'warn' | 'error' | 'operating';
|
|
7
|
+
/** 日志显示等级,none 表示全部静默,operating 为最详细级别(含 UI 模型操作追踪),operating-only 仅显示 operating + error */
|
|
8
|
+
export type LogLevel = LogMethod | 'none' | 'operating-only';
|
|
9
|
+
/** 设置全局日志显示等级 */
|
|
10
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
11
|
+
/** 获取当前日志显示等级 */
|
|
12
|
+
export declare function getLogLevel(): LogLevel;
|
|
13
|
+
export interface Logger {
|
|
14
|
+
log: (...args: unknown[]) => void;
|
|
15
|
+
info: (...args: unknown[]) => void;
|
|
16
|
+
warn: (...args: unknown[]) => void;
|
|
17
|
+
error: (...args: unknown[]) => void;
|
|
18
|
+
operating: (...args: unknown[]) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createLogger(tag?: string): Logger;
|
|
21
|
+
export declare const logger: Logger;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @File : performance-stats.ts
|
|
3
|
+
* @Desc. : 性能统计工具,记录页面运行时间、WebSocket 数据接收量、FPS 和连接状态
|
|
4
|
+
* 统计节点从页面刷新(模块加载)开始
|
|
5
|
+
*/
|
|
6
|
+
/** 性能统计数据 */
|
|
7
|
+
interface PerformanceStats {
|
|
8
|
+
/** 会话开始时间戳 */
|
|
9
|
+
sessionStart: number;
|
|
10
|
+
/** WebSocket 消息接收次数 */
|
|
11
|
+
wsCount: number;
|
|
12
|
+
/** WebSocket 消息接收总字节数 */
|
|
13
|
+
wsSize: number;
|
|
14
|
+
/** 当前帧率 (FPS) */
|
|
15
|
+
fps: number;
|
|
16
|
+
/** WebSocket 是否已连接 */
|
|
17
|
+
wsConnected: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const performanceStats: PerformanceStats;
|
|
20
|
+
/** 设置 WebSocket 连接状态 */
|
|
21
|
+
export declare function setWebSocketConnected(connected: boolean): void;
|
|
22
|
+
/** 启动 FPS 监测(全局只启动一次) */
|
|
23
|
+
export declare function startPerformanceMonitor(): void;
|
|
24
|
+
/** 停止 FPS 监测 */
|
|
25
|
+
export declare function stopPerformanceMonitor(): void;
|
|
26
|
+
/** 记录一次 WebSocket 消息接收 */
|
|
27
|
+
export declare function trackWebSocketMessage(data: unknown): void;
|
|
28
|
+
/** 获取会话持续运行时长(毫秒) */
|
|
29
|
+
export declare function getSessionDuration(): number;
|
|
30
|
+
/** 格式化时长,超过 24 小时时显示天数,如 "1天 23:03:22" */
|
|
31
|
+
export declare function formatDuration(ms: number): string;
|
|
32
|
+
/** 格式化数字,添加千位分隔符 */
|
|
33
|
+
export declare function formatCount(n: number): string;
|
|
34
|
+
/** 格式化字节大小 */
|
|
35
|
+
export declare function formatSize(bytes: number): string;
|
|
36
|
+
/** 格式化时间戳为本地时间字符串 */
|
|
37
|
+
export declare function formatStartTime(ts: number): string;
|
|
38
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jnrs/lingshu-smart",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.35",
|
|
4
4
|
"description": "LingShu Smart 2D Digital Twin System.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jnrs",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|
|
19
19
|
"types": "dist/index.d.ts",
|
|
20
|
-
"sideEffects":
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"./dist/components/index.js"
|
|
22
|
+
],
|
|
21
23
|
"files": [
|
|
22
24
|
"dist",
|
|
23
25
|
"README.md",
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
47
49
|
"vue": "^3.5.22",
|
|
48
50
|
"vue-i18n": "^9.14.5",
|
|
49
|
-
"@jnrs/shared": "1.1.
|
|
51
|
+
"@jnrs/shared": "1.1.36"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
54
|
"@types/lodash-es": "^4.17.12",
|